@llui/dom 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dom-env.d.ts +15 -0
- package/dist/dom-env.d.ts.map +1 -1
- package/dist/dom-env.js +1 -0
- package/dist/dom-env.js.map +1 -1
- package/dist/elements.d.ts.map +1 -1
- package/dist/elements.js +23 -2
- package/dist/elements.js.map +1 -1
- package/dist/primitives/portal.d.ts.map +1 -1
- package/dist/primitives/portal.js +20 -1
- package/dist/primitives/portal.js.map +1 -1
- package/dist/ssr/jsdom.d.ts.map +1 -1
- package/dist/ssr/jsdom.js +1 -0
- package/dist/ssr/jsdom.js.map +1 -1
- package/dist/ssr/linkedom.d.ts.map +1 -1
- package/dist/ssr/linkedom.js +57 -0
- package/dist/ssr/linkedom.js.map +1 -1
- package/package.json +1 -1
package/dist/dom-env.d.ts
CHANGED
|
@@ -48,6 +48,21 @@ export interface DomEnv {
|
|
|
48
48
|
* the right mechanism.
|
|
49
49
|
*/
|
|
50
50
|
parseHtmlFragment(html: string): DocumentFragment;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve a CSS selector against the env's root document. Used by
|
|
53
|
+
* `portal()` to locate its target when `opts.target` is a string.
|
|
54
|
+
*
|
|
55
|
+
* Returns `null` when the selector doesn't match — portal callers
|
|
56
|
+
* treat a null target as a no-op (render nothing), so adapters on
|
|
57
|
+
* runtimes where no real document exists (detached linkedom, empty
|
|
58
|
+
* shadow root, etc.) can safely return `null` here.
|
|
59
|
+
*
|
|
60
|
+
* Optional at the interface level so pre-existing consumer envs
|
|
61
|
+
* constructed by hand continue to type-check; a portal call site
|
|
62
|
+
* with a string target falls back to returning no nodes when the
|
|
63
|
+
* method is absent.
|
|
64
|
+
*/
|
|
65
|
+
querySelector?(selector: string): Element | null;
|
|
51
66
|
}
|
|
52
67
|
/**
|
|
53
68
|
* Wrap the browser globals as a `DomEnv`. Used as the default env for
|
package/dist/dom-env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-env.d.ts","sourceRoot":"","sources":["../src/dom-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,MAAM;IAErB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACnC,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACjD,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACpC,sBAAsB,IAAI,gBAAgB,CAAA;IAC1C;;;;;OAKG;IACH,WAAW,IAAI,KAAK,CAAA;IAKpB,QAAQ,CAAC,OAAO,EAAE,OAAO,OAAO,CAAA;IAChC,QAAQ,CAAC,IAAI,EAAE,OAAO,IAAI,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,OAAO,IAAI,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,OAAO,CAAA;IAChC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,gBAAgB,CAAA;IAClD,QAAQ,CAAC,WAAW,EAAE,OAAO,WAAW,CAAA;IACxC,QAAQ,CAAC,mBAAmB,EAAE,OAAO,mBAAmB,CAAA;IACxD,QAAQ,CAAC,UAAU,EAAE,OAAO,UAAU,CAAA;IAGtC,QAAQ,CAAC,UAAU,EAAE,OAAO,UAAU,CAAA;IAEtC;;;;;OAKG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"dom-env.d.ts","sourceRoot":"","sources":["../src/dom-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,MAAM;IAErB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACnC,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACjD,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACpC,sBAAsB,IAAI,gBAAgB,CAAA;IAC1C;;;;;OAKG;IACH,WAAW,IAAI,KAAK,CAAA;IAKpB,QAAQ,CAAC,OAAO,EAAE,OAAO,OAAO,CAAA;IAChC,QAAQ,CAAC,IAAI,EAAE,OAAO,IAAI,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,OAAO,IAAI,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,OAAO,CAAA;IAChC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,gBAAgB,CAAA;IAClD,QAAQ,CAAC,WAAW,EAAE,OAAO,WAAW,CAAA;IACxC,QAAQ,CAAC,mBAAmB,EAAE,OAAO,mBAAmB,CAAA;IACxD,QAAQ,CAAC,UAAU,EAAE,OAAO,UAAU,CAAA;IAGtC,QAAQ,CAAC,UAAU,EAAE,OAAO,UAAU,CAAA;IAEtC;;;;;OAKG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAA;IAEjD;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CAQjD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,IAAI,MAAM,CA8CnC"}
|
package/dist/dom-env.js
CHANGED
package/dist/dom-env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-env.js","sourceRoot":"","sources":["../src/dom-env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dom-env.js","sourceRoot":"","sources":["../src/dom-env.ts"],"names":[],"mappings":"AAmFA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,UAAU;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CAAC;QACD,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC7D,SAAS,EAAE,IAAI;KAChB,CAAA;AACH,CAAC","sourcesContent":["/**\n * Minimal DOM surface that `@llui/dom`'s internals depend on. Passed to\n * `mountApp` / `hydrateApp` / `renderToString` as a context object so\n * the runtime never reaches for `globalThis.document` directly.\n *\n * Why an injected shape instead of a global shim:\n *\n * 1. **Bundler-friendly.** A Cloudflare Worker that imports\n * `@llui/dom/ssr/linkedom` reaches only linkedom via its module\n * graph. No `await import('jsdom')` appears in reachable source,\n * so rollup doesn't inline the 9 MiB jsdom bundle.\n * 2. **Concurrency-safe.** Two `renderToString` calls can pass\n * different envs; no process-level singleton to collide on.\n * 3. **Strict-isolate safe.** No `globalThis[key] = ...` mutation —\n * Cloudflare workerd and Deno strict modes forbid it.\n *\n * The surface is deliberately narrow: exactly the methods and\n * constructors the runtime touches. Grep `document\\.` /\n * `instanceof (HTMLElement|Element|...)` inside `@llui/dom/src` for\n * the exhaustive set.\n */\nexport interface DomEnv {\n // ── Factories ────────────────────────────────────────────────────\n createElement(tag: string): Element\n createElementNS(ns: string, tag: string): Element\n createTextNode(text: string): Text\n createComment(text: string): Comment\n createDocumentFragment(): DocumentFragment\n /**\n * Used by `each()`'s fast clear/bulk-remove paths to delete a range\n * of siblings in one call. SSR adapters that don't need those paths\n * (jsdom + linkedom both do) can stub — the runtime tolerates a\n * missing range during SSR render, which never hits the bulk paths.\n */\n createRange(): Range\n\n // ── Node / element constructors ─────────────────────────────────\n // Exposed for `instanceof` checks in binding targeting + for any\n // rare site that needs to construct a node type directly.\n readonly Element: typeof Element\n readonly Node: typeof Node\n readonly Text: typeof Text\n readonly Comment: typeof Comment\n readonly DocumentFragment: typeof DocumentFragment\n readonly HTMLElement: typeof HTMLElement\n readonly HTMLTemplateElement: typeof HTMLTemplateElement\n readonly ShadowRoot: typeof ShadowRoot\n\n // ── Event constructor ───────────────────────────────────────────\n readonly MouseEvent: typeof MouseEvent\n\n /**\n * Parse an HTML fragment string into a `DocumentFragment`. Used by\n * `unsafeHtml()`. Browsers and jsdom parse via template-element\n * innerHTML; linkedom has its own fragment parser. Adapter chooses\n * the right mechanism.\n */\n parseHtmlFragment(html: string): DocumentFragment\n\n /**\n * Resolve a CSS selector against the env's root document. Used by\n * `portal()` to locate its target when `opts.target` is a string.\n *\n * Returns `null` when the selector doesn't match — portal callers\n * treat a null target as a no-op (render nothing), so adapters on\n * runtimes where no real document exists (detached linkedom, empty\n * shadow root, etc.) can safely return `null` here.\n *\n * Optional at the interface level so pre-existing consumer envs\n * constructed by hand continue to type-check; a portal call site\n * with a string target falls back to returning no nodes when the\n * method is absent.\n */\n querySelector?(selector: string): Element | null\n\n /**\n * @internal Lets hot-path code (e.g. `el-split.ts`'s template-clone)\n * skip env indirection when the env wraps the browser globals. Only\n * set by `browserEnv()`.\n */\n readonly isBrowser?: boolean\n}\n\n/**\n * Wrap the browser globals as a `DomEnv`. Used as the default env for\n * `mountApp` / `hydrateApp` on the client.\n *\n * The returned object delegates to `globalThis.document` / `globalThis.X`\n * lazily — evaluating `browserEnv()` on a server process before a DOM\n * exists is safe because the delegation only dereferences the globals\n * when a method is actually called.\n *\n * Never mutates `globalThis`. A process with no browser globals that\n * invokes one of the factory methods gets a `TypeError` / `ReferenceError`\n * at the call site — which is correct: you're trying to build DOM on a\n * runtime that has no DOM.\n */\nexport function browserEnv(): DomEnv {\n // Evaluate globals lazily through getters so module-load on a\n // DOM-less process doesn't throw. Hot client code is still cheap —\n // V8/SpiderMonkey inline the getter after the first call.\n return {\n createElement: (tag) => document.createElement(tag),\n createElementNS: (ns, tag) => document.createElementNS(ns, tag),\n createTextNode: (text) => document.createTextNode(text),\n createComment: (text) => document.createComment(text),\n createDocumentFragment: () => document.createDocumentFragment(),\n createRange: () => document.createRange(),\n get Element() {\n return Element\n },\n get Node() {\n return Node\n },\n get Text() {\n return Text\n },\n get Comment() {\n return Comment\n },\n get DocumentFragment() {\n return DocumentFragment\n },\n get HTMLElement() {\n return HTMLElement\n },\n get HTMLTemplateElement() {\n return HTMLTemplateElement\n },\n get ShadowRoot() {\n return ShadowRoot\n },\n get MouseEvent() {\n return MouseEvent\n },\n parseHtmlFragment: (html) => {\n const template = document.createElement('template')\n template.innerHTML = html\n return template.content\n },\n querySelector: (selector) => document.querySelector(selector),\n isBrowser: true,\n }\n}\n"]}
|
package/dist/elements.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAKA,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAC3C,KAAK,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,EAAE,CAAA;AACnC,KAAK,QAAQ,GAAG,KAAK,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAKA,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAC3C,KAAK,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,EAAE,CAAA;AACnC,KAAK,QAAQ,GAAG,KAAK,EAAE,CAAA;AA8HvB,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,qBAAqB,IAAI;IACjD,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAA;IAC5B,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAA;IACpE,CAAC,QAAQ,EAAE,QAAQ,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAA;CAC/C,CAAA;AAGD,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,qBAAqB,IAAI;IACrD,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAA;IAC5B,CAAC,KA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,CAAC,CAAA;AAE1G,eAAO,MAAM,QAAQ,EAAuF,IAAI,CAAC,UAAU,CAAC,CAAA;AAE5H,eAAO,MAAM,KAAK,EAAoF,IAAI,CAAC,OAAO,CAAC,CAAA;AAEnH,eAAO,MAAM,EAAE,EAAiF,IAAI,CAAC,IAAI,CAAC,CAAA;AAE1G,eAAO,MAAM,KAAK,EAAoF,IAAI,CAAC,OAAO,CAAC,CAAA;AAEnH,eAAO,MAAM,IAAI,EAAmF,IAAI,CAAC,MAAM,CAAC,CAAA;AAEhH,eAAO,MAAM,EAAE,EAAiF,IAAI,CAAC,IAAI,CAAC,CAAA;AAE1G,eAAO,MAAM,EAAE,EAAiF,IAAI,CAAC,IAAI,CAAC,CAAA;AAE1G,eAAO,MAAM,KAAK,EAAoF,IAAI,CAAC,OAAO,CAAC,CAAA"}
|
package/dist/elements.js
CHANGED
|
@@ -46,6 +46,14 @@ function createElement(tag, propsOrChildren, maybeChildren) {
|
|
|
46
46
|
const children = Array.isArray(propsOrChildren)
|
|
47
47
|
? propsOrChildren
|
|
48
48
|
: maybeChildren;
|
|
49
|
+
// Props that have to apply AFTER children are appended. `<select
|
|
50
|
+
// value=...>` is the canonical case: setting `value` on a select
|
|
51
|
+
// without options is a silent no-op in real browsers + jsdom
|
|
52
|
+
// (value falls through to the first option on append), and a hard
|
|
53
|
+
// throw under linkedom (its HTMLSelectElement.value setter, once
|
|
54
|
+
// patched, walks options — but there are none yet if we set before
|
|
55
|
+
// appending). Deferring the apply fixes all three envs.
|
|
56
|
+
const deferred = [];
|
|
49
57
|
if (props) {
|
|
50
58
|
for (const [rawKey, value] of Object.entries(props)) {
|
|
51
59
|
if (rawKey === 'key')
|
|
@@ -56,6 +64,7 @@ function createElement(tag, propsOrChildren, maybeChildren) {
|
|
|
56
64
|
el.addEventListener(eventName, value);
|
|
57
65
|
continue;
|
|
58
66
|
}
|
|
67
|
+
const isSelectValue = tag === 'select' && rawKey === 'value';
|
|
59
68
|
// Reactive binding — value is a function
|
|
60
69
|
if (typeof value === 'function') {
|
|
61
70
|
const kind = classifyKind(rawKey);
|
|
@@ -72,13 +81,23 @@ function createElement(tag, propsOrChildren, maybeChildren) {
|
|
|
72
81
|
});
|
|
73
82
|
const initialValue = perItem ? value() : accessor(ctx.state);
|
|
74
83
|
binding.lastValue = initialValue;
|
|
75
|
-
|
|
84
|
+
if (isSelectValue) {
|
|
85
|
+
deferred.push(() => applyBinding({ kind, node: el, key }, initialValue));
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
applyBinding({ kind, node: el, key }, initialValue);
|
|
89
|
+
}
|
|
76
90
|
continue;
|
|
77
91
|
}
|
|
78
92
|
// Static prop
|
|
79
93
|
const kind = classifyKind(rawKey);
|
|
80
94
|
const key = resolveKey(rawKey, kind);
|
|
81
|
-
|
|
95
|
+
if (isSelectValue) {
|
|
96
|
+
deferred.push(() => applyBinding({ kind, node: el, key }, value));
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
applyBinding({ kind, node: el, key }, value);
|
|
100
|
+
}
|
|
82
101
|
}
|
|
83
102
|
}
|
|
84
103
|
if (children) {
|
|
@@ -95,6 +114,8 @@ function createElement(tag, propsOrChildren, maybeChildren) {
|
|
|
95
114
|
}
|
|
96
115
|
}
|
|
97
116
|
}
|
|
117
|
+
for (const fn of deferred)
|
|
118
|
+
fn();
|
|
98
119
|
return el;
|
|
99
120
|
}
|
|
100
121
|
/* v8 ignore start — mechanical tag wrappers */
|
package/dist/elements.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAM5C,oEAAoE;AACpE,MAAM,SAAS,GAAG,IAAI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Aa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAe,CAAA;AAC1G,kBAAkB;AAClB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAA2B,EAAE,CAAY,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAkB,CAAA;AACnH,oBAAoB","sourcesContent":["import type { BindingKind } from './types.js'\nimport { getRenderContext } from './render-context.js'\nimport { createBinding, applyBinding } from './binding.js'\nimport { FULL_MASK } from './update-loop.js'\n\ntype ElementProps = Record<string, unknown>\ntype Child = Node | string | Node[]\ntype Children = Child[]\n\n// DOM properties set via elem[key] = value rather than setAttribute\nconst PROP_KEYS = new Set([\n 'value',\n 'checked',\n 'selected',\n 'disabled',\n 'readOnly',\n 'multiple',\n 'indeterminate',\n 'defaultValue',\n 'defaultChecked',\n 'innerHTML',\n 'textContent',\n])\n\nfunction classifyKind(key: string): BindingKind {\n if (key === 'class' || key === 'className') return 'class'\n if (key.startsWith('style.')) return 'style'\n if (PROP_KEYS.has(key)) return 'prop'\n return 'attr'\n}\n\nfunction resolveKey(key: string, kind: BindingKind): string | undefined {\n if (kind === 'class') return undefined\n if (kind === 'style') return key.slice(6) // strip 'style.'\n if (kind === 'prop') return key\n // attr\n if (key === 'className') return 'class'\n return key\n}\n\nfunction createElement<K extends keyof HTMLElementTagNameMap>(\n tag: K,\n propsOrChildren?: ElementProps | Children,\n maybeChildren?: Children,\n): HTMLElementTagNameMap[K] {\n const ctx = getRenderContext()\n const el = ctx.dom.createElement(tag) as HTMLElementTagNameMap[K]\n\n // Distinguish (props, children) from (children,) — if first arg is an Array, it's children\n const props: ElementProps | undefined = Array.isArray(propsOrChildren)\n ? undefined\n : propsOrChildren\n const children: Children | undefined = Array.isArray(propsOrChildren)\n ? propsOrChildren\n : maybeChildren\n\n if (props) {\n for (const [rawKey, value] of Object.entries(props)) {\n if (rawKey === 'key') continue\n\n // Event handler\n if (/^on[A-Z]/.test(rawKey)) {\n const eventName = rawKey.slice(2).toLowerCase()\n el.addEventListener(eventName, value as EventListener)\n continue\n }\n\n // Reactive binding — value is a function\n if (typeof value === 'function') {\n const kind = classifyKind(rawKey)\n const key = resolveKey(rawKey, kind)\n const accessor = value as (state: never) => unknown\n const perItem = value.length === 0\n\n const binding = createBinding(ctx.rootLifetime, {\n mask: FULL_MASK,\n accessor,\n kind,\n node: el,\n key,\n perItem,\n })\n\n const initialValue = perItem ? (value as () => unknown)() : accessor(ctx.state as never)\n binding.lastValue = initialValue\n applyBinding({ kind, node: el, key }, initialValue)\n continue\n }\n\n // Static prop\n const kind = classifyKind(rawKey)\n const key = resolveKey(rawKey, kind)\n applyBinding({ kind, node: el, key }, value)\n }\n }\n\n if (children) {\n for (const child of children) {\n if (typeof child === 'string') {\n el.appendChild(ctx.dom.createTextNode(child))\n } else if (Array.isArray(child)) {\n for (const node of child) el.appendChild(node)\n } else {\n el.appendChild(child)\n }\n }\n }\n\n return el\n}\n\n// Element helper signature — accepts (props, children?), (children,), or no args\ntype ElFn<K extends keyof HTMLElementTagNameMap> = {\n (): HTMLElementTagNameMap[K]\n (props: ElementProps, children?: Children): HTMLElementTagNameMap[K]\n (children: Children): HTMLElementTagNameMap[K]\n}\n\n// Void-element helper signature — no children allowed\ntype VoidElFn<K extends keyof HTMLElementTagNameMap> = {\n (): HTMLElementTagNameMap[K]\n (props: ElementProps): HTMLElementTagNameMap[K]\n}\n\n/* v8 ignore start — mechanical tag wrappers */\n// prettier-ignore\nexport const a = ((p?: ElementProps | Children, c?: Children) => createElement('a', p, c)) as ElFn<'a'>\n// prettier-ignore\nexport const abbr = ((p?: ElementProps | Children, c?: Children) => createElement('abbr', p, c)) as ElFn<'abbr'>\n// prettier-ignore\nexport const article = ((p?: ElementProps | Children, c?: Children) => createElement('article', p, c)) as ElFn<'article'>\n// prettier-ignore\nexport const aside = ((p?: ElementProps | Children, c?: Children) => createElement('aside', p, c)) as ElFn<'aside'>\n// prettier-ignore\nexport const b = ((p?: ElementProps | Children, c?: Children) => createElement('b', p, c)) as ElFn<'b'>\n// prettier-ignore\nexport const blockquote = ((p?: ElementProps | Children, c?: Children) => createElement('blockquote', p, c)) as ElFn<'blockquote'>\n// prettier-ignore\nexport const br = ((p?: ElementProps) => createElement('br', p)) as VoidElFn<'br'>\n// prettier-ignore\nexport const button = ((p?: ElementProps | Children, c?: Children) => createElement('button', p, c)) as ElFn<'button'>\n// prettier-ignore\nexport const canvas = ((p?: ElementProps | Children, c?: Children) => createElement('canvas', p, c)) as ElFn<'canvas'>\n// prettier-ignore\nexport const code = ((p?: ElementProps | Children, c?: Children) => createElement('code', p, c)) as ElFn<'code'>\n// prettier-ignore\nexport const dd = ((p?: ElementProps | Children, c?: Children) => createElement('dd', p, c)) as ElFn<'dd'>\n// prettier-ignore\nexport const details = ((p?: ElementProps | Children, c?: Children) => createElement('details', p, c)) as ElFn<'details'>\n// prettier-ignore\nexport const dialog = ((p?: ElementProps | Children, c?: Children) => createElement('dialog', p, c)) as ElFn<'dialog'>\n// prettier-ignore\nexport const div = ((p?: ElementProps | Children, c?: Children) => createElement('div', p, c)) as ElFn<'div'>\n// prettier-ignore\nexport const dl = ((p?: ElementProps | Children, c?: Children) => createElement('dl', p, c)) as ElFn<'dl'>\n// prettier-ignore\nexport const dt = ((p?: ElementProps | Children, c?: Children) => createElement('dt', p, c)) as ElFn<'dt'>\n// prettier-ignore\nexport const em = ((p?: ElementProps | Children, c?: Children) => createElement('em', p, c)) as ElFn<'em'>\n// prettier-ignore\nexport const fieldset = ((p?: ElementProps | Children, c?: Children) => createElement('fieldset', p, c)) as ElFn<'fieldset'>\n// prettier-ignore\nexport const figcaption = ((p?: ElementProps | Children, c?: Children) => createElement('figcaption', p, c)) as ElFn<'figcaption'>\n// prettier-ignore\nexport const figure = ((p?: ElementProps | Children, c?: Children) => createElement('figure', p, c)) as ElFn<'figure'>\n// prettier-ignore\nexport const footer = ((p?: ElementProps | Children, c?: Children) => createElement('footer', p, c)) as ElFn<'footer'>\n// prettier-ignore\nexport const form = ((p?: ElementProps | Children, c?: Children) => createElement('form', p, c)) as ElFn<'form'>\n// prettier-ignore\nexport const h1 = ((p?: ElementProps | Children, c?: Children) => createElement('h1', p, c)) as ElFn<'h1'>\n// prettier-ignore\nexport const h2 = ((p?: ElementProps | Children, c?: Children) => createElement('h2', p, c)) as ElFn<'h2'>\n// prettier-ignore\nexport const h3 = ((p?: ElementProps | Children, c?: Children) => createElement('h3', p, c)) as ElFn<'h3'>\n// prettier-ignore\nexport const h4 = ((p?: ElementProps | Children, c?: Children) => createElement('h4', p, c)) as ElFn<'h4'>\n// prettier-ignore\nexport const h5 = ((p?: ElementProps | Children, c?: Children) => createElement('h5', p, c)) as ElFn<'h5'>\n// prettier-ignore\nexport const h6 = ((p?: ElementProps | Children, c?: Children) => createElement('h6', p, c)) as ElFn<'h6'>\n// prettier-ignore\nexport const header = ((p?: ElementProps | Children, c?: Children) => createElement('header', p, c)) as ElFn<'header'>\n// prettier-ignore\nexport const hr = ((p?: ElementProps) => createElement('hr', p)) as VoidElFn<'hr'>\n// prettier-ignore\nexport const i = ((p?: ElementProps | Children, c?: Children) => createElement('i', p, c)) as ElFn<'i'>\n// prettier-ignore\nexport const iframe = ((p?: ElementProps | Children, c?: Children) => createElement('iframe', p, c)) as ElFn<'iframe'>\n// prettier-ignore\nexport const img = ((p?: ElementProps) => createElement('img', p)) as VoidElFn<'img'>\n// prettier-ignore\nexport const input = ((p?: ElementProps) => createElement('input', p)) as VoidElFn<'input'>\n// prettier-ignore\nexport const label = ((p?: ElementProps | Children, c?: Children) => createElement('label', p, c)) as ElFn<'label'>\n// prettier-ignore\nexport const legend = ((p?: ElementProps | Children, c?: Children) => createElement('legend', p, c)) as ElFn<'legend'>\n// prettier-ignore\nexport const li = ((p?: ElementProps | Children, c?: Children) => createElement('li', p, c)) as ElFn<'li'>\n// prettier-ignore\nexport const main = ((p?: ElementProps | Children, c?: Children) => createElement('main', p, c)) as ElFn<'main'>\n// prettier-ignore\nexport const mark = ((p?: ElementProps | Children, c?: Children) => createElement('mark', p, c)) as ElFn<'mark'>\n// prettier-ignore\nexport const nav = ((p?: ElementProps | Children, c?: Children) => createElement('nav', p, c)) as ElFn<'nav'>\n// prettier-ignore\nexport const ol = ((p?: ElementProps | Children, c?: Children) => createElement('ol', p, c)) as ElFn<'ol'>\n// prettier-ignore\nexport const optgroup = ((p?: ElementProps | Children, c?: Children) => createElement('optgroup', p, c)) as ElFn<'optgroup'>\n// prettier-ignore\nexport const option = ((p?: ElementProps | Children, c?: Children) => createElement('option', p, c)) as ElFn<'option'>\n// prettier-ignore\nexport const output = ((p?: ElementProps | Children, c?: Children) => createElement('output', p, c)) as ElFn<'output'>\n// prettier-ignore\nexport const p = ((p?: ElementProps | Children, c?: Children) => createElement('p', p, c)) as ElFn<'p'>\n// prettier-ignore\nexport const pre = ((p?: ElementProps | Children, c?: Children) => createElement('pre', p, c)) as ElFn<'pre'>\n// prettier-ignore\nexport const progress = ((p?: ElementProps | Children, c?: Children) => createElement('progress', p, c)) as ElFn<'progress'>\n// prettier-ignore\nexport const section = ((p?: ElementProps | Children, c?: Children) => createElement('section', p, c)) as ElFn<'section'>\n// prettier-ignore\nexport const select = ((p?: ElementProps | Children, c?: Children) => createElement('select', p, c)) as ElFn<'select'>\n// prettier-ignore\nexport const small = ((p?: ElementProps | Children, c?: Children) => createElement('small', p, c)) as ElFn<'small'>\n// prettier-ignore\nexport const span = ((p?: ElementProps | Children, c?: Children) => createElement('span', p, c)) as ElFn<'span'>\n// prettier-ignore\nexport const strong = ((p?: ElementProps | Children, c?: Children) => createElement('strong', p, c)) as ElFn<'strong'>\n// prettier-ignore\nexport const sub = ((p?: ElementProps | Children, c?: Children) => createElement('sub', p, c)) as ElFn<'sub'>\n// prettier-ignore\nexport const summary = ((p?: ElementProps | Children, c?: Children) => createElement('summary', p, c)) as ElFn<'summary'>\n// prettier-ignore\nexport const sup = ((p?: ElementProps | Children, c?: Children) => createElement('sup', p, c)) as ElFn<'sup'>\n// prettier-ignore\nexport const table = ((p?: ElementProps | Children, c?: Children) => createElement('table', p, c)) as ElFn<'table'>\n// prettier-ignore\nexport const tbody = ((p?: ElementProps | Children, c?: Children) => createElement('tbody', p, c)) as ElFn<'tbody'>\n// prettier-ignore\nexport const td = ((p?: ElementProps | Children, c?: Children) => createElement('td', p, c)) as ElFn<'td'>\n// prettier-ignore\nexport const textarea = ((p?: ElementProps | Children, c?: Children) => createElement('textarea', p, c)) as ElFn<'textarea'>\n// prettier-ignore\nexport const tfoot = ((p?: ElementProps | Children, c?: Children) => createElement('tfoot', p, c)) as ElFn<'tfoot'>\n// prettier-ignore\nexport const th = ((p?: ElementProps | Children, c?: Children) => createElement('th', p, c)) as ElFn<'th'>\n// prettier-ignore\nexport const thead = ((p?: ElementProps | Children, c?: Children) => createElement('thead', p, c)) as ElFn<'thead'>\n// prettier-ignore\nexport const time = ((p?: ElementProps | Children, c?: Children) => createElement('time', p, c)) as ElFn<'time'>\n// prettier-ignore\nexport const tr = ((p?: ElementProps | Children, c?: Children) => createElement('tr', p, c)) as ElFn<'tr'>\n// prettier-ignore\nexport const ul = ((p?: ElementProps | Children, c?: Children) => createElement('ul', p, c)) as ElFn<'ul'>\n// prettier-ignore\nexport const video = ((p?: ElementProps | Children, c?: Children) => createElement('video', p, c)) as ElFn<'video'>\n/* v8 ignore stop */\n"]}
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAM5C,oEAAoE;AACpE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACxB,OAAO;IACP,SAAS;IACT,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,eAAe;IACf,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E,CAAC,CAAC,CAAe,CAAA;AAC1G,kBAAkB;AAClB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAA2B,EAAE,CAAY,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAkB,CAAA;AACnH,kBAAkB;AAClB,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAA2B,EAAE,CAAY,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAiB,CAAA;AAChH,kBAAkB;AAClB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAA2B,EAAE,CAAY,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAe,CAAA;AAC1G,kBAAkB;AAClB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAA2B,EAAE,CAAY,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAe,CAAA;AAC1G,kBAAkB;AAClB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAA2B,EAAE,CAAY,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAkB,CAAA;AACnH,oBAAoB","sourcesContent":["import type { BindingKind } from './types.js'\nimport { getRenderContext } from './render-context.js'\nimport { createBinding, applyBinding } from './binding.js'\nimport { FULL_MASK } from './update-loop.js'\n\ntype ElementProps = Record<string, unknown>\ntype Child = Node | string | Node[]\ntype Children = Child[]\n\n// DOM properties set via elem[key] = value rather than setAttribute\nconst PROP_KEYS = new Set([\n 'value',\n 'checked',\n 'selected',\n 'disabled',\n 'readOnly',\n 'multiple',\n 'indeterminate',\n 'defaultValue',\n 'defaultChecked',\n 'innerHTML',\n 'textContent',\n])\n\nfunction classifyKind(key: string): BindingKind {\n if (key === 'class' || key === 'className') return 'class'\n if (key.startsWith('style.')) return 'style'\n if (PROP_KEYS.has(key)) return 'prop'\n return 'attr'\n}\n\nfunction resolveKey(key: string, kind: BindingKind): string | undefined {\n if (kind === 'class') return undefined\n if (kind === 'style') return key.slice(6) // strip 'style.'\n if (kind === 'prop') return key\n // attr\n if (key === 'className') return 'class'\n return key\n}\n\nfunction createElement<K extends keyof HTMLElementTagNameMap>(\n tag: K,\n propsOrChildren?: ElementProps | Children,\n maybeChildren?: Children,\n): HTMLElementTagNameMap[K] {\n const ctx = getRenderContext()\n const el = ctx.dom.createElement(tag) as HTMLElementTagNameMap[K]\n\n // Distinguish (props, children) from (children,) — if first arg is an Array, it's children\n const props: ElementProps | undefined = Array.isArray(propsOrChildren)\n ? undefined\n : propsOrChildren\n const children: Children | undefined = Array.isArray(propsOrChildren)\n ? propsOrChildren\n : maybeChildren\n\n // Props that have to apply AFTER children are appended. `<select\n // value=...>` is the canonical case: setting `value` on a select\n // without options is a silent no-op in real browsers + jsdom\n // (value falls through to the first option on append), and a hard\n // throw under linkedom (its HTMLSelectElement.value setter, once\n // patched, walks options — but there are none yet if we set before\n // appending). Deferring the apply fixes all three envs.\n const deferred: Array<() => void> = []\n\n if (props) {\n for (const [rawKey, value] of Object.entries(props)) {\n if (rawKey === 'key') continue\n\n // Event handler\n if (/^on[A-Z]/.test(rawKey)) {\n const eventName = rawKey.slice(2).toLowerCase()\n el.addEventListener(eventName, value as EventListener)\n continue\n }\n\n const isSelectValue = tag === 'select' && rawKey === 'value'\n\n // Reactive binding — value is a function\n if (typeof value === 'function') {\n const kind = classifyKind(rawKey)\n const key = resolveKey(rawKey, kind)\n const accessor = value as (state: never) => unknown\n const perItem = value.length === 0\n\n const binding = createBinding(ctx.rootLifetime, {\n mask: FULL_MASK,\n accessor,\n kind,\n node: el,\n key,\n perItem,\n })\n\n const initialValue = perItem ? (value as () => unknown)() : accessor(ctx.state as never)\n binding.lastValue = initialValue\n if (isSelectValue) {\n deferred.push(() => applyBinding({ kind, node: el, key }, initialValue))\n } else {\n applyBinding({ kind, node: el, key }, initialValue)\n }\n continue\n }\n\n // Static prop\n const kind = classifyKind(rawKey)\n const key = resolveKey(rawKey, kind)\n if (isSelectValue) {\n deferred.push(() => applyBinding({ kind, node: el, key }, value))\n } else {\n applyBinding({ kind, node: el, key }, value)\n }\n }\n }\n\n if (children) {\n for (const child of children) {\n if (typeof child === 'string') {\n el.appendChild(ctx.dom.createTextNode(child))\n } else if (Array.isArray(child)) {\n for (const node of child) el.appendChild(node)\n } else {\n el.appendChild(child)\n }\n }\n }\n\n for (const fn of deferred) fn()\n\n return el\n}\n\n// Element helper signature — accepts (props, children?), (children,), or no args\ntype ElFn<K extends keyof HTMLElementTagNameMap> = {\n (): HTMLElementTagNameMap[K]\n (props: ElementProps, children?: Children): HTMLElementTagNameMap[K]\n (children: Children): HTMLElementTagNameMap[K]\n}\n\n// Void-element helper signature — no children allowed\ntype VoidElFn<K extends keyof HTMLElementTagNameMap> = {\n (): HTMLElementTagNameMap[K]\n (props: ElementProps): HTMLElementTagNameMap[K]\n}\n\n/* v8 ignore start — mechanical tag wrappers */\n// prettier-ignore\nexport const a = ((p?: ElementProps | Children, c?: Children) => createElement('a', p, c)) as ElFn<'a'>\n// prettier-ignore\nexport const abbr = ((p?: ElementProps | Children, c?: Children) => createElement('abbr', p, c)) as ElFn<'abbr'>\n// prettier-ignore\nexport const article = ((p?: ElementProps | Children, c?: Children) => createElement('article', p, c)) as ElFn<'article'>\n// prettier-ignore\nexport const aside = ((p?: ElementProps | Children, c?: Children) => createElement('aside', p, c)) as ElFn<'aside'>\n// prettier-ignore\nexport const b = ((p?: ElementProps | Children, c?: Children) => createElement('b', p, c)) as ElFn<'b'>\n// prettier-ignore\nexport const blockquote = ((p?: ElementProps | Children, c?: Children) => createElement('blockquote', p, c)) as ElFn<'blockquote'>\n// prettier-ignore\nexport const br = ((p?: ElementProps) => createElement('br', p)) as VoidElFn<'br'>\n// prettier-ignore\nexport const button = ((p?: ElementProps | Children, c?: Children) => createElement('button', p, c)) as ElFn<'button'>\n// prettier-ignore\nexport const canvas = ((p?: ElementProps | Children, c?: Children) => createElement('canvas', p, c)) as ElFn<'canvas'>\n// prettier-ignore\nexport const code = ((p?: ElementProps | Children, c?: Children) => createElement('code', p, c)) as ElFn<'code'>\n// prettier-ignore\nexport const dd = ((p?: ElementProps | Children, c?: Children) => createElement('dd', p, c)) as ElFn<'dd'>\n// prettier-ignore\nexport const details = ((p?: ElementProps | Children, c?: Children) => createElement('details', p, c)) as ElFn<'details'>\n// prettier-ignore\nexport const dialog = ((p?: ElementProps | Children, c?: Children) => createElement('dialog', p, c)) as ElFn<'dialog'>\n// prettier-ignore\nexport const div = ((p?: ElementProps | Children, c?: Children) => createElement('div', p, c)) as ElFn<'div'>\n// prettier-ignore\nexport const dl = ((p?: ElementProps | Children, c?: Children) => createElement('dl', p, c)) as ElFn<'dl'>\n// prettier-ignore\nexport const dt = ((p?: ElementProps | Children, c?: Children) => createElement('dt', p, c)) as ElFn<'dt'>\n// prettier-ignore\nexport const em = ((p?: ElementProps | Children, c?: Children) => createElement('em', p, c)) as ElFn<'em'>\n// prettier-ignore\nexport const fieldset = ((p?: ElementProps | Children, c?: Children) => createElement('fieldset', p, c)) as ElFn<'fieldset'>\n// prettier-ignore\nexport const figcaption = ((p?: ElementProps | Children, c?: Children) => createElement('figcaption', p, c)) as ElFn<'figcaption'>\n// prettier-ignore\nexport const figure = ((p?: ElementProps | Children, c?: Children) => createElement('figure', p, c)) as ElFn<'figure'>\n// prettier-ignore\nexport const footer = ((p?: ElementProps | Children, c?: Children) => createElement('footer', p, c)) as ElFn<'footer'>\n// prettier-ignore\nexport const form = ((p?: ElementProps | Children, c?: Children) => createElement('form', p, c)) as ElFn<'form'>\n// prettier-ignore\nexport const h1 = ((p?: ElementProps | Children, c?: Children) => createElement('h1', p, c)) as ElFn<'h1'>\n// prettier-ignore\nexport const h2 = ((p?: ElementProps | Children, c?: Children) => createElement('h2', p, c)) as ElFn<'h2'>\n// prettier-ignore\nexport const h3 = ((p?: ElementProps | Children, c?: Children) => createElement('h3', p, c)) as ElFn<'h3'>\n// prettier-ignore\nexport const h4 = ((p?: ElementProps | Children, c?: Children) => createElement('h4', p, c)) as ElFn<'h4'>\n// prettier-ignore\nexport const h5 = ((p?: ElementProps | Children, c?: Children) => createElement('h5', p, c)) as ElFn<'h5'>\n// prettier-ignore\nexport const h6 = ((p?: ElementProps | Children, c?: Children) => createElement('h6', p, c)) as ElFn<'h6'>\n// prettier-ignore\nexport const header = ((p?: ElementProps | Children, c?: Children) => createElement('header', p, c)) as ElFn<'header'>\n// prettier-ignore\nexport const hr = ((p?: ElementProps) => createElement('hr', p)) as VoidElFn<'hr'>\n// prettier-ignore\nexport const i = ((p?: ElementProps | Children, c?: Children) => createElement('i', p, c)) as ElFn<'i'>\n// prettier-ignore\nexport const iframe = ((p?: ElementProps | Children, c?: Children) => createElement('iframe', p, c)) as ElFn<'iframe'>\n// prettier-ignore\nexport const img = ((p?: ElementProps) => createElement('img', p)) as VoidElFn<'img'>\n// prettier-ignore\nexport const input = ((p?: ElementProps) => createElement('input', p)) as VoidElFn<'input'>\n// prettier-ignore\nexport const label = ((p?: ElementProps | Children, c?: Children) => createElement('label', p, c)) as ElFn<'label'>\n// prettier-ignore\nexport const legend = ((p?: ElementProps | Children, c?: Children) => createElement('legend', p, c)) as ElFn<'legend'>\n// prettier-ignore\nexport const li = ((p?: ElementProps | Children, c?: Children) => createElement('li', p, c)) as ElFn<'li'>\n// prettier-ignore\nexport const main = ((p?: ElementProps | Children, c?: Children) => createElement('main', p, c)) as ElFn<'main'>\n// prettier-ignore\nexport const mark = ((p?: ElementProps | Children, c?: Children) => createElement('mark', p, c)) as ElFn<'mark'>\n// prettier-ignore\nexport const nav = ((p?: ElementProps | Children, c?: Children) => createElement('nav', p, c)) as ElFn<'nav'>\n// prettier-ignore\nexport const ol = ((p?: ElementProps | Children, c?: Children) => createElement('ol', p, c)) as ElFn<'ol'>\n// prettier-ignore\nexport const optgroup = ((p?: ElementProps | Children, c?: Children) => createElement('optgroup', p, c)) as ElFn<'optgroup'>\n// prettier-ignore\nexport const option = ((p?: ElementProps | Children, c?: Children) => createElement('option', p, c)) as ElFn<'option'>\n// prettier-ignore\nexport const output = ((p?: ElementProps | Children, c?: Children) => createElement('output', p, c)) as ElFn<'output'>\n// prettier-ignore\nexport const p = ((p?: ElementProps | Children, c?: Children) => createElement('p', p, c)) as ElFn<'p'>\n// prettier-ignore\nexport const pre = ((p?: ElementProps | Children, c?: Children) => createElement('pre', p, c)) as ElFn<'pre'>\n// prettier-ignore\nexport const progress = ((p?: ElementProps | Children, c?: Children) => createElement('progress', p, c)) as ElFn<'progress'>\n// prettier-ignore\nexport const section = ((p?: ElementProps | Children, c?: Children) => createElement('section', p, c)) as ElFn<'section'>\n// prettier-ignore\nexport const select = ((p?: ElementProps | Children, c?: Children) => createElement('select', p, c)) as ElFn<'select'>\n// prettier-ignore\nexport const small = ((p?: ElementProps | Children, c?: Children) => createElement('small', p, c)) as ElFn<'small'>\n// prettier-ignore\nexport const span = ((p?: ElementProps | Children, c?: Children) => createElement('span', p, c)) as ElFn<'span'>\n// prettier-ignore\nexport const strong = ((p?: ElementProps | Children, c?: Children) => createElement('strong', p, c)) as ElFn<'strong'>\n// prettier-ignore\nexport const sub = ((p?: ElementProps | Children, c?: Children) => createElement('sub', p, c)) as ElFn<'sub'>\n// prettier-ignore\nexport const summary = ((p?: ElementProps | Children, c?: Children) => createElement('summary', p, c)) as ElFn<'summary'>\n// prettier-ignore\nexport const sup = ((p?: ElementProps | Children, c?: Children) => createElement('sup', p, c)) as ElFn<'sup'>\n// prettier-ignore\nexport const table = ((p?: ElementProps | Children, c?: Children) => createElement('table', p, c)) as ElFn<'table'>\n// prettier-ignore\nexport const tbody = ((p?: ElementProps | Children, c?: Children) => createElement('tbody', p, c)) as ElFn<'tbody'>\n// prettier-ignore\nexport const td = ((p?: ElementProps | Children, c?: Children) => createElement('td', p, c)) as ElFn<'td'>\n// prettier-ignore\nexport const textarea = ((p?: ElementProps | Children, c?: Children) => createElement('textarea', p, c)) as ElFn<'textarea'>\n// prettier-ignore\nexport const tfoot = ((p?: ElementProps | Children, c?: Children) => createElement('tfoot', p, c)) as ElFn<'tfoot'>\n// prettier-ignore\nexport const th = ((p?: ElementProps | Children, c?: Children) => createElement('th', p, c)) as ElFn<'th'>\n// prettier-ignore\nexport const thead = ((p?: ElementProps | Children, c?: Children) => createElement('thead', p, c)) as ElFn<'thead'>\n// prettier-ignore\nexport const time = ((p?: ElementProps | Children, c?: Children) => createElement('time', p, c)) as ElFn<'time'>\n// prettier-ignore\nexport const tr = ((p?: ElementProps | Children, c?: Children) => createElement('tr', p, c)) as ElFn<'tr'>\n// prettier-ignore\nexport const ul = ((p?: ElementProps | Children, c?: Children) => createElement('ul', p, c)) as ElFn<'ul'>\n// prettier-ignore\nexport const video = ((p?: ElementProps | Children, c?: Children) => createElement('video', p, c)) as ElFn<'video'>\n/* v8 ignore stop */\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/primitives/portal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIhD,wBAAgB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/primitives/portal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIhD,wBAAgB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,EAAE,CAmDlD"}
|
|
@@ -3,7 +3,26 @@ import { createLifetime, addDisposer } from '../lifetime.js';
|
|
|
3
3
|
export function portal(opts) {
|
|
4
4
|
const ctx = getRenderContext('portal');
|
|
5
5
|
const parentLifetime = ctx.rootLifetime;
|
|
6
|
-
|
|
6
|
+
// Resolve a string target against the current env's document.
|
|
7
|
+
// `ctx.dom.querySelector` is present on every env shipped by
|
|
8
|
+
// `@llui/dom` (browserEnv, jsdomEnv, linkedomEnv). For a user-built
|
|
9
|
+
// env that predates this method we fall back to `globalThis.document`,
|
|
10
|
+
// and if THAT is also absent — which is exactly the Cloudflare
|
|
11
|
+
// Workers + linkedom-with-stale-env case portal used to crash on —
|
|
12
|
+
// we return [] instead of throwing. Portal is a client concept; SSR
|
|
13
|
+
// silently skipping the resolution is the right "no-op" behavior.
|
|
14
|
+
let target = null;
|
|
15
|
+
if (typeof opts.target === 'string') {
|
|
16
|
+
if (ctx.dom.querySelector) {
|
|
17
|
+
target = ctx.dom.querySelector(opts.target);
|
|
18
|
+
}
|
|
19
|
+
else if (typeof document !== 'undefined') {
|
|
20
|
+
target = document.querySelector(opts.target);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
target = opts.target;
|
|
25
|
+
}
|
|
7
26
|
if (!target) {
|
|
8
27
|
return [];
|
|
9
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.js","sourceRoot":"","sources":["../../src/primitives/portal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC7F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5D,MAAM,UAAU,MAAM,CAAC,IAAmB;IACxC,MAAM,GAAG,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,cAAc,GAAG,GAAG,CAAC,YAAY,CAAA;IAEvC,
|
|
1
|
+
{"version":3,"file":"portal.js","sourceRoot":"","sources":["../../src/primitives/portal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC7F,OAAO,EAAE,cAAc,EAAE,WAA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AI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IAED,qDAAqD;IACrD,WAAW,CAAC,WAAW,EAAE,GAAG,EAAE;QAC5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,UAAU,KAAK,MAAM,EAAE,CAAC;gBAC/B,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YAC1B,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,sEAAsE;IACtE,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["import type { PortalOptions } from '../types.js'\nimport { getRenderContext, setRenderContext, clearRenderContext } from '../render-context.js'\nimport { createLifetime, addDisposer } from '../lifetime.js'\n\nexport function portal(opts: PortalOptions): Node[] {\n const ctx = getRenderContext('portal')\n const parentLifetime = ctx.rootLifetime\n\n // Resolve a string target against the current env's document.\n // `ctx.dom.querySelector` is present on every env shipped by\n // `@llui/dom` (browserEnv, jsdomEnv, linkedomEnv). For a user-built\n // env that predates this method we fall back to `globalThis.document`,\n // and if THAT is also absent — which is exactly the Cloudflare\n // Workers + linkedom-with-stale-env case portal used to crash on —\n // we return [] instead of throwing. Portal is a client concept; SSR\n // silently skipping the resolution is the right \"no-op\" behavior.\n let target: Element | null = null\n if (typeof opts.target === 'string') {\n if (ctx.dom.querySelector) {\n target = ctx.dom.querySelector(opts.target)\n } else if (typeof document !== 'undefined') {\n target = document.querySelector(opts.target)\n }\n } else {\n target = opts.target\n }\n\n if (!target) {\n return []\n }\n\n const portalScope = createLifetime(parentLifetime)\n portalScope._kind = 'portal'\n const buildCtx = { ...ctx, rootLifetime: portalScope, container: target as Element }\n setRenderContext(buildCtx)\n const nodes = opts.render()\n clearRenderContext()\n // Restore parent context\n setRenderContext(ctx)\n\n for (const node of nodes) {\n target.appendChild(node)\n }\n\n // On scope disposal, remove portal nodes from target\n addDisposer(portalScope, () => {\n for (const node of nodes) {\n if (node.parentNode === target) {\n target.removeChild(node)\n }\n }\n })\n\n // Portal returns nothing to the parent DOM — nodes live in the target\n return []\n}\n"]}
|
package/dist/ssr/jsdom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsdom.d.ts","sourceRoot":"","sources":["../../src/ssr/jsdom.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"jsdom.d.ts","sourceRoot":"","sources":["../../src/ssr/jsdom.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAyB3C;;;;;;;GAOG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CA8BhD"}
|
package/dist/ssr/jsdom.js
CHANGED
package/dist/ssr/jsdom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsdom.js","sourceRoot":"","sources":["../../src/ssr/jsdom.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jsdom.js","sourceRoot":"","sources":["../../src/ssr/jsdom.ts"],"names":[],"mappings":"AAgCA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,qEAAqE;IACrE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,CAAA;IACtC,MAAM,EAAE,KAAK,EAAE,GAAG,QAAoE,CAAA;IACtF,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAA;IAClE,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAA;IAEpB,OAAO;QACL,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC;QACrD,eAAe,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,EAAE,GAAG,CAAC;QACjE,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC;QACzD,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC;QACvD,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,sBAAsB,EAAE;QACjE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE;QAC3C,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,gBAAgB,EAAE,CAAC,CAAC,gBAAgB;QACpC,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,mBAAmB,EAAE,CAAC,CAAC,mBAAmB;QAC1C,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE;YAC1B,MAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAwB,CAAA;YAC5E,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAA;YACzB,OAAO,QAAQ,CAAC,OAAO,CAAA;QACzB,CAAC;QACD,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;KAChE,CAAA;AACH,CAAC","sourcesContent":["/**\n * `@llui/dom/ssr/jsdom` — jsdom-backed `DomEnv` factory.\n *\n * Only imports jsdom. Consumers who need a different DOM (linkedom,\n * happy-dom, custom) use the corresponding sub-entry or build their\n * own `DomEnv` by hand — neither route pulls jsdom into the bundle.\n */\nimport type { DomEnv } from '../dom-env.js'\n\n// jsdom is an optional peer dependency. The typing below is just\n// enough to construct the env; callers don't see the jsdom surface.\ninterface JsdomWindow {\n document: {\n createElement: (tag: string) => Element\n createElementNS: (ns: string, tag: string) => Element\n createTextNode: (text: string) => Text\n createComment: (text: string) => Comment\n createDocumentFragment: () => DocumentFragment\n createRange: () => Range\n querySelector: (selector: string) => Element | null\n }\n Element: typeof Element\n Node: typeof Node\n Text: typeof Text\n Comment: typeof Comment\n DocumentFragment: typeof DocumentFragment\n HTMLElement: typeof HTMLElement\n HTMLTemplateElement: typeof HTMLTemplateElement\n ShadowRoot: typeof ShadowRoot\n MouseEvent: typeof MouseEvent\n}\n\n/**\n * Construct a `DomEnv` backed by a fresh jsdom instance. Each call\n * returns a new env — no process-level state, safe under concurrency.\n *\n * Requires `jsdom` as an installed dependency. If you don't want the\n * jsdom bundle (e.g. on Cloudflare Workers), use `linkedomEnv()` from\n * `@llui/dom/ssr/linkedom` instead.\n */\nexport async function jsdomEnv(): Promise<DomEnv> {\n // @ts-expect-error — jsdom is an optional peer dependency, not typed\n const jsdomMod = await import('jsdom')\n const { JSDOM } = jsdomMod as { JSDOM: new (html: string) => { window: JsdomWindow } }\n const dom = new JSDOM('<!DOCTYPE html><html><body></body></html>')\n const w = dom.window\n\n return {\n createElement: (tag) => w.document.createElement(tag),\n createElementNS: (ns, tag) => w.document.createElementNS(ns, tag),\n createTextNode: (text) => w.document.createTextNode(text),\n createComment: (text) => w.document.createComment(text),\n createDocumentFragment: () => w.document.createDocumentFragment(),\n createRange: () => w.document.createRange(),\n Element: w.Element,\n Node: w.Node,\n Text: w.Text,\n Comment: w.Comment,\n DocumentFragment: w.DocumentFragment,\n HTMLElement: w.HTMLElement,\n HTMLTemplateElement: w.HTMLTemplateElement,\n ShadowRoot: w.ShadowRoot,\n MouseEvent: w.MouseEvent,\n parseHtmlFragment: (html) => {\n const template = w.document.createElement('template') as HTMLTemplateElement\n template.innerHTML = html\n return template.content\n },\n querySelector: (selector) => w.document.querySelector(selector),\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkedom.d.ts","sourceRoot":"","sources":["../../src/ssr/linkedom.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"linkedom.d.ts","sourceRoot":"","sources":["../../src/ssr/linkedom.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAgF3C;;;;;;GAMG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAqCnD"}
|
package/dist/ssr/linkedom.js
CHANGED
|
@@ -1,3 +1,58 @@
|
|
|
1
|
+
// Tracks whether we've installed the HTMLSelectElement.value setter
|
|
2
|
+
// patch for a given prototype. Linkedom instances share prototype
|
|
3
|
+
// objects across `parseHTML` calls, so the patch only needs to run
|
|
4
|
+
// once per prototype — the WeakSet key keeps it idempotent without
|
|
5
|
+
// scanning existing descriptors on every linkedomEnv() call.
|
|
6
|
+
const patchedSelectProtos = new WeakSet();
|
|
7
|
+
/**
|
|
8
|
+
* Linkedom's `HTMLSelectElement.prototype.value` is a get-only accessor
|
|
9
|
+
* — assigning `select.value = 'foo'` throws
|
|
10
|
+
* `TypeError: Cannot set property value of [object Object] which has
|
|
11
|
+
* only a getter`. LLui's reactive attribute bindings call the IDL
|
|
12
|
+
* setter at render time to mirror the matching `<option selected>`,
|
|
13
|
+
* which is standard on jsdom and real browsers.
|
|
14
|
+
*
|
|
15
|
+
* We install a setter that walks child `<option>`s and toggles the
|
|
16
|
+
* `selected` attribute to match the requested value. Matching
|
|
17
|
+
* semantics follow the HTML spec: compare against `option.value`
|
|
18
|
+
* (which falls back to `option.textContent` when no explicit `value`
|
|
19
|
+
* attribute is set). The getter mirrors this lookup so round-trips
|
|
20
|
+
* (`set` then `get`) are consistent.
|
|
21
|
+
*
|
|
22
|
+
* Idempotent — safe to call on every `linkedomEnv()`.
|
|
23
|
+
*/
|
|
24
|
+
function patchSelectValueSetter(w) {
|
|
25
|
+
if (!w.HTMLSelectElement)
|
|
26
|
+
return;
|
|
27
|
+
const proto = w.HTMLSelectElement.prototype;
|
|
28
|
+
if (patchedSelectProtos.has(proto))
|
|
29
|
+
return;
|
|
30
|
+
const existing = Object.getOwnPropertyDescriptor(proto, 'value');
|
|
31
|
+
if (existing?.set) {
|
|
32
|
+
patchedSelectProtos.add(proto);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(proto, 'value', {
|
|
36
|
+
configurable: true,
|
|
37
|
+
get() {
|
|
38
|
+
const sel = this.querySelector('option[selected]');
|
|
39
|
+
return sel?.getAttribute('value') ?? sel?.textContent ?? '';
|
|
40
|
+
},
|
|
41
|
+
set(v) {
|
|
42
|
+
const target = String(v);
|
|
43
|
+
const options = this.querySelectorAll('option');
|
|
44
|
+
for (let i = 0; i < options.length; i++) {
|
|
45
|
+
const opt = options[i];
|
|
46
|
+
const ov = opt.getAttribute('value') ?? opt.textContent ?? '';
|
|
47
|
+
if (ov === target)
|
|
48
|
+
opt.setAttribute('selected', '');
|
|
49
|
+
else
|
|
50
|
+
opt.removeAttribute('selected');
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
patchedSelectProtos.add(proto);
|
|
55
|
+
}
|
|
1
56
|
/**
|
|
2
57
|
* Construct a `DomEnv` backed by a fresh linkedom instance. Each call
|
|
3
58
|
* returns a new env — no process-level state, safe under concurrency
|
|
@@ -15,6 +70,7 @@ export async function linkedomEnv() {
|
|
|
15
70
|
const linkedomMod = (await import('linkedom'));
|
|
16
71
|
const { parseHTML } = linkedomMod;
|
|
17
72
|
const w = parseHTML('<!DOCTYPE html><html><body></body></html>');
|
|
73
|
+
patchSelectValueSetter(w);
|
|
18
74
|
return {
|
|
19
75
|
createElement: (tag) => w.document.createElement(tag),
|
|
20
76
|
createElementNS: (ns, tag) => w.document.createElementNS(ns, tag),
|
|
@@ -36,6 +92,7 @@ export async function linkedomEnv() {
|
|
|
36
92
|
template.innerHTML = html;
|
|
37
93
|
return template.content;
|
|
38
94
|
},
|
|
95
|
+
querySelector: (selector) => w.document.querySelector(selector),
|
|
39
96
|
};
|
|
40
97
|
}
|
|
41
98
|
//# sourceMappingURL=linkedom.js.map
|
package/dist/ssr/linkedom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkedom.js","sourceRoot":"","sources":["../../src/ssr/linkedom.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linkedom.js","sourceRoot":"","sources":["../../src/ssr/linkedom.ts"],"names":[],"mappings":"AAkCA,oEAAoE;AACpE,kEAAkE;AAClE,mEAAmE;AACnE,mEAAmE;AACnE,6DAA6D;AAC7D,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAAU,CAAA;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,sBAAsB,CAAC,CAAiB;IAC/C,IAAI,CAAC,CAAC,CAAC,iBAAiB;QAAE,OAAM;IAChC,MAAM,KAAK,GAAG,CAAC,CAAC,iBAAiB,CAAC,SAA8B,CAAA;IAChE,IAAI,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAM;IAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAChE,IAAI,QAAQ,EAAE,GAAG,EAAE,CAAC;QAClB,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC9B,OAAM;IACR,CAAC;IACD,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE;QACpC,YAAY,EAAE,IAAI;QAClB,GAAG;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,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n * Linkedom is a lightweight JSDOM alternative — smaller bundle, works\n * on Cloudflare Workers and other strict-isolate runtimes where jsdom's\n * transitive `whatwg-url` / `tr46` / `punycode` chain fails to resolve.\n */\nimport type { DomEnv } from '../dom-env.js'\n\n// Linkedom exposes a `parseHTML` function that returns a window-like\n// object with DOM constructors and a `document`. The exact shape is\n// narrower than JSDOM's but matches the DomEnv surface we need.\ninterface LinkedomWindow {\n document: {\n createElement: (tag: string) => Element\n createElementNS: (ns: string, tag: string) => Element\n createTextNode: (text: string) => Text\n createComment: (text: string) => Comment\n createDocumentFragment: () => DocumentFragment\n createRange: () => Range\n querySelector: (selector: string) => Element | null\n }\n Element: typeof Element\n Node: typeof Node\n Text: typeof Text\n Comment: typeof Comment\n DocumentFragment: typeof DocumentFragment\n HTMLElement: typeof HTMLElement\n HTMLTemplateElement: typeof HTMLTemplateElement\n HTMLSelectElement: typeof HTMLSelectElement\n ShadowRoot: typeof ShadowRoot\n MouseEvent: typeof MouseEvent\n}\n\n// Tracks whether we've installed the HTMLSelectElement.value setter\n// patch for a given prototype. Linkedom instances share prototype\n// objects across `parseHTML` calls, so the patch only needs to run\n// once per prototype — the WeakSet key keeps it idempotent without\n// scanning existing descriptors on every linkedomEnv() call.\nconst patchedSelectProtos = new WeakSet<object>()\n\n/**\n * Linkedom's `HTMLSelectElement.prototype.value` is a get-only accessor\n * — assigning `select.value = 'foo'` throws\n * `TypeError: Cannot set property value of [object Object] which has\n * only a getter`. LLui's reactive attribute bindings call the IDL\n * setter at render time to mirror the matching `<option selected>`,\n * which is standard on jsdom and real browsers.\n *\n * We install a setter that walks child `<option>`s and toggles the\n * `selected` attribute to match the requested value. Matching\n * semantics follow the HTML spec: compare against `option.value`\n * (which falls back to `option.textContent` when no explicit `value`\n * attribute is set). The getter mirrors this lookup so round-trips\n * (`set` then `get`) are consistent.\n *\n * Idempotent — safe to call on every `linkedomEnv()`.\n */\nfunction patchSelectValueSetter(w: LinkedomWindow): void {\n if (!w.HTMLSelectElement) return\n const proto = w.HTMLSelectElement.prototype as unknown as object\n if (patchedSelectProtos.has(proto)) return\n const existing = Object.getOwnPropertyDescriptor(proto, 'value')\n if (existing?.set) {\n patchedSelectProtos.add(proto)\n return\n }\n Object.defineProperty(proto, 'value', {\n configurable: true,\n get(this: Element) {\n const sel = this.querySelector('option[selected]')\n return sel?.getAttribute('value') ?? sel?.textContent ?? ''\n },\n set(this: Element, v: unknown) {\n const target = String(v)\n const options = this.querySelectorAll('option')\n for (let i = 0; i < options.length; i++) {\n const opt = options[i]!\n const ov = opt.getAttribute('value') ?? opt.textContent ?? ''\n if (ov === target) opt.setAttribute('selected', '')\n else opt.removeAttribute('selected')\n }\n },\n })\n patchedSelectProtos.add(proto)\n}\n\n/**\n * Construct a `DomEnv` backed by a fresh linkedom instance. Each call\n * returns a new env — no process-level state, safe under concurrency\n * and compatible with Cloudflare Workers.\n *\n * Requires `linkedom` as an installed dependency.\n */\nexport async function linkedomEnv(): Promise<DomEnv> {\n // Dynamic import — linkedom is an optional peer dependency. When it\n // is installed (workspace build, or any consumer that needs the\n // linkedom env), TS resolves the module and infers a real type;\n // when absent, TS errors with \"Cannot find module 'linkedom'\" which\n // is the intended nudge. The explicit `as unknown as …` coerces\n // both cases through the narrow shape the runtime actually uses.\n const linkedomMod = (await import('linkedom')) as unknown as {\n parseHTML: (html: string) => LinkedomWindow\n }\n const { parseHTML } = linkedomMod\n const w = parseHTML('<!DOCTYPE html><html><body></body></html>')\n patchSelectValueSetter(w)\n\n return {\n createElement: (tag) => w.document.createElement(tag),\n createElementNS: (ns, tag) => w.document.createElementNS(ns, tag),\n createTextNode: (text) => w.document.createTextNode(text),\n createComment: (text) => w.document.createComment(text),\n createDocumentFragment: () => w.document.createDocumentFragment(),\n createRange: () => w.document.createRange(),\n Element: w.Element,\n Node: w.Node,\n Text: w.Text,\n Comment: w.Comment,\n DocumentFragment: w.DocumentFragment,\n HTMLElement: w.HTMLElement,\n HTMLTemplateElement: w.HTMLTemplateElement,\n ShadowRoot: w.ShadowRoot,\n MouseEvent: w.MouseEvent,\n parseHtmlFragment: (html) => {\n const template = w.document.createElement('template') as HTMLTemplateElement\n template.innerHTML = html\n return template.content\n },\n querySelector: (selector) => w.document.querySelector(selector),\n }\n}\n"]}
|