@jasonshimmy/custom-elements-runtime 3.4.0 → 3.5.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 +28 -7
- package/dist/css-utils-Bn-dO44e.js +203 -0
- package/dist/{css-utils-CC43BbEy.js.map → css-utils-Bn-dO44e.js.map} +1 -1
- package/dist/{css-utils-CC43BbEy.js → css-utils-CFeP8SK1.cjs} +5 -71
- package/dist/{css-utils-mgjmH8qX.cjs.map → css-utils-CFeP8SK1.cjs.map} +1 -1
- package/dist/custom-elements-runtime.cjs.js +3 -4
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.colors.cjs.js +1 -2
- package/dist/custom-elements-runtime.colors.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.colors.es.js +277 -277
- package/dist/custom-elements-runtime.colors.es.js.map +1 -1
- package/dist/custom-elements-runtime.directive-enhancements.cjs.js +1 -2
- package/dist/custom-elements-runtime.directive-enhancements.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.directive-enhancements.es.js +106 -122
- package/dist/custom-elements-runtime.directive-enhancements.es.js.map +1 -1
- package/dist/custom-elements-runtime.directives.cjs.js +1 -2
- package/dist/custom-elements-runtime.directives.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.directives.es.js +60 -65
- package/dist/custom-elements-runtime.directives.es.js.map +1 -1
- package/dist/custom-elements-runtime.dom-jit-css.cjs.js +1 -7
- package/dist/custom-elements-runtime.dom-jit-css.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.dom-jit-css.es.js +103 -115
- package/dist/custom-elements-runtime.dom-jit-css.es.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +206 -253
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.event-bus.cjs.js +1 -2
- package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.event-bus.es.js +102 -108
- package/dist/custom-elements-runtime.event-bus.es.js.map +1 -1
- package/dist/custom-elements-runtime.jit-css.cjs.js +1 -2
- package/dist/custom-elements-runtime.jit-css.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.jit-css.es.js +14 -32
- package/dist/custom-elements-runtime.jit-css.es.js.map +1 -1
- package/dist/custom-elements-runtime.router.cjs.js +20 -21
- package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.router.es.js +866 -926
- package/dist/custom-elements-runtime.router.es.js.map +1 -1
- package/dist/custom-elements-runtime.ssr-middleware.cjs.js +3 -4
- package/dist/custom-elements-runtime.ssr-middleware.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.ssr-middleware.es.js +67 -73
- package/dist/custom-elements-runtime.ssr-middleware.es.js.map +1 -1
- package/dist/custom-elements-runtime.ssr.cjs.js +1 -1
- package/dist/custom-elements-runtime.ssr.es.js +3 -14
- package/dist/custom-elements-runtime.store.cjs.js +1 -2
- package/dist/custom-elements-runtime.store.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.store.es.js +32 -33
- package/dist/custom-elements-runtime.store.es.js.map +1 -1
- package/dist/custom-elements-runtime.transitions.cjs.js +1 -2
- package/dist/custom-elements-runtime.transitions.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.transitions.es.js +200 -210
- package/dist/custom-elements-runtime.transitions.es.js.map +1 -1
- package/dist/custom-elements-runtime.vite-plugin.cjs.js +4 -2
- package/dist/custom-elements-runtime.vite-plugin.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.vite-plugin.es.js +155 -78
- package/dist/custom-elements-runtime.vite-plugin.es.js.map +1 -1
- package/dist/helpers-DcEpRwq5.cjs +5 -0
- package/dist/helpers-DcEpRwq5.cjs.map +1 -0
- package/dist/helpers-tJgb4Qve.js +693 -0
- package/dist/helpers-tJgb4Qve.js.map +1 -0
- package/dist/hooks-CEUnvtsA.js +407 -0
- package/dist/hooks-CEUnvtsA.js.map +1 -0
- package/dist/hooks-CNfugc95.cjs +2 -0
- package/dist/hooks-CNfugc95.cjs.map +1 -0
- package/dist/logger-DIJ0UH3R.js +36 -0
- package/dist/{logger-L25axmB-.js.map → logger-DIJ0UH3R.js.map} +1 -1
- package/dist/logger-Dkht1dCX.cjs +2 -0
- package/dist/{logger-BYIN7ysT.cjs.map → logger-Dkht1dCX.cjs.map} +1 -1
- package/dist/namespace-helpers-CIUkG8Mn.js +56 -0
- package/dist/{namespace-helpers-BucDdgz_.js.map → namespace-helpers-CIUkG8Mn.js.map} +1 -1
- package/dist/namespace-helpers-yYIb7INq.cjs +2 -0
- package/dist/{namespace-helpers-Bf7rm9JV.cjs.map → namespace-helpers-yYIb7INq.cjs.map} +1 -1
- package/dist/runtime/tag-utils.d.ts +11 -0
- package/dist/ssr-BpYy9XlW.js +170 -0
- package/dist/{ssr-H9GDwbTy.js.map → ssr-BpYy9XlW.js.map} +1 -1
- package/dist/ssr-CFabTOyi.cjs +4 -0
- package/dist/{ssr-DRsGduIK.cjs.map → ssr-CFabTOyi.cjs.map} +1 -1
- package/dist/style-A8l3aQ52.cjs +55 -0
- package/dist/{style-Bjn8zDiZ.cjs.map → style-A8l3aQ52.cjs.map} +1 -1
- package/dist/style-DSSoCbC9.js +1877 -0
- package/dist/{style-DuDoj_xK.js.map → style-DSSoCbC9.js.map} +1 -1
- package/dist/tag-utils-CoSXTr1F.js +10 -0
- package/dist/tag-utils-CoSXTr1F.js.map +1 -0
- package/dist/tag-utils-XJ3dkcPQ.cjs +2 -0
- package/dist/tag-utils-XJ3dkcPQ.cjs.map +1 -0
- package/dist/template-compiler-B4B_jAPN.cjs +19 -0
- package/dist/{template-compiler-BB4JJdqk.cjs.map → template-compiler-B4B_jAPN.cjs.map} +1 -1
- package/dist/template-compiler-C3h8_vbE.js +3044 -0
- package/dist/{template-compiler-Cs5axmn4.js.map → template-compiler-C3h8_vbE.js.map} +1 -1
- package/dist/vite-plugin.d.ts +96 -2
- package/package.json +8 -8
- package/dist/css-utils-mgjmH8qX.cjs +0 -577
- package/dist/hooks-_3xP4G2N.js +0 -1189
- package/dist/hooks-_3xP4G2N.js.map +0 -1
- package/dist/hooks-fYQgZk2g.cjs +0 -7
- package/dist/hooks-fYQgZk2g.cjs.map +0 -1
- package/dist/logger-BYIN7ysT.cjs +0 -3
- package/dist/logger-L25axmB-.js +0 -41
- package/dist/namespace-helpers-Bf7rm9JV.cjs +0 -3
- package/dist/namespace-helpers-BucDdgz_.js +0 -61
- package/dist/ssr-DRsGduIK.cjs +0 -5
- package/dist/ssr-H9GDwbTy.js +0 -172
- package/dist/style-Bjn8zDiZ.cjs +0 -56
- package/dist/style-DuDoj_xK.js +0 -1972
- package/dist/template-compiler-BB4JJdqk.cjs +0 -23
- package/dist/template-compiler-Cs5axmn4.js +0 -3236
|
@@ -1,78 +1,72 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { r as e, t } from "./ssr-BpYy9XlW.js";
|
|
2
|
+
//#region src/lib/ssr-middleware.ts
|
|
3
|
+
function n(e, t, n) {
|
|
4
|
+
if (!n) return e;
|
|
5
|
+
if (e.trimStart().toLowerCase().startsWith("<html") || e.includes("</html>")) {
|
|
6
|
+
let n = t ?? "", r = e.startsWith("<!DOCTYPE") ? e : `<!DOCTYPE html>${e}`;
|
|
7
|
+
return n && r.includes("</head>") ? r.replace("</head>", `${n}</head>`) : r;
|
|
8
|
+
}
|
|
9
|
+
return `<!DOCTYPE html><html><head>${t ?? ""}</head><body>${e}</body></html>`;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
};
|
|
11
|
+
function r(t, r) {
|
|
12
|
+
let i = {
|
|
13
|
+
dsd: !0,
|
|
14
|
+
...r?.render
|
|
15
|
+
}, { head: a, document: o = !0 } = r ?? {};
|
|
16
|
+
return async (r, s) => {
|
|
17
|
+
try {
|
|
18
|
+
let c = typeof t == "function" ? await t(r) : t, l = typeof c == "object" && !!c && "vnode" in c, u = l ? c.vnode : c, d = l ? c.router : void 0, f = l ? c.head : void 0, { htmlWithStyles: p } = e(u, {
|
|
19
|
+
...i,
|
|
20
|
+
router: d
|
|
21
|
+
}), m = n(p, [a, f].filter(Boolean).join("\n") || void 0, o);
|
|
22
|
+
s.setHeader("Content-Type", "text/html; charset=utf-8"), s.end(m);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
try {
|
|
25
|
+
s.setHeader("Content-Type", "text/plain; charset=utf-8"), s.end("Internal Server Error");
|
|
26
|
+
} catch {}
|
|
27
|
+
throw e;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
31
30
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
throw e;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
31
|
+
function i(e, n) {
|
|
32
|
+
let r = {
|
|
33
|
+
dsd: !0,
|
|
34
|
+
...n?.render
|
|
35
|
+
}, { head: i, document: a = !0 } = n ?? {};
|
|
36
|
+
return async (n, o) => {
|
|
37
|
+
try {
|
|
38
|
+
let s = typeof e == "function" ? await e(n) : e, c = typeof s == "object" && !!s && "vnode" in s, l = c ? s.vnode : s, u = c ? s.router : void 0, d = [i, c ? s.head : void 0].filter(Boolean).join("\n") || void 0;
|
|
39
|
+
o.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
40
|
+
let f = t(l, {
|
|
41
|
+
...r,
|
|
42
|
+
router: u
|
|
43
|
+
}).getReader();
|
|
44
|
+
if (o.write) {
|
|
45
|
+
o.setHeader("Transfer-Encoding", "chunked"), a && o.write(`<!DOCTYPE html><html><head>${d ?? ""}</head><body>`);
|
|
46
|
+
let e = !1;
|
|
47
|
+
for (; !e;) {
|
|
48
|
+
let { value: t, done: n } = await f.read();
|
|
49
|
+
t && o.write(t), e = n;
|
|
50
|
+
}
|
|
51
|
+
a ? o.end("</body></html>") : o.end();
|
|
52
|
+
} else {
|
|
53
|
+
let e = [], t = !1;
|
|
54
|
+
for (; !t;) {
|
|
55
|
+
let { value: n, done: r } = await f.read();
|
|
56
|
+
n && e.push(n), t = r;
|
|
57
|
+
}
|
|
58
|
+
let n = e.join(""), r = a ? `<!DOCTYPE html><html><head>${d ?? ""}</head><body>${n}</body></html>` : n;
|
|
59
|
+
o.end(r);
|
|
60
|
+
}
|
|
61
|
+
} catch (e) {
|
|
62
|
+
try {
|
|
63
|
+
o.setHeader("Content-Type", "text/plain; charset=utf-8"), o.end("Internal Server Error");
|
|
64
|
+
} catch {}
|
|
65
|
+
throw e;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
72
68
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
E as createStreamingSSRHandler
|
|
76
|
-
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { r as createSSRHandler, i as createStreamingSSRHandler };
|
|
77
71
|
|
|
78
72
|
//# sourceMappingURL=custom-elements-runtime.ssr-middleware.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-elements-runtime.ssr-middleware.es.js","names":[],"sources":["../src/lib/ssr-middleware.ts"],"sourcesContent":["/**\n * SSR middleware helpers for Express, Fastify, Hono, and other Node.js HTTP frameworks.\n *\n * Provides two handler factories that wrap the SSR rendering pipeline and\n * emit a complete HTML document response. Both accept a static VNode **or**\n * a per-request factory function so route-specific data can be threaded into\n * the render tree.\n *\n * @example Express — static VNode\n * ```ts\n * import express from 'express';\n * import { createSSRHandler } from '@jasonshimmy/custom-elements-runtime/ssr-middleware';\n * import { html } from '@jasonshimmy/custom-elements-runtime';\n *\n * const app = express();\n * app.get('/', createSSRHandler(html`<my-app />`, {\n * render: { dsd: true, jit: { extendedColors: true } },\n * }));\n * ```\n *\n * @example Express — per-request factory\n * ```ts\n * app.get('*', createSSRHandler(\n * (req) => html`<my-app url=\"${req.url}\" />`,\n * { render: { dsd: true }, head: '<link rel=\"stylesheet\" href=\"/app.css\">' },\n * ));\n * ```\n *\n * @example Streaming variant\n * ```ts\n * app.get('*', createStreamingSSRHandler(\n * (req) => html`<my-app url=\"${req.url}\" />`,\n * ));\n * ```\n */\n\nimport { renderToStringWithJITCSS, renderToStream } from './ssr';\nimport type { VNode } from './runtime/types';\nimport type { RenderOptions } from './runtime/vdom-ssr';\nimport type { DSDRenderOptions } from './runtime/vdom-ssr-dsd';\nimport type { JITCSSOptions } from './runtime/style';\n\n/**\n * What a per-request factory may return.\n *\n * - Plain `VNode` — backward-compatible; no per-request router threading.\n * - `{ vnode, router? }` — the router instance is threaded through the render\n * context, making concurrent SSR requests safe (each render reads from its\n * own router, not the module-level `activeRouterProxy` singleton).\n * - `{ vnode, router?, head? }` — `head` is an HTML string injected into the\n * document `<head>` for this specific request (e.g. serialized loader data).\n * It is merged with the static `head` option passed to the handler factory.\n */\nexport type VnodeFactoryResult = VNode | { vnode: VNode; router?: unknown; head?: string };\n\n// ---------------------------------------------------------------------------\n// Minimal framework-agnostic HTTP types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal request interface compatible with Express, Fastify, Hono, and the\n * raw Node.js `IncomingMessage`. Extend or replace with your framework's\n * request type via the generic parameter on `createSSRHandler`.\n */\nexport interface MinimalRequest {\n url?: string;\n method?: string;\n headers?: Record<string, string | string[] | undefined>;\n}\n\n/**\n * Minimal response interface compatible with Express, Fastify, Hono, and the\n * raw Node.js `ServerResponse`. `write` is optional — handlers fall back to\n * buffering when it is absent.\n */\nexport interface MinimalResponse {\n setHeader(name: string, value: string): void;\n write?(chunk: string): boolean | void;\n end(data?: string): void;\n}\n\n// ---------------------------------------------------------------------------\n// Options\n// ---------------------------------------------------------------------------\n\n/**\n * Options for {@link createSSRHandler} and {@link createStreamingSSRHandler}.\n */\nexport interface SSRMiddlewareOptions {\n /**\n * Render options forwarded to `renderToStringWithJITCSS`.\n * Defaults to `{ dsd: true }` so DSD output is on by default.\n */\n render?: RenderOptions & DSDRenderOptions & { jit?: JITCSSOptions };\n /**\n * Additional HTML inserted at the end of the `<head>` tag.\n * Use this to inject `<link>`, `<script>`, `<meta>`, or `<title>` tags.\n */\n head?: string;\n /**\n * When `true` (default), the response is wrapped in a complete\n * `<!DOCTYPE html>` document shell. Set to `false` if you want to\n * assemble the document yourself and only need the rendered fragment.\n */\n document?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\nfunction wrapInDocument(\n htmlWithStyles: string,\n head: string | undefined,\n wrapDocument: boolean,\n): string {\n if (!wrapDocument) return htmlWithStyles;\n\n // If the rendered HTML already contains a root <html> tag, inject extra\n // head tags and prepend the DOCTYPE — do not double-wrap.\n if (\n htmlWithStyles.trimStart().toLowerCase().startsWith('<html') ||\n htmlWithStyles.includes('</html>')\n ) {\n const extra = head ?? '';\n const withDoctype = htmlWithStyles.startsWith('<!DOCTYPE')\n ? htmlWithStyles\n : `<!DOCTYPE html>${htmlWithStyles}`;\n if (extra) {\n return withDoctype.includes('</head>')\n ? withDoctype.replace('</head>', `${extra}</head>`)\n : withDoctype;\n }\n return withDoctype;\n }\n\n // Minimal shell\n const headContent = head ?? '';\n return `<!DOCTYPE html><html><head>${headContent}</head><body>${htmlWithStyles}</body></html>`;\n}\n\n// ---------------------------------------------------------------------------\n// Handler factories\n// ---------------------------------------------------------------------------\n\n/**\n * Create a request handler that SSR-renders a VNode tree and sends the full\n * HTML document as the response.\n *\n * Compatible with Express, Fastify, Hono, and any framework that uses an\n * `(req, res)` handler signature. The generic `Req` parameter lets you use\n * your framework's typed request object.\n *\n * @param vnodeOrFactory - A static {@link VNode} **or** a (possibly async)\n * factory function that receives the request and returns the VNode to render.\n * @param options - Render and document-shell options.\n *\n * @example\n * ```ts\n * app.get('*', createSSRHandler(\n * (req) => html`<my-app url=\"${req.url}\" />`,\n * { render: { dsd: true, jit: { extendedColors: true } } },\n * ));\n * ```\n */\nexport function createSSRHandler<Req extends MinimalRequest = MinimalRequest>(\n vnodeOrFactory:\n | VnodeFactoryResult\n | ((req: Req) => VnodeFactoryResult | Promise<VnodeFactoryResult>),\n options?: SSRMiddlewareOptions,\n): (req: Req, res: MinimalResponse) => Promise<void> {\n const renderOptions: RenderOptions &\n DSDRenderOptions & { jit?: JITCSSOptions } = {\n dsd: true,\n ...options?.render,\n };\n const { head, document: wrapDocument = true } = options ?? {};\n\n return async (req, res) => {\n try {\n const rawResult =\n typeof vnodeOrFactory === 'function'\n ? await vnodeOrFactory(req)\n : vnodeOrFactory;\n\n const isBundle =\n rawResult !== null &&\n typeof rawResult === 'object' &&\n 'vnode' in (rawResult as object);\n const vnode = isBundle\n ? (rawResult as { vnode: VNode }).vnode\n : (rawResult as VNode);\n const router = isBundle\n ? (rawResult as { vnode: VNode; router?: unknown }).router\n : undefined;\n const perRequestHead = isBundle\n ? (rawResult as { head?: string }).head\n : undefined;\n\n const { htmlWithStyles } = renderToStringWithJITCSS(vnode, { ...renderOptions, router });\n\n const mergedHead = [head, perRequestHead].filter(Boolean).join('\\n') || undefined;\n const body = wrapInDocument(htmlWithStyles, mergedHead, wrapDocument);\n\n res.setHeader('Content-Type', 'text/html; charset=utf-8');\n res.end(body);\n } catch (err) {\n // Ensure the response is always closed to prevent the request hanging.\n // Re-throw so the framework's error handler can set the proper status code.\n try {\n res.setHeader('Content-Type', 'text/plain; charset=utf-8');\n res.end('Internal Server Error');\n } catch {\n // ignore secondary errors during error response\n }\n throw err;\n }\n };\n}\n\n/**\n * Create a request handler that SSR-renders a VNode tree and streams the HTML\n * response using chunked transfer encoding.\n *\n * Each chunk produced by the underlying {@link renderToStream} call is written\n * to the response as it becomes available, minimising Time-to-First-Byte.\n * The document shell preamble (`<!DOCTYPE html>…<body>`) is sent in the first\n * write so the browser can begin parsing immediately.\n *\n * @param vnodeOrFactory - A static {@link VNode} **or** a (possibly async)\n * factory function that receives the request and returns the VNode to render.\n * @param options - Render and document-shell options.\n *\n * @example\n * ```ts\n * app.get('*', createStreamingSSRHandler(\n * (req) => html`<my-app url=\"${req.url}\" />`,\n * { render: { dsd: true } },\n * ));\n * ```\n */\nexport function createStreamingSSRHandler<\n Req extends MinimalRequest = MinimalRequest,\n>(\n vnodeOrFactory:\n | VnodeFactoryResult\n | ((req: Req) => VnodeFactoryResult | Promise<VnodeFactoryResult>),\n options?: SSRMiddlewareOptions,\n): (req: Req, res: MinimalResponse) => Promise<void> {\n const renderOptions: RenderOptions &\n DSDRenderOptions & { jit?: JITCSSOptions } = {\n dsd: true,\n ...options?.render,\n };\n const { head, document: wrapDocument = true } = options ?? {};\n\n return async (req, res) => {\n try {\n const rawResult =\n typeof vnodeOrFactory === 'function'\n ? await vnodeOrFactory(req)\n : vnodeOrFactory;\n\n const isBundle =\n rawResult !== null &&\n typeof rawResult === 'object' &&\n 'vnode' in (rawResult as object);\n const vnode = isBundle\n ? (rawResult as { vnode: VNode }).vnode\n : (rawResult as VNode);\n const router = isBundle\n ? (rawResult as { vnode: VNode; router?: unknown }).router\n : undefined;\n const perRequestHead = isBundle\n ? (rawResult as { head?: string }).head\n : undefined;\n\n const mergedHead = [head, perRequestHead].filter(Boolean).join('\\n') || undefined;\n\n res.setHeader('Content-Type', 'text/html; charset=utf-8');\n\n const stream = renderToStream(vnode, { ...renderOptions, router });\n const reader = stream.getReader();\n\n if (res.write) {\n // Streaming path: pipe chunks directly to the response as they arrive.\n res.setHeader('Transfer-Encoding', 'chunked');\n if (wrapDocument) {\n res.write(`<!DOCTYPE html><html><head>${mergedHead ?? ''}</head><body>`);\n }\n let done = false;\n while (!done) {\n const { value, done: d } = await reader.read();\n if (value) res.write(value);\n done = d;\n }\n if (wrapDocument) {\n res.end('</body></html>');\n } else {\n res.end();\n }\n } else {\n // Buffered fallback: framework does not expose write(); collect and send as one response.\n const chunks: string[] = [];\n let done = false;\n while (!done) {\n const { value, done: d } = await reader.read();\n if (value) chunks.push(value);\n done = d;\n }\n const content = chunks.join('');\n const body = wrapDocument\n ? `<!DOCTYPE html><html><head>${mergedHead ?? ''}</head><body>${content}</body></html>`\n : content;\n res.end(body);\n }\n } catch (err) {\n // Ensure the response is always closed to prevent the request hanging.\n // Re-throw so the framework's error handler can set the proper status code.\n try {\n res.setHeader('Content-Type', 'text/plain; charset=utf-8');\n res.end('Internal Server Error');\n } catch {\n // ignore secondary errors during error response\n }\n throw err;\n }\n };\n}\n"],"mappings":";AA+GA,SAAS,EACP,GACA,GACA,GACQ;AACR,MAAI,CAAC,EAAc,QAAO;AAI1B,MACE,EAAe,UAAA,EAAY,YAAA,EAAc,WAAW,OAAA,KACpD,EAAe,SAAS,SAAA,GACxB;AACA,UAAM,IAAQ,KAAQ,IAChB,IAAc,EAAe,WAAW,WAAA,IAC1C,IACA,kBAAkB,CAAA;AACtB,WAAI,KACK,EAAY,SAAS,SAAA,IACxB,EAAY,QAAQ,WAAW,GAAG,CAAA,SAAM,IAGvC;AAAA;AAKT,SAAO,8BADa,KAAQ,EAAA,gBACoC,CAAA;;AA2BlE,SAAgB,EACd,GAGA,GACmD;AACnD,QAAM,IACyC;AAAA,IAC7C,KAAK;A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,0BAAA;AAG9B,YAAM,IADS,EAAe,GAAO;AAAA,QAAE,GAAG;AAAA,QAAe,QAAA;AAAA,OAAQ,EAC3C,UAAA;AAEtB,UAAI,EAAI,OAAO;AAEb,QAAA,EAAI,UAAU,qBAAqB,SAAA,GAC/B,KACF,EAAI,MAAM,8BAA8B,KAAc,EAAA,eAAG;AAE3D,YAAI,IAAO;AACX,eAAO,CAAC,KAAM;AACZ,gBAAM,EAAE,OAAA,GAAO,MAAM,EAAA,IAAM,MAAM,EAAO,KAAA;AACxC,UAAI,KAAO,EAAI,MAAM,CAAA,GACrB,IAAO;AAAA;AAET,QAAI,IACF,EAAI,IAAI,gBAAA,IAER,EAAI,IAAA;AAAA,aAED;AAEL,cAAM,IAAmB,CAAA;AACzB,YAAI,IAAO;AACX,eAAO,CAAC,KAAM;AACZ,gBAAM,EAAE,OAAA,GAAO,MAAM,EAAA,IAAM,MAAM,EAAO,KAAA;AACxC,UAAI,KAAO,EAAO,KAAK,CAAA,GACvB,IAAO;AAAA;AAET,cAAM,IAAU,EAAO,KAAK,EAAA,GACtB,IAAO,IACT,8BAA8B,KAAc,EAAA,gBAAkB,CAAA,mBAC9D;AACJ,QAAA,EAAI,IAAI,CAAA;AAAA;aAEH,GAAK;AAGZ,UAAI;AACF,QAAA,EAAI,UAAU,gBAAgB,2BAAA,GAC9B,EAAI,IAAI,uBAAA;AAAA,cACF;AAAA,MAAA;AAGR,YAAM;AAAA"}
|
|
1
|
+
{"version":3,"file":"custom-elements-runtime.ssr-middleware.es.js","names":[],"sources":["../src/lib/ssr-middleware.ts"],"sourcesContent":["/**\n * SSR middleware helpers for Express, Fastify, Hono, and other Node.js HTTP frameworks.\n *\n * Provides two handler factories that wrap the SSR rendering pipeline and\n * emit a complete HTML document response. Both accept a static VNode **or**\n * a per-request factory function so route-specific data can be threaded into\n * the render tree.\n *\n * @example Express — static VNode\n * ```ts\n * import express from 'express';\n * import { createSSRHandler } from '@jasonshimmy/custom-elements-runtime/ssr-middleware';\n * import { html } from '@jasonshimmy/custom-elements-runtime';\n *\n * const app = express();\n * app.get('/', createSSRHandler(html`<my-app />`, {\n * render: { dsd: true, jit: { extendedColors: true } },\n * }));\n * ```\n *\n * @example Express — per-request factory\n * ```ts\n * app.get('*', createSSRHandler(\n * (req) => html`<my-app url=\"${req.url}\" />`,\n * { render: { dsd: true }, head: '<link rel=\"stylesheet\" href=\"/app.css\">' },\n * ));\n * ```\n *\n * @example Streaming variant\n * ```ts\n * app.get('*', createStreamingSSRHandler(\n * (req) => html`<my-app url=\"${req.url}\" />`,\n * ));\n * ```\n */\n\nimport { renderToStringWithJITCSS, renderToStream } from './ssr';\nimport type { VNode } from './runtime/types';\nimport type { RenderOptions } from './runtime/vdom-ssr';\nimport type { DSDRenderOptions } from './runtime/vdom-ssr-dsd';\nimport type { JITCSSOptions } from './runtime/style';\n\n/**\n * What a per-request factory may return.\n *\n * - Plain `VNode` — backward-compatible; no per-request router threading.\n * - `{ vnode, router? }` — the router instance is threaded through the render\n * context, making concurrent SSR requests safe (each render reads from its\n * own router, not the module-level `activeRouterProxy` singleton).\n * - `{ vnode, router?, head? }` — `head` is an HTML string injected into the\n * document `<head>` for this specific request (e.g. serialized loader data).\n * It is merged with the static `head` option passed to the handler factory.\n */\nexport type VnodeFactoryResult = VNode | { vnode: VNode; router?: unknown; head?: string };\n\n// ---------------------------------------------------------------------------\n// Minimal framework-agnostic HTTP types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal request interface compatible with Express, Fastify, Hono, and the\n * raw Node.js `IncomingMessage`. Extend or replace with your framework's\n * request type via the generic parameter on `createSSRHandler`.\n */\nexport interface MinimalRequest {\n url?: string;\n method?: string;\n headers?: Record<string, string | string[] | undefined>;\n}\n\n/**\n * Minimal response interface compatible with Express, Fastify, Hono, and the\n * raw Node.js `ServerResponse`. `write` is optional — handlers fall back to\n * buffering when it is absent.\n */\nexport interface MinimalResponse {\n setHeader(name: string, value: string): void;\n write?(chunk: string): boolean | void;\n end(data?: string): void;\n}\n\n// ---------------------------------------------------------------------------\n// Options\n// ---------------------------------------------------------------------------\n\n/**\n * Options for {@link createSSRHandler} and {@link createStreamingSSRHandler}.\n */\nexport interface SSRMiddlewareOptions {\n /**\n * Render options forwarded to `renderToStringWithJITCSS`.\n * Defaults to `{ dsd: true }` so DSD output is on by default.\n */\n render?: RenderOptions & DSDRenderOptions & { jit?: JITCSSOptions };\n /**\n * Additional HTML inserted at the end of the `<head>` tag.\n * Use this to inject `<link>`, `<script>`, `<meta>`, or `<title>` tags.\n */\n head?: string;\n /**\n * When `true` (default), the response is wrapped in a complete\n * `<!DOCTYPE html>` document shell. Set to `false` if you want to\n * assemble the document yourself and only need the rendered fragment.\n */\n document?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\nfunction wrapInDocument(\n htmlWithStyles: string,\n head: string | undefined,\n wrapDocument: boolean,\n): string {\n if (!wrapDocument) return htmlWithStyles;\n\n // If the rendered HTML already contains a root <html> tag, inject extra\n // head tags and prepend the DOCTYPE — do not double-wrap.\n if (\n htmlWithStyles.trimStart().toLowerCase().startsWith('<html') ||\n htmlWithStyles.includes('</html>')\n ) {\n const extra = head ?? '';\n const withDoctype = htmlWithStyles.startsWith('<!DOCTYPE')\n ? htmlWithStyles\n : `<!DOCTYPE html>${htmlWithStyles}`;\n if (extra) {\n return withDoctype.includes('</head>')\n ? withDoctype.replace('</head>', `${extra}</head>`)\n : withDoctype;\n }\n return withDoctype;\n }\n\n // Minimal shell\n const headContent = head ?? '';\n return `<!DOCTYPE html><html><head>${headContent}</head><body>${htmlWithStyles}</body></html>`;\n}\n\n// ---------------------------------------------------------------------------\n// Handler factories\n// ---------------------------------------------------------------------------\n\n/**\n * Create a request handler that SSR-renders a VNode tree and sends the full\n * HTML document as the response.\n *\n * Compatible with Express, Fastify, Hono, and any framework that uses an\n * `(req, res)` handler signature. The generic `Req` parameter lets you use\n * your framework's typed request object.\n *\n * @param vnodeOrFactory - A static {@link VNode} **or** a (possibly async)\n * factory function that receives the request and returns the VNode to render.\n * @param options - Render and document-shell options.\n *\n * @example\n * ```ts\n * app.get('*', createSSRHandler(\n * (req) => html`<my-app url=\"${req.url}\" />`,\n * { render: { dsd: true, jit: { extendedColors: true } } },\n * ));\n * ```\n */\nexport function createSSRHandler<Req extends MinimalRequest = MinimalRequest>(\n vnodeOrFactory:\n | VnodeFactoryResult\n | ((req: Req) => VnodeFactoryResult | Promise<VnodeFactoryResult>),\n options?: SSRMiddlewareOptions,\n): (req: Req, res: MinimalResponse) => Promise<void> {\n const renderOptions: RenderOptions &\n DSDRenderOptions & { jit?: JITCSSOptions } = {\n dsd: true,\n ...options?.render,\n };\n const { head, document: wrapDocument = true } = options ?? {};\n\n return async (req, res) => {\n try {\n const rawResult =\n typeof vnodeOrFactory === 'function'\n ? await vnodeOrFactory(req)\n : vnodeOrFactory;\n\n const isBundle =\n rawResult !== null &&\n typeof rawResult === 'object' &&\n 'vnode' in (rawResult as object);\n const vnode = isBundle\n ? (rawResult as { vnode: VNode }).vnode\n : (rawResult as VNode);\n const router = isBundle\n ? (rawResult as { vnode: VNode; router?: unknown }).router\n : undefined;\n const perRequestHead = isBundle\n ? (rawResult as { head?: string }).head\n : undefined;\n\n const { htmlWithStyles } = renderToStringWithJITCSS(vnode, { ...renderOptions, router });\n\n const mergedHead = [head, perRequestHead].filter(Boolean).join('\\n') || undefined;\n const body = wrapInDocument(htmlWithStyles, mergedHead, wrapDocument);\n\n res.setHeader('Content-Type', 'text/html; charset=utf-8');\n res.end(body);\n } catch (err) {\n // Ensure the response is always closed to prevent the request hanging.\n // Re-throw so the framework's error handler can set the proper status code.\n try {\n res.setHeader('Content-Type', 'text/plain; charset=utf-8');\n res.end('Internal Server Error');\n } catch {\n // ignore secondary errors during error response\n }\n throw err;\n }\n };\n}\n\n/**\n * Create a request handler that SSR-renders a VNode tree and streams the HTML\n * response using chunked transfer encoding.\n *\n * Each chunk produced by the underlying {@link renderToStream} call is written\n * to the response as it becomes available, minimising Time-to-First-Byte.\n * The document shell preamble (`<!DOCTYPE html>…<body>`) is sent in the first\n * write so the browser can begin parsing immediately.\n *\n * @param vnodeOrFactory - A static {@link VNode} **or** a (possibly async)\n * factory function that receives the request and returns the VNode to render.\n * @param options - Render and document-shell options.\n *\n * @example\n * ```ts\n * app.get('*', createStreamingSSRHandler(\n * (req) => html`<my-app url=\"${req.url}\" />`,\n * { render: { dsd: true } },\n * ));\n * ```\n */\nexport function createStreamingSSRHandler<\n Req extends MinimalRequest = MinimalRequest,\n>(\n vnodeOrFactory:\n | VnodeFactoryResult\n | ((req: Req) => VnodeFactoryResult | Promise<VnodeFactoryResult>),\n options?: SSRMiddlewareOptions,\n): (req: Req, res: MinimalResponse) => Promise<void> {\n const renderOptions: RenderOptions &\n DSDRenderOptions & { jit?: JITCSSOptions } = {\n dsd: true,\n ...options?.render,\n };\n const { head, document: wrapDocument = true } = options ?? {};\n\n return async (req, res) => {\n try {\n const rawResult =\n typeof vnodeOrFactory === 'function'\n ? await vnodeOrFactory(req)\n : vnodeOrFactory;\n\n const isBundle =\n rawResult !== null &&\n typeof rawResult === 'object' &&\n 'vnode' in (rawResult as object);\n const vnode = isBundle\n ? (rawResult as { vnode: VNode }).vnode\n : (rawResult as VNode);\n const router = isBundle\n ? (rawResult as { vnode: VNode; router?: unknown }).router\n : undefined;\n const perRequestHead = isBundle\n ? (rawResult as { head?: string }).head\n : undefined;\n\n const mergedHead = [head, perRequestHead].filter(Boolean).join('\\n') || undefined;\n\n res.setHeader('Content-Type', 'text/html; charset=utf-8');\n\n const stream = renderToStream(vnode, { ...renderOptions, router });\n const reader = stream.getReader();\n\n if (res.write) {\n // Streaming path: pipe chunks directly to the response as they arrive.\n res.setHeader('Transfer-Encoding', 'chunked');\n if (wrapDocument) {\n res.write(`<!DOCTYPE html><html><head>${mergedHead ?? ''}</head><body>`);\n }\n let done = false;\n while (!done) {\n const { value, done: d } = await reader.read();\n if (value) res.write(value);\n done = d;\n }\n if (wrapDocument) {\n res.end('</body></html>');\n } else {\n res.end();\n }\n } else {\n // Buffered fallback: framework does not expose write(); collect and send as one response.\n const chunks: string[] = [];\n let done = false;\n while (!done) {\n const { value, done: d } = await reader.read();\n if (value) chunks.push(value);\n done = d;\n }\n const content = chunks.join('');\n const body = wrapDocument\n ? `<!DOCTYPE html><html><head>${mergedHead ?? ''}</head><body>${content}</body></html>`\n : content;\n res.end(body);\n }\n } catch (err) {\n // Ensure the response is always closed to prevent the request hanging.\n // Re-throw so the framework's error handler can set the proper status code.\n try {\n res.setHeader('Content-Type', 'text/plain; charset=utf-8');\n res.end('Internal Server Error');\n } catch {\n // ignore secondary errors during error response\n }\n throw err;\n }\n };\n}\n"],"mappings":";;AA+GA,SAAS,EACP,GACA,GACA,GACQ;AACR,KAAI,CAAC,EAAc,QAAO;AAI1B,KACE,EAAe,WAAW,CAAC,aAAa,CAAC,WAAW,QAAQ,IAC5D,EAAe,SAAS,UAAU,EAClC;EACA,IAAM,IAAQ,KAAQ,IAChB,IAAc,EAAe,WAAW,YAAY,GACtD,IACA,kBAAkB;AAMtB,SALI,KACK,EAAY,SAAS,UAAU,GAClC,EAAY,QAAQ,WAAW,GAAG,EAAM,SAAS,GACjD;;AAOR,QAAO,8BADa,KAAQ,GACqB,eAAe,EAAe;;AA2BjF,SAAgB,EACd,GAGA,GACmD;CACnD,IAAM,IACyC;EAC7C,KAAK;EACL,GAAG,GAAS;EACb,EACK,EAAE,SAAM,UAAU,IAAe,OAAS,KAAW,EAAE;AAE7D,QAAO,OAAO,GAAK,MAAQ;AACzB,MAAI;GACF,IAAM,IACJ,OAAO,KAAmB,aACtB,MAAM,EAAe,EAAI,GACzB,GAEA,IAEJ,OAAO,KAAc,cADrB,KAEA,WAAY,GACR,IAAQ,IACT,EAA+B,QAC/B,GACC,IAAS,IACV,EAAiD,SAClD,KAAA,GACE,IAAiB,IAClB,EAAgC,OACjC,KAAA,GAEE,EAAE,sBAAmB,EAAyB,GAAO;IAAE,GAAG;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,CAAC,IAAM;KACZ,IAAM,EAAE,UAAO,MAAM,MAAM,MAAM,EAAO,MAAM;AAE9C,KADI,KAAO,EAAO,KAAK,EAAM,EAC7B,IAAO;;IAET,IAAM,IAAU,EAAO,KAAK,GAAG,EACzB,IAAO,IACT,8BAA8B,KAAc,GAAG,eAAe,EAAQ,kBACtE;AACJ,MAAI,IAAI,EAAK;;WAER,GAAK;AAGZ,OAAI;AAEF,IADA,EAAI,UAAU,gBAAgB,4BAA4B,EAC1D,EAAI,IAAI,wBAAwB;WAC1B;AAGR,SAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./helpers-DcEpRwq5.cjs`),t=require(`./ssr-CFabTOyi.cjs`);exports.DSD_POLYFILL_SCRIPT=t.a,exports.clearRegisteredEntityMap=e.t,exports.loadEntityMap=e.s,exports.registerEntityMap=e.c,exports.renderToStream=t.t,exports.renderToStreamWithJITCSSDSD=t.n,exports.renderToString=t.s,exports.renderToStringDSD=t.o,exports.renderToStringWithJITCSS=t.r,exports.renderToStringWithJITCSSDSD=t.i;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
export {
|
|
4
|
-
i as DSD_POLYFILL_SCRIPT,
|
|
5
|
-
t as clearRegisteredEntityMap,
|
|
6
|
-
a as loadEntityMap,
|
|
7
|
-
e as registerEntityMap,
|
|
8
|
-
D as renderToStream,
|
|
9
|
-
o as renderToStreamWithJITCSSDSD,
|
|
10
|
-
d as renderToString,
|
|
11
|
-
s as renderToStringDSD,
|
|
12
|
-
T as renderToStringWithJITCSS,
|
|
13
|
-
n as renderToStringWithJITCSSDSD
|
|
14
|
-
};
|
|
1
|
+
import { c as e, s as t, t as n } from "./helpers-tJgb4Qve.js";
|
|
2
|
+
import { a as r, i, n as a, o, r as s, s as c, t as l } from "./ssr-BpYy9XlW.js";
|
|
3
|
+
export { r as DSD_POLYFILL_SCRIPT, n as clearRegisteredEntityMap, t as loadEntityMap, e as registerEntityMap, l as renderToStream, a as renderToStreamWithJITCSSDSD, c as renderToString, o as renderToStringDSD, s as renderToStringWithJITCSS, i as renderToStringWithJITCSSDSD };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./logger-Dkht1dCX.cjs`);var t=50;function n(n){let r={...n},i=[];function a(n){return i.push(n),i.length>=t&&e.r(`[store] ${i.length} active subscriptions detected. This may indicate orphaned listeners from components that were destroyed without calling their unsubscribe function. Check that every subscribe() call is paired with the returned unsubscribe in a disconnect/cleanup handler.`),n(r),()=>{let e=i.indexOf(n);e!==-1&&i.splice(e,1)}}function o(){return r}function s(e){let t=typeof e==`function`?e(r):e;r={...r,...t},c()}function c(){let e=i.slice();for(let t of e)t(r)}return{subscribe:a,getState:o,setState:s}}exports.createStore=n;
|
|
3
2
|
//# sourceMappingURL=custom-elements-runtime.store.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-elements-runtime.store.cjs.js","names":[],"sources":["../src/lib/store.ts"],"sourcesContent":["type Listener<T> = (state: T) => void;\n\nimport { devWarn } from './runtime/logger';\n\nconst STORE_LISTENER_WARN_THRESHOLD = 50;\n\nexport interface Store<T extends object> {\n /**\n * Subscribe to store updates.\n * Returns an unsubscribe function to remove the listener.\n */\n subscribe(listener: Listener<T>): () => void;\n getState(): T;\n setState(partial: Partial<T> | ((prev: T) => Partial<T>)): void;\n}\n\nexport function createStore<T extends object>(initial: T): Store<T> {\n let state = { ...initial } as T; // no Proxy needed if we update via setState\n const listeners: Listener<T>[] = [];\n\n function subscribe(listener: Listener<T>) {\n listeners.push(listener);\n if (listeners.length >= STORE_LISTENER_WARN_THRESHOLD) {\n devWarn(\n `[store] ${listeners.length} active subscriptions detected. ` +\n 'This may indicate orphaned listeners from components that were destroyed ' +\n 'without calling their unsubscribe function. Check that every subscribe() ' +\n 'call is paired with the returned unsubscribe in a disconnect/cleanup handler.',\n );\n }\n listener(state); // initial push\n\n // Return unsubscribe function\n return () => {\n const idx = listeners.indexOf(listener);\n if (idx !== -1) listeners.splice(idx, 1);\n };\n }\n\n function getState(): T {\n return state;\n }\n\n function setState(partial: Partial<T> | ((prev: T) => Partial<T>)) {\n const next = typeof partial === 'function' ? partial(state) : partial;\n\n state = { ...state, ...next };\n notify();\n }\n\n function notify() {\n // Snapshot the listeners array before iterating so that a listener calling\n // setState() (re-entrant notify) cannot corrupt the current iteration.\n const snapshot = listeners.slice();\n for (const fn of snapshot) fn(state);\n }\n\n return { subscribe, getState, setState };\n}\n"],"mappings":"4GAIA,IAAM,EAAgC,GAYtC,SAAgB,EAA8B,EAAsB,CAClE,IAAI,EAAQ,CAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"custom-elements-runtime.store.cjs.js","names":[],"sources":["../src/lib/store.ts"],"sourcesContent":["type Listener<T> = (state: T) => void;\n\nimport { devWarn } from './runtime/logger';\n\nconst STORE_LISTENER_WARN_THRESHOLD = 50;\n\nexport interface Store<T extends object> {\n /**\n * Subscribe to store updates.\n * Returns an unsubscribe function to remove the listener.\n */\n subscribe(listener: Listener<T>): () => void;\n getState(): T;\n setState(partial: Partial<T> | ((prev: T) => Partial<T>)): void;\n}\n\nexport function createStore<T extends object>(initial: T): Store<T> {\n let state = { ...initial } as T; // no Proxy needed if we update via setState\n const listeners: Listener<T>[] = [];\n\n function subscribe(listener: Listener<T>) {\n listeners.push(listener);\n if (listeners.length >= STORE_LISTENER_WARN_THRESHOLD) {\n devWarn(\n `[store] ${listeners.length} active subscriptions detected. ` +\n 'This may indicate orphaned listeners from components that were destroyed ' +\n 'without calling their unsubscribe function. Check that every subscribe() ' +\n 'call is paired with the returned unsubscribe in a disconnect/cleanup handler.',\n );\n }\n listener(state); // initial push\n\n // Return unsubscribe function\n return () => {\n const idx = listeners.indexOf(listener);\n if (idx !== -1) listeners.splice(idx, 1);\n };\n }\n\n function getState(): T {\n return state;\n }\n\n function setState(partial: Partial<T> | ((prev: T) => Partial<T>)) {\n const next = typeof partial === 'function' ? partial(state) : partial;\n\n state = { ...state, ...next };\n notify();\n }\n\n function notify() {\n // Snapshot the listeners array before iterating so that a listener calling\n // setState() (re-entrant notify) cannot corrupt the current iteration.\n const snapshot = listeners.slice();\n for (const fn of snapshot) fn(state);\n }\n\n return { subscribe, getState, setState };\n}\n"],"mappings":"4GAIA,IAAM,EAAgC,GAYtC,SAAgB,EAA8B,EAAsB,CAClE,IAAI,EAAQ,CAAE,GAAG,EAAS,CACpB,EAA2B,EAAE,CAEnC,SAAS,EAAU,EAAuB,CAaxC,OAZA,EAAU,KAAK,EAAS,CACpB,EAAU,QAAU,GACtB,EAAA,EACE,WAAW,EAAU,OAAO,iQAI7B,CAEH,EAAS,EAAM,KAGF,CACX,IAAM,EAAM,EAAU,QAAQ,EAAS,CACnC,IAAQ,IAAI,EAAU,OAAO,EAAK,EAAE,EAI5C,SAAS,GAAc,CACrB,OAAO,EAGT,SAAS,EAAS,EAAiD,CACjE,IAAM,EAAO,OAAO,GAAY,WAAa,EAAQ,EAAM,CAAG,EAE9D,EAAQ,CAAE,GAAG,EAAO,GAAG,EAAM,CAC7B,GAAQ,CAGV,SAAS,GAAS,CAGhB,IAAM,EAAW,EAAU,OAAO,CAClC,IAAK,IAAM,KAAM,EAAU,EAAG,EAAM,CAGtC,MAAO,CAAE,YAAW,WAAU,WAAU"}
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { r as e } from "./logger-DIJ0UH3R.js";
|
|
2
|
+
//#region src/lib/store.ts
|
|
3
|
+
var t = 50;
|
|
4
|
+
function n(n) {
|
|
5
|
+
let r = { ...n }, i = [];
|
|
6
|
+
function a(n) {
|
|
7
|
+
return i.push(n), i.length >= t && e(`[store] ${i.length} active subscriptions detected. This may indicate orphaned listeners from components that were destroyed without calling their unsubscribe function. Check that every subscribe() call is paired with the returned unsubscribe in a disconnect/cleanup handler.`), n(r), () => {
|
|
8
|
+
let e = i.indexOf(n);
|
|
9
|
+
e !== -1 && i.splice(e, 1);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function o() {
|
|
13
|
+
return r;
|
|
14
|
+
}
|
|
15
|
+
function s(e) {
|
|
16
|
+
let t = typeof e == "function" ? e(r) : e;
|
|
17
|
+
r = {
|
|
18
|
+
...r,
|
|
19
|
+
...t
|
|
20
|
+
}, c();
|
|
21
|
+
}
|
|
22
|
+
function c() {
|
|
23
|
+
let e = i.slice();
|
|
24
|
+
for (let t of e) t(r);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
subscribe: a,
|
|
28
|
+
getState: o,
|
|
29
|
+
setState: s
|
|
30
|
+
};
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { n as createStore };
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=custom-elements-runtime.store.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-elements-runtime.store.es.js","names":[],"sources":["../src/lib/store.ts"],"sourcesContent":["type Listener<T> = (state: T) => void;\n\nimport { devWarn } from './runtime/logger';\n\nconst STORE_LISTENER_WARN_THRESHOLD = 50;\n\nexport interface Store<T extends object> {\n /**\n * Subscribe to store updates.\n * Returns an unsubscribe function to remove the listener.\n */\n subscribe(listener: Listener<T>): () => void;\n getState(): T;\n setState(partial: Partial<T> | ((prev: T) => Partial<T>)): void;\n}\n\nexport function createStore<T extends object>(initial: T): Store<T> {\n let state = { ...initial } as T; // no Proxy needed if we update via setState\n const listeners: Listener<T>[] = [];\n\n function subscribe(listener: Listener<T>) {\n listeners.push(listener);\n if (listeners.length >= STORE_LISTENER_WARN_THRESHOLD) {\n devWarn(\n `[store] ${listeners.length} active subscriptions detected. ` +\n 'This may indicate orphaned listeners from components that were destroyed ' +\n 'without calling their unsubscribe function. Check that every subscribe() ' +\n 'call is paired with the returned unsubscribe in a disconnect/cleanup handler.',\n );\n }\n listener(state); // initial push\n\n // Return unsubscribe function\n return () => {\n const idx = listeners.indexOf(listener);\n if (idx !== -1) listeners.splice(idx, 1);\n };\n }\n\n function getState(): T {\n return state;\n }\n\n function setState(partial: Partial<T> | ((prev: T) => Partial<T>)) {\n const next = typeof partial === 'function' ? partial(state) : partial;\n\n state = { ...state, ...next };\n notify();\n }\n\n function notify() {\n // Snapshot the listeners array before iterating so that a listener calling\n // setState() (re-entrant notify) cannot corrupt the current iteration.\n const snapshot = listeners.slice();\n for (const fn of snapshot) fn(state);\n }\n\n return { subscribe, getState, setState };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"custom-elements-runtime.store.es.js","names":[],"sources":["../src/lib/store.ts"],"sourcesContent":["type Listener<T> = (state: T) => void;\n\nimport { devWarn } from './runtime/logger';\n\nconst STORE_LISTENER_WARN_THRESHOLD = 50;\n\nexport interface Store<T extends object> {\n /**\n * Subscribe to store updates.\n * Returns an unsubscribe function to remove the listener.\n */\n subscribe(listener: Listener<T>): () => void;\n getState(): T;\n setState(partial: Partial<T> | ((prev: T) => Partial<T>)): void;\n}\n\nexport function createStore<T extends object>(initial: T): Store<T> {\n let state = { ...initial } as T; // no Proxy needed if we update via setState\n const listeners: Listener<T>[] = [];\n\n function subscribe(listener: Listener<T>) {\n listeners.push(listener);\n if (listeners.length >= STORE_LISTENER_WARN_THRESHOLD) {\n devWarn(\n `[store] ${listeners.length} active subscriptions detected. ` +\n 'This may indicate orphaned listeners from components that were destroyed ' +\n 'without calling their unsubscribe function. Check that every subscribe() ' +\n 'call is paired with the returned unsubscribe in a disconnect/cleanup handler.',\n );\n }\n listener(state); // initial push\n\n // Return unsubscribe function\n return () => {\n const idx = listeners.indexOf(listener);\n if (idx !== -1) listeners.splice(idx, 1);\n };\n }\n\n function getState(): T {\n return state;\n }\n\n function setState(partial: Partial<T> | ((prev: T) => Partial<T>)) {\n const next = typeof partial === 'function' ? partial(state) : partial;\n\n state = { ...state, ...next };\n notify();\n }\n\n function notify() {\n // Snapshot the listeners array before iterating so that a listener calling\n // setState() (re-entrant notify) cannot corrupt the current iteration.\n const snapshot = listeners.slice();\n for (const fn of snapshot) fn(state);\n }\n\n return { subscribe, getState, setState };\n}\n"],"mappings":";;AAIA,IAAM,IAAgC;AAYtC,SAAgB,EAA8B,GAAsB;CAClE,IAAI,IAAQ,EAAE,GAAG,GAAS,EACpB,IAA2B,EAAE;CAEnC,SAAS,EAAU,GAAuB;AAaxC,SAZA,EAAU,KAAK,EAAS,EACpB,EAAU,UAAU,KACtB,EACE,WAAW,EAAU,OAAO,iQAI7B,EAEH,EAAS,EAAM,QAGF;GACX,IAAM,IAAM,EAAU,QAAQ,EAAS;AACvC,GAAI,MAAQ,MAAI,EAAU,OAAO,GAAK,EAAE;;;CAI5C,SAAS,IAAc;AACrB,SAAO;;CAGT,SAAS,EAAS,GAAiD;EACjE,IAAM,IAAO,OAAO,KAAY,aAAa,EAAQ,EAAM,GAAG;AAG9D,EADA,IAAQ;GAAE,GAAG;GAAO,GAAG;GAAM,EAC7B,GAAQ;;CAGV,SAAS,IAAS;EAGhB,IAAM,IAAW,EAAU,OAAO;AAClC,OAAK,IAAM,KAAM,EAAU,GAAG,EAAM;;AAGtC,QAAO;EAAE;EAAW;EAAU;EAAU"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./css-utils-CFeP8SK1.cjs`),t=require(`./custom-elements-runtime.directives.cjs.js`);var n={fade:{enterFrom:`opacity-0`,enterActive:`transition-opacity duration-300 ease-out`,enterTo:`opacity-100`,leaveFrom:`opacity-100`,leaveActive:`transition-opacity duration-200 ease-in`,leaveTo:`opacity-0`},"slide-right":{enterFrom:`translate-x-[100%] opacity-0`,enterActive:`transition-all duration-300 ease-out`,enterTo:`translate-x-[0%] opacity-100`,leaveFrom:`translate-x-[0%] opacity-100`,leaveActive:`transition-all duration-200 ease-in`,leaveTo:`translate-x-[100%] opacity-0`},"slide-left":{enterFrom:`translate-x-[-100%] opacity-0`,enterActive:`transition-all duration-300 ease-out`,enterTo:`translate-x-[0%] opacity-100`,leaveFrom:`translate-x-[0%] opacity-100`,leaveActive:`transition-all duration-200 ease-in`,leaveTo:`translate-x-[-100%] opacity-0`},"slide-up":{enterFrom:`translate-y-[100%] opacity-0`,enterActive:`transition-all duration-300 ease-out`,enterTo:`translate-y-[0%] opacity-100`,leaveFrom:`translate-y-[0%] opacity-100`,leaveActive:`transition-all duration-200 ease-in`,leaveTo:`translate-y-[100%] opacity-0`},"slide-down":{enterFrom:`translate-y-[-100%] opacity-0`,enterActive:`transition-all duration-300 ease-out`,enterTo:`translate-y-[0%] opacity-100`,leaveFrom:`translate-y-[0%] opacity-100`,leaveActive:`transition-all duration-200 ease-in`,leaveTo:`translate-y-[-100%] opacity-0`},scale:{enterFrom:`scale-95 opacity-0`,enterActive:`transition-all duration-200 ease-out`,enterTo:`scale-100 opacity-100`,leaveFrom:`scale-100 opacity-100`,leaveActive:`transition-all duration-150 ease-in`,leaveTo:`scale-95 opacity-0`},"scale-down":{enterFrom:`scale-105 opacity-0`,enterActive:`transition-all duration-200 ease-out`,enterTo:`scale-100 opacity-100`,leaveFrom:`scale-100 opacity-100`,leaveActive:`transition-all duration-150 ease-in`,leaveTo:`scale-105 opacity-0`},bounce:{enterFrom:`scale-0 opacity-0`,enterActive:`transition-all duration-500 ease-out`,enterTo:`scale-100 opacity-100`,leaveFrom:`scale-100 opacity-100`,leaveActive:`transition-all duration-200 ease-in`,leaveTo:`scale-0 opacity-0`},zoom:{enterFrom:`scale-0 opacity-0`,enterActive:`transition-all duration-300 ease-out`,enterTo:`scale-100 opacity-100`,leaveFrom:`scale-100 opacity-100`,leaveActive:`transition-all duration-200 ease-in`,leaveTo:`scale-0 opacity-0`},flip:{enterFrom:`rotate-[90deg] opacity-0`,enterActive:`transition-all duration-400 ease-out`,enterTo:`rotate-[0deg] opacity-100`,leaveFrom:`rotate-[0deg] opacity-100`,leaveActive:`transition-all duration-300 ease-in`,leaveTo:`rotate-[90deg] opacity-0`}};function r(e,r){let{preset:i,show:a,mode:o=`default`,duration:s,appear:c=!1,css:l=!0,name:u,enterFrom:d,enterActive:f,enterTo:p,leaveFrom:m,leaveActive:h,leaveTo:g,onBeforeEnter:_,onEnter:v,onAfterEnter:y,onEnterCancelled:b,onBeforeLeave:x,onLeave:S,onAfterLeave:C,onLeaveCancelled:w}=e,T;i&&n[i]?(T={...n[i]},d&&(T.enterFrom=d),f&&(T.enterActive=f),p&&(T.enterTo=p),m&&(T.leaveFrom=m),h&&(T.leaveActive=h),g&&(T.leaveTo=g)):T={enterFrom:d,enterActive:f,enterTo:p,leaveFrom:m,leaveActive:h,leaveTo:g};let E=a&&typeof r==`function`?r():r,D=u||(i?`transition-${i}`:`transition`),O=t.anchorBlock(a?E:[],D);return O._transition={name:D,classes:T,mode:o,duration:s,appear:c,css:l,state:a?`visible`:`hidden`,hooks:{onBeforeEnter:_,onEnter:v,onAfterEnter:y,onEnterCancelled:b,onBeforeLeave:x,onLeave:S,onAfterLeave:C,onLeaveCancelled:w}},O}function i(e,t){let{tag:r=`div`,moveClass:i=`transition-transform duration-300`,preset:a,show:o=!0,mode:s=`default`,duration:c,appear:l=!1,css:u=!0,name:d,class:f,style:p,enterFrom:m,enterActive:h,enterTo:g,leaveFrom:_,leaveActive:v,leaveTo:y,onBeforeEnter:b,onEnter:x,onAfterEnter:S,onEnterCancelled:C,onBeforeLeave:w,onLeave:T,onAfterLeave:E,onLeaveCancelled:D}=e,O;a&&n[a]?(O={...n[a]},m&&(O.enterFrom=m),h&&(O.enterActive=h),g&&(O.enterTo=g),_&&(O.leaveFrom=_),v&&(O.leaveActive=v),y&&(O.leaveTo=y)):O={enterFrom:m,enterActive:h,enterTo:g,leaveFrom:_,leaveActive:v,leaveTo:y};let k=d||(a?`transition-group-${a}`:`transition-group`),A=[];for(let e of o?t:[])if(e&&typeof e==`object`&&e.tag===`#anchor`){let t=Array.isArray(e.children)?e.children:[];for(let n of t)if(n&&typeof n==`object`){let t={...n,key:e.key||n.key,props:{...n.props,_anchorKey:e.key}};A.push(t)}else A.push(n)}else A.push(e);let j=(()=>{if(p)return typeof p==`string`?p:Object.entries(p).map(([e,t])=>`${e}: ${t}`).join(`; `)})();return{tag:r,children:A,key:k,props:{attrs:{...f?{class:f}:{},...j?{style:j}:{}},_transitionGroup:{name:k,classes:O,moveClass:i,mode:s,duration:c,appear:l,css:u,hooks:{onBeforeEnter:b,onEnter:x,onAfterEnter:S,onEnterCancelled:C,onBeforeLeave:w,onLeave:T,onAfterLeave:E,onLeaveCancelled:D}}}}}function a(e){return{...e}}var o=null;function s(){if(!o){if(typeof CSSStyleSheet>`u`)return o={cssRules:[],replaceSync:()=>{},toString:()=>``},o;let t=[];Object.values(n).forEach(e=>{e.enterFrom&&t.push(e.enterFrom),e.enterActive&&t.push(e.enterActive),e.enterTo&&t.push(e.enterTo),e.leaveFrom&&t.push(e.leaveFrom),e.leaveActive&&t.push(e.leaveActive),e.leaveTo&&t.push(e.leaveTo)});let r=e.i(`<div class="${t.join(` `)}"></div>`);try{o=new CSSStyleSheet,o.replaceSync(r)}catch{o={cssRules:[],replaceSync:()=>{},toString:()=>r||``}}}return o}exports.Transition=r,exports.TransitionGroup=i,exports.createTransitionPreset=a,exports.getTransitionStyleSheet=s,exports.transitionPresets=n;
|
|
3
2
|
//# sourceMappingURL=custom-elements-runtime.transitions.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-elements-runtime.transitions.cjs.js","names":[],"sources":["../src/lib/transitions.ts"],"sourcesContent":["/**\n * Transitions module (top-level). This file provides the public Transition\n * and TransitionGroup APIs. It is an explicit entry used by the build so\n * consumers can import transitions separately: `.../transitions`.\n */\n/**\n * Transitions Module\n * Vue-like transition system integrated with JIT CSS\n * Provides Transition and TransitionGroup components for enter/leave animations\n */\n\nimport { anchorBlock } from './directives';\nimport type { VNode } from './runtime/types';\nimport { processJITCSS } from './runtime/render-bridge';\n\n/* --- Types --- */\n\n/**\n * Transition class names for different animation phases\n * All values should be JIT CSS utility classes\n */\nexport interface TransitionClasses {\n /** Classes applied at the start of enter transition */\n enterFrom?: string;\n /** Classes applied during entire enter transition */\n enterActive?: string;\n /** Classes applied at the end of enter transition */\n enterTo?: string;\n /** Classes applied at the start of leave transition */\n leaveFrom?: string;\n /** Classes applied during entire leave transition */\n leaveActive?: string;\n /** Classes applied at the end of leave transition */\n leaveTo?: string;\n}\n\n/**\n * Lifecycle hooks for transition events\n */\nexport interface TransitionHooks {\n /** Called before enter transition starts */\n onBeforeEnter?: (el: HTMLElement) => void;\n /** Called during enter transition (with done callback for manual control) */\n onEnter?: (el: HTMLElement, done: () => void) => void;\n /** Called after enter transition completes */\n onAfterEnter?: (el: HTMLElement) => void;\n /** Called if enter transition is cancelled */\n onEnterCancelled?: (el: HTMLElement) => void;\n /** Called before leave transition starts */\n onBeforeLeave?: (el: HTMLElement) => void;\n /** Called during leave transition (with done callback for manual control) */\n onLeave?: (el: HTMLElement, done: () => void) => void;\n /** Called after leave transition completes */\n onAfterLeave?: (el: HTMLElement) => void;\n /** Called if leave transition is cancelled */\n onLeaveCancelled?: (el: HTMLElement) => void;\n}\n\n/**\n * Options for Transition component\n */\nexport interface TransitionOptions extends TransitionClasses, TransitionHooks {\n /** Preset name (fade, slide-right, scale, etc.) */\n preset?: keyof typeof transitionPresets;\n /** Whether to show the content */\n show: boolean;\n /** Transition mode: default, out-in (leave before enter), in-out (enter before leave) */\n mode?: 'default' | 'out-in' | 'in-out';\n /** Custom duration override (ms) */\n duration?: number | { enter: number; leave: number };\n /** Whether to apply transition on initial render */\n appear?: boolean;\n /** Whether to use CSS transitions (true) or JS-only hooks (false) */\n css?: boolean;\n /** Optional name for debugging */\n name?: string;\n}\n\n/**\n * Options for TransitionGroup component\n */\nexport interface TransitionGroupOptions extends Omit<\n TransitionOptions,\n 'show'\n> {\n /** HTML tag for the wrapper element */\n tag?: string;\n /** Class applied during move transitions (when items reorder) */\n moveClass?: string;\n /** Whether to show the group (defaults to true for TransitionGroup) */\n show?: boolean;\n /** CSS classes to apply to the wrapper element (e.g., 'flex gap-4' or 'grid grid-cols-3') */\n class?: string;\n /** Inline styles to apply to the wrapper element */\n style?: string | Record<string, string>;\n}\n\n/* --- Transition Presets --- */\n\n/**\n * Pre-defined transition presets using JIT CSS classes\n * Users can reference these by name or define custom classes\n */\nexport const transitionPresets = {\n /** Simple fade in/out */\n fade: {\n enterFrom: 'opacity-0',\n enterActive: 'transition-opacity duration-300 ease-out',\n enterTo: 'opacity-100',\n leaveFrom: 'opacity-100',\n leaveActive: 'transition-opacity duration-200 ease-in',\n leaveTo: 'opacity-0',\n },\n\n /** Slide in from right */\n 'slide-right': {\n enterFrom: 'translate-x-[100%] opacity-0',\n enterActive: 'transition-all duration-300 ease-out',\n enterTo: 'translate-x-[0%] opacity-100',\n leaveFrom: 'translate-x-[0%] opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'translate-x-[100%] opacity-0',\n },\n\n /** Slide in from left */\n 'slide-left': {\n enterFrom: 'translate-x-[-100%] opacity-0',\n enterActive: 'transition-all duration-300 ease-out',\n enterTo: 'translate-x-[0%] opacity-100',\n leaveFrom: 'translate-x-[0%] opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'translate-x-[-100%] opacity-0',\n },\n\n /** Slide up from bottom */\n 'slide-up': {\n enterFrom: 'translate-y-[100%] opacity-0',\n enterActive: 'transition-all duration-300 ease-out',\n enterTo: 'translate-y-[0%] opacity-100',\n leaveFrom: 'translate-y-[0%] opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'translate-y-[100%] opacity-0',\n },\n\n /** Slide down from top */\n 'slide-down': {\n enterFrom: 'translate-y-[-100%] opacity-0',\n enterActive: 'transition-all duration-300 ease-out',\n enterTo: 'translate-y-[0%] opacity-100',\n leaveFrom: 'translate-y-[0%] opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'translate-y-[-100%] opacity-0',\n },\n\n /** Scale up from center */\n scale: {\n enterFrom: 'scale-95 opacity-0',\n enterActive: 'transition-all duration-200 ease-out',\n enterTo: 'scale-100 opacity-100',\n leaveFrom: 'scale-100 opacity-100',\n leaveActive: 'transition-all duration-150 ease-in',\n leaveTo: 'scale-95 opacity-0',\n },\n\n /** Scale down to center */\n 'scale-down': {\n enterFrom: 'scale-105 opacity-0',\n enterActive: 'transition-all duration-200 ease-out',\n enterTo: 'scale-100 opacity-100',\n leaveFrom: 'scale-100 opacity-100',\n leaveActive: 'transition-all duration-150 ease-in',\n leaveTo: 'scale-105 opacity-0',\n },\n\n /** Bounce effect */\n bounce: {\n enterFrom: 'scale-0 opacity-0',\n enterActive: 'transition-all duration-500 ease-out',\n enterTo: 'scale-100 opacity-100',\n leaveFrom: 'scale-100 opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'scale-0 opacity-0',\n },\n\n /** Zoom and fade */\n zoom: {\n enterFrom: 'scale-0 opacity-0',\n enterActive: 'transition-all duration-300 ease-out',\n enterTo: 'scale-100 opacity-100',\n leaveFrom: 'scale-100 opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'scale-0 opacity-0',\n },\n\n /** Flip in */\n flip: {\n enterFrom: 'rotate-[90deg] opacity-0',\n enterActive: 'transition-all duration-400 ease-out',\n enterTo: 'rotate-[0deg] opacity-100',\n leaveFrom: 'rotate-[0deg] opacity-100',\n leaveActive: 'transition-all duration-300 ease-in',\n leaveTo: 'rotate-[90deg] opacity-0',\n },\n} as const;\n\n/* --- Core Functions --- */\n\n/**\n * Transition component - wraps content with enter/leave animations\n *\n * @example\n * ```ts\n * // Using a preset\n * ${Transition({ preset: 'fade', show: isVisible.value }, html`<div>Content</div>`)}\n *\n * // Using custom JIT classes\n * ${Transition({\n * show: isVisible.value,\n * enterFrom: 'opacity-0 scale-95',\n * enterActive: 'transition-all duration-300',\n * enterTo: 'opacity-100 scale-100',\n * leaveFrom: 'opacity-100 scale-100',\n * leaveActive: 'transition-all duration-200',\n * leaveTo: 'opacity-0 scale-95'\n * }, html`<div>Content</div>`)}\n *\n * // With lifecycle hooks\n * ${Transition({\n * preset: 'slide-right',\n * show: isVisible.value,\n * onAfterEnter: (el) => console.log('Entered!'),\n * onAfterLeave: (el) => console.log('Left!')\n * }, html`<div>Content</div>`)}\n *\n * // Lazy factory — only evaluated when show is true (avoids constructing\n * // expensive VNode trees when the content is hidden)\n * ${Transition({ show: isVisible.value }, () => html`<div>Expensive content</div>`)}\n * ```\n */\nexport function Transition(\n options: TransitionOptions,\n content: VNode | VNode[] | (() => VNode | VNode[]),\n): VNode {\n const {\n preset,\n show,\n mode = 'default',\n duration,\n appear = false,\n css = true,\n name,\n enterFrom,\n enterActive,\n enterTo,\n leaveFrom,\n leaveActive,\n leaveTo,\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n } = options;\n\n // Resolve classes from preset or explicit values\n let transitionClasses: TransitionClasses;\n if (preset && transitionPresets[preset]) {\n transitionClasses = { ...transitionPresets[preset] };\n // Allow overriding preset classes\n if (enterFrom) transitionClasses.enterFrom = enterFrom;\n if (enterActive) transitionClasses.enterActive = enterActive;\n if (enterTo) transitionClasses.enterTo = enterTo;\n if (leaveFrom) transitionClasses.leaveFrom = leaveFrom;\n if (leaveActive) transitionClasses.leaveActive = leaveActive;\n if (leaveTo) transitionClasses.leaveTo = leaveTo;\n } else {\n transitionClasses = {\n enterFrom,\n enterActive,\n enterTo,\n leaveFrom,\n leaveActive,\n leaveTo,\n };\n }\n\n // Resolve content: only call the factory when show is true so that expensive\n // VNode trees (e.g. those that trigger calender builds or heavy computeds)\n // are never constructed while the transition is hidden. Leave animations\n // operate on existing DOM nodes and do not require the content VNode.\n const resolvedContent: VNode | VNode[] =\n show && typeof content === 'function'\n ? content()\n : (content as VNode | VNode[]);\n\n // Create anchor block with transition metadata\n const transitionKey =\n name || (preset ? `transition-${preset}` : 'transition');\n const transitionVNode = anchorBlock(\n show ? resolvedContent : [],\n transitionKey,\n );\n\n // Attach metadata for VDOM to consume during patching\n (transitionVNode as VNode & { _transition?: unknown })._transition = {\n name: transitionKey,\n classes: transitionClasses,\n mode,\n duration,\n appear,\n css,\n state: show ? 'visible' : 'hidden',\n hooks: {\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n },\n };\n\n return transitionVNode;\n}\n\n/**\n * TransitionGroup component - animates lists with enter/leave/move transitions\n *\n * @example\n * ```ts\n * // Basic usage\n * ${TransitionGroup({\n * preset: 'slide-right',\n * tag: 'ul',\n * moveClass: 'transition-transform duration-300'\n * }, each(items.value, (item) => html`\n * <li key=\"${item.id}\">${item.text}</li>\n * `))}\n *\n * // With flex layout\n * ${TransitionGroup({\n * preset: 'fade',\n * class: 'flex gap-4 flex-wrap'\n * }, each(items.value, (item) => html`\n * <div key=\"${item.id}\" class=\"shrink-0\">${item.text}</div>\n * `))}\n *\n * // With grid layout\n * ${TransitionGroup({\n * preset: 'scale',\n * class: 'grid grid-cols-3 gap-4'\n * }, each(items.value, (item) => html`\n * <div key=\"${item.id}\">${item.text}</div>\n * `))}\n * ```\n */\nexport function TransitionGroup(\n options: TransitionGroupOptions,\n children: VNode[],\n): VNode {\n const {\n tag = 'div',\n moveClass = 'transition-transform duration-300',\n preset,\n show = true,\n mode = 'default',\n duration,\n appear = false,\n css = true,\n name,\n class: className,\n style,\n enterFrom,\n enterActive,\n enterTo,\n leaveFrom,\n leaveActive,\n leaveTo,\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n } = options;\n\n // Resolve classes from preset or explicit values\n let transitionClasses: TransitionClasses;\n if (preset && transitionPresets[preset]) {\n transitionClasses = { ...transitionPresets[preset] };\n // Allow overriding preset classes\n if (enterFrom) transitionClasses.enterFrom = enterFrom;\n if (enterActive) transitionClasses.enterActive = enterActive;\n if (enterTo) transitionClasses.enterTo = enterTo;\n if (leaveFrom) transitionClasses.leaveFrom = leaveFrom;\n if (leaveActive) transitionClasses.leaveActive = leaveActive;\n if (leaveTo) transitionClasses.leaveTo = leaveTo;\n } else {\n transitionClasses = {\n enterFrom,\n enterActive,\n enterTo,\n leaveFrom,\n leaveActive,\n leaveTo,\n };\n }\n\n // Create wrapper element with transition group metadata\n const groupKey =\n name || (preset ? `transition-group-${preset}` : 'transition-group');\n\n // Flatten anchor block children to enable proper keyed diffing\n // When each() is used, it creates anchor blocks. We need to extract the actual elements\n // and give them keys from their anchor blocks for proper reordering\n const flattenedChildren: VNode[] = [];\n for (const child of show ? children : []) {\n if (child && typeof child === 'object' && child.tag === '#anchor') {\n // Extract children from anchor block\n const anchorChildren = Array.isArray(child.children)\n ? child.children\n : [];\n for (const anchorChild of anchorChildren) {\n if (anchorChild && typeof anchorChild === 'object') {\n // Use anchor block's key for the child element\n const keyedChild = {\n ...anchorChild,\n key: child.key || anchorChild.key,\n props: {\n ...anchorChild.props,\n _anchorKey: child.key, // Preserve original anchor key\n },\n };\n flattenedChildren.push(keyedChild);\n } else {\n flattenedChildren.push(anchorChild);\n }\n }\n } else {\n flattenedChildren.push(child);\n }\n }\n\n // Serialize style object to a CSS string for the attrs record so it matches\n // the expected primitive attribute value types.\n const styleAttr = (() => {\n if (!style) return undefined;\n if (typeof style === 'string') return style;\n return Object.entries(style)\n .map(([k, v]) => `${k}: ${v}`)\n .join('; ');\n })();\n\n return {\n tag,\n children: flattenedChildren,\n key: groupKey,\n props: {\n attrs: {\n ...(className ? { class: className } : {}),\n ...(styleAttr ? { style: styleAttr } : {}),\n },\n _transitionGroup: {\n name: groupKey,\n classes: transitionClasses,\n moveClass,\n mode,\n duration,\n appear,\n css,\n hooks: {\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n },\n },\n },\n };\n}\n\n/**\n * Helper to create custom transition presets\n *\n * @example\n * ```ts\n * const customFade = createTransitionPreset({\n * enterFrom: 'opacity-0',\n * enterActive: 'transition-opacity duration-500 ease-out',\n * enterTo: 'opacity-100',\n * leaveFrom: 'opacity-100',\n * leaveActive: 'transition-opacity duration-300 ease-in',\n * leaveTo: 'opacity-0'\n * });\n *\n * ${Transition({ ...customFade, show: visible.value }, content)}\n * ```\n */\nexport function createTransitionPreset(\n classes: TransitionClasses,\n): TransitionClasses {\n return { ...classes };\n}\n\n/**\n * Pre-generate CSS for all transition preset classes\n * This ensures the JIT CSS system has the styles ready when transitions are used\n */\nlet transitionStyleSheet: CSSStyleSheet | null = null;\n\n/**\n * Get the global transition stylesheet (creates it if needed)\n */\nexport function getTransitionStyleSheet(): CSSStyleSheet {\n if (!transitionStyleSheet) {\n // If constructable stylesheets aren't available (SSR / old browsers),\n // return a no-op stub to avoid throwing during import or server render.\n if (typeof CSSStyleSheet === 'undefined') {\n transitionStyleSheet = {\n cssRules: [],\n replaceSync: () => {},\n toString: () => '',\n } as unknown as CSSStyleSheet;\n return transitionStyleSheet;\n }\n\n const allClasses: string[] = [];\n\n // Collect all classes from presets\n Object.values(transitionPresets).forEach((preset) => {\n if (preset.enterFrom) allClasses.push(preset.enterFrom);\n if (preset.enterActive) allClasses.push(preset.enterActive);\n if (preset.enterTo) allClasses.push(preset.enterTo);\n if (preset.leaveFrom) allClasses.push(preset.leaveFrom);\n if (preset.leaveActive) allClasses.push(preset.leaveActive);\n if (preset.leaveTo) allClasses.push(preset.leaveTo);\n });\n\n // Create a fake HTML string with all transition classes\n const fakeHtml = `<div class=\"${allClasses.join(' ')}\"></div>`;\n\n // Trigger JIT CSS generation (no-op if JIT CSS engine is not loaded)\n const generatedCSS = processJITCSS(fakeHtml);\n\n // Create stylesheet\n try {\n transitionStyleSheet = new CSSStyleSheet();\n transitionStyleSheet.replaceSync(generatedCSS);\n } catch {\n // If creating a constructable stylesheet fails for any reason,\n // fallback to a stub to avoid breaking SSR or older environments.\n transitionStyleSheet = {\n cssRules: [],\n replaceSync: () => {},\n toString: () => generatedCSS || '',\n } as unknown as CSSStyleSheet;\n }\n }\n\n return transitionStyleSheet;\n}\n\n"],"mappings":"wKAuGA,IAAa,EAAoB,CAE/B,KAAM,CACJ,UAAW,YACX,YAAa,2CACb,QAAS,cACT,UAAW,cACX,YAAa,0CACb,QAAS,aAIX,cAAe,CACb,UAAW,+BACX,YAAa,uCACb,QAAS,+BACT,UAAW,+BACX,YAAa,sCACb,QAAS,gCAIX,aAAc,CACZ,UAAW,gCACX,YAAa,uCACb,QAAS,+BACT,UAAW,+BACX,YAAa,sCACb,QAAS,iCAIX,WAAY,CACV,UAAW,+BACX,YAAa,uCACb,QAAS,+BACT,UAAW,+BACX,YAAa,sCACb,QAAS,gCAIX,aAAc,CACZ,UAAW,gCACX,YAAa,uCACb,QAAS,+BACT,UAAW,+BACX,YAAa,sCACb,QAAS,iCAIX,MAAO,CACL,UAAW,qBACX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AK,GAAA,CAAI,UAAC,EAMrD,GAAI,CACF,EAAuB,IAAI,cAC3B,EAAqB,YAAY,CAAA,OAC3B,CAGN,EAAuB,CACrB,SAAU,CAAA,EACV,YAAA,IAAmB,CAAA,EACnB,SAAA,IAAgB,GAAgB,KAKtC,OAAO"}
|
|
1
|
+
{"version":3,"file":"custom-elements-runtime.transitions.cjs.js","names":[],"sources":["../src/lib/transitions.ts"],"sourcesContent":["/**\n * Transitions module (top-level). This file provides the public Transition\n * and TransitionGroup APIs. It is an explicit entry used by the build so\n * consumers can import transitions separately: `.../transitions`.\n */\n/**\n * Transitions Module\n * Vue-like transition system integrated with JIT CSS\n * Provides Transition and TransitionGroup components for enter/leave animations\n */\n\nimport { anchorBlock } from './directives';\nimport type { VNode } from './runtime/types';\nimport { processJITCSS } from './runtime/render-bridge';\n\n/* --- Types --- */\n\n/**\n * Transition class names for different animation phases\n * All values should be JIT CSS utility classes\n */\nexport interface TransitionClasses {\n /** Classes applied at the start of enter transition */\n enterFrom?: string;\n /** Classes applied during entire enter transition */\n enterActive?: string;\n /** Classes applied at the end of enter transition */\n enterTo?: string;\n /** Classes applied at the start of leave transition */\n leaveFrom?: string;\n /** Classes applied during entire leave transition */\n leaveActive?: string;\n /** Classes applied at the end of leave transition */\n leaveTo?: string;\n}\n\n/**\n * Lifecycle hooks for transition events\n */\nexport interface TransitionHooks {\n /** Called before enter transition starts */\n onBeforeEnter?: (el: HTMLElement) => void;\n /** Called during enter transition (with done callback for manual control) */\n onEnter?: (el: HTMLElement, done: () => void) => void;\n /** Called after enter transition completes */\n onAfterEnter?: (el: HTMLElement) => void;\n /** Called if enter transition is cancelled */\n onEnterCancelled?: (el: HTMLElement) => void;\n /** Called before leave transition starts */\n onBeforeLeave?: (el: HTMLElement) => void;\n /** Called during leave transition (with done callback for manual control) */\n onLeave?: (el: HTMLElement, done: () => void) => void;\n /** Called after leave transition completes */\n onAfterLeave?: (el: HTMLElement) => void;\n /** Called if leave transition is cancelled */\n onLeaveCancelled?: (el: HTMLElement) => void;\n}\n\n/**\n * Options for Transition component\n */\nexport interface TransitionOptions extends TransitionClasses, TransitionHooks {\n /** Preset name (fade, slide-right, scale, etc.) */\n preset?: keyof typeof transitionPresets;\n /** Whether to show the content */\n show: boolean;\n /** Transition mode: default, out-in (leave before enter), in-out (enter before leave) */\n mode?: 'default' | 'out-in' | 'in-out';\n /** Custom duration override (ms) */\n duration?: number | { enter: number; leave: number };\n /** Whether to apply transition on initial render */\n appear?: boolean;\n /** Whether to use CSS transitions (true) or JS-only hooks (false) */\n css?: boolean;\n /** Optional name for debugging */\n name?: string;\n}\n\n/**\n * Options for TransitionGroup component\n */\nexport interface TransitionGroupOptions extends Omit<\n TransitionOptions,\n 'show'\n> {\n /** HTML tag for the wrapper element */\n tag?: string;\n /** Class applied during move transitions (when items reorder) */\n moveClass?: string;\n /** Whether to show the group (defaults to true for TransitionGroup) */\n show?: boolean;\n /** CSS classes to apply to the wrapper element (e.g., 'flex gap-4' or 'grid grid-cols-3') */\n class?: string;\n /** Inline styles to apply to the wrapper element */\n style?: string | Record<string, string>;\n}\n\n/* --- Transition Presets --- */\n\n/**\n * Pre-defined transition presets using JIT CSS classes\n * Users can reference these by name or define custom classes\n */\nexport const transitionPresets = {\n /** Simple fade in/out */\n fade: {\n enterFrom: 'opacity-0',\n enterActive: 'transition-opacity duration-300 ease-out',\n enterTo: 'opacity-100',\n leaveFrom: 'opacity-100',\n leaveActive: 'transition-opacity duration-200 ease-in',\n leaveTo: 'opacity-0',\n },\n\n /** Slide in from right */\n 'slide-right': {\n enterFrom: 'translate-x-[100%] opacity-0',\n enterActive: 'transition-all duration-300 ease-out',\n enterTo: 'translate-x-[0%] opacity-100',\n leaveFrom: 'translate-x-[0%] opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'translate-x-[100%] opacity-0',\n },\n\n /** Slide in from left */\n 'slide-left': {\n enterFrom: 'translate-x-[-100%] opacity-0',\n enterActive: 'transition-all duration-300 ease-out',\n enterTo: 'translate-x-[0%] opacity-100',\n leaveFrom: 'translate-x-[0%] opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'translate-x-[-100%] opacity-0',\n },\n\n /** Slide up from bottom */\n 'slide-up': {\n enterFrom: 'translate-y-[100%] opacity-0',\n enterActive: 'transition-all duration-300 ease-out',\n enterTo: 'translate-y-[0%] opacity-100',\n leaveFrom: 'translate-y-[0%] opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'translate-y-[100%] opacity-0',\n },\n\n /** Slide down from top */\n 'slide-down': {\n enterFrom: 'translate-y-[-100%] opacity-0',\n enterActive: 'transition-all duration-300 ease-out',\n enterTo: 'translate-y-[0%] opacity-100',\n leaveFrom: 'translate-y-[0%] opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'translate-y-[-100%] opacity-0',\n },\n\n /** Scale up from center */\n scale: {\n enterFrom: 'scale-95 opacity-0',\n enterActive: 'transition-all duration-200 ease-out',\n enterTo: 'scale-100 opacity-100',\n leaveFrom: 'scale-100 opacity-100',\n leaveActive: 'transition-all duration-150 ease-in',\n leaveTo: 'scale-95 opacity-0',\n },\n\n /** Scale down to center */\n 'scale-down': {\n enterFrom: 'scale-105 opacity-0',\n enterActive: 'transition-all duration-200 ease-out',\n enterTo: 'scale-100 opacity-100',\n leaveFrom: 'scale-100 opacity-100',\n leaveActive: 'transition-all duration-150 ease-in',\n leaveTo: 'scale-105 opacity-0',\n },\n\n /** Bounce effect */\n bounce: {\n enterFrom: 'scale-0 opacity-0',\n enterActive: 'transition-all duration-500 ease-out',\n enterTo: 'scale-100 opacity-100',\n leaveFrom: 'scale-100 opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'scale-0 opacity-0',\n },\n\n /** Zoom and fade */\n zoom: {\n enterFrom: 'scale-0 opacity-0',\n enterActive: 'transition-all duration-300 ease-out',\n enterTo: 'scale-100 opacity-100',\n leaveFrom: 'scale-100 opacity-100',\n leaveActive: 'transition-all duration-200 ease-in',\n leaveTo: 'scale-0 opacity-0',\n },\n\n /** Flip in */\n flip: {\n enterFrom: 'rotate-[90deg] opacity-0',\n enterActive: 'transition-all duration-400 ease-out',\n enterTo: 'rotate-[0deg] opacity-100',\n leaveFrom: 'rotate-[0deg] opacity-100',\n leaveActive: 'transition-all duration-300 ease-in',\n leaveTo: 'rotate-[90deg] opacity-0',\n },\n} as const;\n\n/* --- Core Functions --- */\n\n/**\n * Transition component - wraps content with enter/leave animations\n *\n * @example\n * ```ts\n * // Using a preset\n * ${Transition({ preset: 'fade', show: isVisible.value }, html`<div>Content</div>`)}\n *\n * // Using custom JIT classes\n * ${Transition({\n * show: isVisible.value,\n * enterFrom: 'opacity-0 scale-95',\n * enterActive: 'transition-all duration-300',\n * enterTo: 'opacity-100 scale-100',\n * leaveFrom: 'opacity-100 scale-100',\n * leaveActive: 'transition-all duration-200',\n * leaveTo: 'opacity-0 scale-95'\n * }, html`<div>Content</div>`)}\n *\n * // With lifecycle hooks\n * ${Transition({\n * preset: 'slide-right',\n * show: isVisible.value,\n * onAfterEnter: (el) => console.log('Entered!'),\n * onAfterLeave: (el) => console.log('Left!')\n * }, html`<div>Content</div>`)}\n *\n * // Lazy factory — only evaluated when show is true (avoids constructing\n * // expensive VNode trees when the content is hidden)\n * ${Transition({ show: isVisible.value }, () => html`<div>Expensive content</div>`)}\n * ```\n */\nexport function Transition(\n options: TransitionOptions,\n content: VNode | VNode[] | (() => VNode | VNode[]),\n): VNode {\n const {\n preset,\n show,\n mode = 'default',\n duration,\n appear = false,\n css = true,\n name,\n enterFrom,\n enterActive,\n enterTo,\n leaveFrom,\n leaveActive,\n leaveTo,\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n } = options;\n\n // Resolve classes from preset or explicit values\n let transitionClasses: TransitionClasses;\n if (preset && transitionPresets[preset]) {\n transitionClasses = { ...transitionPresets[preset] };\n // Allow overriding preset classes\n if (enterFrom) transitionClasses.enterFrom = enterFrom;\n if (enterActive) transitionClasses.enterActive = enterActive;\n if (enterTo) transitionClasses.enterTo = enterTo;\n if (leaveFrom) transitionClasses.leaveFrom = leaveFrom;\n if (leaveActive) transitionClasses.leaveActive = leaveActive;\n if (leaveTo) transitionClasses.leaveTo = leaveTo;\n } else {\n transitionClasses = {\n enterFrom,\n enterActive,\n enterTo,\n leaveFrom,\n leaveActive,\n leaveTo,\n };\n }\n\n // Resolve content: only call the factory when show is true so that expensive\n // VNode trees (e.g. those that trigger calender builds or heavy computeds)\n // are never constructed while the transition is hidden. Leave animations\n // operate on existing DOM nodes and do not require the content VNode.\n const resolvedContent: VNode | VNode[] =\n show && typeof content === 'function'\n ? content()\n : (content as VNode | VNode[]);\n\n // Create anchor block with transition metadata\n const transitionKey =\n name || (preset ? `transition-${preset}` : 'transition');\n const transitionVNode = anchorBlock(\n show ? resolvedContent : [],\n transitionKey,\n );\n\n // Attach metadata for VDOM to consume during patching\n (transitionVNode as VNode & { _transition?: unknown })._transition = {\n name: transitionKey,\n classes: transitionClasses,\n mode,\n duration,\n appear,\n css,\n state: show ? 'visible' : 'hidden',\n hooks: {\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n },\n };\n\n return transitionVNode;\n}\n\n/**\n * TransitionGroup component - animates lists with enter/leave/move transitions\n *\n * @example\n * ```ts\n * // Basic usage\n * ${TransitionGroup({\n * preset: 'slide-right',\n * tag: 'ul',\n * moveClass: 'transition-transform duration-300'\n * }, each(items.value, (item) => html`\n * <li key=\"${item.id}\">${item.text}</li>\n * `))}\n *\n * // With flex layout\n * ${TransitionGroup({\n * preset: 'fade',\n * class: 'flex gap-4 flex-wrap'\n * }, each(items.value, (item) => html`\n * <div key=\"${item.id}\" class=\"shrink-0\">${item.text}</div>\n * `))}\n *\n * // With grid layout\n * ${TransitionGroup({\n * preset: 'scale',\n * class: 'grid grid-cols-3 gap-4'\n * }, each(items.value, (item) => html`\n * <div key=\"${item.id}\">${item.text}</div>\n * `))}\n * ```\n */\nexport function TransitionGroup(\n options: TransitionGroupOptions,\n children: VNode[],\n): VNode {\n const {\n tag = 'div',\n moveClass = 'transition-transform duration-300',\n preset,\n show = true,\n mode = 'default',\n duration,\n appear = false,\n css = true,\n name,\n class: className,\n style,\n enterFrom,\n enterActive,\n enterTo,\n leaveFrom,\n leaveActive,\n leaveTo,\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n } = options;\n\n // Resolve classes from preset or explicit values\n let transitionClasses: TransitionClasses;\n if (preset && transitionPresets[preset]) {\n transitionClasses = { ...transitionPresets[preset] };\n // Allow overriding preset classes\n if (enterFrom) transitionClasses.enterFrom = enterFrom;\n if (enterActive) transitionClasses.enterActive = enterActive;\n if (enterTo) transitionClasses.enterTo = enterTo;\n if (leaveFrom) transitionClasses.leaveFrom = leaveFrom;\n if (leaveActive) transitionClasses.leaveActive = leaveActive;\n if (leaveTo) transitionClasses.leaveTo = leaveTo;\n } else {\n transitionClasses = {\n enterFrom,\n enterActive,\n enterTo,\n leaveFrom,\n leaveActive,\n leaveTo,\n };\n }\n\n // Create wrapper element with transition group metadata\n const groupKey =\n name || (preset ? `transition-group-${preset}` : 'transition-group');\n\n // Flatten anchor block children to enable proper keyed diffing\n // When each() is used, it creates anchor blocks. We need to extract the actual elements\n // and give them keys from their anchor blocks for proper reordering\n const flattenedChildren: VNode[] = [];\n for (const child of show ? children : []) {\n if (child && typeof child === 'object' && child.tag === '#anchor') {\n // Extract children from anchor block\n const anchorChildren = Array.isArray(child.children)\n ? child.children\n : [];\n for (const anchorChild of anchorChildren) {\n if (anchorChild && typeof anchorChild === 'object') {\n // Use anchor block's key for the child element\n const keyedChild = {\n ...anchorChild,\n key: child.key || anchorChild.key,\n props: {\n ...anchorChild.props,\n _anchorKey: child.key, // Preserve original anchor key\n },\n };\n flattenedChildren.push(keyedChild);\n } else {\n flattenedChildren.push(anchorChild);\n }\n }\n } else {\n flattenedChildren.push(child);\n }\n }\n\n // Serialize style object to a CSS string for the attrs record so it matches\n // the expected primitive attribute value types.\n const styleAttr = (() => {\n if (!style) return undefined;\n if (typeof style === 'string') return style;\n return Object.entries(style)\n .map(([k, v]) => `${k}: ${v}`)\n .join('; ');\n })();\n\n return {\n tag,\n children: flattenedChildren,\n key: groupKey,\n props: {\n attrs: {\n ...(className ? { class: className } : {}),\n ...(styleAttr ? { style: styleAttr } : {}),\n },\n _transitionGroup: {\n name: groupKey,\n classes: transitionClasses,\n moveClass,\n mode,\n duration,\n appear,\n css,\n hooks: {\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n },\n },\n },\n };\n}\n\n/**\n * Helper to create custom transition presets\n *\n * @example\n * ```ts\n * const customFade = createTransitionPreset({\n * enterFrom: 'opacity-0',\n * enterActive: 'transition-opacity duration-500 ease-out',\n * enterTo: 'opacity-100',\n * leaveFrom: 'opacity-100',\n * leaveActive: 'transition-opacity duration-300 ease-in',\n * leaveTo: 'opacity-0'\n * });\n *\n * ${Transition({ ...customFade, show: visible.value }, content)}\n * ```\n */\nexport function createTransitionPreset(\n classes: TransitionClasses,\n): TransitionClasses {\n return { ...classes };\n}\n\n/**\n * Pre-generate CSS for all transition preset classes\n * This ensures the JIT CSS system has the styles ready when transitions are used\n */\nlet transitionStyleSheet: CSSStyleSheet | null = null;\n\n/**\n * Get the global transition stylesheet (creates it if needed)\n */\nexport function getTransitionStyleSheet(): CSSStyleSheet {\n if (!transitionStyleSheet) {\n // If constructable stylesheets aren't available (SSR / old browsers),\n // return a no-op stub to avoid throwing during import or server render.\n if (typeof CSSStyleSheet === 'undefined') {\n transitionStyleSheet = {\n cssRules: [],\n replaceSync: () => {},\n toString: () => '',\n } as unknown as CSSStyleSheet;\n return transitionStyleSheet;\n }\n\n const allClasses: string[] = [];\n\n // Collect all classes from presets\n Object.values(transitionPresets).forEach((preset) => {\n if (preset.enterFrom) allClasses.push(preset.enterFrom);\n if (preset.enterActive) allClasses.push(preset.enterActive);\n if (preset.enterTo) allClasses.push(preset.enterTo);\n if (preset.leaveFrom) allClasses.push(preset.leaveFrom);\n if (preset.leaveActive) allClasses.push(preset.leaveActive);\n if (preset.leaveTo) allClasses.push(preset.leaveTo);\n });\n\n // Create a fake HTML string with all transition classes\n const fakeHtml = `<div class=\"${allClasses.join(' ')}\"></div>`;\n\n // Trigger JIT CSS generation (no-op if JIT CSS engine is not loaded)\n const generatedCSS = processJITCSS(fakeHtml);\n\n // Create stylesheet\n try {\n transitionStyleSheet = new CSSStyleSheet();\n transitionStyleSheet.replaceSync(generatedCSS);\n } catch {\n // If creating a constructable stylesheet fails for any reason,\n // fallback to a stub to avoid breaking SSR or older environments.\n transitionStyleSheet = {\n cssRules: [],\n replaceSync: () => {},\n toString: () => generatedCSS || '',\n } as unknown as CSSStyleSheet;\n }\n }\n\n return transitionStyleSheet;\n}\n\n"],"mappings":"wKAuGA,IAAa,EAAoB,CAE/B,KAAM,CACJ,UAAW,YACX,YAAa,2CACb,QAAS,cACT,UAAW,cACX,YAAa,0CACb,QAAS,YACV,CAGD,cAAe,CACb,UAAW,+BACX,YAAa,uCACb,QAAS,+BACT,UAAW,+BACX,YAAa,sCACb,QAAS,+BACV,CAGD,aAAc,CACZ,UAAW,gCACX,YAAa,uCACb,QAAS,+BACT,UAAW,+BACX,YAAa,sCACb,QAAS,gCACV,CAGD,WAAY,CACV,UAAW,+BACX,YAAa,uCACb,QAAS,+BACT,UAAW,+BACX,YAAa,sCACb,QAAS,+BACV,CAGD,aAAc,CACZ,UAAW,gCACX,YAAa,uCACb,QAAS,+BACT,UAAW,+BACX,YAAa,sCACb,QAAS,gCACV,CAGD,MAAO,CACL,UAAW,qBACX,YAAa,uCACb,Q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