@excom/spa-route 0.1.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/.rush/temp/chunked-rush-logs/spa-route.apply-exports.chunks.jsonl +1 -0
- package/.rush/temp/chunked-rush-logs/spa-route.build_docs.chunks.jsonl +1 -0
- package/.rush/temp/chunked-rush-logs/spa-route.build_package-metas.chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/all.log +1 -0
- package/.rush/temp/operation/apply-exports/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/state.json +3 -0
- package/.rush/temp/operation/build_docs/all.log +1 -0
- package/.rush/temp/operation/build_docs/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/build_docs/state.json +3 -0
- package/.rush/temp/operation/build_package-metas/all.log +1 -0
- package/.rush/temp/operation/build_package-metas/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/build_package-metas/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +3 -0
- package/config/rig.json +5 -0
- package/index.css +5 -0
- package/index.ts +29 -0
- package/package.json +48 -0
- package/rush-logs/spa-route.apply-exports.cache.log +1 -0
- package/rush-logs/spa-route.apply-exports.log +1 -0
- package/rush-logs/spa-route.build_docs.cache.log +1 -0
- package/rush-logs/spa-route.build_docs.log +1 -0
- package/rush-logs/spa-route.build_package-metas.cache.log +1 -0
- package/rush-logs/spa-route.build_package-metas.log +1 -0
- package/spa-a.ts +124 -0
- package/spa-manager.ts +605 -0
- package/spa-route.ts +322 -0
- package/src/spa-route.css +24 -0
- package/src/utils.ts +31 -0
- package/support/custom-elements.json +953 -0
- package/support/dist-docs/spa-a.md +40 -0
- package/support/dist-docs/spa-manager.md +66 -0
- package/support/dist-docs/spa-route.md +408 -0
- package/support/docs/README.md +314 -0
- package/support/package-meta.json +789 -0
- package/support/tests/spa-navigation.test.ts +1076 -0
- package/support/tests/spa-route.test.ts +766 -0
- package/support/tests/spa-title.test.ts +225 -0
- package/tsconfig.json +5 -0
|
@@ -0,0 +1,789 @@
|
|
|
1
|
+
{
|
|
2
|
+
"shortName": "spa-route",
|
|
3
|
+
"package": {
|
|
4
|
+
"name": "@excom/spa-route",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "<spa-route> custom element",
|
|
7
|
+
"peerDependencies": {},
|
|
8
|
+
"excom": {
|
|
9
|
+
"packageType": "kit-element"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"demos": {},
|
|
13
|
+
"readme": "<h1 id=\"md-spa-route\">spa-route</h1>\n<p>Build a full SPA from HTML alone — screens, links, and view transitions.</p>\n<blockquote>\n<p>This site is a live demo... inspect its HTML! Other live demos of spa-route coming soon.</p>\n</blockquote>\n<include-content data-language=\"html\"><template><spa-manager>\n <spa-route route-href=\"/\" template-ref=\"/views/home.html\"></spa-route>\n <spa-route route-href=\"/about\" template-ref=\"/views/about.html\"></spa-route>\n</spa-manager>\n\n<nav>\n <spa-a route-href=\"/\">Home</spa-a>\n <spa-a route-href=\"/about\">About</spa-a>\n</nav></template></include-content>\n<h2 id=\"md-features\">Features</h2>\n<ul>\n<li><strong>Pure CSS View Transitions</strong> Write CSS, get beautiful animations between routes</li>\n<li><strong>Active / was-active</strong> Style current and outgoing links & screens (nav chrome, card expansion)</li>\n<li><strong>Same-route reuse / refresh</strong> Keep or rebuild the view when only params change</li>\n<li><strong>Scroll reset / restore</strong> Per-axis control for push, replace, back, forward</li>\n<li><strong>Nested layouts</strong> Keep a parent route mounted under child paths</li>\n<li><strong>404 fallbacks</strong> Catch-alls that only fire when nothing else matched</li>\n<li><strong>Per-route document title</strong> <code>document.title</code> follows the active route</li>\n<li><strong>History actions</strong> Push, replace, back, forward from a link</li>\n</ul>\n<h2 id=\"md-installation\">Installation</h2>\n<p><include-content is-active template-ref=\"/views/install-section/install-section.html\"></include-content></p>\n<h2 id=\"md-usage\">Usage</h2>\n<p>Wrap screens in <code><spa-manager></code>, give each <code><spa-route></code> a <code>route-href</code>, and link with <code><spa-a></code>.</p>\n<include-content data-language=\"html\"><template><!-- Optional SPA manager for View Transitions and batched router config -->\n<spa-manager>\n <!-- SPA routing -->\n <spa-route route-href=\"/\" template-ref=\"/views/home.html\"></spa-route>\n <spa-route route-href=\"/about\" template-ref=\"/views/about.html\"></spa-route>\n</spa-manager>\n<nav>\n <!-- SPA links -->\n <spa-a route-href=\"/\">Home</spa-a>\n <spa-a route-href=\"/about\">About</spa-a>\n</nav></template></include-content>\n<h3 id=\"md-api-reference\">API Reference</h3>\n<p><include-content is-active template-ref=\"/views/api-reference/api-reference.html\"></include-content></p>\n<h3 id=\"md-examples\">Examples</h3>\n<h4 id=\"md-minimal-spa\">Minimal SPA</h4>\n<p>Three routes, three links. Active links style via <code>spa-a[is-active]</code>.</p>\n<include-content data-language=\"html\"><template><spa-manager>\n <nav>\n <spa-a route-href=\"/home\">Home</spa-a>\n <spa-a route-href=\"/users\">Users</spa-a>\n <spa-a route-href=\"/about\">About</spa-a>\n <spa-a route-href=\"/contact\">Contact</spa-a>\n </nav>\n <spa-route route-href=\"/home\">\n <template>\n <h3>Welcome</h3>\n <p>Mounted because the URL matched <code>/home</code>.</p>\n </template>\n </spa-route>\n <spa-route route-href=\"/users\">\n <template>\n <h3>Users</h3>\n <ul>\n <li>Adam</li>\n <li>Linus</li>\n <li>Grace</li>\n </ul>\n </template>\n </spa-route>\n <spa-route route-href=\"/about\" template-ref=\"/this/view/is/remote.html\"></spa-route>\n <spa-route route-href=\"/contact\" template-ref=\"#this-view-is-dom-selected\"></spa-route>\n</spa-manager>\n\n<template id=\"this-view-is-dom-selected\">foo@bar.com</template></template></include-content>\n<include-content data-language=\"css\"><template>spa-a[is-active] {\n font-weight: bold;\n pointer-events: none;\n text-decoration: none;\n}</template></include-content>\n<h4 id=\"md-nested-layout-amp-404\">Nested layout & 404</h4>\n<p><code>match-nested</code> keeps a layout mounted under child paths. <code>is-fallback</code> with <code>route-regex=".*"</code> is a 404 that only activates when no preceding sibling matched.</p>\n<include-content data-language=\"html\"><template><spa-manager>\n <nav>\n <spa-a route-href=\"/users\">Users list</spa-a>\n <spa-a route-href=\"/users/42\">User 42</spa-a>\n <spa-a route-href=\"/missing\">Missing page</spa-a>\n </nav>\n <spa-route route-href=\"/users\" match-nested>\n <template>\n <section>\n <h3>Users layout</h3>\n <spa-manager>\n <spa-route route-href=\"/users\">\n <template><p>List of users.</p></template>\n </spa-route>\n <spa-route route-href=\"/users/:id\">\n <template><p>Detail for a single user.</p></template>\n </spa-route>\n </spa-manager>\n </section>\n </template>\n </spa-route>\n <spa-route route-regex=\".*?view=admin.*\" template-ref=\"/views/admin-sidebar.html\"></spa-route>\n <spa-route route-regex=\".*\" is-fallback>\n <template>\n <section>\n <h3>404</h3>\n <p>Catch-all — only when no preceding sibling matched.</p>\n </section>\n </template>\n </spa-route>\n</spa-manager></template></include-content>\n<h4 id=\"md-document-title\">Document title</h4>\n<p><code>document-title</code> sets <code>document.title</code> while its route is active. It keys off\nactivation, not clicks, so cold loads and back / forward retitle too. The\noutermost <code><spa-manager></code> applies the last active route carrying one — a\nnested route beats its ancestor — and restores the page's own <code><title></code> once\nno active route has a title.</p>\n<include-content data-language=\"html\"><template><title>Nucleus · docs</title>\n\n<spa-manager>\n <spa-route route-href=\"/\" document-title=\"My company\">\n <template><p>The company page.</p></template>\n </spa-route>\n <!-- untitled: the page's own <title> comes back -->\n <spa-route route-href=\"/docs\">\n <template><p>The docs.</p></template>\n </spa-route>\n</spa-manager></template></include-content>\n<h4 id=\"md-history-actions\">History actions</h4>\n<p><code>route-action="back"</code> / <code>"forward"</code> walk history; <code>"replace"</code> swaps the current entry instead of pushing.</p>\n<include-content data-language=\"html\"><template><spa-manager>\n <nav>\n <spa-a route-action=\"back\">‹ Back</spa-a>\n <spa-a route-action=\"forward\">Forward ›</spa-a>\n <spa-a route-href=\"/one\">Push /one</spa-a>\n <spa-a route-href=\"/two\">Push /two</spa-a>\n <spa-a route-href=\"/login\" route-action=\"replace\">\n Replace with /login\n </spa-a>\n </nav>\n <spa-route route-href=\"/one\">\n <template><p>You're on <code>/one</code>.</p></template>\n </spa-route>\n <spa-route route-href=\"/two\">\n <template><p>You're on <code>/two</code>.</p></template>\n </spa-route>\n <spa-route route-href=\"/login\">\n <template>\n <p>You're on <code>/login</code> — this entry replaced the\n previous one in history.</p>\n </template>\n </spa-route>\n</spa-manager></template></include-content>\n<h4 id=\"md-view-transitions\">View Transitions</h4>\n<p><code><spa-manager></code> wraps each navigation in <code>document.startViewTransition()</code> (when supported). Style with <code>::view-transition-*</code>; set per-link types via <code>transition-types</code> (e.g. card expansion); opt a route out with <code>no-transition</code>.</p>\n<include-content data-language=\"css\"><template>::view-transition-old(root),\n::view-transition-new(root) {\n animation-duration: 0.25s;\n}</template></include-content>\n<h4 id=\"md-view-transitions-localized\">View Transitions - Localized</h4>\n<p>If you had a list of cards, and clicking on one expanded it to the detail view (and vice versa, contracting), you would achieve it similarly to the code example below. This technique relies on styling the <code><spa-a></code> with its <code>[is-active]</code> (incoming view) and <code>[was-active]</code> (outgoing view).</p>\n<include-content data-language=\"html\"><template><spa-manager>\n <spa-route id=\"route-list\" route-href=\"/list\">\n <template>\n <spa-a route-href=\"/detail/123\" transition-types=\"card-morph\" class=\"mini-card\">\n Go to detail\n </spa-a>\n </template>\n </spa-route>\n <spa-route id=\"route-detail\" route-href=\"/detail/:id\">\n <template>\n <article id=\"detail-card\" class=\"card\">\n <!-- other content here -->\n </article>\n </template>\n </spa-route>\n</spa-manager></template></include-content>\n<include-content data-language=\"css\"><template>html:active-view-transition-type(card-morph) {\n #route-list spa-a[transition-types=\"card-morph\"][was-active], /* outgoing list card (forward) */\n #route-list spa-a[transition-types=\"card-morph\"][is-active], /* incoming list card (back) */\n #detail-card /* detail card (forward & back) */ {\n contain: layout;\n height: fit-content;\n view-transition-name: card-morph;\n }\n}\n::view-transition-old(card-morph),\n::view-transition-new(card-morph) {\n mix-blend-mode: normal;\n height: 100%;\n width: 100%;\n will-change: opacity;\n animation-fill-mode: both;\n}\n::view-transition-old(card-morph) {\n animation-name: fade-out 1s ease;\n}\n::view-transition-new(card-morph) {\n animation-name: fade-in 1s ease;\n}\n@keyframes fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fade-out {\n from { opacity: 1; }\n to { opacity: 0; }\n}</template></include-content>\n<h4 id=\"md-touch-edge-swipe\">Touch edge-swipe</h4>\n<p>On touch devices, horizontal drags from within <code>overscroll-x-threshold</code> of an edge trigger back / forward. Use <code>"none"</code> to block overscroll without navigating. Useful for preventing native swipes in Safari, which visually break SPAs.</p>\n<include-content data-language=\"html\"><template><spa-manager overscroll-behavior-x=\"navigate\"></spa-manager></template></include-content>\n<h4 id=\"md-scroll-reset-restore\">Scroll reset / restore</h4>\n<p>By default, <code><spa-route></code>:</p>\n<ul>\n<li>resets scroll to top-left on <code>push</code> / <code>replace</code></li>\n<li>restores the saved scroll position on <code>back</code> / <code>forward</code></li>\n</ul>\n<p>Override per axis with <code>scroll-reset-y</code> / <code>scroll-reset-x</code> — space-separated moves that should reset to <code>0</code> (omitted moves restore instead):</p>\n<include-content data-language=\"html\"><template><!-- also reset Y when the user hits back -->\n<spa-route\n route-href=\"/article/:id\"\n scroll-reset-y=\"push replace back\"\n></spa-route></template></include-content>\n<p>Animate with <code>scroll-reset-behavior="smooth"</code>. Disable all scroll handling with <code>scroll-set-disabled</code>.</p>\n<h4 id=\"md-same-route-params\">Same-route params</h4>\n<p>When the matched route stays the same but params change (e.g. <code>/users/1</code> → <code>/users/2</code>):</p>\n<ul>\n<li><code>same-route="reuse"</code> (default) — keep the rendered tree, update route data, and let <code><spa-manager></code> run a View Transition</li>\n<li><code>same-route="refresh"</code> — tear down and re-render the view</li>\n</ul>\n<include-content data-language=\"html\"><template><spa-route route-href=\"/users/:id\" same-route=\"refresh\">\n <template><!-- fresh tree per user id --></template>\n</spa-route>\n\n<spa-route\n route-href=\"/logs/:view\"\n same-route=\"reuse\"\n scroll-set-disabled\n>\n <template><!-- preserve content + scroll across view tabs --></template>\n</spa-route></template></include-content>\n<h4 id=\"md-transition-delay\">Transition delay</h4>\n<p><code>transition-delay</code> on <code><spa-manager></code> waits N ms before starting the batched View Transition — useful when sibling routes need a beat to queue their render/unrender callbacks, or for last-second DOM work.</p>\n<include-content data-language=\"html\"><template><spa-manager transition-delay=\"50\">\n <!-- routes -->\n</spa-manager></template></include-content>\n",
|
|
14
|
+
"docs": {
|
|
15
|
+
"readme": "<h1 id=\"md-spa-route\">spa-route</h1>\n<p>Build a full SPA from HTML alone — screens, links, and view transitions.</p>\n<blockquote>\n<p>This site is a live demo... inspect its HTML! Other live demos of spa-route coming soon.</p>\n</blockquote>\n<include-content data-language=\"html\"><template><spa-manager>\n <spa-route route-href=\"/\" template-ref=\"/views/home.html\"></spa-route>\n <spa-route route-href=\"/about\" template-ref=\"/views/about.html\"></spa-route>\n</spa-manager>\n\n<nav>\n <spa-a route-href=\"/\">Home</spa-a>\n <spa-a route-href=\"/about\">About</spa-a>\n</nav></template></include-content>\n<h2 id=\"md-features\">Features</h2>\n<ul>\n<li><strong>Pure CSS View Transitions</strong> Write CSS, get beautiful animations between routes</li>\n<li><strong>Active / was-active</strong> Style current and outgoing links & screens (nav chrome, card expansion)</li>\n<li><strong>Same-route reuse / refresh</strong> Keep or rebuild the view when only params change</li>\n<li><strong>Scroll reset / restore</strong> Per-axis control for push, replace, back, forward</li>\n<li><strong>Nested layouts</strong> Keep a parent route mounted under child paths</li>\n<li><strong>404 fallbacks</strong> Catch-alls that only fire when nothing else matched</li>\n<li><strong>Per-route document title</strong> <code>document.title</code> follows the active route</li>\n<li><strong>History actions</strong> Push, replace, back, forward from a link</li>\n</ul>\n<h2 id=\"md-installation\">Installation</h2>\n<p><include-content is-active template-ref=\"/views/install-section/install-section.html\"></include-content></p>\n<h2 id=\"md-usage\">Usage</h2>\n<p>Wrap screens in <code><spa-manager></code>, give each <code><spa-route></code> a <code>route-href</code>, and link with <code><spa-a></code>.</p>\n<include-content data-language=\"html\"><template><!-- Optional SPA manager for View Transitions and batched router config -->\n<spa-manager>\n <!-- SPA routing -->\n <spa-route route-href=\"/\" template-ref=\"/views/home.html\"></spa-route>\n <spa-route route-href=\"/about\" template-ref=\"/views/about.html\"></spa-route>\n</spa-manager>\n<nav>\n <!-- SPA links -->\n <spa-a route-href=\"/\">Home</spa-a>\n <spa-a route-href=\"/about\">About</spa-a>\n</nav></template></include-content>\n<h3 id=\"md-api-reference\">API Reference</h3>\n<p><include-content is-active template-ref=\"/views/api-reference/api-reference.html\"></include-content></p>\n<h3 id=\"md-examples\">Examples</h3>\n<h4 id=\"md-minimal-spa\">Minimal SPA</h4>\n<p>Three routes, three links. Active links style via <code>spa-a[is-active]</code>.</p>\n<include-content data-language=\"html\"><template><spa-manager>\n <nav>\n <spa-a route-href=\"/home\">Home</spa-a>\n <spa-a route-href=\"/users\">Users</spa-a>\n <spa-a route-href=\"/about\">About</spa-a>\n <spa-a route-href=\"/contact\">Contact</spa-a>\n </nav>\n <spa-route route-href=\"/home\">\n <template>\n <h3>Welcome</h3>\n <p>Mounted because the URL matched <code>/home</code>.</p>\n </template>\n </spa-route>\n <spa-route route-href=\"/users\">\n <template>\n <h3>Users</h3>\n <ul>\n <li>Adam</li>\n <li>Linus</li>\n <li>Grace</li>\n </ul>\n </template>\n </spa-route>\n <spa-route route-href=\"/about\" template-ref=\"/this/view/is/remote.html\"></spa-route>\n <spa-route route-href=\"/contact\" template-ref=\"#this-view-is-dom-selected\"></spa-route>\n</spa-manager>\n\n<template id=\"this-view-is-dom-selected\">foo@bar.com</template></template></include-content>\n<include-content data-language=\"css\"><template>spa-a[is-active] {\n font-weight: bold;\n pointer-events: none;\n text-decoration: none;\n}</template></include-content>\n<h4 id=\"md-nested-layout-amp-404\">Nested layout & 404</h4>\n<p><code>match-nested</code> keeps a layout mounted under child paths. <code>is-fallback</code> with <code>route-regex=".*"</code> is a 404 that only activates when no preceding sibling matched.</p>\n<include-content data-language=\"html\"><template><spa-manager>\n <nav>\n <spa-a route-href=\"/users\">Users list</spa-a>\n <spa-a route-href=\"/users/42\">User 42</spa-a>\n <spa-a route-href=\"/missing\">Missing page</spa-a>\n </nav>\n <spa-route route-href=\"/users\" match-nested>\n <template>\n <section>\n <h3>Users layout</h3>\n <spa-manager>\n <spa-route route-href=\"/users\">\n <template><p>List of users.</p></template>\n </spa-route>\n <spa-route route-href=\"/users/:id\">\n <template><p>Detail for a single user.</p></template>\n </spa-route>\n </spa-manager>\n </section>\n </template>\n </spa-route>\n <spa-route route-regex=\".*?view=admin.*\" template-ref=\"/views/admin-sidebar.html\"></spa-route>\n <spa-route route-regex=\".*\" is-fallback>\n <template>\n <section>\n <h3>404</h3>\n <p>Catch-all — only when no preceding sibling matched.</p>\n </section>\n </template>\n </spa-route>\n</spa-manager></template></include-content>\n<h4 id=\"md-document-title\">Document title</h4>\n<p><code>document-title</code> sets <code>document.title</code> while its route is active. It keys off\nactivation, not clicks, so cold loads and back / forward retitle too. The\noutermost <code><spa-manager></code> applies the last active route carrying one — a\nnested route beats its ancestor — and restores the page's own <code><title></code> once\nno active route has a title.</p>\n<include-content data-language=\"html\"><template><title>Nucleus · docs</title>\n\n<spa-manager>\n <spa-route route-href=\"/\" document-title=\"My company\">\n <template><p>The company page.</p></template>\n </spa-route>\n <!-- untitled: the page's own <title> comes back -->\n <spa-route route-href=\"/docs\">\n <template><p>The docs.</p></template>\n </spa-route>\n</spa-manager></template></include-content>\n<h4 id=\"md-history-actions\">History actions</h4>\n<p><code>route-action="back"</code> / <code>"forward"</code> walk history; <code>"replace"</code> swaps the current entry instead of pushing.</p>\n<include-content data-language=\"html\"><template><spa-manager>\n <nav>\n <spa-a route-action=\"back\">‹ Back</spa-a>\n <spa-a route-action=\"forward\">Forward ›</spa-a>\n <spa-a route-href=\"/one\">Push /one</spa-a>\n <spa-a route-href=\"/two\">Push /two</spa-a>\n <spa-a route-href=\"/login\" route-action=\"replace\">\n Replace with /login\n </spa-a>\n </nav>\n <spa-route route-href=\"/one\">\n <template><p>You're on <code>/one</code>.</p></template>\n </spa-route>\n <spa-route route-href=\"/two\">\n <template><p>You're on <code>/two</code>.</p></template>\n </spa-route>\n <spa-route route-href=\"/login\">\n <template>\n <p>You're on <code>/login</code> — this entry replaced the\n previous one in history.</p>\n </template>\n </spa-route>\n</spa-manager></template></include-content>\n<h4 id=\"md-view-transitions\">View Transitions</h4>\n<p><code><spa-manager></code> wraps each navigation in <code>document.startViewTransition()</code> (when supported). Style with <code>::view-transition-*</code>; set per-link types via <code>transition-types</code> (e.g. card expansion); opt a route out with <code>no-transition</code>.</p>\n<include-content data-language=\"css\"><template>::view-transition-old(root),\n::view-transition-new(root) {\n animation-duration: 0.25s;\n}</template></include-content>\n<h4 id=\"md-view-transitions-localized\">View Transitions - Localized</h4>\n<p>If you had a list of cards, and clicking on one expanded it to the detail view (and vice versa, contracting), you would achieve it similarly to the code example below. This technique relies on styling the <code><spa-a></code> with its <code>[is-active]</code> (incoming view) and <code>[was-active]</code> (outgoing view).</p>\n<include-content data-language=\"html\"><template><spa-manager>\n <spa-route id=\"route-list\" route-href=\"/list\">\n <template>\n <spa-a route-href=\"/detail/123\" transition-types=\"card-morph\" class=\"mini-card\">\n Go to detail\n </spa-a>\n </template>\n </spa-route>\n <spa-route id=\"route-detail\" route-href=\"/detail/:id\">\n <template>\n <article id=\"detail-card\" class=\"card\">\n <!-- other content here -->\n </article>\n </template>\n </spa-route>\n</spa-manager></template></include-content>\n<include-content data-language=\"css\"><template>html:active-view-transition-type(card-morph) {\n #route-list spa-a[transition-types=\"card-morph\"][was-active], /* outgoing list card (forward) */\n #route-list spa-a[transition-types=\"card-morph\"][is-active], /* incoming list card (back) */\n #detail-card /* detail card (forward & back) */ {\n contain: layout;\n height: fit-content;\n view-transition-name: card-morph;\n }\n}\n::view-transition-old(card-morph),\n::view-transition-new(card-morph) {\n mix-blend-mode: normal;\n height: 100%;\n width: 100%;\n will-change: opacity;\n animation-fill-mode: both;\n}\n::view-transition-old(card-morph) {\n animation-name: fade-out 1s ease;\n}\n::view-transition-new(card-morph) {\n animation-name: fade-in 1s ease;\n}\n@keyframes fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fade-out {\n from { opacity: 1; }\n to { opacity: 0; }\n}</template></include-content>\n<h4 id=\"md-touch-edge-swipe\">Touch edge-swipe</h4>\n<p>On touch devices, horizontal drags from within <code>overscroll-x-threshold</code> of an edge trigger back / forward. Use <code>"none"</code> to block overscroll without navigating. Useful for preventing native swipes in Safari, which visually break SPAs.</p>\n<include-content data-language=\"html\"><template><spa-manager overscroll-behavior-x=\"navigate\"></spa-manager></template></include-content>\n<h4 id=\"md-scroll-reset-restore\">Scroll reset / restore</h4>\n<p>By default, <code><spa-route></code>:</p>\n<ul>\n<li>resets scroll to top-left on <code>push</code> / <code>replace</code></li>\n<li>restores the saved scroll position on <code>back</code> / <code>forward</code></li>\n</ul>\n<p>Override per axis with <code>scroll-reset-y</code> / <code>scroll-reset-x</code> — space-separated moves that should reset to <code>0</code> (omitted moves restore instead):</p>\n<include-content data-language=\"html\"><template><!-- also reset Y when the user hits back -->\n<spa-route\n route-href=\"/article/:id\"\n scroll-reset-y=\"push replace back\"\n></spa-route></template></include-content>\n<p>Animate with <code>scroll-reset-behavior="smooth"</code>. Disable all scroll handling with <code>scroll-set-disabled</code>.</p>\n<h4 id=\"md-same-route-params\">Same-route params</h4>\n<p>When the matched route stays the same but params change (e.g. <code>/users/1</code> → <code>/users/2</code>):</p>\n<ul>\n<li><code>same-route="reuse"</code> (default) — keep the rendered tree, update route data, and let <code><spa-manager></code> run a View Transition</li>\n<li><code>same-route="refresh"</code> — tear down and re-render the view</li>\n</ul>\n<include-content data-language=\"html\"><template><spa-route route-href=\"/users/:id\" same-route=\"refresh\">\n <template><!-- fresh tree per user id --></template>\n</spa-route>\n\n<spa-route\n route-href=\"/logs/:view\"\n same-route=\"reuse\"\n scroll-set-disabled\n>\n <template><!-- preserve content + scroll across view tabs --></template>\n</spa-route></template></include-content>\n<h4 id=\"md-transition-delay\">Transition delay</h4>\n<p><code>transition-delay</code> on <code><spa-manager></code> waits N ms before starting the batched View Transition — useful when sibling routes need a beat to queue their render/unrender callbacks, or for last-second DOM work.</p>\n<include-content data-language=\"html\"><template><spa-manager transition-delay=\"50\">\n <!-- routes -->\n</spa-manager></template></include-content>\n"
|
|
16
|
+
},
|
|
17
|
+
"installation": {
|
|
18
|
+
"name": "@excom/spa-route",
|
|
19
|
+
"shortName": "spa-route",
|
|
20
|
+
"version": "0.1.0",
|
|
21
|
+
"description": "<spa-route> custom element",
|
|
22
|
+
"packageType": "kit-element",
|
|
23
|
+
"cdn": "<script src=\"https://unpkg.com/@excom/kit-utils/dist/index.umd.min.js\"></script>\n<script src=\"https://unpkg.com/@excom/neutron/dist/index.umd.min.js\"></script>\n<script src=\"https://unpkg.com/@excom/spa-route@0.1.0/dist/index.umd.min.js\"></script>\n<link rel=\"stylesheet\" href=\"https://unpkg.com/@excom/spa-route@0.1.0/dist/index.css\">",
|
|
24
|
+
"install": {
|
|
25
|
+
"npm": "npm install @excom/spa-route"
|
|
26
|
+
},
|
|
27
|
+
"imports": {
|
|
28
|
+
"js": "import \"@excom/spa-route\";",
|
|
29
|
+
"css": "@import \"@excom/spa-route\";",
|
|
30
|
+
"html": "<!-- import path to `node_modules` will depend on your build setup -->\n<script type=\"module\" src=\"/node_modules/@excom/spa-route\"></script>\n<link rel=\"stylesheet\" href=\"/node_modules/@excom/spa-route\">"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": []
|
|
33
|
+
},
|
|
34
|
+
"elementApis": [
|
|
35
|
+
{
|
|
36
|
+
"tag": "spa-route",
|
|
37
|
+
"summary": "Declarative SPA screen — URL match → render.",
|
|
38
|
+
"kind": "class",
|
|
39
|
+
"attributes": [
|
|
40
|
+
{
|
|
41
|
+
"name": "bypass-cache",
|
|
42
|
+
"type": "boolean",
|
|
43
|
+
"description": "Skip the in-memory response cache (URL <code>template-ref</code> only).",
|
|
44
|
+
"fieldName": "bypassCache",
|
|
45
|
+
"surface": "option",
|
|
46
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "document-title",
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "<code>document.title</code> while this route is active. The outermost <code><spa-manager></code> applies the last active route carrying one — so a nested route beats its ancestor — and restores the page's own <code><title></code> once no active route has one. Cold loads and back / forward retitle too: it keys off activation, not clicks.",
|
|
52
|
+
"fieldName": "documentTitle",
|
|
53
|
+
"surface": "option"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "host-ref",
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "Where rendered children land. Unset = this element's light DOM. <code>shadow</code> attaches an open shadow root. <code>iframe</code> paints into a child <code><iframe data-render-host></code> body (you supply the iframe — useful for sandboxed / third-party document isolation). Any other value is a portal selector.",
|
|
59
|
+
"fieldName": "hostRef",
|
|
60
|
+
"surface": "option",
|
|
61
|
+
"values": "\"shadow\" | \"iframe\" | <CSS Selector>",
|
|
62
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "is-fallback",
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"description": "Only activate when this route matches <em>and</em> no earlier sibling <code><spa-route></code> is already active. Pair with a permissive <code>route-regex</code> (e.g. <code>.*</code>) for 404 catch-alls.",
|
|
68
|
+
"fieldName": "isFallback",
|
|
69
|
+
"surface": "option"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "match-nested",
|
|
73
|
+
"type": "boolean",
|
|
74
|
+
"description": "Also match nested paths of <code>route-href</code> (e.g. <code>/users</code> stays active on <code>/users/42</code>). Essential for layout routes and nested SPAs.",
|
|
75
|
+
"fieldName": "matchNested",
|
|
76
|
+
"surface": "option",
|
|
77
|
+
"inheritedFrom": "@excom/routable-element"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "no-transition",
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"description": "Opt this route out of the parent <code><spa-manager></code> View Transition. Still renders/unrenders — just without the cross-fade.",
|
|
83
|
+
"fieldName": "noTransition",
|
|
84
|
+
"surface": "option"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "persist-content",
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"description": "Reuse the same live nodes across unrender / render (held on <code>_persistedTree</code>) so form values, scroll position, and subtree state survive toggles.",
|
|
90
|
+
"fieldName": "persistContent",
|
|
91
|
+
"surface": "option",
|
|
92
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "pre-fetch",
|
|
96
|
+
"type": "string",
|
|
97
|
+
"description": "When to fetch the template, independent of when it renders. <code>""</code> aliases <code>eager</code>.",
|
|
98
|
+
"fieldName": "preFetch",
|
|
99
|
+
"surface": "option",
|
|
100
|
+
"default": "\"lazy\"",
|
|
101
|
+
"values": "\"\" | \"eager\" | \"idle\" | \"lazy\"",
|
|
102
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "ready-on",
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "Event name that marks rendered children "ready". Until it fires, <code>delaying-ready</code> is set so CSS can hide the host for a coordinated paint / view transition.",
|
|
108
|
+
"fieldName": "readyOn",
|
|
109
|
+
"surface": "option",
|
|
110
|
+
"values": "<Event Name>",
|
|
111
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "route-href",
|
|
115
|
+
"type": "string",
|
|
116
|
+
"description": "URL pattern to match. Supports named placeholders (<code>/users/:id</code>) and wildcards. Set this or <code>route-regex</code>.",
|
|
117
|
+
"fieldName": "routeHref",
|
|
118
|
+
"surface": "option",
|
|
119
|
+
"values": "<path pattern>",
|
|
120
|
+
"inheritedFrom": "@excom/routable-element"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "route-regex",
|
|
124
|
+
"type": "string",
|
|
125
|
+
"description": "RegExp source string matched against the current URL — alternative to <code>route-href</code> for catch-alls / advanced patterns.",
|
|
126
|
+
"fieldName": "routeRegex",
|
|
127
|
+
"surface": "option",
|
|
128
|
+
"values": "<RegExp source>",
|
|
129
|
+
"inheritedFrom": "@excom/routable-element"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "same-route",
|
|
133
|
+
"type": "string",
|
|
134
|
+
"description": "When this route matches while already active, <code>reuse</code> keeps the rendered tree and updates route data; <code>refresh</code> tears down and re-renders. Use <code>refresh</code> for param-driven screens (e.g. <code>/users/:id</code> → <code>/users/2</code>); <code>reuse</code> when only route data should change (e.g. <code>/logs/:view</code>). Pair with <code>scroll-set-disabled</code> to leave the viewport untouched.",
|
|
135
|
+
"fieldName": "sameRoute",
|
|
136
|
+
"surface": "option",
|
|
137
|
+
"default": "\"reuse\"",
|
|
138
|
+
"values": "\"reuse\" | \"refresh\""
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "scroll-reset-behavior",
|
|
142
|
+
"type": "string",
|
|
143
|
+
"description": "<code>window.scrollTo</code> behavior when this route applies a scroll reset / restore.",
|
|
144
|
+
"fieldName": "scrollResetBehavior",
|
|
145
|
+
"surface": "option",
|
|
146
|
+
"default": "\"instant\"",
|
|
147
|
+
"values": "\"auto\" | \"instant\" | \"smooth\""
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "scroll-reset-x",
|
|
151
|
+
"type": "tokenlist",
|
|
152
|
+
"description": "Navigation moves that reset scroll X to <code>0</code>. Moves omitted here restore the saved X for that history entry instead.",
|
|
153
|
+
"fieldName": "scrollResetX",
|
|
154
|
+
"surface": "option",
|
|
155
|
+
"default": "\"push replace\"",
|
|
156
|
+
"values": "\"push\" | \"replace\" | \"back\" | \"forward\""
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "scroll-reset-y",
|
|
160
|
+
"type": "tokenlist",
|
|
161
|
+
"description": "Navigation moves that reset scroll Y to <code>0</code>. Moves omitted here restore the saved Y for that history entry instead.",
|
|
162
|
+
"fieldName": "scrollResetY",
|
|
163
|
+
"surface": "option",
|
|
164
|
+
"default": "\"push replace\"",
|
|
165
|
+
"values": "\"push\" | \"replace\" | \"back\" | \"forward\""
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "scroll-set-disabled",
|
|
169
|
+
"type": "boolean",
|
|
170
|
+
"description": "Disable all scroll reset / restore for this route.",
|
|
171
|
+
"fieldName": "scrollSetDisabled",
|
|
172
|
+
"surface": "option"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "template-ref",
|
|
176
|
+
"type": "string",
|
|
177
|
+
"description": "Source <code><template></code> — in-document selector or remote URL. Changing mid-flight aborts and reloads. Can use <code>:scope</code> to relatively select elements: e.g. <code>main:has(:scope) > template</code>",
|
|
178
|
+
"fieldName": "templateRef",
|
|
179
|
+
"surface": "option",
|
|
180
|
+
"default": "\":scope > template\"",
|
|
181
|
+
"values": "<CSS Selector> | <URL>",
|
|
182
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "is-active",
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"description": "Master switch. Set to load (if needed) and render; unset to unrender. Drive from visibility, route match, hover, etc.",
|
|
188
|
+
"fieldName": "isActive",
|
|
189
|
+
"surface": "hybrid",
|
|
190
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "delaying-ready",
|
|
194
|
+
"type": "boolean",
|
|
195
|
+
"description": "Between <code>render</code> and the matching <code>ready-on</code> event. Hook with CSS for coordinated paints / view transitions.",
|
|
196
|
+
"fieldName": "delayingReady",
|
|
197
|
+
"surface": "state",
|
|
198
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "did-load",
|
|
202
|
+
"type": "boolean",
|
|
203
|
+
"description": "Template resolved at least once. Stays set across <code>is-active</code> toggles so consumers know later paints are warm (URL refs reuse the shared fetch cache in kit-utils). Cleared when <code>template-ref</code> changes or <code>--reload</code> forces a fresh resolve.",
|
|
204
|
+
"fieldName": "didLoad",
|
|
205
|
+
"surface": "state",
|
|
206
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "is-error",
|
|
210
|
+
"type": "boolean",
|
|
211
|
+
"description": "Latest template fetch rejected (excluding abort). Fires with the <code>error</code> event.",
|
|
212
|
+
"fieldName": "isError",
|
|
213
|
+
"surface": "state",
|
|
214
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "is-loading",
|
|
218
|
+
"type": "boolean",
|
|
219
|
+
"description": "Template fetch in flight.",
|
|
220
|
+
"fieldName": "isLoading",
|
|
221
|
+
"surface": "state",
|
|
222
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"name": "was-active",
|
|
226
|
+
"type": "boolean",
|
|
227
|
+
"description": "Set briefly while navigating away. Style outgoing screens / card-expansion exits with <code>spa-route[was-active]</code>.",
|
|
228
|
+
"fieldName": "wasActive",
|
|
229
|
+
"surface": "state"
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"events": [
|
|
233
|
+
{
|
|
234
|
+
"name": "spa-route-aborted",
|
|
235
|
+
"description": "Dispatched when an in-flight load / ready wait is canceled because <code>is-active</code> was unset (via <code>startTeardown</code>).",
|
|
236
|
+
"type": "RenderableAbortedEvent",
|
|
237
|
+
"typeExpanded": "CustomEvent & { type: \"{tag}-aborted\"; detail: void; bubbles: true; cancelable: true; composed: true }",
|
|
238
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "spa-route-did-render",
|
|
242
|
+
"description": "Dispatched after the template content has actually been placed into the host.",
|
|
243
|
+
"type": "RenderableDidRenderEvent",
|
|
244
|
+
"typeExpanded": "CustomEvent & { type: \"{tag}-did-render\"; detail: void; bubbles: true; cancelable: true; composed: true }",
|
|
245
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"name": "spa-route-did-unrender",
|
|
249
|
+
"description": "Dispatched after rendered children have been removed from the host.",
|
|
250
|
+
"type": "RenderableDidUnrenderEvent",
|
|
251
|
+
"typeExpanded": "CustomEvent & { type: \"{tag}-did-unrender\"; detail: void; bubbles: true; cancelable: true; composed: true }",
|
|
252
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "spa-route-error",
|
|
256
|
+
"description": "Dispatched when the template promise rejects with anything other than an <code>AbortError</code>.",
|
|
257
|
+
"type": "RenderableErrorEvent",
|
|
258
|
+
"typeExpanded": "CustomEvent & { type: \"{tag}-error\"; detail: void; bubbles: true; cancelable: true; composed: true }",
|
|
259
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": "spa-route-provision",
|
|
263
|
+
"description": "Cancelable. Same route stayed active but params changed (<code>same-route="reuse"</code>). <code>event.detail</code> is a thunk that updates route data and resolves the ready promise. <code><spa-manager></code> batches this into the View Transition like render/unrender.",
|
|
264
|
+
"type": "SpaRouteProvisionEvent",
|
|
265
|
+
"typeExpanded": "CustomEvent & { type: \"spa-route-provision\"; detail: () => void; bubbles: true; cancelable: true; composed: true }",
|
|
266
|
+
"defaultAction": "Invokes <code>event.detail()</code> to apply the new provision."
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "spa-route-render",
|
|
270
|
+
"description": "Cancelable. Dispatched when the element becomes active and is about to place template content into the host. <code>event.detail</code> is a thunk that performs the load (if not already loaded) and renders the children, returning a Promise that resolves once the corresponding <code>ready-on</code> event fires (or immediately if <code>ready-on</code> is unset). The promise rejects if the element is torn down mid-flight (<code>startTeardown</code> while loading / <code>delaying-ready</code>). Call <code>preventDefault()</code> to defer rendering and invoke <code>event.detail()</code> later.",
|
|
271
|
+
"type": "RenderableRenderEvent",
|
|
272
|
+
"typeExpanded": "CustomEvent & { type: \"{tag}-render\"; detail: () => Promise<void>; bubbles: true; cancelable: true; composed: true }",
|
|
273
|
+
"inheritedFrom": "@excom/renderable-element",
|
|
274
|
+
"defaultAction": "Invokes <code>event.detail()</code> to load (if needed) and render the template into the host."
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"name": "spa-route-unrender",
|
|
278
|
+
"description": "Cancelable. Dispatched when the element becomes inactive and content is already painted. <code>event.detail</code> is a thunk that removes the rendered children. Call <code>preventDefault()</code> to defer the removal. Not fired when teardown cancels an in-flight load — that path emits <code>aborted</code> instead.",
|
|
279
|
+
"type": "RenderableUnrenderEvent",
|
|
280
|
+
"typeExpanded": "CustomEvent & { type: \"{tag}-unrender\"; detail: () => void; bubbles: true; cancelable: true; composed: true }",
|
|
281
|
+
"inheritedFrom": "@excom/renderable-element",
|
|
282
|
+
"defaultAction": "Invokes <code>event.detail()</code> to remove rendered children from the host."
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
"slots": [],
|
|
286
|
+
"cssProperties": [],
|
|
287
|
+
"cssClasses": [],
|
|
288
|
+
"cssAliases": [
|
|
289
|
+
{
|
|
290
|
+
"name": ":--spa-route",
|
|
291
|
+
"selectors": [
|
|
292
|
+
"spa-route",
|
|
293
|
+
".tag-spa-route"
|
|
294
|
+
],
|
|
295
|
+
"kind": "element",
|
|
296
|
+
"description": ""
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"listens": [],
|
|
300
|
+
"commands": [
|
|
301
|
+
{
|
|
302
|
+
"name": "--reload",
|
|
303
|
+
"description": "Aborts any in-flight fetch and re-resolves the template, bypassing the cache for URL refs (useful after remote content changes).",
|
|
304
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
305
|
+
}
|
|
306
|
+
],
|
|
307
|
+
"defaultActions": [
|
|
308
|
+
{
|
|
309
|
+
"name": "spa-route-provision",
|
|
310
|
+
"description": "Invokes <code>event.detail()</code> to apply the new provision."
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "spa-route-render",
|
|
314
|
+
"description": "Invokes <code>event.detail()</code> to load (if needed) and render the template into the host.",
|
|
315
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"name": "spa-route-unrender",
|
|
319
|
+
"description": "Invokes <code>event.detail()</code> to remove rendered children from the host.",
|
|
320
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"expectedChildren": [
|
|
324
|
+
{
|
|
325
|
+
"name": "child:iframe[data-render-host]",
|
|
326
|
+
"relationship": "child",
|
|
327
|
+
"selector": "iframe[data-render-host]",
|
|
328
|
+
"required": false,
|
|
329
|
+
"description": "Required when <code>host-ref="iframe"</code>. Content paints into <code>iframe.contentDocument.body</code>. Provide your own iframe (e.g. with <code>srcdoc</code>); the element will not create one.",
|
|
330
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"name": "child:template",
|
|
334
|
+
"relationship": "child",
|
|
335
|
+
"selector": "template",
|
|
336
|
+
"required": true,
|
|
337
|
+
"description": "Screen content. Cloned (or reused with <code>persist-content</code>) on activation."
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"name": "child:template",
|
|
341
|
+
"relationship": "child",
|
|
342
|
+
"selector": "template",
|
|
343
|
+
"required": false,
|
|
344
|
+
"description": "Optional immediate <code><template></code> child used when <code>template-ref</code> is the default <code>":scope > template"</code>. Not required when <code>template-ref</code> points at a selector or URL elsewhere.",
|
|
345
|
+
"inheritedFrom": "@excom/renderable-element"
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"provisions": [
|
|
349
|
+
{
|
|
350
|
+
"name": "provision",
|
|
351
|
+
"type": "SpaRouteProvision",
|
|
352
|
+
"typeExpanded": "{ routeHref: string; matchNested: boolean; scrollResetY: string[]; scrollResetX: string[]; scrollResetBehavior: ScrollBehavior; noTransition: boolean; active: { id: string; url: string; title?: string; isInit?: boolean; scrollX?: number; scrollY?: number; ttypes?: string[]; }; event: { hasUAVisualTransition: boolean; }; match: Array<any> | null; move: null | \"push\" | \"replace\" | \"back\" | \"forward\"; next: { id: string; url: string; title?: string; isInit?: boolean; scrollX?: number; scrollY?: number; ttypes?: string[]; } | null; previous: { id: string; url: string; title?: string; isInit?: boolean; scrollX?: number; scrollY?: number; ttypes?: string[]; } | null; params: Record<string, string> | null; }",
|
|
353
|
+
"description": "Active route payload for this activation (<code>null</code> when inactive). Not reflected as an attribute.",
|
|
354
|
+
"fieldName": "provision"
|
|
355
|
+
}
|
|
356
|
+
]
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"tag": "spa-a",
|
|
360
|
+
"summary": "Declarative SPA link with active-state styling.",
|
|
361
|
+
"kind": "class",
|
|
362
|
+
"attributes": [
|
|
363
|
+
{
|
|
364
|
+
"name": "delay-ms",
|
|
365
|
+
"type": "number",
|
|
366
|
+
"description": "Delay handling by this many milliseconds.",
|
|
367
|
+
"fieldName": "delayMs",
|
|
368
|
+
"surface": "option",
|
|
369
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"name": "document-title",
|
|
373
|
+
"type": "string",
|
|
374
|
+
"description": "Sets <code>document.title</code> after navigation.",
|
|
375
|
+
"fieldName": "documentTitle",
|
|
376
|
+
"surface": "option"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"name": "host-ref",
|
|
380
|
+
"type": "string",
|
|
381
|
+
"description": "Listen on another element / <code>window</code> / <code>document</code> — e.g. Escape to dismiss a dialog from a global <code>keydown</code>. Defaults to <code>:scope</code>. Used with <code>listen-for</code>. Not compatible with <code>listen-for-lifecycle</code>. The selector MUST resolve when <code>host-ref</code> is set — it will not wait for a match to appear.",
|
|
382
|
+
"fieldName": "hostRef",
|
|
383
|
+
"surface": "option",
|
|
384
|
+
"values": "<CSS Selector> | \"window\" | \"document\" | \"html\" | \"body\" | \"head\"",
|
|
385
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "is-debounced",
|
|
389
|
+
"type": "boolean",
|
|
390
|
+
"description": "With <code>delay-ms</code>, coalesce bursts into one trailing call (debounce).",
|
|
391
|
+
"fieldName": "isDebounced",
|
|
392
|
+
"surface": "option",
|
|
393
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"name": "keycode-filter",
|
|
397
|
+
"type": "tokenlist",
|
|
398
|
+
"description": "Space-separated key filters (OR). Join modifiers with <code>+</code> (AND, any order): <code>shift+k tab</code> → Shift+K or Tab. Modifiers: <code>shift</code>, <code>alt</code>, <code>ctrl</code>/<code>control</code>, <code>meta</code>. Case-insensitive.",
|
|
399
|
+
"fieldName": "keycodeFilter",
|
|
400
|
+
"surface": "option",
|
|
401
|
+
"values": "<key | mod+key>…",
|
|
402
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"name": "listen-for",
|
|
406
|
+
"type": "tokenlist",
|
|
407
|
+
"description": "Space-separated event names to listen for. Defaults to <code>click</code> when unset (and no lifecycle list is set).",
|
|
408
|
+
"fieldName": "listenFor",
|
|
409
|
+
"surface": "option",
|
|
410
|
+
"values": "<EventName>…",
|
|
411
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"name": "listen-for-lifecycle",
|
|
415
|
+
"type": "tokenlist",
|
|
416
|
+
"description": "Space-separated element lifecycles to handle.",
|
|
417
|
+
"fieldName": "listenForLifecycle",
|
|
418
|
+
"surface": "option",
|
|
419
|
+
"values": "\"connected\" | \"disconnected\" | \"adopted\"",
|
|
420
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"name": "listen-once",
|
|
424
|
+
"type": "boolean",
|
|
425
|
+
"description": "Handle each distinct event name / lifecycle at most once.",
|
|
426
|
+
"fieldName": "listenOnce",
|
|
427
|
+
"surface": "option",
|
|
428
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"name": "match-hash",
|
|
432
|
+
"type": "boolean",
|
|
433
|
+
"description": "Require the URL hash to match when setting <code>is-active</code>.",
|
|
434
|
+
"fieldName": "matchHash",
|
|
435
|
+
"surface": "option"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"name": "match-nested",
|
|
439
|
+
"type": "boolean",
|
|
440
|
+
"description": "Also match nested paths of <code>route-href</code> (e.g. <code>/users</code> stays active on <code>/users/42</code>). Essential for layout routes and nested SPAs.",
|
|
441
|
+
"fieldName": "matchNested",
|
|
442
|
+
"surface": "option",
|
|
443
|
+
"inheritedFrom": "@excom/routable-element"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"name": "pathname-filter",
|
|
447
|
+
"type": "tokenlist",
|
|
448
|
+
"description": "Only handle when <code>location.pathname</code> is one of these values — route-aware behaviors without a separate router element.",
|
|
449
|
+
"fieldName": "pathnameFilter",
|
|
450
|
+
"surface": "option",
|
|
451
|
+
"values": "<pathname>…",
|
|
452
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"name": "prevent-default",
|
|
456
|
+
"type": "boolean",
|
|
457
|
+
"description": "Call <code>preventDefault()</code> on matched events (ignored for lifecycles).",
|
|
458
|
+
"fieldName": "preventDefault",
|
|
459
|
+
"surface": "option",
|
|
460
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"name": "route-action",
|
|
464
|
+
"type": "string",
|
|
465
|
+
"description": "Navigation mode when activated (default click).",
|
|
466
|
+
"fieldName": "routeAction",
|
|
467
|
+
"surface": "option",
|
|
468
|
+
"default": "\"push\"",
|
|
469
|
+
"values": "\"push\" | \"replace\" | \"back\" | \"forward\""
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"name": "route-href",
|
|
473
|
+
"type": "string",
|
|
474
|
+
"description": "URL pattern to match. Supports named placeholders (<code>/users/:id</code>) and wildcards. Set this or <code>route-regex</code>.",
|
|
475
|
+
"fieldName": "routeHref",
|
|
476
|
+
"surface": "option",
|
|
477
|
+
"values": "<path pattern>",
|
|
478
|
+
"inheritedFrom": "@excom/routable-element"
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"name": "route-regex",
|
|
482
|
+
"type": "string",
|
|
483
|
+
"description": "RegExp source string matched against the current URL — alternative to <code>route-href</code> for catch-alls / advanced patterns.",
|
|
484
|
+
"fieldName": "routeRegex",
|
|
485
|
+
"surface": "option",
|
|
486
|
+
"values": "<RegExp source>",
|
|
487
|
+
"inheritedFrom": "@excom/routable-element"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"name": "selector-filter",
|
|
491
|
+
"type": "string",
|
|
492
|
+
"description": "Only handle events whose <code>event.target</code> matches this CSS selector. Does not support <code>:scope</code> in the selector.",
|
|
493
|
+
"fieldName": "selectorFilter",
|
|
494
|
+
"surface": "option",
|
|
495
|
+
"values": "<CSS Selector>",
|
|
496
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"name": "stop-immediate-propagation",
|
|
500
|
+
"type": "boolean",
|
|
501
|
+
"description": "Call <code>stopImmediatePropagation()</code> on matched events (ignored for lifecycles).",
|
|
502
|
+
"fieldName": "stopImmediatePropagation",
|
|
503
|
+
"surface": "option",
|
|
504
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"name": "stop-propagation",
|
|
508
|
+
"type": "boolean",
|
|
509
|
+
"description": "Call <code>stopPropagation()</code> on matched events (ignored for lifecycles).",
|
|
510
|
+
"fieldName": "stopPropagation",
|
|
511
|
+
"surface": "option",
|
|
512
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"name": "transition-types",
|
|
516
|
+
"type": "tokenlist",
|
|
517
|
+
"description": "Space-separated View Transition types for this navigation (CSS View Transitions API). Useful for shared-element morphs like card expansion.",
|
|
518
|
+
"fieldName": "transitionTypes",
|
|
519
|
+
"surface": "option",
|
|
520
|
+
"values": "<token>…"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
"name": "vibrate-ms",
|
|
524
|
+
"type": "number",
|
|
525
|
+
"description": "Vibrate on handle (<code>navigator.vibrate</code>). Empty / <code>0</code> uses a 20ms pulse.",
|
|
526
|
+
"fieldName": "vibrateMs",
|
|
527
|
+
"surface": "option",
|
|
528
|
+
"default": "\"20 (when attribute is present with no value)\"",
|
|
529
|
+
"inheritedFrom": "@excom/listenable-element"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"name": "is-active",
|
|
533
|
+
"type": "boolean",
|
|
534
|
+
"description": "Current URL matches <code>route-href</code>. Style with <code>spa-a[is-active]</code>.",
|
|
535
|
+
"fieldName": "isActive",
|
|
536
|
+
"surface": "state"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"name": "was-active",
|
|
540
|
+
"type": "boolean",
|
|
541
|
+
"description": "Previous URL matched <code>route-href</code>. Style outgoing links / card-expansion exits with <code>spa-a[was-active]</code>.",
|
|
542
|
+
"fieldName": "wasActive",
|
|
543
|
+
"surface": "state"
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
"events": [],
|
|
547
|
+
"slots": [],
|
|
548
|
+
"cssProperties": [],
|
|
549
|
+
"cssClasses": [],
|
|
550
|
+
"cssAliases": [
|
|
551
|
+
{
|
|
552
|
+
"name": ":--spa-a",
|
|
553
|
+
"selectors": [
|
|
554
|
+
"spa-a",
|
|
555
|
+
".tag-spa-a"
|
|
556
|
+
],
|
|
557
|
+
"kind": "element",
|
|
558
|
+
"description": ""
|
|
559
|
+
}
|
|
560
|
+
],
|
|
561
|
+
"listens": [],
|
|
562
|
+
"commands": [],
|
|
563
|
+
"defaultActions": [],
|
|
564
|
+
"expectedChildren": [],
|
|
565
|
+
"provisions": []
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"tag": "spa-manager",
|
|
569
|
+
"summary": "SPA shell — view transitions, swipe nav, route orchestration.",
|
|
570
|
+
"kind": "class",
|
|
571
|
+
"attributes": [
|
|
572
|
+
{
|
|
573
|
+
"name": "match-nested",
|
|
574
|
+
"type": "boolean",
|
|
575
|
+
"description": "Also match nested paths of <code>route-href</code> (e.g. <code>/users</code> stays active on <code>/users/42</code>). Essential for layout routes and nested SPAs.",
|
|
576
|
+
"fieldName": "matchNested",
|
|
577
|
+
"surface": "option",
|
|
578
|
+
"inheritedFrom": "@excom/routable-element"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"name": "max-states",
|
|
582
|
+
"type": "number",
|
|
583
|
+
"description": "Cap retained router history states (scroll positions, transition types, etc.).",
|
|
584
|
+
"fieldName": "maxStates",
|
|
585
|
+
"surface": "option"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"name": "no-transition",
|
|
589
|
+
"type": "boolean",
|
|
590
|
+
"description": "Disable View Transitions for every child route.",
|
|
591
|
+
"fieldName": "noTransition",
|
|
592
|
+
"surface": "option"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"name": "overscroll-behavior-x",
|
|
596
|
+
"type": "string",
|
|
597
|
+
"description": "Touch edge-swipe on touch devices. <code>none</code> blocks horizontal overscroll; <code>navigate</code> also calls back / forward past the threshold.",
|
|
598
|
+
"fieldName": "overscrollBehaviorX",
|
|
599
|
+
"surface": "option",
|
|
600
|
+
"values": "\"none\" | \"navigate\""
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"name": "overscroll-x-threshold",
|
|
604
|
+
"type": "number",
|
|
605
|
+
"description": "Edge inset (px) where a touch start counts as an edge swipe.",
|
|
606
|
+
"fieldName": "overscrollXThreshold",
|
|
607
|
+
"surface": "option",
|
|
608
|
+
"default": "40"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"name": "render-timeout",
|
|
612
|
+
"type": "number",
|
|
613
|
+
"description": "Max wait (ms) for child render promises before forcing the transition to resolve. Raise for slow remote templates.",
|
|
614
|
+
"fieldName": "renderTimeout",
|
|
615
|
+
"surface": "option",
|
|
616
|
+
"default": "2000"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"name": "route-href",
|
|
620
|
+
"type": "string",
|
|
621
|
+
"description": "URL pattern to match. Supports named placeholders (<code>/users/:id</code>) and wildcards. Set this or <code>route-regex</code>.",
|
|
622
|
+
"fieldName": "routeHref",
|
|
623
|
+
"surface": "option",
|
|
624
|
+
"values": "<path pattern>",
|
|
625
|
+
"inheritedFrom": "@excom/routable-element"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"name": "route-regex",
|
|
629
|
+
"type": "string",
|
|
630
|
+
"description": "RegExp source string matched against the current URL — alternative to <code>route-href</code> for catch-alls / advanced patterns.",
|
|
631
|
+
"fieldName": "routeRegex",
|
|
632
|
+
"surface": "option",
|
|
633
|
+
"values": "<RegExp source>",
|
|
634
|
+
"inheritedFrom": "@excom/routable-element"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"name": "transition-delay",
|
|
638
|
+
"type": "number",
|
|
639
|
+
"description": "Delay (ms) before starting the batched View Transition. Gives late sibling render/unrender events time to queue, or room for last-second DOM work. Unset / <code>null</code> starts synchronously.",
|
|
640
|
+
"fieldName": "transitionDelay",
|
|
641
|
+
"surface": "option"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"name": "transition-first-render",
|
|
645
|
+
"type": "boolean",
|
|
646
|
+
"description": "Animate the very first activation (cold load) with a View Transition. Off by default so the initial paint is instant.",
|
|
647
|
+
"fieldName": "transitionFirstRender",
|
|
648
|
+
"surface": "option"
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"name": "active-url",
|
|
652
|
+
"type": "string",
|
|
653
|
+
"description": "URL of the currently active route.",
|
|
654
|
+
"fieldName": "activeUrl",
|
|
655
|
+
"surface": "state"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"name": "has-rendered",
|
|
659
|
+
"type": "boolean",
|
|
660
|
+
"description": "At least one render has committed. Gates <code>transition-first-render</code>; useful for hiding loading shells.",
|
|
661
|
+
"fieldName": "hasRendered",
|
|
662
|
+
"surface": "state"
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
"name": "is-transitioning",
|
|
666
|
+
"type": "boolean",
|
|
667
|
+
"description": "A View Transition is in flight.",
|
|
668
|
+
"fieldName": "isTransitioning",
|
|
669
|
+
"surface": "state"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"name": "last-move",
|
|
673
|
+
"type": "string",
|
|
674
|
+
"description": "Last navigation direction (<code>push</code> / <code>replace</code> / <code>back</code> / <code>forward</code>). Pick CSS transition styles from this.",
|
|
675
|
+
"fieldName": "lastMove",
|
|
676
|
+
"surface": "state",
|
|
677
|
+
"values": "\"push\" | \"replace\" | \"back\" | \"forward\""
|
|
678
|
+
}
|
|
679
|
+
],
|
|
680
|
+
"events": [
|
|
681
|
+
{
|
|
682
|
+
"name": "spa-manager-back",
|
|
683
|
+
"description": "On <code>back</code> navigations.",
|
|
684
|
+
"type": "SpaManagerBackEvent",
|
|
685
|
+
"typeExpanded": "CustomEvent & { type: \"spa-manager-back\"; detail: void; bubbles: true; cancelable: true; composed: true }"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"name": "spa-manager-error",
|
|
689
|
+
"description": "Re-emitted when a child fires <code>spa-route-error</code>. <code>event.detail</code> mirrors the source error.",
|
|
690
|
+
"type": "SpaManagerErrorEvent",
|
|
691
|
+
"typeExpanded": "CustomEvent & { type: \"spa-manager-error\"; detail: unknown; bubbles: true; cancelable: true; composed: true }"
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"name": "spa-manager-forward",
|
|
695
|
+
"description": "On <code>forward</code> navigations.",
|
|
696
|
+
"type": "SpaManagerForwardEvent",
|
|
697
|
+
"typeExpanded": "CustomEvent & { type: \"spa-manager-forward\"; detail: void; bubbles: true; cancelable: true; composed: true }"
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
"name": "spa-manager-push",
|
|
701
|
+
"description": "On <code>pushState</code> navigations.",
|
|
702
|
+
"type": "SpaManagerPushEvent",
|
|
703
|
+
"typeExpanded": "CustomEvent & { type: \"spa-manager-push\"; detail: void; bubbles: true; cancelable: true; composed: true }"
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
"name": "spa-manager-rendered",
|
|
707
|
+
"description": "After the transition (or synchronous fallback) finishes and routes are settled.",
|
|
708
|
+
"type": "SpaManagerRenderedEvent",
|
|
709
|
+
"typeExpanded": "CustomEvent & { type: \"spa-manager-rendered\"; detail: void; bubbles: true; cancelable: true; composed: true }"
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
"name": "spa-manager-replace",
|
|
713
|
+
"description": "On <code>replaceState</code> navigations.",
|
|
714
|
+
"type": "SpaManagerReplaceEvent",
|
|
715
|
+
"typeExpanded": "CustomEvent & { type: \"spa-manager-replace\"; detail: void; bubbles: true; cancelable: true; composed: true }"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"name": "spa-manager-transition",
|
|
719
|
+
"description": "After <code>document.startViewTransition()</code> is called.",
|
|
720
|
+
"type": "SpaManagerTransitionEvent",
|
|
721
|
+
"typeExpanded": "CustomEvent & { type: \"spa-manager-transition\"; detail: { transition: ViewTransition; }; bubbles: true; cancelable: true; composed: true }"
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
"name": "spa-manager-will-transition",
|
|
725
|
+
"description": "Cancelable. Once per navigation, just before the View Transition starts. <code>preventDefault()</code> skips the transition for this navigation.",
|
|
726
|
+
"type": "SpaManagerWillTransitionEvent",
|
|
727
|
+
"typeExpanded": "CustomEvent & { type: \"spa-manager-will-transition\"; detail: void; bubbles: true; cancelable: true; composed: true }",
|
|
728
|
+
"defaultAction": "Starts the batched View Transition (or synchronous update when transitions are unavailable / opted out)."
|
|
729
|
+
}
|
|
730
|
+
],
|
|
731
|
+
"slots": [],
|
|
732
|
+
"cssProperties": [],
|
|
733
|
+
"cssClasses": [],
|
|
734
|
+
"cssAliases": [],
|
|
735
|
+
"listens": [
|
|
736
|
+
{
|
|
737
|
+
"name": "spa-route-error",
|
|
738
|
+
"description": "Falls back to a non-transitioned update and re-emits as <code>spa-manager-error</code>.",
|
|
739
|
+
"type": "RenderableErrorEvent",
|
|
740
|
+
"typeExpanded": "CustomEvent & { type: \"{tag}-error\"; detail: void; bubbles: true; cancelable: true; composed: true }"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"name": "spa-route-provision",
|
|
744
|
+
"description": "Queues a same-route param update (reuse) into the next batched transition.",
|
|
745
|
+
"type": "SpaRouteProvisionEvent",
|
|
746
|
+
"typeExpanded": "CustomEvent & { type: \"spa-route-provision\"; detail: () => void; bubbles: true; cancelable: true; composed: true }"
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
"name": "spa-route-render",
|
|
750
|
+
"description": "Queues the child's render callback for the next batched transition.",
|
|
751
|
+
"type": "RenderableRenderEvent",
|
|
752
|
+
"typeExpanded": "CustomEvent & { type: \"{tag}-render\"; detail: () => Promise<void>; bubbles: true; cancelable: true; composed: true }"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
"name": "spa-route-unrender",
|
|
756
|
+
"description": "Queues the child's unrender callback (runs before renders so the outgoing route leaves first).",
|
|
757
|
+
"type": "RenderableUnrenderEvent",
|
|
758
|
+
"typeExpanded": "CustomEvent & { type: \"{tag}-unrender\"; detail: () => void; bubbles: true; cancelable: true; composed: true }"
|
|
759
|
+
}
|
|
760
|
+
],
|
|
761
|
+
"commands": [],
|
|
762
|
+
"defaultActions": [
|
|
763
|
+
{
|
|
764
|
+
"name": "spa-manager-will-transition",
|
|
765
|
+
"description": "Starts the batched View Transition (or synchronous update when transitions are unavailable / opted out)."
|
|
766
|
+
}
|
|
767
|
+
],
|
|
768
|
+
"expectedChildren": [
|
|
769
|
+
{
|
|
770
|
+
"name": "descendant:spa-route",
|
|
771
|
+
"relationship": "descendant",
|
|
772
|
+
"selector": "spa-route",
|
|
773
|
+
"required": true,
|
|
774
|
+
"description": "Routes this manager coordinates. Their render lifecycle is intercepted and batched into one view transition per navigation."
|
|
775
|
+
}
|
|
776
|
+
],
|
|
777
|
+
"provisions": [
|
|
778
|
+
{
|
|
779
|
+
"name": "provision",
|
|
780
|
+
"type": "KitRouteData",
|
|
781
|
+
"typeExpanded": "{ previous: { id: string; url: string; title?: string; isInit?: boolean; scrollX?: number; scrollY?: number; ttypes?: string[]; } | null; active: { id: string; url: string; title?: string; isInit?: boolean; scrollX?: number; scrollY?: number; ttypes?: string[]; }; next: { id: string; url: string; title?: string; isInit?: boolean; scrollX?: number; scrollY?: number; ttypes?: string[]; } | null; all: { id: string; url: string; title?: string; isInit?: boolean; scrollX?: number; scrollY?: number; ttypes?: string[]; }[]; params: Record<string, string> | null; match: Array<any> | null; move: null | \"push\" | \"replace\" | \"back\" | \"forward\"; event?: { hasUAVisualTransition: boolean; }; route: KitRoute; }",
|
|
782
|
+
"description": "Current route payload. Not reflected as an attribute.",
|
|
783
|
+
"fieldName": "provision"
|
|
784
|
+
}
|
|
785
|
+
]
|
|
786
|
+
}
|
|
787
|
+
],
|
|
788
|
+
"exportedFiles": {}
|
|
789
|
+
}
|