flexium 0.16.13 → 0.16.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-33M3W7D4.mjs +2 -0
- package/dist/{chunk-G6CRD7I5.mjs.map → chunk-33M3W7D4.mjs.map} +1 -1
- package/dist/{chunk-N5E4LKDY.js → chunk-47EPSC5Q.js} +2 -2
- package/dist/{chunk-N5E4LKDY.js.map → chunk-47EPSC5Q.js.map} +1 -1
- package/dist/{chunk-B645IQS6.js → chunk-4E3YIGJX.js} +2 -2
- package/dist/{chunk-B645IQS6.js.map → chunk-4E3YIGJX.js.map} +1 -1
- package/dist/{chunk-HUE2TOCR.js → chunk-A4VGFEMF.js} +2 -2
- package/dist/{chunk-HUE2TOCR.js.map → chunk-A4VGFEMF.js.map} +1 -1
- package/dist/chunk-AD2E2FQE.js +2 -0
- package/dist/{chunk-EROGYZGA.js.map → chunk-AD2E2FQE.js.map} +1 -1
- package/dist/{chunk-LOKMOGSA.js → chunk-BP5PDE6F.js} +2 -2
- package/dist/{chunk-LOKMOGSA.js.map → chunk-BP5PDE6F.js.map} +1 -1
- package/dist/{chunk-CB6CIG76.mjs → chunk-FJNIW7B2.mjs} +2 -2
- package/dist/{chunk-CB6CIG76.mjs.map → chunk-FJNIW7B2.mjs.map} +1 -1
- package/dist/chunk-MFUHRZBV.mjs +2 -0
- package/dist/chunk-MFUHRZBV.mjs.map +1 -0
- package/dist/chunk-OU6XJZ76.js +2 -0
- package/dist/chunk-OU6XJZ76.js.map +1 -0
- package/dist/chunk-P6NMD5QH.mjs +2 -0
- package/dist/{chunk-KDFYLOV7.mjs.map → chunk-P6NMD5QH.mjs.map} +1 -1
- package/dist/chunk-TIUNOZRI.mjs +2 -0
- package/dist/chunk-TIUNOZRI.mjs.map +1 -0
- package/dist/chunk-TQ64P7YL.js +2 -0
- package/dist/chunk-TQ64P7YL.js.map +1 -0
- package/dist/{chunk-S5DHAAMO.mjs → chunk-UQNPGF7C.mjs} +2 -2
- package/dist/{chunk-S5DHAAMO.mjs.map → chunk-UQNPGF7C.mjs.map} +1 -1
- package/dist/chunk-VB564E5E.mjs +2 -0
- package/dist/{chunk-PPPU2XSA.mjs.map → chunk-VB564E5E.mjs.map} +1 -1
- package/dist/core.d.cts +2 -1
- package/dist/core.d.ts +2 -1
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/dom.js +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/render-FMQNBA7X.js +2 -0
- package/dist/{render-MOUO34XW.js.map → render-FMQNBA7X.js.map} +1 -1
- package/dist/render-HZQ6HEMS.mjs +2 -0
- package/dist/{render-SMFHDQGA.mjs.map → render-HZQ6HEMS.mjs.map} +1 -1
- package/dist/router.js +1 -1
- package/dist/router.mjs +1 -1
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-7LE75TKD.js +0 -2
- package/dist/chunk-7LE75TKD.js.map +0 -1
- package/dist/chunk-EROGYZGA.js +0 -2
- package/dist/chunk-G6CRD7I5.mjs +0 -2
- package/dist/chunk-KDFYLOV7.mjs +0 -2
- package/dist/chunk-PPPU2XSA.mjs +0 -2
- package/dist/chunk-SB3OY2QH.mjs +0 -2
- package/dist/chunk-SB3OY2QH.mjs.map +0 -1
- package/dist/chunk-VNYPOCV7.js +0 -2
- package/dist/chunk-VNYPOCV7.js.map +0 -1
- package/dist/chunk-WHRUAZR4.mjs +0 -2
- package/dist/chunk-WHRUAZR4.mjs.map +0 -1
- package/dist/render-MOUO34XW.js +0 -2
- package/dist/render-SMFHDQGA.mjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dom/render.ts"],"names":["instanceRegistry","currentRenderingInstance","resetRender","removeComponentInstance","instance","child","node","renderComponent","fnode","parent","registryParent","effectiveRegistryParent","mergeProps","props","hasExplicitKey","parentRegistry","key","instanceCount","componentName","_","k","newProps","isFirstRender","renderFn","currentFnode","currentProps","pushContext","previousRenderingInstance","result","runWithComponent","newNodes","renderNode","nodeParent","marker","lastNode","tempContainer","newNodesArray","reconciledNodes","reconcile","unsafeEffect","oldKeysSet","nodes","newKeysSet","keysToRemove","dom","value","eventName","setAttribute","el","canReuse","oldNode","newNode","updateAttributes","oldEl","newEl","attr","oldHandlers","newHandlers","event","reconcileChildren","oldChildren","newChildren","maxLen","i","oldChild","newChild","patchNode","ownerInstance","idx","oldNodes","beforeMarker","resultNodes","render","app","container","registry"],"mappings":"4EAiBA,IAAMA,EAAmB,IAAI,OAAA,CAGzBC,CAAAA,CAAwD,IAAA,CAGrD,SAASC,CAAAA,EAAoB,CAChCD,CAAAA,CAA2B,KAE/B,CAGA,SAASE,CAAAA,CAAwBC,CAAAA,CAAsC,CACnEA,EAAS,QAAA,CAAS,OAAA,CAAQC,CAAAA,EAAS,CAC/BF,EAAwBE,CAAK,EACjC,CAAC,CAAA,CAEDD,EAAS,KAAA,CAAM,OAAA,CAAQE,CAAAA,EAAQ,CACvBA,EAAK,UAAA,EACLA,CAAAA,CAAK,UAAA,CAAW,WAAA,CAAYA,CAAI,EAExC,CAAC,CAAA,CAEDF,CAAAA,CAAS,SAAS,KAAA,EAAM,CAEpBA,CAAAA,CAAS,cAAA,EACTA,EAAS,cAAA,CAAe,QAAA,CAAS,MAAA,CAAOA,CAAQ,EAExD,CAGA,SAASG,CAAAA,CAAgBC,CAAAA,CAAYC,EAAqBC,GAAAA,CAAsC,CAC5F,IAAMC,CAAAA,CAA0BD,KAAkBD,CAAAA,CAE5CG,CAAAA,CAAcN,CAAAA,EAAc,CAC9B,IAAMO,CAAAA,CAAQ,CAAE,GAAGP,CAAAA,CAAK,KAAM,CAAA,CAC9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E,OAAAA,CAAAA,CAAU,SAAA,CAAY,EAAA,CAElB,OAAOD,GAAQ,UAAA,GACfA,CAAAA,CAAM,CAAE,IAAA,CAAMA,EAAK,KAAA,CAAO,GAAI,QAAA,CAAU,GAAI,GAAA,CAAK,MAAU,CAAA,CAAA,CAG/D1C,CAAAA,CAAW0C,EAAKC,CAAS,CAAA,CAGlB,IAAM,CAET,GAAI1E,CAAAA,CAAiB,GAAA,CAAI0E,CAAS,CAAA,CAAG,CACjC,IAAMC,CAAAA,CAAW3E,CAAAA,CAAiB,GAAA,CAAI0E,CAAS,CAAA,CAC/CC,CAAAA,CAAS,OAAA,CAAQvE,CAAAA,EAAY,CACzBD,CAAAA,CAAwBC,CAAQ,EACpC,CAAC,EACDuE,CAAAA,CAAS,KAAA,EAAM,CACf3E,CAAAA,CAAiB,OAAO0E,CAAS,EACrC,CAEAA,CAAAA,CAAU,SAAA,CAAY,GAC1B,CACJ","file":"chunk-KDFYLOV7.mjs","sourcesContent":["import { pushContext } from '../core/context'\nimport { runWithComponent, type ComponentInstance } from '../core/hook'\nimport { unsafeEffect } from '../core/lifecycle'\n\n// Extended ComponentInstance for DOM tracking\ninterface DOMComponentInstance extends ComponentInstance {\n nodes: Node[]\n parent: HTMLElement\n fnode: any\n props: any\n key?: any\n renderFn?: () => void\n children: Set<DOMComponentInstance>\n parentInstance?: DOMComponentInstance\n}\n\n// Registry to store component instances by parent and key\nconst instanceRegistry = new WeakMap<HTMLElement, Map<any, DOMComponentInstance>>()\n\n// Current rendering component instance (for tracking parent-child relationships)\nlet currentRenderingInstance: DOMComponentInstance | null = null\n\n// Reset render state - call before re-rendering the entire app (e.g., srcdoc update)\nexport function resetRender(): void {\n currentRenderingInstance = null\n // Note: WeakMap will automatically GC old entries when their keys are gone\n}\n\n// Recursively remove component instance and all its children\nfunction removeComponentInstance(instance: DOMComponentInstance): void {\n instance.children.forEach(child => {\n removeComponentInstance(child)\n })\n\n instance.nodes.forEach(node => {\n if (node.parentNode) {\n node.parentNode.removeChild(node)\n }\n })\n\n instance.children.clear()\n\n if (instance.parentInstance) {\n instance.parentInstance.children.delete(instance)\n }\n}\n\n// Render a function component with reactive re-rendering\nfunction renderComponent(fnode: any, parent: HTMLElement, registryParent?: HTMLElement): Node[] {\n const effectiveRegistryParent = registryParent || parent\n\n const mergeProps = (node: any) => {\n const props = { ...node.props }\n if (node.children && node.children.length > 0) {\n props.children = node.children.length === 1\n ? node.children[0]\n : node.children\n }\n return props\n }\n\n const hasExplicitKey = fnode.key !== undefined\n\n if (!instanceRegistry.has(effectiveRegistryParent)) {\n instanceRegistry.set(effectiveRegistryParent, new Map())\n }\n const parentRegistry = instanceRegistry.get(effectiveRegistryParent)!\n\n let key: any\n if (hasExplicitKey) {\n key = fnode.key\n } else {\n let instanceCount = 0\n const componentName = fnode.type.name || 'anonymous'\n parentRegistry.forEach((_, k) => {\n if (typeof k === 'string' && k.startsWith(`__auto_${componentName}_`)) {\n instanceCount++\n }\n })\n key = `__auto_${componentName}_${instanceCount}`\n }\n\n if (parentRegistry.has(key)) {\n const instance = parentRegistry.get(key)!\n instance.fnode = fnode\n const newProps = mergeProps(fnode)\n instance.props = newProps\n instance.children.clear()\n\n if (instance.renderFn) {\n instance.renderFn()\n }\n\n return instance.nodes\n }\n\n const instance: DOMComponentInstance = {\n hooks: [],\n hookIndex: 0,\n nodes: [],\n parent,\n fnode: fnode,\n props: mergeProps(fnode),\n key,\n children: new Set(),\n parentInstance: currentRenderingInstance || undefined\n }\n\n if (currentRenderingInstance) {\n currentRenderingInstance.children.add(instance)\n }\n\n parentRegistry.set(key, instance)\n\n let isFirstRender = true\n\n const renderFn = () => {\n const currentFnode = instance.fnode\n const currentProps = instance.props\n\n const isProvider = (currentFnode.type as any)._contextId !== undefined\n if (isProvider) {\n pushContext((currentFnode.type as any)._contextId, currentProps.value)\n }\n\n const previousRenderingInstance = currentRenderingInstance\n currentRenderingInstance = instance\n\n const result = runWithComponent(instance, () => currentFnode.type(currentProps))\n\n if (isFirstRender) {\n const newNodes = renderNode(result, parent)\n instance.nodes = newNodes ? (Array.isArray(newNodes) ? newNodes : [newNodes]) : []\n instance.nodes.forEach(node => {\n if (!(node as any).__ownerInstance) {\n (node as any).__ownerInstance = instance\n }\n })\n isFirstRender = false\n } else {\n if (instance.nodes.length === 0) {\n const newNodes = renderNode(result, parent)\n instance.nodes = newNodes ? (Array.isArray(newNodes) ? newNodes : [newNodes]) : []\n currentRenderingInstance = previousRenderingInstance\n return\n }\n\n const firstNode = instance.nodes[0]\n const nodeParent = firstNode.parentNode as HTMLElement\n\n if (!nodeParent) {\n currentRenderingInstance = previousRenderingInstance\n return\n }\n\n const marker = document.createComment('flexium-marker')\n const lastNode = instance.nodes[instance.nodes.length - 1]\n if (lastNode.nextSibling) {\n nodeParent.insertBefore(marker, lastNode.nextSibling)\n } else {\n nodeParent.appendChild(marker)\n }\n\n instance.children.clear()\n\n const tempContainer = document.createElement('div')\n const newNodes = renderNode(result, tempContainer, nodeParent)\n const newNodesArray = newNodes ? (Array.isArray(newNodes) ? newNodes : [newNodes]) : []\n\n const reconciledNodes = reconcile(instance.nodes, newNodesArray, nodeParent, marker)\n\n nodeParent.removeChild(marker)\n\n instance.nodes = reconciledNodes\n }\n\n currentRenderingInstance = previousRenderingInstance\n }\n\n instance.renderFn = renderFn\n\n unsafeEffect(renderFn)\n\n return instance.nodes\n}\n\nexport function renderNode(fnode: any, parent: HTMLElement, registryParent?: HTMLElement): Node | Node[] | null {\n const effectiveRegistryParent = registryParent || parent\n\n if (fnode === null || fnode === undefined || typeof fnode === 'boolean') {\n const node = document.createTextNode('')\n parent.appendChild(node)\n return node\n }\n\n if (typeof fnode === 'string' || typeof fnode === 'number') {\n const node = document.createTextNode(String(fnode))\n parent.appendChild(node)\n return node\n }\n\n if (Array.isArray(fnode)) {\n const oldKeysSet = new Set<any>()\n if (instanceRegistry.has(effectiveRegistryParent)) {\n const parentRegistry = instanceRegistry.get(effectiveRegistryParent)!\n parentRegistry.forEach((_, key) => oldKeysSet.add(key))\n }\n\n const nodes: Node[] = []\n fnode.forEach((child) => {\n const result = renderNode(child, parent, registryParent)\n if (result) {\n if (Array.isArray(result)) {\n nodes.push(...result)\n } else {\n nodes.push(result)\n }\n }\n })\n\n const newKeysSet = new Set<any>()\n if (instanceRegistry.has(effectiveRegistryParent)) {\n const parentRegistry = instanceRegistry.get(effectiveRegistryParent)!\n parentRegistry.forEach((_, key) => newKeysSet.add(key))\n }\n\n if (instanceRegistry.has(effectiveRegistryParent)) {\n const parentRegistry = instanceRegistry.get(effectiveRegistryParent)!\n const keysToRemove: any[] = []\n\n oldKeysSet.forEach(key => {\n if (!newKeysSet.has(key)) {\n const instance = parentRegistry.get(key)\n if (instance) {\n removeComponentInstance(instance)\n keysToRemove.push(key)\n }\n }\n })\n\n keysToRemove.forEach(key => parentRegistry.delete(key))\n }\n\n return nodes\n }\n\n if (typeof fnode === 'object') {\n if (typeof fnode.type === 'string') {\n const dom = document.createElement(fnode.type)\n\n if (fnode.props) {\n Object.entries(fnode.props).forEach(([key, value]) => {\n if (key === 'ref') {\n // Handle both callback refs and RefObject\n if (typeof value === 'function') {\n value(dom)\n } else if (value && typeof value === 'object' && 'current' in value) {\n value.current = dom\n }\n } else if (key.startsWith('on') && typeof value === 'function') {\n const eventName = key.slice(2).toLowerCase()\n dom.addEventListener(eventName, value as EventListener)\n\n if (!(dom as any).__eventHandlers) {\n (dom as any).__eventHandlers = {}\n }\n (dom as any).__eventHandlers[eventName] = value\n } else if (key !== 'ref') {\n setAttribute(dom, key, value)\n }\n })\n }\n\n if (fnode.children && fnode.children.length > 0) {\n fnode.children.forEach((child: any) => {\n renderNode(child, dom)\n })\n }\n\n parent.appendChild(dom)\n return dom\n }\n\n if (typeof fnode.type === 'function') {\n return renderComponent(fnode, parent, registryParent)\n }\n }\n\n return null\n}\n\nfunction setAttribute(el: Element, key: string, value: any) {\n if (value === null || value === undefined) {\n el.removeAttribute(key)\n } else if (key === 'style' && typeof value === 'object') {\n Object.assign((el as HTMLElement).style, value)\n } else if (key === 'class') {\n el.className = String(value)\n } else if (key in el && typeof (el as any)[key] !== 'function') {\n (el as any)[key] = value\n } else {\n el.setAttribute(key, String(value))\n }\n}\n\n// Reconciliation helpers\nfunction canReuse(oldNode: Node, newNode: Node): boolean {\n if (oldNode.nodeType !== newNode.nodeType) return false\n if (oldNode.nodeType === Node.ELEMENT_NODE && newNode.nodeType === Node.ELEMENT_NODE) {\n return (oldNode as Element).tagName === (newNode as Element).tagName\n }\n return true\n}\n\nfunction updateAttributes(oldEl: Element, newEl: Element): void {\n const oldAttrs = Array.from(oldEl.attributes)\n oldAttrs.forEach(attr => {\n if (!newEl.hasAttribute(attr.name)) {\n oldEl.removeAttribute(attr.name)\n }\n })\n\n const newAttrs = Array.from(newEl.attributes)\n newAttrs.forEach(attr => {\n if (oldEl.getAttribute(attr.name) !== attr.value) {\n if (attr.name === 'value' && 'value' in oldEl) {\n (oldEl as HTMLInputElement).value = attr.value\n } else if (attr.name === 'checked' && 'checked' in oldEl) {\n (oldEl as HTMLInputElement).checked = attr.value === 'true' || attr.value === ''\n } else {\n oldEl.setAttribute(attr.name, attr.value)\n }\n }\n })\n\n const oldHandlers = (oldEl as any).__eventHandlers || {}\n const newHandlers = (newEl as any).__eventHandlers || {}\n\n Object.keys(oldHandlers).forEach(event => {\n if (!newHandlers[event]) {\n oldEl.removeEventListener(event, oldHandlers[event])\n }\n })\n\n Object.keys(newHandlers).forEach(event => {\n if (oldHandlers[event] !== newHandlers[event]) {\n if (oldHandlers[event]) {\n oldEl.removeEventListener(event, oldHandlers[event])\n }\n oldEl.addEventListener(event, newHandlers[event])\n }\n })\n\n if (Object.keys(newHandlers).length > 0) {\n (oldEl as any).__eventHandlers = newHandlers\n } else {\n delete (oldEl as any).__eventHandlers\n }\n\n if (oldEl instanceof HTMLInputElement && newEl instanceof HTMLInputElement) {\n if (oldEl.value !== newEl.value) {\n oldEl.value = newEl.value\n }\n if (oldEl.checked !== newEl.checked) {\n oldEl.checked = newEl.checked\n }\n }\n if (oldEl instanceof HTMLTextAreaElement && newEl instanceof HTMLTextAreaElement) {\n if (oldEl.value !== newEl.value) {\n oldEl.value = newEl.value\n }\n }\n if (oldEl instanceof HTMLSelectElement && newEl instanceof HTMLSelectElement) {\n if (oldEl.value !== newEl.value) {\n oldEl.value = newEl.value\n }\n }\n}\n\nfunction reconcileChildren(oldEl: Element, newEl: Element): void {\n const oldChildren = Array.from(oldEl.childNodes)\n const newChildren = Array.from(newEl.childNodes)\n const maxLen = Math.max(oldChildren.length, newChildren.length)\n\n for (let i = 0; i < maxLen; i++) {\n const oldChild = oldChildren[i]\n const newChild = newChildren[i]\n\n if (!oldChild && newChild) {\n oldEl.appendChild(newChild)\n } else if (oldChild && !newChild) {\n oldEl.removeChild(oldChild)\n } else if (oldChild && newChild) {\n patchNode(oldChild, newChild, oldEl)\n }\n }\n}\n\nfunction patchNode(oldNode: Node, newNode: Node, parent: Element): void {\n if (canReuse(oldNode, newNode)) {\n const ownerInstance = (newNode as any).__ownerInstance as DOMComponentInstance | undefined\n if (ownerInstance) {\n const idx = ownerInstance.nodes.indexOf(newNode)\n if (idx !== -1) {\n ownerInstance.nodes[idx] = oldNode\n }\n ; (oldNode as any).__ownerInstance = ownerInstance\n delete (newNode as any).__ownerInstance\n }\n\n if (oldNode.nodeType === Node.TEXT_NODE) {\n if (oldNode.nodeValue !== newNode.nodeValue) {\n oldNode.nodeValue = newNode.nodeValue\n }\n } else if (oldNode.nodeType === Node.ELEMENT_NODE) {\n updateAttributes(oldNode as Element, newNode as Element)\n reconcileChildren(oldNode as Element, newNode as Element)\n }\n } else {\n // Ensure oldNode is actually a child of parent before replacing\n if (oldNode.parentNode === parent) {\n parent.replaceChild(newNode, oldNode)\n } else if (oldNode.parentNode) {\n // oldNode is attached to a different parent, remove it and insert newNode\n oldNode.parentNode.removeChild(oldNode)\n parent.insertBefore(newNode, null)\n } else {\n // oldNode is detached, just insert newNode\n parent.insertBefore(newNode, null)\n }\n }\n}\n\nexport function reconcile(oldNodes: Node[], newNodes: Node[], parent: Node, beforeMarker: Node): Node[] {\n const maxLen = Math.max(oldNodes.length, newNodes.length)\n const resultNodes: Node[] = []\n\n for (let i = 0; i < maxLen; i++) {\n const oldNode = oldNodes[i]\n const newNode = newNodes[i]\n\n if (!oldNode && newNode) {\n parent.insertBefore(newNode, beforeMarker)\n resultNodes.push(newNode)\n } else if (oldNode && !newNode) {\n if (oldNode.parentNode) {\n parent.removeChild(oldNode)\n }\n } else if (oldNode && newNode) {\n patchNode(oldNode, newNode, parent as Element)\n resultNodes.push(oldNode)\n }\n }\n\n return resultNodes\n}\n\nexport function render(app: any, container: HTMLElement): () => void {\n container.innerHTML = ''\n\n if (typeof app === 'function') {\n app = { type: app, props: {}, children: [], key: undefined }\n }\n\n renderNode(app, container)\n\n // Return dispose function\n return () => {\n // Remove all component instances registered under this container\n if (instanceRegistry.has(container)) {\n const registry = instanceRegistry.get(container)!\n registry.forEach(instance => {\n removeComponentInstance(instance)\n })\n registry.clear()\n instanceRegistry.delete(container)\n }\n // Clear container\n container.innerHTML = ''\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/dom/render.ts"],"names":["instanceRegistry","currentRenderingInstance","resetRender","removeComponentInstance","instance","child","node","renderComponent","fnode","parent","registryParent","effectiveRegistryParent","mergeProps","props","hasExplicitKey","parentRegistry","key","instanceCount","componentName","_","k","newProps","isFirstRender","renderFn","currentFnode","currentProps","pushContext","previousRenderingInstance","result","runWithComponent","newNodes","renderNode","nodeParent","marker","lastNode","tempContainer","newNodesArray","reconciledNodes","reconcile","unsafeEffect","oldKeysSet","nodes","newKeysSet","keysToRemove","dom","value","eventName","setAttribute","el","canReuse","oldNode","newNode","updateAttributes","oldEl","newEl","attr","oldHandlers","newHandlers","event","reconcileChildren","oldChildren","newChildren","maxLen","i","oldChild","newChild","patchNode","ownerInstance","idx","oldNodes","beforeMarker","resultNodes","render","app","container","registry"],"mappings":"4EAiBA,IAAMA,EAAmB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,OAAO0E,CAAS,EACrC,CAEAA,CAAAA,CAAU,SAAA,CAAY,GAC1B,CACJ","file":"chunk-P6NMD5QH.mjs","sourcesContent":["import { pushContext } from '../core/context'\nimport { runWithComponent, type ComponentInstance } from '../core/hook'\nimport { unsafeEffect } from '../core/lifecycle'\n\n// Extended ComponentInstance for DOM tracking\ninterface DOMComponentInstance extends ComponentInstance {\n nodes: Node[]\n parent: HTMLElement\n fnode: any\n props: any\n key?: any\n renderFn?: () => void\n children: Set<DOMComponentInstance>\n parentInstance?: DOMComponentInstance\n}\n\n// Registry to store component instances by parent and key\nconst instanceRegistry = new WeakMap<HTMLElement, Map<any, DOMComponentInstance>>()\n\n// Current rendering component instance (for tracking parent-child relationships)\nlet currentRenderingInstance: DOMComponentInstance | null = null\n\n// Reset render state - call before re-rendering the entire app (e.g., srcdoc update)\nexport function resetRender(): void {\n currentRenderingInstance = null\n // Note: WeakMap will automatically GC old entries when their keys are gone\n}\n\n// Recursively remove component instance and all its children\nfunction removeComponentInstance(instance: DOMComponentInstance): void {\n instance.children.forEach(child => {\n removeComponentInstance(child)\n })\n\n instance.nodes.forEach(node => {\n if (node.parentNode) {\n node.parentNode.removeChild(node)\n }\n })\n\n instance.children.clear()\n\n if (instance.parentInstance) {\n instance.parentInstance.children.delete(instance)\n }\n}\n\n// Render a function component with reactive re-rendering\nfunction renderComponent(fnode: any, parent: HTMLElement, registryParent?: HTMLElement): Node[] {\n const effectiveRegistryParent = registryParent || parent\n\n const mergeProps = (node: any) => {\n const props = { ...node.props }\n if (node.children && node.children.length > 0) {\n props.children = node.children.length === 1\n ? node.children[0]\n : node.children\n }\n return props\n }\n\n const hasExplicitKey = fnode.key !== undefined\n\n if (!instanceRegistry.has(effectiveRegistryParent)) {\n instanceRegistry.set(effectiveRegistryParent, new Map())\n }\n const parentRegistry = instanceRegistry.get(effectiveRegistryParent)!\n\n let key: any\n if (hasExplicitKey) {\n key = fnode.key\n } else {\n let instanceCount = 0\n const componentName = fnode.type.name || 'anonymous'\n parentRegistry.forEach((_, k) => {\n if (typeof k === 'string' && k.startsWith(`__auto_${componentName}_`)) {\n instanceCount++\n }\n })\n key = `__auto_${componentName}_${instanceCount}`\n }\n\n if (parentRegistry.has(key)) {\n const instance = parentRegistry.get(key)!\n instance.fnode = fnode\n const newProps = mergeProps(fnode)\n instance.props = newProps\n instance.children.clear()\n\n if (instance.renderFn) {\n instance.renderFn()\n }\n\n return instance.nodes\n }\n\n const instance: DOMComponentInstance = {\n hooks: [],\n hookIndex: 0,\n nodes: [],\n parent,\n fnode: fnode,\n props: mergeProps(fnode),\n key,\n children: new Set(),\n parentInstance: currentRenderingInstance || undefined\n }\n\n if (currentRenderingInstance) {\n currentRenderingInstance.children.add(instance)\n }\n\n parentRegistry.set(key, instance)\n\n let isFirstRender = true\n\n const renderFn = () => {\n const currentFnode = instance.fnode\n const currentProps = instance.props\n\n const isProvider = (currentFnode.type as any)._contextId !== undefined\n if (isProvider) {\n pushContext((currentFnode.type as any)._contextId, currentProps.value)\n }\n\n const previousRenderingInstance = currentRenderingInstance\n currentRenderingInstance = instance\n\n const result = runWithComponent(instance, () => currentFnode.type(currentProps))\n\n if (isFirstRender) {\n const newNodes = renderNode(result, parent)\n instance.nodes = newNodes ? (Array.isArray(newNodes) ? newNodes : [newNodes]) : []\n instance.nodes.forEach(node => {\n if (!(node as any).__ownerInstance) {\n (node as any).__ownerInstance = instance\n }\n })\n isFirstRender = false\n } else {\n if (instance.nodes.length === 0) {\n const newNodes = renderNode(result, parent)\n instance.nodes = newNodes ? (Array.isArray(newNodes) ? newNodes : [newNodes]) : []\n currentRenderingInstance = previousRenderingInstance\n return\n }\n\n const firstNode = instance.nodes[0]\n const nodeParent = firstNode.parentNode as HTMLElement\n\n if (!nodeParent) {\n currentRenderingInstance = previousRenderingInstance\n return\n }\n\n const marker = document.createComment('flexium-marker')\n const lastNode = instance.nodes[instance.nodes.length - 1]\n if (lastNode.nextSibling) {\n nodeParent.insertBefore(marker, lastNode.nextSibling)\n } else {\n nodeParent.appendChild(marker)\n }\n\n instance.children.clear()\n\n const tempContainer = document.createElement('div')\n const newNodes = renderNode(result, tempContainer, nodeParent)\n const newNodesArray = newNodes ? (Array.isArray(newNodes) ? newNodes : [newNodes]) : []\n\n const reconciledNodes = reconcile(instance.nodes, newNodesArray, nodeParent, marker)\n\n nodeParent.removeChild(marker)\n\n instance.nodes = reconciledNodes\n }\n\n currentRenderingInstance = previousRenderingInstance\n }\n\n instance.renderFn = renderFn\n\n unsafeEffect(renderFn)\n\n return instance.nodes\n}\n\nexport function renderNode(fnode: any, parent: HTMLElement, registryParent?: HTMLElement): Node | Node[] | null {\n const effectiveRegistryParent = registryParent || parent\n\n if (fnode === null || fnode === undefined || typeof fnode === 'boolean') {\n const node = document.createTextNode('')\n parent.appendChild(node)\n return node\n }\n\n if (typeof fnode === 'string' || typeof fnode === 'number') {\n const node = document.createTextNode(String(fnode))\n parent.appendChild(node)\n return node\n }\n\n if (Array.isArray(fnode)) {\n const oldKeysSet = new Set<any>()\n if (instanceRegistry.has(effectiveRegistryParent)) {\n const parentRegistry = instanceRegistry.get(effectiveRegistryParent)!\n parentRegistry.forEach((_, key) => oldKeysSet.add(key))\n }\n\n const nodes: Node[] = []\n fnode.forEach((child) => {\n const result = renderNode(child, parent, registryParent)\n if (result) {\n if (Array.isArray(result)) {\n nodes.push(...result)\n } else {\n nodes.push(result)\n }\n }\n })\n\n const newKeysSet = new Set<any>()\n if (instanceRegistry.has(effectiveRegistryParent)) {\n const parentRegistry = instanceRegistry.get(effectiveRegistryParent)!\n parentRegistry.forEach((_, key) => newKeysSet.add(key))\n }\n\n if (instanceRegistry.has(effectiveRegistryParent)) {\n const parentRegistry = instanceRegistry.get(effectiveRegistryParent)!\n const keysToRemove: any[] = []\n\n oldKeysSet.forEach(key => {\n if (!newKeysSet.has(key)) {\n const instance = parentRegistry.get(key)\n if (instance) {\n removeComponentInstance(instance)\n keysToRemove.push(key)\n }\n }\n })\n\n keysToRemove.forEach(key => parentRegistry.delete(key))\n }\n\n return nodes\n }\n\n if (typeof fnode === 'object') {\n if (typeof fnode.type === 'string') {\n const dom = document.createElement(fnode.type)\n\n if (fnode.props) {\n Object.entries(fnode.props).forEach(([key, value]) => {\n if (key === 'ref') {\n // Handle both callback refs and RefObject\n if (typeof value === 'function') {\n value(dom)\n } else if (value && typeof value === 'object' && 'current' in value) {\n value.current = dom\n }\n } else if (key.startsWith('on') && typeof value === 'function') {\n const eventName = key.slice(2).toLowerCase()\n dom.addEventListener(eventName, value as EventListener)\n\n if (!(dom as any).__eventHandlers) {\n (dom as any).__eventHandlers = {}\n }\n (dom as any).__eventHandlers[eventName] = value\n } else if (key !== 'ref') {\n setAttribute(dom, key, value)\n }\n })\n }\n\n if (fnode.children && fnode.children.length > 0) {\n fnode.children.forEach((child: any) => {\n renderNode(child, dom)\n })\n }\n\n parent.appendChild(dom)\n return dom\n }\n\n if (typeof fnode.type === 'function') {\n return renderComponent(fnode, parent, registryParent)\n }\n }\n\n return null\n}\n\nfunction setAttribute(el: Element, key: string, value: any) {\n if (value === null || value === undefined) {\n el.removeAttribute(key)\n } else if (key === 'style' && typeof value === 'object') {\n Object.assign((el as HTMLElement).style, value)\n } else if (key === 'class') {\n el.className = String(value)\n } else if (key in el && typeof (el as any)[key] !== 'function') {\n (el as any)[key] = value\n } else {\n el.setAttribute(key, String(value))\n }\n}\n\n// Reconciliation helpers\nfunction canReuse(oldNode: Node, newNode: Node): boolean {\n if (oldNode.nodeType !== newNode.nodeType) return false\n if (oldNode.nodeType === Node.ELEMENT_NODE && newNode.nodeType === Node.ELEMENT_NODE) {\n return (oldNode as Element).tagName === (newNode as Element).tagName\n }\n return true\n}\n\nfunction updateAttributes(oldEl: Element, newEl: Element): void {\n const oldAttrs = Array.from(oldEl.attributes)\n oldAttrs.forEach(attr => {\n if (!newEl.hasAttribute(attr.name)) {\n oldEl.removeAttribute(attr.name)\n }\n })\n\n const newAttrs = Array.from(newEl.attributes)\n newAttrs.forEach(attr => {\n if (oldEl.getAttribute(attr.name) !== attr.value) {\n if (attr.name === 'value' && 'value' in oldEl) {\n (oldEl as HTMLInputElement).value = attr.value\n } else if (attr.name === 'checked' && 'checked' in oldEl) {\n (oldEl as HTMLInputElement).checked = attr.value === 'true' || attr.value === ''\n } else {\n oldEl.setAttribute(attr.name, attr.value)\n }\n }\n })\n\n const oldHandlers = (oldEl as any).__eventHandlers || {}\n const newHandlers = (newEl as any).__eventHandlers || {}\n\n Object.keys(oldHandlers).forEach(event => {\n if (!newHandlers[event]) {\n oldEl.removeEventListener(event, oldHandlers[event])\n }\n })\n\n Object.keys(newHandlers).forEach(event => {\n if (oldHandlers[event] !== newHandlers[event]) {\n if (oldHandlers[event]) {\n oldEl.removeEventListener(event, oldHandlers[event])\n }\n oldEl.addEventListener(event, newHandlers[event])\n }\n })\n\n if (Object.keys(newHandlers).length > 0) {\n (oldEl as any).__eventHandlers = newHandlers\n } else {\n delete (oldEl as any).__eventHandlers\n }\n\n if (oldEl instanceof HTMLInputElement && newEl instanceof HTMLInputElement) {\n if (oldEl.value !== newEl.value) {\n oldEl.value = newEl.value\n }\n if (oldEl.checked !== newEl.checked) {\n oldEl.checked = newEl.checked\n }\n }\n if (oldEl instanceof HTMLTextAreaElement && newEl instanceof HTMLTextAreaElement) {\n if (oldEl.value !== newEl.value) {\n oldEl.value = newEl.value\n }\n }\n if (oldEl instanceof HTMLSelectElement && newEl instanceof HTMLSelectElement) {\n if (oldEl.value !== newEl.value) {\n oldEl.value = newEl.value\n }\n }\n}\n\nfunction reconcileChildren(oldEl: Element, newEl: Element): void {\n const oldChildren = Array.from(oldEl.childNodes)\n const newChildren = Array.from(newEl.childNodes)\n const maxLen = Math.max(oldChildren.length, newChildren.length)\n\n for (let i = 0; i < maxLen; i++) {\n const oldChild = oldChildren[i]\n const newChild = newChildren[i]\n\n if (!oldChild && newChild) {\n oldEl.appendChild(newChild)\n } else if (oldChild && !newChild) {\n oldEl.removeChild(oldChild)\n } else if (oldChild && newChild) {\n patchNode(oldChild, newChild, oldEl)\n }\n }\n}\n\nfunction patchNode(oldNode: Node, newNode: Node, parent: Element): void {\n if (canReuse(oldNode, newNode)) {\n const ownerInstance = (newNode as any).__ownerInstance as DOMComponentInstance | undefined\n if (ownerInstance) {\n const idx = ownerInstance.nodes.indexOf(newNode)\n if (idx !== -1) {\n ownerInstance.nodes[idx] = oldNode\n }\n ; (oldNode as any).__ownerInstance = ownerInstance\n delete (newNode as any).__ownerInstance\n }\n\n if (oldNode.nodeType === Node.TEXT_NODE) {\n if (oldNode.nodeValue !== newNode.nodeValue) {\n oldNode.nodeValue = newNode.nodeValue\n }\n } else if (oldNode.nodeType === Node.ELEMENT_NODE) {\n updateAttributes(oldNode as Element, newNode as Element)\n reconcileChildren(oldNode as Element, newNode as Element)\n }\n } else {\n // Ensure oldNode is actually a child of parent before replacing\n if (oldNode.parentNode === parent) {\n parent.replaceChild(newNode, oldNode)\n } else if (oldNode.parentNode) {\n // oldNode is attached to a different parent, remove it and insert newNode\n oldNode.parentNode.removeChild(oldNode)\n parent.insertBefore(newNode, null)\n } else {\n // oldNode is detached, just insert newNode\n parent.insertBefore(newNode, null)\n }\n }\n}\n\nexport function reconcile(oldNodes: Node[], newNodes: Node[], parent: Node, beforeMarker: Node): Node[] {\n const maxLen = Math.max(oldNodes.length, newNodes.length)\n const resultNodes: Node[] = []\n\n for (let i = 0; i < maxLen; i++) {\n const oldNode = oldNodes[i]\n const newNode = newNodes[i]\n\n if (!oldNode && newNode) {\n parent.insertBefore(newNode, beforeMarker)\n resultNodes.push(newNode)\n } else if (oldNode && !newNode) {\n if (oldNode.parentNode) {\n parent.removeChild(oldNode)\n }\n } else if (oldNode && newNode) {\n patchNode(oldNode, newNode, parent as Element)\n resultNodes.push(oldNode)\n }\n }\n\n return resultNodes\n}\n\nexport function render(app: any, container: HTMLElement): () => void {\n container.innerHTML = ''\n\n if (typeof app === 'function') {\n app = { type: app, props: {}, children: [], key: undefined }\n }\n\n renderNode(app, container)\n\n // Return dispose function\n return () => {\n // Remove all component instances registered under this container\n if (instanceRegistry.has(container)) {\n const registry = instanceRegistry.get(container)!\n registry.forEach(instance => {\n removeComponentInstance(instance)\n })\n registry.clear()\n instanceRegistry.delete(container)\n }\n // Clear container\n container.innerHTML = ''\n }\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var r=null;function l(n,e){let t=r;r=n,n.hookIndex=0;try{return e()}finally{r=t;}}function c(n){if(!r)return n();let e=r,{hooks:t,hookIndex:s}=e;if(s<t.length)return e.hookIndex++,t[s];let i=n();return t.push(i),e.hookIndex++,i}var a=class{constructor(){this._useableTag=true;}getActions(){}};function p(n){return n!==null&&typeof n=="object"&&"_useableTag"in n&&n._useableTag===true}var o=new Map;function y(){o.clear();}var u=class extends a{constructor(e){super(),this.id=Symbol("context"),this.defaultValue=e,this.Provider=t=>t.children,this.Provider._contextId=this.id;}getInitial(){return o.has(this.id)?o.get(this.id):this.defaultValue}subscribe(e,t){return ()=>{}}};function f(n){return n.getInitial()}function T(n,e){let t=o.get(n);return o.set(n,e),t}function b(n,e){e===void 0?o.delete(n):o.set(n,e);}export{l as a,c as b,a as c,p as d,y as e,u as f,f as g,T as h,b as i};//# sourceMappingURL=chunk-TIUNOZRI.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-TIUNOZRI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/hook.ts","../src/core/useable.ts","../src/core/context.ts"],"names":["currentComponent","runWithComponent","component","fn","prev","hook","factory","instance","hooks","hookIndex","value","Useable","isUseable","contextMap","resetContext","Context","defaultValue","props","_params","_callback","getContextValue","ctx","pushContext","id","popContext","prevValue"],"mappings":"AAMA,IAAIA,CAAAA,CAA6C,KAM1C,SAASC,CAAAA,CAAoBC,EAA8BC,CAAAA,CAAgB,CAC9E,IAAMC,CAAAA,CAAOJ,CAAAA,CACbA,CAAAA,CAAmBE,EACnBA,CAAAA,CAAU,SAAA,CAAY,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AAIA,EAAW,GAAA,CAAI,IAAA,CAAK,EAAE,CAAA,CAAI,IAAA,CAAK,YAClE,CAMA,SAAA,CAAUK,CAAAA,CAAoBC,EAA2C,CAGvE,OAAO,IAAM,CAAE,CACjB,CACF,EAGO,SAASC,CAAAA,CAAmBC,CAAAA,CAAoB,CACrD,OAAOA,EAAI,UAAA,EACb,CAGO,SAASC,CAAAA,CAAYC,EAAYb,CAAAA,CAAY,CAClD,IAAMN,CAAAA,CAAOS,CAAAA,CAAW,GAAA,CAAIU,CAAE,CAAA,CAC9B,OAAAV,EAAW,GAAA,CAAIU,CAAAA,CAAIb,CAAK,CAAA,CACjBN,CACT,CAGO,SAASoB,CAAAA,CAAWD,CAAAA,CAAYE,EAAgB,CACjDA,CAAAA,GAAc,MAAA,CAChBZ,CAAAA,CAAW,MAAA,CAAOU,CAAE,EAEpBV,CAAAA,CAAW,GAAA,CAAIU,CAAAA,CAAIE,CAAS,EAEhC","file":"chunk-TIUNOZRI.mjs","sourcesContent":["\nexport interface ComponentInstance {\n hooks: any[]\n hookIndex: number\n}\n\nlet currentComponent: ComponentInstance | null = null\n\nexport function getComponent(): ComponentInstance | null {\n return currentComponent\n}\n\nexport function runWithComponent<T>(component: ComponentInstance, fn: () => T): T {\n const prev = currentComponent\n currentComponent = component\n component.hookIndex = 0\n try {\n return fn()\n } finally {\n currentComponent = prev\n }\n}\n\nexport function hook<T>(factory: () => T): T {\n if (!currentComponent) {\n // Outside component: just run factory\n return factory()\n }\n\n const instance = currentComponent\n const { hooks, hookIndex } = instance\n\n if (hookIndex < hooks.length) {\n // Return existing hook\n instance.hookIndex++\n return hooks[hookIndex] as T\n }\n\n // Create new hook\n const value = factory()\n hooks.push(value)\n instance.hookIndex++\n\n return value\n}\n","/**\n * Useable - Base class for reactive data sources that work with use()\n *\n * Extend this class to create custom data sources (Context, Stream, Shared, etc.)\n *\n * @example\n * ```tsx\n * class MySource<T> extends Useable<T> {\n * getInitial() { return this.initialValue }\n * subscribe(params, callback) {\n * // setup subscription\n * return () => { // cleanup }\n * }\n * }\n *\n * const source = new MySource(...)\n * const [value] = use(source)\n * ```\n *\n * @typeParam T - The value type\n * @typeParam P - The params type for subscribe/send\n * @typeParam Actions - Tuple of additional actions returned by use() after the value\n */\nexport abstract class Useable<T, P = void, Actions extends unknown[] = []> {\n /**\n * Unique identifier for this Useable type\n * Used internally by use() for type checking\n */\n readonly _useableTag = true as const\n\n /**\n * Get the initial/current value synchronously\n * Called when use() first accesses this source\n */\n abstract getInitial(params?: P): T\n\n /**\n * Subscribe to value changes\n * Called by use() to receive updates\n *\n * @param params - Optional parameters for the subscription\n * @param callback - Function called when value changes\n * @returns Cleanup function to unsubscribe\n */\n abstract subscribe(\n params: P | undefined,\n callback: (value: T) => void\n ): () => void\n\n /**\n * Get additional actions to include in the use() tuple\n * Override this to return [action1, action2, ...] that will be appended to [value, ...]\n *\n * @example\n * ```tsx\n * class SendableStream extends Useable<T, P> {\n * getActions() {\n * return [this.send.bind(this)]\n * }\n * }\n *\n * const [value, send] = use(stream)\n * ```\n */\n getActions(): Actions | undefined {\n return undefined\n }\n}\n\n/**\n * Type guard to check if a value is a Useable instance\n */\nexport function isUseable(value: unknown): value is Useable<any, any> {\n return (\n value !== null &&\n typeof value === 'object' &&\n '_useableTag' in value &&\n (value as any)._useableTag === true\n )\n}\n","import { Useable } from './useable'\n\nconst contextMap = new Map<symbol, any>()\n\n// Reset context state - used when app is re-rendered from root\nexport function resetContext(): void {\n contextMap.clear()\n}\n\n/**\n * Context for passing data through the component tree\n *\n * @example\n * ```tsx\n * const ThemeContext = new Context('light')\n *\n * function App() {\n * return (\n * <ThemeContext.Provider value=\"dark\">\n * <Child />\n * </ThemeContext.Provider>\n * )\n * }\n *\n * function Child() {\n * const [theme] = use(ThemeContext)\n * return <div>{theme}</div>\n * }\n * ```\n */\nexport class Context<T> extends Useable<T> {\n readonly id: symbol\n readonly defaultValue: T\n readonly Provider: (props: { value: T; children: any }) => any\n\n constructor(defaultValue: T) {\n super()\n this.id = Symbol('context')\n this.defaultValue = defaultValue\n this.Provider = (props: { value: T; children: any }) => props.children\n ; (this.Provider as any)._contextId = this.id\n }\n\n /**\n * Get current context value or default\n */\n getInitial(): T {\n return contextMap.has(this.id) ? contextMap.get(this.id) : this.defaultValue\n }\n\n /**\n * Context doesn't have traditional subscriptions\n * Reactivity is handled by component re-rendering\n */\n subscribe(_params: undefined, _callback: (value: T) => void): () => void {\n // Context changes trigger re-render through Provider mechanism\n // No additional subscription needed\n return () => { }\n }\n}\n\n// Internal: get context value (used by use.ts)\nexport function getContextValue<T>(ctx: Context<T>): T {\n return ctx.getInitial()\n}\n\n// Internal helpers for renderer\nexport function pushContext(id: symbol, value: any) {\n const prev = contextMap.get(id)\n contextMap.set(id, value)\n return prev\n}\n\n\nexport function popContext(id: symbol, prevValue: any) {\n if (prevValue === undefined) {\n contextMap.delete(id)\n } else {\n contextMap.set(id, prevValue)\n }\n}\n\nexport function snapshotContext(): Map<symbol, any> {\n return new Map(contextMap)\n}\n\nexport function runWithContext<R>(snapshot: Map<symbol, any>, fn: () => R): R {\n // 1. Save current context\n const prevContext = new Map(contextMap)\n\n // 2. Apply snapshot\n contextMap.clear()\n snapshot.forEach((value, key) => contextMap.set(key, value))\n\n try {\n return fn()\n } finally {\n // 3. Restore previous context\n contextMap.clear()\n prevContext.forEach((value, key) => contextMap.set(key, value))\n }\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkBP5PDE6F_js=require('./chunk-BP5PDE6F.js'),chunkOU6XJZ76_js=require('./chunk-OU6XJZ76.js'),chunkTFXBDC6C_js=require('./chunk-TFXBDC6C.js');function L(t){if(!t)return {};if(typeof URLSearchParams<"u"){let e=new URLSearchParams(t),r={};return e.forEach((n,o)=>r[o]=n),r}return t.substring(1).split("&").reduce((e,r)=>{let[n,o]=r.split("=");return n&&(e[decodeURIComponent(n)]=decodeURIComponent(o||"")),e},{})}function D(t){return !!(!t||typeof t!="string"||t.length>2048||t.includes("__proto__")||t.includes("constructor")||/^\s*javascript:/i.test(t))}function y(t){let e=[];return t.forEach(r=>{if(!r)return;let{path:n,component:o,children:s,beforeEnter:f}=r.props||{},c={path:n||"/",component:o,beforeEnter:f};if(s){let l=Array.isArray(s)?s:[s];c.children=y(l);}!c.children&&r.children&&r.children.length>0&&(c.children=y(r.children)),e.push(c);}),e}function E(t,e){for(let r of t){let n=r.path,o=T(n,e);if(o)return [{route:r,params:o.params,pathname:o.path}]}return null}function T(t,e){let r=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(r.length!==n.length)return null;let o={};for(let s=0;s<r.length;s++){let f=r[s],c=n[s];if(f.startsWith(":")){let l=f.slice(1);o[l]=c;}else if(f!==c)return null}return {params:o,path:e}}var P=new chunkOU6XJZ76_js.f(null),m=new chunkOU6XJZ76_js.f(0),U=()=>({pathname:"/",search:"",hash:"",query:{}}),w=()=>{if(typeof window>"u")return U();let t=window.location.pathname;return (!t||t==="srcdoc"||t==="/srcdoc")&&(t="/"),{pathname:t,search:window.location.search,hash:window.location.hash,query:L(window.location.search)}},i=null,p=null,F=false;function j(){if(i){let t=w();i.pathname=t.pathname,i.search=t.search,i.hash=t.hash,i.query=t.query;}else i=null,p=null;}function h(){if(i&&p)return [i,p];i=chunkBP5PDE6F_js.a(w());let t=e=>{i&&(i.pathname=e.pathname,i.search=e.search,i.hash=e.hash,i.query=e.query);};return p=e=>{if(typeof window>"u")return;if(D(e)){console.error("[Flexium Router] Blocked navigation to unsafe path:",e);return}try{window.history.pushState({},"",e);}catch{}let r={pathname:e.split("?")[0].split("#")[0],search:e.includes("?")?"?"+e.split("?")[1].split("#")[0]:"",hash:e.includes("#")?"#"+e.split("#")[1]:"",query:L(e.includes("?")?"?"+e.split("?")[1].split("#")[0]:"")};t(r);},typeof window<"u"&&!F&&(window.addEventListener("popstate",()=>{t(w());}),F=true),[i,p]}function R(){let[t]=chunkBP5PDE6F_js.c(P);if(!t)throw new Error("useRouter() must be called within a <Routes> component");return t}function _(){let[,t]=h();return t}function k(){return p||h(),p}function Q(){return R().params}function B(){let[t]=h();return t.query}function x(t){return null}function q(t){return t&&typeof t=="object"&&("type"in t||Array.isArray(t))}function M(t){let[e,r]=h(),n=Array.isArray(t.children)?t.children:[t.children],o=n.filter(u=>q(u)&&u.type===x),s=n.filter(u=>!q(u)||u.type!==x),f=y(o),c=e.pathname,l=E(f,c)||[],A=l.length>0?l[l.length-1].params:{},S={location:e,navigate:r,matches:l,params:A},v=null;if(l.length>0){let u=l[0],N=u.route.component,g=c;u.route.beforeEnter?u.route.beforeEnter(u.params)!==false&&(v=chunkTFXBDC6C_js.a(m.Provider,{value:1,key:g,children:chunkTFXBDC6C_js.a(N,{params:u.params,key:g})})):v=chunkTFXBDC6C_js.a(m.Provider,{value:1,key:g,children:chunkTFXBDC6C_js.a(N,{params:u.params,key:g})});}return chunkTFXBDC6C_js.a(P.Provider,{value:S,children:[...s,v]})}function I(){let t=R(),[e]=chunkBP5PDE6F_js.c(m),r=e??0,[n]=chunkBP5PDE6F_js.c(()=>t.matches);if(r>=n.length)return null;let o=n[r],s=o.route.component;return o.route.beforeEnter&&o.route.beforeEnter(o.params)===false?null:chunkTFXBDC6C_js.a(m.Provider,{value:r+1,children:chunkTFXBDC6C_js.a(s,{params:o.params})})}function O(t){return chunkTFXBDC6C_js.a("a",{href:t.to,class:t.class||t.className,style:t.style?t.style+"; cursor: pointer;":"cursor: pointer;",onclick:e=>{console.log("Link clicked:",t.to),e.preventDefault(),k()(t.to);},children:t.children})}exports.a=j;exports.b=h;exports.c=R;exports.d=_;exports.e=k;exports.f=Q;exports.g=B;exports.h=x;exports.i=M;exports.j=I;exports.k=O;//# sourceMappingURL=chunk-TQ64P7YL.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-TQ64P7YL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/router/utils.ts","../src/router/router.ts","../src/router/dom/Route.tsx","../src/router/dom/Routes.tsx","../src/router/dom/Outlet.tsx","../src/router/dom/Link.tsx"],"names":["parseQuery","search","params","result","value","key","accumulator","part","isUnsafePath","path","createRoutesFromChildren","children","routes","child","component","subChildren","beforeEnter","route","nestedChildren","matchRoutes","locationPathname","routePath","matchResult","matchPath","locationPath","routeSegments","locationSegments","i","routeSegment","locationSegment","RouterCtx","Context","RouteDepthCtx","getDefaultLocation","getCurrentLocation","pathname","globalLocation","globalNavigate","popstateListenerAttached","resetRouter","initial","useLocation","reactive","updateLocation","newLocation","useRouter","routerContext","use","useNavigate","navigate","getNavigate","useParams","useQuery","location","Route","_props","isFNode","node","Routes","props","currentLocation","childrenList","routeNodes","otherChildren","routeDefinitions","currentPath","matches","matchedContent","rootMatch","Component","routeKey","jsx","Outlet","depthValue","depth","match","Link","event"],"mappings":"iKAGA,SAASA,CAAAA,CAAWC,CAAAA,CAAwC,CAC1D,GAAI,CAACA,EAAQ,OAAO,EAAC,CACrB,GAAI,OAAO,eAAA,CAAoB,IAAa,CAC1C,IAAMC,CAAAA,CAAS,IAAI,eAAA,CAAgBD,CAAM,CAAA,CACnCE,CAAAA,CAAiC,EAAC,CACxC,OAAAD,CAAAA,CAAO,OAAA,CAAQ,CAACE,EAAOC,CAAAA,GAAQF,CAAAA,CAAOE,CAAG,CAAA,CAAID,CAAK,CAAA,CAC3CD,CACT,CACA,OAAOF,CAAAA,CACJ,SAAA,CAAU,CAAC,CAAA,CACX,KAAA,CAAM,GAAG,CAAA,CACT,MAAA,CAAO,CAACK,CAAAA,CAAaC,CAAAA,GAAS,CAC7B,GAAM,CAACF,CAAAA,CAAKD,CAAK,CAAA,CAAIG,CAAAA,CAAK,KAAA,CAAM,GAAG,EACnC,OAAIF,CAAAA,GAAKC,CAAAA,CAAY,kBAAA,CAAmBD,CAAG,CAAC,EAAI,kBAAA,CAAmBD,CAAAA,EAAS,EAAE,CAAA,CAAA,CACvEE,CACT,CAAA,CAAG,EAA4B,CACnC,CAEA,SAASE,CAAAA,CAAaC,CAAAA,C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AAM,MAAO,CAAC,CACnD,CAAC,CACL,CCnBO,SAASC,CAAAA,CAAKjB,EAAkB,CACnC,OAAOY,kBAAAA,CAAE,GAAA,CAAK,CACV,IAAA,CAAMZ,CAAAA,CAAM,EAAA,CACZ,KAAA,CAAOA,CAAAA,CAAM,KAAA,EAASA,CAAAA,CAAM,SAAA,CAC5B,KAAA,CAAOA,EAAM,KAAA,CAAQA,CAAAA,CAAM,KAAA,CAAQ,oBAAA,CAAuB,kBAAA,CAC1D,OAAA,CAAUkB,CAAAA,EAAiB,CACvB,OAAA,CAAQ,GAAA,CAAI,eAAA,CAAiBlB,CAAAA,CAAM,EAAE,CAAA,CACrCkB,EAAM,cAAA,EAAe,CAErB3B,CAAAA,EAAY,CAAES,CAAAA,CAAM,EAAE,EAC1B,CAAA,CACA,QAAA,CAAUA,CAAAA,CAAM,QACpB,CAAC,CACL","file":"chunk-TQ64P7YL.js","sourcesContent":["import { RouteDefinition, RouteMatch } from './types'\n\n// Simple query parser (native URLSearchParams fallback) - internal use only\nfunction parseQuery(search: string): Record<string, string> {\n if (!search) return {}\n if (typeof URLSearchParams !== 'undefined') {\n const params = new URLSearchParams(search)\n const result: Record<string, string> = {}\n params.forEach((value, key) => result[key] = value)\n return result\n }\n return search\n .substring(1)\n .split('&')\n .reduce((accumulator, part) => {\n const [key, value] = part.split('=')\n if (key) accumulator[decodeURIComponent(key)] = decodeURIComponent(value || '')\n return accumulator\n }, {} as Record<string, string>)\n}\n\nfunction isUnsafePath(path: string): boolean {\n // Handle undefined or null path\n if (!path || typeof path !== 'string') return true\n // Prevent prototype pollution or massive strings\n if (path.length > 2048) return true\n if (path.includes('__proto__') || path.includes('constructor')) return true\n // Basic XSS check for javascript: protocol\n if (/^\\s*javascript:/i.test(path)) return true\n return false\n}\n\n// Convert children FNodes to RouteDefinitions - internal use only\nfunction createRoutesFromChildren(children: any[]): RouteDefinition[] {\n const routes: RouteDefinition[] = []\n\n children.forEach(child => {\n if (!child) return\n\n // Assuming child is an FNode-like object (config)\n // In Flexium, Route component returns null, but 'createNode' isn't called here.\n // We are traversing the props passed to Router.\n\n const { path, component, children: subChildren, beforeEnter } = child.props || {}\n\n const route: RouteDefinition = {\n path: path || '/',\n component: component,\n beforeEnter\n }\n\n if (subChildren) {\n // If subChildren is array\n const nestedChildren = Array.isArray(subChildren) ? subChildren : [subChildren]\n // We expect the children of a Route to be other Routes\n // However, the 'children' prop in JSX might be the Route components themselves.\n route.children = createRoutesFromChildren(nestedChildren)\n }\n\n // Also check child.children if props.children is empty (direct FNode structure)\n if (!route.children && child.children && child.children.length > 0) {\n route.children = createRoutesFromChildren(child.children)\n }\n\n routes.push(route)\n })\n return routes\n}\n\n// Simple Matcher - internal use only\nfunction matchRoutes(routes: RouteDefinition[], locationPathname: string): RouteMatch[] | null {\n // We want to find the best matching branch\n\n for (const route of routes) {\n // 1. Match current segment\n // Simple exact match or parameter match logic needed?\n // Let's implement simple param matching: /user/:id\n\n const routePath = route.path\n\n const matchResult = matchPath(routePath, locationPathname)\n if (matchResult) {\n return [{ route, params: matchResult.params, pathname: matchResult.path }]\n }\n }\n return null\n}\n\nfunction matchPath(routePath: string, locationPath: string) {\n // 1. Split into segments\n const routeSegments = routePath.split('/').filter(Boolean)\n const locationSegments = locationPath.split('/').filter(Boolean)\n\n if (routeSegments.length !== locationSegments.length) return null\n\n const params: Record<string, string> = {}\n\n for (let i = 0; i < routeSegments.length; i++) {\n const routeSegment = routeSegments[i]\n const locationSegment = locationSegments[i]\n\n if (routeSegment.startsWith(':')) {\n const key = routeSegment.slice(1)\n params[key] = locationSegment\n } else if (routeSegment !== locationSegment) {\n return null\n }\n }\n\n return { params, path: locationPath }\n}\n\n// Export only what's needed by other router files\nexport { parseQuery, isUnsafePath, createRoutesFromChildren, matchRoutes }\n","import { reactive } from '../core/reactive'\nimport { Context } from '../core/context'\nimport { use } from '../core/use'\nimport type { Location, RouterContext } from './types'\nimport { parseQuery, isUnsafePath } from './utils'\n\n// Contexts\nexport const RouterCtx = new Context<RouterContext>(null as any)\nexport const RouteDepthCtx = new Context<number>(0)\n\n// Helper functions\nconst getDefaultLocation = (): Location => ({\n pathname: '/',\n search: '',\n hash: '',\n query: {},\n})\n\nconst getCurrentLocation = (): Location => {\n if (typeof window === 'undefined') {\n return getDefaultLocation()\n }\n\n // Handle srcdoc iframe - pathname may be empty or 'srcdoc'\n let pathname = window.location.pathname\n if (!pathname || pathname === 'srcdoc' || pathname === '/srcdoc') {\n pathname = '/'\n }\n\n return {\n pathname,\n search: window.location.search,\n hash: window.location.hash,\n query: parseQuery(window.location.search),\n }\n}\n\n// Global singleton location state\nlet globalLocation: Location | null = null\nlet globalNavigate: ((path: string) => void) | null = null\nlet popstateListenerAttached = false\n\n// Reset router state - used when app is re-rendered (e.g., srcdoc iframe update)\nexport function resetRouter(): void {\n // Reset the location to initial state, but keep the reactive object\n // This ensures existing subscriptions (like Routes) still work\n if (globalLocation) {\n const initial = getCurrentLocation()\n globalLocation.pathname = initial.pathname\n globalLocation.search = initial.search\n globalLocation.hash = initial.hash\n globalLocation.query = initial.query\n } else {\n // First time - will be initialized on first useLocation() call\n globalLocation = null\n globalNavigate = null\n }\n // Note: we don't reset popstateListenerAttached since the listener persists\n}\n\n// Create location state and navigation (singleton pattern)\nexport function useLocation(): [Location, (path: string) => void] {\n // Return existing singleton if already created\n if (globalLocation && globalNavigate) {\n return [globalLocation, globalNavigate]\n }\n\n // Create a reactive location object (only once)\n globalLocation = reactive<Location>(getCurrentLocation())\n\n const updateLocation = (newLocation: Location) => {\n if (!globalLocation) return\n globalLocation.pathname = newLocation.pathname\n globalLocation.search = newLocation.search\n globalLocation.hash = newLocation.hash\n globalLocation.query = newLocation.query\n }\n\n globalNavigate = (path: string) => {\n if (typeof window === 'undefined') return\n if (isUnsafePath(path)) {\n console.error('[Flexium Router] Blocked navigation to unsafe path:', path)\n return\n }\n\n // Try to update browser history, but continue even if it fails (e.g., in srcdoc iframe)\n try {\n window.history.pushState({}, '', path)\n } catch {\n // SecurityError in srcdoc iframe - ignore but continue with internal state update\n }\n\n // Always update internal location state for SPA navigation\n const newLocation = {\n pathname: path.split('?')[0].split('#')[0],\n search: path.includes('?') ? '?' + path.split('?')[1].split('#')[0] : '',\n hash: path.includes('#') ? '#' + path.split('#')[1] : '',\n query: parseQuery(path.includes('?') ? '?' + path.split('?')[1].split('#')[0] : '')\n }\n updateLocation(newLocation)\n }\n\n // Listen to popstate (only once)\n if (typeof window !== 'undefined' && !popstateListenerAttached) {\n window.addEventListener('popstate', () => {\n updateLocation(getCurrentLocation())\n })\n popstateListenerAttached = true\n }\n\n return [globalLocation, globalNavigate]\n}\n\n// Router hook - returns full router context\nexport function useRouter(): RouterContext {\n const [routerContext] = use(RouterCtx)\n if (!routerContext) {\n throw new Error('useRouter() must be called within a <Routes> component')\n }\n return routerContext\n}\n\n// Navigate hook - returns navigate function\nexport function useNavigate(): (path: string) => void {\n const [, navigate] = useLocation()\n return navigate\n}\n\n// Get navigate function directly (for use in event handlers to avoid stale closures)\nexport function getNavigate(): (path: string) => void {\n if (!globalNavigate) {\n useLocation() // Initialize if needed\n }\n return globalNavigate!\n}\n\n// Params hook - returns route params\nexport function useParams<T extends Record<string, string> = Record<string, string>>(): T {\n const router = useRouter()\n return router.params as T\n}\n\n// Query hook - returns query params\nexport function useQuery<T extends Record<string, string> = Record<string, string>>(): T {\n const [location] = useLocation()\n return location.query as T\n}\n","import type { RouteProps } from '../types'\n\nexport function Route(_props: RouteProps) {\n return null\n}\n","import { jsx as f } from '../../jsx-runtime'\nimport type { FNode, FNodeChild } from '../../dom/types'\nimport { RouterCtx, RouteDepthCtx, useLocation } from '../router'\nimport { createRoutesFromChildren, matchRoutes } from '../utils'\nimport { Route } from './Route'\n\nfunction isFNode(node: any): node is FNode {\n return node && typeof node === 'object' && ('type' in node || Array.isArray(node))\n}\n\nexport function Routes(props: { children: FNodeChild }) {\n const [currentLocation, navigate] = useLocation()\n\n // Parse children to find <Route> definitions and other content\n let childrenList: any[] = Array.isArray(props.children) ? props.children : [props.children]\n\n // Separate routes from other children (like Nav components)\n const routeNodes = childrenList.filter(child => isFNode(child) && child.type === Route)\n const otherChildren = childrenList.filter(child => !isFNode(child) || child.type !== Route)\n\n // Create route definitions\n const routeDefinitions = createRoutesFromChildren(routeNodes)\n\n // DIRECT access to currentLocation.pathname\n // This should trigger reactive tracking in the component's effect context\n const currentPath = currentLocation.pathname\n const matches = matchRoutes(routeDefinitions, currentPath) || []\n const params = matches.length > 0 ? matches[matches.length - 1].params : {}\n\n const routerContext = {\n location: currentLocation,\n navigate,\n matches: matches,\n params: params\n }\n\n // Render matched component\n let matchedContent: FNodeChild = null\n\n if (matches.length > 0) {\n const rootMatch = matches[0]\n const Component = rootMatch.route.component\n\n // Use pathname as key to force re-mount on route change\n const routeKey = currentPath\n\n // Guard Check\n if (rootMatch.route.beforeEnter) {\n const result = rootMatch.route.beforeEnter(rootMatch.params)\n if (result !== false) {\n matchedContent = f(RouteDepthCtx.Provider, {\n value: 1,\n key: routeKey,\n children: f(Component, { params: rootMatch.params, key: routeKey })\n })\n }\n } else {\n matchedContent = f(RouteDepthCtx.Provider, {\n value: 1,\n key: routeKey,\n children: f(Component, { params: rootMatch.params, key: routeKey })\n })\n }\n }\n\n return f(RouterCtx.Provider, {\n value: routerContext,\n children: [...otherChildren, matchedContent]\n })\n}\n","import { use } from '../../core/use'\nimport { jsx as f } from '../../jsx-runtime'\nimport { RouteDepthCtx, useRouter } from '../router'\n\nexport function Outlet() {\n const routerContext = useRouter()\n const [depthValue] = use(RouteDepthCtx)\n const depth = depthValue ?? 0\n\n const [matches] = use(() => routerContext.matches)\n\n if (depth >= matches.length) return null\n\n const match = matches[depth]\n const Component = match.route.component\n\n // Guard\n if (match.route.beforeEnter) {\n if (match.route.beforeEnter(match.params) === false) return null\n }\n\n // Render next level\n return f(RouteDepthCtx.Provider, {\n value: depth + 1,\n children: f(Component, { params: match.params })\n })\n}\n","import { jsx as f } from '../../jsx-runtime'\nimport type { LinkProps } from '../types'\n\n// Import the navigate function getter, not the function itself\n// This ensures we always use the current navigate implementation\nimport { getNavigate } from '../router'\n\nexport function Link(props: LinkProps) {\n return f('a', {\n href: props.to,\n class: props.class || props.className,\n style: props.style ? props.style + '; cursor: pointer;' : 'cursor: pointer;',\n onclick: (event: Event) => {\n console.log('Link clicked:', props.to)\n event.preventDefault()\n // Get current navigate function at click time\n getNavigate()(props.to)\n },\n children: props.children\n })\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {h as h$1,a as a$1,i}from'./chunk-TIUNOZRI.mjs';var $={"&":"&","<":"<",">":">",'"':""","'":"'"},F=/[&<>"']/g;function l(e){return String(e).replace(F,r=>$[r])}function a(e){return l(e)}var f=false,d=null,h=0;function I(){return f}function b(){f=true,d=new Map,h=0;}function S(){f=false;let e=Object.fromEntries(d||new Map);return d=null,{states:e}}function x(){return `fid-${h++}`}var T=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),v=new Set(["disabled","checked","readonly","required","hidden","selected","autofocus","autoplay","controls","loop","muted","multiple","open","defer","async","novalidate"]),A={className:"class",htmlFor:"for"};function R(e,r={}){let{hydrate:n=true}=r;b();try{let t;typeof e=="function"&&!N(e)?t={type:e,props:{},children:[],key:void 0}:t=e;let o=p(t,n),i=S();return {html:o,state:i}}catch(t){throw S(),t}}function E(e){let{html:r}=R(e,{hydrate:false});return r}function N(e){return e&&typeof e=="object"&&"type"in e&&"props"in e}function p(e,r){if(e==null||typeof e=="boolean")return "";if(typeof e=="string"||typeof e=="number")return l(String(e));if(Array.isArray(e))return e.map(n=>p(n,r)).join("");if(typeof e=="function")return C({type:e,props:{},children:[]},r);if(typeof e=="object"&&N(e)){if(typeof e.type=="string")return w(e,r);if(typeof e.type=="function")return C(e,r)}return ""}function w(e,r){let n=e.type,t=j(e.props,r);if(e.props?.dangerouslySetInnerHTML){let i=e.props.dangerouslySetInnerHTML.__html||"";return `<${n}${t}>${i}</${n}>`}if(T.has(n))return `<${n}${t}>`;let o=(e.children||[]).map(i=>p(i,r)).join("");return `<${n}${t}>${o}</${n}>`}function j(e,r){if(!e)return "";let n=[];if(r){let t=x();n.push(`data-fid="${t}"`);}for(let[t,o]of Object.entries(e)){if(t.startsWith("on")||t==="ref"||t==="key"||t==="children"||t==="dangerouslySetInnerHTML"||o==null)continue;let i=A[t]||t;if(t==="style"&&typeof o=="object"){let c=Object.entries(o).filter(([,s])=>s!=null).map(([s,u])=>`${k(s)}:${u}`).join(";");c&&n.push(`style="${a(c)}"`);continue}if(v.has(i)){o&&n.push(i);continue}o!==false&&n.push(`${i}="${a(String(o))}"`);}return n.length?" "+n.join(" "):""}function C(e,r){let n=e.type,t={...e.props};e.children&&e.children.length>0&&(t.children=e.children.length===1?e.children[0]:e.children);let o=n._contextId,i$1=o!==void 0,c;i$1&&(c=h$1(o,t.value));let s={hooks:[],hookIndex:0};try{let u=a$1(s,()=>n(t));return p(u,r)}finally{i$1&&i(o,c);}}function k(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}export{I as a,R as b,E as c};//# sourceMappingURL=chunk-UQNPGF7C.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-UQNPGF7C.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server/escape.ts","../src/server/serverState.ts","../src/server/renderToString.ts"],"names":["ESCAPE_MAP","ESCAPE_REGEX","escapeHtml","str","char","escapeAttribute","isServerRendering","serverStateCollector","hydrationIdCounter","getIsServer","enterServerRender","exitServerRender","states","generateHydrationId","VOID_ELEMENTS","BOOLEAN_ATTRS","ATTR_ALIASES","renderToString","app","options","hydrate","fnode","isFNode","html","renderNodeToString","state","error","renderToStaticMarkup","value","includeHydrationMarkers","child","renderComponentToString","renderElementToString","tag","attrs","renderAttributes","innerHTML","childrenHtml","props","parts","fid","key","attrName","styleStr","v","k","kebabCase","Component","contextId","isProvider","prevContextValue","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CAAAA,CAAUT,CAAK,CAAC,CAAA,CAGhE,OAAOd,CAAAA,CAAmB6B,CAAAA,CAAQxB,CAAuB,CAC3D,CAAA,OAAE,CAEIoB,CAAAA,EACFM,IAAWP,CAAAA,CAAWE,CAAgB,EAE1C,CACF,CAEA,SAASJ,CAAAA,CAAU3C,CAAAA,CAAqB,CACtC,OAAOA,CAAAA,CAAI,OAAA,CAAQ,WAAY,KAAK,CAAA,CAAE,aACxC","file":"chunk-S5DHAAMO.mjs","sourcesContent":["const ESCAPE_MAP: Record<string, string> = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n}\n\nconst ESCAPE_REGEX = /[&<>\"']/g\n\nexport function escapeHtml(str: string): string {\n return String(str).replace(ESCAPE_REGEX, char => ESCAPE_MAP[char])\n}\n\nexport function escapeAttribute(str: string): string {\n return escapeHtml(str)\n}\n","import type { SerializedState } from './types'\n\nlet isServerRendering = false\nlet serverStateCollector: Map<string, unknown> | null = null\nlet hydrationIdCounter = 0\n\nexport function getIsServer(): boolean {\n return isServerRendering\n}\n\nexport function enterServerRender(): void {\n isServerRendering = true\n serverStateCollector = new Map()\n hydrationIdCounter = 0\n}\n\nexport function exitServerRender(): SerializedState {\n isServerRendering = false\n const states = Object.fromEntries(serverStateCollector || new Map())\n serverStateCollector = null\n\n return { states }\n}\n\nexport function collectServerState(key: string, value: unknown): void {\n if (serverStateCollector) {\n serverStateCollector.set(key, value)\n }\n}\n\nexport function generateHydrationId(): string {\n return `fid-${hydrationIdCounter++}`\n}\n\nexport function resetHydrationIdCounter(): void {\n hydrationIdCounter = 0\n}\n","import type { FNode, FNodeChild } from '../dom/types'\nimport type { SSROptions, SSRResult } from './types'\nimport { escapeHtml, escapeAttribute } from './escape'\nimport {\n enterServerRender,\n exitServerRender,\n generateHydrationId\n} from './serverState'\nimport { runWithComponent, ComponentInstance } from '../core/hook'\nimport { pushContext, popContext } from '../core/context'\n\n// Self-closing HTML tags\nconst VOID_ELEMENTS = new Set([\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',\n 'link', 'meta', 'param', 'source', 'track', 'wbr'\n])\n\n// Attributes that should be rendered as boolean\nconst BOOLEAN_ATTRS = new Set([\n 'disabled', 'checked', 'readonly', 'required', 'hidden',\n 'selected', 'autofocus', 'autoplay', 'controls', 'loop', 'muted',\n 'multiple', 'open', 'defer', 'async', 'novalidate'\n])\n\n// Attributes that need special handling\nconst ATTR_ALIASES: Record<string, string> = {\n className: 'class',\n htmlFor: 'for'\n}\n\n/**\n * Render component tree to HTML string with hydration markers\n */\nexport function renderToString(\n app: FNodeChild | (() => FNodeChild),\n options: SSROptions = {}\n): SSRResult {\n const { hydrate = true } = options\n\n enterServerRender()\n\n try {\n // Normalize input - wrap function in FNode if needed\n let fnode: FNodeChild\n if (typeof app === 'function' && !isFNode(app)) {\n fnode = { type: app, props: {}, children: [], key: undefined }\n } else {\n fnode = app\n }\n\n const html = renderNodeToString(fnode, hydrate)\n const state = exitServerRender()\n\n return { html, state }\n } catch (error) {\n exitServerRender()\n throw error\n }\n}\n\n/**\n * Render component tree to static HTML (no hydration markers)\n * Use for email templates, static pages, etc.\n */\nexport function renderToStaticMarkup(app: FNodeChild | (() => FNodeChild)): string {\n const { html } = renderToString(app, { hydrate: false })\n return html\n}\n\nfunction isFNode(value: any): value is FNode {\n return value && typeof value === 'object' && 'type' in value && 'props' in value\n}\n\nfunction renderNodeToString(fnode: FNodeChild, includeHydrationMarkers: boolean): string {\n // Null/undefined/boolean -> empty string\n if (fnode === null || fnode === undefined || typeof fnode === 'boolean') {\n return ''\n }\n\n // String/number -> escaped text\n if (typeof fnode === 'string' || typeof fnode === 'number') {\n return escapeHtml(String(fnode))\n }\n\n // Array -> concatenate children\n if (Array.isArray(fnode)) {\n return fnode.map(child => renderNodeToString(child, includeHydrationMarkers)).join('')\n }\n\n // Function (standalone) -> wrap in FNode and render\n if (typeof fnode === 'function') {\n const wrappedFnode: FNode = { type: fnode, props: {}, children: [], key: undefined }\n return renderComponentToString(wrappedFnode, includeHydrationMarkers)\n }\n\n // Object (FNode)\n if (typeof fnode === 'object' && isFNode(fnode)) {\n // HTML element\n if (typeof fnode.type === 'string') {\n return renderElementToString(fnode, includeHydrationMarkers)\n }\n\n // Function component\n if (typeof fnode.type === 'function') {\n return renderComponentToString(fnode, includeHydrationMarkers)\n }\n }\n\n return ''\n}\n\nfunction renderElementToString(fnode: FNode, includeHydrationMarkers: boolean): string {\n const tag = fnode.type as string\n const attrs = renderAttributes(fnode.props, includeHydrationMarkers)\n\n // Handle dangerouslySetInnerHTML\n if (fnode.props?.dangerouslySetInnerHTML) {\n const innerHTML = fnode.props.dangerouslySetInnerHTML.__html || ''\n return `<${tag}${attrs}>${innerHTML}</${tag}>`\n }\n\n // Void elements (self-closing)\n if (VOID_ELEMENTS.has(tag)) {\n return `<${tag}${attrs}>`\n }\n\n // Render children\n const childrenHtml = (fnode.children || [])\n .map(child => renderNodeToString(child, includeHydrationMarkers))\n .join('')\n\n return `<${tag}${attrs}>${childrenHtml}</${tag}>`\n}\n\nfunction renderAttributes(props: Record<string, any>, includeHydrationMarkers: boolean): string {\n if (!props) return ''\n\n const parts: string[] = []\n\n // Add hydration ID if needed\n if (includeHydrationMarkers) {\n const fid = generateHydrationId()\n parts.push(`data-fid=\"${fid}\"`)\n }\n\n for (const [key, value] of Object.entries(props)) {\n // Skip event handlers, refs, and internal props\n if (key.startsWith('on') || key === 'ref' || key === 'key' || key === 'children') continue\n if (key === 'dangerouslySetInnerHTML') continue\n\n // Skip undefined/null values\n if (value === undefined || value === null) continue\n\n // Handle aliased attributes\n const attrName = ATTR_ALIASES[key] || key\n\n // Handle style object\n if (key === 'style' && typeof value === 'object') {\n const styleStr = Object.entries(value)\n .filter(([, v]) => v !== null && v !== undefined)\n .map(([k, v]) => `${kebabCase(k)}:${v}`)\n .join(';')\n if (styleStr) {\n parts.push(`style=\"${escapeAttribute(styleStr)}\"`)\n }\n continue\n }\n\n // Handle boolean attributes\n if (BOOLEAN_ATTRS.has(attrName)) {\n if (value) parts.push(attrName)\n continue\n }\n\n // Handle false boolean values - skip entirely\n if (value === false) continue\n\n // Regular attribute\n parts.push(`${attrName}=\"${escapeAttribute(String(value))}\"`)\n }\n\n return parts.length ? ' ' + parts.join(' ') : ''\n}\n\nfunction renderComponentToString(fnode: FNode, includeHydrationMarkers: boolean): string {\n const Component = fnode.type as Function\n\n // Merge props with children\n const props = { ...fnode.props }\n if (fnode.children && fnode.children.length > 0) {\n props.children = fnode.children.length === 1\n ? fnode.children[0]\n : fnode.children\n }\n\n // Check if this is a Context Provider\n const contextId = (Component as any)._contextId\n const isProvider = contextId !== undefined\n let prevContextValue: any\n\n if (isProvider) {\n prevContextValue = pushContext(contextId, props.value)\n }\n\n // Create minimal component instance for server (hooks support)\n const instance: ComponentInstance = {\n hooks: [],\n hookIndex: 0\n }\n\n try {\n // Run component with hook context\n const result = runWithComponent(instance, () => Component(props))\n\n // Render result\n return renderNodeToString(result, includeHydrationMarkers)\n } finally {\n // Restore context if it was a provider\n if (isProvider) {\n popContext(contextId, prevContextValue)\n }\n }\n}\n\nfunction kebabCase(str: string): string {\n return str.replace(/([A-Z])/g, '-$1').toLowerCase()\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/server/escape.ts","../src/server/serverState.ts","../src/server/renderToString.ts"],"names":["ESCAPE_MAP","ESCAPE_REGEX","escapeHtml","str","char","escapeAttribute","isServerRendering","serverStateCollector","hydrationIdCounter","getIsServer","enterServerRender","exitServerRender","states","generateHydrationId","VOID_ELEMENTS","BOOLEAN_ATTRS","ATTR_ALIASES","renderToString","app","options","hydrate","fnode","isFNode","html","renderNodeToString","state","error","renderToStaticMarkup","value","includeHydrationMarkers","child","renderComponentToString","renderElementToString","tag","attrs","renderAttributes","innerHTML","childrenHtml","props","parts","fid","key","attrName","styleStr","v","k","kebabCase","Component","contextId","isProvider","prevContextValue","pushContext","instance","result","runWithComponent","popContext"],"mappings":"uDAAA,IAAMA,EAAqC,C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AmB6B,CAAAA,CAAQxB,CAAuB,CAC3D,CAAA,OAAE,CAEIoB,GAAAA,EACFM,EAAWP,CAAAA,CAAWE,CAAgB,EAE1C,CACF,CAEA,SAASJ,CAAAA,CAAU3C,CAAAA,CAAqB,CACtC,OAAOA,CAAAA,CAAI,OAAA,CAAQ,WAAY,KAAK,CAAA,CAAE,aACxC","file":"chunk-UQNPGF7C.mjs","sourcesContent":["const ESCAPE_MAP: Record<string, string> = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n}\n\nconst ESCAPE_REGEX = /[&<>\"']/g\n\nexport function escapeHtml(str: string): string {\n return String(str).replace(ESCAPE_REGEX, char => ESCAPE_MAP[char])\n}\n\nexport function escapeAttribute(str: string): string {\n return escapeHtml(str)\n}\n","import type { SerializedState } from './types'\n\nlet isServerRendering = false\nlet serverStateCollector: Map<string, unknown> | null = null\nlet hydrationIdCounter = 0\n\nexport function getIsServer(): boolean {\n return isServerRendering\n}\n\nexport function enterServerRender(): void {\n isServerRendering = true\n serverStateCollector = new Map()\n hydrationIdCounter = 0\n}\n\nexport function exitServerRender(): SerializedState {\n isServerRendering = false\n const states = Object.fromEntries(serverStateCollector || new Map())\n serverStateCollector = null\n\n return { states }\n}\n\nexport function collectServerState(key: string, value: unknown): void {\n if (serverStateCollector) {\n serverStateCollector.set(key, value)\n }\n}\n\nexport function generateHydrationId(): string {\n return `fid-${hydrationIdCounter++}`\n}\n\nexport function resetHydrationIdCounter(): void {\n hydrationIdCounter = 0\n}\n","import type { FNode, FNodeChild } from '../dom/types'\nimport type { SSROptions, SSRResult } from './types'\nimport { escapeHtml, escapeAttribute } from './escape'\nimport {\n enterServerRender,\n exitServerRender,\n generateHydrationId\n} from './serverState'\nimport { runWithComponent, ComponentInstance } from '../core/hook'\nimport { pushContext, popContext } from '../core/context'\n\n// Self-closing HTML tags\nconst VOID_ELEMENTS = new Set([\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',\n 'link', 'meta', 'param', 'source', 'track', 'wbr'\n])\n\n// Attributes that should be rendered as boolean\nconst BOOLEAN_ATTRS = new Set([\n 'disabled', 'checked', 'readonly', 'required', 'hidden',\n 'selected', 'autofocus', 'autoplay', 'controls', 'loop', 'muted',\n 'multiple', 'open', 'defer', 'async', 'novalidate'\n])\n\n// Attributes that need special handling\nconst ATTR_ALIASES: Record<string, string> = {\n className: 'class',\n htmlFor: 'for'\n}\n\n/**\n * Render component tree to HTML string with hydration markers\n */\nexport function renderToString(\n app: FNodeChild | (() => FNodeChild),\n options: SSROptions = {}\n): SSRResult {\n const { hydrate = true } = options\n\n enterServerRender()\n\n try {\n // Normalize input - wrap function in FNode if needed\n let fnode: FNodeChild\n if (typeof app === 'function' && !isFNode(app)) {\n fnode = { type: app, props: {}, children: [], key: undefined }\n } else {\n fnode = app\n }\n\n const html = renderNodeToString(fnode, hydrate)\n const state = exitServerRender()\n\n return { html, state }\n } catch (error) {\n exitServerRender()\n throw error\n }\n}\n\n/**\n * Render component tree to static HTML (no hydration markers)\n * Use for email templates, static pages, etc.\n */\nexport function renderToStaticMarkup(app: FNodeChild | (() => FNodeChild)): string {\n const { html } = renderToString(app, { hydrate: false })\n return html\n}\n\nfunction isFNode(value: any): value is FNode {\n return value && typeof value === 'object' && 'type' in value && 'props' in value\n}\n\nfunction renderNodeToString(fnode: FNodeChild, includeHydrationMarkers: boolean): string {\n // Null/undefined/boolean -> empty string\n if (fnode === null || fnode === undefined || typeof fnode === 'boolean') {\n return ''\n }\n\n // String/number -> escaped text\n if (typeof fnode === 'string' || typeof fnode === 'number') {\n return escapeHtml(String(fnode))\n }\n\n // Array -> concatenate children\n if (Array.isArray(fnode)) {\n return fnode.map(child => renderNodeToString(child, includeHydrationMarkers)).join('')\n }\n\n // Function (standalone) -> wrap in FNode and render\n if (typeof fnode === 'function') {\n const wrappedFnode: FNode = { type: fnode, props: {}, children: [], key: undefined }\n return renderComponentToString(wrappedFnode, includeHydrationMarkers)\n }\n\n // Object (FNode)\n if (typeof fnode === 'object' && isFNode(fnode)) {\n // HTML element\n if (typeof fnode.type === 'string') {\n return renderElementToString(fnode, includeHydrationMarkers)\n }\n\n // Function component\n if (typeof fnode.type === 'function') {\n return renderComponentToString(fnode, includeHydrationMarkers)\n }\n }\n\n return ''\n}\n\nfunction renderElementToString(fnode: FNode, includeHydrationMarkers: boolean): string {\n const tag = fnode.type as string\n const attrs = renderAttributes(fnode.props, includeHydrationMarkers)\n\n // Handle dangerouslySetInnerHTML\n if (fnode.props?.dangerouslySetInnerHTML) {\n const innerHTML = fnode.props.dangerouslySetInnerHTML.__html || ''\n return `<${tag}${attrs}>${innerHTML}</${tag}>`\n }\n\n // Void elements (self-closing)\n if (VOID_ELEMENTS.has(tag)) {\n return `<${tag}${attrs}>`\n }\n\n // Render children\n const childrenHtml = (fnode.children || [])\n .map(child => renderNodeToString(child, includeHydrationMarkers))\n .join('')\n\n return `<${tag}${attrs}>${childrenHtml}</${tag}>`\n}\n\nfunction renderAttributes(props: Record<string, any>, includeHydrationMarkers: boolean): string {\n if (!props) return ''\n\n const parts: string[] = []\n\n // Add hydration ID if needed\n if (includeHydrationMarkers) {\n const fid = generateHydrationId()\n parts.push(`data-fid=\"${fid}\"`)\n }\n\n for (const [key, value] of Object.entries(props)) {\n // Skip event handlers, refs, and internal props\n if (key.startsWith('on') || key === 'ref' || key === 'key' || key === 'children') continue\n if (key === 'dangerouslySetInnerHTML') continue\n\n // Skip undefined/null values\n if (value === undefined || value === null) continue\n\n // Handle aliased attributes\n const attrName = ATTR_ALIASES[key] || key\n\n // Handle style object\n if (key === 'style' && typeof value === 'object') {\n const styleStr = Object.entries(value)\n .filter(([, v]) => v !== null && v !== undefined)\n .map(([k, v]) => `${kebabCase(k)}:${v}`)\n .join(';')\n if (styleStr) {\n parts.push(`style=\"${escapeAttribute(styleStr)}\"`)\n }\n continue\n }\n\n // Handle boolean attributes\n if (BOOLEAN_ATTRS.has(attrName)) {\n if (value) parts.push(attrName)\n continue\n }\n\n // Handle false boolean values - skip entirely\n if (value === false) continue\n\n // Regular attribute\n parts.push(`${attrName}=\"${escapeAttribute(String(value))}\"`)\n }\n\n return parts.length ? ' ' + parts.join(' ') : ''\n}\n\nfunction renderComponentToString(fnode: FNode, includeHydrationMarkers: boolean): string {\n const Component = fnode.type as Function\n\n // Merge props with children\n const props = { ...fnode.props }\n if (fnode.children && fnode.children.length > 0) {\n props.children = fnode.children.length === 1\n ? fnode.children[0]\n : fnode.children\n }\n\n // Check if this is a Context Provider\n const contextId = (Component as any)._contextId\n const isProvider = contextId !== undefined\n let prevContextValue: any\n\n if (isProvider) {\n prevContextValue = pushContext(contextId, props.value)\n }\n\n // Create minimal component instance for server (hooks support)\n const instance: ComponentInstance = {\n hooks: [],\n hookIndex: 0\n }\n\n try {\n // Run component with hook context\n const result = runWithComponent(instance, () => Component(props))\n\n // Render result\n return renderNodeToString(result, includeHydrationMarkers)\n } finally {\n // Restore context if it was a provider\n if (isProvider) {\n popContext(contextId, prevContextValue)\n }\n }\n}\n\nfunction kebabCase(str: string): string {\n return str.replace(/([A-Z])/g, '-$1').toLowerCase()\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/ref.ts"],"names":["useRef","initialValue","hook"],"mappings":"qCA2BO,SAASA,CAAAA,CAAUC,CAAAA,CAA4C,CACpE,OAAOC,CAAAA,CAAK,KAAO,CACjB,OAAA,CAASD,CACX,CAAA,CAAE,CACJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/core/ref.ts"],"names":["useRef","initialValue","hook"],"mappings":"qCA2BO,SAASA,CAAAA,CAAUC,CAAAA,CAA4C,CACpE,OAAOC,CAAAA,CAAK,KAAO,CACjB,OAAA,CAASD,CACX,CAAA,CAAE,CACJ","file":"chunk-VB564E5E.mjs","sourcesContent":["import { hook } from './hook'\nimport type { RefObject } from './types'\n\n/**\n * Creates a mutable ref object that persists across renders\n *\n * @example\n * ```tsx\n * function InputWithFocus() {\n * const inputRef = useRef<HTMLInputElement>()\n *\n * const focusInput = () => {\n * inputRef.current?.focus()\n * }\n *\n * return (\n * <div>\n * <input ref={inputRef} type=\"text\" />\n * <button onClick={focusInput}>Focus Input</button>\n * </div>\n * )\n * }\n * ```\n */\nexport function useRef<T>(initialValue: T): RefObject<T>\nexport function useRef<T>(initialValue: T | null): RefObject<T | null>\nexport function useRef<T = undefined>(): RefObject<T | undefined>\nexport function useRef<T>(initialValue?: T): RefObject<T | undefined> {\n return hook(() => ({\n current: initialValue\n }))\n}\n"]}
|
package/dist/core.d.cts
CHANGED
|
@@ -63,6 +63,7 @@ declare abstract class Useable<T, P = void, Actions extends unknown[] = []> {
|
|
|
63
63
|
*/
|
|
64
64
|
declare function isUseable(value: unknown): value is Useable<any, any>;
|
|
65
65
|
|
|
66
|
+
declare function resetContext(): void;
|
|
66
67
|
/**
|
|
67
68
|
* Context for passing data through the component tree
|
|
68
69
|
*
|
|
@@ -168,4 +169,4 @@ declare function useRef<T = undefined>(): RefObject<T | undefined>;
|
|
|
168
169
|
|
|
169
170
|
declare function isReactive(value: unknown): boolean;
|
|
170
171
|
|
|
171
|
-
export { Context, type ForwardedRef, type Ref, type RefCallback, type RefObject, type ResourceControl, type Setter, type UseContext, type UseOptions, Useable, getContextValue, isReactive, isUseable, popContext, pushContext, sync, use, useRef };
|
|
172
|
+
export { Context, type ForwardedRef, type Ref, type RefCallback, type RefObject, type ResourceControl, type Setter, type UseContext, type UseOptions, Useable, getContextValue, isReactive, isUseable, popContext, pushContext, resetContext, sync, use, useRef };
|
package/dist/core.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ declare abstract class Useable<T, P = void, Actions extends unknown[] = []> {
|
|
|
63
63
|
*/
|
|
64
64
|
declare function isUseable(value: unknown): value is Useable<any, any>;
|
|
65
65
|
|
|
66
|
+
declare function resetContext(): void;
|
|
66
67
|
/**
|
|
67
68
|
* Context for passing data through the component tree
|
|
68
69
|
*
|
|
@@ -168,4 +169,4 @@ declare function useRef<T = undefined>(): RefObject<T | undefined>;
|
|
|
168
169
|
|
|
169
170
|
declare function isReactive(value: unknown): boolean;
|
|
170
171
|
|
|
171
|
-
export { Context, type ForwardedRef, type Ref, type RefCallback, type RefObject, type ResourceControl, type Setter, type UseContext, type UseOptions, Useable, getContextValue, isReactive, isUseable, popContext, pushContext, sync, use, useRef };
|
|
172
|
+
export { Context, type ForwardedRef, type Ref, type RefCallback, type RefObject, type ResourceControl, type Setter, type UseContext, type UseOptions, Useable, getContextValue, isReactive, isUseable, popContext, pushContext, resetContext, sync, use, useRef };
|
package/dist/core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkAD2E2FQE_js=require('./chunk-AD2E2FQE.js'),chunkBP5PDE6F_js=require('./chunk-BP5PDE6F.js'),chunk3CKIHQIE_js=require('./chunk-3CKIHQIE.js'),chunkOU6XJZ76_js=require('./chunk-OU6XJZ76.js');Object.defineProperty(exports,"useRef",{enumerable:true,get:function(){return chunkAD2E2FQE_js.a}});Object.defineProperty(exports,"isReactive",{enumerable:true,get:function(){return chunkBP5PDE6F_js.b}});Object.defineProperty(exports,"use",{enumerable:true,get:function(){return chunkBP5PDE6F_js.c}});Object.defineProperty(exports,"sync",{enumerable:true,get:function(){return chunk3CKIHQIE_js.e}});Object.defineProperty(exports,"Context",{enumerable:true,get:function(){return chunkOU6XJZ76_js.f}});Object.defineProperty(exports,"Useable",{enumerable:true,get:function(){return chunkOU6XJZ76_js.c}});Object.defineProperty(exports,"getContextValue",{enumerable:true,get:function(){return chunkOU6XJZ76_js.g}});Object.defineProperty(exports,"isUseable",{enumerable:true,get:function(){return chunkOU6XJZ76_js.d}});Object.defineProperty(exports,"popContext",{enumerable:true,get:function(){return chunkOU6XJZ76_js.i}});Object.defineProperty(exports,"pushContext",{enumerable:true,get:function(){return chunkOU6XJZ76_js.h}});Object.defineProperty(exports,"resetContext",{enumerable:true,get:function(){return chunkOU6XJZ76_js.e}});//# sourceMappingURL=core.js.map
|
|
2
2
|
//# sourceMappingURL=core.js.map
|
package/dist/core.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as useRef}from'./chunk-
|
|
1
|
+
export{a as useRef}from'./chunk-VB564E5E.mjs';export{b as isReactive,c as use}from'./chunk-FJNIW7B2.mjs';export{e as sync}from'./chunk-NRPWBHKP.mjs';export{f as Context,c as Useable,g as getContextValue,d as isUseable,i as popContext,h as pushContext,e as resetContext}from'./chunk-TIUNOZRI.mjs';//# sourceMappingURL=core.mjs.map
|
|
2
2
|
//# sourceMappingURL=core.mjs.map
|
package/dist/dom.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk47EPSC5Q_js=require('./chunk-47EPSC5Q.js'),chunk4E3YIGJX_js=require('./chunk-4E3YIGJX.js');require('./chunk-BP5PDE6F.js'),require('./chunk-3CKIHQIE.js'),require('./chunk-OU6XJZ76.js');Object.defineProperty(exports,"ErrorBoundary",{enumerable:true,get:function(){return chunk47EPSC5Q_js.d}});Object.defineProperty(exports,"Suspense",{enumerable:true,get:function(){return chunk47EPSC5Q_js.c}});Object.defineProperty(exports,"f",{enumerable:true,get:function(){return chunk47EPSC5Q_js.a}});Object.defineProperty(exports,"hydrate",{enumerable:true,get:function(){return chunk47EPSC5Q_js.b}});Object.defineProperty(exports,"lazy",{enumerable:true,get:function(){return chunk47EPSC5Q_js.e}});Object.defineProperty(exports,"render",{enumerable:true,get:function(){return chunk4E3YIGJX_js.d}});Object.defineProperty(exports,"resetRender",{enumerable:true,get:function(){return chunk4E3YIGJX_js.a}});//# sourceMappingURL=dom.js.map
|
|
2
2
|
//# sourceMappingURL=dom.js.map
|
package/dist/dom.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{d as ErrorBoundary,c as Suspense,a as f,b as hydrate,e as lazy}from'./chunk-
|
|
1
|
+
export{d as ErrorBoundary,c as Suspense,a as f,b as hydrate,e as lazy}from'./chunk-33M3W7D4.mjs';export{d as render,a as resetRender}from'./chunk-P6NMD5QH.mjs';import'./chunk-FJNIW7B2.mjs';import'./chunk-NRPWBHKP.mjs';import'./chunk-TIUNOZRI.mjs';//# sourceMappingURL=dom.mjs.map
|
|
2
2
|
//# sourceMappingURL=dom.mjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Context, ForwardedRef, Ref, RefCallback, RefObject, ResourceControl, Setter, UseContext, UseOptions, Useable, getContextValue, isReactive, isUseable, popContext, pushContext, sync, use, useRef } from './core.cjs';
|
|
1
|
+
export { Context, ForwardedRef, Ref, RefCallback, RefObject, ResourceControl, Setter, UseContext, UseOptions, Useable, getContextValue, isReactive, isUseable, popContext, pushContext, resetContext, sync, use, useRef } from './core.cjs';
|
|
2
2
|
export { ErrorBoundary, ErrorBoundaryProps, ErrorInfo, HydrateOptions, LazyComponent, Suspense, SuspenseProps, f, hydrate, lazy, render, resetRender } from './dom.cjs';
|
|
3
3
|
export { Link, LinkProps, Location, Outlet, Route, RouteDefinition, RouteMatch, RouteProps, RouterContext, Routes, getNavigate, resetRouter, useLocation, useNavigate, useParams, useQuery, useRouter } from './router.cjs';
|
|
4
4
|
export { S as SSROptions, a as SSRResult, b as SerializedState } from './types-C5UPsdAS.cjs';
|
|
@@ -6,6 +6,6 @@ export { getIsServer, renderToStaticMarkup, renderToString } from './server.cjs'
|
|
|
6
6
|
export { CSSProperties, CSSValue, DefaultVariants, KeyframeDefinition, StyleObject, StyledConfig, StyledProps, VariantConfig, css, cx, getStyleTag, getStyles, hydrateStyles, keyframes, resetStyles, styled } from './css.cjs';
|
|
7
7
|
import './types-DH8L3A5z.cjs';
|
|
8
8
|
|
|
9
|
-
declare const VERSION = "0.16.
|
|
9
|
+
declare const VERSION = "0.16.15";
|
|
10
10
|
|
|
11
11
|
export { VERSION };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Context, ForwardedRef, Ref, RefCallback, RefObject, ResourceControl, Setter, UseContext, UseOptions, Useable, getContextValue, isReactive, isUseable, popContext, pushContext, sync, use, useRef } from './core.js';
|
|
1
|
+
export { Context, ForwardedRef, Ref, RefCallback, RefObject, ResourceControl, Setter, UseContext, UseOptions, Useable, getContextValue, isReactive, isUseable, popContext, pushContext, resetContext, sync, use, useRef } from './core.js';
|
|
2
2
|
export { ErrorBoundary, ErrorBoundaryProps, ErrorInfo, HydrateOptions, LazyComponent, Suspense, SuspenseProps, f, hydrate, lazy, render, resetRender } from './dom.js';
|
|
3
3
|
export { Link, LinkProps, Location, Outlet, Route, RouteDefinition, RouteMatch, RouteProps, RouterContext, Routes, getNavigate, resetRouter, useLocation, useNavigate, useParams, useQuery, useRouter } from './router.js';
|
|
4
4
|
export { S as SSROptions, a as SSRResult, b as SerializedState } from './types-C5UPsdAS.js';
|
|
@@ -6,6 +6,6 @@ export { getIsServer, renderToStaticMarkup, renderToString } from './server.js';
|
|
|
6
6
|
export { CSSProperties, CSSValue, DefaultVariants, KeyframeDefinition, StyleObject, StyledConfig, StyledProps, VariantConfig, css, cx, getStyleTag, getStyles, hydrateStyles, keyframes, resetStyles, styled } from './css.js';
|
|
7
7
|
import './types-DH8L3A5z.js';
|
|
8
8
|
|
|
9
|
-
declare const VERSION = "0.16.
|
|
9
|
+
declare const VERSION = "0.16.15";
|
|
10
10
|
|
|
11
11
|
export { VERSION };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkAD2E2FQE_js=require('./chunk-AD2E2FQE.js'),chunk47EPSC5Q_js=require('./chunk-47EPSC5Q.js'),chunk4E3YIGJX_js=require('./chunk-4E3YIGJX.js'),chunkA4VGFEMF_js=require('./chunk-A4VGFEMF.js'),chunkTQ64P7YL_js=require('./chunk-TQ64P7YL.js'),chunkBP5PDE6F_js=require('./chunk-BP5PDE6F.js'),chunk3CKIHQIE_js=require('./chunk-3CKIHQIE.js'),chunkOU6XJZ76_js=require('./chunk-OU6XJZ76.js'),chunkZJZRDYA2_js=require('./chunk-ZJZRDYA2.js');require('./chunk-TFXBDC6C.js');var J="0.16.15";Object.defineProperty(exports,"useRef",{enumerable:true,get:function(){return chunkAD2E2FQE_js.a}});Object.defineProperty(exports,"ErrorBoundary",{enumerable:true,get:function(){return chunk47EPSC5Q_js.d}});Object.defineProperty(exports,"Suspense",{enumerable:true,get:function(){return chunk47EPSC5Q_js.c}});Object.defineProperty(exports,"f",{enumerable:true,get:function(){return chunk47EPSC5Q_js.a}});Object.defineProperty(exports,"hydrate",{enumerable:true,get:function(){return chunk47EPSC5Q_js.b}});Object.defineProperty(exports,"lazy",{enumerable:true,get:function(){return chunk47EPSC5Q_js.e}});Object.defineProperty(exports,"render",{enumerable:true,get:function(){return chunk4E3YIGJX_js.d}});Object.defineProperty(exports,"resetRender",{enumerable:true,get:function(){return chunk4E3YIGJX_js.a}});Object.defineProperty(exports,"getIsServer",{enumerable:true,get:function(){return chunkA4VGFEMF_js.a}});Object.defineProperty(exports,"renderToStaticMarkup",{enumerable:true,get:function(){return chunkA4VGFEMF_js.c}});Object.defineProperty(exports,"renderToString",{enumerable:true,get:function(){return chunkA4VGFEMF_js.b}});Object.defineProperty(exports,"Link",{enumerable:true,get:function(){return chunkTQ64P7YL_js.k}});Object.defineProperty(exports,"Outlet",{enumerable:true,get:function(){return chunkTQ64P7YL_js.j}});Object.defineProperty(exports,"Route",{enumerable:true,get:function(){return chunkTQ64P7YL_js.h}});Object.defineProperty(exports,"Routes",{enumerable:true,get:function(){return chunkTQ64P7YL_js.i}});Object.defineProperty(exports,"getNavigate",{enumerable:true,get:function(){return chunkTQ64P7YL_js.e}});Object.defineProperty(exports,"resetRouter",{enumerable:true,get:function(){return chunkTQ64P7YL_js.a}});Object.defineProperty(exports,"useLocation",{enumerable:true,get:function(){return chunkTQ64P7YL_js.b}});Object.defineProperty(exports,"useNavigate",{enumerable:true,get:function(){return chunkTQ64P7YL_js.d}});Object.defineProperty(exports,"useParams",{enumerable:true,get:function(){return chunkTQ64P7YL_js.f}});Object.defineProperty(exports,"useQuery",{enumerable:true,get:function(){return chunkTQ64P7YL_js.g}});Object.defineProperty(exports,"useRouter",{enumerable:true,get:function(){return chunkTQ64P7YL_js.c}});Object.defineProperty(exports,"isReactive",{enumerable:true,get:function(){return chunkBP5PDE6F_js.b}});Object.defineProperty(exports,"use",{enumerable:true,get:function(){return chunkBP5PDE6F_js.c}});Object.defineProperty(exports,"sync",{enumerable:true,get:function(){return chunk3CKIHQIE_js.e}});Object.defineProperty(exports,"Context",{enumerable:true,get:function(){return chunkOU6XJZ76_js.f}});Object.defineProperty(exports,"Useable",{enumerable:true,get:function(){return chunkOU6XJZ76_js.c}});Object.defineProperty(exports,"getContextValue",{enumerable:true,get:function(){return chunkOU6XJZ76_js.g}});Object.defineProperty(exports,"isUseable",{enumerable:true,get:function(){return chunkOU6XJZ76_js.d}});Object.defineProperty(exports,"popContext",{enumerable:true,get:function(){return chunkOU6XJZ76_js.i}});Object.defineProperty(exports,"pushContext",{enumerable:true,get:function(){return chunkOU6XJZ76_js.h}});Object.defineProperty(exports,"resetContext",{enumerable:true,get:function(){return chunkOU6XJZ76_js.e}});Object.defineProperty(exports,"css",{enumerable:true,get:function(){return chunkZJZRDYA2_js.e}});Object.defineProperty(exports,"cx",{enumerable:true,get:function(){return chunkZJZRDYA2_js.f}});Object.defineProperty(exports,"getStyleTag",{enumerable:true,get:function(){return chunkZJZRDYA2_js.b}});Object.defineProperty(exports,"getStyles",{enumerable:true,get:function(){return chunkZJZRDYA2_js.a}});Object.defineProperty(exports,"hydrateStyles",{enumerable:true,get:function(){return chunkZJZRDYA2_js.d}});Object.defineProperty(exports,"keyframes",{enumerable:true,get:function(){return chunkZJZRDYA2_js.h}});Object.defineProperty(exports,"resetStyles",{enumerable:true,get:function(){return chunkZJZRDYA2_js.c}});Object.defineProperty(exports,"styled",{enumerable:true,get:function(){return chunkZJZRDYA2_js.g}});exports.VERSION=J;//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"geAAO,IAAMA,CAAAA,CAAU","file":"index.js","sourcesContent":["export const VERSION = '0.16.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"geAAO,IAAMA,CAAAA,CAAU","file":"index.js","sourcesContent":["export const VERSION = '0.16.15' // Bump version to signify rebuild\n\n// Re-export all from submodules\nexport * from './core'\nexport * from './dom'\nexport * from './router'\nexport * from './server'\nexport * from './css'\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as useRef}from'./chunk-
|
|
1
|
+
export{a as useRef}from'./chunk-VB564E5E.mjs';export{d as ErrorBoundary,c as Suspense,a as f,b as hydrate,e as lazy}from'./chunk-33M3W7D4.mjs';export{d as render,a as resetRender}from'./chunk-P6NMD5QH.mjs';export{a as getIsServer,c as renderToStaticMarkup,b as renderToString}from'./chunk-UQNPGF7C.mjs';export{k as Link,j as Outlet,h as Route,i as Routes,e as getNavigate,a as resetRouter,b as useLocation,d as useNavigate,f as useParams,g as useQuery,c as useRouter}from'./chunk-MFUHRZBV.mjs';export{b as isReactive,c as use}from'./chunk-FJNIW7B2.mjs';export{e as sync}from'./chunk-NRPWBHKP.mjs';export{f as Context,c as Useable,g as getContextValue,d as isUseable,i as popContext,h as pushContext,e as resetContext}from'./chunk-TIUNOZRI.mjs';export{e as css,f as cx,b as getStyleTag,a as getStyles,d as hydrateStyles,h as keyframes,c as resetStyles,g as styled}from'./chunk-FU4W2BKL.mjs';import'./chunk-RUYGSYEV.mjs';var J="0.16.15";export{J as VERSION};//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"u5BAAO,IAAMA,CAAAA,CAAU","file":"index.mjs","sourcesContent":["export const VERSION = '0.16.15' // Bump version to signify rebuild\n\n// Re-export all from submodules\nexport * from './core'\nexport * from './dom'\nexport * from './router'\nexport * from './server'\nexport * from './css'\n"]}
|