nuclo 0.2.35 → 0.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/Element-DLSdmoqX.mjs +2 -0
  2. package/dist/Element-DLSdmoqX.mjs.map +1 -0
  3. package/dist/Element-DfxBbUgD.cjs +2 -0
  4. package/dist/Element-DfxBbUgD.cjs.map +1 -0
  5. package/dist/nuclo.cjs +1 -1
  6. package/dist/nuclo.cjs.map +1 -1
  7. package/dist/nuclo.mjs +1 -1
  8. package/dist/nuclo.mjs.map +1 -1
  9. package/dist/polyfill/nuclo.polyfill.cjs +1 -1
  10. package/dist/polyfill/nuclo.polyfill.cjs.map +1 -1
  11. package/dist/polyfill/nuclo.polyfill.mjs +1 -1
  12. package/dist/polyfill/nuclo.polyfill.mjs.map +1 -1
  13. package/dist/ssr/nuclo.ssr.cjs +1 -1
  14. package/dist/ssr/nuclo.ssr.cjs.map +1 -1
  15. package/dist/ssr/nuclo.ssr.mjs +1 -1
  16. package/dist/ssr/nuclo.ssr.mjs.map +1 -1
  17. package/package.json +4 -20
  18. package/types/core/base.d.ts +1 -4
  19. package/types/features/list.d.ts +0 -1
  20. package/types/index.d.ts +0 -53
  21. package/types/polyfill.d.ts +9 -44
  22. package/types/ssr.d.ts +0 -6
  23. package/dist/Element-BUdteOsZ.cjs +0 -2
  24. package/dist/Element-BUdteOsZ.cjs.map +0 -1
  25. package/dist/Element-Djosl17E.mjs +0 -2
  26. package/dist/Element-Djosl17E.mjs.map +0 -1
  27. package/dist/bootstrap.d.ts +0 -5
  28. package/dist/bootstrap.d.ts.map +0 -1
  29. package/dist/element/attributes.d.ts +0 -6
  30. package/dist/element/attributes.d.ts.map +0 -1
  31. package/dist/element/class-name.d.ts +0 -6
  32. package/dist/element/class-name.d.ts.map +0 -1
  33. package/dist/element/event-attributes.d.ts +0 -5
  34. package/dist/element/event-attributes.d.ts.map +0 -1
  35. package/dist/element/events.d.ts +0 -46
  36. package/dist/element/events.d.ts.map +0 -1
  37. package/dist/element/factory-meta.d.ts +0 -27
  38. package/dist/element/factory-meta.d.ts.map +0 -1
  39. package/dist/element/factory.d.ts +0 -32
  40. package/dist/element/factory.d.ts.map +0 -1
  41. package/dist/element/inline-style.d.ts +0 -9
  42. package/dist/element/inline-style.d.ts.map +0 -1
  43. package/dist/element/lifecycle.d.ts +0 -106
  44. package/dist/element/lifecycle.d.ts.map +0 -1
  45. package/dist/element/modifiers.d.ts +0 -11
  46. package/dist/element/modifiers.d.ts.map +0 -1
  47. package/dist/element/tags.d.ts +0 -5
  48. package/dist/element/tags.d.ts.map +0 -1
  49. package/dist/hydration.d.ts +0 -73
  50. package/dist/hydration.d.ts.map +0 -1
  51. package/dist/index.d.ts +0 -17
  52. package/dist/index.d.ts.map +0 -1
  53. package/dist/list/index.d.ts +0 -7
  54. package/dist/list/index.d.ts.map +0 -1
  55. package/dist/list/runtime.d.ts +0 -6
  56. package/dist/list/runtime.d.ts.map +0 -1
  57. package/dist/list/template.d.ts +0 -113
  58. package/dist/list/template.d.ts.map +0 -1
  59. package/dist/list/types.d.ts +0 -57
  60. package/dist/list/types.d.ts.map +0 -1
  61. package/dist/nuclo.umd.js +0 -2
  62. package/dist/nuclo.umd.js.map +0 -1
  63. package/dist/polyfill/Document.d.ts +0 -19
  64. package/dist/polyfill/Document.d.ts.map +0 -1
  65. package/dist/polyfill/Element.d.ts +0 -48
  66. package/dist/polyfill/Element.d.ts.map +0 -1
  67. package/dist/polyfill/Event.d.ts +0 -43
  68. package/dist/polyfill/Event.d.ts.map +0 -1
  69. package/dist/polyfill/Node.d.ts +0 -13
  70. package/dist/polyfill/Node.d.ts.map +0 -1
  71. package/dist/polyfill/Text.d.ts +0 -11
  72. package/dist/polyfill/Text.d.ts.map +0 -1
  73. package/dist/polyfill/index.d.ts +0 -24
  74. package/dist/polyfill/index.d.ts.map +0 -1
  75. package/dist/render.d.ts +0 -33
  76. package/dist/render.d.ts.map +0 -1
  77. package/dist/shared/conditions.d.ts +0 -4
  78. package/dist/shared/conditions.d.ts.map +0 -1
  79. package/dist/shared/dom.d.ts +0 -80
  80. package/dist/shared/dom.d.ts.map +0 -1
  81. package/dist/shared/environment.d.ts +0 -5
  82. package/dist/shared/environment.d.ts.map +0 -1
  83. package/dist/shared/errors.d.ts +0 -2
  84. package/dist/shared/errors.d.ts.map +0 -1
  85. package/dist/shared/renderables.d.ts +0 -4
  86. package/dist/shared/renderables.d.ts.map +0 -1
  87. package/dist/shared/strings.d.ts +0 -19
  88. package/dist/shared/strings.d.ts.map +0 -1
  89. package/dist/shared/type-guards.d.ts +0 -16
  90. package/dist/shared/type-guards.d.ts.map +0 -1
  91. package/dist/ssr/index.d.ts +0 -19
  92. package/dist/ssr/index.d.ts.map +0 -1
  93. package/dist/ssr/render-to-string.d.ts +0 -41
  94. package/dist/ssr/render-to-string.d.ts.map +0 -1
  95. package/dist/style/css.d.ts +0 -26
  96. package/dist/style/css.d.ts.map +0 -1
  97. package/dist/style/engine.d.ts +0 -94
  98. package/dist/style/engine.d.ts.map +0 -1
  99. package/dist/style/index.d.ts +0 -3
  100. package/dist/style/index.d.ts.map +0 -1
  101. package/dist/update/conditional.d.ts +0 -3
  102. package/dist/update/conditional.d.ts.map +0 -1
  103. package/dist/update/reactive-attributes.d.ts +0 -45
  104. package/dist/update/reactive-attributes.d.ts.map +0 -1
  105. package/dist/update/reactive-text.d.ts +0 -38
  106. package/dist/update/reactive-text.d.ts.map +0 -1
  107. package/dist/update/registry.d.ts +0 -116
  108. package/dist/update/registry.d.ts.map +0 -1
  109. package/dist/update/scope.d.ts +0 -7
  110. package/dist/update/scope.d.ts.map +0 -1
  111. package/dist/update/update.d.ts +0 -4
  112. package/dist/update/update.d.ts.map +0 -1
  113. package/dist/when/builder.d.ts +0 -16
  114. package/dist/when/builder.d.ts.map +0 -1
  115. package/dist/when/index.d.ts +0 -44
  116. package/dist/when/index.d.ts.map +0 -1
  117. package/dist/when/runtime.d.ts +0 -59
  118. package/dist/when/runtime.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"Element-BUdteOsZ.cjs","names":[],"sources":["../src/shared/environment.ts","../src/polyfill/Node.ts","../src/polyfill/Element.ts"],"sourcesContent":["/**\n * Simplified environment detection - minimal overhead for smaller bundle size\n */\n\n// Basic environment detection - no complex caching or edge cases\nexport const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n","/**\n * Base Node class for instanceof checks in Node.js polyfill\n */\nexport class NucloNode {\n nodeType: number = 1; // ELEMENT_NODE\n nodeName: string = '';\n nodeValue: string | null = null;\n parentNode: unknown = null;\n _childNodes: Node[] | null = null;\n textContent: string = '';\n\n get childNodes(): NodeListOf<ChildNode> {\n const nodes = this._childNodes ?? [];\n return {\n ...nodes,\n length: nodes.length,\n item: (index: number) => (nodes[index] as ChildNode) || null,\n [Symbol.iterator]: function* () {\n for (const node of nodes) {\n yield node as ChildNode;\n }\n },\n forEach: (callback: (value: ChildNode, key: number, parent: NodeListOf<ChildNode>) => void) => {\n for (let i = 0; i < nodes.length; i++) {\n callback(nodes[i] as ChildNode, i, this.childNodes);\n }\n },\n entries: function* () {\n for (let i = 0; i < nodes.length; i++) {\n yield [i, nodes[i] as ChildNode] as [number, ChildNode];\n }\n },\n keys: function* () {\n for (let i = 0; i < nodes.length; i++) {\n yield i;\n }\n },\n values: function* () {\n for (const node of nodes) {\n yield node as ChildNode;\n }\n }\n } as unknown as NodeListOf<ChildNode>;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { NucloNode } from './Node';\nimport { isBrowser } from '../shared/environment';\n\n/**\n * Lightweight style object for SSR — prototype methods instead of Object.defineProperty per element.\n * Stores CSS properties as own properties and provides cssText/setProperty/getPropertyValue via prototype.\n */\nclass SSRStyle {\n [key: string]: unknown;\n\n get cssText(): string {\n const entries = Object.entries(this);\n if (entries.length === 0) return '';\n return entries.map(([k, v]) => `${k}: ${v}`).join('; ');\n }\n\n setProperty(name: string, value: string): void {\n (this as Record<string, unknown>)[name] = value;\n }\n\n getPropertyValue(name: string): string {\n return ((this as Record<string, unknown>)[name] as string) || '';\n }\n}\n\n// Lightweight classList for SSR — prototype methods instead of per-element closures\nclass SSRClassList {\n private _el: NucloElement;\n constructor(el: NucloElement) { this._el = el; }\n\n add(...tokens: string[]): void {\n const classes = this._el.className ? this._el.className.split(' ').filter(Boolean) : [];\n for (const t of tokens) if (t && !classes.includes(t)) classes.push(t);\n this._el.className = classes.join(' ');\n }\n remove(...tokens: string[]): void {\n if (!this._el.className) return;\n this._el.className = this._el.className.split(' ').filter(c => c && !tokens.includes(c)).join(' ');\n }\n contains(token: string): boolean {\n return !!this._el.className && this._el.className.split(' ').includes(token);\n }\n toggle(token: string, force?: boolean): boolean {\n const has = this.contains(token);\n if (force === undefined) { if (has) { this.remove(token); return false; } this.add(token); return true; }\n if (force) { this.add(token); return true; }\n this.remove(token); return false;\n }\n replace(oldToken: string, newToken: string): boolean {\n if (!this.contains(oldToken)) return false;\n this.remove(oldToken); this.add(newToken); return true;\n }\n item(index: number): string | null { return (this._el.className.split(' ').filter(Boolean)[index]) ?? null; }\n get length(): number { return this._el.className ? this._el.className.split(' ').filter(Boolean).length : 0; }\n get value(): string { return this._el.className; }\n set value(v: string) { this._el.className = v; }\n toString(): string { return this._el.className; }\n supports(_token: string): boolean { return false; }\n forEach(cb: (value: string, key: number, parent: DOMTokenList) => void): void {\n const classes = this._el.className.split(' ').filter(Boolean);\n for (let i = 0; i < classes.length; i++) cb(classes[i], i, this as unknown as DOMTokenList);\n }\n [Symbol.iterator](): Iterator<string> {\n const classes = this._el.className.split(' ').filter(Boolean);\n let i = 0;\n return { next(): IteratorResult<string> { return i < classes.length ? { value: classes[i++], done: false } : { value: '', done: true }; } };\n }\n entries(): Iterator<[number, string]> {\n const classes = this._el.className.split(' ').filter(Boolean);\n let i = 0;\n return { next(): IteratorResult<[number, string]> { return i < classes.length ? { value: [i, classes[i++]], done: false } : { value: [0, ''], done: true }; } };\n }\n keys(): Iterator<number> {\n const len = this.length; let i = 0;\n return { next(): IteratorResult<number> { return i < len ? { value: i++, done: false } : { value: 0, done: true }; } };\n }\n values(): Iterator<string> { return this[Symbol.iterator](); }\n}\n\ninterface TextNode {\n nodeType: 3;\n textContent: string;\n}\n\ninterface CommentNode {\n nodeType: 8;\n data: string;\n}\n\nfunction isElementNode(node: unknown): node is NucloElement {\n return typeof node === 'object' && node !== null && 'tagName' in node;\n}\n\nfunction isTextNode(node: unknown): node is TextNode {\n return typeof node === 'object' && node !== null && 'nodeType' in node && (node as { nodeType: number }).nodeType === 3;\n}\n\nfunction isCommentNode(node: unknown): node is CommentNode {\n return typeof node === 'object' && node !== null && 'nodeType' in node && (node as { nodeType: number }).nodeType === 8;\n}\n\nexport class NucloElement extends NucloNode {\n tagName: string;\n children: unknown[];\n className: string = '';\n textContent: string = '';\n private _innerHTML: string = '';\n parentNode: unknown = null;\n rawMods?: unknown[];\n mods?: unknown[];\n id: string = '';\n namespaceURI?: string;\n sheet?: CSSStyleSheet | null;\n private _listeners: Map<string, Set<EventListener>> | null;\n\n // style/classList are allocated lazily: the vast majority of SSR elements\n // never touch either (className is stored on the .className string, and the\n // serializer reads the backing field directly), so eagerly constructing an\n // SSRStyle + SSRClassList per element was pure allocation churn. The browser\n // path assigns these in the constructor, so its getter never lazy-allocates.\n private _style?: CSSStyleDeclaration;\n private _classList?: DOMTokenList;\n\n // attributes is allocated lazily too — most elements carry their identity on\n // .className/.id (separate string fields) and never call setAttribute. Reads\n // short-circuit on the undefined backing map without allocating; the\n // serializer reads _attributes directly. The public getter still lazily\n // materializes a Map for any external `el.attributes` consumer.\n private _attributes?: Map<string, string>;\n\n get attributes(): Map<string, string> {\n return (this._attributes ??= new Map<string, string>());\n }\n set attributes(value: Map<string, string>) {\n this._attributes = value;\n }\n\n get style(): CSSStyleDeclaration {\n return (this._style ??= new SSRStyle() as unknown as CSSStyleDeclaration);\n }\n set style(value: CSSStyleDeclaration) {\n this._style = value;\n }\n\n get classList(): DOMTokenList {\n return (this._classList ??= new SSRClassList(this) as unknown as DOMTokenList);\n }\n set classList(value: DOMTokenList) {\n this._classList = value;\n }\n\n get innerHTML(): string {\n return this.serializeChildren();\n }\n\n set innerHTML(value: string) {\n this._innerHTML = value;\n }\n \n private serializeChildren(): string {\n let html = '';\n for (const child of this.children) {\n if (isElementNode(child)) {\n html += this.serializeElement(child);\n } else if (isTextNode(child)) {\n html += child.textContent || '';\n } else if (isCommentNode(child)) {\n html += `<!--${child.data || ''}-->`;\n }\n }\n return html;\n }\n \n private serializeElement(element: NucloElement): string {\n const tag = element.tagName.toLowerCase();\n let html = `<${tag}`;\n \n // Add attributes\n if (element.id) {\n html += ` id=\"${element.id}\"`;\n }\n if (element.className) {\n html += ` class=\"${element.className}\"`;\n }\n if (element._attributes) {\n for (const [name, value] of element._attributes) {\n if (name !== 'id' && name !== 'class') {\n html += ` ${name}=\"${value}\"`;\n }\n }\n }\n \n html += '>';\n \n // Add children\n if (element.children && element.children.length > 0) {\n for (const child of element.children) {\n if (isElementNode(child)) {\n html += this.serializeElement(child);\n } else if (isTextNode(child)) {\n html += child.textContent || '';\n } else if (isCommentNode(child)) {\n html += `<!--${child.data || ''}-->`;\n }\n }\n }\n \n html += `</${tag}>`;\n return html;\n }\n \n constructor(tagName: string) {\n super();\n this.tagName = tagName.toLowerCase();\n this.nodeType = 1; // ELEMENT_NODE\n this.nodeName = tagName.toUpperCase();\n this.children = [];\n\n if (!isBrowser) {\n // ── SSR path: minimal allocations, no Proxy, no event listeners ──\n // style and classList stay unallocated until first access (see getters).\n this._listeners = null;\n } else {\n // ── Browser path: full-featured Proxy style + DOMTokenList ──\n this._listeners = new Map();\n\n const styleProps: Record<string, string> = {};\n this.style = new Proxy({} as CSSStyleDeclaration, {\n get: (_target, prop: string) => {\n if (prop === 'setProperty') return (name: string, value: string) => { styleProps[name] = value; };\n if (prop === 'getPropertyValue') return (name: string) => styleProps[name] || '';\n if (prop === 'cssText') return Object.entries(styleProps).map(([k, v]) => `${k}: ${v}`).join('; ');\n return styleProps[prop];\n },\n set: (_target, prop: string, value: string) => { styleProps[prop] = value; return true; },\n });\n\n // CSSStyleSheet mock for style elements (browser only)\n if (this.tagName === 'style') {\n const cssRules: CSSRule[] = [];\n this.sheet = {\n cssRules: cssRules as unknown as CSSRuleList,\n insertRule: (rule: string, index?: number) => {\n const idx = index ?? cssRules.length;\n let mockRule: CSSRule;\n if (rule.trim().startsWith('@')) {\n const innerRules: CSSRule[] = [];\n const conditionText = rule.replace(/^@\\w+\\s+/, '').replace(/\\s*\\{[\\s\\S]*\\}$/, '').trim();\n mockRule = {\n cssText: rule, conditionText,\n media: { mediaText: conditionText } as MediaList,\n cssRules: innerRules as unknown as CSSRuleList,\n insertRule: (innerRule: string, innerIndex?: number) => {\n const innerIdx = innerIndex ?? innerRules.length;\n innerRules.splice(innerIdx, 0, { cssText: innerRule, selectorText: innerRule.split('{')[0].trim(), style: {} as CSSStyleDeclaration, type: 1 } as unknown as CSSRule);\n return innerIdx;\n },\n deleteRule: (i: number) => { innerRules.splice(i, 1); },\n type: 4,\n } as unknown as CSSRule;\n } else {\n mockRule = { cssText: rule, selectorText: rule.split('{')[0].trim(), style: {} as CSSStyleDeclaration, type: 1 } as unknown as CSSRule;\n }\n cssRules.splice(idx, 0, mockRule);\n return idx;\n },\n deleteRule: (index: number) => { cssRules.splice(index, 1); },\n } as unknown as CSSStyleSheet;\n }\n\n this.classList = createClassList(this);\n }\n }\n \n appendChild<T extends Node>(child: T): T {\n // Spec behaviour: appending a DocumentFragment moves its children into this\n // node and leaves the fragment empty. The list runtime relies on this to\n // batch row insertions.\n if ((child as any)?.nodeType === 11) {\n // Detach the fragment's backing array before iterating (instead of\n // slicing it) — the fragment is emptied either way, and reassigning\n // first means the loop never has to allocate a copy just to guard\n // against the array it's about to discard.\n const kids = (child as any).childNodes as Node[];\n (child as any).childNodes = [];\n if ((child as any).children) (child as any).children = [];\n for (let i = 0; i < kids.length; i++) this.appendChild(kids[i]);\n return child;\n }\n this.children.push(child);\n if (isBrowser && (this as any)['_childNodes']) {\n (this as any)['_childNodes'].push(child);\n }\n if (typeof child === 'object' && child !== null && 'parentNode' in child) {\n (child as { parentNode: unknown }).parentNode = this;\n }\n return child;\n }\n \n setAttribute(name: string, value: string): void {\n (this._attributes ??= new Map<string, string>()).set(name, value);\n if (name === 'class') {\n this.className = value;\n } else if (name === 'id') {\n this.id = value;\n }\n }\n\n getAttribute(name: string): string | null {\n return this._attributes?.get(name) ?? null;\n }\n\n removeAttribute(name: string): void {\n this._attributes?.delete(name);\n if (name === 'class') {\n this.className = '';\n }\n }\n\n hasAttribute(name: string): boolean {\n return this._attributes?.has(name) ?? false;\n }\n \n insertBefore<T extends Node>(newNode: T, referenceNode: Node | null): T {\n if (referenceNode === null) {\n return this.appendChild(newNode);\n }\n // Spec behaviour: inserting a DocumentFragment moves its children (in order)\n // before the reference node and empties the fragment.\n if ((newNode as any)?.nodeType === 11) {\n const kids = (newNode as any).childNodes as Node[];\n (newNode as any).childNodes = [];\n if ((newNode as any).children) (newNode as any).children = [];\n for (let i = 0; i < kids.length; i++) this.insertBefore(kids[i], referenceNode);\n return newNode;\n }\n const index = this.children.indexOf(referenceNode);\n if (index !== -1) {\n this.children.splice(index, 0, newNode);\n if (isBrowser && (this as any)['_childNodes']) {\n const childNodesIndex = (this as any)['_childNodes'].indexOf(referenceNode);\n if (childNodesIndex !== -1) {\n (this as any)['_childNodes'].splice(childNodesIndex, 0, newNode);\n }\n }\n if (typeof newNode === 'object' && newNode !== null && 'parentNode' in newNode) {\n (newNode as { parentNode: unknown }).parentNode = this;\n }\n }\n return newNode;\n }\n \n removeChild<T extends Node>(child: T): T {\n const index = this.children.indexOf(child);\n if (index !== -1) {\n this.children.splice(index, 1);\n if (isBrowser && (this as any)['_childNodes']) {\n const cnIndex = (this as any)['_childNodes'].indexOf(child);\n if (cnIndex !== -1) {\n (this as any)['_childNodes'].splice(cnIndex, 1);\n }\n }\n if (typeof child === 'object' && child !== null && 'parentNode' in child) {\n (child as { parentNode: unknown }).parentNode = null;\n }\n }\n return child;\n }\n\n replaceChild<T extends Node>(newChild: Node, oldChild: T): T {\n const index = this.children.indexOf(oldChild);\n if (index !== -1) {\n this.children[index] = newChild;\n if (isBrowser && (this as any)['_childNodes']) {\n const cnIndex = (this as any)['_childNodes'].indexOf(oldChild);\n if (cnIndex !== -1) {\n (this as any)['_childNodes'][cnIndex] = newChild;\n }\n }\n if (typeof newChild === 'object' && newChild !== null && 'parentNode' in newChild) {\n (newChild as { parentNode: unknown }).parentNode = this;\n }\n if (typeof oldChild === 'object' && oldChild !== null && 'parentNode' in oldChild) {\n (oldChild as { parentNode: unknown }).parentNode = null;\n }\n }\n return oldChild;\n }\n \n addEventListener(type: string, listener: EventListener): void {\n if (!this._listeners) return;\n if (!this._listeners.has(type)) {\n this._listeners.set(type, new Set());\n }\n this._listeners.get(type)!.add(listener);\n }\n\n removeEventListener(type: string, listener: EventListener): void {\n const listeners = this._listeners?.get(type);\n if (listeners) {\n listeners.delete(listener);\n }\n }\n\n dispatchEvent(event: Event): boolean {\n const listeners = this._listeners?.get(event.type);\n if (listeners) {\n for (const listener of listeners) {\n try {\n listener(event);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error in event listener:', error);\n }\n }\n }\n if (event.bubbles && this.parentNode && typeof this.parentNode === 'object' && 'dispatchEvent' in this.parentNode && typeof this.parentNode.dispatchEvent === 'function') {\n this.parentNode.dispatchEvent(event);\n }\n return true;\n }\n \n querySelector(selector: string): Element | null {\n // Simple implementation - supports basic selectors\n // #id, .class, tagName\n if (selector.startsWith('#')) {\n const id = selector.slice(1);\n return this.querySelectorById(id);\n } else if (selector.startsWith('.')) {\n const className = selector.slice(1);\n return this.querySelectorByClass(className);\n } else {\n // Tag name selector\n return this.querySelectorByTag(selector);\n }\n }\n \n private querySelectorById(id: string): Element | null {\n // Check self\n if (this.id === id) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.id === id) {\n return child as unknown as Element;\n }\n const found = child.querySelector(`#${id}`);\n if (found) return found;\n }\n }\n return null;\n }\n \n private querySelectorByClass(className: string): Element | null {\n // Check self\n if (this.classList.contains(className)) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.classList?.contains(className)) {\n return child as unknown as Element;\n }\n const found = child.querySelector(`.${className}`);\n if (found) return found;\n }\n }\n return null;\n }\n \n private querySelectorByTag(tagName: string): Element | null {\n const lowerTag = tagName.toLowerCase();\n // Check self\n if (this.tagName.toLowerCase() === lowerTag) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.tagName.toLowerCase() === lowerTag) {\n return child as unknown as Element;\n }\n const found = child.querySelector(tagName);\n if (found) return found;\n }\n }\n return null;\n }\n \n querySelectorAll(selector: string): NodeListOf<Element> {\n const results: Element[] = [];\n \n if (selector.startsWith('#')) {\n const found = this.querySelector(selector);\n if (found) results.push(found);\n } else if (selector.startsWith('.')) {\n const className = selector.slice(1);\n this.querySelectorAllByClass(className, results);\n } else {\n const tagName = selector.toLowerCase();\n this.querySelectorAllByTag(tagName, results);\n }\n \n return results as unknown as NodeListOf<Element>;\n }\n \n private querySelectorAllByClass(className: string, results: Element[]): void {\n if (this.classList.contains(className)) {\n results.push(this as unknown as Element);\n }\n // Recursion alone collects matching descendants — checking the child here\n // as well would push direct children twice.\n for (const child of this.children) {\n if (isElementNode(child)) {\n child.querySelectorAllByClass(className, results);\n }\n }\n }\n\n private querySelectorAllByTag(tagName: string, results: Element[]): void {\n if (this.tagName.toLowerCase() === tagName) {\n results.push(this as unknown as Element);\n }\n for (const child of this.children) {\n if (isElementNode(child)) {\n child.querySelectorAllByTag(tagName, results);\n }\n }\n }\n}\n\nfunction createClassList(owner: NucloElement): DOMTokenList {\n const getClasses = () => owner.className.split(' ').filter((c) => c);\n const setClasses = (classes: string[]) => {\n owner.className = classes.join(' ');\n };\n\n const classList = {\n add: (...tokens: string[]) => {\n const classes = getClasses();\n for (const token of tokens) {\n if (token && !classes.includes(token)) {\n classes.push(token);\n }\n }\n setClasses(classes);\n },\n remove: (...tokens: string[]) => {\n if (tokens.length === 0) return;\n setClasses(getClasses().filter((c) => !tokens.includes(c)));\n },\n toggle: (token: string, force?: boolean) => {\n const hasClass = classList.contains(token);\n if (force === undefined) {\n if (hasClass) {\n classList.remove(token);\n return false;\n }\n classList.add(token);\n return true;\n }\n if (force) {\n classList.add(token);\n return true;\n }\n classList.remove(token);\n return false;\n },\n contains: (token: string) => getClasses().includes(token),\n replace: (oldToken: string, newToken: string) => {\n const classes = getClasses();\n const index = classes.indexOf(oldToken);\n if (index === -1) return false;\n classes[index] = newToken;\n setClasses(classes);\n return true;\n },\n item: (index: number) => getClasses()[index] || null,\n get length() {\n return getClasses().length;\n },\n toString: () => owner.className,\n [Symbol.iterator]: function* () {\n yield* getClasses();\n },\n forEach: (callback: (value: string, key: number, parent: DOMTokenList) => void) => {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n callback(classes[i], i, classList as unknown as DOMTokenList);\n }\n },\n entries: function* () {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n yield [i, classes[i]] as [number, string];\n }\n },\n keys: function* () {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n yield i;\n }\n },\n values: function* () {\n yield* getClasses();\n },\n get value() {\n return owner.className;\n },\n set value(value: string) {\n owner.className = value;\n },\n supports: (_token: string) => false\n };\n\n return classList as unknown as DOMTokenList;\n}\n"],"mappings":"AAKA,MAAa,EAAY,OAAO,OAAW,KAAe,OAAO,SAAa,ICF9E,IAAa,EAAb,KAAuB,CACrB,SAAmB,EACnB,SAAmB,GACnB,UAA2B,KAC3B,WAAsB,KACtB,YAA6B,KAC7B,YAAsB,GAEtB,IAAI,YAAoC,CACtC,IAAM,EAAQ,KAAK,aAAe,CAAC,EACnC,MAAO,CACL,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jB,IAAM,EAAU,EAAW,EAC3B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAClC,MAAM,CAEV,EACA,OAAQ,WAAa,CACnB,MAAO,EAAW,CACpB,EACA,IAAI,OAAQ,CACV,OAAO,EAAM,SACf,EACA,IAAI,MAAM,EAAe,CACvB,EAAM,UAAY,CACpB,EACA,SAAW,GAAmB,EAChC,EAEA,OAAO,CACT"}
@@ -1,2 +0,0 @@
1
- const e=typeof window<`u`&&typeof document<`u`;var t=class{nodeType=1;nodeName=``;nodeValue=null;parentNode=null;_childNodes=null;textContent=``;get childNodes(){let e=this._childNodes??[];return{...e,length:e.length,item:t=>e[t]||null,[Symbol.iterator]:function*(){for(let t of e)yield t},forEach:t=>{for(let n=0;n<e.length;n++)t(e[n],n,this.childNodes)},entries:function*(){for(let t=0;t<e.length;t++)yield[t,e[t]]},keys:function*(){for(let t=0;t<e.length;t++)yield t},values:function*(){for(let t of e)yield t}}}},n=class{get cssText(){let e=Object.entries(this);return e.length===0?``:e.map(([e,t])=>`${e}: ${t}`).join(`; `)}setProperty(e,t){this[e]=t}getPropertyValue(e){return this[e]||``}},r=class{_el;constructor(e){this._el=e}add(...e){let t=this._el.className?this._el.className.split(` `).filter(Boolean):[];for(let n of e)n&&!t.includes(n)&&t.push(n);this._el.className=t.join(` `)}remove(...e){this._el.className&&(this._el.className=this._el.className.split(` `).filter(t=>t&&!e.includes(t)).join(` `))}contains(e){return!!this._el.className&&this._el.className.split(` `).includes(e)}toggle(e,t){let n=this.contains(e);return t===void 0?n?(this.remove(e),!1):(this.add(e),!0):t?(this.add(e),!0):(this.remove(e),!1)}replace(e,t){return this.contains(e)?(this.remove(e),this.add(t),!0):!1}item(e){return this._el.className.split(` `).filter(Boolean)[e]??null}get length(){return this._el.className?this._el.className.split(` `).filter(Boolean).length:0}get value(){return this._el.className}set value(e){this._el.className=e}toString(){return this._el.className}supports(e){return!1}forEach(e){let t=this._el.className.split(` `).filter(Boolean);for(let n=0;n<t.length;n++)e(t[n],n,this)}[Symbol.iterator](){let e=this._el.className.split(` `).filter(Boolean),t=0;return{next(){return t<e.length?{value:e[t++],done:!1}:{value:``,done:!0}}}}entries(){let e=this._el.className.split(` `).filter(Boolean),t=0;return{next(){return t<e.length?{value:[t,e[t++]],done:!1}:{value:[0,``],done:!0}}}}keys(){let e=this.length,t=0;return{next(){return t<e?{value:t++,done:!1}:{value:0,done:!0}}}}values(){return this[Symbol.iterator]()}};function i(e){return typeof e==`object`&&!!e&&`tagName`in e}function a(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===3}function o(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===8}var s=class extends t{tagName;children;className=``;textContent=``;_innerHTML=``;parentNode=null;rawMods;mods;id=``;namespaceURI;sheet;_listeners;_style;_classList;_attributes;get attributes(){return this._attributes??=/* @__PURE__ */ new Map}set attributes(e){this._attributes=e}get style(){return this._style??=new n}set style(e){this._style=e}get classList(){return this._classList??=new r(this)}set classList(e){this._classList=e}get innerHTML(){return this.serializeChildren()}set innerHTML(e){this._innerHTML=e}serializeChildren(){let e=``;for(let t of this.children)i(t)?e+=this.serializeElement(t):a(t)?e+=t.textContent||``:o(t)&&(e+=`<!--${t.data||``}-->`);return e}serializeElement(e){let t=e.tagName.toLowerCase(),n=`<${t}`;if(e.id&&(n+=` id="${e.id}"`),e.className&&(n+=` class="${e.className}"`),e._attributes)for(let[t,r]of e._attributes)t!==`id`&&t!==`class`&&(n+=` ${t}="${r}"`);if(n+=`>`,e.children&&e.children.length>0)for(let t of e.children)i(t)?n+=this.serializeElement(t):a(t)?n+=t.textContent||``:o(t)&&(n+=`<!--${t.data||``}-->`);return n+=`</${t}>`,n}constructor(t){if(super(),this.tagName=t.toLowerCase(),this.nodeType=1,this.nodeName=t.toUpperCase(),this.children=[],!e)this._listeners=null;else{this._listeners=/* @__PURE__ */ new Map;let e={};if(this.style=new Proxy({},{get:(t,n)=>n===`setProperty`?(t,n)=>{e[t]=n}:n===`getPropertyValue`?t=>e[t]||``:n===`cssText`?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `):e[n],set:(t,n,r)=>(e[n]=r,!0)}),this.tagName===`style`){let e=[];this.sheet={cssRules:e,insertRule:(t,n)=>{let r=n??e.length,i;if(t.trim().startsWith(`@`)){let e=[],n=t.replace(/^@\w+\s+/,``).replace(/\s*\{[\s\S]*\}$/,``).trim();i={cssText:t,conditionText:n,media:{mediaText:n},cssRules:e,insertRule:(t,n)=>{let r=n??e.length;return e.splice(r,0,{cssText:t,selectorText:t.split(`{`)[0].trim(),style:{},type:1}),r},deleteRule:t=>{e.splice(t,1)},type:4}}else i={cssText:t,selectorText:t.split(`{`)[0].trim(),style:{},type:1};return e.splice(r,0,i),r},deleteRule:t=>{e.splice(t,1)}}}this.classList=c(this)}}appendChild(t){if(t?.nodeType===11){let e=t.childNodes;t.childNodes=[],t.children&&=[];for(let t=0;t<e.length;t++)this.appendChild(e[t]);return t}return this.children.push(t),e&&this._childNodes&&this._childNodes.push(t),typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=this),t}setAttribute(e,t){(this._attributes??=/* @__PURE__ */ new Map).set(e,t),e===`class`?this.className=t:e===`id`&&(this.id=t)}getAttribute(e){return this._attributes?.get(e)??null}removeAttribute(e){this._attributes?.delete(e),e===`class`&&(this.className=``)}hasAttribute(e){return this._attributes?.has(e)??!1}insertBefore(t,n){if(n===null)return this.appendChild(t);if(t?.nodeType===11){let e=t.childNodes;t.childNodes=[],t.children&&=[];for(let t=0;t<e.length;t++)this.insertBefore(e[t],n);return t}let r=this.children.indexOf(n);if(r!==-1){if(this.children.splice(r,0,t),e&&this._childNodes){let e=this._childNodes.indexOf(n);e!==-1&&this._childNodes.splice(e,0,t)}typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=this)}return t}removeChild(t){let n=this.children.indexOf(t);if(n!==-1){if(this.children.splice(n,1),e&&this._childNodes){let e=this._childNodes.indexOf(t);e!==-1&&this._childNodes.splice(e,1)}typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=null)}return t}replaceChild(t,n){let r=this.children.indexOf(n);if(r!==-1){if(this.children[r]=t,e&&this._childNodes){let e=this._childNodes.indexOf(n);e!==-1&&(this._childNodes[e]=t)}typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=this),typeof n==`object`&&n&&`parentNode`in n&&(n.parentNode=null)}return n}addEventListener(e,t){this._listeners&&(this._listeners.has(e)||this._listeners.set(e,/* @__PURE__ */ new Set),this._listeners.get(e).add(t))}removeEventListener(e,t){let n=this._listeners?.get(e);n&&n.delete(t)}dispatchEvent(e){let t=this._listeners?.get(e.type);if(t)for(let n of t)try{n(e)}catch(e){console.error(`Error in event listener:`,e)}return e.bubbles&&this.parentNode&&typeof this.parentNode==`object`&&`dispatchEvent`in this.parentNode&&typeof this.parentNode.dispatchEvent==`function`&&this.parentNode.dispatchEvent(e),!0}querySelector(e){if(e.startsWith(`#`)){let t=e.slice(1);return this.querySelectorById(t)}if(e.startsWith(`.`)){let t=e.slice(1);return this.querySelectorByClass(t)}return this.querySelectorByTag(e)}querySelectorById(e){if(this.id===e)return this;for(let t of this.children)if(i(t)){if(t.id===e)return t;let n=t.querySelector(`#${e}`);if(n)return n}return null}querySelectorByClass(e){if(this.classList.contains(e))return this;for(let t of this.children)if(i(t)){if(t.classList?.contains(e))return t;let n=t.querySelector(`.${e}`);if(n)return n}return null}querySelectorByTag(e){let t=e.toLowerCase();if(this.tagName.toLowerCase()===t)return this;for(let n of this.children)if(i(n)){if(n.tagName.toLowerCase()===t)return n;let r=n.querySelector(e);if(r)return r}return null}querySelectorAll(e){let t=[];if(e.startsWith(`#`)){let n=this.querySelector(e);n&&t.push(n)}else if(e.startsWith(`.`)){let n=e.slice(1);this.querySelectorAllByClass(n,t)}else{let n=e.toLowerCase();this.querySelectorAllByTag(n,t)}return t}querySelectorAllByClass(e,t){this.classList.contains(e)&&t.push(this);for(let n of this.children)i(n)&&n.querySelectorAllByClass(e,t)}querySelectorAllByTag(e,t){this.tagName.toLowerCase()===e&&t.push(this);for(let n of this.children)i(n)&&n.querySelectorAllByTag(e,t)}};function c(e){let t=()=>e.className.split(` `).filter(e=>e),n=t=>{e.className=t.join(` `)},r={add:(...e)=>{let r=t();for(let t of e)t&&!r.includes(t)&&r.push(t);n(r)},remove:(...e)=>{e.length!==0&&n(t().filter(t=>!e.includes(t)))},toggle:(e,t)=>{let n=r.contains(e);return t===void 0?n?(r.remove(e),!1):(r.add(e),!0):t?(r.add(e),!0):(r.remove(e),!1)},contains:e=>t().includes(e),replace:(e,r)=>{let i=t(),a=i.indexOf(e);return a!==-1&&(i[a]=r,n(i),!0)},item:e=>t()[e]||null,get length(){return t().length},toString:()=>e.className,[Symbol.iterator]:function*(){yield*t()},forEach:e=>{let n=t();for(let t=0;t<n.length;t++)e(n[t],t,r)},entries:function*(){let e=t();for(let t=0;t<e.length;t++)yield[t,e[t]]},keys:function*(){let e=t();for(let t=0;t<e.length;t++)yield t},values:function*(){yield*t()},get value(){return e.className},set value(t){e.className=t},supports:e=>!1};return r}export{t as n,s as t};
2
- //# sourceMappingURL=Element-Djosl17E.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Element-Djosl17E.mjs","names":[],"sources":["../src/shared/environment.ts","../src/polyfill/Node.ts","../src/polyfill/Element.ts"],"sourcesContent":["/**\n * Simplified environment detection - minimal overhead for smaller bundle size\n */\n\n// Basic environment detection - no complex caching or edge cases\nexport const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n","/**\n * Base Node class for instanceof checks in Node.js polyfill\n */\nexport class NucloNode {\n nodeType: number = 1; // ELEMENT_NODE\n nodeName: string = '';\n nodeValue: string | null = null;\n parentNode: unknown = null;\n _childNodes: Node[] | null = null;\n textContent: string = '';\n\n get childNodes(): NodeListOf<ChildNode> {\n const nodes = this._childNodes ?? [];\n return {\n ...nodes,\n length: nodes.length,\n item: (index: number) => (nodes[index] as ChildNode) || null,\n [Symbol.iterator]: function* () {\n for (const node of nodes) {\n yield node as ChildNode;\n }\n },\n forEach: (callback: (value: ChildNode, key: number, parent: NodeListOf<ChildNode>) => void) => {\n for (let i = 0; i < nodes.length; i++) {\n callback(nodes[i] as ChildNode, i, this.childNodes);\n }\n },\n entries: function* () {\n for (let i = 0; i < nodes.length; i++) {\n yield [i, nodes[i] as ChildNode] as [number, ChildNode];\n }\n },\n keys: function* () {\n for (let i = 0; i < nodes.length; i++) {\n yield i;\n }\n },\n values: function* () {\n for (const node of nodes) {\n yield node as ChildNode;\n }\n }\n } as unknown as NodeListOf<ChildNode>;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { NucloNode } from './Node';\nimport { isBrowser } from '../shared/environment';\n\n/**\n * Lightweight style object for SSR — prototype methods instead of Object.defineProperty per element.\n * Stores CSS properties as own properties and provides cssText/setProperty/getPropertyValue via prototype.\n */\nclass SSRStyle {\n [key: string]: unknown;\n\n get cssText(): string {\n const entries = Object.entries(this);\n if (entries.length === 0) return '';\n return entries.map(([k, v]) => `${k}: ${v}`).join('; ');\n }\n\n setProperty(name: string, value: string): void {\n (this as Record<string, unknown>)[name] = value;\n }\n\n getPropertyValue(name: string): string {\n return ((this as Record<string, unknown>)[name] as string) || '';\n }\n}\n\n// Lightweight classList for SSR — prototype methods instead of per-element closures\nclass SSRClassList {\n private _el: NucloElement;\n constructor(el: NucloElement) { this._el = el; }\n\n add(...tokens: string[]): void {\n const classes = this._el.className ? this._el.className.split(' ').filter(Boolean) : [];\n for (const t of tokens) if (t && !classes.includes(t)) classes.push(t);\n this._el.className = classes.join(' ');\n }\n remove(...tokens: string[]): void {\n if (!this._el.className) return;\n this._el.className = this._el.className.split(' ').filter(c => c && !tokens.includes(c)).join(' ');\n }\n contains(token: string): boolean {\n return !!this._el.className && this._el.className.split(' ').includes(token);\n }\n toggle(token: string, force?: boolean): boolean {\n const has = this.contains(token);\n if (force === undefined) { if (has) { this.remove(token); return false; } this.add(token); return true; }\n if (force) { this.add(token); return true; }\n this.remove(token); return false;\n }\n replace(oldToken: string, newToken: string): boolean {\n if (!this.contains(oldToken)) return false;\n this.remove(oldToken); this.add(newToken); return true;\n }\n item(index: number): string | null { return (this._el.className.split(' ').filter(Boolean)[index]) ?? null; }\n get length(): number { return this._el.className ? this._el.className.split(' ').filter(Boolean).length : 0; }\n get value(): string { return this._el.className; }\n set value(v: string) { this._el.className = v; }\n toString(): string { return this._el.className; }\n supports(_token: string): boolean { return false; }\n forEach(cb: (value: string, key: number, parent: DOMTokenList) => void): void {\n const classes = this._el.className.split(' ').filter(Boolean);\n for (let i = 0; i < classes.length; i++) cb(classes[i], i, this as unknown as DOMTokenList);\n }\n [Symbol.iterator](): Iterator<string> {\n const classes = this._el.className.split(' ').filter(Boolean);\n let i = 0;\n return { next(): IteratorResult<string> { return i < classes.length ? { value: classes[i++], done: false } : { value: '', done: true }; } };\n }\n entries(): Iterator<[number, string]> {\n const classes = this._el.className.split(' ').filter(Boolean);\n let i = 0;\n return { next(): IteratorResult<[number, string]> { return i < classes.length ? { value: [i, classes[i++]], done: false } : { value: [0, ''], done: true }; } };\n }\n keys(): Iterator<number> {\n const len = this.length; let i = 0;\n return { next(): IteratorResult<number> { return i < len ? { value: i++, done: false } : { value: 0, done: true }; } };\n }\n values(): Iterator<string> { return this[Symbol.iterator](); }\n}\n\ninterface TextNode {\n nodeType: 3;\n textContent: string;\n}\n\ninterface CommentNode {\n nodeType: 8;\n data: string;\n}\n\nfunction isElementNode(node: unknown): node is NucloElement {\n return typeof node === 'object' && node !== null && 'tagName' in node;\n}\n\nfunction isTextNode(node: unknown): node is TextNode {\n return typeof node === 'object' && node !== null && 'nodeType' in node && (node as { nodeType: number }).nodeType === 3;\n}\n\nfunction isCommentNode(node: unknown): node is CommentNode {\n return typeof node === 'object' && node !== null && 'nodeType' in node && (node as { nodeType: number }).nodeType === 8;\n}\n\nexport class NucloElement extends NucloNode {\n tagName: string;\n children: unknown[];\n className: string = '';\n textContent: string = '';\n private _innerHTML: string = '';\n parentNode: unknown = null;\n rawMods?: unknown[];\n mods?: unknown[];\n id: string = '';\n namespaceURI?: string;\n sheet?: CSSStyleSheet | null;\n private _listeners: Map<string, Set<EventListener>> | null;\n\n // style/classList are allocated lazily: the vast majority of SSR elements\n // never touch either (className is stored on the .className string, and the\n // serializer reads the backing field directly), so eagerly constructing an\n // SSRStyle + SSRClassList per element was pure allocation churn. The browser\n // path assigns these in the constructor, so its getter never lazy-allocates.\n private _style?: CSSStyleDeclaration;\n private _classList?: DOMTokenList;\n\n // attributes is allocated lazily too — most elements carry their identity on\n // .className/.id (separate string fields) and never call setAttribute. Reads\n // short-circuit on the undefined backing map without allocating; the\n // serializer reads _attributes directly. The public getter still lazily\n // materializes a Map for any external `el.attributes` consumer.\n private _attributes?: Map<string, string>;\n\n get attributes(): Map<string, string> {\n return (this._attributes ??= new Map<string, string>());\n }\n set attributes(value: Map<string, string>) {\n this._attributes = value;\n }\n\n get style(): CSSStyleDeclaration {\n return (this._style ??= new SSRStyle() as unknown as CSSStyleDeclaration);\n }\n set style(value: CSSStyleDeclaration) {\n this._style = value;\n }\n\n get classList(): DOMTokenList {\n return (this._classList ??= new SSRClassList(this) as unknown as DOMTokenList);\n }\n set classList(value: DOMTokenList) {\n this._classList = value;\n }\n\n get innerHTML(): string {\n return this.serializeChildren();\n }\n\n set innerHTML(value: string) {\n this._innerHTML = value;\n }\n \n private serializeChildren(): string {\n let html = '';\n for (const child of this.children) {\n if (isElementNode(child)) {\n html += this.serializeElement(child);\n } else if (isTextNode(child)) {\n html += child.textContent || '';\n } else if (isCommentNode(child)) {\n html += `<!--${child.data || ''}-->`;\n }\n }\n return html;\n }\n \n private serializeElement(element: NucloElement): string {\n const tag = element.tagName.toLowerCase();\n let html = `<${tag}`;\n \n // Add attributes\n if (element.id) {\n html += ` id=\"${element.id}\"`;\n }\n if (element.className) {\n html += ` class=\"${element.className}\"`;\n }\n if (element._attributes) {\n for (const [name, value] of element._attributes) {\n if (name !== 'id' && name !== 'class') {\n html += ` ${name}=\"${value}\"`;\n }\n }\n }\n \n html += '>';\n \n // Add children\n if (element.children && element.children.length > 0) {\n for (const child of element.children) {\n if (isElementNode(child)) {\n html += this.serializeElement(child);\n } else if (isTextNode(child)) {\n html += child.textContent || '';\n } else if (isCommentNode(child)) {\n html += `<!--${child.data || ''}-->`;\n }\n }\n }\n \n html += `</${tag}>`;\n return html;\n }\n \n constructor(tagName: string) {\n super();\n this.tagName = tagName.toLowerCase();\n this.nodeType = 1; // ELEMENT_NODE\n this.nodeName = tagName.toUpperCase();\n this.children = [];\n\n if (!isBrowser) {\n // ── SSR path: minimal allocations, no Proxy, no event listeners ──\n // style and classList stay unallocated until first access (see getters).\n this._listeners = null;\n } else {\n // ── Browser path: full-featured Proxy style + DOMTokenList ──\n this._listeners = new Map();\n\n const styleProps: Record<string, string> = {};\n this.style = new Proxy({} as CSSStyleDeclaration, {\n get: (_target, prop: string) => {\n if (prop === 'setProperty') return (name: string, value: string) => { styleProps[name] = value; };\n if (prop === 'getPropertyValue') return (name: string) => styleProps[name] || '';\n if (prop === 'cssText') return Object.entries(styleProps).map(([k, v]) => `${k}: ${v}`).join('; ');\n return styleProps[prop];\n },\n set: (_target, prop: string, value: string) => { styleProps[prop] = value; return true; },\n });\n\n // CSSStyleSheet mock for style elements (browser only)\n if (this.tagName === 'style') {\n const cssRules: CSSRule[] = [];\n this.sheet = {\n cssRules: cssRules as unknown as CSSRuleList,\n insertRule: (rule: string, index?: number) => {\n const idx = index ?? cssRules.length;\n let mockRule: CSSRule;\n if (rule.trim().startsWith('@')) {\n const innerRules: CSSRule[] = [];\n const conditionText = rule.replace(/^@\\w+\\s+/, '').replace(/\\s*\\{[\\s\\S]*\\}$/, '').trim();\n mockRule = {\n cssText: rule, conditionText,\n media: { mediaText: conditionText } as MediaList,\n cssRules: innerRules as unknown as CSSRuleList,\n insertRule: (innerRule: string, innerIndex?: number) => {\n const innerIdx = innerIndex ?? innerRules.length;\n innerRules.splice(innerIdx, 0, { cssText: innerRule, selectorText: innerRule.split('{')[0].trim(), style: {} as CSSStyleDeclaration, type: 1 } as unknown as CSSRule);\n return innerIdx;\n },\n deleteRule: (i: number) => { innerRules.splice(i, 1); },\n type: 4,\n } as unknown as CSSRule;\n } else {\n mockRule = { cssText: rule, selectorText: rule.split('{')[0].trim(), style: {} as CSSStyleDeclaration, type: 1 } as unknown as CSSRule;\n }\n cssRules.splice(idx, 0, mockRule);\n return idx;\n },\n deleteRule: (index: number) => { cssRules.splice(index, 1); },\n } as unknown as CSSStyleSheet;\n }\n\n this.classList = createClassList(this);\n }\n }\n \n appendChild<T extends Node>(child: T): T {\n // Spec behaviour: appending a DocumentFragment moves its children into this\n // node and leaves the fragment empty. The list runtime relies on this to\n // batch row insertions.\n if ((child as any)?.nodeType === 11) {\n // Detach the fragment's backing array before iterating (instead of\n // slicing it) — the fragment is emptied either way, and reassigning\n // first means the loop never has to allocate a copy just to guard\n // against the array it's about to discard.\n const kids = (child as any).childNodes as Node[];\n (child as any).childNodes = [];\n if ((child as any).children) (child as any).children = [];\n for (let i = 0; i < kids.length; i++) this.appendChild(kids[i]);\n return child;\n }\n this.children.push(child);\n if (isBrowser && (this as any)['_childNodes']) {\n (this as any)['_childNodes'].push(child);\n }\n if (typeof child === 'object' && child !== null && 'parentNode' in child) {\n (child as { parentNode: unknown }).parentNode = this;\n }\n return child;\n }\n \n setAttribute(name: string, value: string): void {\n (this._attributes ??= new Map<string, string>()).set(name, value);\n if (name === 'class') {\n this.className = value;\n } else if (name === 'id') {\n this.id = value;\n }\n }\n\n getAttribute(name: string): string | null {\n return this._attributes?.get(name) ?? null;\n }\n\n removeAttribute(name: string): void {\n this._attributes?.delete(name);\n if (name === 'class') {\n this.className = '';\n }\n }\n\n hasAttribute(name: string): boolean {\n return this._attributes?.has(name) ?? false;\n }\n \n insertBefore<T extends Node>(newNode: T, referenceNode: Node | null): T {\n if (referenceNode === null) {\n return this.appendChild(newNode);\n }\n // Spec behaviour: inserting a DocumentFragment moves its children (in order)\n // before the reference node and empties the fragment.\n if ((newNode as any)?.nodeType === 11) {\n const kids = (newNode as any).childNodes as Node[];\n (newNode as any).childNodes = [];\n if ((newNode as any).children) (newNode as any).children = [];\n for (let i = 0; i < kids.length; i++) this.insertBefore(kids[i], referenceNode);\n return newNode;\n }\n const index = this.children.indexOf(referenceNode);\n if (index !== -1) {\n this.children.splice(index, 0, newNode);\n if (isBrowser && (this as any)['_childNodes']) {\n const childNodesIndex = (this as any)['_childNodes'].indexOf(referenceNode);\n if (childNodesIndex !== -1) {\n (this as any)['_childNodes'].splice(childNodesIndex, 0, newNode);\n }\n }\n if (typeof newNode === 'object' && newNode !== null && 'parentNode' in newNode) {\n (newNode as { parentNode: unknown }).parentNode = this;\n }\n }\n return newNode;\n }\n \n removeChild<T extends Node>(child: T): T {\n const index = this.children.indexOf(child);\n if (index !== -1) {\n this.children.splice(index, 1);\n if (isBrowser && (this as any)['_childNodes']) {\n const cnIndex = (this as any)['_childNodes'].indexOf(child);\n if (cnIndex !== -1) {\n (this as any)['_childNodes'].splice(cnIndex, 1);\n }\n }\n if (typeof child === 'object' && child !== null && 'parentNode' in child) {\n (child as { parentNode: unknown }).parentNode = null;\n }\n }\n return child;\n }\n\n replaceChild<T extends Node>(newChild: Node, oldChild: T): T {\n const index = this.children.indexOf(oldChild);\n if (index !== -1) {\n this.children[index] = newChild;\n if (isBrowser && (this as any)['_childNodes']) {\n const cnIndex = (this as any)['_childNodes'].indexOf(oldChild);\n if (cnIndex !== -1) {\n (this as any)['_childNodes'][cnIndex] = newChild;\n }\n }\n if (typeof newChild === 'object' && newChild !== null && 'parentNode' in newChild) {\n (newChild as { parentNode: unknown }).parentNode = this;\n }\n if (typeof oldChild === 'object' && oldChild !== null && 'parentNode' in oldChild) {\n (oldChild as { parentNode: unknown }).parentNode = null;\n }\n }\n return oldChild;\n }\n \n addEventListener(type: string, listener: EventListener): void {\n if (!this._listeners) return;\n if (!this._listeners.has(type)) {\n this._listeners.set(type, new Set());\n }\n this._listeners.get(type)!.add(listener);\n }\n\n removeEventListener(type: string, listener: EventListener): void {\n const listeners = this._listeners?.get(type);\n if (listeners) {\n listeners.delete(listener);\n }\n }\n\n dispatchEvent(event: Event): boolean {\n const listeners = this._listeners?.get(event.type);\n if (listeners) {\n for (const listener of listeners) {\n try {\n listener(event);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error in event listener:', error);\n }\n }\n }\n if (event.bubbles && this.parentNode && typeof this.parentNode === 'object' && 'dispatchEvent' in this.parentNode && typeof this.parentNode.dispatchEvent === 'function') {\n this.parentNode.dispatchEvent(event);\n }\n return true;\n }\n \n querySelector(selector: string): Element | null {\n // Simple implementation - supports basic selectors\n // #id, .class, tagName\n if (selector.startsWith('#')) {\n const id = selector.slice(1);\n return this.querySelectorById(id);\n } else if (selector.startsWith('.')) {\n const className = selector.slice(1);\n return this.querySelectorByClass(className);\n } else {\n // Tag name selector\n return this.querySelectorByTag(selector);\n }\n }\n \n private querySelectorById(id: string): Element | null {\n // Check self\n if (this.id === id) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.id === id) {\n return child as unknown as Element;\n }\n const found = child.querySelector(`#${id}`);\n if (found) return found;\n }\n }\n return null;\n }\n \n private querySelectorByClass(className: string): Element | null {\n // Check self\n if (this.classList.contains(className)) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.classList?.contains(className)) {\n return child as unknown as Element;\n }\n const found = child.querySelector(`.${className}`);\n if (found) return found;\n }\n }\n return null;\n }\n \n private querySelectorByTag(tagName: string): Element | null {\n const lowerTag = tagName.toLowerCase();\n // Check self\n if (this.tagName.toLowerCase() === lowerTag) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.tagName.toLowerCase() === lowerTag) {\n return child as unknown as Element;\n }\n const found = child.querySelector(tagName);\n if (found) return found;\n }\n }\n return null;\n }\n \n querySelectorAll(selector: string): NodeListOf<Element> {\n const results: Element[] = [];\n \n if (selector.startsWith('#')) {\n const found = this.querySelector(selector);\n if (found) results.push(found);\n } else if (selector.startsWith('.')) {\n const className = selector.slice(1);\n this.querySelectorAllByClass(className, results);\n } else {\n const tagName = selector.toLowerCase();\n this.querySelectorAllByTag(tagName, results);\n }\n \n return results as unknown as NodeListOf<Element>;\n }\n \n private querySelectorAllByClass(className: string, results: Element[]): void {\n if (this.classList.contains(className)) {\n results.push(this as unknown as Element);\n }\n // Recursion alone collects matching descendants — checking the child here\n // as well would push direct children twice.\n for (const child of this.children) {\n if (isElementNode(child)) {\n child.querySelectorAllByClass(className, results);\n }\n }\n }\n\n private querySelectorAllByTag(tagName: string, results: Element[]): void {\n if (this.tagName.toLowerCase() === tagName) {\n results.push(this as unknown as Element);\n }\n for (const child of this.children) {\n if (isElementNode(child)) {\n child.querySelectorAllByTag(tagName, results);\n }\n }\n }\n}\n\nfunction createClassList(owner: NucloElement): DOMTokenList {\n const getClasses = () => owner.className.split(' ').filter((c) => c);\n const setClasses = (classes: string[]) => {\n owner.className = classes.join(' ');\n };\n\n const classList = {\n add: (...tokens: string[]) => {\n const classes = getClasses();\n for (const token of tokens) {\n if (token && !classes.includes(token)) {\n classes.push(token);\n }\n }\n setClasses(classes);\n },\n remove: (...tokens: string[]) => {\n if (tokens.length === 0) return;\n setClasses(getClasses().filter((c) => !tokens.includes(c)));\n },\n toggle: (token: string, force?: boolean) => {\n const hasClass = classList.contains(token);\n if (force === undefined) {\n if (hasClass) {\n classList.remove(token);\n return false;\n }\n classList.add(token);\n return true;\n }\n if (force) {\n classList.add(token);\n return true;\n }\n classList.remove(token);\n return false;\n },\n contains: (token: string) => getClasses().includes(token),\n replace: (oldToken: string, newToken: string) => {\n const classes = getClasses();\n const index = classes.indexOf(oldToken);\n if (index === -1) return false;\n classes[index] = newToken;\n setClasses(classes);\n return true;\n },\n item: (index: number) => getClasses()[index] || null,\n get length() {\n return getClasses().length;\n },\n toString: () => owner.className,\n [Symbol.iterator]: function* () {\n yield* getClasses();\n },\n forEach: (callback: (value: string, key: number, parent: DOMTokenList) => void) => {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n callback(classes[i], i, classList as unknown as DOMTokenList);\n }\n },\n entries: function* () {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n yield [i, classes[i]] as [number, string];\n }\n },\n keys: function* () {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n yield i;\n }\n },\n values: function* () {\n yield* getClasses();\n },\n get value() {\n return owner.className;\n },\n set value(value: string) {\n owner.className = value;\n },\n supports: (_token: string) => false\n };\n\n return classList as unknown as DOMTokenList;\n}\n"],"mappings":"AAKA,MAAa,EAAY,OAAO,OAAW,KAAe,OAAO,SAAa,ICF9E,IAAa,EAAb,KAAuB,CACrB,SAAmB,EACnB,SAAmB,GACnB,UAA2B,KAC3B,WAAsB,KACtB,YAA6B,KAC7B,YAAsB,GAEtB,IAAI,YAAoC,CACtC,IAAM,EAAQ,KAAK,aAAe,CAAC,EACnC,MAAO,CACL,GAAG,EACH,OAAQ,EAAM,OACd,KAAO,GAAmB,EAAM,IAAwB,KACxD,CAAC,OAAO,UAAW,WAAa,CAC9B,IAAK,IAAM,KAAQ,EACjB,MAAM,CAEV,EACA,QAAU,GAAqF,CAC7F,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAChC,EAAS,EAAM,GAAiB,EAAG,KAAK,UAAU,CAEtD,EACA,QAAS,WAAa,CACpB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAChC,KAAM,CAAC,EAAG,EAAM,EAAe,CAEnC,EACA,KAAM,WAAa,CACjB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAChC,MAAM,CAEV,EACA,OAAQ,WAAa,CACnB,IAAK,IAAM,KAAQ,EACjB,MAAM,CAEV,CACF,CACF,CACF,ECpCM,EAAN,KAAe,CAGb,IAAI,SAA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,CAAK,EACf,GACT,EACA,SAAW,GAAkB,EAAW,CAAC,CAAC,SAAS,CAAK,EACxD,SAAU,EAAkB,IAAqB,CAC/C,IAAM,EAAU,EAAW,EACrB,EAAQ,EAAQ,QAAQ,CAAQ,EAItC,OAHI,IAAU,KACd,EAAQ,GAAS,EACjB,EAAW,CAAO,EACX,GACT,EACA,KAAO,GAAkB,EAAW,CAAC,CAAC,IAAU,KAChD,IAAI,QAAS,CACX,OAAO,EAAW,CAAC,CAAC,MACtB,EACA,aAAgB,EAAM,UACtB,CAAC,OAAO,UAAW,WAAa,CAC9B,MAAO,EAAW,CACpB,EACA,QAAU,GAAyE,CACjF,IAAM,EAAU,EAAW,EAC3B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAClC,EAAS,EAAQ,GAAI,EAAG,CAAoC,CAEhE,EACA,QAAS,WAAa,CACpB,IAAM,EAAU,EAAW,EAC3B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAClC,KAAM,CAAC,EAAG,EAAQ,EAAE,CAExB,EACA,KAAM,WAAa,CACjB,IAAM,EAAU,EAAW,EAC3B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAClC,MAAM,CAEV,EACA,OAAQ,WAAa,CACnB,MAAO,EAAW,CACpB,EACA,IAAI,OAAQ,CACV,OAAO,EAAM,SACf,EACA,IAAI,MAAM,EAAe,CACvB,EAAM,UAAY,CACpB,EACA,SAAW,GAAmB,EAChC,EAEA,OAAO,CACT"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Initializes the nuclo runtime by exposing tag builders and utilities.
3
- */
4
- export declare function initializeRuntime(): void;
5
- //# sourceMappingURL=bootstrap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AASA;;GAEG;AAEH,wBAAgB,iBAAiB,IAAI,IAAI,CAoBxC"}
@@ -1,6 +0,0 @@
1
- type AttributeKey<TTagName extends ElementTagName> = keyof ExpandedElementAttributes<TTagName>;
2
- type AttributeCandidate<TTagName extends ElementTagName> = ExpandedElementAttributes<TTagName>[AttributeKey<TTagName>];
3
- export declare function applySingleAttribute<TTagName extends ElementTagName>(el: ExpandedElement<TTagName>, key: AttributeKey<TTagName>, raw: AttributeCandidate<TTagName> | undefined, shouldMergeClassName?: boolean): void;
4
- export declare function applyAttributes<TTagName extends ElementTagName>(element: ExpandedElement<TTagName>, attributes: ExpandedElementAttributes<TTagName>, mergeClassName?: boolean): void;
5
- export { createReactiveTextNode } from "../update/reactive-text";
6
- //# sourceMappingURL=attributes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/element/attributes.ts"],"names":[],"mappings":"AAcA,KAAK,YAAY,CAAC,QAAQ,SAAS,cAAc,IAAI,MAAM,yBAAyB,CAAC,QAAQ,CAAC,CAAC;AAC/F,KAAK,kBAAkB,CAAC,QAAQ,SAAS,cAAc,IACrD,yBAAyB,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;AA0C9D,wBAAgB,oBAAoB,CAAC,QAAQ,SAAS,cAAc,EAClE,EAAE,EAAE,eAAe,CAAC,QAAQ,CAAC,EAC7B,GAAG,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC3B,GAAG,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GAAG,SAAS,EAC7C,oBAAoB,UAAQ,GAC3B,IAAI,CAmFN;AAED,wBAAgB,eAAe,CAAC,QAAQ,SAAS,cAAc,EAC7D,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,UAAU,EAAE,yBAAyB,CAAC,QAAQ,CAAC,EAC/C,cAAc,UAAO,GACpB,IAAI,CAYN;AAED,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare function initReactiveClassName(el: HTMLElement): void;
2
- export declare function hasReactiveClassName(el: HTMLElement): boolean;
3
- export declare function addStaticClasses(el: HTMLElement, className: string): void;
4
- export declare function mergeReactiveClassName(el: HTMLElement, reactiveClassName: string): void;
5
- export declare function mergeStaticClassName(el: HTMLElement, newClassName: string): void;
6
- //# sourceMappingURL=class-name.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"class-name.d.ts","sourceRoot":"","sources":["../../src/element/class-name.ts"],"names":[],"mappings":"AAoCA,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAO3D;AAGD,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAE7D;AAGD,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAQzE;AAGD,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CA+BvF;AAGD,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAWhF"}
@@ -1,5 +0,0 @@
1
- /** Converts a public camel-cased event attribute to its native IDL property. */
2
- export declare function eventAttributeToProperty(attribute: string): string | null;
3
- /** Assigns an event attribute, falling back when the IDL property is absent. */
4
- export declare function setEventAttribute(element: HTMLElement, property: string, listener: EventListener): void;
5
- //# sourceMappingURL=event-attributes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-attributes.d.ts","sourceRoot":"","sources":["../../src/element/event-attributes.ts"],"names":[],"mappings":"AAkBA,gFAAgF;AAChF,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiBzE;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,aAAa,GACtB,IAAI,CA2BN"}
@@ -1,46 +0,0 @@
1
- /**
2
- * Typed event listener helper.
3
- *
4
- * Usage:
5
- * button(
6
- * "Click",
7
- * on("click", (e) => {
8
- * // e and currentTarget are inferred from the native event map
9
- * })
10
- * )
11
- *
12
- * Design notes:
13
- * - Returns a NodeModFn so it can be used like any other modifier.
14
- * - Produces no child node (returns void in the modifier body).
15
- * - Provides strong typing of the event object based on the DOM event name.
16
- * - Stores listener references in a WeakMap to prevent memory leaks.
17
- * - Listeners are automatically cleaned up when elements are garbage collected.
18
- */
19
- type EventListenerOptions = boolean | AddEventListenerOptions;
20
- /**
21
- * Remove all listeners of a specific type from an element.
22
- */
23
- export declare function removeAllListeners(element: HTMLElement, type?: string): void;
24
- /**
25
- * Overload for standard HTMLElement events (strongly typed via lib.dom.d.ts)
26
- */
27
- export declare function on<K extends NucloHTMLElementEventName, TTagName extends NucloHTMLElementTagNameForEvent<K> = NucloHTMLElementTagNameForEvent<K>>(type: K, listener: TypedEventListener<HTMLElementTagNameMap[TTagName], NucloHTMLElementEventForName<K>>, options?: EventListenerOptions): NodeModFn<TTagName>;
28
- /**
29
- * Fires once, after the element has been created and connected to the live
30
- * document. Equivalent to `{ onMount: ... }`. May return a cleanup function —
31
- * equivalent to also registering it with on("destroy", ...).
32
- *
33
- * Listed before the generic string overload below on purpose: "mount" is a
34
- * string too, so a less specific overload earlier would shadow this one.
35
- */
36
- export declare function on<TTagName extends ElementTagName = ElementTagName>(type: "mount", listener: MountCallback<HTMLElementTagNameMap[TTagName]>): NodeModFn<TTagName>;
37
- /** Fires once the element has been removed. Equivalent to `{ onDestroy: ... }`. */
38
- export declare function on<TTagName extends ElementTagName = ElementTagName>(type: "destroy", listener: DestroyCallback<HTMLElementTagNameMap[TTagName]>): NodeModFn<TTagName>;
39
- /**
40
- * Fallback / custom event overload (arbitrary event names or custom event types).
41
- * Specify a custom event type with the E generic if needed:
42
- * on<"my-event", CustomEvent<MyDetail>>("my-event", e => { ... })
43
- */
44
- export declare function on<K extends string, E extends Event = Event, TTagName extends ElementTagName = ElementTagName>(type: K, listener: TypedEventListener<HTMLElementTagNameMap[TTagName], E>, options?: EventListenerOptions): NodeModFn<TTagName>;
45
- export {};
46
- //# sourceMappingURL=events.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/element/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,KAAK,oBAAoB,GAAG,OAAO,GAAG,uBAAuB,CAAC;AAiD9D;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAyCN;AA+CD;;GAEG;AACH,wBAAgB,EAAE,CAChB,CAAC,SAAS,yBAAyB,EACnC,QAAQ,SAAS,+BAA+B,CAAC,CAAC,CAAC,GAAG,+BAA+B,CAAC,CAAC,CAAC,EAExF,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,kBAAkB,CAC1B,qBAAqB,CAAC,QAAQ,CAAC,EAC/B,4BAA4B,CAAC,CAAC,CAAC,CAChC,EACD,OAAO,CAAC,EAAE,oBAAoB,GAC7B,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEvB;;;;;;;GAOG;AACH,wBAAgB,EAAE,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,EACjE,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,aAAa,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,GACvD,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEvB,mFAAmF;AACnF,wBAAgB,EAAE,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,EACjE,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,eAAe,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,GACzD,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEvB;;;;GAIG;AACH,wBAAgB,EAAE,CAChB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,KAAK,GAAG,KAAK,EACvB,QAAQ,SAAS,cAAc,GAAG,cAAc,EAEhD,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,kBAAkB,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAChE,OAAO,CAAC,EAAE,oBAAoB,GAC7B,SAAS,CAAC,QAAQ,CAAC,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Internal factory metadata.
3
- *
4
- * Tag builders return opaque factory closures; the list() template engine
5
- * needs to see through them (tag name + modifier list) to decide whether a
6
- * row can be built by cloning a skeleton instead of running the factory.
7
- * The metadata is attached under symbols so nothing leaks into the public
8
- * API surface or enumerable properties.
9
- */
10
- export declare const FACTORY_TAG: unique symbol;
11
- export declare const FACTORY_MODS: unique symbol;
12
- export declare function acquireMetadataOnlyFactory(): () => null;
13
- export declare function setFactoryMeta(factory: unknown, tag: string, mods: readonly unknown[]): void;
14
- /** Returns the modifier list of a tag-builder factory, or undefined. */
15
- export declare function getFactoryMods(fn: unknown): readonly unknown[] | undefined;
16
- /** Returns the tag name of a tag-builder factory, or undefined. */
17
- export declare function getFactoryTag(fn: unknown): string | undefined;
18
- export declare function isMetadataOnlyFactoryMode(): boolean;
19
- /**
20
- * Takes the render function and its two args directly (rather than a `() =>`
21
- * thunk) so the hot per-row call in list/runtime.ts doesn't allocate a
22
- * closure just to defer a single call.
23
- */
24
- export declare function withMetadataOnlyFactories<TItem, T>(fn: (item: TItem, index: number) => T, item: TItem, index: number): T;
25
- export declare function getMetadataOnlyFactoryCheckpoint(): number;
26
- export declare function releaseMetadataOnlyFactories(checkpoint: number): void;
27
- //# sourceMappingURL=factory-meta.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory-meta.d.ts","sourceRoot":"","sources":["../../src/element/factory-meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,WAAW,eAA8B,CAAC;AACvD,eAAO,MAAM,YAAY,eAA+B,CAAC;AAgBzD,wBAAgB,0BAA0B,IAAI,MAAM,IAAI,CAKvD;AAOD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,SAAS,OAAO,EAAE,GACvB,IAAI,CAGN;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,SAAS,OAAO,EAAE,GAAG,SAAS,CAE1E;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAE7D;AAED,wBAAgB,yBAAyB,IAAI,OAAO,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAOxH;AAED,wBAAgB,gCAAgC,WAE/C;AAED,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,QAM9D"}
@@ -1,32 +0,0 @@
1
- /**
2
- * Element creation: builds HTML/SVG elements and applies the modifier list
3
- * that was passed to a tag builder (children, attributes, text, on(), ...).
4
- */
5
- import { type NodeModifier } from "./modifiers";
6
- export type { NodeModifier };
7
- /**
8
- * Applies modifiers to an element, appending newly produced Nodes while avoiding
9
- * duplicate DOM insertions (i.e. only appends if parentNode differs).
10
- *
11
- * `localIndex` advances once per appended child so each reactive/static text
12
- * modifier gets a unique `text-N` marker; it is internal bookkeeping only and
13
- * is not returned (no production caller consumed the previous result object).
14
- */
15
- export declare function applyModifiers<TTagName extends ElementTagName>(element: ExpandedElement<TTagName>, modifiers: ReadonlyArray<NodeModifier<TTagName>>, startIndex?: number): void;
16
- /**
17
- * Creates an HTML element with the specified tag name and applies modifiers to it.
18
- */
19
- export declare function createHtmlElementWithModifiers<TTagName extends ElementTagName>(tagName: TTagName, modifiers: ReadonlyArray<NodeModifier<TTagName>>): ExpandedElement<TTagName>;
20
- /**
21
- * Creates an SVG element with the specified tag name and applies modifiers to it.
22
- */
23
- export declare function createSvgElementWithModifiers<TTagName extends keyof SVGElementTagNameMap>(tagName: TTagName, modifiers: ReadonlyArray<unknown>): SVGElementTagNameMap[TTagName];
24
- /**
25
- * Creates an HTML tag builder function.
26
- */
27
- export declare function createHtmlTagBuilder<TTagName extends ElementTagName>(tagName: TTagName): ExpandedElementBuilder<TTagName>;
28
- /**
29
- * Creates an SVG tag builder function.
30
- */
31
- export declare function createSvgTagBuilder<TTagName extends keyof SVGElementTagNameMap>(tagName: TTagName): ExpandedSVGElementBuilder<TTagName>;
32
- //# sourceMappingURL=factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/element/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAKnE,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,QAAQ,SAAS,cAAc,EAC5D,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,SAAS,EAAE,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAChD,UAAU,SAAI,GACb,IAAI,CAoBN;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,SAAS,cAAc,EAC5E,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,GAC/C,eAAe,CAAC,QAAQ,CAAC,CAO3B;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,SAAS,MAAM,oBAAoB,EACvF,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,GAChC,oBAAoB,CAAC,QAAQ,CAAC,CAOhC;AAmED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,SAAS,cAAc,EAClE,OAAO,EAAE,QAAQ,GAChB,sBAAsB,CAAC,QAAQ,CAAC,CAElC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,oBAAoB,EAC7E,OAAO,EAAE,QAAQ,GAChB,yBAAyB,CAAC,QAAQ,CAAC,CAErC"}
@@ -1,9 +0,0 @@
1
- type StyleAssignment = CSSStyleObject;
2
- type StyleResolver = () => StyleAssignment | null | undefined;
3
- /**
4
- * Simplified style management - basic functionality with minimal overhead
5
- */
6
- export declare function assignInlineStyles<TTagName extends ElementTagName>(element: ExpandedElement<TTagName>, styles: StyleAssignment | null | undefined): void;
7
- export declare function applyStyleAttribute<TTagName extends ElementTagName>(element: ExpandedElement<TTagName>, styleValue: StyleAssignment | StyleResolver | null | undefined): void;
8
- export {};
9
- //# sourceMappingURL=inline-style.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-style.d.ts","sourceRoot":"","sources":["../../src/element/inline-style.ts"],"names":[],"mappings":"AAKA,KAAK,eAAe,GAAG,cAAc,CAAC;AACtC,KAAK,aAAa,GAAG,MAAM,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;AAE9D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,SAAS,cAAc,EAChE,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GACzC,IAAI,CAeN;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,cAAc,EACjE,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAClC,UAAU,EAAE,eAAe,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,GAC7D,IAAI,CAUN"}
@@ -1,106 +0,0 @@
1
- /**
2
- * Mount/destroy lifecycle hooks.
3
- *
4
- * Two equivalent ways to register them, both funneling into this module:
5
- * - `on("mount", cb)` / `on("destroy", cb)` (./events.ts)
6
- * - `{ onMount: cb }` / `{ onDestroy: cb }` attributes (./attributes.ts)
7
- *
8
- * ── Mount timing ─────────────────────────────────────────────────────────
9
- * A freshly created element is still detached while its own subtree (and,
10
- * for the initial page render, every ancestor up to the root) is being
11
- * assembled — nuclo builds a tree fully off-document before attaching it in
12
- * one shot (render()/hydrate()), and list()/when() do the same for the
13
- * rows/branches they insert into an already-connected host. So onMount can't
14
- * fire the instant a modifier runs; the element is queued and the queue is
15
- * flushed once the surrounding operation (render(), hydrate(), or update())
16
- * finishes inserting its nodes — at that point the element is guaranteed
17
- * connected. See flushMountQueue() and its call sites in render.ts/update.ts.
18
- *
19
- * ── Destroy timing ───────────────────────────────────────────────────────
20
- * onDestroy fires eagerly and synchronously the moment nuclo removes the
21
- * element through its own machinery — see the disposeElementLifecycle() call
22
- * in shared/dom.ts's cleanupNodeTree(), which every ordinary removal
23
- * (list()/when() diffing, any safeRemoveChild() call) already goes through.
24
- * The handful of fast paths that intentionally skip that per-node walk for
25
- * performance (list()'s bulk clear/replace, the single-element when()/else()
26
- * swap) call disposeLifecyclesInSubtree() directly instead, so destroy still
27
- * fires exactly at removal time there too — without paying for a bookkeeping
28
- * walk when nothing in the affected subtree ever registered a lifecycle
29
- * callback (hasActiveLifecycleRegistrations() short-circuits that to a
30
- * single integer comparison in the — by far most common — case where
31
- * lifecycle hooks aren't used at all).
32
- *
33
- * An element removed through means nuclo never observes (e.g. a raw
34
- * `node.remove()` on a container built by render()) is only noticed the next
35
- * time render()/hydrate()/update() runs and finds it disconnected — this
36
- * file does not use a MutationObserver. That never leaks memory (all
37
- * bookkeeping below is WeakMap-based, exactly like every other nuclo
38
- * registry — see test/memory/gc-collectability.test.ts), but if an app
39
- * removes a node that way and never calls update() again afterwards,
40
- * onDestroy for it will not run either. This matches list()/when()'s own
41
- * documented "disconnection is noticed lazily, on the next update()"
42
- * contract; it is not a lifecycle-specific limitation.
43
- *
44
- * ── Ordering (parent/child, any depth) ──────────────────────────────────
45
- * Neither mechanism below cares how many list()s, when()s, or plain
46
- * component functions wrap an element — every element gets its own
47
- * independent WeakMap record, keyed by the element itself, so correctness
48
- * never depends on nesting depth. What nesting *does* affect is the relative
49
- * order two related elements' callbacks fire in, which follows normal
50
- * resource-scoping discipline in both directions:
51
- * - onMount fires parent-before-child. This falls out of queue order for
52
- * free — a parent's own {onMount}/on("mount", ...) modifier is applied
53
- * (queuing it) before the child factories in its own modifier list are
54
- * even invoked, since applying modifiers is a synchronous, in-order walk.
55
- * A child's onMount can safely assume any context the parent's onMount
56
- * set up is already in place.
57
- * - onDestroy fires child-before-parent (see cleanupNodeTree() and
58
- * disposeLifecyclesInSubtree() in shared/dom.ts, both post-order: they
59
- * recurse into every descendant *before* disposing the node itself). A
60
- * parent's onDestroy can safely release something its children were
61
- * still using — they have already run by the time it does.
62
- * Together: mount is top-down, destroy is bottom-up — the same order a
63
- * `try { ... } finally { ... }` stack of nested resource scopes unwinds in,
64
- * applied to the DOM tree instead of the call stack.
65
- *
66
- * ── Memory ───────────────────────────────────────────────────────────────
67
- * Per-element bookkeeping lives in a WeakMap keyed by the element, so it is
68
- * collectible the instant nothing else references the element — exactly the
69
- * same shape as list/runtime.ts's and update/registry.ts's registries. The
70
- * mountQueue holds only WeakRefs, so abandoned builds are collectible even
71
- * if no later operation flushes the queue. Completed mount callbacks are
72
- * released immediately; only their returned cleanup survives until destroy.
73
- */
74
- /** Registers a mount callback for `element`. See the module doc for timing. */
75
- export declare function registerMount<TElement extends Element>(element: TElement, callback: MountCallback<TElement>): void;
76
- /** Registers a destroy callback for `element`. See the module doc for timing. */
77
- export declare function registerDestroy<TElement extends Element>(element: TElement, callback: DestroyCallback<TElement>): void;
78
- /**
79
- * Flushes every element queued since the last flush, firing its mount
80
- * callback(s) now that the surrounding render()/hydrate()/update() pass has
81
- * finished inserting nodes into the (connected) document.
82
- *
83
- * Swaps the shared queue out to a local batch before iterating, so a mount
84
- * callback that itself triggers a nested update() (which pushes onto a fresh
85
- * queue and flushes it in its own, inner call) can't corrupt or be corrupted
86
- * by the batch this call is still draining.
87
- */
88
- export declare function flushMountQueue(): void;
89
- /**
90
- * Finalizes one element's lifecycle: silently cancels a mount that never got
91
- * to run (state was still Pending — built and discarded within one pass), or
92
- * fires its destroy callback(s) (state was Mounted). Idempotent — safe to
93
- * call more than once for the same element, e.g. once eagerly from
94
- * cleanupNodeTree() and, redundantly, once more from a fast-path caller that
95
- * doesn't know whether the eager walk already reached this node.
96
- */
97
- export declare function disposeElementLifecycle(element: Element): void;
98
- /**
99
- * True while at least one element anywhere on the page has a live (Pending
100
- * or Mounted) lifecycle record. Called by disposeLifecyclesInSubtree() in
101
- * shared/dom.ts (its own short-circuit) and, hoisted out of its per-row
102
- * loop, by list/runtime.ts's bulkClearRecords() — so clearing a large
103
- * lifecycle-free list costs one comparison, not one skipped call per row.
104
- */
105
- export declare function hasActiveLifecycleRegistrations(): boolean;
106
- //# sourceMappingURL=lifecycle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/element/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAsFH,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,QAAQ,SAAS,OAAO,EACpD,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC,GAChC,IAAI,CAWN;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,QAAQ,SAAS,OAAO,EACtD,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC,GAClC,IAAI,CAMN;AAkDD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAQtC;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB9D;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,IAAI,OAAO,CAEzD"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Caches the probe result of zero-arity function modifiers so the same
3
- * function is not re-invoked when it reappears during re-renders.
4
- */
5
- export declare const modifierProbeCache: WeakMap<() => unknown, {
6
- value: unknown;
7
- error: boolean;
8
- }>;
9
- export type NodeModifier<TTagName extends ElementTagName = ElementTagName> = NodeMod<TTagName> | NodeModFn<TTagName> | AnyParentNodeModifier;
10
- export declare function applyNodeModifier<TTagName extends ElementTagName>(parent: ExpandedElement<TTagName>, modifier: NodeModifier<TTagName>, index: number): Node | null;
11
- //# sourceMappingURL=modifiers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../src/element/modifiers.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,gBAAqB,OAAO;WAAW,OAAO;WAAS,OAAO;EAAK,CAAC;AAEnG,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,IACtE,OAAO,CAAC,QAAQ,CAAC,GACjB,SAAS,CAAC,QAAQ,CAAC,GACnB,qBAAqB,CAAC;AAqDzB,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,cAAc,EAChE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,EAChC,KAAK,EAAE,MAAM,GACX,IAAI,GAAG,IAAI,CAsFb"}
@@ -1,5 +0,0 @@
1
- export declare const HTML_TAGS: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "menu", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "search", "section", "select", "slot", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"];
2
- export declare const SVG_TAGS: readonly ["a", "animate", "animateMotion", "animateTransform", "circle", "clipPath", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "script", "set", "stop", "style", "svg", "switch", "symbol", "text", "textPath", "title", "tspan", "use", "view"];
3
- export declare const SELF_CLOSING_TAGS: readonly ["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "source", "track", "wbr"];
4
- export declare function registerGlobalTagBuilders(target?: Record<string, unknown>): void;
5
- //# sourceMappingURL=tags.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../src/element/tags.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS,g7BAc4B,CAAC;AAEnD,eAAO,MAAM,QAAQ,4wBAWyC,CAAC;AAE/D,eAAO,MAAM,iBAAiB,iHAGoB,CAAC;AAkDnD,wBAAgB,yBAAyB,CAAC,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAc,GAAG,IAAI,CAe5F"}
@@ -1,73 +0,0 @@
1
- /**
2
- * Hydration context — tracks global hydration state and per-parent cursor positions.
3
- *
4
- * During hydration the component tree is built against an existing DOM tree
5
- * (produced by SSR). Instead of creating new nodes, factories claim existing
6
- * children from their parent element by advancing a cursor.
7
- *
8
- * The cursor is a *node pointer* (the next unclaimed child), not an index.
9
- * Indexed childNodes access is O(n) after any tree/attribute mutation in
10
- * jsdom (live NodeList re-materialization) which made hydration O(n²);
11
- * firstChild/nextSibling pointers are O(1) in every DOM implementation.
12
- */
13
- export declare function isHydrating(): boolean;
14
- /**
15
- * True while a tree is being built for SSR serialization (inside
16
- * renderToString). Text children must keep their `<!-- text-N -->` markers in
17
- * this mode so the emitted HTML stays hydratable — even when `isBrowser` is
18
- * true (SSR running under jsdom, or an isomorphic worker that provides a DOM).
19
- * A pure client render leaves this false and skips the markers.
20
- */
21
- export declare function isSerializing(): boolean;
22
- /**
23
- * Runs `fn` with serialization mode enabled, restoring the previous state
24
- * afterwards (so nested/re-entrant renderToString calls behave correctly).
25
- */
26
- export declare function runSerializing<T>(fn: () => T): T;
27
- export declare function startHydration(): void;
28
- export declare function endHydration(): void;
29
- /**
30
- * Runs a callback with hydration temporarily disabled, restoring the previous
31
- * state afterwards. Used when a server/client mismatch forces a subtree to be
32
- * rendered fresh in the middle of a hydration pass — fresh rendering must not
33
- * claim nodes from the surrounding SSR DOM.
34
- */
35
- export declare function runWithoutHydration<T>(fn: () => T): T;
36
- /**
37
- * Returns the next unclaimed child of a parent node (or null at the end)
38
- * without advancing the cursor.
39
- */
40
- export declare function peekChild(parent: Node): Node | null;
41
- /**
42
- * Sets the cursor to a specific child node (or null for "past the end").
43
- */
44
- export declare function setCursor(parent: Node, node: Node | null): void;
45
- /**
46
- * Advances the cursor past whitespace-only text nodes.
47
- *
48
- * Nuclo's own SSR output never produces bare whitespace text nodes (text
49
- * children are always preceded by a `<!-- text-N -->` marker), so unmarked
50
- * whitespace comes from the surrounding template or an HTML
51
- * formatter/minifier. Skipping (without removing) keeps the cursor aligned
52
- * while leaving the document's visual whitespace untouched.
53
- */
54
- export declare function skipWhitespaceText(parent: Node): void;
55
- /**
56
- * Claims the next child node from parent at the current cursor position.
57
- * Advances the cursor by one.
58
- */
59
- export declare function claimChild(parent: Node): Node | null;
60
- /**
61
- * Attempts to claim an existing element from the parent during hydration.
62
- * Returns the claimed element if the next child matches the expected tag, or null.
63
- */
64
- export declare function claimElement(parent: Node, tagName: string): Element | null;
65
- /**
66
- * Removes unclaimed SSR children from a hydrated element.
67
- * Must be called after modifiers have been applied to a claimed element.
68
- * Removes nodes from the cursor through `lastOriginalChild` (the element's
69
- * last child before modifiers ran) — nodes appended by modifiers come after
70
- * that boundary and are preserved.
71
- */
72
- export declare function cleanupUnclaimedChildren(node: Node, lastOriginalChild: Node | null): void;
73
- //# sourceMappingURL=hydration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../src/hydration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAQhD;AAED,wBAAgB,cAAc,IAAI,IAAI,CAMrC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAQrD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAGnD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAE/D;AAMD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAUrD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAMpD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAQ1E;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CASzF"}