@verajs/renderer 0.2.1 → 0.3.0
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 +729 -226
- package/dist/development/vera-renderer-elements.d.ts +39 -0
- package/dist/development/vera-renderer-elements.d.ts.map +1 -0
- package/dist/development/vera-renderer-elements.js +193 -0
- package/dist/development/vera-renderer-elements.js.map +1 -0
- package/dist/development/vera-renderer-hydrate-slots.d.ts +94 -0
- package/dist/development/vera-renderer-hydrate-slots.d.ts.map +1 -0
- package/dist/development/vera-renderer-hydrate-slots.js +325 -0
- package/dist/development/vera-renderer-hydrate-slots.js.map +1 -0
- package/dist/development/vera-renderer-hydration.d.ts +332 -0
- package/dist/development/vera-renderer-hydration.d.ts.map +1 -0
- package/dist/development/vera-renderer-hydration.js +864 -0
- package/dist/development/vera-renderer-hydration.js.map +1 -0
- package/dist/development/vera-renderer-keyed.d.ts +25 -8
- package/dist/development/vera-renderer-keyed.d.ts.map +1 -1
- package/dist/development/vera-renderer-keyed.js +843 -268
- package/dist/development/vera-renderer-keyed.js.map +1 -1
- package/dist/development/vera-renderer-multi-window.d.ts +5 -0
- package/dist/development/vera-renderer-multi-window.d.ts.map +1 -0
- package/dist/development/vera-renderer-multi-window.js +40 -0
- package/dist/development/vera-renderer-multi-window.js.map +1 -0
- package/dist/development/vera-renderer-namespaces.d.ts +64 -0
- package/dist/development/vera-renderer-namespaces.d.ts.map +1 -0
- package/dist/development/vera-renderer-namespaces.js +94 -0
- package/dist/development/vera-renderer-namespaces.js.map +1 -0
- package/dist/development/vera-renderer-native-elements.d.ts +13 -0
- package/dist/development/vera-renderer-native-elements.d.ts.map +1 -0
- package/dist/development/vera-renderer-native-elements.js +231 -0
- package/dist/development/vera-renderer-native-elements.js.map +1 -0
- package/dist/development/vera-renderer-portal.d.ts +29 -0
- package/dist/development/vera-renderer-portal.d.ts.map +1 -0
- package/dist/development/vera-renderer-portal.js +167 -0
- package/dist/development/vera-renderer-portal.js.map +1 -0
- package/dist/development/vera-renderer-profiler.d.ts +113 -138
- package/dist/development/vera-renderer-profiler.d.ts.map +1 -1
- package/dist/development/vera-renderer-profiler.js +2428 -2101
- package/dist/development/vera-renderer-profiler.js.map +1 -1
- package/dist/development/vera-renderer-slots.d.ts +88 -92
- package/dist/development/vera-renderer-slots.d.ts.map +1 -1
- package/dist/development/vera-renderer-slots.js +1834 -1237
- package/dist/development/vera-renderer-slots.js.map +1 -1
- package/dist/development/vera-renderer-spread.d.ts +8 -29
- package/dist/development/vera-renderer-spread.d.ts.map +1 -1
- package/dist/development/vera-renderer-spread.js +542 -461
- package/dist/development/vera-renderer-spread.js.map +1 -1
- package/dist/development/vera-renderer-tag.d.ts +12 -3
- package/dist/development/vera-renderer-tag.d.ts.map +1 -1
- package/dist/development/vera-renderer-tag.js +671 -494
- package/dist/development/vera-renderer-tag.js.map +1 -1
- package/dist/development/vera-renderer-until.d.ts +24 -0
- package/dist/development/vera-renderer-until.d.ts.map +1 -0
- package/dist/development/vera-renderer-until.js +83 -0
- package/dist/development/vera-renderer-until.js.map +1 -0
- package/dist/development/vera-renderer.d.ts +77 -96
- package/dist/development/vera-renderer.d.ts.map +1 -1
- package/dist/development/vera-renderer.js +2401 -2061
- package/dist/development/vera-renderer.js.map +1 -1
- package/dist/vera-renderer-elements.min.js +2 -0
- package/dist/vera-renderer-elements.min.js.map +1 -0
- package/dist/vera-renderer-hydrate-slots.min.js +2 -0
- package/dist/vera-renderer-hydrate-slots.min.js.map +1 -0
- package/dist/vera-renderer-hydration.min.js +3 -0
- package/dist/vera-renderer-hydration.min.js.map +1 -0
- package/dist/vera-renderer-keyed.min.js +1 -1
- package/dist/vera-renderer-keyed.min.js.map +1 -1
- package/dist/vera-renderer-multi-window.min.js +2 -0
- package/dist/vera-renderer-multi-window.min.js.map +1 -0
- package/dist/vera-renderer-namespaces.min.js +2 -0
- package/dist/vera-renderer-namespaces.min.js.map +1 -0
- package/dist/vera-renderer-native-elements.min.js +2 -0
- package/dist/vera-renderer-native-elements.min.js.map +1 -0
- package/dist/vera-renderer-portal.min.js +2 -0
- package/dist/vera-renderer-portal.min.js.map +1 -0
- package/dist/vera-renderer-slots.min.js +1 -1
- package/dist/vera-renderer-slots.min.js.map +1 -1
- package/dist/vera-renderer-spread.min.js +1 -1
- package/dist/vera-renderer-spread.min.js.map +1 -1
- package/dist/vera-renderer-tag.min.js +1 -1
- package/dist/vera-renderer-tag.min.js.map +1 -1
- package/dist/vera-renderer-until.min.js +2 -0
- package/dist/vera-renderer-until.min.js.map +1 -0
- package/dist/vera-renderer.min.js +1 -1
- package/dist/vera-renderer.min.js.map +1 -1
- package/package.json +52 -9
- package/dist/development/vera-renderer-hydrate.d.ts +0 -118
- package/dist/development/vera-renderer-hydrate.d.ts.map +0 -1
- package/dist/development/vera-renderer-hydrate.js +0 -3092
- package/dist/development/vera-renderer-hydrate.js.map +0 -1
- package/dist/vera-renderer-hydrate.min.js +0 -2
- package/dist/vera-renderer-hydrate.min.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vera-renderer-spread.js","sources":["../../src/dev-values.ts","../../src/spread.ts"],"sourcesContent":["/**\n * `__DEV__` only: the one home for *\"is this value something an attribute can carry?\"*\n *\n * **Why it is a closed vocabulary and not a predicate.** The first design asked whether a value\n * stringifies meaningfully — `String(v) === '[object Object]'` means it lost its data. Driven\n * through 16 value shapes rather than reasoned about, that broke four ways, and the first is\n * disqualifying: `String()` THROWS on `Object.create(null)`, on `{ toString: null }`, and on any\n * object whose `toString` throws — so a diagnostic would have killed the page for an author using\n * the recommended dictionary idiom. It also passed `[\"a\",\"b\"]` as `\"a,b\"` (one junk class, if that\n * was a `class` binding) and `new Date()` as a timezone-bearing string, which is an SSR/CSR\n * divergence manufactured out of correct-looking code. And it passed `Symbol('s')` while\n * `` `${sym}` `` throws — a guard and its sink disagreeing about a single expression.\n *\n * \"Does it stringify meaningfully\" is an OPEN predicate over an unbounded, environment-dependent\n * space, and open predicates cannot be audited. So the test is inverted and closed: **primitives\n * pass; everything else is reported; anything else that should pass is a named row added on\n * evidence.** The list has exactly one member so far.\n *\n * Credit where it is due: the four breaks were found by the omni engine's session, which drove the\n * shapes rather than arguing about them, and the closed-vocabulary form is theirs.\n */\n\n/**\n * Blessed non-primitives — types whose `toString` IS the value the author means.\n *\n * Tested by brand rather than `instanceof`, which is false across realms: a `URL` built in an\n * iframe is not `instanceof` the parent's `URL`, and a diagnostic that fires on a correct value in\n * one frame and not another is worse than none.\n */\nconst brand = (value: object) => Object.prototype.toString.call(value);\n\n/** One message per element+name+kind, so a value rebuilt every render does not flood the console. */\nlet reported: Set<string> | undefined;\n\n/**\n * Returns the complaint, or `null` when the value is fine. Never throws — the shapes that break a\n * naive guard are exactly the ones worth reporting, so they reach the `object` arm and are named.\n */\nexport const attributeValueComplaint = (tag: string, name: string, value: unknown): string | null => {\n const type = typeof value;\n if (type === 'string' || type === 'number' || type === 'boolean' || type === 'bigint') return null;\n if (type === 'object' && brand(value as object) === '[object URL]') return null;\n\n /**\n * Keyed by BRAND, not by `typeof` — `Date`, `Array` and a plain object are all `'object'`, so a\n * coarser key reported whichever arrived first and silently swallowed the rest. An author who\n * fixed the Date would never have been told about the array.\n */\n const key = `${tag}|${name}|${type === 'object' ? brand(value as object) : type}`;\n reported ??= new Set();\n if (reported.has(key)) return null;\n reported.add(key);\n\n /**\n * A function into an attribute is never what the author meant, but the REASON matters: on a\n * custom element the Lit-era convention is that complex values are set as properties, so\n * `<my-chart formatter={fn}>` is a coherent intention that this sink simply cannot express. The\n * message names the binding that can, rather than blaming the author.\n */\n const said = type === 'function'\n ? `a function, which becomes its own SOURCE TEXT`\n : type === 'symbol'\n ? `a symbol, which every DOM conversion refuses`\n : Array.isArray(value)\n ? `an array, which becomes its members joined by commas`\n : brand(value as object) === '[object Date]'\n ? `a Date, whose text carries the TIMEZONE of whichever side rendered it`\n : `an ${type}, which cannot survive as text`;\n\n /**\n * Returned WITHOUT the `[vera]` prefix, which each call site writes as a literal.\n * `tests/diagnostics-convention.test.mjs` reads the prefix off the call, so a message handed over\n * as a variable is invisible to it — and its answer to that is an allowance list. Taking the\n * allowance would have excused these two calls rather than checked them, which is the\n * reclassification this audit keeps refusing; the literal at the call site is what every other\n * diagnostic in the repo does anyway.\n */\n return (\n `renderer: the attribute \\`${name}\\` on <${tag}> was given ${said}. ` +\n `An attribute value is a string and nothing else.\\n` +\n `If the element is meant to RECEIVE this value, bind a property instead — \\`.${name}=\\${value}\\` ` +\n `— which is how a custom element takes anything that is not text. If it is meant to be read as ` +\n `text, convert it where you know what it means: \\`date.toISOString()\\`, \\`list.join(' ')\\`. ` +\n `A Date in particular serializes with the SERVER's timezone on one side and the browser's on ` +\n `the other, so it will not survive hydration.`\n );\n};\n","import { attributeValueComplaint } from './dev-values.js';\n/**\n * `<div ${spread(props)}>` — bindings whose names are not known when the template is parsed.\n *\n * Template renderers bake attribute names in at parse time; that is what makes them small and fast,\n * and it is why neither this renderer nor lit-html has had spread. Lit's spread PR has sat open as a\n * draft since 2021, blocked on the questions answered below.\n *\n * **Why this ships separately.** The renderer holds one property read — a value at element position\n * carrying `_$apply$` applies itself — and nothing else, so a base bundle grows 16 B rather than\n * 176 B and an app that never spreads pays only that. Core and the renderer are the two packages\n * where weight is absolute; this is not one of them, but it is still measured.\n *\n * The sigil rules are repeated here rather than shared through `@verajs/shared-utils`. That was\n * tried: a shared resolver has to hand back both a kind and a name, and the tuple it allocates cost\n * the renderer 10 B. Principle #5 permits deliberate duplication where two callers can legitimately\n * diverge; #7 decides it, because the renderer is where bytes are not negotiable.\n */\n\nconst ATTR = 0;\nconst PROPERTY = 1;\nconst BOOLEAN = 2;\n/** `!name` — a property compared against the live DOM rather than against what this last wrote. */\nconst LIVE = 3;\nconst EVENT = 4;\nconst REF = 5;\n/** A binding gone inert — a get-only property refusal; `write` matches it against nothing. */\nconst REFUSED = -1;\n\n/**\n * A key that cannot be written into a tag, and therefore cannot be used at all.\n *\n * Measured in Chromium, `setAttribute` accepts `\"`, `'` and `<` and rejects whitespace, `>`, `=`,\n * `/` and NUL — but a name carrying a quote or a `<` cannot survive **markup**, so `@verajs/ssr`\n * has to refuse it, and a key that works here and vanishes server-side is worse than one that works\n * nowhere. The rule is therefore the HTML attribute-name restriction (control characters,\n * whitespace, `\"`, `'`, `>`, `/`, `=`) plus `<` and a backtick, applied identically on both sides.\n *\n * Skipped rather than thrown. `setAttribute` throws `InvalidCharacterError` on some of these, which\n * took down the whole render — for one bad key in a props bag, on a binding whose entire purpose is\n * names that are not known until runtime.\n *\n * The control-character range is the point of the rule, not a mistake in it: a name carrying one\n * is exactly what must never reach markup.\n */\n// eslint-disable-next-line no-control-regex\nconst UNSAFE_NAME = /^$|[\\s\"'>/=<`]|[\\u0000-\\u001f\\u007f]/;\n\n/**\n * **Sinks spread refuses, because spread is the one place the template security model breaks.**\n *\n * The renderer's posture on `.innerHTML` (README, \"security\") rests on three properties of the\n * template spelling: greppable, obviously yours, reviewable as the decision it is. A spread key\n * arrives at RUNTIME inside a props object — often built from data — and has none of the three:\n * `spread(fromJson)` carrying `.innerHTML` or an inline `onclick` attribute is markup or code\n * injection through a door no grep can see. So spread refuses the sinks and points at the template\n * spelling, which remains fully available to an author who means it.\n *\n * The list, deliberately minimal and named: `innerHTML`/`outerHTML` as property or live-property\n * keys; `srcdoc` as an attribute (an iframe's inline document); and any attribute whose name the\n * browser would treat as an inline handler (`on…` in any casing) — EXCEPT the documented event\n * spelling `on` + Capital, which the constructor converts to a real listener and which therefore\n * never becomes an attribute. The exemption mirrors the constructor's test byte for byte, because\n * `ONCLICK` must not slip through as \"looks like the event spelling\": the constructor only\n * converts a lowercase `on`, so only that exact shape is exempt.\n *\n * Returns the hint for the diagnostic, or null for a permitted key.\n */\nconst refusedSink = (key: string): string | null => {\n const first = key[0];\n if (first === '.' || first === '!') {\n const name = key.slice(1);\n if (name === 'innerHTML' || name === 'outerHTML')\n return 'write it in the template — html`<div .innerHTML=${trusted}>` — sanitized first (renderer README, security note)';\n /**\n * `element.__proto__ = value` is not a property write — it hits Object.prototype's\n * `__proto__` ACCESSOR and replaces the element's prototype, stripping every DOM method it\n * has. The element is bricked, and the crash lands LATER, in whatever binding next calls\n * `removeAttribute` on it — a data-driven render-kill with a stack that names the renderer\n * and not the data. Found by the run-14 payload probe; there is no legitimate use, so unlike\n * `.innerHTML` there is no template spelling to point at.\n */\n /** The deliberate twin of the same refusal in `AttrPart`'s constructor (`./renderer.ts`), for\n * the template spellings `.name` / `!name`. Independent bundles, neither imports the other, so\n * the rule is copied — and a fix visits both. `tests/dangerous-binding-matrix.test.mjs` holds\n * the two spellings to the same answer. */\n if (name === '__proto__')\n return \"assigning __proto__ replaces the element's own prototype and destroys it — no property write does this, and no use of it is legitimate\";\n return null;\n }\n if (first === '?' || first === '@' || first === '&') return null;\n /** The event spelling the constructor converts: `on` + Capital, lowercase `on` only. */\n if (first === 'o' && key.charCodeAt(1) === 110 && key.charCodeAt(2) > 64 && key.charCodeAt(2) < 91) return null;\n const lower = key.toLowerCase();\n if (lower === 'srcdoc') return 'an inline iframe document is markup injection by definition — bind it in the template if you truly mean it';\n if (lower.length > 2 && lower.startsWith('on'))\n return 'an inline handler attribute is code from data — pass a function as `on` + Capital (onClick) or `@click` instead';\n return null;\n};\n\n/** Module-local: one identity comparison, not a global symbol-registry lookup per binding. */\nconst UNSET = Symbol();\n\n/**\n * The deliberate twin of `commitAdopt` in `./renderer.ts` — independent bundles, neither imports\n * the other, so the rule is copied IN FULL and a fix visits both. Full reasoning there; the short\n * form: after the write, an accessor anywhere on the chain means something receives this property\n * and the binding can latch onto the plain write for good. Unreceived, the value is recorded under\n * the element-carried `_$props$` — the cross-bundle channel core's `init()` drains — and the latch\n * closes once the element is upgraded (its record is final) or has no realm. The development\n * clobber detector rides along, because a bag key and a written binding are the same mistake with\n * the same author watching.\n *\n * Returns the binding's NEXT kind, exactly as the twin does: `PROPERTY` to latch onto the plain\n * write, `REFUSED` to go inert (a get-only surface), `0` to keep adopting.\n */\nconst adopt = (element: Element, name: string, value: unknown): number => {\n const el = element as unknown as Record<string, unknown>;\n /** The walk comes BEFORE the write — see the twin: a setter receives (its throw is the\n * component's own error), a getter with no setter refuses instead of throwing a raw TypeError\n * out of the render, and the dev warning defers to `_$adopt$`'s own refusal where it exists. */\n let carrier: object | null = el;\n while (carrier !== null) {\n const desc = Object.getOwnPropertyDescriptor(carrier, name);\n if (desc !== undefined) {\n if (desc.set !== undefined) {\n el[name] = value;\n return PROPERTY;\n }\n if (desc.get !== undefined) {\n if (el._$adopt$ !== undefined) (el._$adopt$ as (key: string, value: unknown) => void)(name, value);\n else if (__DEV__)\n console.warn(\n `[vera] renderer: <${element.localName}> declares \\`${name}\\` as a getter with no ` +\n `setter — the value bound by \\`.${name}\\` cannot be delivered and the binding is ` +\n `ignored. Add a setter, or stop binding it.`\n );\n return REFUSED;\n }\n break; // a data property — an own field, or an inherited default: nothing receives it\n }\n carrier = Object.getPrototypeOf(carrier);\n }\n el[name] = value;\n /** An initialized component receives live through `_$adopt$` — a record after the drain would\n * never be read again. The door a spread bag's conditional key arrives through, reactive. */\n if (el._$adopt$ !== undefined) {\n (el._$adopt$ as (key: string, value: unknown) => void)(name, value);\n return PROPERTY;\n }\n const record = (el._$props$ ??= {}) as Record<string, unknown>;\n const firstRecording = !Object.hasOwn(record, name);\n record[name] = value;\n /** Prototype, never `el.constructor` — a bag key named `constructor` shadows the real one with\n * an own property, and no property write can move a prototype (`__proto__` is refused above). */\n const win = element.ownerDocument.defaultView as unknown as {\n HTMLElement: { prototype: object };\n customElements: CustomElementRegistry;\n } | null;\n const upgraded = win === null || Object.getPrototypeOf(el) !== win.HTMLElement.prototype;\n if (__DEV__ && win !== null && !upgraded && firstRecording) {\n const tag = element.localName;\n win.customElements.whenDefined(tag).then(() => {\n /** Ownership is asked of the whole CHAIN — see the twin: a drain accessor, a handed-to\n * prototype pair, or a refused get-only surface all mean nothing is left to report. */\n let owner: object | null = el;\n let owned = false;\n while (owner !== null) {\n const desc = Object.getOwnPropertyDescriptor(owner, name);\n if (desc !== undefined) {\n owned = desc.get !== undefined || desc.set !== undefined;\n break;\n }\n owner = Object.getPrototypeOf(owner);\n }\n if (!owned && el[name] !== record[name])\n console.warn(\n `[vera] renderer: the value bound by \\`.${name}\\` on <${tag}> was replaced while the ` +\n `element upgraded. A class field is the usual cause: at ES2022 \\`${name}?: …\\` emits ` +\n `\\`${name};\\`, which runs during upgrade and overwrites whatever was set beforehand — ` +\n `write it \\`declare ${name}?: …\\` instead, which emits nothing. A component that ` +\n `calls init() adopts bound properties automatically and never sees this; this ` +\n `element did not. Ignore this if the component replaced the value on purpose.`\n );\n });\n }\n return upgraded ? PROPERTY : 0;\n};\n\n/**\n * A class, not an object literal, so `handleEvent` exists once on the prototype. As a literal it was\n * a fresh closure per bound key — allocation proportional to the size of every props bag.\n */\nclass Binding {\n _kind: number;\n _name: string;\n _element: Element;\n /** What the element held before this binding took over. Releasing puts it back. */\n _initial: unknown;\n _committed: unknown = UNSET;\n _handler: EventListener | null = null;\n /** Twin of AttrPart's `PROP_ADOPT`: a property binding on a dashed tag goes through `adopt`\n * until something receives the property, then latches onto the plain write. Bindings persist\n * per element in `owned`, so the latch is safe here too. */\n _recording = false;\n\n constructor(element: Element, key: string) {\n const first = key[0];\n let kind =\n first === '.'\n ? PROPERTY\n : first === '?'\n ? BOOLEAN\n : first === '@'\n ? EVENT\n : first === '&'\n ? REF\n : first === '!'\n ? LIVE\n : ATTR;\n let name = kind ? key.slice(1) : key;\n /** `on` + a capital: `onClick` ≡ `@click`. All-lowercase `onclick` never reaches here — it is\n * an inline-handler attribute, which `refusedSink` rejects before a binding exists. */\n if (kind === ATTR && first === 'o' && key.charCodeAt(1) === 110 && key.charCodeAt(2) > 64 && key.charCodeAt(2) < 91) {\n kind = EVENT;\n name = key.slice(2).toLowerCase();\n }\n this._kind = kind;\n this._name = name;\n this._element = element;\n this._recording = kind === PROPERTY && element.localName.includes('-');\n this._initial =\n kind === ATTR\n ? element.getAttribute(name)\n : kind === BOOLEAN\n ? element.hasAttribute(name)\n : kind === PROPERTY || kind === LIVE\n ? (element as unknown as Record<string, unknown>)[name]\n : null;\n }\n\n /**\n * **Two shapes, because `addEventListener` takes two** — the same rule `AttrPart.handleEvent`\n * applies, and it did not travel here when that one was fixed. A function is called with the\n * element as `this`; an object with a `handleEvent` method is invoked through it — the platform's\n * own `EventListenerObject` protocol, which every engine accepts. This called `.call()`\n * unconditionally, so `spread({ onClick: { handleEvent } })` bound without complaint, never\n * fired, and raised `this._handler.call is not a function` on **every** dispatch — while the\n * identical value through a written `@click` worked.\n *\n * Anything else is inert rather than throwing, exactly as there: development names it at the\n * binding (see the event branch in `write`), where the mistake still is.\n */\n handleEvent(event: Event) {\n const handler = this._handler as EventListener | EventListenerObject | null;\n if (typeof handler === 'function') handler.call(this._element as never, event);\n else if (typeof (handler as EventListenerObject)?.handleEvent === 'function')\n (handler as EventListenerObject).handleEvent(event);\n }\n}\n\n/**\n * Keyed by the **part**, not the element.\n *\n * Keyed by element, `<div ${spread(a)} ${spread(b)}>` shares one map: whichever applies second sees\n * the other's keys as absent from its own props and releases them. Measured — the first spread's\n * attributes silently vanished. The part is one per element-position slot, which is exactly the\n * ownership boundary, and the renderer reuses it across renders.\n */\nconst owned = new WeakMap<object, Map<string, Binding>>();\n\nconst write = (binding: Binding, value: unknown) => {\n /** One comparison per key per render — the same dirty check a written binding gets. */\n /**\n * A live property asks the element rather than its own memory — see `AttrPart` in the renderer.\n * The dirty check is what keeps a field someone typed into, and it is exactly wrong for a control\n * whose DOM state changes when a *sibling* is interacted with, a radio group being the case.\n */\n if (binding._kind === LIVE) {\n binding._committed = value;\n const live = binding._element as unknown as Record<string, unknown>;\n if (live[binding._name] !== value) live[binding._name] = value;\n return;\n }\n if (value === binding._committed) return;\n binding._committed = value;\n const element = binding._element;\n const name = binding._name;\n const kind = binding._kind;\n if (kind === ATTR) {\n if (value == null) element.removeAttribute(name);\n else {\n if (__DEV__) {\n const complaint = attributeValueComplaint(element.localName, name, value);\n if (complaint !== null) console.warn(`[vera] ${complaint}`);\n }\n /**\n * `` `${value}` ``, never `String(value)` — the two differ on exactly one thing and it is the\n * one that matters here. `String(sym)` returns `\"Symbol(s)\"` while every DOM conversion and\n * `@verajs/ssr`'s own escaper throw, so this sink was the ONLY one of three that accepted a\n * symbol, writing to the client an attribute the server refuses to produce. The rule was\n * already recorded in `@verajs/ssr`'s `escapeHtml` — \"serving Symbol(s) into markup the client\n * cannot reproduce does not make anything work, it moves the failure across the boundary and\n * strips the context\" — and this file used the other form anyway. A house rule written down\n * in one of three homes is a house rule in none of them.\n */\n element.setAttribute(name, `${value}`);\n }\n } else if (kind === PROPERTY) {\n if (binding._recording) {\n const next = adopt(element, name, value);\n if (next !== 0) {\n binding._recording = false;\n if (next === REFUSED) binding._kind = REFUSED; // inert: `write` matches it against nothing\n }\n } else (element as unknown as Record<string, unknown>)[name] = value;\n } else if (kind === BOOLEAN) {\n element.toggleAttribute(name, !!value);\n } else if (kind === REF) {\n /**\n * `&name` is the written form's ref sigil (`<input &field=${myRef} />`), and it was the one\n * binding kind a spread could not express: the key fell through to `ATTR` and\n * `setAttribute('&field', …)` threw on the client while the server wrote `&field=\"[object\n * Object]\"` into the markup. A function is called with the element, an object gets it assigned\n * to `.value` — the same two shapes `AttrPart` handles.\n */\n if (typeof value === 'function') (value as (el: Element) => void)(element);\n else if (value !== null && typeof value === 'object') (value as { value: unknown }).value = element;\n } else {\n /**\n * A listener is validated when a *user* clicks, which in development may be never — so it is\n * checked where it is written, the same rule `AttrPart` applies to `@event`. `false` stays\n * silent: `{ onClick: enabled && onClick }` is the ordinary conditional form and already\n * behaves correctly, since `handleEvent` finds nothing callable and does nothing.\n */\n if (__DEV__ && value != null && value !== false && typeof value !== 'function' &&\n typeof (value as EventListenerObject)?.handleEvent !== 'function')\n console.warn(\n `[vera] spread: @${name} on <${element.localName}> was given ` +\n `${typeof value === 'object' ? 'an object with no handleEvent method' : `a ${typeof value}`}, ` +\n `which cannot listen — the event will do nothing.\\n` +\n `Pass a function, or an object with a handleEvent method. A missing handler is ` +\n `\\`undefined\\` or \\`false\\`, both of which are fine; this is neither.`\n );\n if (binding._handler === null && value != null) element.addEventListener(name, binding);\n binding._handler = (value as EventListener) ?? null;\n }\n};\n\n/**\n * A key that disappeared between renders restores what the element held before the binding existed.\n *\n * This is the question Lit's PR is stuck on, and the trap is asking it as \"what value means absent\".\n * For a property there is no answer: assigning `undefined` runs through coercing setters, so\n * dropping `.value` yields `\"\"` rather than reverting, and `delete` cannot remove a prototype\n * accessor. Asked instead as *\"undo what this binding did\"* it is well defined for every kind and\n * never invents a value the author did not write — the initial state was, by definition, acceptable\n * before the binding arrived.\n *\n * And asked that way it needs no code of its own: releasing is writing the initial value back.\n * `null` removes an attribute, `false` untoggles a boolean, `undefined` restores a property to\n * pristine, and an event handler falls to `null` — every case the existing commit already handles.\n * The separate per-kind teardown this replaced was fourteen lines saying the same thing twice.\n *\n * Deliberately unguarded by an ownership check (`is the value still the one we wrote?`). That only\n * matters when a component reassigns a property its parent is binding, which is already confused;\n * per principle #3 the machinery waits for evidence rather than being pre-built.\n */\nfunction apply(this: { _props: Record<string, unknown> }, element: Element, part: object) {\n const props = this._props;\n let bindings = owned.get(part);\n if (bindings === undefined) owned.set(part, (bindings = new Map()));\n\n /**\n * Counted here rather than with `Object.keys(props).length`, which allocates an array on every\n * render of every spread — garbage in the render path, for a number already being walked.\n */\n let count = 0;\n for (const key in props) {\n count++;\n /**\n * Counted before it is skipped, so the size comparison below still describes the key set — a\n * refused key that changed the count would make every render look like a removal.\n */\n if (UNSAFE_NAME.test(key[0] === '.' || key[0] === '?' || key[0] === '@' || key[0] === '&' ? key.slice(1) : key)) {\n if (__DEV__)\n console.warn(\n `[vera] spread: ignoring the key ${JSON.stringify(key)} — an attribute name ` +\n `cannot contain whitespace, a quote, \\`<\\`, \\`>\\`, \\`/\\`, \\`=\\` or a control character, ` +\n `and one that cannot be written into markup would not survive server rendering.`\n );\n continue;\n }\n /** Counted above for the same reason the unsafe skip is. */\n const refused = refusedSink(key);\n if (refused !== null) {\n if (__DEV__)\n console.warn(\n `[vera] spread: refusing ${JSON.stringify(key)} — spread names arrive at runtime, which is ` +\n `exactly the property that makes this sink unreviewable; ${refused}.`\n );\n continue;\n }\n let binding = bindings.get(key);\n if (binding === undefined) bindings.set(key, (binding = new Binding(element, key)));\n write(binding, props[key]);\n }\n\n /**\n * A size mismatch is the only way a key can have gone: every key in `props` was just visited, so\n * equal sizes means equal sets. The steady-state render of an unchanged shape — overwhelmingly the\n * common case — costs one integer comparison, not a scan.\n */\n if (bindings.size !== count) {\n for (const [key, binding] of bindings) {\n if (key in props) continue;\n bindings.delete(key);\n write(binding, binding._initial);\n }\n }\n}\n\n/**\n * The server half of the protocol: hand back every binding, resolved, and let the renderer that\n * asked decide what belongs in markup.\n *\n * Deliberately *not* a serializer. This package knows what a key means — `.value` is a property,\n * `?disabled` a boolean, `onClick` an event — and nothing else. Whether a property belongs in\n * server markup (`value`, `checked`, `selected` do; the rest are client state) and how a value is\n * escaped are `@verajs/ssr`'s decisions, and principle #8 wants escaping in exactly one place. So\n * this returns data, never a string.\n *\n * Kinds are single characters rather than the module's numeric constants, because this crosses a\n * package boundary: `a`ttribute, `b`oolean, `p`roperty, `e`vent, `r`ef. A ref is client state with\n * no markup, exactly like an event, and the serializer drops both.\n */\nfunction attributes(this: { _props: Record<string, unknown> }): [string, string, unknown][] {\n const out: [string, string, unknown][] = [];\n for (const key in this._props) {\n /** The client refusal, applied at the serializer boundary too — one predicate, both renders.\n * Without this, a refused key was merely inert in the browser and LIVE in server markup. */\n if (refusedSink(key) !== null) continue;\n const first = key[0];\n /** `!` reports as a property: the server has nothing to re-read, so it serializes as `.` does. */\n const kind =\n first === '.' || first === '!'\n ? 'p'\n : first === '?'\n ? 'b'\n : first === '@'\n ? 'e'\n : first === '&'\n ? 'r'\n : 'a';\n if (kind !== 'a') {\n out.push([kind, key.slice(1), this._props[key]]);\n } else if (first === 'o' && key.charCodeAt(1) === 110 && key.charCodeAt(2) > 64 && key.charCodeAt(2) < 91) {\n out.push(['e', key.slice(2).toLowerCase(), this._props[key]]);\n } else {\n out.push(['a', key, this._props[key]]);\n }\n }\n return out;\n}\n\n/**\n * Branded rather than duck-typed: the element position already means \"element ref\", and a props bag\n * is indistinguishable from a ref object — `{ value: 5 }` is legitimately either.\n */\n/** The branded, self-applying result — what the renderer's element position recognises. */\ntype SpreadResult = {\n _props: Record<string, unknown>;\n _$apply$: unknown;\n _$attrs$: unknown;\n};\nexport const spread = (props: Record<string, unknown>): SpreadResult => {\n /**\n * **Already branded → returned as-is.** `spread(spread(x))` arises legitimately: JSX compiles\n * `{...props({ date })}` to `spread(props({ date }))`, and `props()` below already returns the\n * branded result. Without this line the brand itself would be iterated as a bag and bind\n * attributes named `_props`, `_$apply$` and `_$attrs$`. Detected by the brand's PRESENCE, never\n * by identity with this bundle's `apply` — on a CDN page the renderer and a second copy of this\n * module are separate bundles with separate `apply` functions, and a result from either must\n * pass through both (the two-registry failure shape `tests/cdn-cross-bundle.test.mjs` guards).\n */\n if (props !== null && typeof props === 'object' && (props as SpreadResult)._$apply$ !== undefined)\n return props as SpreadResult;\n /**\n * **A props bag that is not an object is iterated anyway, and a browser accepts the result.**\n *\n * Everything below reads `props` with `Object.keys`/`Object.entries`, which answer for any value:\n * a **string** yields its character indices, so `spread('text')` sets four attributes named `0`,\n * `1`, `2`, `3` — measured in Chromium, with no error and no warning. A number, a boolean and\n * `null` yield nothing at all, so `spread(someUndefinedVariable)` applies no props and says\n * nothing, which reads as a renderer that ignored the spread.\n *\n * **jsdom hides this rather than catching it.** It implements the XML Name production and throws\n * `InvalidCharacterError` on `setAttribute('0', …)`, so a probe under jsdom sees a loud failure\n * for the case a real engine performs silently — the inverse of the usual trap, and the reason\n * this was verified in a browser before being called a defect (`tests/browser/spread-names.test.js`\n * records the engines' actual rule).\n *\n * Warned and ignored rather than thrown, which is exactly what an unusable *key* already does a\n * few lines above: one bad props bag should not cost the render.\n *\n * **The message is `__DEV__`-only; the refusal is not.** They were both inside the guard, which\n * made the two builds behave differently for the same code — and differently in the direction that\n * hides the bug. Measured: `spread('text')` applies nothing in development, so the app under test\n * looks fine; in production the string is iterated by character index and the element ends up with\n * attributes named `0`, `1`, `2` and `3` (under jsdom, an `InvalidCharacterError` instead — the\n * usual inversion, and why this was measured against both builds rather than reasoned about).\n *\n * A diagnostic belongs in `__DEV__`. A guard that changes what the program does cannot, or the\n * development build stops being a faithful model of the production one, which is the property that\n * makes testing in it worth anything. Costs 27 B gzipped (842 → 869, A-B-A) and buys the two builds agreeing.\n */\n if (props === null || typeof props !== 'object' || Array.isArray(props)) {\n if (__DEV__)\n console.warn(\n `[vera] spread: ignoring a props bag that is not a plain object — received ` +\n `${Array.isArray(props) ? 'an array' : typeof props === 'object' ? 'null' : `a ${typeof props}`}. ` +\n `A string is iterated by character index, so \\`spread('text')\\` would set attributes named ` +\n `0, 1, 2 and 3; anything else applies nothing at all. This is usually an import or a ` +\n `property that resolved to something unexpected.`\n );\n props = {};\n }\n return {\n _props: props,\n _$apply$: apply,\n _$attrs$: attributes,\n };\n};\n\n/**\n * A bag of PROPERTY bindings — the object form of `.name=${value}`, one call in both surfaces:\n *\n * ```js\n * html`<calendar-day ${props({ date, events })}></calendar-day>`\n * ```\n * ```jsx\n * <calendar-day {...props({ date, events })}></calendar-day>\n * ```\n *\n * Exists because an attribute is always a string: an array, a `Date` or a store can only reach a\n * custom element as a property — vera's JSX accepts the sigil spelling, TSX's type-checker refuses\n * it (`TS1003`), and this bag is the typed path either way. Every key is a\n * property NAME, never a sigil — `props({ date })` binds `.date`, so `props({ '.date': d })` would\n * bind `..date` and is the caller's mistake to keep.\n *\n * Properties only, by definition: events and boolean attributes keep their own spellings\n * (`@click`/`onClick`, `?disabled`). **Prefer keys spelled conditionally over bags that change\n * shape** — `props({ date: loaded ? date : null })` over `props(loaded ? { date } : {})`. Both\n * work: a key appearing later on a component goes through `_$adopt$` and arrives reactive, and a\n * key that disappears restores what the element held — but a stable shape updates in place, the\n * same reason templates prefer `?hidden` over swapped subtrees.\n *\n * With an explicit type argument the bag is checked against the element —\n * `props<CalendarDay>({ dat })` is a compile error naming the misspelling.\n */\nexport const props = <T extends object = Record<string, unknown>>(values: Partial<T>): SpreadResult => {\n const sigiled: Record<string, unknown> = {};\n for (const key of Object.keys(values)) sigiled[`.${key}`] = (values as Record<string, unknown>)[key];\n return spread(sigiled);\n};\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;AAoBG;AAEH;;;;;;AAMG;AACH,MAAM,KAAK,GAAG,CAAC,KAAa,KAAK,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AAEtE;AACA,IAAI,QAAiC;AAErC;;;AAGG;AACI,MAAM,uBAAuB,GAAG,CAAC,GAAW,EAAE,IAAY,EAAE,KAAc,KAAmB;AAClG,IAAA,MAAM,IAAI,GAAG,OAAO,KAAK;AACzB,IAAA,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,IAAI;IAClG,IAAI,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAe,CAAC,KAAK,cAAc;AAAE,QAAA,OAAO,IAAI;AAE/E;;;;AAIG;IACH,MAAM,GAAG,GAAG,CAAA,EAAG,GAAG,IAAI,IAAI,CAAA,CAAA,EAAI,IAAI,KAAK,QAAQ,GAAG,KAAK,CAAC,KAAe,CAAC,GAAG,IAAI,CAAA,CAAE;AACjF,IAAA,QAAQ,KAAK,IAAI,GAAG,EAAE;AACtB,IAAA,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,IAAI;AAClC,IAAA,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;AAEjB;;;;;AAKG;AACH,IAAA,MAAM,IAA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,CAAC,KAAK,CAAC,EAAE;AACvE,QAAA,IAAI,OAAO;YACT,OAAO,CAAC,IAAI,CACV,CAAA,0EAAA,CAA4E;AAC1E,gBAAA,CAAA,EAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,UAAU,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,CAAA,EAAA,EAAK,OAAO,KAAK,CAAA,CAAE,CAAA,EAAA,CAAI;gBACnG,CAAA,0FAAA,CAA4F;gBAC5F,CAAA,oFAAA,CAAsF;AACtF,gBAAA,CAAA,+CAAA,CAAiD,CACpD;QACH,KAAK,GAAG,EAAE;IACZ;IACA,OAAO;AACL,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,QAAQ,EAAE,KAAK;AACf,QAAA,QAAQ,EAAE,UAAU;KACrB;AACH;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACI,MAAM,KAAK,GAAG,CAA6C,MAAkB,KAAkB;IACpG,MAAM,OAAO,GAA4B,EAAE;IAC3C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,CAAC,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE,CAAC,GAAI,MAAkC,CAAC,GAAG,CAAC;AACpG,IAAA,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB;;;;"}
|
|
1
|
+
{"version":3,"file":"vera-renderer-spread.js","sources":["../../../shared-utils/src/diagnostic.ts","../../../shared-utils/src/diagnostics.ts","../../../shared-utils/src/adopt-property.ts","../../../shared-utils/src/markup-grammar.ts","../../../shared-utils/src/utils.ts","../../src/dev-values.ts","../../src/spread-diagnostics.ts","../../src/spread.ts"],"sourcesContent":["/**\n * **Where every diagnostic code is explained.** The URL is permanent: a released bundle is immutable, so every version\n * published points here for ever — the domain cannot lapse and `/e/` cannot be reorganized without breaking links in\n * code nobody can edit; the docs site redirects instead. `scripts/sync-diagnostics.mjs` imports this constant, so the\n * pages and the bundles can never disagree about where they are.\n */\nexport const DOCS = 'https://verajs.dev/e/';\n\n/**\n * **What this copy of the framework has already said** (Brian's ruling, 2026-11-12): the ONE memory behind `warnOnce`, `errorOnce`\n * and `hasWarned`, for DEVELOPMENT-ONLY warnings. It replaced the hand-written once-flags every package kept\n * (`saidLists`, `warnedDrop`, per-element WeakSets, per-key Sets: two naming styles, Brian: no names). **A warning that\n * ships to production keeps its memory at its site** (bytes, measured 2026-11-12: the shared memory costs +80–145 B gz\n * per bundle); development-only warnings use warnOnce. Module state by necessity, since \"once\" spans every call on the\n * page. One per BUNDLE COPY, exactly the scope each flag had, because this package is inlined into every bundle.\n * A code, or `code key` for a string key, in a Set. An object key (an element, a setup function) in a WeakMap, so its\n * entry goes with the object. Marked pure, so a bundle that never prints once drops both.\n */\nconst printed = /* @__PURE__ */ new Set<string>();\nconst printedOn = /* @__PURE__ */ new WeakMap<object, Map<string, Set<unknown>>>();\n/**\n * A once's KEY: none (once per page), a string (once per that string), an object (once per that object: an element, a\n * class, a setup function), or the PAIR `[object, value]`, a value key on that object (a store write: the object and its\n * property; a keyed list: the list and the duplicate key, compared as the list compares them, by value, so `1` and `'1'`\n * stay apart). A pair is the only array a key may be.\n */\ntype OnceKey = string | object | readonly [object, unknown];\n/** Where an object key's (code, value) lives: the value set for that code on that object, made on demand. */\nconst valuesOn = (on: object, code: string, make: boolean): Set<unknown> | undefined => {\n let codes = printedOn.get(on);\n if (codes === undefined) {\n if (!make) return undefined;\n printedOn.set(on, (codes = new Map()));\n }\n let values = codes.get(code);\n if (values === undefined && make) codes.set(code, (values = new Set()));\n return values;\n};\n/** The object and value of an object or pair key. */\nconst split = (key: object): readonly [object, unknown] => (Array.isArray(key) ? (key as unknown as readonly [object, unknown]) : [key, undefined]);\n/** Whether (code, key) is new, recording it if so. */\nconst firstTime = (code: string, key?: OnceKey): boolean => {\n if (key === undefined || typeof key === 'string') {\n const entry = key === undefined ? code : `${code} ${key}`;\n if (printed.has(entry)) return false;\n printed.add(entry);\n return true;\n }\n const [on, sub] = split(key);\n const values = valuesOn(on, code, true)!;\n if (values.has(sub)) return false;\n values.add(sub);\n return true;\n};\n\n/**\n * **One shape for every diagnostic the framework prints** — the short line production keeps, the whole sentence\n * development adds — so a package converting its messages writes a table and a call, never its own format.\n *\n * production `[vera] hydration: element: found <i> — https://verajs.dev/e/hydration-fallback`\n * development `[vera] hydration: element: found <i> — fell back to a client render: … (hydration-fallback)`\n *\n * `subject` is the free information — what the code already has at hand, naming the problem area — the same in both\n * builds. `prose` is development only: the package's table entry (`Prose`), called behind `__DEV__` at the call site so\n * the table goes unreferenced in production and rollup drops it whole. Production prints the code inside the link, so\n * the reader is one click from the explanation, which `scripts/sync-diagnostics.mjs` publishes from the same tables.\n *\n * **Every production message is coded** (Brian, 2026-11-11; this supersedes \"convert where smaller\", 2026-10-02):\n * consistency over a few bytes, so no package keeps a hand-written production line beside its table.\n */\n/*\n * The parameter names are deliberately unlike anything a caller holds: terser will not inline a function whose\n * parameter shadows a name at the call site (measured 2026-10-02 — directives passes its own `code`, and a parameter\n * called `code` left `((e,t,n)=>`…`)(0,t,n)` in its bundle, +8 B; renamed, the call folds to the bare template).\n */\n/**\n * **A misused API, named by its function** — the thrown-error twin of `diagnostic()`: `untrack: expected a function …\n * (untrack-not-function)`, function-first because a stack already names the source and the sweep reads that shape. The\n * prose comes from a package's table, behind `__DEV__`, so a development-only guard costs production nothing.\n */\nexport const misuse = (forName: string, withCode: string, andProse?: false | readonly [string, string?]) =>\n __DEV__ && andProse\n ? `${forName}: ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `${forName}: ${DOCS}${withCode}`;\n\n/**\n * **A misused API and what it was misused ABOUT** — `misuse()` with a subject, in `diagnostic()`'s ` — ` separator:\n * `parseFrontmatter: line 3 — https://verajs.dev/e/cms-frontmatter-unsupported`. The subject is the free information\n * (a line, a URL and its status) and prints in both builds. A sibling rather than an optional parameter on `misuse()`,\n * because `misuse()` is inlined into every bundle that throws and a conditional subject would tax all of them for a\n * shape few need; a sibling is tree-shaken where unused.\n */\nexport const misuseAbout = (forName: string, aboutSubject: string, withCode: string, andProse?: false | readonly [string, string?]) =>\n __DEV__ && andProse\n ? `${forName}: ${aboutSubject} — ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `${forName}: ${aboutSubject} — ${DOCS}${withCode}`;\n\nexport const diagnostic = (\n inArea: string,\n bySubject: string,\n withCode: string,\n andProse?: false | readonly [string, string?]\n) =>\n /** `__DEV__` HERE as well as at the call: production folds this to the one-line form, branch and all. */\n __DEV__ && andProse\n ? `[vera] ${inArea}: ${bySubject} — ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `[vera] ${inArea}: ${bySubject} — ${DOCS}${withCode}`;\n\n/**\n * **Text from outside — a file path, a YAML key, a URL, an error's message — quoted before it reaches a line.** A log is a\n * pipeline, and such text can be shaped by an author or a request: a newline in it forges a line, an ESC sequence hides\n * one (log injection). `JSON.stringify` escapes both; cut to 80 characters so one value cannot fill the log. @verajs/ssr\n * keeps a twin (it cannot import this), held equal by tests/ssr-coded-diagnostics.\n */\n/**\n * `max` caps the length (80 by default); `Infinity` keeps the whole text for a value worth reading in full — a site\n * owner's own path — which is still ESCAPED: truncation and escaping are separate jobs, and a path is not free of control\n * characters just because its owner wrote it (2026-10-09).\n */\nexport const quoted = (text: string, max = 80): string => JSON.stringify(text.length > max ? `${text.slice(0, max)}…` : text);\n\n/**\n * **The errors a package constructs, marked as its own** — so a wrapper that reports an inner refusal (cms's\n * `generateManifest` around a frontmatter line) carries it as it is: already formatted, its outside text already\n * quoted. Anything else is foreign, and quoted. Identity, never a shape test: a message can imitate ours, an identity\n * cannot. @verajs/ssr keeps a twin (it cannot import this).\n */\nconst ours = /* @__PURE__ */ new WeakSet<object>();\nexport const own = <E extends Error>(error: E): E => {\n ours.add(error);\n return error;\n};\nexport const isOwn = (error: unknown): boolean => typeof error === 'object' && error !== null && ours.has(error);\n\n/**\n * **Whether this copy has already said `code` (for `key`)**: for a GUARD only, where deciding to warn costs work worth\n * skipping once the warning is out (development's whole-tree walk for unwired directive attributes, an event-name\n * guess over every property of an element). A site that only prints calls `warnOnce`. Asks, never records.\n */\nexport const hasWarned = (code: string, key?: OnceKey): boolean => {\n if (key === undefined || typeof key === 'string') return printed.has(key === undefined ? code : `${code} ${key}`);\n const [on, sub] = split(key);\n return valuesOn(on, code, false)?.has(sub) === true;\n};\n\ntype Detail = false | readonly [string, string?] | (() => readonly [string, string?] | undefined);\n/**\n * The printer behind both, on one level. `andDetail` is `diagnostic()`'s prose, or a function returning it where building\n * the sentence costs something: it is called only the first time. `...andMore` rides beside the line behind '%s' (an\n * element, a thrown error), never inside it, so text from outside cannot forge a line. The console method is read at the\n * call, so a test that replaces `console.warn` sees it.\n */\nconst sayOnce =\n (level: 'warn' | 'error') =>\n (inArea: string, bySubject: string, withCode: string, andDetail?: Detail, forKey?: OnceKey, ...andMore: unknown[]): void => {\n if (!firstTime(withCode, forKey)) return;\n const line = diagnostic(inArea, bySubject, withCode, typeof andDetail === 'function' ? andDetail() : andDetail);\n if (andMore.length) console[level]('%s', line, ...andMore);\n else console[level](line);\n };\n/**\n * **A diagnostic said once per page** (per key, where one is given: a string, or an object such as the element it is\n * about): `diagnostic()`'s arguments, then the key, then what rides beside the line. Coded in production exactly as\n * `diagnostic()` is, because it IS `diagnostic()`. `errorOnce` is its twin on `console.error`, for a refusal a page should\n * not miss.\n */\nexport const warnOnce = /* @__PURE__ */ sayOnce('warn');\nexport const errorOnce = /* @__PURE__ */ sayOnce('error');\n","/**\n * **The codes more than one package prints — DEVELOPMENT ONLY, except to the jsx compiler** (2026-10-09). A\n * fact said by two emitters has\n * ONE docs page and ONE text, so its prose lives here, in the lowest dependency every emitter shares, and each raises\n * it as `SHARED['code']` — never a second sentence in a second table (the dev line would stop being the docs page's\n * text). Referenced only behind `__DEV__`, so production drops it whole — but the jsx COMPILER raises `voidChildren`\n * and `styleObject` in every build: a compile error is a build tool's only output, and Vite loads the production one. `scripts/sync-diagnostics.mjs` publishes it\n * as `packages/shared-utils/diagnostics.json`; the uniqueness check sees each code here once.\n *\n * Also the home of messages shared-utils' OWN code prints on a renderer's behalf (adopt-property, markup-grammar,\n * isSelection) — the same rule: the emitter is shared, so the text is.\n *\n * **One named export per code, never one object** (measured 2026-10-09): rollup cannot drop an unused KEY of\n * an object literal, so a shared `PROSE` object put every shared message into every importer's development bundle.\n * A named export is dropped per function. **The export's name IS the code** — `tagCalled` is `tag-called` — so the\n * map sync and the tests read is derived (`proseOf`, scripts/diagnostic-tables.mjs), never kept by hand, and a call\n * `SHARED.tagCalled(…)` names its code exactly once.\n */\nimport type { Prose } from './types.js';\n\n/**\n * core's `html`/`svg`/`mathml` and the renderer's `tag` — a tagged template called as a function. The FACT is shared;\n * the EXAMPLE is each emitter's: `html` writes markup, `tag` an element name — so the emitter passes it.\n */\nexport const tagCalled: Prose = (tag, received, example) => [\n `expected a template literal and received ${received}.`,\n `It is a tagged template — write ${tag}\\`${example}\\`, not ${tag}('${example}').`,\n];\n/** core's props adoption on an `init()` element, and the renderer's on any other element. */\nexport const getterOnlyProp: Prose = (key) => [\n `received a bound property \\`.${key}\\` (or \\`!${key}\\`), but its class declares \\`${key}\\` as a getter with no setter — the value cannot be delivered and the binding is ignored.`,\n 'Add a setter, or stop binding it.',\n];\n/** shared-utils' `adoptProperty` (renderer, spread): an element that never drains the record loses it at upgrade. */\nexport const upgradeClobber: Prose = (name) => [\n `the value bound to \\`${name}\\` was replaced while the element upgraded. A class field is the usual cause: at ES2022 \\`${name}?: …\\` emits \\`${name};\\`, which runs during upgrade and overwrites whatever was set beforehand.`,\n `Write it \\`declare ${name}?: …\\` instead. A component that calls init() adopts bound properties automatically and never sees this; this element did not. Ignore this if the component replaced the value on purpose.`,\n];\n/** shared-utils' `isSelection` (renderer, spread). */\nexport const selectMultiple: Prose = (name) => [\n `\\`${name}\\` controls only ONE selection here, and a selection the user adds is kept — it is not controlled.`,\n 'Bind `?selected=${…}` on each <option> to control every selection.',\n];\n/** shared-utils' `contentClash` (renderer, spread): a content-replacing property beside content of the element's own. */\nexport const contentClash: Prose = (tag, name, alone) => [\n `<${tag}> binds \\`.${name}\\`, which replaces the element's content, and also has content of its own — markup or a child binding, which the write would strand.`,\n `Bind one or the other: the property alone (\\`${alone}\\`), or the content alone.`,\n];\n/** shared-utils' `tagHole` (renderer; @verajs/ssr keeps a twin). */\nexport const tagHole: Prose = () => [\n 'an expression in tag position (`<${…}>`) cannot be a tag name — a tag name must be a tag value.',\n \"Use `tag`h1`` from @verajs/renderer/tag, with that entry's `html`.\",\n];\n/** core's `wire` (at wire time) and the renderer (a template built before slots was wired, at render). */\nexport const lateTemplateModule: Prose = () => [\n \"a 'template' or 'element' module (namespaces, elements, slots) was wired after the renderer had already built templates — those never ask it, and keep rendering without it.\",\n 'Wire it beside the renderer, before the first render.',\n];\n/** The renderer and spread (two bundles); @verajs/ssr refuses the same URLs silently today. */\nexport const scriptUrl: Prose = (name) => [\n `\\`${name}\\` was given a javascript: URL — refused, and the attribute removed.`,\n 'A bound URL is data, and data must never become code.',\n];\n/**\n * The renderer and spread: `kind` is what the value was (dev-values' `attributeValueKind`); `property` is the\n * emitter's own spelling of a property binding — a template's `.name=${value}`, a spread's `'.name': value`.\n */\nexport const attributeValue: Prose = (name, kind, property) => [\n `the attribute \\`${name}\\` was given ${kind}. An attribute value is a string and nothing else.`,\n `If the element is meant to RECEIVE this value, bind a property instead — \\`${property}\\` — which is how a custom element takes anything that is not text. If it is meant to be read as text, convert it where you know what it means: \\`date.toISOString()\\`, \\`list.join(' ')\\`. A Date in particular serializes with the SERVER's timezone on one side and the browser's on the other, so it will not survive hydration.`,\n];\n/** The renderer and spread: `type` is the value's `typeof`. */\nexport const notAListener: Prose = (name, type) => [\n `@${name} was given ${type === 'object' ? 'an object with no handleEvent method' : `a ${type}`}, which cannot listen — the event will do nothing.`,\n 'Pass a function, or an object with a handleEvent method. A missing handler is `undefined` or `false`, both of which are fine; this is neither.',\n];\n/** The renderer (and @verajs/ssr's twin): an expression inside an attribute NAME. */\nexport const nameExpression: Prose = (written, given) => [\n `an attribute name cannot be an expression — \\`${written}\\` is read by the parser before any value exists.`,\n `A name known only at runtime is a spread: \\`\\${spread({ [\\`${written}\\`]: ${given} })}\\` (from @verajs/renderer/spread).`,\n];\n/** The renderer (and, ruled 2026-10-09, @verajs/ssr): data shaped like a template, not made by `html`. */\nexport const forgedTemplate: Prose = () => [\n 'is shaped like a template but was not made by html`` — rendered as text.',\n 'A template from data (JSON, or html([markup])) is never markup; for trusted markup, bind it: <div .innerHTML=${markup}>.',\n];\n/** The renderer and spread (two bundles; @verajs/ssr refuses the same): binding `__proto__`. */\nexport const protoBinding: Prose = (written) => [\n `binds \\`${written}\\`, which would replace the element's own prototype and destroy it — no property write does this, and no use of it is legitimate.`,\n 'The binding is ignored.',\n];\n/** The renderer and spread: a bound `srcdoc` ATTRIBUTE. `property` is the emitter's spelling of the property binding. */\nexport const srcdocAttribute: Prose = (property) => [\n 'binds the `srcdoc` attribute, which renders its value as an HTML document — refused.',\n `If the markup is trusted and sanitized, bind the property: \\`${property}\\`.`,\n];\n/** The renderer and spread: a bound inline-handler attribute (`onclick`). `event` is the emitter's event spelling(s). */\nexport const handlerAttribute: Prose = (name, event) => [\n `binds the \\`${name}\\` attribute, which runs its value as code — refused.`,\n `Bind a function as an event instead: ${event}.`,\n];\n/**\n * The jsx compiler and the renderer's `tag` — children given to a void element. Both refuse; the FATE the refusal\n * prevents is each emitter's: compiled, they would land after the element; through `tag`, vanish.\n */\nexport const voidChildren: Prose = (tag, fate) => [\n `<${tag}> is a void element — it has no end tag and takes no children, so ${fate}; refused.`,\n 'Move the children out, or use an element that takes content.',\n];\n/** The jsx compiler and the renderer's `tag` — an object `style`. The EXAMPLE is each emitter's spelling. */\nexport const styleObject: Prose = (example) => [\n 'style expects a STRING, not an object.',\n `Build the string: ${example}.`,\n];\n/**\n * An option a module or loader does not have — autoloader(), directiveLoader(), router(), and the directives packs\n * remote(), sensors(), motion(). One fact and one fix; the module is the line's SUBJECT and the list is its own.\n */\nexport const unknownOption: Prose = (key, list) => [\n `\\`${key}\\` is not an option, so it was ignored.`,\n `The options are ${list}.`,\n];\n","import type { PropertyHost } from './types.js';\nimport { diagnostic } from './diagnostic.js';\nimport * as SHARED from './diagnostics.js';\n\n/**\n * **Delivering a bound property to a custom element that may not receive it yet** — the one home of the\n * rule `@verajs/renderer` (a `.prop` template binding) and `@verajs/renderer/spread` (a `.prop` bag key)\n * both apply. They ship as separate bundles that cannot import each other, so this package, inlined into\n * each, is where the rule lives once; before, each carried a full copy and a fix had to visit both.\n *\n * Returns where the binding stands after this write:\n * - `0` — still adopting: nothing received the value, so it was recorded in the element-carried\n * `_$props$`, which core's `init()` drains over whatever the class's field initializers wrote at\n * upgrade. Call again on the next write.\n * - `1` — received (a setter anywhere on the chain, an initialized component's `_$adopt$`, or an element\n * that is already upgraded): later writes are plain property writes.\n * - `2` — refused: a getter with no setter, where the plain write would throw. Later writes do nothing.\n *\n * `_$props$` and `_$adopt$` are `$`-named because they cross bundle boundaries (renderer, spread, core)\n * and must survive property mangling.\n *\n * **`_$adopt$` is a BRAND, not just a slot:** present means \"core has initialized this component\", which is what routes\n * a delivery to the live accessor (`1`) instead of the `_$props$` record. Do not move it to a class's PROTOTYPE\n * (2026-10-10): every instance would carry it BEFORE `init`, and a delivery to an upgraded-but-uninitialized element\n * would be adopted into a store that does not exist yet. It is ONE shared function written onto each element at `init`,\n * called with the element as `this` (`adopt.call(element, …)`) — 2026-10-11: the closure it replaced was free in\n * optimized code (measured) but cost Chrome's interpreted first render one allocation per component.\n */\n\n/** Development only: getter-only names already reported, per element — a `!name` re-asserts on every render. */\nlet refused: WeakMap<PropertyHost, Set<string>> | undefined;\n\nexport const adoptProperty = (element: PropertyHost, name: string, value: unknown): 0 | 1 | 2 => {\n /**\n * **`__proto__` is refused HERE, at the receiver** (2026-11-10): `element.__proto__ = v` replaces the element's\n * prototype, and an own `__proto__` key reaches a bag through `JSON.parse`. This is the choke point every delivery\n * passes; the renderer's template binding and spread's bag key refuse it first, with a development warning naming\n * where it was written (their second addresses: renderer.ts `proto-binding`, spread.ts refusal 3).\n */\n if (name === '__proto__') return 2;\n const adopt = element._$adopt$ as ((key: string, value: unknown) => void) | undefined;\n /** The walk comes first: what it finds decides whether writing is even legal. */\n for (let carrier: object | null = element; carrier !== null; carrier = Object.getPrototypeOf(carrier)) {\n const desc = Object.getOwnPropertyDescriptor(carrier, name);\n if (desc === undefined) continue;\n if (desc.set !== undefined) {\n element[name] = value;\n return 1;\n }\n if (desc.get !== undefined) {\n if (adopt !== undefined) adopt.call(element, name, value);\n else if (__DEV__) {\n const names = (refused ??= new WeakMap()).get(element) ?? new Set<string>();\n refused.set(element, names);\n if (!names.has(name)) {\n names.add(name);\n console.warn(diagnostic('renderer', `<${element.localName}>`, 'getter-only-prop', __DEV__ && SHARED.getterOnlyProp(name)));\n }\n }\n return 2;\n }\n break; // a data property: an own field, or an inherited default — nothing receives it\n }\n element[name] = value;\n if (adopt !== undefined) {\n adopt.call(element, name, value);\n return 1;\n }\n const record = (element._$props$ ??= {}) as Record<string, unknown>;\n const first = __DEV__ && !Object.hasOwn(record, name);\n record[name] = value;\n /** Upgrade is read off the PROTOTYPE — a bag key named `constructor` can shadow `el.constructor`. The realm is the element's. */\n const view = element.ownerDocument.defaultView as unknown as {\n HTMLElement: { prototype: object };\n customElements: CustomElementRegistry;\n } | null;\n const upgraded = view === null || Object.getPrototypeOf(element) !== view.HTMLElement.prototype;\n /** Development only: an element that never drains still loses the value at upgrade — told apart by ownership. */\n if (__DEV__ && view !== null && !upgraded && first) {\n const tag = element.localName;\n view.customElements.whenDefined(tag).then(() => {\n let owned = false;\n for (let carrier: object | null = element; carrier !== null; carrier = Object.getPrototypeOf(carrier)) {\n const desc = Object.getOwnPropertyDescriptor(carrier, name);\n if (desc === undefined) continue;\n owned = desc.get !== undefined || desc.set !== undefined;\n break;\n }\n if (!owned && element[name] !== record[name])\n console.warn(diagnostic('renderer', `<${tag}>`, 'upgrade-clobber', __DEV__ && SHARED.upgradeClobber(name)));\n });\n }\n return upgraded ? 1 : 0;\n};\n","import { misuse } from './diagnostic.js';\nimport * as SHARED from './diagnostics.js';\n/**\n * HTML's own element grammar — the facts about tags that every package emitting or reading markup\n * has to agree on.\n *\n * These are not this framework's rules; they are the parser's, and a package that guesses at them\n * produces markup whose *parse* differs from what its author wrote. That failure is silent by\n * nature: nothing throws, the page renders, and the DOM simply has a different shape than the\n * source said. See `VOID_ELEMENTS` below for the two measured instances.\n *\n * **Why here.** These sets had grown copies in `@verajs/ssr`, `@verajs/cms` and (as a regex) the\n * renderer, all agreeing by luck rather than by construction. This file is the one source for\n * every package that can take a build-time import — `@verajs/shared-utils` is private and inlined,\n * so importing it costs a consumer nothing at runtime and adds no published dependency.\n *\n * **`@verajs/ssr` cannot import it** and keeps its own copies: that package publishes its `src`\n * with no dependencies at all, so an import of a package that is never published would break the\n * published tarball. The same constraint already forced a twin of `escapeStyleText` there. A copy\n * is acceptable; a copy nothing checks is not, so `tests/markup-grammar-homes.test.mjs` drives\n * every copy against this file source-to-source rather than trusting they get edited together.\n *\n * **A consumer may keep a different SHAPE for the same fact** where a hot path needs one — the\n * renderer matches raw-text tags with a case-insensitive regex rather than lowercasing a string to\n * probe a `Set`. The rule is agreement, not representation, and the homes test asserts agreement\n * across whatever shape each home uses.\n */\n\n/**\n * Elements with no end tag, and therefore no children.\n *\n * Both directions of getting this wrong are silent, and both were live in this repo until the\n * audit of 2026-09-12 measured them:\n *\n * - **A non-void element written self-closing swallows what follows it.** HTML has no\n * self-closing syntax outside foreign content, so `<div/><span>after</span>` parses as\n * `<div><span>after</span></div>` — the sibling becomes a child. Every JSX toolchain treats\n * `<div/>` as an empty element, which is exactly why authors write it.\n * - **A void element written with an end tag is duplicated.** A parser reads `</br>` as *another*\n * `<br>`, so `<br></br>` renders two line breaks where the author wrote one.\n *\n * Inside `<svg>` and `<math>` the parser switches to foreign content, where XML self-closing *is*\n * honored — so neither rule applies there, and a consumer that checks must know where it is.\n */\nexport const VOID_ELEMENTS = new Set([\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',\n 'link', 'meta', 'param', 'source', 'track', 'wbr',\n]);\n\n/**\n * Elements a parser reads the children of as text rather than as markup.\n *\n * Two pieces of measured lore travel with this list and are the reason it is not read off a spec:\n *\n * - `iframe` and `noscript` were once absent from the SSR copy, which built a tree no browser\n * builds — `<noscript><img src=\"x\"></noscript>` produced an element, so\n * `querySelectorAll('noscript img')` answered 1 where every engine answers 0.\n * - `noscript` is raw text only when scripting is ENABLED. Fragment parsing disables it, and\n * Chromium and WebKit then parse the content as markup while Firefox parses it as text — so a\n * binding inside `<noscript>` worked in two engines and painted the renderer's internal marker\n * onto the page in the third. Listing it is safe in both parses.\n *\n * jsdom is not the oracle for either: it parses with scripting disabled and agrees with the old,\n * wrong list.\n */\nexport const RAW_TEXT_ELEMENTS = new Set(['style', 'script', 'textarea', 'title', 'iframe', 'noscript']);\n\n/**\n * The hyphenated names SVG and MathML already define, which the custom-elements spec reserves — so a\n * dash in one of these does NOT make it a custom element.\n *\n * Measured, the one that matters: JSX treats a dash-named tag as a custom element and compiles its\n * attributes to PROPERTIES, which turned `<annotation-xml encoding=\"text/html\">` into\n * `.encoding=${…}`. The HTML parser decides that element is an integration point from the\n * ATTRIBUTE on its start tag, so HTML content inside was moved out of the `<math>` entirely, and a\n * custom element there was built MathML-namespaced and never upgraded — silent on the server and\n * the client alike. That is also the exact spelling the renderer's own warning recommends.\n */\nexport const RESERVED_ELEMENT_NAMES = new Set([\n 'annotation-xml', 'color-profile', 'font-face', 'font-face-src',\n 'font-face-uri', 'font-face-format', 'font-face-name', 'missing-glyph',\n]);\n\n/**\n * **A custom element, by its name:** a dash, except the eight names SVG and MathML already own (above). One\n * definition for every package that asks — `@verajs/jsx` compiles such a tag's attributes to properties, and\n * `@verajs/renderer/slots` captures such a host's children. (The renderer's own property paths ask a narrower\n * question, the bare dash, on its hot path; a reserved name never carries a property binding.)\n */\nexport const isCustomElementName = (tag: string): boolean =>\n tag.includes('-') && !RESERVED_ELEMENT_NAMES.has(tag.toLowerCase());\n\n/**\n * A URL whose scheme a browser reads as `javascript:` — navigating to one runs it, so a BOUND value\n * that parses this way is code arriving as data, never a link.\n *\n * Matched the way the URL Standard's parser reads a scheme, because that is the only reading that\n * matters: leading C0 controls and spaces are stripped, ASCII tab, LF and CR are removed anywhere, and\n * the scheme is case-insensitive. A check that only lowercases is bypassed by `\" jAvA\\tscript:\"`,\n * which every engine navigates to. React's blocking pattern is the same rule.\n *\n * `@verajs/ssr` keeps a twin (it cannot import this package), held to this one by\n * `tests/url-sinks.test.mjs`, so a server never emits a link the client refuses.\n */\n// eslint-disable-next-line no-control-regex\nexport const SCRIPT_URL = /^[\\u0000- ]*j[\\t\\n\\r]*a[\\t\\n\\r]*v[\\t\\n\\r]*a[\\t\\n\\r]*s[\\t\\n\\r]*c[\\t\\n\\r]*r[\\t\\n\\r]*i[\\t\\n\\r]*p[\\t\\n\\r]*t[\\t\\n\\r]*:/i;\n\n/**\n * **Every bound name whose value is checked for a `javascript:` URL — and how.** One test answers both.\n *\n * Captured, checked from the start: the attributes (and their reflecting properties) whose value a browser\n * NAVIGATES to or loads as a document — links and areas (`href`, SVG's `xlink:href`), forms (`action`,\n * `formaction`), frames (`src`), and `<object data>`. `src` is matched on every element — refusing one on an `<img>`\n * costs nothing, since an image never runs it. Resource-only attributes (`poster`, `srcset`) are fetched, never run,\n * so they are not listed.\n *\n * Not captured, checked ITEM BY ITEM (`SCRIPT_URL_ITEM`): an SVG animation's values — `to`, `from`, `by`, `values`.\n * `<animate attributeName=\"href\" to=\"javascript:…\">` (or `<set>`, or `values`) writes its value onto the link it\n * animates, and clicking the link then RUNS it: measured 2026-09-30 in Chromium, Firefox and WebKit, through `href`\n * and `xlink:href` alike. Refused on EVERY element and whatever `attributeName` says, because `attributeName` can\n * itself be bound or spread, a server spread has no element to ask, and no legitimate value of any attribute by these\n * names starts with `javascript:` (a component's `to`, a router link's, is a URL too). **Only these names are checked\n * item by item**: an unanchored test scans the whole value for `;`, which on a bound `src` holding a data URI costs\n * ~0.45 ms per MB per update in Chromium and Firefox (measured 2026-09-30), where the anchored `SCRIPT_URL` stops at\n * the first character.\n *\n * Case-insensitive, because property spellings (`formAction`) and attribute spellings meet here. `@verajs/ssr` keeps\n * a twin, held to this one by `tests/url-sinks.test.mjs`.\n */\nexport const URL_SINK = /^(?:(href|src|action|formaction|xlink:href|data)|to|from|by|values)$/i;\n\n/**\n * `SCRIPT_URL` at the start of the value OR of any `;`-separated item of it — an animation's `values` list\n * (`\"#a;javascript:…\"`) applies every item in turn. Only for an animation's values (`URL_SINK`'s uncaptured names): a `;` inside an `href` is a path\n * character, and `/p;javascript:x` is a working link, never a script. Written out rather than derived from\n * `SCRIPT_URL`: the repeated text costs less gzipped than the code that would build it.\n */\n// eslint-disable-next-line no-control-regex\nexport const SCRIPT_URL_ITEM = /(?:^|;)[\\u0000- ]*j[\\t\\n\\r]*a[\\t\\n\\r]*v[\\t\\n\\r]*a[\\t\\n\\r]*s[\\t\\n\\r]*c[\\t\\n\\r]*r[\\t\\n\\r]*i[\\t\\n\\r]*p[\\t\\n\\r]*t[\\t\\n\\r]*:/i;\n\n/**\n * **An inline event-handler attribute** — `on` and a letter, any case (`onclick`, `onLoad`, `onbeforeinput`): its\n * value is run as CODE, so a BOUND one is code arriving as data, refused by the template scanner, `spread` and the\n * server alike (a static `onclick=\"save()\"` is the author's own and untouched). Broad on purpose — it also refuses a\n * bound `once=`/`online=` attribute; the precise rule would need the platform's list of handler names. `@verajs/ssr`\n * keeps a twin, held to this one by `tests/inline-handlers.test.mjs`.\n */\nexport const INLINE_HANDLER = /^on./i;\n\n/**\n * **The properties that replace an element's whole content** — a binding to one owns the element's children, so it\n * cannot share the element with content of its own (markup, or a child binding the write would strand: a later commit\n * into it then throws on a missing parent). Development refuses the pair in the template scanner and in `spread` alike.\n */\nexport const CONTENT_PROPERTY = /^(?:textContent|innerHTML|innerText|outerHTML|outerText)$/;\n/**\n * Whether an element has content of its own that a content-replacing write would strand or lose: a child that is not\n * whitespace-only text (formatting whitespace loses nothing), or — `$content`, set in development by the renderer — a\n * child binding that owns the element whole and leaves no node behind until it commits. The element-specific `.text`\n * setters (`<a>`, `<option>`, `<title>`, `<script>`) are deliberately not in the list: a custom element's own `text`\n * prop is common, and would be refused for nothing.\n */\nexport const ownsContent = (element: Element): boolean => {\n if ((element as Element & { $content?: boolean }).$content === true) return true;\n for (let node = element.firstChild; node !== null; node = node.nextSibling)\n /**\n * An EMPTY text node is a child binding's anchor, not formatting: formatting whitespace is never empty. And\n * formatting is HTML's whitespace, `[ \\t\\n\\f\\r]` — not JS's `trim()`, which would let an ` ` be overwritten.\n */\n if (node.nodeType !== 3 || (node as Text).data === '' || /[^ \\t\\n\\f\\r]/.test((node as Text).data)) return true;\n return false;\n};\n/** `side` is the module the user wired — `renderer` for a template, `spread` for a spread. */\nexport const contentClash = (side: string, tag: string, name: string): never => {\n throw new Error(misuse(side, 'content-clash', __DEV__ && SHARED.contentClash(tag, name, side === 'spread' ? `<${tag} \\${spread({ '.${name}': … })}></${tag}>` : `<${tag} .${name}=\\${…}></${tag}>`)));\n};\n\n/**\n * **An expression in TAG-name position** (`<${x}>`, `</${x}>`, `<my-${x}>`) without `@verajs/renderer/tag`: no\n * element can be made from it — the parser reads a tag name before any value exists. Refused by the client in\n * development and by the server in every build, with one message. The tag entry splices a tag VALUE into the\n * statics before the renderer sees it, so only a non-tag ever reaches here.\n */\nexport const TAG_NAME_HOLE = /<\\/?[^\\s>]*$/;\nexport const tagHole = (side: string): never => {\n throw new Error(misuse(side, 'tag-hole', __DEV__ && SHARED.tagHole()));\n};\n","import type { HandlerHolder, Untracked } from './types.js';\nimport { diagnostic } from './diagnostic.js';\nimport * as SHARED from './diagnostics.js';\n\n/**\n * Get an object's type.\n *\n * @param obj The object\n * @return The type\n */\nexport const getType = (obj: unknown) => Object.prototype.toString.call(obj).slice(8, -1).toLowerCase();\n\n/**\n * Weak collections need their per-key dependencies stored weakly, or tracking `weakMap.get(obj)`\n * holds `obj` and defeats the whole point of the type. Checked by type string rather than\n * `instanceof`, which fails across realms (iframes, `vm`).\n */\n/**\n * A WeakMap or WeakSet (or WeakRef) — read from `Symbol.toStringTag`, the tag `Object.prototype.toString` itself reads, so\n * the answer is the same (another realm's collections included) without building and lower-casing a string on every first\n * tracked read of every object.\n */\nexport const isWeakCollection = (item: unknown) => {\n const tag = (item as { [Symbol.toStringTag]?: unknown } | null)?.[Symbol.toStringTag];\n return typeof tag === 'string' && (tag[0] === 'W' || tag[0] === 'w');\n};\n\n/**\n * Remove a trailing slash from an url if its not root url (`/`).\n *\n * @param str String to remove trailing slash from\n */\nexport const stripTrailingSlash = (str: string) => (str !== '/' && str.endsWith('/') ? str.slice(0, -1) : str);\n\n/**\n * **Reports an error nothing else handled, the way the platform reports one.** `reportError` fires\n * the window's `error` event — what `window.onerror`, error trackers and test runners listen for —\n * without unwinding the caller, so one failing hook or ref never stops its siblings. A bare\n * `console.error` reached none of those: a component could stop updating while every page-error\n * listener stayed silent. Off-browser (Node has no `reportError`) the console is all there is.\n * `line` is the framework's own line, printed beside the error — a CODED one (2026-10-09):\n * each caller passes `'[vera] <code>'` in production and its table's `diagnostic()` sentence in development, both\n * literal codes at the call site, so the static checks read them. The subject is fixed wording too (`a hook`, `an\n * element ref`), never a tag name: this line is the console's FORMAT (no `'%s'`, which measured +2–3 B on the renderer\n * bundles), so nothing from outside may reach it — the element goes to the `'error'` handlers instead. Production prints it only where the platform has no\n * `reportError` (Node); in a browser, `reportError` alone reports.\n *\n * Shared by core (a hook threw) and the renderer (a ref threw) so the fallback is one rule.\n */\nexport const reportUncaught = (error: unknown, line: string) => {\n if (typeof reportError !== 'function') console.error(line, error);\n else {\n if (__DEV__) console.error(line, error);\n reportError(error);\n }\n};\n\n/**\n * **Reports what user code a render called threw — to the app's `'error'` chain, else as uncaught.** One rule for\n * every callback the framework runs on the user's behalf and survives: a hook (core), an element ref, and an element\n * claim's `create`/`mount`/`unmount` (the renderer). The caller catches at the call site and carries on, so one\n * failing callback never stops its siblings or leaves a commit half applied. `element` is the component the error\n * belongs to, handed to each handler. Every throw is reported — nothing is deduped, as a hook's never was.\n * **Core keeps a deliberate twin** (`reportHookError`, the same rule as a `forEach`): routed through here it measured\n * +11 B gzip on `vera.min.js` (2026-10-09). A change to the rule changes both.\n */\nexport const reportTo = (handlers: readonly unknown[] | undefined, error: unknown, element: Element | undefined, line: string) => {\n if (handlers?.length) for (const handler of handlers) (handler as (error: unknown, element?: Element) => void)(error, element);\n else reportUncaught(error, line);\n};\n\n/** The component a render root belongs to: a shadow root's host, or a light root itself. */\nexport const hostOf = (root: Node | null | undefined): Element | undefined =>\n root == null ? undefined : root.nodeType === 11 ? (root as ShadowRoot).host : (root as Element);\n\n/** `fn(a, b, c)`, tracked as the caller is — the stand-in for core's `untracked` when no core was wired. */\nexport const call: Untracked = (fn, a, b, c) => fn(a!, b!, c!);\n\n/**\n * **Runs a bound handler, and its callers run it UNTRACKED**: the renderer's template `@event` and spread's event key,\n * each through `untracked(dispatch, holder, event)` (2026-10-09). An effect that fires an event synchronously\n * (`el.click()`, `focus()`, `dispatchEvent`) runs the handler INSIDE itself, and the handler's reads subscribed the\n * effect: a handler doing `state.n++` made the effect re-run on every click, a self-feeding loop held to one round per\n * frame, forever (measured). A handler's reads are event-time decisions, never a hook's inputs. The directives engine's\n * delegated `listen` makes the same choice its own way. A function is called with the element as `this`; an object\n * through its `handleEvent`. One function for both callers (Brian's size-audit ruling, 2026-11-13): it was two\n * identical copies, so a fix had two addresses; each bundle still inlines its own.\n */\nexport const dispatch = (holder: HandlerHolder, event: Event) => {\n const handler = holder._handler as EventListener | EventListenerObject | null;\n if (typeof handler === 'function') handler.call(holder._element as never, event);\n else if (typeof handler?.handleEvent === 'function') handler.handleEvent(event);\n};\n\n/**\n * **Whether a property binding is a `<select>`'s SELECTION** — `value` or `selectedIndex` — which the renderer and\n * `spread` both treat as live: re-asserted every render and compared against the live value (as `!value` is), because\n * a select's options can be replaced under an unchanged value, which drops the selection. One rule, asked once per\n * binding by both, so a template and a spread key cannot disagree about it.\n *\n * In development it names the one shape it cannot serve: on a `<select multiple>` both properties read and set a\n * SINGLE selection, so a selection the user adds is kept rather than controlled. Always writing there was measured\n * 2–3% slower on every table with a select per row, to serve an API that does not fit — hence a warning, not a cost.\n */\nexport const isSelection = (element: Element, name: unknown) => {\n if ((name !== 'value' && name !== 'selectedIndex') || element.localName !== 'select') return false;\n return true;\n};\n\n/**\n * Development: the one shape a selection binding cannot serve, named by the module the user wired (`side`). Called only\n * behind `__DEV__` at each call site, so production keeps `isSelection` exactly as small as it was (a `side` argument on\n * it measured +1 B, a default +9 B on vera-renderer.min.js — 2026-10-09).\n */\nexport const saySelectMultiple = (element: Element, name: unknown, side: string) => {\n if (element.hasAttribute('multiple'))\n console.warn(diagnostic(side, '<select multiple>', 'select-multiple', __DEV__ && SHARED.selectMultiple(String(name))));\n};\n\n/**\n * `target[key]`, as a function — how a component's GETTER is read through `untracked`. Not `Reflect.get`: `untracked`\n * passes three arguments, and `Reflect.get`'s third is the RECEIVER — `undefined` there runs the getter with no `this`.\n */\nexport const read = (target: object, key: string) => (target as Record<string, unknown>)[key];\n\n/**\n * **What a thrown value says, whatever was thrown — and it never throws itself.** A caught value comes from author\n * code (a `resolve` option, a motion tick or vocabulary function), and JavaScript can throw anything: `null`, an object\n * with no prototype (`String()` finds no `toString`), one whose `toString` or `message` getter throws, a Proxy whose\n * traps throw. Formatting it naively replaced the real failure with an unrelated TypeError from inside the framework.\n * Anything unreadable becomes a fixed phrase; `Object.prototype.toString` is no fallback, since it reads\n * `Symbol.toStringTag` through a Proxy's trap too.\n *\n * **A deliberate duplicate of `thrownMessage` in `packages/ssr/src/vera/escaping.ts` — fix both copies.** `@verajs/ssr`\n * is compiled per file with no bundling, so it cannot import this private, unpublished package at run time;\n * `tests/thrown-message-copies.test.mjs` runs one table of thrown values against both, so they cannot drift.\n */\nexport const thrownMessage = (error: unknown): string => {\n try {\n if (error instanceof Error) return String(error.message);\n const message = (error as { message?: unknown } | null)?.message;\n return typeof message === 'string' ? message : String(error);\n } catch {\n return '[unprintable value thrown]';\n }\n};\n","/**\n * `__DEV__` only: the one home for *\"is this value something an attribute can carry?\"*\n *\n * **Why it is a closed vocabulary and not a predicate.** The first design asked whether a value\n * stringifies meaningfully — `String(v) === '[object Object]'` means it lost its data. Driven\n * through 16 value shapes rather than reasoned about, that broke four ways, and the first is\n * disqualifying: `String()` THROWS on `Object.create(null)`, on `{ toString: null }`, and on any\n * object whose `toString` throws — so a diagnostic would have killed the page for an author using\n * the recommended dictionary idiom. It also passed `[\"a\",\"b\"]` as `\"a,b\"` (one junk class, if that\n * was a `class` binding) and `new Date()` as a timezone-bearing string, which is an SSR/CSR\n * divergence manufactured out of correct-looking code. And it passed `Symbol('s')` while\n * `` `${sym}` `` throws — a guard and its sink disagreeing about a single expression.\n *\n * \"Does it stringify meaningfully\" is an OPEN predicate over an unbounded, environment-dependent\n * space, and open predicates cannot be audited. So the test is inverted and closed: **primitives\n * pass; everything else is reported; anything else that should pass is a named row added on\n * evidence.** The list has exactly one member so far.\n *\n * Credit where it is due: the four breaks were found by the omni engine's session, which drove the\n * shapes rather than arguing about them, and the closed-vocabulary form is theirs.\n */\n\nimport { hasWarned } from '@verajs/shared-utils';\n\n/**\n * Blessed non-primitives — types whose `toString` IS the value the author means.\n *\n * Tested by brand rather than `instanceof`, which is false across realms: a `URL` built in an\n * iframe is not `instanceof` the parent's `URL`, and a diagnostic that fires on a correct value in\n * one frame and not another is worse than none.\n */\nconst brand = (value: object) => Object.prototype.toString.call(value);\n\n/** One message per element+name+kind, so a value rebuilt every render does not flood the console. */\nlet reported: Set<string> | undefined;\n\n/**\n * Returns the complaint, or `null` when the value is fine. Never throws — the shapes that break a\n * naive guard are exactly the ones worth reporting, so they reach the `object` arm and are named.\n */\nexport const attributeValueKind = (tag: string, name: string, value: unknown): string | null => {\n const type = typeof value;\n if (type === 'string' || type === 'number' || type === 'boolean' || type === 'bigint') return null;\n if (type === 'object' && brand(value as object) === '[object URL]') return null;\n\n /**\n * Keyed by BRAND, not by `typeof` — `Date`, `Array` and a plain object are all `'object'`, so a\n * coarser key reported whichever arrived first and silently swallowed the rest. An author who\n * fixed the Date would never have been told about the array.\n */\n const key = `${tag}|${name}|${type === 'object' ? brand(value as object) : type}`;\n reported ??= new Set();\n if (reported.has(key)) return null;\n reported.add(key);\n\n /**\n * A function into an attribute is never what the author meant, but the REASON matters: on a\n * custom element the Lit-era convention is that complex values are set as properties, so\n * `<my-chart formatter={fn}>` is a coherent intention that this sink simply cannot express. The\n * message names the binding that can, rather than blaming the author.\n */\n const kind = type === 'function'\n ? `a function, which becomes its own SOURCE TEXT`\n : type === 'symbol'\n ? `a symbol, which every DOM conversion refuses`\n : Array.isArray(value)\n ? `an array, which becomes its members joined by commas`\n : brand(value as object) === '[object Date]'\n ? `a Date, whose text carries the TIMEZONE of whichever side rendered it`\n : `an ${type}, which cannot survive as text`;\n\n /** The KIND only: the sentence is the shared `attribute-value` entry, printed by each call site with its area. */\n return kind;\n};\n\n/**\n * `__DEV__` only: **an event name one or two keystrokes from a real one** — `@clik`, or `onClik` in\n * JSX, which compiles to it — is almost certainly a typo, and a listener for an event that never\n * fires is a button that silently does nothing. TypeScript cannot catch it beside a permissive prop\n * surface (an index signature cannot exclude names), and nothing at runtime ever fails.\n *\n * Deliberately narrow, because custom events are legitimate on every element: a name the element\n * knows (`'on' + name in element`) is never questioned; one that EXTENDS a real event (`changed`,\n * `loaded`, `closed`) is a custom event by its shape and is left alone; and only a name within two\n * edits of an event this element really has — transpositions counting as one — is named. Each\n * `(tag, name)` pair is said once: the caller's `warnOnce(…, 'event-name-typo', …, key)`, keyed by `eventKey`, and\n * the scan below is skipped for a pair already said (`hasWarned`).\n */\nexport const eventKey = (element: Element, name: string): string => element.localName + ' ' + name;\nexport const eventNameGuess = (element: Element, name: string): string | null => {\n if ('on' + name in element) return null;\n if (hasWarned('event-name-typo', eventKey(element, name))) return null;\n let best: string | null = null;\n let bestDistance = 3;\n for (const key in element) {\n if (!key.startsWith('on')) continue;\n const known = key.slice(2);\n if (name.startsWith(known)) return null;\n const distance = editDistance(name, known, bestDistance);\n if (distance < bestDistance) {\n bestDistance = distance;\n best = known;\n }\n }\n if (best === null) return null;\n /** The GUESS only: the sentence is the renderer table's `event-name-typo`. */\n return best;\n};\n\n/** Optimal-string-alignment distance, stopping early once it cannot come in under `limit`. */\nconst editDistance = (a: string, b: string, limit: number): number => {\n if (Math.abs(a.length - b.length) >= limit) return limit;\n let before: number[] = [];\n let previous = Array.from({ length: b.length + 1 }, (_, j) => j);\n for (let i = 1; i <= a.length; i++) {\n const current = [i];\n let rowBest = i;\n for (let j = 1; j <= b.length; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n let value = Math.min(previous[j] + 1, current[j - 1] + 1, previous[j - 1] + cost);\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) value = Math.min(value, before[j - 2] + 1);\n current.push(value);\n if (value < rowBest) rowBest = value;\n }\n if (rowBest >= limit) return limit;\n before = previous;\n previous = current;\n }\n return previous[b.length];\n};\n","/**\n * **`@verajs/renderer/spread`'s own diagnostics — DEVELOPMENT ONLY.** A spread key refused for the same reason a template\n * binding is (`__proto__`, a bound `srcdoc`, an inline handler) raises the shared code from shared-utils' table; these\n * are the refusals only a spread can meet — its names arrive at runtime.\n */\nimport type { Prose } from '@verajs/shared-utils';\n\nexport const PROSE: Record<string, Prose> = {\n 'spread-unsafe-name': (key) => [\n `refusing ${key} — an attribute name cannot contain whitespace, a quote, \\`<\\`, \\`>\\`, \\`/\\`, \\`=\\` or a control character, and one that cannot be written into markup would not survive server rendering.`,\n 'Spread names arrive at runtime; check where this key came from.',\n ],\n 'spread-inner-html': (key) => [\n `refusing ${key} — spread names arrive at runtime, which is exactly the property that makes an HTML sink unreviewable.`,\n 'Write it in the template — html`<div .innerHTML=${trusted}>` — sanitized first (renderer README, security note).',\n ],\n 'spread-not-object': (received) => [\n `ignoring a props bag that is not a plain object — received ${received}. A string is iterated by character index, so \\`spread('text')\\` would set attributes named 0, 1, 2 and 3; anything else applies nothing at all.`,\n 'This is usually an import or a property that resolved to something unexpected.',\n ],\n};\n","/**\n * `<div ${spread(props)}>` — bindings whose NAMES are not known when the template is parsed.\n *\n * Ships separately: the renderer holds one property read (a value at element position carrying\n * `_$apply$` applies itself), so an app that never spreads pays only that. This entry imports nothing\n * from the renderer and reaches it only through that protocol, so it works beside any renderer entry.\n *\n * **One key, one rule, decided once.** A key's kind and name follow the renderer's template sigils\n * exactly (`.prop`, `?bool`, `@event`, `&ref`, `!live`, `onClick`), and its verdict — including every\n * refusal — is decided when its binding is first created, never again per render. The rules are\n * repeated rather than imported from the renderer (the bundles cannot share state);\n * `tests/spread-written-parity.test.mjs` drives both spellings against each other.\n *\n * **Security: spread is where the template security model would break**, because its names arrive at\n * runtime, often from data, and are neither greppable nor reviewable. So it refuses, on the client and\n * in the server half (`_$attrs$`) alike: `.innerHTML`/`.outerHTML` (and `!`), `.__proto__`, the `srcdoc`\n * attribute, inline-handler attributes (`onclick` in any casing — `on` + Capital is the event spelling\n * and still works), names that cannot survive markup, and — as the renderer does — a `javascript:` URL\n * where a browser navigates.\n */\nimport { adoptProperty, call, CONTENT_PROPERTY, dispatch, contentClash, INLINE_HANDLER, ownsContent, isSelection, read, saySelectMultiple, SCRIPT_URL, SCRIPT_URL_ITEM, URL_SINK, diagnostic, SHARED } from '@verajs/shared-utils';\nimport type { Untracked } from '@verajs/shared-utils';\nimport { attributeValueKind } from './dev-values.js';\nimport { PROSE } from './spread-diagnostics.js';\n\nconst ATTR = 0;\nconst PROPERTY = 1;\nconst BOOLEAN = 2;\n/** `!name` — a property compared against the live DOM rather than against what this last wrote. */\nconst LIVE = 3;\nconst EVENT = 4;\nconst REF = 5;\nconst REFUSED = 6;\n\n/**\n * A name that cannot be written into a tag: the HTML attribute-name restriction (control characters,\n * whitespace, `\"`, `'`, `>`, `/`, `=`) plus `<` and a backtick — refused identically on both sides, so a\n * key cannot work here and vanish server-side. Skipped, never thrown: one bad key must not cost a render.\n */\n// eslint-disable-next-line no-control-regex\nconst UNSAFE_NAME = /^$|[\\s\"'>/=<`]|[\\u0000-\\u001f\\u007f]/;\n\n/** Development only: why a key was refused, by refusal code. */\n\n/**\n * A key's kind and name, and — for a refused key — why (`[REFUSED, code]`). The twin of the renderer's\n * template construction; a refused key's verdict never changes, so it is decided once per binding.\n */\nconst resolve = (key: string): [number, string | number] => {\n const first = key[0];\n let kind = first === '.' ? PROPERTY : first === '?' ? BOOLEAN : first === '@' ? EVENT : first === '&' ? REF : first === '!' ? LIVE : ATTR;\n let name = kind === ATTR ? key : key.slice(1);\n if (kind === ATTR && /^on[A-Z]/.test(key)) {\n kind = EVENT;\n name = key.slice(2).toLowerCase();\n }\n const property = kind === PROPERTY || kind === LIVE;\n const refusal = UNSAFE_NAME.test(name)\n ? 1\n : property && (name === 'innerHTML' || name === 'outerHTML')\n ? 2\n : property && name === '__proto__'\n ? 3\n : kind === ATTR && name.toLowerCase() === 'srcdoc'\n ? 4\n : kind === ATTR && INLINE_HANDLER.test(name)\n ? 5\n : 0;\n return refusal ? [REFUSED, refusal] : [kind, name];\n};\n\n/**\n * How a key names a URL a browser navigates to — the renderer's rule, by the same numbers: 0 not one; 1 a custom\n * element's property — often an object (`.data=${rows}`), so only a string is checked and nothing is converted; 2\n * converted ONCE, and that string checked and written (so a `toString` that answers differently each time cannot pass\n * the check as one URL and be written as another); 3 an animation's value (`to`, `values`…), converted once and\n * checked item by item. A refused key needs no case: its name is a refusal code, which no URL\n * attribute name matches.\n */\nconst urlRule = (kind: number, name: string, custom: boolean) => {\n const sink = URL_SINK.exec(name);\n return kind === BOOLEAN || kind === EVENT || kind === REF || sink === null ? 0 : kind !== ATTR && custom ? 1 : sink[1] ? 2 : 3;\n};\n\n/** What `checked` answers for a `javascript:` URL where the rule looks. */\nconst REFUSE = {};\n\n/** `value` as it is checked AND written under `rule` — converted once, or left as it is — or `REFUSE`. */\nconst checked = (rule: number, value: unknown) => {\n if (rule > 1 && value != null && typeof value !== 'string') value = `${value}`;\n return rule !== 0 && typeof value === 'string' && (rule === 3 ? SCRIPT_URL_ITEM : SCRIPT_URL).test(value) ? REFUSE : value;\n};\n\nconst UNSET = {};\n\n/** One key's binding on one element. It is also the `@event` listener — a stable object, so the platform dedupes re-adds. */\nclass Binding {\n _kind: number;\n _name: string;\n _element: Element;\n /** What the element held before the bag first wrote this key — restored when the key leaves the bag. */\n _initial: unknown = null;\n _committed: unknown = UNSET;\n _handler: unknown = null;\n /** For `.prop`: where adoption stands (`adoptProperty`: 0 still adopting, 1 received, 2 refused). */\n _state = 1;\n /** How this key is checked as a URL (`urlRule`) — decided once, with the element in hand. */\n _url: number;\n /**\n * On a custom element, a property read is the component's GETTER, so it goes through the `untracked` this binding was\n * created with; `null` on a built-in element, whose getters read no state. Decided once.\n */\n _read: Untracked | null;\n constructor(element: Element, key: string, untracked: Untracked) {\n const [resolved, name] = resolve(key);\n /** A `<select>`'s selection is live, as in a template — the same rule, asked of the same function. */\n const kind = (resolved === PROPERTY || resolved === LIVE) && isSelection(element, name) ? LIVE : resolved;\n if (__DEV__ && (resolved === PROPERTY || resolved === LIVE) && isSelection(element, name)) saySelectMultiple(element, name, 'spread');\n this._kind = kind;\n this._name = name as string;\n this._element = element;\n const custom = element.localName.includes('-');\n /** Core's `untracked` for a custom element's getter reads, and for an event key's handler (`dispatch`). */\n this._read = custom || kind === EVENT ? untracked : null;\n this._url = urlRule(kind, name as string, custom);\n /** A content-replacing property beside content of the element's own: development refuses it, as a template does. */\n if (__DEV__ && (kind === PROPERTY || kind === LIVE) && CONTENT_PROPERTY.test(name as string) && ownsContent(element))\n contentClash('spread', element.localName, name as string);\n if (kind === REFUSED) {\n if (__DEV__) {\n /** Each refusal written out, so the manifest (`diagnostics-tables`) reads every raise from the source. */\n const at = `<${element.localName}>`;\n const written = JSON.stringify(key);\n const why = name as number;\n if (why === 1) console.warn(diagnostic('spread', at, 'spread-unsafe-name', __DEV__ && PROSE['spread-unsafe-name'](written)));\n else if (why === 2) console.warn(diagnostic('spread', at, 'spread-inner-html', __DEV__ && PROSE['spread-inner-html'](written)));\n else if (why === 3) console.warn(diagnostic('spread', at, 'proto-binding', __DEV__ && SHARED.protoBinding(written)));\n else if (why === 4) console.warn(diagnostic('spread', at, 'srcdoc-attribute', __DEV__ && SHARED.srcdocAttribute(\"'.srcdoc': trusted\")));\n else\n console.warn(\n diagnostic('spread', at, 'handler-attribute',\n __DEV__ && SHARED.handlerAttribute(key, `\\`'@${key.slice(2).toLowerCase()}': fn\\` (or \\`on${key.slice(2, 3).toUpperCase()}${key.slice(3)}\\`)`))\n );\n }\n return;\n }\n if (kind === ATTR) this._initial = element.getAttribute(name as string);\n else if (kind === BOOLEAN) this._initial = element.hasAttribute(name as string);\n /** On a custom element this is the component's getter, run on the parent's behalf: read through `untracked`. */\n else if (kind === PROPERTY || kind === LIVE)\n this._initial = custom ? untracked(read, element, name as string) : (element as unknown as Record<string, unknown>)[name as string];\n if (kind === PROPERTY && custom) this._state = 0;\n }\n /** Runs the handler UNTRACKED (shared-utils' `dispatch`): `_read` holds core's `untracked` for an event key too. */\n handleEvent(event: Event) {\n (this._read ?? call)(dispatch, this, event);\n }\n}\n\nconst write = (binding: Binding, given: unknown, adopting?: boolean) => {\n const kind = binding._kind;\n const value = checked(binding._url, given);\n const name = binding._name;\n /** One variable, typed for both uses: a cast alias survives minification as a second variable. */\n const element = binding._element as Element & Record<string, unknown>;\n if (kind === REFUSED) return;\n /**\n * **Adopting server markup** (hydration hands this in): a built-in control's state — `value`, `checked`, `selected`,\n * `open`, by `.name` or `!name` — is RECORDED, not written: the server's default, and anything the user changed before\n * the script arrived, stand, exactly as for a written binding (hydration's `FORM_STATE`, the same list — keep them\n * equal). Any other name is written, and a component's property is always delivered.\n */\n if (adopting && binding._read === null && (kind === LIVE || kind === PROPERTY) && /^(?:value|checked|selected|open)$/.test(name as string)) {\n binding._committed = value;\n return;\n }\n if (value === REFUSE) {\n if (__DEV__ && given !== binding._committed)\n console.warn(diagnostic('spread', `<${element.localName}>`, 'script-url', __DEV__ && SHARED.scriptUrl(name)));\n binding._committed = given;\n element.removeAttribute(name);\n return;\n }\n if (kind === LIVE) {\n binding._committed = value;\n /**\n * A built-in is compared against its live property. A COMPONENT is compared against its current value — the raw one\n * its store holds (`_$raw$`) for a name it received, else read through `untracked` — and receives a difference\n * through `adoptProperty`. Inline, as the renderer's `commit` reads a template's `!name`: keep the two equal.\n */\n if (binding._read === null) {\n if (element[name] !== value) element[name] = value;\n } else {\n const raw = element._$raw$ as Record<string, unknown> | undefined;\n if ((raw !== undefined && name in raw ? raw[name] : binding._read(read, element, name)) !== value) adoptProperty(element, name, value);\n }\n return;\n }\n if (value === binding._committed) return;\n binding._committed = value;\n if (kind === ATTR) {\n if (value == null) element.removeAttribute(name);\n else {\n if (__DEV__) {\n const kind = attributeValueKind(element.localName, name, value);\n if (kind !== null) console.warn(diagnostic('spread', `<${element.localName}>`, 'attribute-value', __DEV__ && SHARED.attributeValue(name, kind, `'.${name}': value`)));\n }\n element.setAttribute(name, `${value}`);\n }\n } else if (kind === PROPERTY) {\n if (binding._state === 1) element[name] = value;\n else if (binding._state === 0) binding._state = adoptProperty(element, name, value);\n } else if (kind === BOOLEAN) element.toggleAttribute(name, !!value);\n else if (kind === REF) {\n if (typeof value === 'function') (value as (element: Element) => void)(element);\n else if (value !== null && typeof value === 'object') (value as { value: unknown }).value = element;\n } else {\n if (__DEV__ && value != null && value !== false && typeof value !== 'function' &&\n typeof (value as EventListenerObject)?.handleEvent !== 'function')\n console.warn(diagnostic('spread', `<${element.localName}>`, 'not-a-listener', __DEV__ && SHARED.notAListener(name, typeof value)));\n if (binding._handler === null && value != null) element.addEventListener(name, binding);\n binding._handler = value ?? null;\n }\n};\n\n/**\n * Each binding is owned by the renderer's binding record it arrived through (the `key`), so one element can\n * carry several spreads. A key that leaves the bag is written back to what the element held before.\n */\nconst owned = new WeakMap<object, Map<string, Binding>>();\n/**\n * `untracked` is `_$apply$`'s third argument — core's, through the renderer; `call` when a renderer leaves it out.\n * Each binding keeps the one it was CREATED with, so nothing about it is paid per render, and an apply nested inside\n * another (a component setter rendering a spread) can never change what the outer's bindings use.\n */\nfunction apply(this: SpreadResult, element: Element, key: object, untracked: Untracked = call, adopting = false) {\n const props = this._props;\n let bindings = owned.get(key);\n if (bindings === undefined) owned.set(key, (bindings = new Map()));\n let count = 0;\n for (const name in props) {\n count++;\n let binding = bindings.get(name);\n if (binding === undefined) bindings.set(name, (binding = new Binding(element, name, untracked)));\n write(binding, props[name], adopting);\n }\n if (bindings.size !== count)\n for (const [name, binding] of bindings)\n if (!(name in props)) {\n bindings.delete(name);\n write(binding, binding._initial);\n }\n}\n\n/**\n * The server half of the protocol: `[kind, name, value]` for each key `@verajs/ssr` should serialize —\n * `a`ttribute, `b`oolean, `p`roperty, `e`vent, `r`ef — with every refusal and every refused URL already\n * applied, by the same `resolve` the client uses, so the two cannot disagree.\n */\nfunction attributes(this: SpreadResult): [string, string, unknown][] {\n const out: [string, string, unknown][] = [];\n for (const key in this._props) {\n const [kind, name] = resolve(key);\n /** No element here: a property key is judged as a custom element's — the server only ever delivers one to a component. */\n const rule = urlRule(kind, name as string, true);\n const value = checked(rule, this._props[key]);\n if (kind === REFUSED || value === REFUSE) continue;\n out.push([kind === ATTR ? 'a' : kind === BOOLEAN ? 'b' : kind === EVENT ? 'e' : kind === REF ? 'r' : 'p', name as string, value]);\n }\n return out;\n}\n\n/** The branded, self-applying result — what the renderer's element position recognizes. */\ntype SpreadResult = {\n _props: Record<string, unknown>;\n _$apply$: unknown;\n _$attrs$: unknown;\n};\n\n/**\n * Binds every key of `props` to the element it is placed on. Keys follow the template sigils — `.prop`,\n * `?bool`, `@event` (or `onClick`), `&ref`, `!live` — and a plain key is an attribute.\n *\n * Already-branded input is returned as-is (JSX compiles `{...spread(x)}` to a spread of a spread). A\n * value that is not a plain object is refused in BOTH builds — a string would otherwise be iterated by\n * character index into attributes named `0`, `1`, `2` — and development says so.\n */\nexport const spread = (props: object | null | undefined): SpreadResult => {\n if (props !== null && typeof props === 'object' && typeof (props as SpreadResult)._$apply$ === 'function')\n return props as SpreadResult;\n if (props === null || typeof props !== 'object' || Array.isArray(props)) {\n if (__DEV__)\n console.warn(\n diagnostic('spread', 'spread()', 'spread-not-object',\n __DEV__ && PROSE['spread-not-object'](Array.isArray(props) ? 'an array' : typeof props === 'object' ? 'null' : `a ${typeof props}`))\n );\n props = {};\n }\n return { _props: props as Record<string, unknown>, _$apply$: apply, _$attrs$: attributes };\n};\n\n/** Every key as a property: `props({ items })` is `spread({ '.items': items })` — how a component receives data. */\nexport const props = <T extends object = Record<string, unknown>>(values: Partial<T>): SpreadResult => {\n const sigiled: Record<string, unknown> = {};\n for (const key of Object.keys(values)) sigiled[`.${key}`] = (values as Record<string, unknown>)[key];\n return spread(sigiled);\n};\n"],"names":["contentClash","SHARED.getterOnlyProp","SHARED.upgradeClobber","SHARED.contentClash","SHARED.selectMultiple","SHARED.protoBinding","SHARED.srcdocAttribute","SHARED.handlerAttribute","SHARED.scriptUrl","SHARED.attributeValue","SHARED.notAListener"],"mappings":"AAAA;;;;;AAKG;AACI,MAAM,IAAI,GAAG,uBAAuB;AAiD3C;;;;;;;;;;;;;;AAcG;AACH;;;;AAIG;AACH;;;;AAIG;AACI,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,QAAgB,EAAE,QAA6C,KACrG,OAAO,IAAI;AACT,MAAE,CAAA,EAAG,OAAO,CAAA,EAAA,EAAK,QAAQ,CAAC,CAAC,CAAC,CAAA,EAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAA,CAAA,EAAI,QAAQ,CAAC,CAAC,CA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AC,KAAgC,KAAkB;AACvE,IAAA,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAQ,KAAsB,CAAC,QAAQ,KAAK,UAAU;AACvG,QAAA,OAAO,KAAqB;AAC9B,IAAA,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACvE,QAAA,IAAI,OAAO;YACT,OAAO,CAAC,IAAI,CACV,UAAU,CAAC,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAClD,OAAO,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,UAAU,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,CAAA,EAAA,EAAK,OAAO,KAAK,CAAA,CAAE,CAAC,CAAC,CACvI;QACH,KAAK,GAAG,EAAE;IACZ;AACA,IAAA,OAAO,EAAE,MAAM,EAAE,KAAgC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE;AAC5F;AAEA;AACO,MAAM,KAAK,GAAG,CAA6C,MAAkB,KAAkB;IACpG,MAAM,OAAO,GAA4B,EAAE;IAC3C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,CAAC,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE,CAAC,GAAI,MAAkC,CAAC,GAAG,CAAC;AACpG,IAAA,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB;;;;"}
|
|
@@ -32,9 +32,7 @@ type Tag = ((props?: Record<string, unknown>) => unknown) & {
|
|
|
32
32
|
* ordinary template shape and costs one loop.
|
|
33
33
|
*
|
|
34
34
|
* It builds `{ _$litType$: 1, strings, values }` directly rather than calling core's `html`, so this
|
|
35
|
-
* entry keeps the renderer's independence from core.
|
|
36
|
-
* not reach here — which is right, since a swapped `html` belongs to a different renderer and this
|
|
37
|
-
* is a renderer feature.
|
|
35
|
+
* entry keeps the renderer's independence from core.
|
|
38
36
|
*/
|
|
39
37
|
declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => {
|
|
40
38
|
_$litType$: number;
|
|
@@ -45,6 +43,17 @@ declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => {
|
|
|
45
43
|
strings: string[];
|
|
46
44
|
values: unknown[];
|
|
47
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* React's names, mapped the way `@verajs/jsx` maps them on a written element — so `<H1
|
|
48
|
+
* className="t" disabled={d}>` and `<h1 className="t" disabled={d}>` mean the same thing.
|
|
49
|
+
*
|
|
50
|
+
* Not cosmetic. Passed through raw, `disabled={false}` becomes the attribute `disabled="false"`,
|
|
51
|
+
* and any value at all disables the control; `className` lands as `classname` and never applies.
|
|
52
|
+
*
|
|
53
|
+
* Deliberately duplicated from the transform rather than shared through a package: the two are
|
|
54
|
+
* build-time and runtime, and `tests/jsx-name-mapping.test.mjs` asserts they agree on every key —
|
|
55
|
+
* which is the drift protection a shared module would have bought, without the dependency.
|
|
56
|
+
*/
|
|
48
57
|
declare const BOOLEAN_ATTRIBUTES: Set<string>;
|
|
49
58
|
declare const jsxName: (key: string) => string;
|
|
50
59
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vera-renderer-tag.d.ts","sources":["../../src/tag.ts"],"mappings":"AAAA;AAEA;;;;;;;;;;;;;;;;;;;;;;;AAuBG
|
|
1
|
+
{"version":3,"file":"vera-renderer-tag.d.ts","sources":["../../src/tag.ts"],"mappings":"AAAA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;AAuBG,KAAA,GAAA,aAAA,MAAA;AAEH,KAAA,MAAA;AACA;AAEA;AACA;AAIA;;;;;;;;AAQG;AACH;AAEA;;;;;;AAMG;AACH;;AAEE;AACE;;AAEE;;;;AAIG,cAAA,OAAA;;;;;;;;;cASG,eAAc,oBAAA,2BAAA,GAAA;;;;","names":[]}
|