@pithyjs/core 0.1.0-beta.23 → 0.1.0-beta.24
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/README.md +2 -0
- package/dist/compile/binds/bindComponentsTags.d.ts.map +1 -1
- package/dist/compile/binds/bindComponentsTags.js +21 -10
- package/dist/compile/binds/bindComponentsTags.js.map +1 -1
- package/dist/compile/binds/bindDeferDirectives.d.ts +3 -3
- package/dist/compile/binds/bindDeferDirectives.d.ts.map +1 -1
- package/dist/compile/binds/bindDeferDirectives.js +7 -5
- package/dist/compile/binds/bindDeferDirectives.js.map +1 -1
- package/dist/compile/binds/bindErrorBoundary.d.ts +6 -2
- package/dist/compile/binds/bindErrorBoundary.d.ts.map +1 -1
- package/dist/compile/binds/bindErrorBoundary.js +86 -20
- package/dist/compile/binds/bindErrorBoundary.js.map +1 -1
- package/dist/compile/contentProjection.d.ts +14 -2
- package/dist/compile/contentProjection.d.ts.map +1 -1
- package/dist/compile/contentProjection.js +42 -4
- package/dist/compile/contentProjection.js.map +1 -1
- package/dist/compile/nodeExpando.d.ts +1 -0
- package/dist/compile/nodeExpando.d.ts.map +1 -1
- package/dist/compile/nodeExpando.js.map +1 -1
- package/dist/compile/ssrCrashes.d.ts.map +1 -1
- package/dist/compile/ssrCrashes.js +76 -20
- package/dist/compile/ssrCrashes.js.map +1 -1
- package/dist/runtime/applyBindings.d.ts +6 -0
- package/dist/runtime/applyBindings.d.ts.map +1 -1
- package/dist/runtime/applyBindings.js +6 -0
- package/dist/runtime/applyBindings.js.map +1 -1
- package/dist/runtime/bindings/applyComponent.d.ts.map +1 -1
- package/dist/runtime/bindings/applyComponent.js +3 -1
- package/dist/runtime/bindings/applyComponent.js.map +1 -1
- package/dist/runtime/bindings/applyDefer.js +2 -2
- package/dist/runtime/bindings/applyDefer.js.map +1 -1
- package/dist/runtime/bindings/applySimple.d.ts.map +1 -1
- package/dist/runtime/bindings/applySimple.js +10 -4
- package/dist/runtime/bindings/applySimple.js.map +1 -1
- package/dist/runtime/bindings/helpers.d.ts.map +1 -1
- package/dist/runtime/bindings/helpers.js +2 -1
- package/dist/runtime/bindings/helpers.js.map +1 -1
- package/dist/runtime/bindings/types.d.ts +2 -0
- package/dist/runtime/bindings/types.d.ts.map +1 -1
- package/dist/runtime/bindings/types.js.map +1 -1
- package/dist/types/globals.d.ts +1 -0
- package/dist/types/globals.d.ts.map +1 -1
- package/dist/types/globals.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applySimple.js","sourceRoot":"","sources":["../../../src/runtime/bindings/applySimple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACL,kBAAkB,EAClB,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAgB,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAczE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEzD,iFAAiF;AAEjF,MAAM,UAAU,QAAQ,CACtB,CAAU,EACV,EAAW,EACX,GA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F,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAE/D,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,EAAE;YACvB,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,+BAA+B;IACjC,CAAC;AACH,CAAC","sourcesContent":["import { effect, isSignal } from '@pithyjs/signals';\nimport { compileExpression } from '../../compile/compileExpression';\nimport {\n UNCOMPILED,\n writeBound,\n setStyleProp,\n styleWriter,\n} from '../../compile/binds/bindBoundAttributes';\nimport { toTextValue } from '../../compile/textValue';\nimport {\n classesEvalMessage,\n textEvalMessage,\n} from '../../compile/evalDiagnostics';\nimport { isSSRMode } from '../../compile/ssrMode';\nimport {\n registerBoundary,\n boundaryForElement,\n setBoundaryError,\n withSlotBoundary,\n} from '../../compile/binds/bindErrorBoundary';\nimport { applyClassGroup } from '../../compile/binds/bindClassDirectives';\nimport { mountProjection, type SlotMap } from '../../compile/contentProjection';\nimport { bindAfterProjection } from '../../compile/binds/bindAfterProjection';\nimport { forwardEventKey, nodeExpando } from '../../compile/nodeExpando';\nimport type {\n RefDesc,\n ErrorDesc,\n ProjDesc,\n BindDesc,\n InterpDesc,\n EventDesc,\n ClassDesc,\n ClassesDesc,\n StyleDesc,\n BoundDesc,\n BindingContext,\n} from './types';\nimport { nearestCtx, compileWithEvent } from './helpers';\n\n// ─── Individual binding handlers ──────────────────────────────────────────────\n\nexport function applyRef(\n d: RefDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n const ref = ctx[d.name] as\n | { set?: (value: Element | null) => void }\n | undefined;\n if (ref && typeof ref.set === 'function') {\n ref.set(el);\n disposers.push(() => ref.set!(null));\n }\n}\n\n/**\n * Sets `data-error` from the descriptor (source of truth), so `registerBoundary`\n * finds the signal name and a branch built before registration can `closest()`\n * the boundary, even if AOT codegen stops emitting the transitional attribute.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.apply-bindings\",\"name\":\"markBoundary\",\"stability\":\"internal\",\"signature\":\"(d: ErrorDesc, el: Element) => void\"} */\nexport function markBoundary(d: ErrorDesc, el: Element): void {\n if (d.expr && !el.getAttribute('data-error'))\n el.setAttribute('data-error', d.expr);\n}\n\nexport function applyError(\n d: ErrorDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n markBoundary(d, el);\n\n // Register el itself as an error boundary. We use registerBoundary (not\n // bindErrorBoundary) because bindErrorBoundary uses querySelectorAll which\n // only searches children — it would miss el itself.\n registerBoundary(el, ctx, disposers);\n}\n\nexport function applyProjection(\n d: ProjDesc,\n commentMap: Map<string, Comment>,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n const anchor = commentMap.get(`slot:${d.name}`);\n if (!anchor) return;\n\n const fallback = d.fallback;\n const anchorExpando = anchor as Comment & {\n __slotName?: string;\n __fallbackFactory?: (\n factoryCtx?: BindingContext\n ) => HTMLElement | DocumentFragment | undefined;\n };\n\n // Set expando properties that extractSlotDefs expects\n anchorExpando.__slotName = d.name;\n if (fallback) {\n anchorExpando.__fallbackFactory = (factoryCtx?: BindingContext) => {\n const result = fallback(factoryCtx || ctx);\n if (result && typeof result.destroy === 'function') {\n disposers.push(result.destroy);\n }\n return result?.el;\n };\n }\n\n // Check for SlotMap in context\n const slotMap = ('__slotMap' in ctx ? ctx.__slotMap : undefined) as\n | SlotMap\n | undefined;\n if (slotMap) {\n const slotDefs = [\n {\n name: d.name,\n anchor,\n fallbackFactory: anchorExpando.__fallbackFactory,\n },\n ];\n const render = slotMap.get(d.name);\n const bound: SlotMap = new Map();\n if (render)\n bound.set(d.name, (slotDisposers, at) => {\n const content = render(slotDisposers, at);\n const pageCtx = nodeExpando(content).__pithyCtx;\n // Runtime-built content: the page's own passes do not run on a remount.\n if (pageCtx)\n withSlotBoundary(at, ctx.__slotHost as Element | undefined, () =>\n bindAfterProjection(content, pageCtx, slotDisposers ?? disposers)\n );\n return content;\n });\n mountProjection(slotDefs, bound, disposers);\n } else if (fallback) {\n // No projected content — mount fallback\n const fallbackResult = fallback(ctx);\n const parent = anchor.parentNode;\n if (parent && fallbackResult?.el) {\n // Capture nodes for cleanup (fragment empties itself on insert)\n const nodes =\n fallbackResult.el instanceof DocumentFragment\n ? Array.from(fallbackResult.el.childNodes)\n : [fallbackResult.el];\n // Insert directly — fragment preserves child order; single node is trivial\n parent.insertBefore(fallbackResult.el, anchor.nextSibling);\n if (typeof fallbackResult.destroy === 'function') {\n disposers.push(fallbackResult.destroy);\n }\n disposers.push(() => {\n for (const node of nodes) {\n if (node.parentNode) node.parentNode.removeChild(node);\n }\n });\n }\n }\n}\n\nexport function applyBind(\n d: BindDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n if (!(el instanceof HTMLElement)) return;\n\n const sig = ctx[d.expr];\n if (!isSignal(sig) || typeof sig.set !== 'function') {\n if (import.meta.env?.DEV) {\n console.warn(`[AOT @bind] \"${d.expr}\" must refer to a writable signal`);\n }\n return;\n }\n const write = sig.set;\n\n const prop = inferBindableProperty(el);\n const target = el as HTMLElement & Record<string, unknown>;\n const stop = effect(() => {\n const value = sig();\n if (target[prop] !== value) target[prop] = value;\n });\n\n const event = prop === 'checked' ? 'change' : 'input';\n const handler = () => {\n write(extractBindableValue(el, prop));\n };\n el.addEventListener(event, handler);\n\n disposers.push(() => {\n el.removeEventListener(event, handler);\n stop();\n });\n}\n\nfunction inferBindableProperty(el: HTMLElement): string {\n const tag = el.tagName.toLowerCase();\n if (tag === 'input') {\n const type = (el as HTMLInputElement).type;\n if (type === 'checkbox' || type === 'radio') return 'checked';\n }\n return 'value';\n}\n\n/** Extract value from element with type coercion for number inputs. */\nfunction extractBindableValue(el: HTMLElement, prop: string): unknown {\n if (prop === 'checked') return (el as HTMLInputElement).checked;\n\n const tag = el.tagName.toLowerCase();\n if (tag === 'input') {\n const inputEl = el as HTMLInputElement;\n if (inputEl.type === 'number') {\n const numValue = Number(inputEl.value);\n return isNaN(numValue) ? inputEl.value : numValue;\n }\n return inputEl.value;\n }\n\n return (el as HTMLElement & Record<string, unknown>)[prop];\n}\n\n/**\n * Matches the skeleton's text exactly: the descriptor's own text and expressions.\n * A value can hold `{{` too, and text already bound can equal a later marker.\n */\nfunction holdsInterpolation(node: Text, parts: InterpDesc['parts']): boolean {\n if (!skeletonText.has(node)) return false;\n const text = node.nodeValue ?? '';\n let at = 0;\n for (const part of parts) {\n if ('s' in part) {\n if (!text.startsWith(part.s, at)) return false;\n at += part.s.length;\n continue;\n }\n if (!text.startsWith('{{', at)) return false;\n const end = text.indexOf('}}', at);\n if (end === -1 || text.slice(at + 2, end).trim() !== part.e) return false;\n at = end + 2;\n }\n return at === text.length;\n}\n\nconst skeletonText = new WeakSet<Text>();\n\n/** Record the skeleton's own `{{ }}` text, before components or bindings add any. */\nexport function markSkeletonText(fragment: DocumentFragment): void {\n const walker = document.createTreeWalker(fragment, NodeFilter.SHOW_TEXT);\n let node: Text | null;\n while ((node = walker.nextNode() as Text | null)) {\n if (node.nodeValue?.includes('{{')) skeletonText.add(node);\n }\n}\n\nexport function applyInterpolation(\n d: InterpDesc,\n el: Element | DocumentFragment,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n // Find text nodes within el that contain {{ }} markers\n const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT);\n let textNode: Text | null;\n const targets: Text[] = [];\n\n const rootLevel = d.pid === '';\n while ((textNode = walker.nextNode() as Text | null)) {\n if (!holdsInterpolation(textNode, d.parts)) continue;\n if (rootLevel && textNode.parentElement?.closest('[data-pid]')) continue;\n targets.push(textNode);\n break;\n }\n\n if (targets.length === 0 && import.meta.env?.DEV) {\n console.warn(\n `[AOT interp] No text node with {{ }} markers found ${rootLevel ? 'at the template root' : `in element pid=\"${d.pid}\"`}`\n );\n }\n\n // Process each target text node matching this interpolation descriptor\n for (const node of targets) {\n const localCtx = nearestCtx(node, ctx);\n const parent = node.parentNode;\n if (!parent) continue;\n\n const nextSibling = node.nextSibling;\n parent.removeChild(node);\n\n for (const part of d.parts) {\n if ('s' in part) {\n // Static text\n parent.insertBefore(document.createTextNode(part.s), nextSibling);\n } else {\n // Dynamic expression\n const expr = part.e;\n const startComment = document.createComment('t');\n const dynText = document.createTextNode('');\n const endComment = document.createComment('/t');\n\n parent.insertBefore(startComment, nextSibling);\n parent.insertBefore(dynText, nextSibling);\n parent.insertBefore(endComment, nextSibling);\n\n try {\n const compiledFn = compileExpression(expr, localCtx);\n\n if (isSSRMode()) {\n try {\n dynText.nodeValue = toTextValue(compiledFn());\n } catch (err) {\n if (import.meta.env?.DEV)\n console.error(textEvalMessage(expr), err);\n dynText.nodeValue = '';\n }\n } else {\n let lastValue: string | undefined;\n const stop = effect(() => {\n try {\n const next = toTextValue(compiledFn());\n if (next !== lastValue) {\n dynText.nodeValue = next;\n lastValue = next;\n }\n } catch (err) {\n if (import.meta.env?.DEV)\n console.error(textEvalMessage(expr), err);\n dynText.nodeValue = '';\n lastValue = '';\n }\n });\n disposers.push(stop);\n }\n } catch {\n dynText.nodeValue = '';\n }\n }\n }\n\n // Only process the first matching text node per interpolation descriptor\n break;\n }\n}\n\n/** Per-element, per-event idempotency guard (mirrors JIT's BOUND_KEY symbol). */\nconst AOT_BOUND_KEY: unique symbol = Symbol('pithy:aot-bound');\n\nfunction getAotBoundSet(el: Element, eventName: string): Set<string> {\n const host = el as Element & {\n [AOT_BOUND_KEY]?: Record<string, Set<string>>;\n };\n const store =\n host[AOT_BOUND_KEY] ??\n (host[AOT_BOUND_KEY] = Object.create(null) as Record<string, Set<string>>);\n return (store[eventName] ??= new Set<string>());\n}\n\nexport function applyEvent(\n d: EventDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n // Idempotency: skip if this exact event+expr combo was already bound\n const boundSet = getAotBoundSet(el, d.event);\n const key = `${d.event}${d.mods ? '.' + d.mods.join('.') : ''}=${d.expr}`;\n const fwdCtx = nodeExpando(el).__pithyForwardCtx;\n // A root is marked only after the child bound its own events.\n const boundKey = fwdCtx ? forwardEventKey(el, key) : key;\n if (boundSet.has(boundKey)) return;\n\n const localCtx = fwdCtx ?? nearestCtx(el, ctx);\n const mods = parseMods(d.mods);\n const handlerExpr = d.expr;\n\n const isSimpleIdentifier = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(handlerExpr);\n const directFn =\n isSimpleIdentifier && typeof localCtx[handlerExpr] === 'function'\n ? (localCtx[handlerExpr] as EventListener)\n : null;\n const runWithEvt = directFn ? null : compileWithEvent(handlerExpr, localCtx);\n\n const listener: EventListener = (ev: Event) => {\n if (mods.self && ev.target !== el) return;\n if (mods.prevent) ev.preventDefault();\n if (mods.stop) ev.stopPropagation();\n\n try {\n if (directFn) {\n return directFn.call(localCtx, ev);\n } else if (runWithEvt) {\n const out = runWithEvt(ev, el);\n if (typeof out === 'function')\n return (out as (e: Event) => unknown).call(localCtx, ev);\n return out;\n }\n } catch (error) {\n const boundaryEl = el.closest('[data-error]') as Element | null;\n const boundary = boundaryForElement(boundaryEl);\n if (boundary) {\n setBoundaryError(\n boundary,\n error instanceof Error ? error : new Error(String(error))\n );\n } else {\n throw error;\n }\n }\n };\n\n const options: AddEventListenerOptions = {\n capture: !!mods.capture,\n passive: !!mods.passive,\n once: !!mods.once,\n };\n\n el.addEventListener(d.event, listener, options);\n boundSet.add(boundKey);\n disposers.push(() => {\n el.removeEventListener(d.event, listener, { capture: !!mods.capture });\n boundSet.delete(boundKey);\n });\n}\n\nfunction parseMods(mods?: string[]): {\n once?: boolean;\n prevent?: boolean;\n stop?: boolean;\n self?: boolean;\n capture?: boolean;\n passive?: boolean;\n} {\n if (!mods) return {};\n const m: Record<string, boolean> = {};\n for (const mod of mods) m[mod] = true;\n return m;\n}\n\nexport function applyClass(\n d: ClassDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n const localCtx = nodeExpando(el).__pithyForwardCtx ?? nearestCtx(el, ctx);\n try {\n const evaluate = compileExpression(d.expr, localCtx);\n const stop = effect(() => {\n try {\n el.classList.toggle(d.name, !!evaluate());\n } catch {\n /* ignore */\n }\n });\n disposers.push(stop);\n } catch {\n /* ignore */\n }\n}\n\nexport function applyClasses(\n d: ClassesDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n const localCtx = nodeExpando(el).__pithyForwardCtx ?? nearestCtx(el, ctx);\n try {\n const evaluate = compileExpression(d.expr, localCtx);\n const owned = new Set<string>();\n const stop = effect(() => {\n try {\n applyClassGroup(el, evaluate(), owned);\n } catch (err) {\n if (import.meta.env?.DEV) console.warn(classesEvalMessage, err);\n }\n });\n disposers.push(stop);\n } catch {\n /* ignore */\n }\n}\n\n/** Convert camelCase to kebab-case for CSS property names. */\nfunction toKebabCase(prop: string): string {\n return prop.replace(/[A-Z]/g, m => `-${m.toLowerCase()}`);\n}\n\nexport function applyStyle(\n d: StyleDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n // Not `instanceof HTMLElement`: SVG elements have inline styles too.\n const style = (el as Partial<ElementCSSInlineStyle>).style;\n if (!style) return;\n const localCtx = nodeExpando(el).__pithyForwardCtx ?? nearestCtx(el, ctx);\n // setProperty requires kebab-case; codegen may emit camelCase (e.g. fontSize)\n const cssProp = d.prop.includes('-') ? d.prop : toKebabCase(d.prop);\n try {\n const evaluate = compileExpression(d.expr, localCtx);\n const stop = effect(() => {\n try {\n const value = evaluate();\n if (value == null || value === false) {\n setStyleProp(el, cssProp, null);\n return;\n }\n const text = String(value);\n const important = /\\s*!important\\s*$/i.exec(text);\n if (important) {\n setStyleProp(\n el,\n cssProp,\n text.slice(0, important.index),\n 'important'\n );\n } else {\n setStyleProp(el, cssProp, text);\n }\n } catch {\n /* ignore */\n }\n });\n disposers.push(stop);\n } catch {\n /* ignore */\n }\n}\n\nexport function applyBound(\n d: BoundDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n const localCtx = nodeExpando(el).__pithyForwardCtx ?? nearestCtx(el, ctx);\n // Compile once outside effect via compileExpression (consistent with applyClass/applyStyle).\n try {\n const evaluate = compileExpression<unknown>(d.expr, localCtx, UNCOMPILED);\n const read = () => {\n const value = evaluate();\n if (value !== UNCOMPILED) return value;\n throw d.expr.trim() ? UNCOMPILED : new SyntaxError('Empty expression');\n };\n const writeStyle = d.attr === 'style' ? styleWriter(el) : null;\n\n const stop = effect(() => {\n writeBound(el, d.attr, d.expr, writeStyle, read);\n });\n disposers.push(stop);\n } catch {\n /* ignore invalid expression */\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"applySimple.js","sourceRoot":"","sources":["../../../src/runtime/bindings/applySimple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACL,kBAAkB,EAClB,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,iBAAiB,GAElB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB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AC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,YAAY;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,CAAY,EACZ,EAAW,EACX,GAAmB,EACnB,SAAyB;IAEzB,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,iBAAiB,IAAI,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC1E,6FAA6F;IAC7F,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,iBAAiB,CAAU,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC1E,MAAM,IAAI,GAAG,GAAG,EAAE;YAChB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;YACzB,IAAI,KAAK,KAAK,UAAU;gBAAE,OAAO,KAAK,CAAC;YACvC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,kBAAkB,CAAC,CAAC;QACzE,CAAC,CAAC;QACF,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAE/D,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,EAAE;YACvB,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,+BAA+B;IACjC,CAAC;AACH,CAAC","sourcesContent":["import { effect, isSignal } from '@pithyjs/signals';\nimport { compileExpression } from '../../compile/compileExpression';\nimport {\n UNCOMPILED,\n writeBound,\n setStyleProp,\n styleWriter,\n} from '../../compile/binds/bindBoundAttributes';\nimport { toTextValue } from '../../compile/textValue';\nimport {\n classesEvalMessage,\n textEvalMessage,\n} from '../../compile/evalDiagnostics';\nimport { isSSRMode } from '../../compile/ssrMode';\nimport {\n registerBoundary,\n boundaryForElement,\n setBoundaryError,\n withSlotBoundary,\n} from '../../compile/binds/bindErrorBoundary';\nimport { applyClassGroup } from '../../compile/binds/bindClassDirectives';\nimport {\n mountProjection,\n warnDuplicateSlot,\n type SlotMap,\n} from '../../compile/contentProjection';\nimport { bindAfterProjection } from '../../compile/binds/bindAfterProjection';\nimport { forwardEventKey, nodeExpando } from '../../compile/nodeExpando';\nimport type {\n RefDesc,\n ErrorDesc,\n ProjDesc,\n BindDesc,\n InterpDesc,\n EventDesc,\n ClassDesc,\n ClassesDesc,\n StyleDesc,\n BoundDesc,\n BindingContext,\n} from './types';\nimport { nearestCtx, compileWithEvent } from './helpers';\n\n// ─── Individual binding handlers ──────────────────────────────────────────────\n\nexport function applyRef(\n d: RefDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n const ref = ctx[d.name] as\n | { set?: (value: Element | null) => void }\n | undefined;\n if (ref && typeof ref.set === 'function') {\n ref.set(el);\n disposers.push(() => ref.set!(null));\n }\n}\n\n/**\n * Sets `data-error` from the descriptor (source of truth), so `registerBoundary`\n * finds the signal name and a branch built before registration can `closest()`\n * the boundary, even if AOT codegen stops emitting the transitional attribute.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.apply-bindings\",\"name\":\"markBoundary\",\"stability\":\"internal\",\"signature\":\"(d: ErrorDesc, el: Element) => void\"} */\nexport function markBoundary(d: ErrorDesc, el: Element): void {\n if (d.expr && !el.getAttribute('data-error'))\n el.setAttribute('data-error', d.expr);\n}\n\nexport function applyError(\n d: ErrorDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n markBoundary(d, el);\n\n // Register el itself as an error boundary. We use registerBoundary (not\n // bindErrorBoundary) because bindErrorBoundary uses querySelectorAll which\n // only searches children — it would miss el itself.\n registerBoundary(el, ctx, disposers);\n}\n\n/** Each slot anchor takes one descriptor, so none mounts at another's place. */\nconst claimedAnchors = new WeakSet<Comment>();\n\nexport function applyProjection(\n d: ProjDesc,\n commentMap: Map<string, Comment>,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n const anchor = commentMap.get(d.dup ? `slot-dup:${d.pid}` : `slot:${d.name}`);\n if (!anchor || claimedAnchors.has(anchor)) return;\n claimedAnchors.add(anchor);\n\n const fallback = d.fallback;\n const anchorExpando = anchor as Comment & {\n __slotName?: string;\n __fallbackFactory?: (\n factoryCtx?: BindingContext\n ) => HTMLElement | DocumentFragment | undefined;\n };\n\n // Set expando properties that extractSlotDefs expects\n anchorExpando.__slotName = d.name;\n if (fallback) {\n anchorExpando.__fallbackFactory = (factoryCtx?: BindingContext) => {\n const result = fallback(factoryCtx || ctx);\n if (result && typeof result.destroy === 'function') {\n disposers.push(result.destroy);\n }\n return result?.el;\n };\n }\n\n // Check for SlotMap in context\n const slotMap = ('__slotMap' in ctx ? ctx.__slotMap : undefined) as\n | SlotMap\n | undefined;\n if (d.dup && import.meta.env?.DEV)\n warnDuplicateSlot(slotMap, d.name, commentMap);\n if (slotMap) {\n const slotDefs = [\n {\n name: d.name,\n anchor,\n fallbackFactory: anchorExpando.__fallbackFactory,\n },\n ];\n // A later slot of a name mounts only its fallback, still through the boundary.\n const render = d.dup ? undefined : slotMap.get(d.name);\n const bound: SlotMap = new Map();\n if (render)\n bound.set(d.name, (slotDisposers, at) => {\n const content = render(slotDisposers, at);\n const pageCtx = nodeExpando(content).__pithyCtx;\n // Runtime-built content: the page's own passes do not run on a remount.\n if (pageCtx)\n withSlotBoundary(at, ctx.__slotHost as Element | undefined, () =>\n bindAfterProjection(content, pageCtx, slotDisposers ?? disposers)\n );\n return content;\n });\n mountProjection(slotDefs, bound, disposers);\n } else if (fallback) {\n // No projected content — mount fallback\n const fallbackResult = fallback(ctx);\n const parent = anchor.parentNode;\n if (parent && fallbackResult?.el) {\n // Capture nodes for cleanup (fragment empties itself on insert)\n const nodes =\n fallbackResult.el instanceof DocumentFragment\n ? Array.from(fallbackResult.el.childNodes)\n : [fallbackResult.el];\n // Insert directly — fragment preserves child order; single node is trivial\n parent.insertBefore(fallbackResult.el, anchor.nextSibling);\n if (typeof fallbackResult.destroy === 'function') {\n disposers.push(fallbackResult.destroy);\n }\n disposers.push(() => {\n for (const node of nodes) {\n if (node.parentNode) node.parentNode.removeChild(node);\n }\n });\n }\n }\n}\n\nexport function applyBind(\n d: BindDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n if (!(el instanceof HTMLElement)) return;\n\n const sig = ctx[d.expr];\n if (!isSignal(sig) || typeof sig.set !== 'function') {\n if (import.meta.env?.DEV) {\n console.warn(`[AOT @bind] \"${d.expr}\" must refer to a writable signal`);\n }\n return;\n }\n const write = sig.set;\n\n const prop = inferBindableProperty(el);\n const target = el as HTMLElement & Record<string, unknown>;\n const stop = effect(() => {\n const value = sig();\n if (target[prop] !== value) target[prop] = value;\n });\n\n const event = prop === 'checked' ? 'change' : 'input';\n const handler = () => {\n write(extractBindableValue(el, prop));\n };\n el.addEventListener(event, handler);\n\n disposers.push(() => {\n el.removeEventListener(event, handler);\n stop();\n });\n}\n\nfunction inferBindableProperty(el: HTMLElement): string {\n const tag = el.tagName.toLowerCase();\n if (tag === 'input') {\n const type = (el as HTMLInputElement).type;\n if (type === 'checkbox' || type === 'radio') return 'checked';\n }\n return 'value';\n}\n\n/** Extract value from element with type coercion for number inputs. */\nfunction extractBindableValue(el: HTMLElement, prop: string): unknown {\n if (prop === 'checked') return (el as HTMLInputElement).checked;\n\n const tag = el.tagName.toLowerCase();\n if (tag === 'input') {\n const inputEl = el as HTMLInputElement;\n if (inputEl.type === 'number') {\n const numValue = Number(inputEl.value);\n return isNaN(numValue) ? inputEl.value : numValue;\n }\n return inputEl.value;\n }\n\n return (el as HTMLElement & Record<string, unknown>)[prop];\n}\n\n/**\n * Matches the skeleton's text exactly: the descriptor's own text and expressions.\n * A value can hold `{{` too, and text already bound can equal a later marker.\n */\nfunction holdsInterpolation(node: Text, parts: InterpDesc['parts']): boolean {\n if (!skeletonText.has(node)) return false;\n const text = node.nodeValue ?? '';\n let at = 0;\n for (const part of parts) {\n if ('s' in part) {\n if (!text.startsWith(part.s, at)) return false;\n at += part.s.length;\n continue;\n }\n if (!text.startsWith('{{', at)) return false;\n const end = text.indexOf('}}', at);\n if (end === -1 || text.slice(at + 2, end).trim() !== part.e) return false;\n at = end + 2;\n }\n return at === text.length;\n}\n\nconst skeletonText = new WeakSet<Text>();\n\n/** Record the skeleton's own `{{ }}` text, before components or bindings add any. */\nexport function markSkeletonText(fragment: DocumentFragment): void {\n const walker = document.createTreeWalker(fragment, NodeFilter.SHOW_TEXT);\n let node: Text | null;\n while ((node = walker.nextNode() as Text | null)) {\n if (node.nodeValue?.includes('{{')) skeletonText.add(node);\n }\n}\n\nexport function applyInterpolation(\n d: InterpDesc,\n el: Element | DocumentFragment,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n // Find text nodes within el that contain {{ }} markers\n const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT);\n let textNode: Text | null;\n const targets: Text[] = [];\n\n const rootLevel = d.pid === '';\n while ((textNode = walker.nextNode() as Text | null)) {\n if (!holdsInterpolation(textNode, d.parts)) continue;\n if (rootLevel && textNode.parentElement?.closest('[data-pid]')) continue;\n targets.push(textNode);\n break;\n }\n\n if (targets.length === 0 && import.meta.env?.DEV) {\n console.warn(\n `[AOT interp] No text node with {{ }} markers found ${rootLevel ? 'at the template root' : `in element pid=\"${d.pid}\"`}`\n );\n }\n\n // Process each target text node matching this interpolation descriptor\n for (const node of targets) {\n const localCtx = nearestCtx(node, ctx);\n const parent = node.parentNode;\n if (!parent) continue;\n\n const nextSibling = node.nextSibling;\n parent.removeChild(node);\n\n for (const part of d.parts) {\n if ('s' in part) {\n // Static text\n parent.insertBefore(document.createTextNode(part.s), nextSibling);\n } else {\n // Dynamic expression\n const expr = part.e;\n const startComment = document.createComment('t');\n const dynText = document.createTextNode('');\n const endComment = document.createComment('/t');\n\n parent.insertBefore(startComment, nextSibling);\n parent.insertBefore(dynText, nextSibling);\n parent.insertBefore(endComment, nextSibling);\n\n try {\n const compiledFn = compileExpression(expr, localCtx);\n\n if (isSSRMode()) {\n try {\n dynText.nodeValue = toTextValue(compiledFn());\n } catch (err) {\n if (import.meta.env?.DEV)\n console.error(textEvalMessage(expr), err);\n dynText.nodeValue = '';\n }\n } else {\n let lastValue: string | undefined;\n const stop = effect(() => {\n try {\n const next = toTextValue(compiledFn());\n if (next !== lastValue) {\n dynText.nodeValue = next;\n lastValue = next;\n }\n } catch (err) {\n if (import.meta.env?.DEV)\n console.error(textEvalMessage(expr), err);\n dynText.nodeValue = '';\n lastValue = '';\n }\n });\n disposers.push(stop);\n }\n } catch {\n dynText.nodeValue = '';\n }\n }\n }\n\n // Only process the first matching text node per interpolation descriptor\n break;\n }\n}\n\n/** Per-element, per-event idempotency guard (mirrors JIT's BOUND_KEY symbol). */\nconst AOT_BOUND_KEY: unique symbol = Symbol('pithy:aot-bound');\n\nfunction getAotBoundSet(el: Element, eventName: string): Set<string> {\n const host = el as Element & {\n [AOT_BOUND_KEY]?: Record<string, Set<string>>;\n };\n const store =\n host[AOT_BOUND_KEY] ??\n (host[AOT_BOUND_KEY] = Object.create(null) as Record<string, Set<string>>);\n return (store[eventName] ??= new Set<string>());\n}\n\nexport function applyEvent(\n d: EventDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n // Idempotency: skip if this exact event+expr combo was already bound\n const boundSet = getAotBoundSet(el, d.event);\n const key = `${d.event}${d.mods ? '.' + d.mods.join('.') : ''}=${d.expr}`;\n const fwdCtx = nodeExpando(el).__pithyForwardCtx;\n // A root is marked only after the child bound its own events.\n const boundKey = fwdCtx ? forwardEventKey(el, key) : key;\n if (boundSet.has(boundKey)) return;\n\n const localCtx = fwdCtx ?? nearestCtx(el, ctx);\n const mods = parseMods(d.mods);\n const handlerExpr = d.expr;\n\n const isSimpleIdentifier = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(handlerExpr);\n const directFn =\n isSimpleIdentifier && typeof localCtx[handlerExpr] === 'function'\n ? (localCtx[handlerExpr] as EventListener)\n : null;\n const runWithEvt = directFn ? null : compileWithEvent(handlerExpr, localCtx);\n\n const listener: EventListener = (ev: Event) => {\n if (mods.self && ev.target !== el) return;\n if (mods.prevent) ev.preventDefault();\n if (mods.stop) ev.stopPropagation();\n\n try {\n if (directFn) {\n return directFn.call(localCtx, ev);\n } else if (runWithEvt) {\n const out = runWithEvt(ev, el);\n if (typeof out === 'function')\n return (out as (e: Event) => unknown).call(localCtx, ev);\n return out;\n }\n } catch (error) {\n const boundaryEl = el.closest('[data-error]') as Element | null;\n const boundary = boundaryForElement(boundaryEl);\n if (boundary) {\n setBoundaryError(\n boundary,\n error instanceof Error ? error : new Error(String(error))\n );\n } else {\n throw error;\n }\n }\n };\n\n const options: AddEventListenerOptions = {\n capture: !!mods.capture,\n passive: !!mods.passive,\n once: !!mods.once,\n };\n\n el.addEventListener(d.event, listener, options);\n boundSet.add(boundKey);\n disposers.push(() => {\n el.removeEventListener(d.event, listener, { capture: !!mods.capture });\n boundSet.delete(boundKey);\n });\n}\n\nfunction parseMods(mods?: string[]): {\n once?: boolean;\n prevent?: boolean;\n stop?: boolean;\n self?: boolean;\n capture?: boolean;\n passive?: boolean;\n} {\n if (!mods) return {};\n const m: Record<string, boolean> = {};\n for (const mod of mods) m[mod] = true;\n return m;\n}\n\nexport function applyClass(\n d: ClassDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n const localCtx = nodeExpando(el).__pithyForwardCtx ?? nearestCtx(el, ctx);\n try {\n const evaluate = compileExpression(d.expr, localCtx);\n const stop = effect(() => {\n try {\n el.classList.toggle(d.name, !!evaluate());\n } catch {\n /* ignore */\n }\n });\n disposers.push(stop);\n } catch {\n /* ignore */\n }\n}\n\nexport function applyClasses(\n d: ClassesDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n const localCtx = nodeExpando(el).__pithyForwardCtx ?? nearestCtx(el, ctx);\n try {\n const evaluate = compileExpression(d.expr, localCtx);\n const owned = new Set<string>();\n const stop = effect(() => {\n try {\n applyClassGroup(el, evaluate(), owned);\n } catch (err) {\n if (import.meta.env?.DEV) console.warn(classesEvalMessage, err);\n }\n });\n disposers.push(stop);\n } catch {\n /* ignore */\n }\n}\n\n/** Convert camelCase to kebab-case for CSS property names. */\nfunction toKebabCase(prop: string): string {\n return prop.replace(/[A-Z]/g, m => `-${m.toLowerCase()}`);\n}\n\nexport function applyStyle(\n d: StyleDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n // Not `instanceof HTMLElement`: SVG elements have inline styles too.\n const style = (el as Partial<ElementCSSInlineStyle>).style;\n if (!style) return;\n const localCtx = nodeExpando(el).__pithyForwardCtx ?? nearestCtx(el, ctx);\n // setProperty requires kebab-case; codegen may emit camelCase (e.g. fontSize)\n const cssProp = d.prop.includes('-') ? d.prop : toKebabCase(d.prop);\n try {\n const evaluate = compileExpression(d.expr, localCtx);\n const stop = effect(() => {\n try {\n const value = evaluate();\n if (value == null || value === false) {\n setStyleProp(el, cssProp, null);\n return;\n }\n const text = String(value);\n const important = /\\s*!important\\s*$/i.exec(text);\n if (important) {\n setStyleProp(\n el,\n cssProp,\n text.slice(0, important.index),\n 'important'\n );\n } else {\n setStyleProp(el, cssProp, text);\n }\n } catch {\n /* ignore */\n }\n });\n disposers.push(stop);\n } catch {\n /* ignore */\n }\n}\n\nexport function applyBound(\n d: BoundDesc,\n el: Element,\n ctx: BindingContext,\n disposers: (() => void)[]\n): void {\n const localCtx = nodeExpando(el).__pithyForwardCtx ?? nearestCtx(el, ctx);\n // Compile once outside effect via compileExpression (consistent with applyClass/applyStyle).\n try {\n const evaluate = compileExpression<unknown>(d.expr, localCtx, UNCOMPILED);\n const read = () => {\n const value = evaluate();\n if (value !== UNCOMPILED) return value;\n throw d.expr.trim() ? UNCOMPILED : new SyntaxError('Empty expression');\n };\n const writeStyle = d.attr === 'style' ? styleWriter(el) : null;\n\n const stop = effect(() => {\n writeBound(el, d.attr, d.expr, writeStyle, read);\n });\n disposers.push(stop);\n } catch {\n /* ignore invalid expression */\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/runtime/bindings/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK9C;;;;GAIG;AACH,0KAA0K;AAC1K,wBAAgB,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAS5E;AAED;;;;GAIG;AACH,8KAA8K;AAC9K,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,gBAAgB,GACzB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/runtime/bindings/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK9C;;;;GAIG;AACH,0KAA0K;AAC1K,wBAAgB,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAS5E;AAED;;;;GAIG;AACH,8KAA8K;AAC9K,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,gBAAgB,GACzB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CActB;AAED;;;;;;GAMG;AACH,0KAA0K;AAC1K,wBAAgB,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,GAAG,cAAc,CAe5E;AAED;;;;GAIG;AACH,mLAAmL;AACnL,wBAAgB,UAAU,CACxB,GAAG,OAAO,EAAE,CAAC,cAAc,GAAG,SAAS,CAAC,EAAE,GACzC,cAAc,CA2BhB;AAED;;;;;GAKG;AACH,mKAAmK;AACnK,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CA0BrE;AAED;;;;;GAKG;AACH,qMAAqM;AACrM,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,cAAc,GAClB,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,KAAK,OAAO,CAgBrC"}
|
|
@@ -38,7 +38,8 @@ export function buildCommentMap(fragment) {
|
|
|
38
38
|
const text = node.textContent ?? '';
|
|
39
39
|
// Structural anchors: "if:pid", "for:pid", "slot:name"
|
|
40
40
|
const colonIdx = text.indexOf(':');
|
|
41
|
-
|
|
41
|
+
// The first of two same-named slots is the one that receives content.
|
|
42
|
+
if (colonIdx > 0 && !map.has(text)) {
|
|
42
43
|
map.set(text, node);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/runtime/bindings/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAYF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,iFAAiF;AAEjF;;;;GAIG;AACH,0KAA0K;AAC1K,MAAM,UAAU,WAAW,CAAC,QAA0B;IACpD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAmB,CAAC;IACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAC5E,IAAI,IAAoB,CAAC;IACzB,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAoB,CAAC,EAAE,CAAC;QACpD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C,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,sCAAsC,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,CAAC,GAAU,EAAE,GAAY,EAAE,EAAE,CAAC,SAAS,CAAC;IACjD,CAAC;AACH,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.runtime.binding-helpers\",\n \"title\": \"AOT Binding Helpers\",\n \"category\": \"runtime\"\n}\n*/\n\n/**\n * Shared helper utilities for AOT binding application.\n *\n * Provides DOM lookup maps, context merging, and expression compilation\n * used by both the JIT path (`html.ts`) and the AOT path (`applyBindings.ts`).\n *\n * @module runtime/bindings/helpers\n */\n\nimport type { BindingContext } from './types';\nimport { pithyGlobals } from '../../types/globals';\n\n// ─── Helpers ──────────────────────────────────────────────────────────────────\n\n/**\n * Build a map of pid → Element from data-pid attributes in the fragment.\n * @param fragment - The DOM fragment to scan\n * @returns Map from pid string to the corresponding Element\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"buildPidMap\",\"stability\":\"internal\",\"signature\":\"(fragment: DocumentFragment) => Map<string, Element>\"} */\nexport function buildPidMap(fragment: DocumentFragment): Map<string, Element> {\n const map = new Map<string, Element>();\n const walker = document.createTreeWalker(fragment, NodeFilter.SHOW_ELEMENT);\n let node: Element | null;\n while ((node = walker.nextNode() as Element | null)) {\n const pid = node.getAttribute('data-pid');\n if (pid) map.set(pid, node);\n }\n return map;\n}\n\n/**\n * Build a map of comment anchor id → Comment for structural directives.\n * @param fragment - The DOM fragment to scan\n * @returns Map from comment text (e.g. \"if:r0\") to the Comment node\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"buildCommentMap\",\"stability\":\"internal\",\"signature\":\"(fragment: DocumentFragment) => Map<string, Comment>\"} */\nexport function buildCommentMap(\n fragment: DocumentFragment\n): Map<string, Comment> {\n const map = new Map<string, Comment>();\n const walker = document.createTreeWalker(fragment, NodeFilter.SHOW_COMMENT);\n let node: Comment | null;\n while ((node = walker.nextNode() as Comment | null)) {\n const text = node.textContent ?? '';\n // Structural anchors: \"if:pid\", \"for:pid\", \"slot:name\"\n const colonIdx = text.indexOf(':');\n if (colonIdx > 0) {\n map.set(text, node);\n }\n }\n return map;\n}\n\n/**\n * Walk up the DOM to find the nearest local PithyJS context.\n * Falls back to the provided root context.\n * @param el - Starting DOM node\n * @param rootCtx - Fallback context if no local context is found\n * @returns The nearest context object\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"nearestCtx\",\"stability\":\"internal\",\"signature\":\"(el: Node, rootCtx: BindingContext) => BindingContext\"} */\nexport function nearestCtx(el: Node, rootCtx: BindingContext): BindingContext {\n // Walk parentNode (not parentElement) so context is found on Text/Comment\n // nodes — needed when JIT-projected content is slotted into AOT components.\n // NOTE: In @for loops, only Element nodes receive loop-item __pithyCtx\n // (see applyStructural.ts / createLoopManager.ts). Text nodes inside loop\n // items inherit context from their parent Element, which works correctly\n // because AOT text nodes don't have __pithyCtx set (factories use raw\n // createTextNode), and JIT text nodes are children of tagged Elements.\n let n: Node | null = el;\n while (n) {\n const local = (n as Node & { __pithyCtx?: BindingContext }).__pithyCtx;\n if (local) return local;\n n = n.parentNode;\n }\n return rootCtx;\n}\n\n/**\n * `{ ...a, ...b }` that copies a getter as a getter: a spread reads it once\n * and stores the value, so the template would never see it change. Every\n * read goes through the source, so `this` and a Proxy's `get` trap apply.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"spreadLive\",\"stability\":\"internal\",\"signature\":\"(...sources: (BindingContext | undefined)[]) => BindingContext\"} */\nexport function spreadLive(\n ...sources: (BindingContext | undefined)[]\n): BindingContext {\n const out: BindingContext = {};\n for (const source of sources) {\n if (!source) continue;\n for (const key of Reflect.ownKeys(source)) {\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!desc?.enumerable) continue;\n Object.defineProperty(\n out,\n key,\n 'value' in desc\n ? {\n value: Reflect.get(source, key),\n writable: true,\n enumerable: true,\n configurable: true,\n }\n : {\n get: () => Reflect.get(source, key),\n set: desc.set && ((v: unknown) => Reflect.set(source, key, v)),\n enumerable: true,\n configurable: true,\n }\n );\n }\n }\n return out;\n}\n\n/**\n * Merge parent component and async (SSR) contexts into the explicit context.\n * Single source of truth used by both `html.ts` and `applyBindings.ts`.\n * @param context - The explicit context from the call site\n * @returns Merged context with parent component and async contexts\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"mergeContexts\",\"stability\":\"internal\",\"signature\":\"(context: BindingContext) => BindingContext\"} */\nexport function mergeContexts(context: BindingContext): BindingContext {\n const g = pithyGlobals();\n const getContextFn = g.__getComponentContext;\n const asyncContext =\n typeof getContextFn === 'function' ? getContextFn() : undefined;\n const parentComponentContext = g.__pithyComponentContext;\n\n let parentData: BindingContext | undefined;\n if (parentComponentContext && typeof parentComponentContext === 'object') {\n parentData = {};\n for (const key of Object.keys(parentComponentContext)) {\n if (key === '__pithyRowLocals') continue;\n if (\n key.startsWith('__') ||\n typeof parentComponentContext[key] === 'function'\n ) {\n parentData[key] = parentComponentContext[key];\n }\n }\n if (Object.keys(parentData).length === 0) parentData = undefined;\n }\n\n if (asyncContext || parentData) {\n return spreadLive(parentData, asyncContext, context);\n }\n return context;\n}\n\n/**\n * Compile expression with $event and $el support for event handlers.\n * @param expr - The expression string to compile\n * @param ctx - The reactive context for variable resolution\n * @returns A function that accepts (event, element) and evaluates the expression\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"compileWithEvent\",\"stability\":\"internal\",\"signature\":\"(expr: string, ctx: BindingContext) => (ev: Event, el: Element) => unknown\"} */\nexport function compileWithEvent(\n expr: string,\n ctx: BindingContext\n): (ev: Event, el: Element) => unknown {\n try {\n // eslint-disable-next-line no-new-func -- JIT event-handler expression evaluation is a core framework feature\n const fn = new Function(\n 'ctx',\n '$event',\n '$el',\n `with (ctx) { return (${expr}); }`\n ) as (ctx: BindingContext, ev: Event, el: Element) => unknown;\n return (ev: Event, el: Element) => fn(ctx, ev, el);\n } catch (err) {\n if (import.meta.env?.DEV) {\n console.warn(`[AOT bindEvent] Failed to compile \"${expr}\"`, err);\n }\n return (_ev: Event, _el: Element) => undefined;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/runtime/bindings/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAYF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,iFAAiF;AAEjF;;;;GAIG;AACH,0KAA0K;AAC1K,MAAM,UAAU,WAAW,CAAC,QAA0B;IACpD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAmB,CAAC;IACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAC5E,IAAI,IAAoB,CAAC;IACzB,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAoB,CAAC,EAAE,CAAC;QACpD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,GAAG;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,8KAA8K;AAC9K,MAAM,UAAU,eAAe,CAC7B,QAA0B;IAE1B,MAAM,GAAG,GAAG,IAAI,GAAG,EAAmB,CAAC;IACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAC5E,IAAI,IAAoB,CAAC;IACzB,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAoB,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,I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ACjD,CAAC;gBACD,UAAU,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,UAAU,GAAG,SAAS,CAAC;IACnE,CAAC;IAED,IAAI,YAAY,IAAI,UAAU,EAAE,CAAC;QAC/B,OAAO,UAAU,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,qMAAqM;AACrM,MAAM,UAAU,gBAAgB,CAC9B,IAAY,EACZ,GAAmB;IAEnB,IAAI,CAAC;QACH,8GAA8G;QAC9G,MAAM,EAAE,GAAG,IAAI,QAAQ,CACrB,KAAK,EACL,QAAQ,EACR,KAAK,EACL,wBAAwB,IAAI,MAAM,CACyB,CAAC;QAC9D,OAAO,CAAC,EAAS,EAAE,EAAW,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,sCAAsC,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,CAAC,GAAU,EAAE,GAAY,EAAE,EAAE,CAAC,SAAS,CAAC;IACjD,CAAC;AACH,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.runtime.binding-helpers\",\n \"title\": \"AOT Binding Helpers\",\n \"category\": \"runtime\"\n}\n*/\n\n/**\n * Shared helper utilities for AOT binding application.\n *\n * Provides DOM lookup maps, context merging, and expression compilation\n * used by both the JIT path (`html.ts`) and the AOT path (`applyBindings.ts`).\n *\n * @module runtime/bindings/helpers\n */\n\nimport type { BindingContext } from './types';\nimport { pithyGlobals } from '../../types/globals';\n\n// ─── Helpers ──────────────────────────────────────────────────────────────────\n\n/**\n * Build a map of pid → Element from data-pid attributes in the fragment.\n * @param fragment - The DOM fragment to scan\n * @returns Map from pid string to the corresponding Element\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"buildPidMap\",\"stability\":\"internal\",\"signature\":\"(fragment: DocumentFragment) => Map<string, Element>\"} */\nexport function buildPidMap(fragment: DocumentFragment): Map<string, Element> {\n const map = new Map<string, Element>();\n const walker = document.createTreeWalker(fragment, NodeFilter.SHOW_ELEMENT);\n let node: Element | null;\n while ((node = walker.nextNode() as Element | null)) {\n const pid = node.getAttribute('data-pid');\n if (pid) map.set(pid, node);\n }\n return map;\n}\n\n/**\n * Build a map of comment anchor id → Comment for structural directives.\n * @param fragment - The DOM fragment to scan\n * @returns Map from comment text (e.g. \"if:r0\") to the Comment node\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"buildCommentMap\",\"stability\":\"internal\",\"signature\":\"(fragment: DocumentFragment) => Map<string, Comment>\"} */\nexport function buildCommentMap(\n fragment: DocumentFragment\n): Map<string, Comment> {\n const map = new Map<string, Comment>();\n const walker = document.createTreeWalker(fragment, NodeFilter.SHOW_COMMENT);\n let node: Comment | null;\n while ((node = walker.nextNode() as Comment | null)) {\n const text = node.textContent ?? '';\n // Structural anchors: \"if:pid\", \"for:pid\", \"slot:name\"\n const colonIdx = text.indexOf(':');\n // The first of two same-named slots is the one that receives content.\n if (colonIdx > 0 && !map.has(text)) {\n map.set(text, node);\n }\n }\n return map;\n}\n\n/**\n * Walk up the DOM to find the nearest local PithyJS context.\n * Falls back to the provided root context.\n * @param el - Starting DOM node\n * @param rootCtx - Fallback context if no local context is found\n * @returns The nearest context object\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"nearestCtx\",\"stability\":\"internal\",\"signature\":\"(el: Node, rootCtx: BindingContext) => BindingContext\"} */\nexport function nearestCtx(el: Node, rootCtx: BindingContext): BindingContext {\n // Walk parentNode (not parentElement) so context is found on Text/Comment\n // nodes — needed when JIT-projected content is slotted into AOT components.\n // NOTE: In @for loops, only Element nodes receive loop-item __pithyCtx\n // (see applyStructural.ts / createLoopManager.ts). Text nodes inside loop\n // items inherit context from their parent Element, which works correctly\n // because AOT text nodes don't have __pithyCtx set (factories use raw\n // createTextNode), and JIT text nodes are children of tagged Elements.\n let n: Node | null = el;\n while (n) {\n const local = (n as Node & { __pithyCtx?: BindingContext }).__pithyCtx;\n if (local) return local;\n n = n.parentNode;\n }\n return rootCtx;\n}\n\n/**\n * `{ ...a, ...b }` that copies a getter as a getter: a spread reads it once\n * and stores the value, so the template would never see it change. Every\n * read goes through the source, so `this` and a Proxy's `get` trap apply.\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"spreadLive\",\"stability\":\"internal\",\"signature\":\"(...sources: (BindingContext | undefined)[]) => BindingContext\"} */\nexport function spreadLive(\n ...sources: (BindingContext | undefined)[]\n): BindingContext {\n const out: BindingContext = {};\n for (const source of sources) {\n if (!source) continue;\n for (const key of Reflect.ownKeys(source)) {\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!desc?.enumerable) continue;\n Object.defineProperty(\n out,\n key,\n 'value' in desc\n ? {\n value: Reflect.get(source, key),\n writable: true,\n enumerable: true,\n configurable: true,\n }\n : {\n get: () => Reflect.get(source, key),\n set: desc.set && ((v: unknown) => Reflect.set(source, key, v)),\n enumerable: true,\n configurable: true,\n }\n );\n }\n }\n return out;\n}\n\n/**\n * Merge parent component and async (SSR) contexts into the explicit context.\n * Single source of truth used by both `html.ts` and `applyBindings.ts`.\n * @param context - The explicit context from the call site\n * @returns Merged context with parent component and async contexts\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"mergeContexts\",\"stability\":\"internal\",\"signature\":\"(context: BindingContext) => BindingContext\"} */\nexport function mergeContexts(context: BindingContext): BindingContext {\n const g = pithyGlobals();\n const getContextFn = g.__getComponentContext;\n const asyncContext =\n typeof getContextFn === 'function' ? getContextFn() : undefined;\n const parentComponentContext = g.__pithyComponentContext;\n\n let parentData: BindingContext | undefined;\n if (parentComponentContext && typeof parentComponentContext === 'object') {\n parentData = {};\n for (const key of Object.keys(parentComponentContext)) {\n if (key === '__pithyRowLocals') continue;\n if (\n key.startsWith('__') ||\n typeof parentComponentContext[key] === 'function'\n ) {\n parentData[key] = parentComponentContext[key];\n }\n }\n if (Object.keys(parentData).length === 0) parentData = undefined;\n }\n\n if (asyncContext || parentData) {\n return spreadLive(parentData, asyncContext, context);\n }\n return context;\n}\n\n/**\n * Compile expression with $event and $el support for event handlers.\n * @param expr - The expression string to compile\n * @param ctx - The reactive context for variable resolution\n * @returns A function that accepts (event, element) and evaluates the expression\n */\n/** @codexApi {\"parent\":\"pithy.runtime.binding-helpers\",\"name\":\"compileWithEvent\",\"stability\":\"internal\",\"signature\":\"(expr: string, ctx: BindingContext) => (ev: Event, el: Element) => unknown\"} */\nexport function compileWithEvent(\n expr: string,\n ctx: BindingContext\n): (ev: Event, el: Element) => unknown {\n try {\n // eslint-disable-next-line no-new-func -- JIT event-handler expression evaluation is a core framework feature\n const fn = new Function(\n 'ctx',\n '$event',\n '$el',\n `with (ctx) { return (${expr}); }`\n ) as (ctx: BindingContext, ev: Event, el: Element) => unknown;\n return (ev: Event, el: Element) => fn(ctx, ev, el);\n } catch (err) {\n if (import.meta.env?.DEV) {\n console.warn(`[AOT bindEvent] Failed to compile \"${expr}\"`, err);\n }\n return (_ev: Event, _el: Element) => undefined;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/runtime/bindings/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,EA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":[],"mappings":"AAAA,gFAAgF;AAChF,4EAA4E;AAC5E,mFAAmF","sourcesContent":["// ─── Descriptor types (mirror codegen output) ────────────────────────────────\n// These describe the shape of the compact binding arrays emitted by the AOT\n// codegen in generateBindings.ts. Handlers narrow inside via the `t` discriminant.\n\nexport type BindingContext = Record<string, unknown>;\n\nexport interface FactoryResult {\n el?: HTMLElement | DocumentFragment;\n destroy?: () => void;\n}\n\nexport type Factory = (ctx: BindingContext) => FactoryResult | null | undefined;\n\n/** @codexApi {\"parent\":\"pithy.runtime.compile-nodes\",\"name\":\"ChildFactory\",\"stability\":\"experimental\",\"signature\":\"type ChildFactory = (ctx: BindingContext, wrap?: (nodes: DocumentFragment) => DocumentFragment) => { el: DocumentFragment; destroy: () => void }\"} */\nexport type ChildFactory = (\n ctx: BindingContext,\n wrap?: (nodes: DocumentFragment) => DocumentFragment\n) => { el: DocumentFragment; destroy: () => void };\n\nexport interface EventDesc {\n t: 'event';\n pid: string;\n event: string;\n expr: string;\n mods?: string[];\n}\nexport interface InterpDesc {\n t: 'interp';\n pid: string;\n parts: ({ s: string } | { e: string })[];\n}\nexport interface ClassDesc {\n t: 'class';\n pid: string;\n name: string;\n expr: string;\n}\nexport interface ClassesDesc {\n t: 'classes';\n pid: string;\n expr: string;\n}\nexport interface StyleDesc {\n t: 'style';\n pid: string;\n prop: string;\n expr: string;\n}\nexport interface BoundDesc {\n t: 'bound';\n pid: string;\n attr: string;\n expr: string;\n}\nexport interface RefDesc {\n t: 'ref';\n pid: string;\n name: string;\n}\nexport interface BindDesc {\n t: 'bind';\n pid: string;\n expr: string;\n}\nexport interface CompDesc {\n t: 'comp';\n pid: string;\n tag: string;\n props: Record<string, string>;\n children?: ChildFactory;\n /** Slot name → factory that renders and binds that slot's content once per mount. */\n slots?: Record<string, ChildFactory>;\n}\nexport interface DeferDesc {\n t: 'defer';\n pid: string;\n trigger: string;\n load: string;\n placeholder?: string;\n when?: string;\n priority?: string;\n timeout?: number;\n}\nexport interface ErrorDesc {\n t: 'error';\n pid: string;\n expr: string;\n}\nexport interface ProjDesc {\n t: 'proj';\n pid: string;\n name: string;\n fallback?: Factory;\n}\nexport interface IfDesc {\n t: 'if';\n pid: string;\n branches: { expr?: string; factory: Factory }[];\n}\nexport interface ForDesc {\n t: 'for';\n pid: string;\n item: string;\n index?: string;\n expr: string;\n trackBy?: string;\n /** The `@for` element's tag, for diagnostics. */\n tag?: string;\n factory: Factory;\n}\nexport interface SwitchDesc {\n t: 'switch';\n pid: string;\n expr: string;\n cases: { val?: string; factory: Factory }[];\n}\n\nexport type Desc =\n | EventDesc\n | InterpDesc\n | ClassDesc\n | ClassesDesc\n | StyleDesc\n | BoundDesc\n | RefDesc\n | BindDesc\n | CompDesc\n | DeferDesc\n | ErrorDesc\n | ProjDesc\n | IfDesc\n | ForDesc\n | SwitchDesc;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/runtime/bindings/types.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,4EAA4E;AAC5E,mFAAmF","sourcesContent":["// ─── Descriptor types (mirror codegen output) ────────────────────────────────\n// These describe the shape of the compact binding arrays emitted by the AOT\n// codegen in generateBindings.ts. Handlers narrow inside via the `t` discriminant.\n\nexport type BindingContext = Record<string, unknown>;\n\nexport interface FactoryResult {\n el?: HTMLElement | DocumentFragment;\n destroy?: () => void;\n}\n\nexport type Factory = (ctx: BindingContext) => FactoryResult | null | undefined;\n\n/** @codexApi {\"parent\":\"pithy.runtime.compile-nodes\",\"name\":\"ChildFactory\",\"stability\":\"experimental\",\"signature\":\"type ChildFactory = (ctx: BindingContext, wrap?: (nodes: DocumentFragment) => DocumentFragment) => { el: DocumentFragment; destroy: () => void }\"} */\nexport type ChildFactory = (\n ctx: BindingContext,\n wrap?: (nodes: DocumentFragment) => DocumentFragment\n) => { el: DocumentFragment; destroy: () => void };\n\nexport interface EventDesc {\n t: 'event';\n pid: string;\n event: string;\n expr: string;\n mods?: string[];\n}\nexport interface InterpDesc {\n t: 'interp';\n pid: string;\n parts: ({ s: string } | { e: string })[];\n}\nexport interface ClassDesc {\n t: 'class';\n pid: string;\n name: string;\n expr: string;\n}\nexport interface ClassesDesc {\n t: 'classes';\n pid: string;\n expr: string;\n}\nexport interface StyleDesc {\n t: 'style';\n pid: string;\n prop: string;\n expr: string;\n}\nexport interface BoundDesc {\n t: 'bound';\n pid: string;\n attr: string;\n expr: string;\n}\nexport interface RefDesc {\n t: 'ref';\n pid: string;\n name: string;\n}\nexport interface BindDesc {\n t: 'bind';\n pid: string;\n expr: string;\n}\nexport interface CompDesc {\n t: 'comp';\n pid: string;\n tag: string;\n props: Record<string, string>;\n children?: ChildFactory;\n /** Slot name → factory that renders and binds that slot's content once per mount. */\n slots?: Record<string, ChildFactory>;\n}\nexport interface DeferDesc {\n t: 'defer';\n pid: string;\n trigger: string;\n load: string;\n placeholder?: string;\n when?: string;\n priority?: string;\n timeout?: number;\n}\nexport interface ErrorDesc {\n t: 'error';\n pid: string;\n expr: string;\n}\nexport interface ProjDesc {\n t: 'proj';\n pid: string;\n name: string;\n fallback?: Factory;\n /** A later slot of `name` in its template: shows only its fallback, at `slot-dup:${pid}`. */\n dup?: true;\n}\nexport interface IfDesc {\n t: 'if';\n pid: string;\n branches: { expr?: string; factory: Factory }[];\n}\nexport interface ForDesc {\n t: 'for';\n pid: string;\n item: string;\n index?: string;\n expr: string;\n trackBy?: string;\n /** The `@for` element's tag, for diagnostics. */\n tag?: string;\n factory: Factory;\n}\nexport interface SwitchDesc {\n t: 'switch';\n pid: string;\n expr: string;\n cases: { val?: string; factory: Factory }[];\n}\n\nexport type Desc =\n | EventDesc\n | InterpDesc\n | ClassDesc\n | ClassesDesc\n | StyleDesc\n | BoundDesc\n | RefDesc\n | BindDesc\n | CompDesc\n | DeferDesc\n | ErrorDesc\n | ProjDesc\n | IfDesc\n | ForDesc\n | SwitchDesc;\n"]}
|
package/dist/types/globals.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface PithyGlobals {
|
|
|
24
24
|
__pithyBranchFailures?: WeakSet<Element>;
|
|
25
25
|
__pithyOpenBranches?: number;
|
|
26
26
|
__pithyBoundaryContext?: Element | null;
|
|
27
|
+
__pithyBoundaryContextInFallback?: boolean;
|
|
27
28
|
PITHY_DEBUG_PROJECTION?: boolean;
|
|
28
29
|
__PITHY_SSR__?: boolean;
|
|
29
30
|
__getComponentContext?: () => Record<string, unknown> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../src/types/globals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,WAAW,qBAAsB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACpE,wBAAwB,CAAC,EAAE,qBAAqB,CAAC;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,SAAS,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1C,iGAAiG;IACjG,wBAAwB,CAAC,EAAE,OAAO,EAAE,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,qBAAqB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7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G,wBAAwB,CAAC,EAAE,OAAO,EAAE,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,qBAAqB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACxC,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAClE,uBAAuB,CAAC,EAAE,qBAAqB,CAAC;IAChD,wBAAwB,CAAC,EAAE,gBAAgB,CAAC;IAC5C,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,0BAA0B,CAAC,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC;IAC9D,0BAA0B,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC;CAC5D;AAED,wBAAgB,YAAY,IAAI,OAAO,UAAU,GAAG,YAAY,CAE/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.js","sourceRoot":"","sources":["../../src/types/globals.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"globals.js","sourceRoot":"","sources":["../../src/types/globals.ts"],"names":[],"mappings":"AAuCA,MAAM,UAAU,YAAY;IAC1B,OAAO,UAA8C,CAAC;AACxD,CAAC","sourcesContent":["import type { SlotMap } from '../compile/contentProjection';\nimport type { PithyNode } from '@pithyjs/compiler';\nimport type { ChildFactory } from '../runtime/bindings/types';\n\nexport interface PithyComponentContext extends Record<string, unknown> {\n __parentComponentContext?: PithyComponentContext;\n __slotMap?: SlotMap;\n __childAstNodes?: PithyNode[];\n __childFactory?: ChildFactory;\n /** The component placeholder this context renders, while it is in the tree. */\n __slotHost?: Element;\n}\n\nexport interface PithyGlobals {\n /**\n * SSR component-crash registry. Lives on `globalThis` rather than in a module\n * so that an app and `@pithyjs/ssr` resolving two physical copies of\n * `@pithyjs/core` still share one — see `compile/ssrCrashes.ts`.\n */\n __pithySSRCrashes?: Map<Element, unknown>;\n /** Crashes attributed to a boundary, resolved when the render ends; shared like the registry. */\n __pithyAttributedCrashes?: unknown[];\n __pithyRenderDepth?: number;\n __pithyRenderId?: number;\n __pithyCrashedElements?: WeakSet<Element>;\n __pithyBranchFailures?: WeakSet<Element>;\n __pithyOpenBranches?: number;\n __pithyBoundaryContext?: Element | null;\n __pithyBoundaryContextInFallback?: boolean;\n PITHY_DEBUG_PROJECTION?: boolean;\n __PITHY_SSR__?: boolean;\n __getComponentContext?: () => Record<string, unknown> | undefined;\n __pithyComponentContext?: PithyComponentContext;\n __pithyProjectedChildren?: DocumentFragment;\n __pithyRenderingComponent?: boolean;\n __pithyGetDestroyCallbacks?: () => (() => void)[] | undefined;\n __pithySetDestroyCallbacks?: (cbs: (() => void)[]) => void;\n}\n\nexport function pithyGlobals(): typeof globalThis & PithyGlobals {\n return globalThis as typeof globalThis & PithyGlobals;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pithyjs/core",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.24",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/PithyJS/pithyjs.git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@pithyjs/shared": "0.1.0-beta.4",
|
|
28
28
|
"@pithyjs/signals": "0.1.0-beta.2",
|
|
29
|
-
"@pithyjs/compiler": "0.1.0-beta.
|
|
29
|
+
"@pithyjs/compiler": "0.1.0-beta.12",
|
|
30
30
|
"@pithyjs/design-system": "0.1.0-beta.12"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|