@unsetsoft/ryunixjs 1.2.3-canary.8 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"Ryunix.umd.min.js","sources":["../src/utils/index.js","../src/lib/createElement.js","../src/lib/effects.js","../src/lib/dom.js","../src/lib/commits.js","../src/lib/reconciler.js","../src/lib/components.js","../src/lib/priority.js","../src/lib/profiler.js","../src/lib/workers.js","../src/lib/render.js","../src/lib/hooks.js","../src/lib/memo.js","../src/lib/lazy.js","../src/lib/batching.js","../src/main.js"],"sourcesContent":["// Improved state management - avoid global mutable object\n// Instead, create a state manager that can be instantiated per render tree\n\nconst createRenderState = () => ({\n containerRoot: null,\n nextUnitOfWork: null,\n currentRoot: null,\n wipRoot: null,\n deletions: [],\n wipFiber: null,\n hookIndex: 0,\n effects: [],\n})\n\n// Singleton for backward compatibility, but allows testing with isolated instances\nlet globalState = createRenderState()\n\nconst getState = () => globalState\nconst resetState = () => {\n globalState = createRenderState()\n return globalState\n}\n\n// Use const for regex to prevent accidental modification\nconst CAMEL_TO_KEBAB_REGEX = /[A-Z]/g\n\nconst RYUNIX_TYPES = Object.freeze({\n TEXT_ELEMENT: Symbol.for('ryunix.text.element'),\n RYUNIX_ELEMENT: Symbol.for('ryunix.element'),\n RYUNIX_EFFECT: Symbol.for('ryunix.effect'),\n RYUNIX_MEMO: Symbol.for('ryunix.memo'),\n RYUNIX_URL_QUERY: Symbol.for('ryunix.urlQuery'),\n RYUNIX_REF: Symbol.for('ryunix.ref'),\n RYUNIX_STORE: Symbol.for('ryunix.store'),\n RYUNIX_REDUCE: Symbol.for('ryunix.reduce'),\n RYUNIX_FRAGMENT: Symbol.for('ryunix.fragment'),\n RYUNIX_CONTEXT: Symbol.for('ryunix.context'),\n})\n\nconst STRINGS = Object.freeze({\n OBJECT: 'object',\n FUNCTION: 'function',\n STYLE: 'ryunix-style',\n CLASS_NAME: 'ryunix-class',\n CHILDREN: 'children',\n BOOLEAN: 'boolean',\n STRING: 'string',\n UNDEFINED: 'undefined',\n})\n\nconst OLD_STRINGS = Object.freeze({\n STYLE: 'style',\n CLASS_NAME: 'className',\n})\n\nconst EFFECT_TAGS = Object.freeze({\n PLACEMENT: Symbol.for('ryunix.reconciler.status.placement'),\n UPDATE: Symbol.for('ryunix.reconciler.status.update'),\n DELETION: Symbol.for('ryunix.reconciler.status.deletion'),\n NO_EFFECT: Symbol.for('ryunix.reconciler.status.no_effect'),\n})\n\n/**\n * Generate a unique hash with optional prefix\n * @param {string} prefix - Optional prefix for the hash\n * @returns {string} Unique hash string\n */\nconst generateHash = (prefix = 'ryunix') => {\n const randomPart = Math.random().toString(36).substring(2, 11)\n const timestamp = Date.now().toString(36)\n return `${prefix}-${timestamp}-${randomPart}`\n}\n\n/**\n * Match a route pattern against a path\n * @param {string} pattern - Route pattern with :params\n * @param {string} path - URL path to match\n * @returns {Object|null} Params object or null if no match\n */\nconst matchPath = (pattern, path) => {\n if (!pattern || !path) return null\n\n // Wildcard matches everything\n if (pattern === '*') return {}\n\n const patternSegments = pattern.split('/').filter(Boolean)\n const pathSegments = path.split('/').filter(Boolean)\n\n // Different number of segments = no match\n if (patternSegments.length !== pathSegments.length) return null\n\n const params = {}\n\n for (let i = 0; i < patternSegments.length; i++) {\n const patternSeg = patternSegments[i]\n const pathSeg = pathSegments[i]\n\n if (patternSeg.startsWith(':')) {\n // Dynamic segment\n const paramName = patternSeg.slice(1)\n params[paramName] = decodeURIComponent(pathSeg)\n } else if (patternSeg !== pathSeg) {\n // Static segment doesn't match\n return null\n }\n }\n\n return params\n}\n\n/**\n * Parse query string into object\n * @param {string} search - Query string (with or without ?)\n * @returns {Object} Parsed query parameters\n */\nconst parseQuery = (search) => {\n if (!search) return {}\n\n // Remove leading ? if present\n const cleanSearch = search.startsWith('?') ? search.slice(1) : search\n\n if (!cleanSearch) return {}\n\n try {\n return Object.fromEntries(new URLSearchParams(cleanSearch))\n } catch (error) {\n console.warn('Failed to parse query string:', error)\n return {}\n }\n}\n\n/**\n * Deep equality check for hook dependencies\n * @param {Array} prevDeps - Previous dependencies\n * @param {Array} nextDeps - Next dependencies\n * @returns {boolean} Whether dependencies changed\n */\nconst haveDepsChanged = (prevDeps, nextDeps) => {\n if (!prevDeps || !nextDeps) return true\n if (prevDeps.length !== nextDeps.length) return true\n\n return prevDeps.some((dep, index) => !Object.is(dep, nextDeps[index]))\n}\n\n/**\n * Safe array flattening\n * @param {Array} arr - Array to flatten\n * @param {number} depth - Depth to flatten (default: 1)\n * @returns {Array} Flattened array\n */\nconst flattenArray = (arr, depth = 1) => {\n if (!Array.isArray(arr)) return [arr]\n if (depth < 1) return arr.slice()\n\n return arr.reduce((acc, val) => {\n if (Array.isArray(val) && depth > 0) {\n acc.push(...flattenArray(val, depth - 1))\n } else {\n acc.push(val)\n }\n return acc\n }, [])\n}\n\n/**\n * Type checking utilities\n */\nconst is = {\n object: (val) => val !== null && typeof val === STRINGS.OBJECT,\n function: (val) => typeof val === STRINGS.FUNCTION,\n string: (val) => typeof val === STRINGS.STRING,\n undefined: (val) => typeof val === STRINGS.UNDEFINED,\n null: (val) => val === null,\n array: (val) => Array.isArray(val),\n promise: (val) => val instanceof Promise,\n}\n\nexport {\n getState,\n resetState,\n createRenderState,\n CAMEL_TO_KEBAB_REGEX,\n RYUNIX_TYPES,\n EFFECT_TAGS,\n STRINGS,\n OLD_STRINGS,\n generateHash,\n matchPath,\n parseQuery,\n haveDepsChanged,\n flattenArray,\n is,\n}\n","import { RYUNIX_TYPES, STRINGS, is } from '../utils/index'\n\n/**\n * Create text element\n */\nconst createTextElement = (text) => {\n return {\n type: RYUNIX_TYPES.TEXT_ELEMENT,\n props: {\n nodeValue: text,\n children: [],\n },\n }\n}\n\n/**\n * Create element\n */\nconst createElement = (type, props, ...children) => {\n const safeProps = props || {}\n\n return {\n type,\n props: {\n ...safeProps,\n children: children\n .flat()\n .map((child) =>\n typeof child === STRINGS.OBJECT ? child : createTextElement(child),\n ),\n },\n }\n}\n\n/**\n * Fragment component\n */\nconst Fragment = (props) => {\n const children = Array.isArray(props.children)\n ? props.children\n : [props.children]\n return createElement(RYUNIX_TYPES.RYUNIX_FRAGMENT, {}, ...children)\n}\n\n/**\n * Clone element utility\n */\nconst cloneElement = (element, props = {}, ...children) => {\n if (!element || !is.object(element)) {\n throw new Error('cloneElement requires a valid element')\n }\n\n const newChildren = children.length > 0 ? children : element.props.children\n\n return createElement(\n element.type,\n { ...element.props, ...props },\n ...(Array.isArray(newChildren) ? newChildren : [newChildren]),\n )\n}\n\n/**\n * Check if valid element\n */\nconst isValidElement = (object) => {\n return (\n is.object(object) && object.type !== undefined && object.props !== undefined\n )\n}\n\nexport {\n createElement,\n createTextElement,\n Fragment,\n cloneElement,\n isValidElement,\n}\n","import { RYUNIX_TYPES, STRINGS, is } from '../utils/index'\n\n/**\n * Check if a key is an event handler\n * @param {string} key - Prop key\n * @returns {boolean}\n */\nconst isEvent = (key) => key.startsWith('on')\n\n/**\n * Check if a key is a property (not children or event)\n * @param {string} key - Prop key\n * @returns {boolean}\n */\nconst isProperty = (key) => key !== STRINGS.CHILDREN && !isEvent(key)\n\n/**\n * Check if a property is new or changed\n * @param {Object} prev - Previous props\n * @param {Object} next - Next props\n * @returns {Function}\n */\nconst isNew = (prev, next) => (key) => {\n // Use Object.is for better comparison (handles NaN, -0, +0)\n return !Object.is(prev[key], next[key])\n}\n\n/**\n * Check if a property was removed\n * @param {Object} next - Next props\n * @returns {Function}\n */\nconst isGone = (next) => (key) => !(key in next)\n\n/**\n * Check if dependencies array has changed\n * @param {Array} prevDeps - Previous dependencies\n * @param {Array} nextDeps - Next dependencies\n * @returns {boolean}\n */\nconst haveDepsChanged = (prevDeps, nextDeps) => {\n if (!prevDeps || !nextDeps) return true\n if (prevDeps.length !== nextDeps.length) return true\n return prevDeps.some((dep, index) => !Object.is(dep, nextDeps[index]))\n}\n\n/**\n * Cancel effects for a single fiber\n * @param {Object} fiber - Fiber node\n */\nconst cancelEffects = (fiber) => {\n if (!fiber?.hooks?.length) return\n\n fiber.hooks\n .filter(\n (hook) =>\n hook.type === RYUNIX_TYPES.RYUNIX_EFFECT && is.function(hook.cancel),\n )\n .forEach((hook) => {\n try {\n hook.cancel()\n hook.cancel = null // Clear reference to prevent memory leaks\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in effect cleanup:', error)\n }\n }\n })\n}\n\n/**\n * Recursively cancel effects in fiber tree\n * @param {Object} fiber - Root fiber node\n */\nconst cancelEffectsDeep = (fiber) => {\n if (!fiber) return\n\n // Cancel effects for current fiber\n if (fiber.hooks?.length > 0) {\n fiber.hooks\n .filter(\n (hook) =>\n hook.type === RYUNIX_TYPES.RYUNIX_EFFECT && is.function(hook.cancel),\n )\n .forEach((hook) => {\n try {\n hook.cancel()\n hook.cancel = null // Clear reference\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in deep effect cleanup:', error)\n }\n }\n })\n }\n\n // Recursively process children\n if (fiber.child) cancelEffectsDeep(fiber.child)\n if (fiber.sibling) cancelEffectsDeep(fiber.sibling)\n}\n\n/**\n * Run effects for a fiber\n * @param {Object} fiber - Fiber node\n */\nconst runEffects = (fiber) => {\n if (!fiber?.hooks?.length) return\n\n for (let i = 0; i < fiber.hooks.length; i++) {\n const hook = fiber.hooks[i]\n\n if (hook.type === RYUNIX_TYPES.RYUNIX_EFFECT && is.function(hook.effect)) {\n // Cancel previous cleanup if exists\n if (is.function(hook.cancel)) {\n try {\n hook.cancel()\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in effect cleanup:', error)\n }\n }\n }\n\n // Run new effect\n try {\n const cleanup = hook.effect()\n\n // Store cleanup function if returned\n if (is.function(cleanup)) {\n hook.cancel = cleanup\n } else {\n hook.cancel = null\n }\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in effect:', error)\n }\n hook.cancel = null\n }\n\n // Clear effect reference after running\n hook.effect = null\n }\n }\n}\n\n/**\n * Batch multiple effect operations\n * @param {Function} callback - Callback containing effect operations\n */\nconst batchEffects = (callback) => {\n // Could implement batching logic here for performance\n // For now, just execute immediately\n callback()\n}\n\nexport {\n runEffects,\n cancelEffects,\n cancelEffectsDeep,\n isEvent,\n isProperty,\n isNew,\n isGone,\n haveDepsChanged,\n batchEffects,\n}\n","import { isEvent, isGone, isNew, isProperty } from './effects'\nimport {\n RYUNIX_TYPES,\n STRINGS,\n OLD_STRINGS,\n CAMEL_TO_KEBAB_REGEX,\n is,\n} from '../utils/index'\n\n/**\n * Convert camelCase to kebab-case for CSS properties\n * @param {string} camelCase - CamelCase string\n * @returns {string} Kebab-case string\n */\nconst camelToKebab = (camelCase) => {\n return camelCase.replace(\n CAMEL_TO_KEBAB_REGEX,\n (match) => `-${match.toLowerCase()}`,\n )\n}\n\n/**\n * Apply styles to DOM element\n * @param {HTMLElement} dom - DOM element\n * @param {Object} styleObj - Style object\n */\nconst applyStyles = (dom, styleObj) => {\n if (!is.object(styleObj) || is.null(styleObj)) {\n dom.style.cssText = ''\n return\n }\n\n try {\n const cssText = Object.entries(styleObj)\n .filter(([_, value]) => value != null) // Filter out null/undefined\n .map(([key, value]) => {\n const kebabKey = camelToKebab(key)\n return `${kebabKey}: ${value}`\n })\n .join('; ')\n\n dom.style.cssText = cssText\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error applying styles:', error)\n }\n }\n}\n\n/**\n * Apply CSS classes to DOM element\n * @param {HTMLElement} dom - DOM element\n * @param {string} prevClasses - Previous class string\n * @param {string} nextClasses - Next class string\n */\nconst applyClasses = (dom, prevClasses, nextClasses) => {\n // Allow empty/undefined - just remove classes\n if (!nextClasses || nextClasses.trim() === '') {\n if (prevClasses) {\n const oldClasses = prevClasses.split(/\\s+/).filter(Boolean)\n dom.classList.remove(...oldClasses)\n }\n return\n }\n\n // Remove old classes\n if (prevClasses) {\n const oldClasses = prevClasses.split(/\\s+/).filter(Boolean)\n dom.classList.remove(...oldClasses)\n }\n\n // Add new classes\n const newClasses = nextClasses.split(/\\s+/).filter(Boolean)\n if (newClasses.length > 0) {\n dom.classList.add(...newClasses)\n }\n}\n\n/**\n * Create a DOM element from fiber\n * @param {Object} fiber - Fiber node\n * @returns {HTMLElement|Text|null}\n */\nconst createDom = (fiber) => {\n // Fragments don't create real DOM nodes\n if (fiber.type === RYUNIX_TYPES.RYUNIX_FRAGMENT) {\n return null\n }\n\n let dom\n\n try {\n if (fiber.type === RYUNIX_TYPES.TEXT_ELEMENT) {\n dom = document.createTextNode('')\n } else if (is.string(fiber.type)) {\n dom = document.createElement(fiber.type)\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Attempted to create DOM for non-host component:',\n fiber.type,\n )\n }\n return null\n }\n\n updateDom(dom, {}, fiber.props)\n return dom\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error creating DOM element:', error, fiber)\n }\n return null\n }\n}\n\n/**\n * Update DOM element with new props\n * @param {HTMLElement|Text} dom - DOM element\n * @param {Object} prevProps - Previous props\n * @param {Object} nextProps - Next props\n */\nconst updateDom = (dom, prevProps = {}, nextProps = {}) => {\n // Remove old event listeners\n Object.keys(prevProps)\n .filter(isEvent)\n .filter((key) => isGone(nextProps)(key) || isNew(prevProps, nextProps)(key))\n .forEach((name) => {\n const eventType = name.toLowerCase().substring(2)\n try {\n dom.removeEventListener(eventType, prevProps[name])\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Error removing event listener:', error)\n }\n }\n })\n\n // Remove old properties\n Object.keys(prevProps)\n .filter(isProperty)\n .filter(isGone(nextProps))\n .forEach((name) => {\n // Skip special properties\n if (\n [\n STRINGS.STYLE,\n OLD_STRINGS.STYLE,\n STRINGS.CLASS_NAME,\n OLD_STRINGS.CLASS_NAME,\n ].includes(name)\n ) {\n return\n }\n dom[name] = ''\n })\n\n // Set new properties\n Object.keys(nextProps)\n .filter(isProperty)\n .filter(isNew(prevProps, nextProps))\n .forEach((name) => {\n try {\n // Handle style properties\n if (name === STRINGS.STYLE || name === OLD_STRINGS.STYLE) {\n const styleValue = nextProps[name]\n applyStyles(dom, styleValue)\n }\n // Handle className properties\n else if (name === STRINGS.CLASS_NAME) {\n applyClasses(\n dom,\n prevProps[STRINGS.CLASS_NAME],\n nextProps[STRINGS.CLASS_NAME],\n )\n } else if (name === OLD_STRINGS.CLASS_NAME) {\n applyClasses(\n dom,\n prevProps[OLD_STRINGS.CLASS_NAME],\n nextProps[OLD_STRINGS.CLASS_NAME],\n )\n }\n // Handle other properties\n else {\n // Special handling for value and checked (controlled components)\n if (name === 'value' || name === 'checked') {\n if (dom[name] !== nextProps[name]) {\n dom[name] = nextProps[name]\n }\n } else {\n dom[name] = nextProps[name]\n }\n }\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Error setting property ${name}:`, error)\n }\n }\n })\n\n // Add new event listeners\n Object.keys(nextProps)\n .filter(isEvent)\n .filter(isNew(prevProps, nextProps))\n .forEach((name) => {\n const eventType = name.toLowerCase().substring(2)\n try {\n dom.addEventListener(eventType, nextProps[name])\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Error adding event listener:', error)\n }\n }\n })\n}\n\n/**\n * Remove DOM element safely\n * @param {HTMLElement} dom - DOM element to remove\n */\nconst removeDom = (dom) => {\n try {\n if (dom && dom.parentNode) {\n dom.parentNode.removeChild(dom)\n }\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error removing DOM element:', error)\n }\n }\n}\n\nexport {\n createDom,\n updateDom,\n applyStyles,\n applyClasses,\n removeDom,\n camelToKebab,\n}\n","import { updateDom } from './dom'\nimport { cancelEffects, cancelEffectsDeep, runEffects } from './effects'\nimport { EFFECT_TAGS, getState } from '../utils/index'\n\nconst commitRoot = () => {\n const state = getState()\n state.deletions.forEach(commitWork)\n commitWork(state.wipRoot.child)\n state.currentRoot = state.wipRoot\n state.wipRoot = null\n}\n\nconst commitWork = (fiber) => {\n if (!fiber) {\n return\n }\n\n let domParentFiber = fiber.parent\n while (!domParentFiber.dom) {\n domParentFiber = domParentFiber.parent\n }\n const domParent = domParentFiber.dom\n\n if (fiber.effectTag === EFFECT_TAGS.PLACEMENT) {\n if (fiber.dom != null) {\n domParent.appendChild(fiber.dom)\n }\n runEffects(fiber)\n } else if (fiber.effectTag === EFFECT_TAGS.UPDATE) {\n cancelEffects(fiber)\n if (fiber.dom != null) {\n updateDom(fiber.dom, fiber.alternate.props, fiber.props)\n }\n runEffects(fiber)\n } else if (fiber.effectTag === EFFECT_TAGS.DELETION) {\n cancelEffectsDeep(fiber)\n commitDeletion(fiber, domParent)\n return\n }\n\n commitWork(fiber.child)\n commitWork(fiber.sibling)\n}\n\nconst commitDeletion = (fiber, domParent) => {\n if (fiber.dom) {\n domParent.removeChild(fiber.dom)\n } else {\n let child = fiber.child\n while (child) {\n commitDeletion(child, domParent)\n child = child.sibling\n }\n }\n}\n\nexport { commitDeletion, commitWork, commitRoot }\n","import { EFFECT_TAGS, getState } from '../utils/index'\n\n/**\n * Reconcile children with key optimization\n */\nconst reconcileChildren = (wipFiber, elements) => {\n const state = getState()\n let index = 0\n let prevSibling\n\n // Build map of old fibers by key/index\n const oldFiberMap = new Map()\n let oldFiber = wipFiber.alternate?.child\n let position = 0\n\n while (oldFiber) {\n const key = oldFiber.key ?? `__index_${position}__`\n oldFiberMap.set(key, oldFiber)\n oldFiber = oldFiber.sibling\n position++\n }\n\n // Process new elements\n while (index < elements.length) {\n const element = elements[index]\n if (!element) {\n index++\n continue\n }\n\n const key = element.key ?? `__index_${index}__`\n const matchedFiber = oldFiberMap.get(key)\n\n let newFiber\n const sameType = matchedFiber && element.type === matchedFiber.type\n\n if (sameType) {\n // Update existing fiber\n newFiber = {\n type: matchedFiber.type,\n props: element.props,\n dom: matchedFiber.dom,\n parent: wipFiber,\n alternate: matchedFiber,\n effectTag: EFFECT_TAGS.UPDATE,\n hooks: matchedFiber.hooks,\n key: element.key,\n }\n oldFiberMap.delete(key)\n } else {\n // Create new fiber\n newFiber = {\n type: element.type,\n props: element.props,\n dom: null,\n parent: wipFiber,\n alternate: null,\n effectTag: EFFECT_TAGS.PLACEMENT,\n key: element.key,\n }\n\n // Mark matched fiber for deletion if exists\n if (matchedFiber) {\n matchedFiber.effectTag = EFFECT_TAGS.DELETION\n state.deletions.push(matchedFiber)\n oldFiberMap.delete(key)\n }\n }\n\n // Link fibers\n if (index === 0) {\n wipFiber.child = newFiber\n } else if (newFiber) {\n prevSibling.sibling = newFiber\n }\n\n prevSibling = newFiber\n index++\n }\n\n // Delete remaining old fibers\n oldFiberMap.forEach((fiber) => {\n fiber.effectTag = EFFECT_TAGS.DELETION\n state.deletions.push(fiber)\n })\n}\n\nexport { reconcileChildren }\n","import { createDom } from './dom'\nimport { reconcileChildren } from './reconciler'\nimport { getState } from '../utils/index'\nimport { createElement } from './createElement'\n\nconst updateFunctionComponent = (fiber) => {\n const state = getState()\n state.wipFiber = fiber\n state.hookIndex = 0\n state.wipFiber.hooks = []\n\n const children = [fiber.type(fiber.props)]\n\n if (fiber.type._contextId && fiber.props.value !== undefined) {\n fiber._contextId = fiber.type._contextId\n fiber._contextValue = fiber.props.value\n }\n\n reconcileChildren(fiber, children)\n}\n\nconst updateHostComponent = (fiber) => {\n if (!fiber.dom) {\n fiber.dom = createDom(fiber)\n }\n const children = fiber.props?.children || []\n reconcileChildren(fiber, children)\n}\n\nconst Image = ({ src, ...props }) => {\n return createElement('img', { ...props, src })\n}\n\nexport { updateFunctionComponent, updateHostComponent, Image }\n","/**\n * Priority levels for updates\n */\nconst Priority = {\n IMMEDIATE: 1, // User input (clicks, typing)\n USER_BLOCKING: 2, // Hover, scroll\n NORMAL: 3, // Data fetching\n LOW: 4, // Analytics\n IDLE: 5, // Background tasks\n}\n\nlet currentPriority = Priority.NORMAL\nlet pendingUpdates = []\nlet isScheduling = false\n\n/**\n * Schedule update with priority\n */\nconst scheduleUpdate = (callback, priority = Priority.NORMAL) => {\n pendingUpdates.push({ callback, priority, timestamp: Date.now() })\n\n if (!isScheduling) {\n isScheduling = true\n requestIdleCallback(processPendingUpdates)\n }\n}\n\n/**\n * Process updates by priority\n */\nconst processPendingUpdates = (deadline) => {\n pendingUpdates.sort((a, b) => a.priority - b.priority)\n\n while (pendingUpdates.length > 0 && deadline.timeRemaining() > 1) {\n const update = pendingUpdates.shift()\n currentPriority = update.priority\n update.callback()\n }\n\n if (pendingUpdates.length > 0) {\n requestIdleCallback(processPendingUpdates)\n } else {\n isScheduling = false\n currentPriority = Priority.NORMAL\n }\n}\n\n/**\n * Run callback with specific priority\n */\nconst runWithPriority = (priority, callback) => {\n const previousPriority = currentPriority\n currentPriority = priority\n\n try {\n return callback()\n } finally {\n currentPriority = previousPriority\n }\n}\n\n/**\n * Get current priority\n */\nconst getCurrentPriority = () => currentPriority\n\n/**\n * Wrap setState with priority\n */\nconst createPriorityDispatch = (dispatch) => {\n return (action, priority = currentPriority) => {\n scheduleUpdate(() => dispatch(action), priority)\n }\n}\n\nexport {\n Priority,\n scheduleUpdate,\n runWithPriority,\n getCurrentPriority,\n createPriorityDispatch,\n}\n","/**\n * Performance profiler for Ryunix\n */\nclass Profiler {\n constructor() {\n this.enabled = process.env.NODE_ENV !== 'production'\n this.measures = new Map()\n this.renderTimes = []\n this.maxSamples = 100\n }\n\n startMeasure(name) {\n if (!this.enabled) return\n this.measures.set(name, performance.now())\n }\n\n endMeasure(name) {\n if (!this.enabled) return\n const start = this.measures.get(name)\n if (!start) return\n\n const duration = performance.now() - start\n this.measures.delete(name)\n\n return duration\n }\n\n recordRender(componentName, duration) {\n if (!this.enabled) return\n\n this.renderTimes.push({\n component: componentName,\n duration,\n timestamp: Date.now(),\n })\n\n if (this.renderTimes.length > this.maxSamples) {\n this.renderTimes.shift()\n }\n }\n\n getStats() {\n if (!this.enabled) return null\n\n const total = this.renderTimes.reduce((sum, r) => sum + r.duration, 0)\n const avg = total / this.renderTimes.length\n const max = Math.max(...this.renderTimes.map((r) => r.duration))\n const min = Math.min(...this.renderTimes.map((r) => r.duration))\n\n return { total, avg, max, min, count: this.renderTimes.length }\n }\n\n getSlowestComponents(limit = 10) {\n if (!this.enabled) return []\n\n const byComponent = new Map()\n\n this.renderTimes.forEach(({ component, duration }) => {\n if (!byComponent.has(component)) {\n byComponent.set(component, { total: 0, count: 0, max: 0 })\n }\n const stats = byComponent.get(component)\n stats.total += duration\n stats.count++\n stats.max = Math.max(stats.max, duration)\n })\n\n return Array.from(byComponent.entries())\n .map(([name, stats]) => ({\n name,\n avg: stats.total / stats.count,\n max: stats.max,\n count: stats.count,\n }))\n .sort((a, b) => b.avg - a.avg)\n .slice(0, limit)\n }\n\n logStats() {\n if (!this.enabled) return\n\n const stats = this.getStats()\n if (!stats) return\n\n console.group('🔍 Ryunix Performance Stats')\n console.log(`Total renders: ${stats.count}`)\n console.log(`Avg render time: ${stats.avg.toFixed(2)}ms`)\n console.log(\n `Min: ${stats.min.toFixed(2)}ms | Max: ${stats.max.toFixed(2)}ms`,\n )\n\n const slowest = this.getSlowestComponents(5)\n if (slowest.length > 0) {\n console.log('\\n⚠️ Slowest components:')\n slowest.forEach((comp, i) => {\n console.log(\n `${i + 1}. ${comp.name}: ${comp.avg.toFixed(2)}ms avg (${comp.count} renders)`,\n )\n })\n }\n console.groupEnd()\n }\n\n clear() {\n this.renderTimes = []\n this.measures.clear()\n }\n\n enable() {\n this.enabled = true\n }\n\n disable() {\n this.enabled = false\n }\n}\n\n// Global profiler instance\nconst profiler = new Profiler()\n\n/**\n * Hook to profile component render\n */\nconst useProfiler = (componentName) => {\n const startTime = performance.now()\n\n return () => {\n const duration = performance.now() - startTime\n profiler.recordRender(componentName, duration)\n }\n}\n\n/**\n * HOC to profile component\n */\nconst withProfiler = (Component, name) => {\n return (props) => {\n profiler.startMeasure(name)\n const result = Component(props)\n const duration = profiler.endMeasure(name)\n if (duration) profiler.recordRender(name, duration)\n return result\n }\n}\n\nexport { profiler, useProfiler, withProfiler }\n","import { commitRoot } from './commits'\nimport { updateFunctionComponent, updateHostComponent } from './components'\nimport { getState } from '../utils/index'\nimport { getCurrentPriority, Priority } from './priority'\nimport { profiler } from './profiler'\n\nconst workLoop = (deadline) => {\n const state = getState()\n let shouldYield = false\n\n while (state.nextUnitOfWork && !shouldYield) {\n state.nextUnitOfWork = performUnitOfWork(state.nextUnitOfWork)\n shouldYield = deadline.timeRemaining() < 1\n }\n\n if (!state.nextUnitOfWork && state.wipRoot) {\n commitRoot()\n }\n\n requestIdleCallback(workLoop)\n}\n\nrequestIdleCallback(workLoop)\n\nconst performUnitOfWork = (fiber) => {\n const componentName = fiber.type?.name || fiber.type?.displayName || 'Unknown'\n\n profiler.startMeasure(componentName)\n\n const isFunctionComponent = fiber.type instanceof Function\n if (isFunctionComponent) {\n updateFunctionComponent(fiber)\n } else {\n updateHostComponent(fiber)\n }\n\n const duration = profiler.endMeasure(componentName)\n if (duration) profiler.recordRender(componentName, duration)\n\n if (fiber.child) {\n return fiber.child\n }\n let nextFiber = fiber\n while (nextFiber) {\n if (nextFiber.sibling) {\n return nextFiber.sibling\n }\n nextFiber = nextFiber.parent\n }\n}\n\nconst scheduleWork = (root, priority = Priority.NORMAL) => {\n const state = getState()\n state.nextUnitOfWork = root\n state.wipRoot = root\n state.deletions = []\n state.hookIndex = 0\n state.effects = []\n\n // Higher priority = faster scheduling\n if (priority <= Priority.USER_BLOCKING) {\n requestIdleCallback(workLoop)\n } else {\n setTimeout(() => requestIdleCallback(workLoop), 0)\n }\n}\n\nexport { performUnitOfWork, workLoop, scheduleWork }\n","import { getState } from '../utils/index'\nimport { scheduleWork } from './workers'\n\nconst clearContainer = (container) => {\n while (container.firstChild) {\n container.removeChild(container.firstChild)\n }\n}\n\nconst render = (element, container) => {\n const state = getState()\n state.wipRoot = {\n dom: container,\n props: {\n children: [element],\n },\n alternate: state.currentRoot,\n }\n\n state.nextUnitOfWork = state.wipRoot\n state.deletions = []\n scheduleWork(state.wipRoot)\n return state.wipRoot\n}\n\nconst init = (MainElement, root = '__ryunix') => {\n const state = getState()\n state.containerRoot = document.getElementById(root)\n const renderProcess = render(MainElement, state.containerRoot)\n return renderProcess\n}\n\nconst safeRender = (component, props, onError) => {\n try {\n return component(props)\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Component error:', error)\n }\n if (onError) onError(error)\n return null\n }\n}\n\nexport { init, render, safeRender }\n","import { RYUNIX_TYPES, getState, is } from '../utils/index'\nimport { createElement, Fragment } from './createElement'\nimport { scheduleWork } from './workers'\nimport { Priority } from './priority'\n\nconst validateHookCall = () => {\n const state = getState()\n if (!state.wipFiber) {\n throw new Error(\n 'Hooks can only be called inside the body of a function component.',\n )\n }\n if (!Array.isArray(state.wipFiber.hooks)) {\n state.wipFiber.hooks = []\n }\n}\n\nconst haveDepsChanged = (oldDeps, newDeps) => {\n if (!oldDeps || !newDeps) return true\n if (oldDeps.length !== newDeps.length) return true\n return oldDeps.some((dep, i) => !Object.is(dep, newDeps[i]))\n}\n\nconst useStore = (initialState) => {\n const reducer = (state, action) =>\n is.function(action) ? action(state) : action\n return useReducer(reducer, initialState)\n}\n\nconst useReducer = (reducer, initialState, init) => {\n validateHookCall()\n\n const state = getState()\n const { wipFiber, hookIndex } = state\n const oldHook = wipFiber.alternate?.hooks?.[hookIndex]\n\n const hook = {\n hookID: hookIndex,\n type: RYUNIX_TYPES.RYUNIX_STORE,\n state: oldHook ? oldHook.state : init ? init(initialState) : initialState,\n queue: [], // Siempre nueva cola vacía\n }\n\n // Procesar acciones del render anterior\n if (oldHook?.queue) {\n oldHook.queue.forEach((action) => {\n try {\n hook.state = reducer(hook.state, action)\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in reducer:', error)\n }\n }\n })\n }\n\n const dispatch = (action) => {\n if (action === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('dispatch called with undefined action')\n }\n return\n }\n\n hook.queue.push(action)\n\n const currentState = getState()\n currentState.wipRoot = {\n dom: currentState.currentRoot.dom,\n props: currentState.currentRoot.props,\n alternate: currentState.currentRoot,\n }\n currentState.deletions = []\n currentState.hookIndex = 0\n scheduleWork(currentState.wipRoot)\n }\n\n wipFiber.hooks[hookIndex] = hook\n state.hookIndex++\n return [hook.state, dispatch]\n}\n\nconst useEffect = (callback, deps) => {\n validateHookCall()\n\n if (!is.function(callback)) {\n throw new Error('useEffect callback must be a function')\n }\n if (deps !== undefined && !Array.isArray(deps)) {\n throw new Error('useEffect dependencies must be an array or undefined')\n }\n\n const state = getState()\n const { wipFiber, hookIndex } = state\n const oldHook = wipFiber.alternate?.hooks?.[hookIndex]\n const hasChanged = haveDepsChanged(oldHook?.deps, deps)\n\n const hook = {\n hookID: hookIndex,\n type: RYUNIX_TYPES.RYUNIX_EFFECT,\n deps,\n effect: hasChanged ? callback : null,\n cancel: oldHook?.cancel,\n }\n\n wipFiber.hooks[hookIndex] = hook\n state.hookIndex++\n}\n\nconst useRef = (initialValue) => {\n validateHookCall()\n\n const state = getState()\n const { wipFiber, hookIndex } = state\n const oldHook = wipFiber.alternate?.hooks?.[hookIndex]\n\n const hook = {\n hookID: hookIndex,\n type: RYUNIX_TYPES.RYUNIX_REF,\n value: oldHook ? oldHook.value : { current: initialValue },\n }\n\n wipFiber.hooks[hookIndex] = hook\n state.hookIndex++\n return hook.value\n}\n\nconst useMemo = (compute, deps) => {\n validateHookCall()\n\n if (!is.function(compute)) {\n throw new Error('useMemo callback must be a function')\n }\n if (!Array.isArray(deps)) {\n throw new Error('useMemo requires a dependencies array')\n }\n\n const state = getState()\n const { wipFiber, hookIndex } = state\n const oldHook = wipFiber.alternate?.hooks?.[hookIndex]\n\n let value\n if (oldHook && !haveDepsChanged(oldHook.deps, deps)) {\n value = oldHook.value\n } else {\n try {\n value = compute()\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in useMemo computation:', error)\n }\n value = undefined\n }\n }\n\n const hook = {\n hookID: hookIndex,\n type: RYUNIX_TYPES.RYUNIX_MEMO,\n value,\n deps,\n }\n\n wipFiber.hooks[hookIndex] = hook\n state.hookIndex++\n return value\n}\n\nconst useCallback = (callback, deps) => {\n if (!is.function(callback)) {\n throw new Error('useCallback requires a function as first argument')\n }\n return useMemo(() => callback, deps)\n}\n\nconst createContext = (\n contextId = RYUNIX_TYPES.RYUNIX_CONTEXT,\n defaultValue = {},\n) => {\n const Provider = ({ children, value }) => {\n const element = Fragment({ children })\n element._contextId = contextId\n element._contextValue = value\n return element\n }\n\n Provider._contextId = contextId\n\n const useContext = (ctxID = contextId) => {\n validateHookCall()\n\n const state = getState()\n let fiber = state.wipFiber\n\n while (fiber) {\n if (fiber._contextId === ctxID && fiber._contextValue !== undefined) {\n return fiber._contextValue\n }\n if (\n fiber.type?._contextId === ctxID &&\n fiber.props?.value !== undefined\n ) {\n return fiber.props.value\n }\n fiber = fiber.parent\n }\n return defaultValue\n }\n\n return { Provider, useContext }\n}\n\nconst useQuery = () => {\n if (typeof window === 'undefined') return {}\n\n const searchParams = new URLSearchParams(window.location.search)\n const query = {}\n for (const [key, value] of searchParams.entries()) {\n query[key] = value\n }\n return query\n}\n\nconst useHash = () => {\n if (typeof window === 'undefined') return ''\n\n const [hash, setHash] = useStore(window.location.hash)\n useEffect(() => {\n const onHashChange = () => setHash(window.location.hash)\n window.addEventListener('hashchange', onHashChange)\n return () => window.removeEventListener('hashchange', onHashChange)\n }, [])\n return hash\n}\n\nconst useMetadata = (tags = {}, options = {}) => {\n useEffect(() => {\n if (typeof document === 'undefined') return\n\n let finalTitle = 'Ryunix App'\n const template = options.title?.template\n const defaultTitle = options.title?.prefix || 'Ryunix App'\n const pageTitle = tags.pageTitle || tags.title\n\n if (is.string(pageTitle) && pageTitle.trim()) {\n finalTitle = template?.includes('%s')\n ? template.replace('%s', pageTitle)\n : pageTitle\n } else {\n finalTitle = defaultTitle\n }\n\n document.title = finalTitle\n\n if (tags.canonical) {\n let link = document.querySelector('link[rel=\"canonical\"]')\n if (!link) {\n link = document.createElement('link')\n link.setAttribute('rel', 'canonical')\n document.head.appendChild(link)\n }\n link.setAttribute('href', tags.canonical)\n }\n\n Object.entries(tags).forEach(([key, value]) => {\n if (['title', 'pageTitle', 'canonical'].includes(key)) return\n\n const isProperty = key.startsWith('og:') || key.startsWith('twitter:')\n const selector = `meta[${isProperty ? 'property' : 'name'}='${key}']`\n let meta = document.head.querySelector(selector)\n\n if (!meta) {\n meta = document.createElement('meta')\n meta.setAttribute(isProperty ? 'property' : 'name', key)\n document.head.appendChild(meta)\n }\n meta.setAttribute('content', value)\n })\n }, [JSON.stringify(tags), JSON.stringify(options)])\n}\n\n// Router Context\nconst RouterContext = createContext('ryunix.navigation', {\n location: '/',\n params: {},\n query: {},\n navigate: (path) => {},\n route: null,\n})\n\nconst findRoute = (routes, path) => {\n const pathname = path.split('?')[0].split('#')[0]\n const notFoundRoute = routes.find((route) => route.NotFound)\n const notFound = notFoundRoute\n ? { route: { component: notFoundRoute.NotFound }, params: {} }\n : { route: { component: null }, params: {} }\n\n for (const route of routes) {\n if (route.subRoutes) {\n const childRoute = findRoute(route.subRoutes, path)\n if (childRoute) return childRoute\n }\n if (route.path === '*') return notFound\n if (!route.path || typeof route.path !== 'string') continue\n\n const keys = []\n const pattern = new RegExp(\n `^${route.path.replace(/:\\w+/g, (match) => {\n keys.push(match.substring(1))\n return '([^/]+)'\n })}$`,\n )\n\n const match = pathname.match(pattern)\n if (match) {\n const params = keys.reduce((acc, key, index) => {\n acc[key] = match[index + 1]\n return acc\n }, {})\n return { route, params }\n }\n }\n return notFound\n}\n\nconst RouterProvider = ({ routes, children }) => {\n const [location, setLocation] = useStore(window.location.pathname)\n\n useEffect(() => {\n const update = () => setLocation(window.location.pathname)\n window.addEventListener('popstate', update)\n window.addEventListener('hashchange', update)\n return () => {\n window.removeEventListener('popstate', update)\n window.removeEventListener('hashchange', update)\n }\n }, [location])\n\n const navigate = (path) => {\n window.history.pushState({}, '', path)\n setLocation(path)\n }\n\n const currentRouteData = findRoute(routes, location) || {}\n const query = useQuery()\n\n const contextValue = {\n location,\n params: currentRouteData.params || {},\n query,\n navigate,\n route: currentRouteData.route,\n }\n\n return createElement(\n RouterContext.Provider,\n { value: contextValue },\n Fragment({ children }),\n )\n}\n\nconst useRouter = () => {\n return RouterContext.useContext('ryunix.navigation')\n}\n\nconst Children = () => {\n const { route, params, query, location } = useRouter()\n if (!route || !route.component) return null\n const hash = useHash()\n\n useEffect(() => {\n if (hash) {\n const id = hash.slice(1)\n const el = document.getElementById(id)\n if (el) el.scrollIntoView({ block: 'start', behavior: 'smooth' })\n }\n }, [hash])\n\n return createElement(route.component, {\n key: location,\n params,\n query,\n hash,\n })\n}\n\nconst NavLink = ({ to, exact = false, ...props }) => {\n const { location, navigate } = useRouter()\n const isActive = exact ? location === to : location.startsWith(to)\n\n const resolveClass = (cls) =>\n typeof cls === 'function' ? cls({ isActive }) : cls || ''\n\n const handleClick = (e) => {\n e.preventDefault()\n navigate(to)\n }\n\n const classAttrName = props['ryunix-class'] ? 'ryunix-class' : 'className'\n const classAttrValue = resolveClass(\n props['ryunix-class'] || props['className'],\n )\n\n const {\n ['ryunix-class']: _omitRyunix,\n className: _omitClassName,\n ...cleanedProps\n } = props\n\n return createElement(\n 'a',\n {\n href: to,\n onClick: handleClick,\n [classAttrName]: classAttrValue,\n ...cleanedProps,\n },\n props.children,\n )\n}\n\n/**\n * useStore with priority support\n */\nconst useStorePriority = (initialState) => {\n const reducer = (state, action) =>\n typeof action === 'function' ? action.value(state) : action.value\n\n const [state, baseDispatch] = useReducer(reducer, initialState)\n\n const dispatch = (action, priority = Priority.NORMAL) => {\n const wrappedAction = {\n value: action,\n priority,\n }\n\n baseDispatch(wrappedAction)\n }\n\n return [state, dispatch]\n}\n\n/**\n * useTransition - Mark updates as non-urgent\n */\nconst useTransition = () => {\n const [isPending, setIsPending] = useStorePriority(false)\n\n const startTransition = (callback) => {\n setIsPending(true, Priority.IMMEDIATE)\n\n setTimeout(() => {\n callback()\n setIsPending(false, Priority.IMMEDIATE)\n }, 0)\n }\n\n return [isPending, startTransition]\n}\n\n/**\n * useDeferredValue - Defer value updates\n */\nconst useDeferredValue = (value) => {\n const [deferredValue, setDeferredValue] = useStorePriority(value)\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setDeferredValue(value, Priority.LOW)\n }, 100)\n\n return () => clearTimeout(timeout)\n }, [value])\n\n return deferredValue\n}\n\nexport {\n useStore,\n useReducer,\n useEffect,\n useRef,\n useMemo,\n useCallback,\n createContext,\n useQuery,\n useHash,\n useMetadata,\n useStorePriority,\n useTransition,\n useDeferredValue,\n // Router exports\n RouterProvider,\n useRouter,\n Children,\n NavLink,\n}\n","import { useMemo } from './hooks'\n\n/**\n * memo - Memoize component to prevent unnecessary re-renders\n */\nconst memo = (Component, arePropsEqual) => {\n return (props) => {\n const memoizedElement = useMemo(() => {\n return Component(props)\n }, [\n // Default comparison: shallow props comparison\n ...Object.values(props),\n ])\n\n return memoizedElement\n }\n}\n\n/**\n * Custom comparison function for memo\n */\nconst shallowEqual = (prevProps, nextProps) => {\n const prevKeys = Object.keys(prevProps)\n const nextKeys = Object.keys(nextProps)\n\n if (prevKeys.length !== nextKeys.length) return false\n\n return prevKeys.every((key) => Object.is(prevProps[key], nextProps[key]))\n}\n\n/**\n * Deep comparison for complex objects\n */\nconst deepEqual = (a, b) => {\n if (a === b) return true\n if (a == null || b == null) return false\n if (typeof a !== 'object' || typeof b !== 'object') return false\n\n const keysA = Object.keys(a)\n const keysB = Object.keys(b)\n\n if (keysA.length !== keysB.length) return false\n\n return keysA.every((key) => deepEqual(a[key], b[key]))\n}\n\nexport { memo, shallowEqual, deepEqual }\n","import { createElement } from './createElement'\nimport { useStore, useEffect } from './hooks'\n\n/**\n * Lazy load component\n */\nconst lazy = (importFn) => {\n let Component = null\n let promise = null\n let error = null\n\n return (props) => {\n const [, forceUpdate] = useStore(0)\n\n useEffect(() => {\n if (Component || error) return\n\n if (!promise) {\n promise = importFn()\n .then((module) => {\n Component = module.default || module\n forceUpdate((x) => x + 1)\n })\n .catch((err) => {\n error = err\n forceUpdate((x) => x + 1)\n })\n }\n }, [])\n\n if (error) throw error\n if (!Component) return null\n return createElement(Component, props)\n }\n}\n\n/**\n * Suspense component (basic implementation)\n */\nconst Suspense = ({ fallback, children }) => {\n const [isLoading, setIsLoading] = useStore(true)\n\n useEffect(() => {\n setIsLoading(false)\n }, [])\n\n if (isLoading && fallback) {\n return fallback\n }\n\n return children\n}\n\n/**\n * Preload component for prefetching\n */\nconst preload = (importFn) => {\n return importFn()\n}\n\nexport { lazy, Suspense, preload }\n","let isBatching = false\nlet pendingUpdates = []\n\n/**\n * Batch multiple state updates into single render\n */\nconst batchUpdates = (callback) => {\n const wasBatching = isBatching\n isBatching = true\n\n try {\n callback()\n } finally {\n isBatching = wasBatching\n\n if (!isBatching && pendingUpdates.length > 0) {\n flushUpdates()\n }\n }\n}\n\n/**\n * Queue update for batching\n */\nconst queueUpdate = (update) => {\n pendingUpdates.push(update)\n\n if (!isBatching) {\n flushUpdates()\n }\n}\n\n/**\n * Flush all pending updates\n */\nconst flushUpdates = () => {\n if (pendingUpdates.length === 0) return\n\n const updates = pendingUpdates\n pendingUpdates = []\n\n // Execute all updates\n updates.forEach((update) => update())\n}\n\nexport { batchUpdates, queueUpdate, flushUpdates }\n","import * as Ryunix from './lib/index.js'\n\nexport * from './lib/index.js'\nexport { Image } from './lib/components.js'\n\nwindow.Ryunix = Ryunix\nexport default Ryunix\n"],"names":["globalState","containerRoot","nextUnitOfWork","currentRoot","wipRoot","deletions","wipFiber","hookIndex","effects","getState","CAMEL_TO_KEBAB_REGEX","RYUNIX_TYPES","Object","freeze","TEXT_ELEMENT","Symbol","for","RYUNIX_ELEMENT","RYUNIX_EFFECT","RYUNIX_MEMO","RYUNIX_URL_QUERY","RYUNIX_REF","RYUNIX_STORE","RYUNIX_REDUCE","RYUNIX_FRAGMENT","RYUNIX_CONTEXT","STRINGS","OBJECT","FUNCTION","STYLE","CLASS_NAME","CHILDREN","BOOLEAN","STRING","UNDEFINED","OLD_STRINGS","EFFECT_TAGS","PLACEMENT","UPDATE","DELETION","NO_EFFECT","is","val","createElement","type","props","children","flat","map","child","text","nodeValue","Fragment","Array","isArray","isEvent","key","startsWith","isProperty","isNew","prev","next","isGone","cancelEffectsDeep","fiber","hooks","length","filter","hook","cancel","forEach","error","process","env","NODE_ENV","console","sibling","runEffects","i","effect","cleanup","applyStyles","dom","styleObj","cssText","entries","_","value","replace","match","toLowerCase","join","style","applyClasses","prevClasses","nextClasses","trim","oldClasses","split","Boolean","classList","remove","newClasses","add","updateDom","prevProps","nextProps","keys","name","eventType","substring","removeEventListener","warn","includes","styleValue","addEventListener","commitWork","domParentFiber","parent","domParent","effectTag","appendChild","cancelEffects","alternate","commitDeletion","removeChild","reconcileChildren","elements","state","prevSibling","index","oldFiberMap","Map","oldFiber","position","set","element","matchedFiber","get","newFiber","delete","push","updateHostComponent","document","createTextNode","createDom","Priority","IMMEDIATE","USER_BLOCKING","NORMAL","LOW","IDLE","profiler","constructor","this","enabled","measures","renderTimes","maxSamples","startMeasure","performance","now","endMeasure","start","duration","recordRender","componentName","component","timestamp","Date","shift","getStats","total","reduce","sum","r","avg","max","Math","min","count","getSlowestComponents","limit","byComponent","has","stats","from","sort","a","b","slice","logStats","group","log","toFixed","slowest","comp","groupEnd","clear","enable","disable","useProfiler","startTime","withProfiler","Component","result","workLoop","deadline","shouldYield","performUnitOfWork","timeRemaining","commitRoot","requestIdleCallback","displayName","Function","_contextId","undefined","_contextValue","updateFunctionComponent","nextFiber","scheduleWork","root","priority","setTimeout","render","container","init","MainElement","getElementById","safeRender","onError","validateHookCall","Error","haveDepsChanged","oldDeps","newDeps","some","dep","useStore","initialState","useReducer","action","reducer","oldHook","hookID","queue","currentState","useEffect","callback","deps","hasChanged","useMemo","compute","createContext","contextId","defaultValue","Provider","useContext","ctxID","useQuery","window","searchParams","URLSearchParams","location","search","query","useHash","hash","setHash","onHashChange","RouterContext","params","navigate","path","route","findRoute","routes","pathname","notFoundRoute","find","NotFound","notFound","subRoutes","childRoute","pattern","RegExp","acc","useRouter","useStorePriority","baseDispatch","id","el","scrollIntoView","block","behavior","to","exact","isActive","classAttrName","classAttrValue","cls","_omitRyunix","className","_omitClassName","cleanedProps","href","onClick","e","preventDefault","setLocation","update","currentRouteData","contextValue","history","pushState","deferredValue","setDeferredValue","timeout","clearTimeout","tags","options","finalTitle","template","title","defaultTitle","prefix","pageTitle","canonical","link","querySelector","setAttribute","head","selector","meta","JSON","stringify","initialValue","current","isPending","setIsPending","memo","arePropsEqual","values","lazy","importFn","promise","forceUpdate","then","module","default","x","catch","err","Suspense","fallback","isLoading","setIsLoading","isBatching","pendingUpdates","batchUpdates","wasBatching","flushUpdates","updates","Ryunix","src"],"mappings":"6OAeA,IAAIA,EAZsB,CACxBC,cAAe,KACfC,eAAgB,KAChBC,YAAa,KACbC,QAAS,KACTC,UAAW,GACXC,SAAU,KACVC,UAAW,EACXC,QAAS,IAMX,MAAMC,EAAW,IAAMT,EAOjBU,EAAuB,SAEvBC,EAAeC,OAAOC,OAAO,CACjCC,aAAcC,OAAOC,IAAI,uBACzBC,eAAgBF,OAAOC,IAAI,kBAC3BE,cAAeH,OAAOC,IAAI,iBAC1BG,YAAaJ,OAAOC,IAAI,eACxBI,iBAAkBL,OAAOC,IAAI,mBAC7BK,WAAYN,OAAOC,IAAI,cACvBM,aAAcP,OAAOC,IAAI,gBACzBO,cAAeR,OAAOC,IAAI,iBAC1BQ,gBAAiBT,OAAOC,IAAI,mBAC5BS,eAAgBV,OAAOC,IAAI,oBAGvBU,EAAUd,OAAOC,OAAO,CAC5Bc,OAAQ,SACRC,SAAU,WACVC,MAAO,eACPC,WAAY,eACZC,SAAU,WACVC,QAAS,UACTC,OAAQ,SACRC,UAAW,cAGPC,EAAcvB,OAAOC,OAAO,CAChCgB,MAAO,QACPC,WAAY,cAGRM,EAAcxB,OAAOC,OAAO,CAChCwB,UAAWtB,OAAOC,IAAI,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AAI,OAG5B,IAECvR,EAAO,MAAMA,EACjB,OAAKqI,EACEjK,EAAciK,EAAW/J,GADT,OAQrBoT,EAAW,EAAGC,WAAUpT,eAC5B,MAAOqT,EAAWC,GAAgBtH,GAAS,GAM3C,OAJAS,EAAU,KACR6G,GAAa,IACZ,IAECD,GAAaD,EACRA,EAGFpT,GClDT,IAAIuT,IAAa,EACbC,GAAiB,GAKhB,MAACC,GAAgB/G,IACpB,MAAMgH,EAAcH,GACpBA,IAAa,EAEb,IACE7G,GACF,CAAC,QACC6G,GAAaG,GAERH,IAAcC,GAAepS,OAAS,GACzCuS,IAEJ,GAiBIA,GAAe,KACnB,GAA8B,IAA1BH,GAAepS,OAAc,OAEjC,MAAMwS,EAAUJ,GAChBA,GAAiB,GAGjBI,EAAQpS,QAASgP,GAAWA,yMCrC9BlD,OAAOuG,OAASA,kCTwBF,EAAGC,SAAQ/T,KAChBF,EAAc,MAAO,IAAKE,EAAO+T"}
1
+ {"version":3,"file":"Ryunix.umd.min.js","sources":["../src/utils/index.js","../src/lib/createElement.js","../src/lib/effects.js","../src/lib/dom.js","../src/lib/commits.js","../src/lib/reconciler.js","../src/lib/priority.js","../src/lib/hooks.js","../src/lib/components.js","../src/lib/profiler.js","../src/lib/workers.js","../src/lib/render.js","../src/lib/memo.js","../src/lib/lazy.js","../src/lib/batching.js","../src/main.js"],"sourcesContent":["// Improved state management - avoid global mutable object\n// Instead, create a state manager that can be instantiated per render tree\n\nconst createRenderState = () => ({\n containerRoot: null,\n nextUnitOfWork: null,\n currentRoot: null,\n wipRoot: null,\n deletions: [],\n wipFiber: null,\n hookIndex: 0,\n effects: [],\n})\n\n// Singleton for backward compatibility, but allows testing with isolated instances\nlet globalState = createRenderState()\n\nconst getState = () => globalState\nconst resetState = () => {\n globalState = createRenderState()\n return globalState\n}\n\n// Use const for regex to prevent accidental modification\nconst CAMEL_TO_KEBAB_REGEX = /[A-Z]/g\n\nconst RYUNIX_TYPES = Object.freeze({\n TEXT_ELEMENT: Symbol.for('ryunix.text.element'),\n RYUNIX_ELEMENT: Symbol.for('ryunix.element'),\n RYUNIX_EFFECT: Symbol.for('ryunix.effect'),\n RYUNIX_MEMO: Symbol.for('ryunix.memo'),\n RYUNIX_URL_QUERY: Symbol.for('ryunix.urlQuery'),\n RYUNIX_REF: Symbol.for('ryunix.ref'),\n RYUNIX_STORE: Symbol.for('ryunix.store'),\n RYUNIX_REDUCE: Symbol.for('ryunix.reduce'),\n RYUNIX_FRAGMENT: Symbol.for('ryunix.fragment'),\n RYUNIX_CONTEXT: Symbol.for('ryunix.context'),\n})\n\nconst STRINGS = Object.freeze({\n OBJECT: 'object',\n FUNCTION: 'function',\n STYLE: 'ryunix-style',\n CLASS_NAME: 'ryunix-class',\n CHILDREN: 'children',\n BOOLEAN: 'boolean',\n STRING: 'string',\n UNDEFINED: 'undefined',\n})\n\nconst OLD_STRINGS = Object.freeze({\n STYLE: 'style',\n CLASS_NAME: 'className',\n})\n\nconst EFFECT_TAGS = Object.freeze({\n PLACEMENT: Symbol.for('ryunix.reconciler.status.placement'),\n UPDATE: Symbol.for('ryunix.reconciler.status.update'),\n DELETION: Symbol.for('ryunix.reconciler.status.deletion'),\n NO_EFFECT: Symbol.for('ryunix.reconciler.status.no_effect'),\n})\n\n/**\n * Generate a unique hash with optional prefix\n * @param {string} prefix - Optional prefix for the hash\n * @returns {string} Unique hash string\n */\nconst generateHash = (prefix = 'ryunix') => {\n const randomPart = Math.random().toString(36).substring(2, 11)\n const timestamp = Date.now().toString(36)\n return `${prefix}-${timestamp}-${randomPart}`\n}\n\n/**\n * Match a route pattern against a path\n * @param {string} pattern - Route pattern with :params\n * @param {string} path - URL path to match\n * @returns {Object|null} Params object or null if no match\n */\nconst matchPath = (pattern, path) => {\n if (!pattern || !path) return null\n\n // Wildcard matches everything\n if (pattern === '*') return {}\n\n const patternSegments = pattern.split('/').filter(Boolean)\n const pathSegments = path.split('/').filter(Boolean)\n\n // Different number of segments = no match\n if (patternSegments.length !== pathSegments.length) return null\n\n const params = {}\n\n for (let i = 0; i < patternSegments.length; i++) {\n const patternSeg = patternSegments[i]\n const pathSeg = pathSegments[i]\n\n if (patternSeg.startsWith(':')) {\n // Dynamic segment\n const paramName = patternSeg.slice(1)\n params[paramName] = decodeURIComponent(pathSeg)\n } else if (patternSeg !== pathSeg) {\n // Static segment doesn't match\n return null\n }\n }\n\n return params\n}\n\n/**\n * Parse query string into object\n * @param {string} search - Query string (with or without ?)\n * @returns {Object} Parsed query parameters\n */\nconst parseQuery = (search) => {\n if (!search) return {}\n\n // Remove leading ? if present\n const cleanSearch = search.startsWith('?') ? search.slice(1) : search\n\n if (!cleanSearch) return {}\n\n try {\n return Object.fromEntries(new URLSearchParams(cleanSearch))\n } catch (error) {\n console.warn('Failed to parse query string:', error)\n return {}\n }\n}\n\n/**\n * Deep equality check for hook dependencies\n * @param {Array} prevDeps - Previous dependencies\n * @param {Array} nextDeps - Next dependencies\n * @returns {boolean} Whether dependencies changed\n */\nconst haveDepsChanged = (prevDeps, nextDeps) => {\n if (!prevDeps || !nextDeps) return true\n if (prevDeps.length !== nextDeps.length) return true\n\n return prevDeps.some((dep, index) => !Object.is(dep, nextDeps[index]))\n}\n\n/**\n * Safe array flattening\n * @param {Array} arr - Array to flatten\n * @param {number} depth - Depth to flatten (default: 1)\n * @returns {Array} Flattened array\n */\nconst flattenArray = (arr, depth = 1) => {\n if (!Array.isArray(arr)) return [arr]\n if (depth < 1) return arr.slice()\n\n return arr.reduce((acc, val) => {\n if (Array.isArray(val) && depth > 0) {\n acc.push(...flattenArray(val, depth - 1))\n } else {\n acc.push(val)\n }\n return acc\n }, [])\n}\n\n/**\n * Type checking utilities\n */\nconst is = {\n object: (val) => val !== null && typeof val === STRINGS.OBJECT,\n function: (val) => typeof val === STRINGS.FUNCTION,\n string: (val) => typeof val === STRINGS.STRING,\n undefined: (val) => typeof val === STRINGS.UNDEFINED,\n null: (val) => val === null,\n array: (val) => Array.isArray(val),\n promise: (val) => val instanceof Promise,\n}\n\nexport {\n getState,\n resetState,\n createRenderState,\n CAMEL_TO_KEBAB_REGEX,\n RYUNIX_TYPES,\n EFFECT_TAGS,\n STRINGS,\n OLD_STRINGS,\n generateHash,\n matchPath,\n parseQuery,\n haveDepsChanged,\n flattenArray,\n is,\n}\n","import { RYUNIX_TYPES, STRINGS, is } from '../utils/index'\n\n/**\n * The `createTextElement` function creates a text element with the specified text content.\n * @param text - The `text` parameter in the `createTextElement` function is the text content that you\n * want to create a text element for. This text will be set as the `nodeValue` of the text element in\n * the returned object.\n * @returns A text element object is being returned with a type of RYUNIX_TYPES.TEXT_ELEMENT and props\n * containing the text value provided in the function argument.\n */\nconst createTextElement = (text) => {\n return {\n type: RYUNIX_TYPES.TEXT_ELEMENT,\n props: {\n nodeValue: text,\n children: [],\n },\n }\n}\n\n/**\n * The `createElement` function creates a virtual DOM element with specified type, properties, and\n * children.\n * @param type - The `type` parameter in the `createElement` function represents the type of element\n * you want to create, such as a HTML tag like 'div', 'span', 'p', etc.\n * @param props - The `props` parameter in the `createElement` function is an object that contains the\n * properties or attributes for the element being created. These properties can include things like\n * class names, styles, event handlers, and any other custom attributes you want to assign to the\n * element. In the code snippet you provided,\n * @param children - The `children` parameter in the `createElement` function represents the child\n * elements or text content that will be nested within the created element. These children can be\n * passed as arguments to the `createElement` function and will be rendered as part of the element's\n * content.\n * @returns An object is being returned with a `type` property representing the type of element, and a\n * `props` property containing the element's properties. The `props` object includes the children of\n * the element, which are processed to ensure they are in the correct format.\n */\nconst createElement = (type, props, ...children) => {\n const safeProps = props || {}\n\n return {\n type,\n props: {\n ...safeProps,\n children: children\n .flat()\n .map((child) =>\n typeof child === STRINGS.OBJECT ? child : createTextElement(child),\n ),\n },\n }\n}\n\n/**\n * The `Fragment` function in JavaScript creates a fragment element with the given children.\n * @param props - The `props` parameter in the `Fragment` function is an object that contains the\n * properties passed to the `Fragment` component. These properties can include `children`, which\n * represents the child elements or components nested within the `Fragment`.\n * @returns The `Fragment` component is returning a Ryunix fragment element created using the\n * `createElement` function. The element is of type `RYUNIX_TYPES.RYUNIX_FRAGMENT` and contains the\n * children passed to the `Fragment` component. If `props.children` is not an array, it is converted\n * into an array before being spread into the `createElement` function.\n */\nconst Fragment = (props) => {\n const children = Array.isArray(props.children)\n ? props.children\n : [props.children]\n return createElement(RYUNIX_TYPES.RYUNIX_FRAGMENT, {}, ...children)\n}\n\n/**\n * Clone element utility\n */\nconst cloneElement = (element, props = {}, ...children) => {\n if (!element || !is.object(element)) {\n throw new Error('cloneElement requires a valid element')\n }\n\n const newChildren = children.length > 0 ? children : element.props.children\n\n return createElement(\n element.type,\n { ...element.props, ...props },\n ...(Array.isArray(newChildren) ? newChildren : [newChildren]),\n )\n}\n\n/**\n * Check if valid element\n */\nconst isValidElement = (object) => {\n return (\n is.object(object) && object.type !== undefined && object.props !== undefined\n )\n}\n\nexport {\n createElement,\n createTextElement,\n Fragment,\n cloneElement,\n isValidElement,\n}\n","import { RYUNIX_TYPES, STRINGS, is } from '../utils/index'\n\n/**\n * Check if a key is an event handler\n * @param {string} key - Prop key\n * @returns {boolean}\n */\nconst isEvent = (key) => key.startsWith('on')\n\n/**\n * Check if a key is a property (not children or event)\n * @param {string} key - Prop key\n * @returns {boolean}\n */\nconst isProperty = (key) => key !== STRINGS.CHILDREN && !isEvent(key)\n\n/**\n * Check if a property is new or changed\n * @param {Object} prev - Previous props\n * @param {Object} next - Next props\n * @returns {Function}\n */\nconst isNew = (prev, next) => (key) => {\n // Use Object.is for better comparison (handles NaN, -0, +0)\n return !Object.is(prev[key], next[key])\n}\n\n/**\n * Check if a property was removed\n * @param {Object} next - Next props\n * @returns {Function}\n */\nconst isGone = (next) => (key) => !(key in next)\n\n/**\n * Check if dependencies array has changed\n * @param {Array} prevDeps - Previous dependencies\n * @param {Array} nextDeps - Next dependencies\n * @returns {boolean}\n */\nconst haveDepsChanged = (prevDeps, nextDeps) => {\n if (!prevDeps || !nextDeps) return true\n if (prevDeps.length !== nextDeps.length) return true\n return prevDeps.some((dep, index) => !Object.is(dep, nextDeps[index]))\n}\n\n/**\n * Cancel effects for a single fiber\n * @param {Object} fiber - Fiber node\n */\nconst cancelEffects = (fiber) => {\n if (!fiber?.hooks?.length) return\n\n fiber.hooks\n .filter(\n (hook) =>\n hook.type === RYUNIX_TYPES.RYUNIX_EFFECT && is.function(hook.cancel),\n )\n .forEach((hook) => {\n try {\n hook.cancel()\n hook.cancel = null // Clear reference to prevent memory leaks\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in effect cleanup:', error)\n }\n }\n })\n}\n\n/**\n * Recursively cancel effects in fiber tree\n * @param {Object} fiber - Root fiber node\n */\nconst cancelEffectsDeep = (fiber) => {\n if (!fiber) return\n\n // Cancel effects for current fiber\n if (fiber.hooks?.length > 0) {\n fiber.hooks\n .filter(\n (hook) =>\n hook.type === RYUNIX_TYPES.RYUNIX_EFFECT && is.function(hook.cancel),\n )\n .forEach((hook) => {\n try {\n hook.cancel()\n hook.cancel = null // Clear reference\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in deep effect cleanup:', error)\n }\n }\n })\n }\n\n // Recursively process children\n if (fiber.child) cancelEffectsDeep(fiber.child)\n if (fiber.sibling) cancelEffectsDeep(fiber.sibling)\n}\n\n/**\n * Run effects for a fiber\n * @param {Object} fiber - Fiber node\n */\nconst runEffects = (fiber) => {\n if (!fiber?.hooks?.length) return\n\n for (let i = 0; i < fiber.hooks.length; i++) {\n const hook = fiber.hooks[i]\n\n if (hook.type === RYUNIX_TYPES.RYUNIX_EFFECT && is.function(hook.effect)) {\n // Cancel previous cleanup if exists\n if (is.function(hook.cancel)) {\n try {\n hook.cancel()\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in effect cleanup:', error)\n }\n }\n }\n\n // Run new effect\n try {\n const cleanup = hook.effect()\n\n // Store cleanup function if returned\n if (is.function(cleanup)) {\n hook.cancel = cleanup\n } else {\n hook.cancel = null\n }\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in effect:', error)\n }\n hook.cancel = null\n }\n\n // Clear effect reference after running\n hook.effect = null\n }\n }\n}\n\n/**\n * Batch multiple effect operations\n * @param {Function} callback - Callback containing effect operations\n */\nconst batchEffects = (callback) => {\n // Could implement batching logic here for performance\n // For now, just execute immediately\n callback()\n}\n\nexport {\n runEffects,\n cancelEffects,\n cancelEffectsDeep,\n isEvent,\n isProperty,\n isNew,\n isGone,\n haveDepsChanged,\n batchEffects,\n}\n","import { isEvent, isGone, isNew, isProperty } from './effects'\nimport {\n RYUNIX_TYPES,\n STRINGS,\n OLD_STRINGS,\n CAMEL_TO_KEBAB_REGEX,\n is,\n} from '../utils/index'\n\n/**\n * Convert camelCase to kebab-case for CSS properties\n * @param {string} camelCase - CamelCase string\n * @returns {string} Kebab-case string\n */\nconst camelToKebab = (camelCase) => {\n return camelCase.replace(\n CAMEL_TO_KEBAB_REGEX,\n (match) => `-${match.toLowerCase()}`,\n )\n}\n\n/**\n * Apply styles to DOM element\n * @param {HTMLElement} dom - DOM element\n * @param {Object} styleObj - Style object\n */\nconst applyStyles = (dom, styleObj) => {\n if (!is.object(styleObj) || is.null(styleObj)) {\n dom.style.cssText = ''\n return\n }\n\n try {\n const cssText = Object.entries(styleObj)\n .filter(([_, value]) => value != null) // Filter out null/undefined\n .map(([key, value]) => {\n const kebabKey = camelToKebab(key)\n return `${kebabKey}: ${value}`\n })\n .join('; ')\n\n dom.style.cssText = cssText\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error applying styles:', error)\n }\n }\n}\n\n/**\n * Apply CSS classes to DOM element\n * @param {HTMLElement} dom - DOM element\n * @param {string} prevClasses - Previous class string\n * @param {string} nextClasses - Next class string\n */\nconst applyClasses = (dom, prevClasses, nextClasses) => {\n // Allow empty/undefined - just remove classes\n if (!nextClasses || nextClasses.trim() === '') {\n if (prevClasses) {\n const oldClasses = prevClasses.split(/\\s+/).filter(Boolean)\n dom.classList.remove(...oldClasses)\n }\n return\n }\n\n // Remove old classes\n if (prevClasses) {\n const oldClasses = prevClasses.split(/\\s+/).filter(Boolean)\n dom.classList.remove(...oldClasses)\n }\n\n // Add new classes\n const newClasses = nextClasses.split(/\\s+/).filter(Boolean)\n if (newClasses.length > 0) {\n dom.classList.add(...newClasses)\n }\n}\n\n/**\n * Create a DOM element from fiber\n * @param {Object} fiber - Fiber node\n * @returns {HTMLElement|Text|null}\n */\nconst createDom = (fiber) => {\n // Fragments don't create real DOM nodes\n if (fiber.type === RYUNIX_TYPES.RYUNIX_FRAGMENT) {\n return null\n }\n\n let dom\n\n try {\n if (fiber.type === RYUNIX_TYPES.TEXT_ELEMENT) {\n dom = document.createTextNode('')\n } else if (is.string(fiber.type)) {\n dom = document.createElement(fiber.type)\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Attempted to create DOM for non-host component:',\n fiber.type,\n )\n }\n return null\n }\n\n updateDom(dom, {}, fiber.props)\n return dom\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error creating DOM element:', error, fiber)\n }\n return null\n }\n}\n\n/**\n * Update DOM element with new props\n * @param {HTMLElement|Text} dom - DOM element\n * @param {Object} prevProps - Previous props\n * @param {Object} nextProps - Next props\n */\nconst updateDom = (dom, prevProps = {}, nextProps = {}) => {\n // Remove old event listeners\n Object.keys(prevProps)\n .filter(isEvent)\n .filter((key) => isGone(nextProps)(key) || isNew(prevProps, nextProps)(key))\n .forEach((name) => {\n const eventType = name.toLowerCase().substring(2)\n try {\n dom.removeEventListener(eventType, prevProps[name])\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Error removing event listener:', error)\n }\n }\n })\n\n // Remove old properties\n Object.keys(prevProps)\n .filter(isProperty)\n .filter(isGone(nextProps))\n .forEach((name) => {\n // Skip special properties\n if (\n [\n STRINGS.STYLE,\n OLD_STRINGS.STYLE,\n STRINGS.CLASS_NAME,\n OLD_STRINGS.CLASS_NAME,\n ].includes(name)\n ) {\n return\n }\n dom[name] = ''\n })\n\n // Set new properties\n Object.keys(nextProps)\n .filter(isProperty)\n .filter(isNew(prevProps, nextProps))\n .forEach((name) => {\n try {\n // Handle style properties\n if (name === STRINGS.STYLE || name === OLD_STRINGS.STYLE) {\n const styleValue = nextProps[name]\n applyStyles(dom, styleValue)\n }\n // Handle className properties\n else if (name === STRINGS.CLASS_NAME) {\n applyClasses(\n dom,\n prevProps[STRINGS.CLASS_NAME],\n nextProps[STRINGS.CLASS_NAME],\n )\n } else if (name === OLD_STRINGS.CLASS_NAME) {\n applyClasses(\n dom,\n prevProps[OLD_STRINGS.CLASS_NAME],\n nextProps[OLD_STRINGS.CLASS_NAME],\n )\n }\n // Handle other properties\n else {\n // Special handling for value and checked (controlled components)\n if (name === 'value' || name === 'checked') {\n if (dom[name] !== nextProps[name]) {\n dom[name] = nextProps[name]\n }\n } else {\n dom[name] = nextProps[name]\n }\n }\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Error setting property ${name}:`, error)\n }\n }\n })\n\n // Add new event listeners\n Object.keys(nextProps)\n .filter(isEvent)\n .filter(isNew(prevProps, nextProps))\n .forEach((name) => {\n const eventType = name.toLowerCase().substring(2)\n try {\n dom.addEventListener(eventType, nextProps[name])\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Error adding event listener:', error)\n }\n }\n })\n}\n\n/**\n * Remove DOM element safely\n * @param {HTMLElement} dom - DOM element to remove\n */\nconst removeDom = (dom) => {\n try {\n if (dom && dom.parentNode) {\n dom.parentNode.removeChild(dom)\n }\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error removing DOM element:', error)\n }\n }\n}\n\nexport {\n createDom,\n updateDom,\n applyStyles,\n applyClasses,\n removeDom,\n camelToKebab,\n}\n","import { updateDom } from './dom'\nimport { cancelEffects, cancelEffectsDeep, runEffects } from './effects'\nimport { EFFECT_TAGS, getState } from '../utils/index'\n\n/**\n * The `commitRoot` function commits the changes made to the virtual DOM by updating the actual DOM.\n */\nconst commitRoot = () => {\n const state = getState()\n state.deletions.forEach(commitWork)\n commitWork(state.wipRoot.child)\n state.currentRoot = state.wipRoot\n state.wipRoot = null\n}\n\nconst commitWork = (fiber) => {\n if (!fiber) {\n return\n }\n\n let domParentFiber = fiber.parent\n while (!domParentFiber.dom) {\n domParentFiber = domParentFiber.parent\n }\n const domParent = domParentFiber.dom\n\n if (fiber.effectTag === EFFECT_TAGS.PLACEMENT) {\n if (fiber.dom != null) {\n domParent.appendChild(fiber.dom)\n }\n runEffects(fiber)\n } else if (fiber.effectTag === EFFECT_TAGS.UPDATE) {\n cancelEffects(fiber)\n if (fiber.dom != null) {\n updateDom(fiber.dom, fiber.alternate.props, fiber.props)\n }\n runEffects(fiber)\n } else if (fiber.effectTag === EFFECT_TAGS.DELETION) {\n cancelEffectsDeep(fiber)\n commitDeletion(fiber, domParent)\n return\n }\n\n commitWork(fiber.child)\n commitWork(fiber.sibling)\n}\n\nconst commitDeletion = (fiber, domParent) => {\n if (fiber.dom) {\n domParent.removeChild(fiber.dom)\n } else {\n let child = fiber.child\n while (child) {\n commitDeletion(child, domParent)\n child = child.sibling\n }\n }\n}\n\nexport { commitDeletion, commitWork, commitRoot }\n","import { EFFECT_TAGS, getState } from '../utils/index'\n\n/**\n * Reconcile children with key optimization\n */\nconst reconcileChildren = (wipFiber, elements) => {\n const state = getState()\n let index = 0\n let prevSibling\n\n // Build map of old fibers by key/index\n const oldFiberMap = new Map()\n let oldFiber = wipFiber.alternate?.child\n let position = 0\n\n while (oldFiber) {\n const key = oldFiber.key ?? `__index_${position}__`\n oldFiberMap.set(key, oldFiber)\n oldFiber = oldFiber.sibling\n position++\n }\n\n // Process new elements\n while (index < elements.length) {\n const element = elements[index]\n if (!element) {\n index++\n continue\n }\n\n const key = element.key ?? `__index_${index}__`\n const matchedFiber = oldFiberMap.get(key)\n\n let newFiber\n const sameType = matchedFiber && element.type === matchedFiber.type\n\n if (sameType) {\n // Update existing fiber\n newFiber = {\n type: matchedFiber.type,\n props: element.props,\n dom: matchedFiber.dom,\n parent: wipFiber,\n alternate: matchedFiber,\n effectTag: EFFECT_TAGS.UPDATE,\n hooks: matchedFiber.hooks,\n key: element.key,\n }\n oldFiberMap.delete(key)\n } else {\n // Create new fiber\n newFiber = {\n type: element.type,\n props: element.props,\n dom: null,\n parent: wipFiber,\n alternate: null,\n effectTag: EFFECT_TAGS.PLACEMENT,\n key: element.key,\n }\n\n // Mark matched fiber for deletion if exists\n if (matchedFiber) {\n matchedFiber.effectTag = EFFECT_TAGS.DELETION\n state.deletions.push(matchedFiber)\n oldFiberMap.delete(key)\n }\n }\n\n // Link fibers\n if (index === 0) {\n wipFiber.child = newFiber\n } else if (newFiber) {\n prevSibling.sibling = newFiber\n }\n\n prevSibling = newFiber\n index++\n }\n\n // Delete remaining old fibers\n oldFiberMap.forEach((fiber) => {\n fiber.effectTag = EFFECT_TAGS.DELETION\n state.deletions.push(fiber)\n })\n}\n\nexport { reconcileChildren }\n","/**\n * Priority levels for updates\n */\nconst Priority = {\n IMMEDIATE: 1, // User input (clicks, typing)\n USER_BLOCKING: 2, // Hover, scroll\n NORMAL: 3, // Data fetching\n LOW: 4, // Analytics\n IDLE: 5, // Background tasks\n}\n\nlet currentPriority = Priority.NORMAL\nlet pendingUpdates = []\nlet isScheduling = false\n\n/**\n * Schedule update with priority\n */\nconst scheduleUpdate = (callback, priority = Priority.NORMAL) => {\n pendingUpdates.push({ callback, priority, timestamp: Date.now() })\n\n if (!isScheduling) {\n isScheduling = true\n requestIdleCallback(processPendingUpdates)\n }\n}\n\n/**\n * Process updates by priority\n */\nconst processPendingUpdates = (deadline) => {\n pendingUpdates.sort((a, b) => a.priority - b.priority)\n\n while (pendingUpdates.length > 0 && deadline.timeRemaining() > 1) {\n const update = pendingUpdates.shift()\n currentPriority = update.priority\n update.callback()\n }\n\n if (pendingUpdates.length > 0) {\n requestIdleCallback(processPendingUpdates)\n } else {\n isScheduling = false\n currentPriority = Priority.NORMAL\n }\n}\n\n/**\n * Run callback with specific priority\n */\nconst runWithPriority = (priority, callback) => {\n const previousPriority = currentPriority\n currentPriority = priority\n\n try {\n return callback()\n } finally {\n currentPriority = previousPriority\n }\n}\n\n/**\n * Get current priority\n */\nconst getCurrentPriority = () => currentPriority\n\n/**\n * Wrap setState with priority\n */\nconst createPriorityDispatch = (dispatch) => {\n return (action, priority = currentPriority) => {\n scheduleUpdate(() => dispatch(action), priority)\n }\n}\n\nexport {\n Priority,\n scheduleUpdate,\n runWithPriority,\n getCurrentPriority,\n createPriorityDispatch,\n}\n","import { RYUNIX_TYPES, getState, is } from '../utils/index'\nimport { createElement, Fragment } from './createElement'\nimport { scheduleWork } from './workers'\nimport { Priority } from './priority'\n\nconst validateHookCall = () => {\n const state = getState()\n if (!state.wipFiber) {\n throw new Error(\n 'Hooks can only be called inside the body of a function component.',\n )\n }\n if (!Array.isArray(state.wipFiber.hooks)) {\n state.wipFiber.hooks = []\n }\n}\n\nconst haveDepsChanged = (oldDeps, newDeps) => {\n if (!oldDeps || !newDeps) return true\n if (oldDeps.length !== newDeps.length) return true\n return oldDeps.some((dep, i) => !Object.is(dep, newDeps[i]))\n}\n\n/**\n * The `useStore` function in JavaScript is a custom hook that uses a reducer to manage state updates\n * based on actions provided.\n * @param initialState - The `initialState` parameter in the `useStore` function is the initial state\n * of the store that will be used with the `useReducer` hook. It represents the starting state of the\n * store before any actions are dispatched to update it.\n * @returns The `useStore` function is returning the result of calling the `useReducer` hook with the\n * `reducer` function and the `initialState` as arguments.\n */\nconst useStore = (initialState) => {\n const reducer = (state, action) =>\n is.function(action) ? action(state) : action\n return useReducer(reducer, initialState)\n}\n\n/**\n * The `useReducer` function in JavaScript is used to manage state and actions.\n *\n * @param reducer - The `reducer` parameter in the `useReducer` function is a function that specifies\n * how the state should be updated in response to an action. It takes the current state and an action\n * as arguments and returns the new state based on the action.\n * @param initialState - The `initialState` parameter in the `useReducer` function represents the\n * initial state of the reducer. It is the state that will be used when the reducer is first called or\n * when the state needs to be reset. This initial state can be a simple value, an object, an array, or\n * @param init - The `init` parameter in the `useReducer` function is an optional function that can be\n * used to initialize the state. If provided, it will be called with the `initialState` as its argument\n * and the return value will be used as the initial state for the reducer. If `init`\n * @returns An array containing the current state and the dispatch function is being returned.\n */\nconst useReducer = (reducer, initialState, init) => {\n validateHookCall()\n\n const state = getState()\n const { wipFiber, hookIndex } = state\n const oldHook = wipFiber.alternate?.hooks?.[hookIndex]\n\n const hook = {\n hookID: hookIndex,\n type: RYUNIX_TYPES.RYUNIX_STORE,\n state: oldHook ? oldHook.state : init ? init(initialState) : initialState,\n queue: [],\n }\n\n if (oldHook?.queue) {\n oldHook.queue.forEach((action) => {\n try {\n hook.state = reducer(hook.state, action)\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in reducer:', error)\n }\n }\n })\n }\n\n const dispatch = (action) => {\n if (action === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('dispatch called with undefined action')\n }\n return\n }\n\n hook.queue.push(action)\n\n const currentState = getState()\n currentState.wipRoot = {\n dom: currentState.currentRoot.dom,\n props: currentState.currentRoot.props,\n alternate: currentState.currentRoot,\n }\n currentState.deletions = []\n currentState.hookIndex = 0\n scheduleWork(currentState.wipRoot)\n }\n\n wipFiber.hooks[hookIndex] = hook\n state.hookIndex++\n return [hook.state, dispatch]\n}\n\n/**\n * The `useEffect` function in JavaScript is used to manage side effects in functional components by\n * comparing dependencies and executing a callback function when dependencies change.\n * @param callback - The `callback` parameter in the `useEffect` function is a function that will be\n * executed as the effect. This function can perform side effects like data fetching, subscriptions, or\n * DOM manipulations.\n * @param deps - The `deps` parameter in the `useEffect` function stands for dependencies. It is an\n * optional array that contains values that the effect depends on. The effect will only re-run if any\n * of the values in the `deps` array have changed since the last render. If the `deps` array\n */\nconst useEffect = (callback, deps) => {\n validateHookCall()\n\n if (!is.function(callback)) {\n throw new Error('useEffect callback must be a function')\n }\n if (deps !== undefined && !Array.isArray(deps)) {\n throw new Error('useEffect dependencies must be an array or undefined')\n }\n\n const state = getState()\n const { wipFiber, hookIndex } = state\n const oldHook = wipFiber.alternate?.hooks?.[hookIndex]\n const hasChanged = haveDepsChanged(oldHook?.deps, deps)\n\n const hook = {\n hookID: hookIndex,\n type: RYUNIX_TYPES.RYUNIX_EFFECT,\n deps,\n effect: hasChanged ? callback : null,\n cancel: oldHook?.cancel,\n }\n\n wipFiber.hooks[hookIndex] = hook\n state.hookIndex++\n}\n\n/**\n * The useRef function in JavaScript creates a reference object with an initial value for use in functional components.\n * @param initialValue - The `initialValue` parameter in the `useRef` function represents the initial\n * value that will be assigned to the `current` property of the reference object. This initial value\n * will be used if there is no previous value stored in the hook.\n * @returns The `useRef` function is returning the `current` property of the `hook.value` object, which\n * contains the initial value passed to the `useRef` function.\n */\nconst useRef = (initialValue) => {\n validateHookCall()\n\n const state = getState()\n const { wipFiber, hookIndex } = state\n const oldHook = wipFiber.alternate?.hooks?.[hookIndex]\n\n const hook = {\n hookID: hookIndex,\n type: RYUNIX_TYPES.RYUNIX_REF,\n value: oldHook ? oldHook.value : { current: initialValue },\n }\n\n wipFiber.hooks[hookIndex] = hook\n state.hookIndex++\n return hook.value\n}\n\n/**\n * The useMemo function in JavaScript is used to memoize the result of a computation based on\n * dependencies.\n * @param compute - The `compute` parameter in the `useMemo` function is a callback function that\n * calculates the value that `useMemo` will memoize and return. This function will be called to compute\n * the memoized value when necessary.\n * @param deps - The `deps` parameter in the `useMemo` function refers to an array of dependencies.\n * These dependencies are used to determine whether the memoized value needs to be recalculated or if\n * the previously calculated value can be reused. The `useMemo` hook will recompute the memoized value\n * only if\n * @returns The `useMemo` function is returning the `value` calculated by the `compute` function.\n */\nconst useMemo = (compute, deps) => {\n validateHookCall()\n\n if (!is.function(compute)) {\n throw new Error('useMemo callback must be a function')\n }\n if (!Array.isArray(deps)) {\n throw new Error('useMemo requires a dependencies array')\n }\n\n const state = getState()\n const { wipFiber, hookIndex } = state\n const oldHook = wipFiber.alternate?.hooks?.[hookIndex]\n\n let value\n if (oldHook && !haveDepsChanged(oldHook.deps, deps)) {\n value = oldHook.value\n } else {\n try {\n value = compute()\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Error in useMemo computation:', error)\n }\n value = undefined\n }\n }\n\n const hook = {\n hookID: hookIndex,\n type: RYUNIX_TYPES.RYUNIX_MEMO,\n value,\n deps,\n }\n\n wipFiber.hooks[hookIndex] = hook\n state.hookIndex++\n return value\n}\n\n/**\n * The useCallback function in JavaScript ensures that a callback function is memoized based on its\n * dependencies.\n * @param callback - A function that you want to memoize and return for later use.\n * @param deps - The `deps` parameter in the `useCallback` function refers to an array of dependencies.\n * These dependencies are used to determine when the callback function should be re-evaluated and\n * memoized. If any of the dependencies change, the callback function will be re-executed and the\n * memoized value will\n * @returns The useCallback function is returning the memoized version of the callback function passed\n * as the first argument, based on the dependencies array provided as the second argument.\n */\nconst useCallback = (callback, deps) => {\n if (!is.function(callback)) {\n throw new Error('useCallback requires a function as first argument')\n }\n return useMemo(() => callback, deps)\n}\n\n/**\n * The createContext function creates a context provider and useContext hook in JavaScript.\n * @param [contextId] - The `contextId` parameter in the `createContext` function is used to specify\n * the unique identifier for the context being created. It defaults to `RYUNIX_TYPES.RYUNIX_CONTEXT` if\n * not provided.\n * @param [defaultValue] - The `defaultValue` parameter in the `createContext` function is used to\n * specify the default value that will be returned by the `useContext` hook if no provider is found in\n * the component tree. It is an optional parameter, and if not provided, an empty object `{}` will be\n * used as\n * @returns The `createContext` function returns an object with two properties: `Provider` and\n * `useContext`. The `Provider` property is a component that accepts `children` and `value` props, and\n * sets the `_contextId` and `_contextValue` properties on the element. The `useContext` property is a\n * hook function that retrieves the context value based on the context ID provided, or\n */\nconst createContext = (\n contextId = RYUNIX_TYPES.RYUNIX_CONTEXT,\n defaultValue = {},\n) => {\n const Provider = ({ children, value }) => {\n const element = Fragment({ children })\n element._contextId = contextId\n element._contextValue = value\n return element\n }\n\n Provider._contextId = contextId\n\n const useContext = (ctxID = contextId) => {\n validateHookCall()\n\n const state = getState()\n let fiber = state.wipFiber\n\n while (fiber) {\n if (fiber._contextId === ctxID && fiber._contextValue !== undefined) {\n return fiber._contextValue\n }\n if (\n fiber.type?._contextId === ctxID &&\n fiber.props?.value !== undefined\n ) {\n return fiber.props.value\n }\n fiber = fiber.parent\n }\n return defaultValue\n }\n\n return { Provider, useContext }\n}\n\n/**\n * The `useQuery` function extracts query parameters from the URL in a browser environment.\n * @returns An object containing the query parameters from the current URL is being returned.\n */\nconst useQuery = () => {\n if (typeof window === 'undefined') return {}\n\n const searchParams = new URLSearchParams(window.location.search)\n const query = {}\n for (const [key, value] of searchParams.entries()) {\n query[key] = value\n }\n return query\n}\n\n/**\n * The function `useHash` in JavaScript is used to manage and update the hash portion of the URL in a\n * web application.\n * @returns The `useHash` function returns the current hash value from the window's location. If the\n * window is undefined (e.g., in a server-side environment), it returns an empty string. The function\n * also sets up an event listener to update the hash value when the hash in the URL changes and removes\n * the event listener when the component unmounts.\n */\nconst useHash = () => {\n if (typeof window === 'undefined') return ''\n\n const [hash, setHash] = useStore(window.location.hash)\n useEffect(() => {\n const onHashChange = () => setHash(window.location.hash)\n window.addEventListener('hashchange', onHashChange)\n return () => window.removeEventListener('hashchange', onHashChange)\n }, [])\n return hash\n}\n\n/**\n * The `useMetadata` function in JavaScript is used to dynamically update metadata tags in the document\n * head based on provided tags and options.\n * @param [tags] - The `tags` parameter in the `useMetadata` function is an object that contains\n * metadata information for the webpage. It can include properties like `pageTitle`, `canonical`, and\n * other custom metadata tags like `og:title`, `og:description`, `twitter:title`,\n * `twitter:description`, etc. These tags\n * @param [options] - The `options` parameter in the `useMetadata` function is an object that can\n * contain the following properties:\n * - `title`: An object that can have the following properties:\n * - `template`: A string that defines the template for the page title. It can include a placeholder\n * `%s` that will be replaced with the actual page title.\n * - `prefix`: A string that will be used as the default title if no specific page title is provided.\n * @returns The `useMetadata` function does not return anything. It is a custom hook that updates the\n * document's metadata (such as title and meta tags) based on the provided `tags` and `options` whenever\n * they change.\n * This hook can't be reached by google crawler.\n */\n\nconst useMetadata = (tags = {}, options = {}) => {\n useEffect(() => {\n if (typeof document === 'undefined') return\n\n let finalTitle = 'Ryunix App'\n const template = options.title?.template\n const defaultTitle = options.title?.prefix || 'Ryunix App'\n const pageTitle = tags.pageTitle || tags.title\n\n if (is.string(pageTitle) && pageTitle.trim()) {\n finalTitle = template?.includes('%s')\n ? template.replace('%s', pageTitle)\n : pageTitle\n } else {\n finalTitle = defaultTitle\n }\n\n document.title = finalTitle\n\n if (tags.canonical) {\n let link = document.querySelector('link[rel=\"canonical\"]')\n if (!link) {\n link = document.createElement('link')\n link.setAttribute('rel', 'canonical')\n document.head.appendChild(link)\n }\n link.setAttribute('href', tags.canonical)\n }\n\n Object.entries(tags).forEach(([key, value]) => {\n if (['title', 'pageTitle', 'canonical'].includes(key)) return\n\n const isProperty = key.startsWith('og:') || key.startsWith('twitter:')\n const selector = `meta[${isProperty ? 'property' : 'name'}='${key}']`\n let meta = document.head.querySelector(selector)\n\n if (!meta) {\n meta = document.createElement('meta')\n meta.setAttribute(isProperty ? 'property' : 'name', key)\n document.head.appendChild(meta)\n }\n meta.setAttribute('content', value)\n })\n }, [JSON.stringify(tags), JSON.stringify(options)])\n}\n\n// Router Context\nconst RouterContext = createContext('ryunix.navigation', {\n location: '/',\n params: {},\n query: {},\n navigate: (path) => {},\n route: null,\n})\n\nconst findRoute = (routes, path) => {\n const pathname = path.split('?')[0].split('#')[0]\n const notFoundRoute = routes.find((route) => route.NotFound)\n const notFound = notFoundRoute\n ? { route: { component: notFoundRoute.NotFound }, params: {} }\n : { route: { component: null }, params: {} }\n\n for (const route of routes) {\n if (route.subRoutes) {\n const childRoute = findRoute(route.subRoutes, path)\n if (childRoute) return childRoute\n }\n if (route.path === '*') return notFound\n if (!route.path || typeof route.path !== 'string') continue\n\n const keys = []\n const pattern = new RegExp(\n `^${route.path.replace(/:\\w+/g, (match) => {\n keys.push(match.substring(1))\n return '([^/]+)'\n })}$`,\n )\n\n const match = pathname.match(pattern)\n if (match) {\n const params = keys.reduce((acc, key, index) => {\n acc[key] = match[index + 1]\n return acc\n }, {})\n return { route, params }\n }\n }\n return notFound\n}\n\n/**\n * The `RouterProvider` component manages routing in a Ryunix application by updating the location based\n * on window events and providing context for the current route.\n * @returns The `RouterProvider` component is returning a `RouterContext.Provider` component with a\n * `value` prop set to `contextValue`, and wrapping the `children` within a `Fragment`.\n */\nconst RouterProvider = ({ routes, children }) => {\n const [location, setLocation] = useStore(window.location.pathname)\n\n useEffect(() => {\n const update = () => setLocation(window.location.pathname)\n window.addEventListener('popstate', update)\n window.addEventListener('hashchange', update)\n return () => {\n window.removeEventListener('popstate', update)\n window.removeEventListener('hashchange', update)\n }\n }, [location])\n\n const navigate = (path) => {\n window.history.pushState({}, '', path)\n setLocation(path)\n }\n\n const currentRouteData = findRoute(routes, location) || {}\n const query = useQuery()\n\n const contextValue = {\n location,\n params: currentRouteData.params || {},\n query,\n navigate,\n route: currentRouteData.route,\n }\n\n return createElement(\n RouterContext.Provider,\n { value: contextValue },\n Fragment({ children }),\n )\n}\n\n/**\n * The function `useRouter` returns the context of the Router for navigation in a Ryunix application.\n * @returns The `useRouter` function is returning the result of calling\n * `RouterContext.useContext('ryunix.navigation')`. This function is likely attempting to retrieve the\n * navigation context from the RouterContext.\n */\nconst useRouter = () => {\n return RouterContext.useContext('ryunix.navigation')\n}\n\n/**\n * The `Children` function in JavaScript uses router hooks to handle scrolling to a specific element\n * based on the hash in the URL.\n * @returns The `Children` component is returning the result of calling `createElement` with\n * `route.component` as the first argument and an object with `key`, `params`, `query`, and `hash`\n * properties as the second argument. The `key` property is set to `location`, and the `params`,\n * `query`, and `hash` properties are passed as values from the component's props.\n */\nconst Children = () => {\n const { route, params, query, location } = useRouter()\n if (!route || !route.component) return null\n const hash = useHash()\n\n useEffect(() => {\n if (hash) {\n const id = hash.slice(1)\n const el = document.getElementById(id)\n if (el) el.scrollIntoView({ block: 'start', behavior: 'smooth' })\n }\n }, [hash])\n\n return createElement(route.component, {\n key: location,\n params,\n query,\n hash,\n })\n}\n\n/**\n * The NavLink function in JavaScript is a component that generates a link element with customizable\n * classes and active state based on the current location.\n * @returns The `NavLink` component is returning a JSX element representing an anchor (`<a>`) tag with\n * the following attributes and properties:\n */\nconst NavLink = ({ to, exact = false, ...props }) => {\n const { location, navigate } = useRouter()\n const isActive = exact ? location === to : location.startsWith(to)\n\n const resolveClass = (cls) =>\n typeof cls === 'function' ? cls({ isActive }) : cls || ''\n\n const handleClick = (e) => {\n e.preventDefault()\n navigate(to)\n }\n\n const classAttrName = props['ryunix-class'] ? 'ryunix-class' : 'className'\n const classAttrValue = resolveClass(\n props['ryunix-class'] || props['className'],\n )\n\n const {\n ['ryunix-class']: _omitRyunix,\n className: _omitClassName,\n ...cleanedProps\n } = props\n\n return createElement(\n 'a',\n {\n href: to,\n onClick: handleClick,\n [classAttrName]: classAttrValue,\n ...cleanedProps,\n },\n props.children,\n )\n}\n\n/**\n * useStore with priority support\n */\nconst useStorePriority = (initialState) => {\n const reducer = (state, action) =>\n typeof action === 'function' ? action.value(state) : action.value\n\n const [state, baseDispatch] = useReducer(reducer, initialState)\n\n const dispatch = (action, priority = Priority.NORMAL) => {\n const wrappedAction = {\n value: action,\n priority,\n }\n\n baseDispatch(wrappedAction)\n }\n\n return [state, dispatch]\n}\n\n/**\n * useTransition - Mark updates as non-urgent\n */\nconst useTransition = () => {\n const [isPending, setIsPending] = useStorePriority(false)\n\n const startTransition = (callback) => {\n setIsPending(true, Priority.IMMEDIATE)\n\n setTimeout(() => {\n callback()\n setIsPending(false, Priority.IMMEDIATE)\n }, 0)\n }\n\n return [isPending, startTransition]\n}\n\n/**\n * useDeferredValue - Defer value updates\n */\nconst useDeferredValue = (value) => {\n const [deferredValue, setDeferredValue] = useStorePriority(value)\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setDeferredValue(value, Priority.LOW)\n }, 100)\n\n return () => clearTimeout(timeout)\n }, [value])\n\n return deferredValue\n}\n\nexport {\n useStore,\n useReducer,\n useEffect,\n useRef,\n useMemo,\n useCallback,\n createContext,\n useQuery,\n useHash,\n useMetadata,\n useStorePriority,\n useTransition,\n useDeferredValue,\n // Router exports\n RouterProvider,\n useRouter,\n Children,\n NavLink,\n}\n","import { createDom } from './dom'\nimport { reconcileChildren } from './reconciler'\nimport { getState } from '../utils/index'\nimport { createElement } from './createElement'\nimport { createContext } from './hooks'\n\nconst updateFunctionComponent = (fiber) => {\n const state = getState()\n state.wipFiber = fiber\n state.hookIndex = 0\n state.wipFiber.hooks = []\n\n const children = [fiber.type(fiber.props)]\n\n if (fiber.type._contextId && fiber.props.value !== undefined) {\n fiber._contextId = fiber.type._contextId\n fiber._contextValue = fiber.props.value\n }\n\n reconcileChildren(fiber, children)\n}\n\nconst updateHostComponent = (fiber) => {\n if (!fiber.dom) {\n fiber.dom = createDom(fiber)\n }\n const children = fiber.props?.children || []\n reconcileChildren(fiber, children)\n}\n\n/**\n * The Component `Image` takes in a `src` and other props, and returns an `img` element with the\n * specified `src` and props.\n * @returns The `Image` component is being returned. It is a functional component that renders an `img`\n * element with the specified `src` and other props passed to it.\n */\nconst Image = ({ src, ...props }) => {\n return createElement('img', { ...props, src })\n}\n\nconst { Provider: MDXProvider, useContext: useMDXComponents } = createContext(\n 'ryunix.mdx',\n {},\n)\n\n/**\n * Get merged MDX components from context and provided components\n * @param {Object} components - Additional components to merge\n * @returns {Object} Merged components object\n */\nconst getMDXComponents = (components) => {\n const contextComponents = useMDXComponents()\n return {\n ...contextComponents,\n ...components,\n }\n}\n\n/**\n * Default MDX components with Ryunix-optimized rendering\n */\nconst defaultComponents = {\n // Headings\n h1: (props) => createElement('h1', { ...props }),\n h2: (props) => createElement('h2', { ...props }),\n h3: (props) => createElement('h3', { ...props }),\n h4: (props) => createElement('h4', { ...props }),\n h5: (props) => createElement('h5', { ...props }),\n h6: (props) => createElement('h6', { ...props }),\n\n // Text\n p: (props) => createElement('p', { ...props }),\n a: (props) => createElement('a', { ...props }),\n strong: (props) => createElement('strong', { ...props }),\n em: (props) => createElement('em', { ...props }),\n code: (props) => createElement('code', { ...props }),\n\n // Lists\n ul: (props) => createElement('ul', { ...props }),\n ol: (props) => createElement('ol', { ...props }),\n li: (props) => createElement('li', { ...props }),\n\n // Blocks\n blockquote: (props) => createElement('blockquote', { ...props }),\n pre: (props) => createElement('pre', { ...props }),\n hr: (props) => createElement('hr', { ...props }),\n\n // Tables\n table: (props) => createElement('table', { ...props }),\n thead: (props) => createElement('thead', { ...props }),\n tbody: (props) => createElement('tbody', { ...props }),\n tr: (props) => createElement('tr', { ...props }),\n th: (props) => createElement('th', { ...props }),\n td: (props) => createElement('td', { ...props }),\n\n // Media\n img: (props) => createElement('img', { ...props }),\n}\n\n/**\n * MDX Wrapper component\n * Provides default styling and components for MDX content\n */\nconst MDXContent = ({ children, components = {} }) => {\n const mergedComponents = getMDXComponents(components)\n\n return createElement(\n MDXProvider,\n { value: mergedComponents },\n createElement('div', null, children),\n )\n}\n\nexport {\n // Internal use\n updateFunctionComponent,\n updateHostComponent,\n\n // Buil-in components\n\n // MDX Support\n MDXContent,\n MDXProvider,\n useMDXComponents,\n getMDXComponents,\n defaultComponents,\n\n // Custom components\n Image,\n}\n","/**\n * Performance profiler for Ryunix\n */\nclass Profiler {\n constructor() {\n this.enabled = process.env.NODE_ENV !== 'production'\n this.measures = new Map()\n this.renderTimes = []\n this.maxSamples = 100\n }\n\n startMeasure(name) {\n if (!this.enabled) return\n this.measures.set(name, performance.now())\n }\n\n endMeasure(name) {\n if (!this.enabled) return\n const start = this.measures.get(name)\n if (!start) return\n\n const duration = performance.now() - start\n this.measures.delete(name)\n\n return duration\n }\n\n recordRender(componentName, duration) {\n if (!this.enabled) return\n\n this.renderTimes.push({\n component: componentName,\n duration,\n timestamp: Date.now(),\n })\n\n if (this.renderTimes.length > this.maxSamples) {\n this.renderTimes.shift()\n }\n }\n\n getStats() {\n if (!this.enabled) return null\n\n const total = this.renderTimes.reduce((sum, r) => sum + r.duration, 0)\n const avg = total / this.renderTimes.length\n const max = Math.max(...this.renderTimes.map((r) => r.duration))\n const min = Math.min(...this.renderTimes.map((r) => r.duration))\n\n return { total, avg, max, min, count: this.renderTimes.length }\n }\n\n getSlowestComponents(limit = 10) {\n if (!this.enabled) return []\n\n const byComponent = new Map()\n\n this.renderTimes.forEach(({ component, duration }) => {\n if (!byComponent.has(component)) {\n byComponent.set(component, { total: 0, count: 0, max: 0 })\n }\n const stats = byComponent.get(component)\n stats.total += duration\n stats.count++\n stats.max = Math.max(stats.max, duration)\n })\n\n return Array.from(byComponent.entries())\n .map(([name, stats]) => ({\n name,\n avg: stats.total / stats.count,\n max: stats.max,\n count: stats.count,\n }))\n .sort((a, b) => b.avg - a.avg)\n .slice(0, limit)\n }\n\n logStats() {\n if (!this.enabled) return\n\n const stats = this.getStats()\n if (!stats) return\n\n console.group('🔍 Ryunix Performance Stats')\n console.log(`Total renders: ${stats.count}`)\n console.log(`Avg render time: ${stats.avg.toFixed(2)}ms`)\n console.log(\n `Min: ${stats.min.toFixed(2)}ms | Max: ${stats.max.toFixed(2)}ms`,\n )\n\n const slowest = this.getSlowestComponents(5)\n if (slowest.length > 0) {\n console.log('\\n⚠️ Slowest components:')\n slowest.forEach((comp, i) => {\n console.log(\n `${i + 1}. ${comp.name}: ${comp.avg.toFixed(2)}ms avg (${comp.count} renders)`,\n )\n })\n }\n console.groupEnd()\n }\n\n clear() {\n this.renderTimes = []\n this.measures.clear()\n }\n\n enable() {\n this.enabled = true\n }\n\n disable() {\n this.enabled = false\n }\n}\n\n// Global profiler instance\nconst profiler = new Profiler()\n\n/**\n * Hook to profile component render\n */\nconst useProfiler = (componentName) => {\n const startTime = performance.now()\n\n return () => {\n const duration = performance.now() - startTime\n profiler.recordRender(componentName, duration)\n }\n}\n\n/**\n * HOC to profile component\n */\nconst withProfiler = (Component, name) => {\n return (props) => {\n profiler.startMeasure(name)\n const result = Component(props)\n const duration = profiler.endMeasure(name)\n if (duration) profiler.recordRender(name, duration)\n return result\n }\n}\n\nexport { profiler, useProfiler, withProfiler }\n","import { commitRoot } from './commits'\nimport { updateFunctionComponent, updateHostComponent } from './components'\nimport { getState } from '../utils/index'\nimport { getCurrentPriority, Priority } from './priority'\nimport { profiler } from './profiler'\n\nconst workLoop = (deadline) => {\n const state = getState()\n let shouldYield = false\n\n while (state.nextUnitOfWork && !shouldYield) {\n state.nextUnitOfWork = performUnitOfWork(state.nextUnitOfWork)\n shouldYield = deadline.timeRemaining() < 1\n }\n\n if (!state.nextUnitOfWork && state.wipRoot) {\n commitRoot()\n }\n\n requestIdleCallback(workLoop)\n}\n\nrequestIdleCallback(workLoop)\n\nconst performUnitOfWork = (fiber) => {\n const componentName = fiber.type?.name || fiber.type?.displayName || 'Unknown'\n\n profiler.startMeasure(componentName)\n\n const isFunctionComponent = fiber.type instanceof Function\n if (isFunctionComponent) {\n updateFunctionComponent(fiber)\n } else {\n updateHostComponent(fiber)\n }\n\n const duration = profiler.endMeasure(componentName)\n if (duration) profiler.recordRender(componentName, duration)\n\n if (fiber.child) {\n return fiber.child\n }\n let nextFiber = fiber\n while (nextFiber) {\n if (nextFiber.sibling) {\n return nextFiber.sibling\n }\n nextFiber = nextFiber.parent\n }\n}\n\nconst scheduleWork = (root, priority = Priority.NORMAL) => {\n const state = getState()\n state.nextUnitOfWork = root\n state.wipRoot = root\n state.deletions = []\n state.hookIndex = 0\n state.effects = []\n\n // Higher priority = faster scheduling\n if (priority <= Priority.USER_BLOCKING) {\n requestIdleCallback(workLoop)\n } else {\n setTimeout(() => requestIdleCallback(workLoop), 0)\n }\n}\n\nexport { performUnitOfWork, workLoop, scheduleWork }\n","import { getState } from '../utils/index'\nimport { scheduleWork } from './workers'\n\nconst clearContainer = (container) => {\n while (container.firstChild) {\n container.removeChild(container.firstChild)\n }\n}\n\n/**\n * The `render` function in JavaScript updates the DOM with a new element and schedules work to be done\n * on the element.\n * @param element - The `element` parameter in the `render` function is the element that you want to\n * render in the specified container. It could be a DOM element, a component, or any other valid\n * element that you want to display on the screen.\n * @param container - The `container` parameter in the `render` function is the DOM element where the\n * `element` will be rendered. It is the target container where the element will be appended as a\n * child.\n * @returns The `render` function is returning the `state.wipRoot` object.\n */\nconst render = (element, container) => {\n const state = getState()\n state.wipRoot = {\n dom: container,\n props: {\n children: [element],\n },\n alternate: state.currentRoot,\n }\n\n state.nextUnitOfWork = state.wipRoot\n state.deletions = []\n scheduleWork(state.wipRoot)\n return state.wipRoot\n}\n\n/**\n * The `init` function initializes a rendering process for a main element within a specified container\n * root element.\n * @param MainElement - MainElement is the main component or element that you want to render on the\n * webpage. It could be a React component, a DOM element, or any other element that you want to display\n * on the page.\n * @param [root=__ryunix] - The `root` parameter in the `init` function is a default parameter with the\n * value `'__ryunix'`. If no value is provided for `root` when calling the `init` function, it will\n * default to `'__ryunix'`.\n * @returns The `renderProcess` function is being returned from the `init` function.\n */\nconst init = (MainElement, root = '__ryunix') => {\n const state = getState()\n state.containerRoot = document.getElementById(root)\n const renderProcess = render(MainElement, state.containerRoot)\n return renderProcess\n}\n\nconst safeRender = (component, props, onError) => {\n try {\n return component(props)\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Component error:', error)\n }\n if (onError) onError(error)\n return null\n }\n}\n\nexport { init, render, safeRender }\n","import { useMemo } from './hooks'\n\n/**\n * memo - Memoize component to prevent unnecessary re-renders\n */\nconst memo = (Component, arePropsEqual) => {\n return (props) => {\n const memoizedElement = useMemo(() => {\n return Component(props)\n }, [\n // Default comparison: shallow props comparison\n ...Object.values(props),\n ])\n\n return memoizedElement\n }\n}\n\n/**\n * Custom comparison function for memo\n */\nconst shallowEqual = (prevProps, nextProps) => {\n const prevKeys = Object.keys(prevProps)\n const nextKeys = Object.keys(nextProps)\n\n if (prevKeys.length !== nextKeys.length) return false\n\n return prevKeys.every((key) => Object.is(prevProps[key], nextProps[key]))\n}\n\n/**\n * Deep comparison for complex objects\n */\nconst deepEqual = (a, b) => {\n if (a === b) return true\n if (a == null || b == null) return false\n if (typeof a !== 'object' || typeof b !== 'object') return false\n\n const keysA = Object.keys(a)\n const keysB = Object.keys(b)\n\n if (keysA.length !== keysB.length) return false\n\n return keysA.every((key) => deepEqual(a[key], b[key]))\n}\n\nexport { memo, shallowEqual, deepEqual }\n","import { createElement } from './createElement'\nimport { useStore, useEffect } from './hooks'\n\n/**\n * Lazy load component\n */\nconst lazy = (importFn) => {\n let Component = null\n let promise = null\n let error = null\n\n return (props) => {\n const [, forceUpdate] = useStore(0)\n\n useEffect(() => {\n if (Component || error) return\n\n if (!promise) {\n promise = importFn()\n .then((module) => {\n Component = module.default || module\n forceUpdate((x) => x + 1)\n })\n .catch((err) => {\n error = err\n forceUpdate((x) => x + 1)\n })\n }\n }, [])\n\n if (error) throw error\n if (!Component) return null\n return createElement(Component, props)\n }\n}\n\n/**\n * Suspense component (basic implementation)\n */\nconst Suspense = ({ fallback, children }) => {\n const [isLoading, setIsLoading] = useStore(true)\n\n useEffect(() => {\n setIsLoading(false)\n }, [])\n\n if (isLoading && fallback) {\n return fallback\n }\n\n return children\n}\n\n/**\n * Preload component for prefetching\n */\nconst preload = (importFn) => {\n return importFn()\n}\n\nexport { lazy, Suspense, preload }\n","let isBatching = false\nlet pendingUpdates = []\n\n/**\n * The `batchUpdates` function in JavaScript allows for batching multiple updates and flushing them all\n * at once.\n * @param callback - The `callback` parameter in the `batchUpdates` function is a function that will be\n * executed within a batch update. This function can contain multiple updates that need to be processed\n * together in a batch to improve performance and avoid unnecessary re-renders.\n */\nconst batchUpdates = (callback) => {\n const wasBatching = isBatching\n isBatching = true\n\n try {\n callback()\n } finally {\n isBatching = wasBatching\n\n if (!isBatching && pendingUpdates.length > 0) {\n flushUpdates()\n }\n }\n}\n\n/**\n * The `queueUpdate` function adds an update to a queue and flushes the updates if not currently\n * batching.\n * @param update - The `update` parameter is the new update that needs to be added to the queue for\n * processing.\n */\nconst queueUpdate = (update) => {\n pendingUpdates.push(update)\n\n if (!isBatching) {\n flushUpdates()\n }\n}\n\n/**\n * The `flushUpdates` function processes and executes pending updates stored in an array.\n * @returns If the `pendingUpdates` array is empty, the `flushUpdates` function will return nothing\n * (undefined).\n */\nconst flushUpdates = () => {\n if (pendingUpdates.length === 0) return\n\n const updates = pendingUpdates\n pendingUpdates = []\n\n // Execute all updates\n updates.forEach((update) => update())\n}\n\nexport { batchUpdates, queueUpdate, flushUpdates }\n","import * as Ryunix from './lib/index.js'\n\nexport * from './lib/index.js'\nexport {\n Image,\n MDXContent,\n MDXProvider,\n useMDXComponents,\n getMDXComponents,\n defaultComponents,\n} from './lib/components.js'\nwindow.Ryunix = Ryunix\nexport default Ryunix\n"],"names":["globalState","containerRoot","nextUnitOfWork","currentRoot","wipRoot","deletions","wipFiber","hookIndex","effects","getState","CAMEL_TO_KEBAB_REGEX","RYUNIX_TYPES","Object","freeze","TEXT_ELEMENT","Symbol","for","RYUNIX_ELEMENT","RYUNIX_EFFECT","RYUNIX_MEMO","RYUNIX_URL_QUERY","RYUNIX_REF","RYUNIX_STORE","RYUNIX_REDUCE","RYUNIX_FRAGMENT","RYUNIX_CONTEXT","STRINGS","OBJECT","FUNCTION","STYLE","CLASS_NAME","CHILDREN","BOOLEAN","STRING","UNDEFINED","OLD_STRINGS","EFFECT_TAGS","PLACEMENT","UPDATE","DELETION","NO_EFFECT","is","val","createElement","type","props","children","flat","map","child","text","nodeValue","Fragment","Array","isArray","isEvent","key","startsWith","isProperty","isNew","prev","next","isGone","cancelEffectsDeep","fiber","hooks","length","filter","hook","cancel","forEach","error","process","env","NODE_ENV","console","sibling","runEffects","i","effect","cleanup","applyStyles","dom","styleObj","cssText","entries","_","value","replace","match","toLowerCase","join","style","applyClasses","prevClasses","nextClasses","trim","oldClasses","split","Boolean","classList","remove","newClasses","add","updateDom","prevProps","nextProps","keys","name","eventType","substring","removeEventListener","warn","includes","styleValue","addEventListener","commitWork","domParentFiber","parent","domParent","effectTag","appendChild","cancelEffects","alternate","commitDeletion","removeChild","reconcileChildren","elements","state","prevSibling","index","oldFiberMap","Map","oldFiber","position","set","element","matchedFiber","get","newFiber","delete","push","Priority","IMMEDIATE","USER_BLOCKING","NORMAL","LOW","IDLE","validateHookCall","Error","haveDepsChanged","oldDeps","newDeps","some","dep","useStore","initialState","useReducer","action","reducer","init","oldHook","hookID","queue","undefined","currentState","scheduleWork","useEffect","callback","deps","hasChanged","useRef","initialValue","current","useMemo","compute","useCallback","createContext","contextId","defaultValue","Provider","_contextId","_contextValue","useContext","ctxID","useQuery","window","searchParams","URLSearchParams","location","search","query","useHash","hash","setHash","onHashChange","useMetadata","tags","options","document","finalTitle","template","title","defaultTitle","prefix","pageTitle","canonical","link","querySelector","setAttribute","head","selector","meta","JSON","stringify","RouterContext","params","navigate","path","route","findRoute","routes","pathname","notFoundRoute","find","NotFound","notFound","component","subRoutes","childRoute","pattern","RegExp","reduce","acc","RouterProvider","setLocation","update","currentRouteData","contextValue","history","pushState","useRouter","Children","id","slice","el","getElementById","scrollIntoView","block","behavior","NavLink","to","exact","isActive","classAttrName","classAttrValue","cls","_omitRyunix","className","_omitClassName","cleanedProps","href","onClick","e","preventDefault","useStorePriority","baseDispatch","priority","useTransition","isPending","setIsPending","setTimeout","useDeferredValue","deferredValue","setDeferredValue","timeout","clearTimeout","updateHostComponent","createTextNode","createDom","MDXProvider","useMDXComponents","getMDXComponents","components","defaultComponents","h1","h2","h3","h4","h5","h6","p","a","strong","em","code","ul","ol","li","blockquote","pre","hr","table","thead","tbody","tr","th","td","img","profiler","constructor","this","enabled","measures","renderTimes","maxSamples","startMeasure","performance","now","endMeasure","start","duration","recordRender","componentName","timestamp","Date","shift","getStats","total","sum","r","avg","max","Math","min","count","getSlowestComponents","limit","byComponent","has","stats","from","sort","b","logStats","group","log","toFixed","slowest","comp","groupEnd","clear","enable","disable","useProfiler","startTime","withProfiler","Component","result","workLoop","deadline","shouldYield","performUnitOfWork","timeRemaining","commitRoot","requestIdleCallback","displayName","Function","updateFunctionComponent","nextFiber","root","render","container","MainElement","safeRender","onError","memo","arePropsEqual","values","lazy","importFn","promise","forceUpdate","then","module","default","x","catch","err","Suspense","fallback","isLoading","setIsLoading","isBatching","pendingUpdates","batchUpdates","wasBatching","flushUpdates","updates","Ryunix","src","mergedComponents"],"mappings":"6OAeA,IAAIA,EAZsB,CACxBC,cAAe,KACfC,eAAgB,KAChBC,YAAa,KACbC,QAAS,KACTC,UAAW,GACXC,SAAU,KACVC,UAAW,EACXC,QAAS,IAMX,MAAMC,EAAW,IAAMT,EAOjBU,EAAuB,SAEvBC,EAAeC,OAAOC,OAAO,CACjCC,aAAcC,OAAOC,IAAI,uBACzBC,eAAgBF,OAAOC,IAAI,kBAC3BE,cAAeH,OAAOC,IAAI,iBAC1BG,YAAaJ,OAAOC,IAAI,eACxBI,iBAAkBL,OAAOC,IAAI,mBAC7BK,WAAYN,OAAOC,IAAI,cACvBM,aAAcP,OAAOC,IAAI,gBACzBO,cAAeR,OAAOC,IAAI,iBAC1BQ,gBAAiBT,OAAOC,IAAI,mBAC5BS,eAAgBV,OAAOC,IAAI,oBAGvBU,EAAUd,OAAOC,OAAO,CAC5Bc,OAAQ,SACRC,SAAU,WACVC,MAAO,eACPC,WAAY,eACZC,SAAU,WACVC,QAAS,UACTC,OAAQ,SACRC,UAAW,cAGPC,EAAcvB,OAAOC,OAAO,CAChCgB,MAAO,QACPC,WAAY,cAGRM,EAAcxB,OAAOC,OAAO,CAChCwB,UAAWtB,OAAOC,IAAI,sCACtBsB,OAAQvB,OAAOC,IAAI,mCACnBuB,SAAUxB,OAAOC,IAAI,qCACrBwB,UAAWzB,OAAOC,IAAI,wCA4GlByB,EACKC,GAAgB,OAARA,UAAuBA,IAAQhB,EAAQC,OADpDc,EAEOC,UAAeA,IAAQhB,EAAQE,SAFtCa,EAGKC,UAAeA,IAAQhB,EAAQO,OAHpCQ,EAKGC,GAAgB,OAARA,ECvIXC,EAAgB,CAACC,EAAMC,KAAUC,KAG9B,CACLF,OACAC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EAAcH,GACpBA,IAAa,EAEb,IACEjO,GACF,CAAC,QACCiO,GAAaG,GAERH,IAAcC,GAAexU,OAAS,GACzC2U,IAEJ,GAsBIA,GAAe,KACnB,GAA8B,IAA1BH,GAAexU,OAAc,OAEjC,MAAM4U,EAAUJ,GAChBA,GAAiB,GAGjBI,EAAQxU,QAASsK,GAAWA,kbCxC9BlD,OAAOqN,OAASA,+CPyBF,EAAGC,SAAQnW,KAChBF,EAAc,MAAO,IAAKE,EAAOmW,qBAkEvB,EAAGlW,WAAU6O,aAAa,CAAA,MAC3C,MAAMsH,EAAmBvH,EAAiBC,GAE1C,OAAOhP,EACL6O,EACA,CAAEjM,MAAO0T,GACTtW,EAAc,MAAO,KAAMG"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * JSX Development Runtime for Ryunix
3
+ * Used during development for better debugging
4
+ */
5
+
6
+ export { jsx, jsxs, jsxDEV, Fragment } from './jsx-runtime.js'
@@ -0,0 +1,56 @@
1
+ /**
2
+ * JSX Runtime for Ryunix - Automatic JSX Runtime
3
+ * This enables compatibility with modern JSX transformations
4
+ */
5
+
6
+ import { createElement, Fragment } from '../dist/Ryunix.esm.js'
7
+
8
+ /**
9
+ * Create JSX element (automatic runtime)
10
+ * @param {string|Function} type - Element type
11
+ * @param {Object} props - Element props
12
+ * @param {string} key - Element key
13
+ * @returns {Object} Ryunix element
14
+ */
15
+ export function jsx(type, props, key) {
16
+ const { children, ...restProps } = props || {}
17
+
18
+ // If children is provided, pass it as rest parameter
19
+ if (children !== undefined) {
20
+ return createElement(
21
+ type,
22
+ key !== undefined ? { ...restProps, key } : restProps,
23
+ ...(Array.isArray(children) ? children : [children]),
24
+ )
25
+ }
26
+
27
+ return createElement(
28
+ type,
29
+ key !== undefined ? { ...restProps, key } : restProps,
30
+ )
31
+ }
32
+
33
+ /**
34
+ * Create JSX element with multiple children (automatic runtime)
35
+ * @param {string|Function} type - Element type
36
+ * @param {Object} props - Element props
37
+ * @param {string} key - Element key
38
+ * @returns {Object} Ryunix element
39
+ */
40
+ export function jsxs(type, props, key) {
41
+ return jsx(type, props, key)
42
+ }
43
+
44
+ /**
45
+ * Create JSX development element (with additional debug info)
46
+ * @param {string|Function} type - Element type
47
+ * @param {Object} props - Element props
48
+ * @param {string} key - Element key
49
+ * @returns {Object} Ryunix element
50
+ */
51
+ export function jsxDEV(type, props, key) {
52
+ return jsx(type, props, key)
53
+ }
54
+
55
+ // Export Fragment for JSX runtime
56
+ export { Fragment }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsetsoft/ryunixjs",
3
- "version": "1.2.3-canary.8",
3
+ "version": "1.2.4",
4
4
  "license": "MIT",
5
5
  "main": "./dist/Ryunix.umd.js",
6
6
  "module": "./dist/Ryunix.esm.js",
@@ -10,10 +10,21 @@
10
10
  "require": "./dist/Ryunix.umd.js",
11
11
  "default": "./dist/Ryunix.umd.js"
12
12
  },
13
- "./package.json": "./package.json"
13
+ "./package.json": "./package.json",
14
+ "./jsx-runtime": {
15
+ "import": "./jsx/jsx-runtime.js",
16
+ "require": "./jsx/jsx-runtime.js",
17
+ "default": "./jsx/jsx-runtime.js"
18
+ },
19
+ "./jsx-dev-runtime": {
20
+ "import": "./jsx/jsx-dev-runtime.js",
21
+ "require": "./jsx/jsx-dev-runtime.js",
22
+ "default": "./jsx/jsx-dev-runtime.js"
23
+ }
14
24
  },
15
25
  "files": [
16
- "dist"
26
+ "dist",
27
+ "jsx"
17
28
  ],
18
29
  "type": "module",
19
30
  "scripts": {