flexium 0.9.0 → 0.9.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.
- package/dist/advanced.d.cts +2 -2
- package/dist/advanced.d.ts +2 -2
- package/dist/advanced.js +1 -1
- package/dist/advanced.mjs +1 -1
- package/dist/canvas.d.cts +1 -1
- package/dist/canvas.d.ts +1 -1
- package/dist/canvas.js +1 -1
- package/dist/canvas.mjs +1 -1
- package/dist/chunk-2ZHUQBNI.mjs +2 -0
- package/dist/chunk-2ZHUQBNI.mjs.map +1 -0
- package/dist/{chunk-CBO2X74Q.js → chunk-DFG62GKW.js} +2 -2
- package/dist/{chunk-CBO2X74Q.js.map → chunk-DFG62GKW.js.map} +1 -1
- package/dist/{chunk-LXXN76HJ.mjs → chunk-HDCPA76O.mjs} +2 -2
- package/dist/{chunk-LXXN76HJ.mjs.map → chunk-HDCPA76O.mjs.map} +1 -1
- package/dist/chunk-J4CK5NRW.mjs +3 -0
- package/dist/chunk-J4CK5NRW.mjs.map +1 -0
- package/dist/chunk-JEDCNAAI.mjs +3 -0
- package/dist/chunk-JEDCNAAI.mjs.map +1 -0
- package/dist/{chunk-PDOEMOWN.js → chunk-JHJHIMWD.js} +2 -2
- package/dist/{chunk-PDOEMOWN.js.map → chunk-JHJHIMWD.js.map} +1 -1
- package/dist/{chunk-RIVNKTUR.js → chunk-L4C5UBOX.js} +2 -2
- package/dist/{chunk-RIVNKTUR.js.map → chunk-L4C5UBOX.js.map} +1 -1
- package/dist/{chunk-ZG3LULLU.js → chunk-M4ANLZ6P.js} +3 -3
- package/dist/{chunk-ZG3LULLU.js.map → chunk-M4ANLZ6P.js.map} +1 -1
- package/dist/chunk-RDA77IE6.js +2 -0
- package/dist/chunk-RDA77IE6.js.map +1 -0
- package/dist/{chunk-JDTJFAXO.mjs → chunk-RUXAK74B.mjs} +2 -2
- package/dist/{chunk-JDTJFAXO.mjs.map → chunk-RUXAK74B.mjs.map} +1 -1
- package/dist/chunk-TRIEKNVZ.mjs +2 -0
- package/dist/{chunk-GQKN4NPW.mjs.map → chunk-TRIEKNVZ.mjs.map} +1 -1
- package/dist/chunk-VIVO4FHN.js +3 -0
- package/dist/chunk-VIVO4FHN.js.map +1 -0
- package/dist/chunk-XLE6SMWX.mjs +3 -0
- package/dist/{chunk-6RV7ARJT.mjs.map → chunk-XLE6SMWX.mjs.map} +1 -1
- package/dist/chunk-YGMMJWAA.js +3 -0
- package/dist/chunk-YGMMJWAA.js.map +1 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/dom.js +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/dom.mjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/interactive.js +1 -1
- package/dist/interactive.mjs +1 -1
- package/dist/interactive.mjs.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/{owner-Ce7KCWzi.d.cts → owner-QS9tPwPr.d.cts} +1 -8
- package/dist/{owner-Ce7KCWzi.d.ts → owner-QS9tPwPr.d.ts} +1 -8
- package/dist/primitives/motion.js +1 -1
- package/dist/primitives/motion.mjs +1 -1
- package/dist/primitives/ui.js +1 -1
- package/dist/primitives/ui.mjs +1 -1
- package/dist/primitives/ui.mjs.map +1 -1
- package/dist/primitives.d.cts +1 -1
- package/dist/primitives.d.ts +1 -1
- package/dist/primitives.js +1 -1
- package/dist/primitives.mjs +1 -1
- package/dist/router.js +1 -1
- package/dist/router.mjs +1 -1
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/server.mjs.map +1 -1
- package/dist/signal-3YZHUCLL.js +2 -0
- package/dist/{signal-AXKUQJVA.js.map → signal-3YZHUCLL.js.map} +1 -1
- package/dist/signal-F2HEYB6F.mjs +2 -0
- package/dist/{signal-HM2LG5YL.mjs.map → signal-F2HEYB6F.mjs.map} +1 -1
- package/dist/test-exports.d.cts +2 -2
- package/dist/test-exports.d.ts +2 -2
- package/dist/test-exports.js +1 -1
- package/dist/test-exports.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-6RV7ARJT.mjs +0 -3
- package/dist/chunk-GFL4VRAO.mjs +0 -3
- package/dist/chunk-GFL4VRAO.mjs.map +0 -1
- package/dist/chunk-GQKN4NPW.mjs +0 -2
- package/dist/chunk-MKE3KA43.js +0 -3
- package/dist/chunk-MKE3KA43.js.map +0 -1
- package/dist/chunk-TQLZ7UZX.js +0 -2
- package/dist/chunk-TQLZ7UZX.js.map +0 -1
- package/dist/chunk-WEYAKKNF.js +0 -3
- package/dist/chunk-WEYAKKNF.js.map +0 -1
- package/dist/chunk-WO6NQ3KR.mjs +0 -3
- package/dist/chunk-WO6NQ3KR.mjs.map +0 -1
- package/dist/chunk-Y4DUMNIW.mjs +0 -2
- package/dist/chunk-Y4DUMNIW.mjs.map +0 -1
- package/dist/signal-AXKUQJVA.js +0 -2
- package/dist/signal-HM2LG5YL.mjs +0 -2
- /package/dist/{scheduler-Z4QqUDjF.d.cts → sync-Z4QqUDjF.d.cts} +0 -0
- /package/dist/{scheduler-Z4QqUDjF.d.ts → sync-Z4QqUDjF.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/state.ts"],"names":["STATE_SIGNAL","toStateObject","res","actions","s","toComputedStateObject","comp","toSignalStateObject","sig","globalStateRegistry","DEV_WARNING_THRESHOLD","hasWarnedAboutSize","currentComponent","setCurrentComponent","instance","createComponentInstance","resetHookIndex","keyCache","serializeKey","key","cached","serialized","error","checkRegistrySize","isStateValue","value","getStateSignal","stateValue","equals","isTruthy","createStateProxy","target","PEEK_PROP","VALUE_OF_PROP","TO_STRING_PROP","TO_JSON_PROP","TO_PRIMITIVE_SYMBOL","_target","prop","_hint","currentValue","propValue","desc","state","initialValueOrFetcher","options","params","hookIndex","savedComponent","result","isAsync","isComputed","proxy","refetch","statusComputed","computed","errorComputed","statusValue","errorValue","newValue","originalFn","fn","resActions","createResource","val","testResult","signal","serializedKey","_state","ref","initialValue"],"mappings":"yCAMO,IAAMA,CAAAA,CAAe,MAAA,CAAO,GAAA,CAAI,qBAAqB,CAAA,CA2B5D,SAASC,CAAAA,CACPC,CAAAA,CACAC,CAAAA,CACa,CACb,IAAMC,CAAAA,CAAIF,EACV,OAAAE,CAAAA,CAAE,OAAA,CAAUF,CAAAA,CACZE,CAAAA,CAAE,aAAA,CAAgBD,CAAAA,CACXC,CACT,CAMA,SAASC,CAAAA,CAAyBC,CAAAA,CAAgC,CAChE,OAAO,CACL,KAAA,CAAO,MAAA,CACP,IAAA,CAAMA,CAAAA,CAAK,IAAA,CACX,OAAA,CAASA,EACT,WAAA,CAAa,IACf,CACF,CAMA,SAASC,CAAAA,CAAuBC,EAA6B,CAC3D,IAAMJ,CAAAA,CAAII,CAAAA,CACV,OAAAJ,CAAAA,CAAE,OAAA,CAAUI,CAAAA,CACLJ,CACT,CAGA,IAAMK,CAAAA,CAAsB,IAAI,GAAA,CAG1BC,EAAwB,GAAA,CAC1BC,CAAAA,CAAqB,KAAA,CAYrBC,CAAAA,CAA6C,IAAA,CAO1C,SAASC,EAAoBC,CAAAA,CAA0C,CAC5EF,CAAAA,CAAmBE,EACrB,CAcO,SAASC,GAA6C,CAC3D,OAAO,CACL,EAAA,CAAI,MAAA,CAAO,WAAW,CAAA,CACtB,SAAA,CAAW,CAAA,CACX,KAAA,CAAO,EACT,CACF,CAMO,SAASC,CAAAA,CAAeF,CAAAA,CAAmC,CAChEA,CAAAA,CAAS,SAAA,CAAY,EACvB,CAMA,IAAMG,CAAAA,CAAW,IAAI,OAAA,CAOrB,SAASC,CAAAA,CAAaC,EAAuB,CAC3C,GAAI,OAAOA,CAAAA,EAAQ,QAAA,CACjB,OAAOA,CAAAA,CAIT,IAAMC,CAAAA,CAASH,CAAAA,CAAS,GAAA,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D,CAAAA,CAASzB,EAmCR,SAAS0B,CAAAA,CAAOC,CAAAA,CAAsC,CAC3D,OAAO,CAAE,OAAA,CAASA,CAAa,CACjC","file":"chunk-Y4DUMNIW.mjs","sourcesContent":["import { signal, computed, createResource } from './signal'\nimport type { Signal, Computed, Resource } from './signal'\n\n/** Symbol to identify StateProxy and access underlying signal */\n// Use Symbol.for() to ensure the symbol is shared across module boundaries\n// This is important for Vite dev mode where modules may be loaded separately\nexport const STATE_SIGNAL = Symbol.for('flexium.stateSignal')\n\n/** Internal state object that may be a Signal, Computed, or Resource */\ninterface StateObject {\n value: unknown\n peek: () => unknown\n loading?: boolean\n error?: unknown\n state?: 'unresolved' | 'pending' | 'ready' | 'refreshing' | 'errored'\n latest?: unknown\n\n _stateActions?: StateActions\n _signal?: Signal<unknown> | Computed<unknown> | Resource<unknown>\n _isComputed?: boolean\n}\n\n/** Actions available for state mutation */\ninterface StateActions {\n mutate?: (value: unknown) => void\n refetch?: () => void\n}\n\n/**\n * Type-safe helper to wrap Resource as StateObject.\n * Consolidates unsafe type assertions in one place.\n * @internal\n */\nfunction toStateObject<T>(\n res: Resource<T>,\n actions: { mutate: (v: T | undefined) => void; refetch: () => void }\n): StateObject {\n const s = res as unknown as StateObject\n s._signal = res as Resource<unknown>\n s._stateActions = actions as StateActions\n return s\n}\n\n/**\n * Type-safe helper to create a computed StateObject.\n * @internal\n */\nfunction toComputedStateObject<T>(comp: Computed<T>): StateObject {\n return {\n value: undefined,\n peek: comp.peek,\n _signal: comp as Computed<unknown>,\n _isComputed: true,\n }\n}\n\n/**\n * Type-safe helper to wrap Signal as StateObject.\n * @internal\n */\nfunction toSignalStateObject<T>(sig: Signal<T>): StateObject {\n const s = sig as unknown as StateObject\n s._signal = sig as Signal<unknown>\n return s\n}\n\n// Global registry for keyed states\nconst globalStateRegistry = new Map<string, StateObject>()\n\n// Dev mode warning thresholds\nconst DEV_WARNING_THRESHOLD = 10000\nlet hasWarnedAboutSize = false\n\n// ============================================================================\n// Component Hook System - enables state() inside components\n// ============================================================================\n\ninterface ComponentInstance {\n id: symbol\n hookIndex: number\n hooks: unknown[]\n}\n\nlet currentComponent: ComponentInstance | null = null\n\n/**\n * Set the current component context for hook tracking.\n * Called by the renderer before executing a component function.\n * @internal\n */\nexport function setCurrentComponent(instance: ComponentInstance | null): void {\n currentComponent = instance\n}\n\n/**\n * Get the current component context.\n * @internal\n */\nexport function getCurrentComponent(): ComponentInstance | null {\n return currentComponent\n}\n\n/**\n * Create a new component instance for hook tracking.\n * @internal\n */\nexport function createComponentInstance(): ComponentInstance {\n return {\n id: Symbol('component'),\n hookIndex: 0,\n hooks: [],\n }\n}\n\n/**\n * Reset hook index for re-renders.\n * @internal\n */\nexport function resetHookIndex(instance: ComponentInstance): void {\n instance.hookIndex = 0\n}\n\n/** Key type - string or array of serializable values */\nexport type StateKey = string | readonly (string | number | boolean | null | undefined | object)[]\n\n// Cache for array key serialization to avoid repeated JSON.stringify calls\nconst keyCache = new WeakMap<readonly unknown[], string>()\n\n/**\n * Serialize a key to a string for registry lookup.\n * Arrays are JSON-stringified for consistent comparison.\n * Uses WeakMap cache to avoid repeated serialization of array keys.\n */\nfunction serializeKey(key: StateKey): string {\n if (typeof key === 'string') {\n return key\n }\n\n // Check cache first for array keys\n const cached = keyCache.get(key)\n if (cached !== undefined) {\n return cached\n }\n\n try {\n const serialized = JSON.stringify(key)\n keyCache.set(key, serialized)\n return serialized\n } catch (error) {\n // Handle circular references or other serialization errors\n console.warn('[Flexium] Failed to serialize state key, using fallback:', error)\n const fallback = String(key)\n return fallback\n }\n}\n\n/**\n * Check global state registry size and warn in development mode.\n * Does not enforce hard limits - use state.delete() or state.clear() for cleanup.\n * @internal\n */\nfunction checkRegistrySize(): void {\n const isDev = typeof process !== 'undefined' && process.env?.NODE_ENV !== 'production'\n if (\n isDev &&\n !hasWarnedAboutSize &&\n globalStateRegistry.size >= DEV_WARNING_THRESHOLD\n ) {\n hasWarnedAboutSize = true\n console.warn(\n `[Flexium] Global state registry has ${globalStateRegistry.size} entries. ` +\n `Consider using state.delete(key) to clean up unused states, ` +\n `or state.clear() to reset all global states.`\n )\n }\n}\n\n/** Action function type for state mutation */\nexport type StateAction<T> = (newValue: T | ((prev: T) => T)) => void\n\n/**\n * StateValue type - a value-like proxy that behaves like T.\n * Can be used directly in expressions and JSX.\n */\nexport type StateValue<T> = T & (() => T) & { peek(): T }\n\n/**\n * Check if a value is a StateValue (created by the state() API).\n * Useful for type guards and runtime detection of reactive state.\n * @internal\n * @param value - The value to check\n * @returns true if the value is a StateValue proxy, false otherwise\n *\n * @example\n * ```tsx\n * const count = state(0)\n * isStateValue(count) // true\n * isStateValue(5) // false\n * ```\n */\nexport function isStateValue(value: unknown): boolean {\n return (\n (typeof value === 'object' || typeof value === 'function') &&\n value !== null &&\n STATE_SIGNAL in value\n )\n}\n\n/**\n * Get the underlying signal from a StateValue proxy.\n * Used internally for reactive binding detection and DOM updates.\n * @internal\n * @param stateValue - The StateValue proxy to extract the signal from\n * @returns The underlying Signal if stateValue is a StateValue, null otherwise\n *\n * @example\n * ```tsx\n * const count = state(0)\n * const signal = getStateSignal(count) // Returns the internal Signal<number>\n * ```\n */\nexport function getStateSignal(stateValue: unknown): Signal<unknown> | null {\n if (isStateValue(stateValue)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (stateValue as any)[STATE_SIGNAL]\n }\n return null\n}\n\n/**\n * Compare a StateValue with a primitive value safely.\n * Handles Proxy comparison automatically by extracting the underlying value.\n * \n * @param stateValue - The StateValue to compare\n * @param value - The value to compare against\n * @returns true if the StateValue's underlying value equals the comparison value\n * \n * @example\n * ```tsx\n * const [count, setCount] = state(0)\n * \n * // ✅ Safe comparison using helper\n * if (equals(count, 5)) {\n * console.log('Count is 5')\n * }\n * \n * // ❌ Direct comparison (always false)\n * if (count === 5) { ... }\n * ```\n */\nexport function equals<T>(stateValue: StateValue<T>, value: T): boolean {\n if (!isStateValue(stateValue)) {\n return false\n }\n const actualValue = stateValue.peek()\n return actualValue === value\n}\n\n/**\n * Check if a StateValue is truthy.\n * Useful for boolean checks without explicit conversion.\n * \n * @param stateValue - The StateValue to check\n * @returns true if the underlying value is truthy\n * \n * @example\n * ```tsx\n * const [user, setUser] = state<User | null>(null)\n * \n * // ✅ Safe boolean check\n * if (isTruthy(user)) {\n * console.log('User exists:', user.name)\n * }\n * \n * // ❌ Direct check (always true for Proxy)\n * if (user) { ... }\n * ```\n */\nexport function isTruthy<T>(stateValue: StateValue<T>): boolean {\n if (!isStateValue(stateValue)) {\n return false\n }\n return Boolean(stateValue.peek())\n}\n\n/**\n * Create a reactive proxy that behaves like a value but stays reactive.\n * The proxy is also callable - calling it returns the current value.\n * This ensures compatibility with code expecting getter functions.\n * \n * Performance optimization: Cache value and type checks to avoid repeated sig.value calls.\n */\nfunction createStateProxy<T>(sig: Signal<T> | Computed<T>): StateValue<T> {\n // Use an arrow function as the target so the proxy is callable but has no prototype\n // This prevents invariant violations in ownKeys trap\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const target = () => sig.value\n\n // Performance: Cache common property accessors to avoid repeated lookups\n const PEEK_PROP = 'peek'\n const VALUE_OF_PROP = 'valueOf'\n const TO_STRING_PROP = 'toString'\n const TO_JSON_PROP = 'toJSON'\n const TO_PRIMITIVE_SYMBOL = Symbol.toPrimitive\n\n const proxy = new Proxy(target, {\n // Make the proxy callable - returns current value\n apply() {\n return sig.value\n },\n\n get(_target, prop) {\n // Return underlying signal for reactive binding detection\n if (prop === STATE_SIGNAL) {\n return sig\n }\n\n // Allow direct access to peek() without tracking\n if (prop === PEEK_PROP) {\n return sig.peek\n }\n\n // Symbol.toPrimitive - called for +, -, ==, template literals, etc.\n if (prop === TO_PRIMITIVE_SYMBOL) {\n return (_hint: string) => sig.value\n }\n\n // valueOf - called for numeric operations\n if (prop === VALUE_OF_PROP) {\n return () => {\n // Optional dev mode warning for comparison operations\n // Note: This is intentionally minimal to avoid performance overhead\n // Full comparison detection would require stack trace analysis\n const isDev = typeof process !== 'undefined' && process.env?.NODE_ENV !== 'production'\n if (isDev && \n typeof process !== 'undefined' && process.env?.FLEXIUM_WARN_COMPARISON === 'true') {\n // Only warn if explicitly enabled via environment variable\n // Most users should rely on ESLint rules instead\n }\n return sig.value\n }\n }\n\n // toString - called for string concatenation\n if (prop === TO_STRING_PROP) {\n return () => String(sig.value)\n }\n\n // toJSON - called for JSON.stringify\n if (prop === TO_JSON_PROP) {\n return () => sig.value\n }\n\n // Performance: Read value once and cache type check result\n // For object/array values, access properties on current value\n // Note: accessing sig.value here tracks the signal in any enclosing effect\n const currentValue = sig.value\n\n // Performance: Early return for null (most common non-object case)\n if (currentValue === null) {\n return undefined\n }\n\n // Performance: Type check once\n const isObject = typeof currentValue === 'object'\n if (isObject) {\n const obj = currentValue as Record<string | symbol, unknown>\n const propValue = obj[prop]\n // If it's a function (like array methods), bind it to the current value\n if (typeof propValue === 'function') {\n return propValue.bind(currentValue)\n }\n return propValue\n }\n\n return undefined\n },\n\n // For property checks (like 'length' in array)\n has(_target, prop) {\n if (prop === STATE_SIGNAL) return true\n // Performance: Read value once\n const currentValue = sig.value\n // Performance: Early return for null\n if (currentValue === null) return false\n // Performance: Type check once\n return typeof currentValue === 'object' && prop in (currentValue as object)\n },\n\n // For Object.keys, for...in loops\n ownKeys(_target) {\n // Performance: Read value once\n const currentValue = sig.value\n // Performance: Early return for null\n if (currentValue === null) return []\n // Performance: Type check once\n if (typeof currentValue === 'object') {\n return Reflect.ownKeys(currentValue as object)\n }\n return []\n },\n\n getOwnPropertyDescriptor(_target, prop) {\n if (prop === STATE_SIGNAL) {\n return { configurable: true, enumerable: false, value: sig }\n }\n // Performance: Read value once\n const currentValue = sig.value\n // Performance: Early return for null\n if (currentValue === null) return undefined\n // Performance: Type check once\n if (typeof currentValue === 'object') {\n const desc = Object.getOwnPropertyDescriptor(currentValue as object, prop)\n if (desc) {\n // Make it configurable to satisfy Proxy invariants\n return { ...desc, configurable: true }\n }\n }\n return undefined\n },\n })\n\n return proxy as StateValue<T>\n}\n\n/** Async state status */\nexport type AsyncStatus = 'idle' | 'loading' | 'success' | 'error'\n\n/** Options for state() */\nexport interface StateOptions<P = unknown> {\n /**\n * Key for global state sharing. Can be a string or array.\n * Array keys are useful for hierarchical namespacing.\n * @example\n * state('light', { key: 'theme' })\n * state(null, { key: ['user', 'profile', userId] })\n */\n key?: StateKey\n /**\n * Parameters to pass to the function (for computed/async state).\n * Improves DX by making dependencies explicit.\n * @example\n * state(\n * async ({ userId }) => fetch(`/api/users/${userId}`),\n * { key: ['user', userId], params: { userId } }\n * )\n */\n params?: P\n}\n\n/**\n * Unified State API\n *\n * One function for all reactive state needs - always returns an array for consistency:\n * 1. Simple state: const [count, setCount] = state(0)\n * 2. Derived state: const [doubled] = state(() => count * 2)\n * 3. Async state: const [data, refetch, status, error] = state(async () => fetch(...))\n * 4. Global state: const [theme, setTheme] = state('light', { key: 'theme' })\n * 5. With params: const [user] = state(async (p) => fetch(`/api/${p.id}`), { params: { id } })\n *\n * @example\n * ```tsx\n * function Counter() {\n * const [count, setCount] = state(0)\n * const [doubled] = state(() => count * 2)\n * return <Button onPress={() => setCount(count + 1)}>{doubled}</Button>\n * }\n * ```\n */\n// Static methods interface for the state function\ninterface StateFunction {\n // Overloads\n <T>(initialValue: T, options?: StateOptions): [StateValue<T>, StateAction<T>]\n <T, P>(computeFn: (params: P) => T, options: StateOptions<P> & { params: P }): [StateValue<T>]\n <T>(computeFn: () => T, options?: StateOptions): [StateValue<T>]\n <T, P>(fetcher: (params: P) => Promise<T>, options: StateOptions<P> & { params: P }): [StateValue<T | undefined>, () => void, StateValue<AsyncStatus>, StateValue<unknown>]\n <T>(fetcher: () => Promise<T>, options?: StateOptions): [StateValue<T | undefined>, () => void, StateValue<AsyncStatus>, StateValue<unknown>]\n\n /** Delete a specific global state by key */\n delete: (key: StateKey) => boolean\n /** Clear all global states */\n clear: () => void\n /** Check if a global state exists */\n has: (key: StateKey) => boolean\n /** Current number of global states */\n readonly size: number\n}\n\n// Overload 1: Value → [StateValue, Setter]\nfunction state<T>(\n initialValue: T,\n options?: StateOptions\n): [StateValue<T>, StateAction<T>]\n\n// Overload 2: Sync function with params → [StateValue] (derived, no setter)\nfunction state<T, P>(\n computeFn: (params: P) => T,\n options: StateOptions<P> & { params: P }\n): [StateValue<T>]\n\n// Overload 3: Sync function without params → [StateValue] (derived, no setter)\nfunction state<T>(\n computeFn: () => T,\n options?: StateOptions\n): [StateValue<T>]\n\n// Overload 4: Async function with params → [StateValue, refetch, status, error]\nfunction state<T, P>(\n fetcher: (params: P) => Promise<T>,\n options: StateOptions<P> & { params: P }\n): [StateValue<T | undefined>, () => void, StateValue<AsyncStatus>, StateValue<unknown>]\n\n// Overload 5: Async function without params → [StateValue, refetch, status, error]\nfunction state<T>(\n fetcher: () => Promise<T>,\n options?: StateOptions\n): [StateValue<T | undefined>, () => void, StateValue<AsyncStatus>, StateValue<unknown>]\n\nfunction state<T, P = unknown>(\n initialValueOrFetcher: T | ((params?: P) => T) | ((params?: P) => Promise<T>),\n options?: StateOptions<P>\n): [StateValue<T>] | [StateValue<T>, StateAction<T>] | [StateValue<T | undefined>, () => void, StateValue<AsyncStatus>, StateValue<unknown>] {\n const key = options?.key ? serializeKey(options.key) : undefined\n const params = options?.params\n\n // 0. Hook System - reuse state from previous render if inside a component\n if (currentComponent && !key) {\n const comp = currentComponent\n const hookIndex = comp.hookIndex++\n\n // Return existing hook if available\n if (hookIndex < comp.hooks.length) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return comp.hooks[hookIndex] as any\n }\n\n // Create new state and store in hooks array\n // Temporarily clear currentComponent to avoid infinite recursion\n const savedComponent = currentComponent\n currentComponent = null\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = state(initialValueOrFetcher as any, options as any)\n currentComponent = savedComponent\n\n comp.hooks.push(result)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return result as any\n }\n\n // 1. Check Global Registry for keyed state\n if (key && globalStateRegistry.has(key)) {\n const cached = globalStateRegistry.get(key)!\n const isAsync = 'loading' in cached && cached._stateActions?.refetch !== undefined\n const isComputed = cached._isComputed\n\n const proxy = createStateProxy(cached._signal as Signal<T>)\n\n if (isComputed) {\n return [proxy] as [StateValue<T>]\n }\n\n if (isAsync) {\n const refetch = cached._stateActions?.refetch || (() => { })\n // Performance: Use computed directly instead of state() to avoid recursion\n const statusComputed = computed<AsyncStatus>(() => {\n if (cached.error) return 'error'\n if (cached.loading) return 'loading'\n if (cached.value !== undefined) return 'success'\n return 'idle'\n })\n const errorComputed = computed<unknown>(() => cached.error)\n const statusValue = createStateProxy(statusComputed)\n const errorValue = createStateProxy(errorComputed)\n return [proxy, refetch, statusValue, errorValue] as [StateValue<T | undefined>, () => void, StateValue<AsyncStatus>, StateValue<unknown>]\n }\n\n const setter: StateAction<T> = (newValue) => {\n if (typeof newValue === 'function') {\n cached.value = (newValue as (prev: T) => T)(cached.peek() as T)\n } else {\n cached.value = newValue\n }\n }\n return [proxy, setter] as [StateValue<T>, StateAction<T>]\n }\n\n // 2. Handle function input (computed or async)\n if (typeof initialValueOrFetcher === 'function') {\n const originalFn = initialValueOrFetcher as (params?: P) => T | Promise<T>\n // Wrap function to inject params if provided\n const fn = params !== undefined\n ? () => originalFn(params)\n : originalFn as () => T | Promise<T>\n\n // Try to detect if it's async by checking constructor name\n // This handles `async () => ...` functions\n const isAsyncFn = originalFn.constructor.name === 'AsyncFunction'\n\n if (isAsyncFn) {\n // Async function → Resource\n const [res, resActions] = createResource(fn, async (val) => val)\n const s = toStateObject(res, resActions)\n\n if (key) {\n globalStateRegistry.set(key, s)\n checkRegistrySize()\n }\n\n const proxy = createStateProxy(s._signal as Signal<T>)\n // Performance: Use computed directly instead of state() to avoid recursion\n const statusComputed = computed<AsyncStatus>(() => {\n if (s.error) return 'error'\n if (s.loading) return 'loading'\n if (s.value !== undefined) return 'success'\n return 'idle'\n })\n const errorComputed = computed<unknown>(() => s.error)\n const statusValue = createStateProxy(statusComputed)\n const errorValue = createStateProxy(errorComputed)\n\n return [proxy, resActions.refetch, statusValue, errorValue] as [StateValue<T | undefined>, () => void, StateValue<AsyncStatus>, StateValue<unknown>]\n }\n\n // Sync function → Computed\n // First, try running to check if it returns a Promise (for non-async functions that return Promise)\n let testResult: T | Promise<T>\n try {\n testResult = fn()\n } catch {\n // If it throws during initial call, treat as computed (will throw on access)\n const comp = computed(fn as () => T)\n const s = toComputedStateObject(comp)\n if (key) {\n globalStateRegistry.set(key, s)\n checkRegistrySize()\n }\n return [createStateProxy(comp)] as [StateValue<T>]\n }\n\n if (testResult instanceof Promise) {\n // It's a Promise-returning function → Resource\n const [res, resActions] = createResource(fn, async (val) => val)\n const s = toStateObject(res, resActions)\n\n if (key) {\n globalStateRegistry.set(key, s)\n checkRegistrySize()\n }\n\n const proxy = createStateProxy(s._signal as Signal<T>)\n // Performance: Use computed directly instead of state() to avoid recursion\n const statusComputed = computed<AsyncStatus>(() => {\n if (s.error) return 'error'\n if (s.loading) return 'loading'\n if (s.value !== undefined) return 'success'\n return 'idle'\n })\n const errorComputed = computed<unknown>(() => s.error)\n const statusValue = createStateProxy(statusComputed)\n const errorValue = createStateProxy(errorComputed)\n\n return [proxy, resActions.refetch, statusValue, errorValue] as [StateValue<T | undefined>, () => void, StateValue<AsyncStatus>, StateValue<unknown>]\n }\n\n // Sync function → Computed (memoized derived value)\n const comp = computed(fn as () => T)\n const s = toComputedStateObject(comp)\n if (key) {\n globalStateRegistry.set(key, s)\n checkRegistrySize()\n }\n return [createStateProxy(comp)] as [StateValue<T>]\n }\n\n // 3. Plain value → Signal with setter\n const sig = signal<T>(initialValueOrFetcher)\n const s = toSignalStateObject(sig)\n\n if (key) {\n globalStateRegistry.set(key, s)\n checkRegistrySize()\n }\n\n const proxy = createStateProxy(sig)\n const setter: StateAction<T> = (newValue) => {\n if (typeof newValue === 'function') {\n sig.value = (newValue as (prev: T) => T)(sig.peek())\n } else {\n sig.value = newValue\n }\n }\n\n return [proxy, setter] as [StateValue<T>, StateAction<T>]\n}\n\n/**\n * Delete a specific global state by key\n * @param key - The key of the state to delete\n * @returns true if the state was deleted, false if it didn't exist\n *\n * @example\n * ```ts\n * state.delete('theme')\n * state.delete(['user', 'profile', userId])\n * ```\n */\nstate.delete = function (key: StateKey): boolean {\n const serializedKey = serializeKey(key)\n return globalStateRegistry.delete(serializedKey)\n}\n\n/**\n * Clear all global states (useful for testing or resetting app)\n *\n * @example\n * ```ts\n * state.clear()\n * ```\n */\nstate.clear = function (): void {\n globalStateRegistry.clear()\n hasWarnedAboutSize = false\n}\n\n/**\n * Check if a global state exists\n * @param key - The key to check\n * @returns true if the state exists\n *\n * @example\n * ```ts\n * if (state.has('theme')) { ... }\n * ```\n */\nstate.has = function (key: StateKey): boolean {\n const serializedKey = serializeKey(key)\n return globalStateRegistry.has(serializedKey)\n}\n\n/**\n * Get the current number of global states\n */\nObject.defineProperty(state, 'size', {\n get: () => globalStateRegistry.size,\n enumerable: true,\n})\n\n// Export with proper typing (cast to include static methods)\nconst _state = state as StateFunction\nexport { _state as state }\n\n/**\n * Ref object type for DOM element references\n */\nexport interface RefObject<T> {\n current: T | null\n}\n\n/**\n * Create a ref object to hold a reference to a DOM element.\n * Use with the `ref` prop on JSX elements.\n *\n * @param initialValue - Initial value (typically null)\n * @returns A ref object with a `current` property\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const inputRef = ref<HTMLInputElement>(null)\n *\n * const focusInput = () => {\n * inputRef.current?.focus()\n * }\n *\n * return (\n * <div>\n * <input ref={inputRef} type=\"text\" />\n * <button onclick={focusInput}>Focus</button>\n * </div>\n * )\n * }\n * ```\n */\nexport function ref<T>(initialValue: T | null): RefObject<T> {\n return { current: initialValue }\n}\n\n/**\n * Type helper for creating state with explicit type inference.\n * Useful when TypeScript inference fails or you want clearer types.\n * \n * @param initial - Initial value\n * @returns Tuple of [StateValue, StateAction]\n * \n * @example\n * ```tsx\n * // Better type inference in some cases\n * const [user, setUser] = createState<User | null>(null)\n * ```\n */\nexport function createState<T>(initial: T): [StateValue<T>, StateAction<T>] {\n return state(initial)\n}\n\n/**\n * Type helper for creating computed state with explicit type inference.\n * Useful when TypeScript inference fails or you want clearer types.\n * \n * @param fn - Computed function\n * @returns Tuple of [StateValue]\n * \n * @example\n * ```tsx\n * // Better type inference in some cases\n * const [total] = createComputed(() => items.reduce((sum, item) => sum + item.price, 0))\n * ```\n */\nexport function createComputed<T>(fn: () => T): [StateValue<T>] {\n // Use the imported computed from signal.ts, not state() to avoid recursion\n const comp = computed(fn)\n const s = toComputedStateObject(comp)\n return [createStateProxy(comp)] as [StateValue<T>]\n}\n"]}
|
package/dist/signal-AXKUQJVA.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkMKE3KA43_js=require('./chunk-MKE3KA43.js');Object.defineProperty(exports,"computed",{enumerable:true,get:function(){return chunkMKE3KA43_js.l}});Object.defineProperty(exports,"createResource",{enumerable:true,get:function(){return chunkMKE3KA43_js.o}});Object.defineProperty(exports,"effect",{enumerable:true,get:function(){return chunkMKE3KA43_js.i}});Object.defineProperty(exports,"isSignal",{enumerable:true,get:function(){return chunkMKE3KA43_js.m}});Object.defineProperty(exports,"onCleanup",{enumerable:true,get:function(){return chunkMKE3KA43_js.n}});Object.defineProperty(exports,"onMount",{enumerable:true,get:function(){return chunkMKE3KA43_js.g}});Object.defineProperty(exports,"root",{enumerable:true,get:function(){return chunkMKE3KA43_js.f}});Object.defineProperty(exports,"setDevToolsHooks",{enumerable:true,get:function(){return chunkMKE3KA43_js.j}});Object.defineProperty(exports,"signal",{enumerable:true,get:function(){return chunkMKE3KA43_js.k}});Object.defineProperty(exports,"untrack",{enumerable:true,get:function(){return chunkMKE3KA43_js.d}});//# sourceMappingURL=signal-AXKUQJVA.js.map
|
|
2
|
-
//# sourceMappingURL=signal-AXKUQJVA.js.map
|
package/dist/signal-HM2LG5YL.mjs
DELETED
|
File without changes
|
|
File without changes
|