@fictjs/runtime 0.0.13 → 0.0.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.
- package/dist/advanced.cjs +79 -0
- package/dist/advanced.cjs.map +1 -0
- package/dist/advanced.d.cts +50 -0
- package/dist/advanced.d.ts +50 -0
- package/dist/advanced.js +79 -0
- package/dist/advanced.js.map +1 -0
- package/dist/chunk-624QY53A.cjs +45 -0
- package/dist/chunk-624QY53A.cjs.map +1 -0
- package/dist/chunk-F3AIYQB7.js +45 -0
- package/dist/chunk-F3AIYQB7.js.map +1 -0
- package/dist/chunk-GJTYOFMO.cjs +109 -0
- package/dist/chunk-GJTYOFMO.cjs.map +1 -0
- package/dist/chunk-IUZXKAAY.js +109 -0
- package/dist/chunk-IUZXKAAY.js.map +1 -0
- package/dist/chunk-PMF6MWEV.cjs +3301 -0
- package/dist/chunk-PMF6MWEV.cjs.map +1 -0
- package/dist/chunk-RY4WDS6R.js +3301 -0
- package/dist/chunk-RY4WDS6R.js.map +1 -0
- package/dist/context-B7UYnfzM.d.ts +153 -0
- package/dist/context-UXySaqI_.d.cts +153 -0
- package/dist/effect-Auji1rz9.d.cts +350 -0
- package/dist/effect-Auji1rz9.d.ts +350 -0
- package/dist/index.cjs +98 -3558
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1358
- package/dist/index.d.ts +5 -1358
- package/dist/index.dev.js +240 -1698
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +63 -3435
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +901 -0
- package/dist/internal.cjs.map +1 -0
- package/dist/internal.d.cts +158 -0
- package/dist/internal.d.ts +158 -0
- package/dist/internal.js +901 -0
- package/dist/internal.js.map +1 -0
- package/dist/{jsx-dev-runtime.d.ts → props-CrOMYbLv.d.cts} +107 -18
- package/dist/{jsx-dev-runtime.d.cts → props-ES0Ag_Wd.d.ts} +107 -18
- package/dist/scope-DKYzWfTn.d.cts +55 -0
- package/dist/scope-S6eAzBJZ.d.ts +55 -0
- package/package.json +11 -1
- package/src/advanced.ts +101 -0
- package/src/constants.ts +3 -26
- package/src/context.ts +300 -0
- package/src/delegated-events.ts +24 -0
- package/src/index.ts +41 -112
- package/src/internal.ts +130 -0
- package/src/props.ts +48 -46
- package/src/store.ts +47 -7
- package/src/versioned-signal.ts +3 -3
- package/dist/jsx-runtime.d.cts +0 -671
- package/dist/jsx-runtime.d.ts +0 -671
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkGJTYOFMOcjs = require('./chunk-GJTYOFMO.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunk624QY53Acjs = require('./chunk-624QY53A.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
var _chunkPMF6MWEVcjs = require('./chunk-PMF6MWEV.cjs');
|
|
27
|
+
|
|
28
|
+
// src/versioned-signal.ts
|
|
29
|
+
function createVersionedSignal(initialValue, options) {
|
|
30
|
+
const equals = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.equals]), () => ( Object.is));
|
|
31
|
+
const value = _chunkPMF6MWEVcjs.signal.call(void 0, initialValue);
|
|
32
|
+
const version = _chunkPMF6MWEVcjs.signal.call(void 0, 0);
|
|
33
|
+
const bumpVersion = () => {
|
|
34
|
+
const next = version() + 1;
|
|
35
|
+
version(next);
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
read: () => {
|
|
39
|
+
version();
|
|
40
|
+
return value();
|
|
41
|
+
},
|
|
42
|
+
write: (next) => {
|
|
43
|
+
const prev = value();
|
|
44
|
+
if (!equals(prev, next)) {
|
|
45
|
+
value(next);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
bumpVersion();
|
|
49
|
+
},
|
|
50
|
+
force: () => {
|
|
51
|
+
bumpVersion();
|
|
52
|
+
},
|
|
53
|
+
peekVersion: () => _chunkPMF6MWEVcjs.untrack.call(void 0, () => version()),
|
|
54
|
+
peekValue: () => _chunkPMF6MWEVcjs.untrack.call(void 0, () => value())
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
exports.createAttributeBinding = _chunkPMF6MWEVcjs.createAttributeBinding; exports.createChildBinding = _chunkPMF6MWEVcjs.createChildBinding; exports.createClassBinding = _chunkPMF6MWEVcjs.createClassBinding; exports.createContext = _chunkGJTYOFMOcjs.createContext; exports.createRenderEffect = _chunkPMF6MWEVcjs.createRenderEffect; exports.createScope = _chunk624QY53Acjs.createScope; exports.createSelector = _chunkPMF6MWEVcjs.createSelector; exports.createShow = _chunkPMF6MWEVcjs.createShow; exports.createSignal = _chunkPMF6MWEVcjs.signal; exports.createStyleBinding = _chunkPMF6MWEVcjs.createStyleBinding; exports.createTextBinding = _chunkPMF6MWEVcjs.createTextBinding; exports.createVersionedSignal = createVersionedSignal; exports.effectScope = _chunkPMF6MWEVcjs.effectScope; exports.getDevtoolsHook = _chunkPMF6MWEVcjs.getDevtoolsHook; exports.hasContext = _chunkGJTYOFMOcjs.hasContext; exports.isReactive = _chunkPMF6MWEVcjs.isReactive; exports.runInScope = _chunk624QY53Acjs.runInScope; exports.setCycleProtectionOptions = _chunkPMF6MWEVcjs.setCycleProtectionOptions; exports.unwrap = _chunkPMF6MWEVcjs.unwrap; exports.useContext = _chunkGJTYOFMOcjs.useContext;
|
|
79
|
+
//# sourceMappingURL=advanced.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/fict/fict/packages/runtime/dist/advanced.cjs","../src/versioned-signal.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACHO,SAAS,qBAAA,CACd,YAAA,EACA,OAAA,EACoB;AACpB,EAAA,MAAM,OAAA,mCAAS,OAAA,2BAAS,QAAA,UAAU,MAAA,CAAO,IAAA;AACzC,EAAA,MAAM,MAAA,EAAQ,sCAAA,YAAyB,CAAA;AACvC,EAAA,MAAM,QAAA,EAAU,sCAAA,CAAc,CAAA;AAE9B,EAAA,MAAM,YAAA,EAAc,CAAA,EAAA,GAAM;AACxB,IAAA,MAAM,KAAA,EAAO,OAAA,CAAQ,EAAA,EAAI,CAAA;AACzB,IAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,EACd,CAAA;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,CAAA,EAAA,GAAM;AAEV,MAAA,OAAA,CAAQ,CAAA;AACR,MAAA,OAAO,KAAA,CAAM,CAAA;AAAA,IACf,CAAA;AAAA,IACA,KAAA,EAAO,CAAC,IAAA,EAAA,GAAY;AAClB,MAAA,MAAM,KAAA,EAAO,KAAA,CAAM,CAAA;AACnB,MAAA,GAAA,CAAI,CAAC,MAAA,CAAO,IAAA,EAAM,IAAI,CAAA,EAAG;AACvB,QAAA,KAAA,CAAM,IAAI,CAAA;AACV,QAAA,MAAA;AAAA,MACF;AACA,MAAA,WAAA,CAAY,CAAA;AAAA,IACd,CAAA;AAAA,IACA,KAAA,EAAO,CAAA,EAAA,GAAM;AACX,MAAA,WAAA,CAAY,CAAA;AAAA,IACd,CAAA;AAAA,IACA,WAAA,EAAa,CAAA,EAAA,GAAM,uCAAA,CAAQ,EAAA,GAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC1C,SAAA,EAAW,CAAA,EAAA,GAAM,uCAAA,CAAQ,EAAA,GAAM,KAAA,CAAM,CAAC;AAAA,EACxC,CAAA;AACF;ADDA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,qpCAAC","file":"/home/runner/work/fict/fict/packages/runtime/dist/advanced.cjs","sourcesContent":[null,"import { createSignal, untrack } from './signal'\n\nexport interface VersionedSignalOptions<T> {\n equals?: (prev: T, next: T) => boolean\n}\n\nexport interface VersionedSignal<T> {\n /** Reactive read that tracks both the value and version counter */\n read: () => T\n /** Write a new value, forcing a version bump when value is equal */\n write: (next: T) => void\n /** Force a version bump without changing the value */\n force: () => void\n /** Read the current version without creating a dependency */\n peekVersion: () => number\n /** Read the current value without tracking */\n peekValue: () => T\n}\n\n/**\n * Create a signal wrapper that forces subscribers to update when the same reference is written.\n *\n * Useful for compiler-generated keyed list items where updates may reuse the same object reference.\n */\nexport function createVersionedSignal<T>(\n initialValue: T,\n options?: VersionedSignalOptions<T>,\n): VersionedSignal<T> {\n const equals = options?.equals ?? Object.is\n const value = createSignal(initialValue)\n const version = createSignal(0)\n\n const bumpVersion = () => {\n const next = version() + 1\n version(next)\n }\n\n return {\n read: () => {\n // Track both version and value to ensure equal writes notify subscribers\n version()\n return value()\n },\n write: (next: T) => {\n const prev = value()\n if (!equals(prev, next)) {\n value(next)\n return\n }\n bumpVersion()\n },\n force: () => {\n bumpVersion()\n },\n peekVersion: () => untrack(() => version()),\n peekValue: () => untrack(() => value()),\n }\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export { R as ReactiveScope, S as Signal, c as createScope, a as createSelector, s as createSignal, e as effectScope, r as runInScope } from './scope-DKYzWfTn.cjs';
|
|
2
|
+
export { b as createAttributeBinding, a as createChildBinding, e as createClassBinding, g as createRenderEffect, f as createShow, d as createStyleBinding, c as createTextBinding, i as isReactive, u as unwrap } from './effect-Auji1rz9.cjs';
|
|
3
|
+
export { C as Context, P as ProviderProps, c as createContext, h as hasContext, u as useContext } from './context-UXySaqI_.cjs';
|
|
4
|
+
|
|
5
|
+
interface VersionedSignalOptions<T> {
|
|
6
|
+
equals?: (prev: T, next: T) => boolean;
|
|
7
|
+
}
|
|
8
|
+
interface VersionedSignal<T> {
|
|
9
|
+
/** Reactive read that tracks both the value and version counter */
|
|
10
|
+
read: () => T;
|
|
11
|
+
/** Write a new value, forcing a version bump when value is equal */
|
|
12
|
+
write: (next: T) => void;
|
|
13
|
+
/** Force a version bump without changing the value */
|
|
14
|
+
force: () => void;
|
|
15
|
+
/** Read the current version without creating a dependency */
|
|
16
|
+
peekVersion: () => number;
|
|
17
|
+
/** Read the current value without tracking */
|
|
18
|
+
peekValue: () => T;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a signal wrapper that forces subscribers to update when the same reference is written.
|
|
22
|
+
*
|
|
23
|
+
* Useful for compiler-generated keyed list items where updates may reuse the same object reference.
|
|
24
|
+
*/
|
|
25
|
+
declare function createVersionedSignal<T>(initialValue: T, options?: VersionedSignalOptions<T>): VersionedSignal<T>;
|
|
26
|
+
|
|
27
|
+
interface FictDevtoolsHook {
|
|
28
|
+
registerSignal: (id: number, value: unknown) => void;
|
|
29
|
+
updateSignal: (id: number, value: unknown) => void;
|
|
30
|
+
registerEffect: (id: number) => void;
|
|
31
|
+
effectRun: (id: number) => void;
|
|
32
|
+
cycleDetected?: (payload: {
|
|
33
|
+
reason: string;
|
|
34
|
+
detail?: Record<string, unknown>;
|
|
35
|
+
}) => void;
|
|
36
|
+
}
|
|
37
|
+
declare function getDevtoolsHook(): FictDevtoolsHook | undefined;
|
|
38
|
+
|
|
39
|
+
interface CycleProtectionOptions {
|
|
40
|
+
maxFlushCyclesPerMicrotask?: number;
|
|
41
|
+
maxEffectRunsPerFlush?: number;
|
|
42
|
+
windowSize?: number;
|
|
43
|
+
highUsageRatio?: number;
|
|
44
|
+
maxRootReentrantDepth?: number;
|
|
45
|
+
enableWindowWarning?: boolean;
|
|
46
|
+
devMode?: boolean;
|
|
47
|
+
}
|
|
48
|
+
declare let setCycleProtectionOptions: (opts: CycleProtectionOptions) => void;
|
|
49
|
+
|
|
50
|
+
export { type FictDevtoolsHook, type VersionedSignal, type VersionedSignalOptions, createVersionedSignal, getDevtoolsHook, setCycleProtectionOptions };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export { R as ReactiveScope, S as Signal, c as createScope, a as createSelector, s as createSignal, e as effectScope, r as runInScope } from './scope-S6eAzBJZ.js';
|
|
2
|
+
export { b as createAttributeBinding, a as createChildBinding, e as createClassBinding, g as createRenderEffect, f as createShow, d as createStyleBinding, c as createTextBinding, i as isReactive, u as unwrap } from './effect-Auji1rz9.js';
|
|
3
|
+
export { C as Context, P as ProviderProps, c as createContext, h as hasContext, u as useContext } from './context-B7UYnfzM.js';
|
|
4
|
+
|
|
5
|
+
interface VersionedSignalOptions<T> {
|
|
6
|
+
equals?: (prev: T, next: T) => boolean;
|
|
7
|
+
}
|
|
8
|
+
interface VersionedSignal<T> {
|
|
9
|
+
/** Reactive read that tracks both the value and version counter */
|
|
10
|
+
read: () => T;
|
|
11
|
+
/** Write a new value, forcing a version bump when value is equal */
|
|
12
|
+
write: (next: T) => void;
|
|
13
|
+
/** Force a version bump without changing the value */
|
|
14
|
+
force: () => void;
|
|
15
|
+
/** Read the current version without creating a dependency */
|
|
16
|
+
peekVersion: () => number;
|
|
17
|
+
/** Read the current value without tracking */
|
|
18
|
+
peekValue: () => T;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a signal wrapper that forces subscribers to update when the same reference is written.
|
|
22
|
+
*
|
|
23
|
+
* Useful for compiler-generated keyed list items where updates may reuse the same object reference.
|
|
24
|
+
*/
|
|
25
|
+
declare function createVersionedSignal<T>(initialValue: T, options?: VersionedSignalOptions<T>): VersionedSignal<T>;
|
|
26
|
+
|
|
27
|
+
interface FictDevtoolsHook {
|
|
28
|
+
registerSignal: (id: number, value: unknown) => void;
|
|
29
|
+
updateSignal: (id: number, value: unknown) => void;
|
|
30
|
+
registerEffect: (id: number) => void;
|
|
31
|
+
effectRun: (id: number) => void;
|
|
32
|
+
cycleDetected?: (payload: {
|
|
33
|
+
reason: string;
|
|
34
|
+
detail?: Record<string, unknown>;
|
|
35
|
+
}) => void;
|
|
36
|
+
}
|
|
37
|
+
declare function getDevtoolsHook(): FictDevtoolsHook | undefined;
|
|
38
|
+
|
|
39
|
+
interface CycleProtectionOptions {
|
|
40
|
+
maxFlushCyclesPerMicrotask?: number;
|
|
41
|
+
maxEffectRunsPerFlush?: number;
|
|
42
|
+
windowSize?: number;
|
|
43
|
+
highUsageRatio?: number;
|
|
44
|
+
maxRootReentrantDepth?: number;
|
|
45
|
+
enableWindowWarning?: boolean;
|
|
46
|
+
devMode?: boolean;
|
|
47
|
+
}
|
|
48
|
+
declare let setCycleProtectionOptions: (opts: CycleProtectionOptions) => void;
|
|
49
|
+
|
|
50
|
+
export { type FictDevtoolsHook, type VersionedSignal, type VersionedSignalOptions, createVersionedSignal, getDevtoolsHook, setCycleProtectionOptions };
|
package/dist/advanced.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
hasContext,
|
|
4
|
+
useContext
|
|
5
|
+
} from "./chunk-IUZXKAAY.js";
|
|
6
|
+
import {
|
|
7
|
+
createScope,
|
|
8
|
+
runInScope
|
|
9
|
+
} from "./chunk-F3AIYQB7.js";
|
|
10
|
+
import {
|
|
11
|
+
createAttributeBinding,
|
|
12
|
+
createChildBinding,
|
|
13
|
+
createClassBinding,
|
|
14
|
+
createRenderEffect,
|
|
15
|
+
createSelector,
|
|
16
|
+
createShow,
|
|
17
|
+
createStyleBinding,
|
|
18
|
+
createTextBinding,
|
|
19
|
+
effectScope,
|
|
20
|
+
getDevtoolsHook,
|
|
21
|
+
isReactive,
|
|
22
|
+
setCycleProtectionOptions,
|
|
23
|
+
signal,
|
|
24
|
+
untrack,
|
|
25
|
+
unwrap
|
|
26
|
+
} from "./chunk-RY4WDS6R.js";
|
|
27
|
+
|
|
28
|
+
// src/versioned-signal.ts
|
|
29
|
+
function createVersionedSignal(initialValue, options) {
|
|
30
|
+
const equals = options?.equals ?? Object.is;
|
|
31
|
+
const value = signal(initialValue);
|
|
32
|
+
const version = signal(0);
|
|
33
|
+
const bumpVersion = () => {
|
|
34
|
+
const next = version() + 1;
|
|
35
|
+
version(next);
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
read: () => {
|
|
39
|
+
version();
|
|
40
|
+
return value();
|
|
41
|
+
},
|
|
42
|
+
write: (next) => {
|
|
43
|
+
const prev = value();
|
|
44
|
+
if (!equals(prev, next)) {
|
|
45
|
+
value(next);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
bumpVersion();
|
|
49
|
+
},
|
|
50
|
+
force: () => {
|
|
51
|
+
bumpVersion();
|
|
52
|
+
},
|
|
53
|
+
peekVersion: () => untrack(() => version()),
|
|
54
|
+
peekValue: () => untrack(() => value())
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
createAttributeBinding,
|
|
59
|
+
createChildBinding,
|
|
60
|
+
createClassBinding,
|
|
61
|
+
createContext,
|
|
62
|
+
createRenderEffect,
|
|
63
|
+
createScope,
|
|
64
|
+
createSelector,
|
|
65
|
+
createShow,
|
|
66
|
+
signal as createSignal,
|
|
67
|
+
createStyleBinding,
|
|
68
|
+
createTextBinding,
|
|
69
|
+
createVersionedSignal,
|
|
70
|
+
effectScope,
|
|
71
|
+
getDevtoolsHook,
|
|
72
|
+
hasContext,
|
|
73
|
+
isReactive,
|
|
74
|
+
runInScope,
|
|
75
|
+
setCycleProtectionOptions,
|
|
76
|
+
unwrap,
|
|
77
|
+
useContext
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=advanced.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/versioned-signal.ts"],"sourcesContent":["import { createSignal, untrack } from './signal'\n\nexport interface VersionedSignalOptions<T> {\n equals?: (prev: T, next: T) => boolean\n}\n\nexport interface VersionedSignal<T> {\n /** Reactive read that tracks both the value and version counter */\n read: () => T\n /** Write a new value, forcing a version bump when value is equal */\n write: (next: T) => void\n /** Force a version bump without changing the value */\n force: () => void\n /** Read the current version without creating a dependency */\n peekVersion: () => number\n /** Read the current value without tracking */\n peekValue: () => T\n}\n\n/**\n * Create a signal wrapper that forces subscribers to update when the same reference is written.\n *\n * Useful for compiler-generated keyed list items where updates may reuse the same object reference.\n */\nexport function createVersionedSignal<T>(\n initialValue: T,\n options?: VersionedSignalOptions<T>,\n): VersionedSignal<T> {\n const equals = options?.equals ?? Object.is\n const value = createSignal(initialValue)\n const version = createSignal(0)\n\n const bumpVersion = () => {\n const next = version() + 1\n version(next)\n }\n\n return {\n read: () => {\n // Track both version and value to ensure equal writes notify subscribers\n version()\n return value()\n },\n write: (next: T) => {\n const prev = value()\n if (!equals(prev, next)) {\n value(next)\n return\n }\n bumpVersion()\n },\n force: () => {\n bumpVersion()\n },\n peekVersion: () => untrack(() => version()),\n peekValue: () => untrack(() => value()),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,SAAS,sBACd,cACA,SACoB;AACpB,QAAM,SAAS,SAAS,UAAU,OAAO;AACzC,QAAM,QAAQ,OAAa,YAAY;AACvC,QAAM,UAAU,OAAa,CAAC;AAE9B,QAAM,cAAc,MAAM;AACxB,UAAM,OAAO,QAAQ,IAAI;AACzB,YAAQ,IAAI;AAAA,EACd;AAEA,SAAO;AAAA,IACL,MAAM,MAAM;AAEV,cAAQ;AACR,aAAO,MAAM;AAAA,IACf;AAAA,IACA,OAAO,CAAC,SAAY;AAClB,YAAM,OAAO,MAAM;AACnB,UAAI,CAAC,OAAO,MAAM,IAAI,GAAG;AACvB,cAAM,IAAI;AACV;AAAA,MACF;AACA,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,MAAM;AACX,kBAAY;AAAA,IACd;AAAA,IACA,aAAa,MAAM,QAAQ,MAAM,QAAQ,CAAC;AAAA,IAC1C,WAAW,MAAM,QAAQ,MAAM,MAAM,CAAC;AAAA,EACxC;AACF;","names":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkPMF6MWEVcjs = require('./chunk-PMF6MWEV.cjs');
|
|
8
|
+
|
|
9
|
+
// src/scope.ts
|
|
10
|
+
function createScope() {
|
|
11
|
+
let dispose = null;
|
|
12
|
+
const stop = () => {
|
|
13
|
+
if (dispose) {
|
|
14
|
+
dispose();
|
|
15
|
+
dispose = null;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const run = (fn) => {
|
|
19
|
+
stop();
|
|
20
|
+
const { dispose: rootDispose, value } = _chunkPMF6MWEVcjs.createRoot.call(void 0, fn);
|
|
21
|
+
dispose = rootDispose;
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
_chunkPMF6MWEVcjs.registerRootCleanup.call(void 0, stop);
|
|
25
|
+
return { run, stop };
|
|
26
|
+
}
|
|
27
|
+
function runInScope(flag, fn) {
|
|
28
|
+
const scope = createScope();
|
|
29
|
+
const evaluate = () => _chunkPMF6MWEVcjs.isReactive.call(void 0, flag) ? flag() : !!flag;
|
|
30
|
+
_chunkPMF6MWEVcjs.createEffect.call(void 0, () => {
|
|
31
|
+
const enabled = evaluate();
|
|
32
|
+
if (enabled) {
|
|
33
|
+
scope.run(fn);
|
|
34
|
+
} else {
|
|
35
|
+
scope.stop();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
_chunkPMF6MWEVcjs.onCleanup.call(void 0, scope.stop);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
exports.createScope = createScope; exports.runInScope = runInScope;
|
|
45
|
+
//# sourceMappingURL=chunk-624QY53A.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/fict/fict/packages/runtime/dist/chunk-624QY53A.cjs","../src/scope.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACOO,SAAS,WAAA,CAAA,EAA6B;AAC3C,EAAA,IAAI,QAAA,EAA+B,IAAA;AAEnC,EAAA,MAAM,KAAA,EAAO,CAAA,EAAA,GAAM;AACjB,IAAA,GAAA,CAAI,OAAA,EAAS;AACX,MAAA,OAAA,CAAQ,CAAA;AACR,MAAA,QAAA,EAAU,IAAA;AAAA,IACZ;AAAA,EACF,CAAA;AAEA,EAAA,MAAM,IAAA,EAAM,CAAI,EAAA,EAAA,GAAmB;AACjC,IAAA,IAAA,CAAK,CAAA;AACL,IAAA,MAAM,EAAE,OAAA,EAAS,WAAA,EAAa,MAAM,EAAA,EAAI,0CAAA,EAAa,CAAA;AACrD,IAAA,QAAA,EAAU,WAAA;AACV,IAAA,OAAO,KAAA;AAAA,EACT,CAAA;AAEA,EAAA,mDAAA,IAAwB,CAAA;AACxB,EAAA,OAAO,EAAE,GAAA,EAAK,KAAK,CAAA;AACrB;AAMO,SAAS,UAAA,CAAW,IAAA,EAA8B,EAAA,EAAsB;AAC7E,EAAA,MAAM,MAAA,EAAQ,WAAA,CAAY,CAAA;AAC1B,EAAA,MAAM,SAAA,EAAW,CAAA,EAAA,GAAO,0CAAA,IAAe,EAAA,EAAK,IAAA,CAAuB,EAAA,EAAI,CAAC,CAAC,IAAA;AAEzE,EAAA,4CAAA,CAAa,EAAA,GAAM;AACjB,IAAA,MAAM,QAAA,EAAU,QAAA,CAAS,CAAA;AACzB,IAAA,GAAA,CAAI,OAAA,EAAS;AACX,MAAA,KAAA,CAAM,GAAA,CAAI,EAAE,CAAA;AAAA,IACd,EAAA,KAAO;AACL,MAAA,KAAA,CAAM,IAAA,CAAK,CAAA;AAAA,IACb;AAAA,EACF,CAAC,CAAA;AAED,EAAA,yCAAA,KAAU,CAAM,IAAI,CAAA;AACtB;ADfA;AACA;AACE;AACA;AACF,mEAAC","file":"/home/runner/work/fict/fict/packages/runtime/dist/chunk-624QY53A.cjs","sourcesContent":[null,"import { isReactive, type MaybeReactive } from './binding'\nimport { createEffect } from './effect'\nimport { createRoot, onCleanup, registerRootCleanup } from './lifecycle'\n\nexport { effectScope } from './signal'\n\nexport interface ReactiveScope {\n run<T>(fn: () => T): T\n stop(): void\n}\n\n/**\n * Create an explicit reactive scope that can contain effects/memos and be stopped manually.\n * The scope registers with the current root for cleanup.\n */\nexport function createScope(): ReactiveScope {\n let dispose: (() => void) | null = null\n\n const stop = () => {\n if (dispose) {\n dispose()\n dispose = null\n }\n }\n\n const run = <T>(fn: () => T): T => {\n stop()\n const { dispose: rootDispose, value } = createRoot(fn)\n dispose = rootDispose\n return value\n }\n\n registerRootCleanup(stop)\n return { run, stop }\n}\n\n/**\n * Run a block of reactive code inside a managed scope that follows a boolean flag.\n * When the flag turns false, the scope is disposed and all contained effects/memos are cleaned up.\n */\nexport function runInScope(flag: MaybeReactive<boolean>, fn: () => void): void {\n const scope = createScope()\n const evaluate = () => (isReactive(flag) ? (flag as () => boolean)() : !!flag)\n\n createEffect(() => {\n const enabled = evaluate()\n if (enabled) {\n scope.run(fn)\n } else {\n scope.stop()\n }\n })\n\n onCleanup(scope.stop)\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createEffect,
|
|
3
|
+
createRoot,
|
|
4
|
+
isReactive,
|
|
5
|
+
onCleanup,
|
|
6
|
+
registerRootCleanup
|
|
7
|
+
} from "./chunk-RY4WDS6R.js";
|
|
8
|
+
|
|
9
|
+
// src/scope.ts
|
|
10
|
+
function createScope() {
|
|
11
|
+
let dispose = null;
|
|
12
|
+
const stop = () => {
|
|
13
|
+
if (dispose) {
|
|
14
|
+
dispose();
|
|
15
|
+
dispose = null;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const run = (fn) => {
|
|
19
|
+
stop();
|
|
20
|
+
const { dispose: rootDispose, value } = createRoot(fn);
|
|
21
|
+
dispose = rootDispose;
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
registerRootCleanup(stop);
|
|
25
|
+
return { run, stop };
|
|
26
|
+
}
|
|
27
|
+
function runInScope(flag, fn) {
|
|
28
|
+
const scope = createScope();
|
|
29
|
+
const evaluate = () => isReactive(flag) ? flag() : !!flag;
|
|
30
|
+
createEffect(() => {
|
|
31
|
+
const enabled = evaluate();
|
|
32
|
+
if (enabled) {
|
|
33
|
+
scope.run(fn);
|
|
34
|
+
} else {
|
|
35
|
+
scope.stop();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
onCleanup(scope.stop);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
createScope,
|
|
43
|
+
runInScope
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=chunk-F3AIYQB7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/scope.ts"],"sourcesContent":["import { isReactive, type MaybeReactive } from './binding'\nimport { createEffect } from './effect'\nimport { createRoot, onCleanup, registerRootCleanup } from './lifecycle'\n\nexport { effectScope } from './signal'\n\nexport interface ReactiveScope {\n run<T>(fn: () => T): T\n stop(): void\n}\n\n/**\n * Create an explicit reactive scope that can contain effects/memos and be stopped manually.\n * The scope registers with the current root for cleanup.\n */\nexport function createScope(): ReactiveScope {\n let dispose: (() => void) | null = null\n\n const stop = () => {\n if (dispose) {\n dispose()\n dispose = null\n }\n }\n\n const run = <T>(fn: () => T): T => {\n stop()\n const { dispose: rootDispose, value } = createRoot(fn)\n dispose = rootDispose\n return value\n }\n\n registerRootCleanup(stop)\n return { run, stop }\n}\n\n/**\n * Run a block of reactive code inside a managed scope that follows a boolean flag.\n * When the flag turns false, the scope is disposed and all contained effects/memos are cleaned up.\n */\nexport function runInScope(flag: MaybeReactive<boolean>, fn: () => void): void {\n const scope = createScope()\n const evaluate = () => (isReactive(flag) ? (flag as () => boolean)() : !!flag)\n\n createEffect(() => {\n const enabled = evaluate()\n if (enabled) {\n scope.run(fn)\n } else {\n scope.stop()\n }\n })\n\n onCleanup(scope.stop)\n}\n"],"mappings":";;;;;;;;;AAeO,SAAS,cAA6B;AAC3C,MAAI,UAA+B;AAEnC,QAAM,OAAO,MAAM;AACjB,QAAI,SAAS;AACX,cAAQ;AACR,gBAAU;AAAA,IACZ;AAAA,EACF;AAEA,QAAM,MAAM,CAAI,OAAmB;AACjC,SAAK;AACL,UAAM,EAAE,SAAS,aAAa,MAAM,IAAI,WAAW,EAAE;AACrD,cAAU;AACV,WAAO;AAAA,EACT;AAEA,sBAAoB,IAAI;AACxB,SAAO,EAAE,KAAK,KAAK;AACrB;AAMO,SAAS,WAAW,MAA8B,IAAsB;AAC7E,QAAM,QAAQ,YAAY;AAC1B,QAAM,WAAW,MAAO,WAAW,IAAI,IAAK,KAAuB,IAAI,CAAC,CAAC;AAEzE,eAAa,MAAM;AACjB,UAAM,UAAU,SAAS;AACzB,QAAI,SAAS;AACX,YAAM,IAAI,EAAE;AAAA,IACd,OAAO;AACL,YAAM,KAAK;AAAA,IACb;AAAA,EACF,CAAC;AAED,YAAU,MAAM,IAAI;AACtB;","names":[]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkPMF6MWEVcjs = require('./chunk-PMF6MWEV.cjs');
|
|
14
|
+
|
|
15
|
+
// src/context.ts
|
|
16
|
+
var contextStorage = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
function getContextMap(root) {
|
|
18
|
+
let map = contextStorage.get(root);
|
|
19
|
+
if (!map) {
|
|
20
|
+
map = /* @__PURE__ */ new Map();
|
|
21
|
+
contextStorage.set(root, map);
|
|
22
|
+
}
|
|
23
|
+
return map;
|
|
24
|
+
}
|
|
25
|
+
function createContext(defaultValue) {
|
|
26
|
+
const id = Symbol("fict.context");
|
|
27
|
+
const context = {
|
|
28
|
+
id,
|
|
29
|
+
defaultValue,
|
|
30
|
+
Provider: null
|
|
31
|
+
};
|
|
32
|
+
context.Provider = function Provider(props) {
|
|
33
|
+
const hostRoot = _chunkPMF6MWEVcjs.getCurrentRoot.call(void 0, );
|
|
34
|
+
const providerRoot = _chunkPMF6MWEVcjs.createRootContext.call(void 0, hostRoot);
|
|
35
|
+
const contextMap = getContextMap(providerRoot);
|
|
36
|
+
contextMap.set(id, props.value);
|
|
37
|
+
const fragment = document.createDocumentFragment();
|
|
38
|
+
const marker = document.createComment("fict:ctx");
|
|
39
|
+
fragment.appendChild(marker);
|
|
40
|
+
let cleanup;
|
|
41
|
+
let activeNodes = [];
|
|
42
|
+
const renderChildren = (children) => {
|
|
43
|
+
if (cleanup) {
|
|
44
|
+
cleanup();
|
|
45
|
+
cleanup = void 0;
|
|
46
|
+
}
|
|
47
|
+
if (activeNodes.length) {
|
|
48
|
+
_chunkPMF6MWEVcjs.removeNodes.call(void 0, activeNodes);
|
|
49
|
+
activeNodes = [];
|
|
50
|
+
}
|
|
51
|
+
if (children == null || children === false) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const prev = _chunkPMF6MWEVcjs.pushRoot.call(void 0, providerRoot);
|
|
55
|
+
let nodes = [];
|
|
56
|
+
try {
|
|
57
|
+
const output = _chunkPMF6MWEVcjs.createElement.call(void 0, children);
|
|
58
|
+
nodes = _chunkPMF6MWEVcjs.toNodeArray.call(void 0, output);
|
|
59
|
+
const parentNode = marker.parentNode;
|
|
60
|
+
if (parentNode) {
|
|
61
|
+
_chunkPMF6MWEVcjs.insertNodesBefore.call(void 0, parentNode, nodes, marker);
|
|
62
|
+
}
|
|
63
|
+
} finally {
|
|
64
|
+
_chunkPMF6MWEVcjs.popRoot.call(void 0, prev);
|
|
65
|
+
_chunkPMF6MWEVcjs.flushOnMount.call(void 0, providerRoot);
|
|
66
|
+
}
|
|
67
|
+
cleanup = () => {
|
|
68
|
+
_chunkPMF6MWEVcjs.destroyRoot.call(void 0, providerRoot);
|
|
69
|
+
_chunkPMF6MWEVcjs.removeNodes.call(void 0, nodes);
|
|
70
|
+
};
|
|
71
|
+
activeNodes = nodes;
|
|
72
|
+
};
|
|
73
|
+
_chunkPMF6MWEVcjs.createRenderEffect.call(void 0, () => {
|
|
74
|
+
contextMap.set(id, props.value);
|
|
75
|
+
renderChildren(props.children);
|
|
76
|
+
});
|
|
77
|
+
return fragment;
|
|
78
|
+
};
|
|
79
|
+
return context;
|
|
80
|
+
}
|
|
81
|
+
function useContext(context) {
|
|
82
|
+
let root = _chunkPMF6MWEVcjs.getCurrentRoot.call(void 0, );
|
|
83
|
+
while (root) {
|
|
84
|
+
const contextMap = contextStorage.get(root);
|
|
85
|
+
if (contextMap && contextMap.has(context.id)) {
|
|
86
|
+
return contextMap.get(context.id);
|
|
87
|
+
}
|
|
88
|
+
root = root.parent;
|
|
89
|
+
}
|
|
90
|
+
return context.defaultValue;
|
|
91
|
+
}
|
|
92
|
+
function hasContext(context) {
|
|
93
|
+
let root = _chunkPMF6MWEVcjs.getCurrentRoot.call(void 0, );
|
|
94
|
+
while (root) {
|
|
95
|
+
const contextMap = contextStorage.get(root);
|
|
96
|
+
if (contextMap && contextMap.has(context.id)) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
root = root.parent;
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
exports.createContext = createContext; exports.useContext = useContext; exports.hasContext = hasContext;
|
|
109
|
+
//# sourceMappingURL=chunk-GJTYOFMO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/fict/fict/packages/runtime/dist/chunk-GJTYOFMO.cjs","../src/context.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACsFA,IAAM,eAAA,kBAAiB,IAAI,OAAA,CAA2C,CAAA;AAKtE,SAAS,aAAA,CAAc,IAAA,EAAyC;AAC9D,EAAA,IAAI,IAAA,EAAM,cAAA,CAAe,GAAA,CAAI,IAAI,CAAA;AACjC,EAAA,GAAA,CAAI,CAAC,GAAA,EAAK;AACR,IAAA,IAAA,kBAAM,IAAI,GAAA,CAAI,CAAA;AACd,IAAA,cAAA,CAAe,GAAA,CAAI,IAAA,EAAM,GAAG,CAAA;AAAA,EAC9B;AACA,EAAA,OAAO,GAAA;AACT;AA0CO,SAAS,aAAA,CAAiB,YAAA,EAA6B;AAC5D,EAAA,MAAM,GAAA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AC1D,EAAA,IAAI,KAAA,EAAO,8CAAA,CAAe;AAE1B,EAAA,MAAA,CAAO,IAAA,EAAM;AACX,IAAA,MAAM,WAAA,EAAa,cAAA,CAAe,GAAA,CAAI,IAAI,CAAA;AAC1C,IAAA,GAAA,CAAI,WAAA,GAAc,UAAA,CAAW,GAAA,CAAI,OAAA,CAAQ,EAAE,CAAA,EAAG;AAC5C,MAAA,OAAO,IAAA;AAAA,IACT;AACA,IAAA,KAAA,EAAO,IAAA,CAAK,MAAA;AAAA,EACd;AAEA,EAAA,OAAO,KAAA;AACT;ADrMA;AACA;AACE;AACA;AACA;AACF,wGAAC","file":"/home/runner/work/fict/fict/packages/runtime/dist/chunk-GJTYOFMO.cjs","sourcesContent":[null,"/**\n * @fileoverview Context API for Fict\n *\n * Provides a way to pass data through the component tree without having to pass\n * props down manually at every level. Context is designed for:\n *\n * - SSR isolation (different request = different context values)\n * - Multi-instance support (multiple app roots with different values)\n * - Subtree scoping (override values in specific parts of the tree)\n *\n * ## Design Principles\n *\n * 1. **Reuses existing RootContext hierarchy** - Uses parent chain for value lookup,\n * consistent with handleError/handleSuspend mechanisms.\n *\n * 2. **Zero extra root creation overhead** - Provider doesn't create new root,\n * only mounts value on current root.\n *\n * 3. **Auto-aligned with insert/suspense boundaries** - Because they create child\n * roots that inherit parent, context values propagate correctly.\n *\n * ## Usage\n *\n * ```tsx\n * // Create context with default value\n * const ThemeContext = createContext<'light' | 'dark'>('light')\n *\n * // Provide value to subtree\n * function App() {\n * return (\n * <ThemeContext.Provider value=\"dark\">\n * <ThemedComponent />\n * </ThemeContext.Provider>\n * )\n * }\n *\n * // Consume value\n * function ThemedComponent() {\n * const theme = useContext(ThemeContext)\n * return <div class={theme}>...</div>\n * }\n * ```\n *\n * @module\n */\n\nimport { createElement } from './dom'\nimport {\n createRootContext,\n destroyRoot,\n flushOnMount,\n getCurrentRoot,\n popRoot,\n pushRoot,\n type RootContext,\n} from './lifecycle'\nimport { insertNodesBefore, removeNodes, toNodeArray } from './node-ops'\nimport { createRenderEffect } from './effect'\nimport type { BaseProps, FictNode } from './types'\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Context object created by createContext.\n * Contains the Provider component and serves as a key for context lookup.\n */\nexport interface Context<T> {\n /** Unique identifier for this context */\n readonly id: symbol\n /** Default value when no provider is found */\n readonly defaultValue: T\n /** Provider component for supplying context values */\n Provider: ContextProvider<T>\n /** Display name for debugging */\n displayName?: string\n}\n\n/**\n * Props for the Context Provider component\n */\nexport interface ProviderProps<T> extends BaseProps {\n /** The value to provide to the subtree */\n value: T\n}\n\n/**\n * Provider component type\n */\nexport type ContextProvider<T> = (props: ProviderProps<T>) => FictNode\n\n// ============================================================================\n// Internal Context Storage\n// ============================================================================\n\n/**\n * WeakMap to store context values per RootContext.\n * Using WeakMap ensures proper garbage collection when roots are destroyed.\n */\nconst contextStorage = new WeakMap<RootContext, Map<symbol, unknown>>()\n\n/**\n * Get the context map for a root, creating it if needed\n */\nfunction getContextMap(root: RootContext): Map<symbol, unknown> {\n let map = contextStorage.get(root)\n if (!map) {\n map = new Map()\n contextStorage.set(root, map)\n }\n return map\n}\n\n// ============================================================================\n// Context API\n// ============================================================================\n\n/**\n * Creates a new context with the given default value.\n *\n * Context provides a way to pass values through the component tree without\n * explicit props drilling. It's especially useful for:\n *\n * - Theme data\n * - Locale/i18n settings\n * - Authentication state\n * - Feature flags\n * - Any data that many components at different nesting levels need\n *\n * @param defaultValue - The value to use when no Provider is found above in the tree\n * @returns A context object with a Provider component\n *\n * @example\n * ```tsx\n * // Create a theme context\n * const ThemeContext = createContext<'light' | 'dark'>('light')\n *\n * // Use the provider\n * function App() {\n * return (\n * <ThemeContext.Provider value=\"dark\">\n * <Content />\n * </ThemeContext.Provider>\n * )\n * }\n *\n * // Consume the context\n * function Content() {\n * const theme = useContext(ThemeContext)\n * return <div class={`theme-${theme}`}>Hello</div>\n * }\n * ```\n */\nexport function createContext<T>(defaultValue: T): Context<T> {\n const id = Symbol('fict.context')\n\n const context: Context<T> = {\n id,\n defaultValue,\n Provider: null as unknown as ContextProvider<T>,\n }\n\n // Create the Provider component\n context.Provider = function Provider(props: ProviderProps<T>): FictNode {\n const hostRoot = getCurrentRoot()\n\n // Create a child root for the provider's subtree\n // This establishes the provider boundary - children will look up from here\n const providerRoot = createRootContext(hostRoot)\n\n // Store the context value on this root\n const contextMap = getContextMap(providerRoot)\n contextMap.set(id, props.value)\n\n // Create DOM structure\n const fragment = document.createDocumentFragment()\n const marker = document.createComment('fict:ctx')\n fragment.appendChild(marker)\n\n let cleanup: (() => void) | undefined\n let activeNodes: Node[] = []\n\n const renderChildren = (children: FictNode) => {\n // Cleanup previous render\n if (cleanup) {\n cleanup()\n cleanup = undefined\n }\n if (activeNodes.length) {\n removeNodes(activeNodes)\n activeNodes = []\n }\n\n if (children == null || children === false) {\n return\n }\n\n const prev = pushRoot(providerRoot)\n let nodes: Node[] = []\n try {\n const output = createElement(children)\n nodes = toNodeArray(output)\n const parentNode = marker.parentNode as (ParentNode & Node) | null\n if (parentNode) {\n insertNodesBefore(parentNode, nodes, marker)\n }\n } finally {\n popRoot(prev)\n flushOnMount(providerRoot)\n }\n\n cleanup = () => {\n destroyRoot(providerRoot)\n removeNodes(nodes)\n }\n activeNodes = nodes\n }\n\n // Initial render\n createRenderEffect(() => {\n // Update context value on re-render (if value prop changes reactively)\n contextMap.set(id, props.value)\n renderChildren(props.children)\n })\n\n return fragment\n }\n\n return context\n}\n\n/**\n * Reads the current value of a context.\n *\n * useContext looks up through the RootContext parent chain to find the\n * nearest Provider for this context. If no Provider is found, returns\n * the context's default value.\n *\n * @param context - The context object created by createContext\n * @returns The current context value\n *\n * @example\n * ```tsx\n * const ThemeContext = createContext('light')\n *\n * function ThemedButton() {\n * const theme = useContext(ThemeContext)\n * return <button class={theme === 'dark' ? 'btn-dark' : 'btn-light'}>Click</button>\n * }\n * ```\n */\nexport function useContext<T>(context: Context<T>): T {\n let root = getCurrentRoot()\n\n // Walk up the parent chain looking for the context value\n while (root) {\n const contextMap = contextStorage.get(root)\n if (contextMap && contextMap.has(context.id)) {\n return contextMap.get(context.id) as T\n }\n root = root.parent\n }\n\n // No provider found, return default value\n return context.defaultValue\n}\n\n/**\n * Checks if a context value is currently provided in the tree.\n *\n * Useful for conditional behavior when a provider may or may not exist.\n *\n * @param context - The context object to check\n * @returns true if a Provider exists above in the tree\n *\n * @example\n * ```tsx\n * function OptionalTheme() {\n * if (hasContext(ThemeContext)) {\n * const theme = useContext(ThemeContext)\n * return <div class={theme}>Themed content</div>\n * }\n * return <div>Default content</div>\n * }\n * ```\n */\nexport function hasContext<T>(context: Context<T>): boolean {\n let root = getCurrentRoot()\n\n while (root) {\n const contextMap = contextStorage.get(root)\n if (contextMap && contextMap.has(context.id)) {\n return true\n }\n root = root.parent\n }\n\n return false\n}\n"]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createElement,
|
|
3
|
+
createRenderEffect,
|
|
4
|
+
createRootContext,
|
|
5
|
+
destroyRoot,
|
|
6
|
+
flushOnMount,
|
|
7
|
+
getCurrentRoot,
|
|
8
|
+
insertNodesBefore,
|
|
9
|
+
popRoot,
|
|
10
|
+
pushRoot,
|
|
11
|
+
removeNodes,
|
|
12
|
+
toNodeArray
|
|
13
|
+
} from "./chunk-RY4WDS6R.js";
|
|
14
|
+
|
|
15
|
+
// src/context.ts
|
|
16
|
+
var contextStorage = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
function getContextMap(root) {
|
|
18
|
+
let map = contextStorage.get(root);
|
|
19
|
+
if (!map) {
|
|
20
|
+
map = /* @__PURE__ */ new Map();
|
|
21
|
+
contextStorage.set(root, map);
|
|
22
|
+
}
|
|
23
|
+
return map;
|
|
24
|
+
}
|
|
25
|
+
function createContext(defaultValue) {
|
|
26
|
+
const id = Symbol("fict.context");
|
|
27
|
+
const context = {
|
|
28
|
+
id,
|
|
29
|
+
defaultValue,
|
|
30
|
+
Provider: null
|
|
31
|
+
};
|
|
32
|
+
context.Provider = function Provider(props) {
|
|
33
|
+
const hostRoot = getCurrentRoot();
|
|
34
|
+
const providerRoot = createRootContext(hostRoot);
|
|
35
|
+
const contextMap = getContextMap(providerRoot);
|
|
36
|
+
contextMap.set(id, props.value);
|
|
37
|
+
const fragment = document.createDocumentFragment();
|
|
38
|
+
const marker = document.createComment("fict:ctx");
|
|
39
|
+
fragment.appendChild(marker);
|
|
40
|
+
let cleanup;
|
|
41
|
+
let activeNodes = [];
|
|
42
|
+
const renderChildren = (children) => {
|
|
43
|
+
if (cleanup) {
|
|
44
|
+
cleanup();
|
|
45
|
+
cleanup = void 0;
|
|
46
|
+
}
|
|
47
|
+
if (activeNodes.length) {
|
|
48
|
+
removeNodes(activeNodes);
|
|
49
|
+
activeNodes = [];
|
|
50
|
+
}
|
|
51
|
+
if (children == null || children === false) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const prev = pushRoot(providerRoot);
|
|
55
|
+
let nodes = [];
|
|
56
|
+
try {
|
|
57
|
+
const output = createElement(children);
|
|
58
|
+
nodes = toNodeArray(output);
|
|
59
|
+
const parentNode = marker.parentNode;
|
|
60
|
+
if (parentNode) {
|
|
61
|
+
insertNodesBefore(parentNode, nodes, marker);
|
|
62
|
+
}
|
|
63
|
+
} finally {
|
|
64
|
+
popRoot(prev);
|
|
65
|
+
flushOnMount(providerRoot);
|
|
66
|
+
}
|
|
67
|
+
cleanup = () => {
|
|
68
|
+
destroyRoot(providerRoot);
|
|
69
|
+
removeNodes(nodes);
|
|
70
|
+
};
|
|
71
|
+
activeNodes = nodes;
|
|
72
|
+
};
|
|
73
|
+
createRenderEffect(() => {
|
|
74
|
+
contextMap.set(id, props.value);
|
|
75
|
+
renderChildren(props.children);
|
|
76
|
+
});
|
|
77
|
+
return fragment;
|
|
78
|
+
};
|
|
79
|
+
return context;
|
|
80
|
+
}
|
|
81
|
+
function useContext(context) {
|
|
82
|
+
let root = getCurrentRoot();
|
|
83
|
+
while (root) {
|
|
84
|
+
const contextMap = contextStorage.get(root);
|
|
85
|
+
if (contextMap && contextMap.has(context.id)) {
|
|
86
|
+
return contextMap.get(context.id);
|
|
87
|
+
}
|
|
88
|
+
root = root.parent;
|
|
89
|
+
}
|
|
90
|
+
return context.defaultValue;
|
|
91
|
+
}
|
|
92
|
+
function hasContext(context) {
|
|
93
|
+
let root = getCurrentRoot();
|
|
94
|
+
while (root) {
|
|
95
|
+
const contextMap = contextStorage.get(root);
|
|
96
|
+
if (contextMap && contextMap.has(context.id)) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
root = root.parent;
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
createContext,
|
|
106
|
+
useContext,
|
|
107
|
+
hasContext
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=chunk-IUZXKAAY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/context.ts"],"sourcesContent":["/**\n * @fileoverview Context API for Fict\n *\n * Provides a way to pass data through the component tree without having to pass\n * props down manually at every level. Context is designed for:\n *\n * - SSR isolation (different request = different context values)\n * - Multi-instance support (multiple app roots with different values)\n * - Subtree scoping (override values in specific parts of the tree)\n *\n * ## Design Principles\n *\n * 1. **Reuses existing RootContext hierarchy** - Uses parent chain for value lookup,\n * consistent with handleError/handleSuspend mechanisms.\n *\n * 2. **Zero extra root creation overhead** - Provider doesn't create new root,\n * only mounts value on current root.\n *\n * 3. **Auto-aligned with insert/suspense boundaries** - Because they create child\n * roots that inherit parent, context values propagate correctly.\n *\n * ## Usage\n *\n * ```tsx\n * // Create context with default value\n * const ThemeContext = createContext<'light' | 'dark'>('light')\n *\n * // Provide value to subtree\n * function App() {\n * return (\n * <ThemeContext.Provider value=\"dark\">\n * <ThemedComponent />\n * </ThemeContext.Provider>\n * )\n * }\n *\n * // Consume value\n * function ThemedComponent() {\n * const theme = useContext(ThemeContext)\n * return <div class={theme}>...</div>\n * }\n * ```\n *\n * @module\n */\n\nimport { createElement } from './dom'\nimport {\n createRootContext,\n destroyRoot,\n flushOnMount,\n getCurrentRoot,\n popRoot,\n pushRoot,\n type RootContext,\n} from './lifecycle'\nimport { insertNodesBefore, removeNodes, toNodeArray } from './node-ops'\nimport { createRenderEffect } from './effect'\nimport type { BaseProps, FictNode } from './types'\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Context object created by createContext.\n * Contains the Provider component and serves as a key for context lookup.\n */\nexport interface Context<T> {\n /** Unique identifier for this context */\n readonly id: symbol\n /** Default value when no provider is found */\n readonly defaultValue: T\n /** Provider component for supplying context values */\n Provider: ContextProvider<T>\n /** Display name for debugging */\n displayName?: string\n}\n\n/**\n * Props for the Context Provider component\n */\nexport interface ProviderProps<T> extends BaseProps {\n /** The value to provide to the subtree */\n value: T\n}\n\n/**\n * Provider component type\n */\nexport type ContextProvider<T> = (props: ProviderProps<T>) => FictNode\n\n// ============================================================================\n// Internal Context Storage\n// ============================================================================\n\n/**\n * WeakMap to store context values per RootContext.\n * Using WeakMap ensures proper garbage collection when roots are destroyed.\n */\nconst contextStorage = new WeakMap<RootContext, Map<symbol, unknown>>()\n\n/**\n * Get the context map for a root, creating it if needed\n */\nfunction getContextMap(root: RootContext): Map<symbol, unknown> {\n let map = contextStorage.get(root)\n if (!map) {\n map = new Map()\n contextStorage.set(root, map)\n }\n return map\n}\n\n// ============================================================================\n// Context API\n// ============================================================================\n\n/**\n * Creates a new context with the given default value.\n *\n * Context provides a way to pass values through the component tree without\n * explicit props drilling. It's especially useful for:\n *\n * - Theme data\n * - Locale/i18n settings\n * - Authentication state\n * - Feature flags\n * - Any data that many components at different nesting levels need\n *\n * @param defaultValue - The value to use when no Provider is found above in the tree\n * @returns A context object with a Provider component\n *\n * @example\n * ```tsx\n * // Create a theme context\n * const ThemeContext = createContext<'light' | 'dark'>('light')\n *\n * // Use the provider\n * function App() {\n * return (\n * <ThemeContext.Provider value=\"dark\">\n * <Content />\n * </ThemeContext.Provider>\n * )\n * }\n *\n * // Consume the context\n * function Content() {\n * const theme = useContext(ThemeContext)\n * return <div class={`theme-${theme}`}>Hello</div>\n * }\n * ```\n */\nexport function createContext<T>(defaultValue: T): Context<T> {\n const id = Symbol('fict.context')\n\n const context: Context<T> = {\n id,\n defaultValue,\n Provider: null as unknown as ContextProvider<T>,\n }\n\n // Create the Provider component\n context.Provider = function Provider(props: ProviderProps<T>): FictNode {\n const hostRoot = getCurrentRoot()\n\n // Create a child root for the provider's subtree\n // This establishes the provider boundary - children will look up from here\n const providerRoot = createRootContext(hostRoot)\n\n // Store the context value on this root\n const contextMap = getContextMap(providerRoot)\n contextMap.set(id, props.value)\n\n // Create DOM structure\n const fragment = document.createDocumentFragment()\n const marker = document.createComment('fict:ctx')\n fragment.appendChild(marker)\n\n let cleanup: (() => void) | undefined\n let activeNodes: Node[] = []\n\n const renderChildren = (children: FictNode) => {\n // Cleanup previous render\n if (cleanup) {\n cleanup()\n cleanup = undefined\n }\n if (activeNodes.length) {\n removeNodes(activeNodes)\n activeNodes = []\n }\n\n if (children == null || children === false) {\n return\n }\n\n const prev = pushRoot(providerRoot)\n let nodes: Node[] = []\n try {\n const output = createElement(children)\n nodes = toNodeArray(output)\n const parentNode = marker.parentNode as (ParentNode & Node) | null\n if (parentNode) {\n insertNodesBefore(parentNode, nodes, marker)\n }\n } finally {\n popRoot(prev)\n flushOnMount(providerRoot)\n }\n\n cleanup = () => {\n destroyRoot(providerRoot)\n removeNodes(nodes)\n }\n activeNodes = nodes\n }\n\n // Initial render\n createRenderEffect(() => {\n // Update context value on re-render (if value prop changes reactively)\n contextMap.set(id, props.value)\n renderChildren(props.children)\n })\n\n return fragment\n }\n\n return context\n}\n\n/**\n * Reads the current value of a context.\n *\n * useContext looks up through the RootContext parent chain to find the\n * nearest Provider for this context. If no Provider is found, returns\n * the context's default value.\n *\n * @param context - The context object created by createContext\n * @returns The current context value\n *\n * @example\n * ```tsx\n * const ThemeContext = createContext('light')\n *\n * function ThemedButton() {\n * const theme = useContext(ThemeContext)\n * return <button class={theme === 'dark' ? 'btn-dark' : 'btn-light'}>Click</button>\n * }\n * ```\n */\nexport function useContext<T>(context: Context<T>): T {\n let root = getCurrentRoot()\n\n // Walk up the parent chain looking for the context value\n while (root) {\n const contextMap = contextStorage.get(root)\n if (contextMap && contextMap.has(context.id)) {\n return contextMap.get(context.id) as T\n }\n root = root.parent\n }\n\n // No provider found, return default value\n return context.defaultValue\n}\n\n/**\n * Checks if a context value is currently provided in the tree.\n *\n * Useful for conditional behavior when a provider may or may not exist.\n *\n * @param context - The context object to check\n * @returns true if a Provider exists above in the tree\n *\n * @example\n * ```tsx\n * function OptionalTheme() {\n * if (hasContext(ThemeContext)) {\n * const theme = useContext(ThemeContext)\n * return <div class={theme}>Themed content</div>\n * }\n * return <div>Default content</div>\n * }\n * ```\n */\nexport function hasContext<T>(context: Context<T>): boolean {\n let root = getCurrentRoot()\n\n while (root) {\n const contextMap = contextStorage.get(root)\n if (contextMap && contextMap.has(context.id)) {\n return true\n }\n root = root.parent\n }\n\n return false\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoGA,IAAM,iBAAiB,oBAAI,QAA2C;AAKtE,SAAS,cAAc,MAAyC;AAC9D,MAAI,MAAM,eAAe,IAAI,IAAI;AACjC,MAAI,CAAC,KAAK;AACR,UAAM,oBAAI,IAAI;AACd,mBAAe,IAAI,MAAM,GAAG;AAAA,EAC9B;AACA,SAAO;AACT;AA0CO,SAAS,cAAiB,cAA6B;AAC5D,QAAM,KAAK,OAAO,cAAc;AAEhC,QAAM,UAAsB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,UAAU;AAAA,EACZ;AAGA,UAAQ,WAAW,SAAS,SAAS,OAAmC;AACtE,UAAM,WAAW,eAAe;AAIhC,UAAM,eAAe,kBAAkB,QAAQ;AAG/C,UAAM,aAAa,cAAc,YAAY;AAC7C,eAAW,IAAI,IAAI,MAAM,KAAK;AAG9B,UA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