sibujs 4.14.0 → 4.15.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/dist/browser.cjs +297 -45
- package/dist/browser.js +6 -7
- package/dist/build.cjs +2189 -573
- package/dist/build.js +16 -15
- package/dist/cdn.dev.global.js +13 -12
- package/dist/cdn.full.dev.global.js +14 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-RVR5NPFL.js → chunk-2VKTFA7C.js} +1 -1
- package/dist/{chunk-7ILEHTVX.js → chunk-4AEFGRYW.js} +1 -1
- package/dist/{chunk-4TQDTWWN.js → chunk-6IV5ZRG6.js} +5 -7
- package/dist/{chunk-GVAMIU6K.js → chunk-75EAQH3U.js} +2 -2
- package/dist/{chunk-TLS4NVIB.js → chunk-7JO7DPSS.js} +4 -4
- package/dist/{chunk-SVULV7O4.js → chunk-AQH7WDSE.js} +6 -8
- package/dist/{chunk-S37PZD6I.js → chunk-BF3WBJJQ.js} +60 -10
- package/dist/{chunk-LJMX4SQ7.js → chunk-BG4BP44S.js} +3 -3
- package/dist/{chunk-N7A6FKWW.js → chunk-D44TAGCT.js} +2 -2
- package/dist/{chunk-CCKUNHVU.js → chunk-DAEXQJQA.js} +1 -1
- package/dist/chunk-DNCQDFJJ.js +22 -0
- package/dist/{chunk-BKZ5N6NK.js → chunk-DNCT2UXB.js} +4 -4
- package/dist/{chunk-BOYKGGVD.js → chunk-DRWOD7RZ.js} +4 -4
- package/dist/chunk-DS5V2PRE.js +64 -0
- package/dist/{chunk-VM2U5LEL.js → chunk-EHSJESRN.js} +595 -123
- package/dist/{chunk-MIRKTVH4.js → chunk-GFM5WWPU.js} +252 -5
- package/dist/{chunk-52XFPGSN.js → chunk-HTPOIAAL.js} +1 -1
- package/dist/{chunk-3HEX6QJQ.js → chunk-I2R5QALY.js} +2 -4
- package/dist/{chunk-4FJSAUKB.js → chunk-IUBV5WO5.js} +1 -1
- package/dist/{chunk-A454RAEK.js → chunk-KIDETDMU.js} +5 -7
- package/dist/{chunk-JTFQ7IL4.js → chunk-KPAXG5IR.js} +7 -9
- package/dist/{chunk-AE32RGWX.js → chunk-LGUXYHTZ.js} +3 -3
- package/dist/{chunk-Y4LUM2XS.js → chunk-LQWLPQOK.js} +6 -8
- package/dist/{chunk-CNPT6NKV.js → chunk-MINLMJUY.js} +48 -9
- package/dist/{chunk-BNXRWZZV.js → chunk-OURTGOJT.js} +8 -10
- package/dist/{chunk-F67F77IA.js → chunk-TQ24Y3IV.js} +2 -2
- package/dist/{chunk-2TTRW2TE.js → chunk-UM3M5PXS.js} +8 -8
- package/dist/{chunk-CJ7KS3DF.js → chunk-VSTX3XSX.js} +205 -15
- package/dist/{chunk-HQIAL7F2.js → chunk-XPDZ2LDR.js} +2 -2
- package/dist/{chunk-UUIKJJIK.js → chunk-Y7JM7GY2.js} +5 -7
- package/dist/{chunk-QS6GMWDD.js → chunk-YAFITBOK.js} +1269 -162
- package/dist/data.cjs +285 -33
- package/dist/data.js +6 -7
- package/dist/devtools.cjs +289 -39
- package/dist/devtools.js +5 -6
- package/dist/{dispose-EIHHHDC7.js → dispose-3WDBYJMH.js} +3 -1
- package/dist/ecosystem.cjs +345 -61
- package/dist/ecosystem.d.cts +1 -1
- package/dist/ecosystem.d.ts +1 -1
- package/dist/ecosystem.js +10 -10
- package/dist/extras.cjs +568 -248
- package/dist/extras.d.cts +1 -1
- package/dist/extras.d.ts +1 -1
- package/dist/extras.js +27 -27
- package/dist/index.cjs +2134 -515
- package/dist/index.d.cts +628 -211
- package/dist/index.d.ts +628 -211
- package/dist/index.js +22 -15
- package/dist/motion.cjs +286 -30
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +301 -43
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +286 -36
- package/dist/performance.js +9 -9
- package/dist/plugins.cjs +1237 -291
- package/dist/plugins.d.cts +3 -1
- package/dist/plugins.d.ts +3 -1
- package/dist/plugins.js +20 -19
- package/dist/{renderRoute-fxgsm2Ir.d.ts → renderRoute-B84MONaO.d.cts} +2 -2
- package/dist/{renderRoute-DP20XwMS.d.cts → renderRoute-_yxPuEQY.d.ts} +2 -2
- package/dist/{routeHead-CE9SV-cH.d.cts → routeHead-DLxlq15W.d.cts} +94 -0
- package/dist/{routeHead-DzVxPviY.d.ts → routeHead-w8nANZ3M.d.ts} +94 -0
- package/dist/{ssr-NECEU4X4.js → ssr-EF3IUHTE.js} +6 -6
- package/dist/ssr-dom.cjs +64 -9
- package/dist/ssr-dom.d.cts +2 -0
- package/dist/ssr-dom.d.ts +2 -0
- package/dist/ssr-dom.js +2 -1
- package/dist/ssr.cjs +850 -170
- package/dist/ssr.d.cts +5 -3
- package/dist/ssr.d.ts +5 -3
- package/dist/ssr.js +16 -15
- package/dist/{tagFactory-DkytnJws.d.cts → tagFactory-BfEh69VF.d.cts} +7 -0
- package/dist/{tagFactory-Bnd_Nph9.d.ts → tagFactory-pSYiLYyh.d.ts} +7 -0
- package/dist/testing.cjs +817 -132
- package/dist/testing.d.cts +4 -2
- package/dist/testing.d.ts +4 -2
- package/dist/testing.js +18 -17
- package/dist/track-core-0edROAF5.d.ts +187 -0
- package/dist/track-core-DN5fYLWi.d.cts +187 -0
- package/dist/ui.cjs +293 -43
- package/dist/ui.js +10 -12
- package/dist/widgets.cjs +285 -27
- package/dist/widgets.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-7ZHH77QA.js +0 -9
package/dist/plugins.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { L as LazyModule, M as Migration, a as MigrationStorageError, P as PackageExportTarget, S as SemVer, V as VERSION, b as bundlerMetadata, c as checkCompatibility, d as compareSemVer, e as createBootSequence, f as createBundle, g as createMigrationRunner, h as createModuleRegistry, i as createSSRCache, j as createTestHarness, k as deferNonCritical, l as env, m as healthCheck, n as lazyModule, p as packageInfo, o as parseSemVer, q as preloadCritical, r as prerenderRoutes, s as satisfies } from './startup-BLfSeL15.cjs';
|
|
2
2
|
import { A as Accessor } from './signal-EotCj4hS.cjs';
|
|
3
3
|
export { P as PluginContext, a as PluginInstallCancelledError, b as PluginRegistry, S as SibuPlugin, c as createPlugin, d as createPluginRegistry, i as inject, e as isPluginInstallCancelledError, p as plugin, r as resetPlugins, s as setDefaultPluginRegistry, t as triggerPluginError, f as triggerPluginMount, g as triggerPluginUnmount } from './plugin-DVgSnTfK.cjs';
|
|
4
|
-
export { A as AsyncComponent, b as AsyncRoute, C as Component, c as ComponentRoute, G as Guard, d as GuardResult, J as JsonLd, K as KeepAliveRoute, L as LazyComponent, e as LazyRoute, N as NavigationFailure, f as NavigationFailureReason, g as NavigationGuard, h as NavigationNext, i as NavigationQuery, j as NavigationResult, k as NavigationTarget, O as Outlet, P as Params, Q as QueryValues, l as RedirectRoute, m as ResolvedHeadTag, n as ResolvedRouteHead, o as Route, p as RouteBase, q as RouteContext, a as RouteDef, r as RouteHead, s as RouteHeadAlternate, t as RouteHeadOpenGraph, u as RouteHeadTwitter, v as RouteHeadValue, w as RouteMeta, x as RouteTransitionOptions, y as RouterHeadOptions, z as RouterLink, R as RouterOptions, B as RouterPlugin, S as ScrollBehavior, D as ScrollPosition, E as SibuRouter, F as Suspense, _ as __getNavigationEpoch, H as __removeRouterPagehideHandler, I as addRoute, M as afterEach, T as back, U as beforeEach, V as beforeResolve, W as buildURL, X as createMemoryRouter, Y as createRouter, Z as destroyRouter, $ as forward, a0 as getRouteInfo, a1 as getRouteTransition, a2 as go, a3 as hasRoute, a4 as jsonLdScript, a5 as lazy, a6 as navigate, a7 as preloadRoute, a8 as push, a9 as removeRoute, aa as replace, ab as resolveRouteHead, ac as route, ad as routeHeadToHTML, ae as router, af as routerPlugin, ag as routerReady, ah as routerState, ai as serializeJsonLd, aj as setRouteTransition, ak as setRoutes } from './routeHead-
|
|
4
|
+
export { A as AsyncComponent, b as AsyncRoute, C as Component, c as ComponentRoute, G as Guard, d as GuardResult, J as JsonLd, K as KeepAliveRoute, L as LazyComponent, e as LazyRoute, N as NavigationFailure, f as NavigationFailureReason, g as NavigationGuard, h as NavigationNext, i as NavigationQuery, j as NavigationResult, k as NavigationTarget, O as Outlet, P as Params, Q as QueryValues, l as RedirectRoute, m as ResolvedHeadTag, n as ResolvedRouteHead, o as Route, p as RouteBase, q as RouteContext, a as RouteDef, r as RouteHead, s as RouteHeadAlternate, t as RouteHeadOpenGraph, u as RouteHeadTwitter, v as RouteHeadValue, w as RouteMeta, x as RouteTransitionOptions, y as RouterHeadOptions, z as RouterLink, R as RouterOptions, B as RouterPlugin, S as ScrollBehavior, D as ScrollPosition, E as SibuRouter, F as Suspense, _ as __getNavigationEpoch, H as __removeRouterPagehideHandler, I as addRoute, M as afterEach, T as back, U as beforeEach, V as beforeResolve, W as buildURL, X as createMemoryRouter, Y as createRouter, Z as destroyRouter, $ as forward, a0 as getRouteInfo, a1 as getRouteTransition, a2 as go, a3 as hasRoute, a4 as jsonLdScript, a5 as lazy, a6 as navigate, a7 as preloadRoute, a8 as push, a9 as removeRoute, aa as replace, ab as resolveRouteHead, ac as route, ad as routeHeadToHTML, ae as router, af as routerPlugin, ag as routerReady, ah as routerState, ai as serializeJsonLd, aj as setRouteTransition, ak as setRoutes } from './routeHead-DLxlq15W.cjs';
|
|
5
5
|
import { T as TrustedHTML } from './ssr-JpGpHnpC.cjs';
|
|
6
6
|
import './types-CJFViL6Q.cjs';
|
|
7
|
+
import './track-core-DN5fYLWi.cjs';
|
|
8
|
+
import './signal-BnWpq6WB.cjs';
|
|
7
9
|
|
|
8
10
|
type Translations = Record<string, string>;
|
|
9
11
|
/**
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { L as LazyModule, M as Migration, a as MigrationStorageError, P as PackageExportTarget, S as SemVer, V as VERSION, b as bundlerMetadata, c as checkCompatibility, d as compareSemVer, e as createBootSequence, f as createBundle, g as createMigrationRunner, h as createModuleRegistry, i as createSSRCache, j as createTestHarness, k as deferNonCritical, l as env, m as healthCheck, n as lazyModule, p as packageInfo, o as parseSemVer, q as preloadCritical, r as prerenderRoutes, s as satisfies } from './startup-BLfSeL15.js';
|
|
2
2
|
import { A as Accessor } from './signal-EotCj4hS.js';
|
|
3
3
|
export { P as PluginContext, a as PluginInstallCancelledError, b as PluginRegistry, S as SibuPlugin, c as createPlugin, d as createPluginRegistry, i as inject, e as isPluginInstallCancelledError, p as plugin, r as resetPlugins, s as setDefaultPluginRegistry, t as triggerPluginError, f as triggerPluginMount, g as triggerPluginUnmount } from './plugin-DVgSnTfK.js';
|
|
4
|
-
export { A as AsyncComponent, b as AsyncRoute, C as Component, c as ComponentRoute, G as Guard, d as GuardResult, J as JsonLd, K as KeepAliveRoute, L as LazyComponent, e as LazyRoute, N as NavigationFailure, f as NavigationFailureReason, g as NavigationGuard, h as NavigationNext, i as NavigationQuery, j as NavigationResult, k as NavigationTarget, O as Outlet, P as Params, Q as QueryValues, l as RedirectRoute, m as ResolvedHeadTag, n as ResolvedRouteHead, o as Route, p as RouteBase, q as RouteContext, a as RouteDef, r as RouteHead, s as RouteHeadAlternate, t as RouteHeadOpenGraph, u as RouteHeadTwitter, v as RouteHeadValue, w as RouteMeta, x as RouteTransitionOptions, y as RouterHeadOptions, z as RouterLink, R as RouterOptions, B as RouterPlugin, S as ScrollBehavior, D as ScrollPosition, E as SibuRouter, F as Suspense, _ as __getNavigationEpoch, H as __removeRouterPagehideHandler, I as addRoute, M as afterEach, T as back, U as beforeEach, V as beforeResolve, W as buildURL, X as createMemoryRouter, Y as createRouter, Z as destroyRouter, $ as forward, a0 as getRouteInfo, a1 as getRouteTransition, a2 as go, a3 as hasRoute, a4 as jsonLdScript, a5 as lazy, a6 as navigate, a7 as preloadRoute, a8 as push, a9 as removeRoute, aa as replace, ab as resolveRouteHead, ac as route, ad as routeHeadToHTML, ae as router, af as routerPlugin, ag as routerReady, ah as routerState, ai as serializeJsonLd, aj as setRouteTransition, ak as setRoutes } from './routeHead-
|
|
4
|
+
export { A as AsyncComponent, b as AsyncRoute, C as Component, c as ComponentRoute, G as Guard, d as GuardResult, J as JsonLd, K as KeepAliveRoute, L as LazyComponent, e as LazyRoute, N as NavigationFailure, f as NavigationFailureReason, g as NavigationGuard, h as NavigationNext, i as NavigationQuery, j as NavigationResult, k as NavigationTarget, O as Outlet, P as Params, Q as QueryValues, l as RedirectRoute, m as ResolvedHeadTag, n as ResolvedRouteHead, o as Route, p as RouteBase, q as RouteContext, a as RouteDef, r as RouteHead, s as RouteHeadAlternate, t as RouteHeadOpenGraph, u as RouteHeadTwitter, v as RouteHeadValue, w as RouteMeta, x as RouteTransitionOptions, y as RouterHeadOptions, z as RouterLink, R as RouterOptions, B as RouterPlugin, S as ScrollBehavior, D as ScrollPosition, E as SibuRouter, F as Suspense, _ as __getNavigationEpoch, H as __removeRouterPagehideHandler, I as addRoute, M as afterEach, T as back, U as beforeEach, V as beforeResolve, W as buildURL, X as createMemoryRouter, Y as createRouter, Z as destroyRouter, $ as forward, a0 as getRouteInfo, a1 as getRouteTransition, a2 as go, a3 as hasRoute, a4 as jsonLdScript, a5 as lazy, a6 as navigate, a7 as preloadRoute, a8 as push, a9 as removeRoute, aa as replace, ab as resolveRouteHead, ac as route, ad as routeHeadToHTML, ae as router, af as routerPlugin, ag as routerReady, ah as routerState, ai as serializeJsonLd, aj as setRouteTransition, ak as setRoutes } from './routeHead-w8nANZ3M.js';
|
|
5
5
|
import { T as TrustedHTML } from './ssr-JpGpHnpC.js';
|
|
6
6
|
import './types-CJFViL6Q.js';
|
|
7
|
+
import './track-core-0edROAF5.js';
|
|
8
|
+
import './signal-BnWpq6WB.js';
|
|
7
9
|
|
|
8
10
|
type Translations = Record<string, string>;
|
|
9
11
|
/**
|
package/dist/plugins.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
serializeJsonLd,
|
|
39
39
|
setRouteTransition,
|
|
40
40
|
setRoutes
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-EHSJESRN.js";
|
|
42
42
|
import {
|
|
43
43
|
MigrationStorageError,
|
|
44
44
|
VERSION,
|
|
@@ -60,8 +60,8 @@ import {
|
|
|
60
60
|
preloadCritical,
|
|
61
61
|
prerenderRoutes,
|
|
62
62
|
satisfies
|
|
63
|
-
} from "./chunk-
|
|
64
|
-
import "./chunk-
|
|
63
|
+
} from "./chunk-6IV5ZRG6.js";
|
|
64
|
+
import "./chunk-HTPOIAAL.js";
|
|
65
65
|
import {
|
|
66
66
|
PluginInstallCancelledError,
|
|
67
67
|
createPlugin,
|
|
@@ -74,29 +74,28 @@ import {
|
|
|
74
74
|
triggerPluginError,
|
|
75
75
|
triggerPluginMount,
|
|
76
76
|
triggerPluginUnmount
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-I2R5QALY.js";
|
|
78
|
+
import "./chunk-DS5V2PRE.js";
|
|
78
79
|
import {
|
|
79
80
|
span
|
|
80
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-4AEFGRYW.js";
|
|
81
82
|
import {
|
|
82
83
|
escapeScriptJson,
|
|
83
84
|
renderToString,
|
|
84
85
|
serializeHeadEntry
|
|
85
|
-
} from "./chunk-
|
|
86
|
-
import "./chunk-
|
|
87
|
-
import "./chunk-
|
|
86
|
+
} from "./chunk-DRWOD7RZ.js";
|
|
87
|
+
import "./chunk-MINLMJUY.js";
|
|
88
|
+
import "./chunk-BG4BP44S.js";
|
|
88
89
|
import "./chunk-3HZOSMPX.js";
|
|
89
90
|
import {
|
|
90
91
|
isUnsafeKey,
|
|
91
92
|
readOwnGlobal
|
|
92
93
|
} from "./chunk-62BDYGAG.js";
|
|
93
|
-
import "./chunk-
|
|
94
|
-
import "./chunk-
|
|
94
|
+
import "./chunk-VSTX3XSX.js";
|
|
95
|
+
import "./chunk-DNCQDFJJ.js";
|
|
96
|
+
import "./chunk-XPDZ2LDR.js";
|
|
95
97
|
import "./chunk-RVWJGWCL.js";
|
|
96
|
-
import
|
|
97
|
-
globalSingleton
|
|
98
|
-
} from "./chunk-7ZHH77QA.js";
|
|
99
|
-
import "./chunk-AE32RGWX.js";
|
|
98
|
+
import "./chunk-LGUXYHTZ.js";
|
|
100
99
|
import {
|
|
101
100
|
sanitizeUrl
|
|
102
101
|
} from "./chunk-B3HOT4TK.js";
|
|
@@ -106,9 +105,11 @@ import {
|
|
|
106
105
|
import "./chunk-5HZXGZ6T.js";
|
|
107
106
|
import {
|
|
108
107
|
signal
|
|
109
|
-
} from "./chunk-
|
|
110
|
-
import "./chunk-
|
|
111
|
-
import
|
|
108
|
+
} from "./chunk-IUBV5WO5.js";
|
|
109
|
+
import "./chunk-GFM5WWPU.js";
|
|
110
|
+
import {
|
|
111
|
+
globalSingleton
|
|
112
|
+
} from "./chunk-BF3WBJJQ.js";
|
|
112
113
|
import "./chunk-NT3ZYB5S.js";
|
|
113
114
|
import "./chunk-R5U7XKVJ.js";
|
|
114
115
|
|
|
@@ -430,8 +431,8 @@ function hydrateRouter(routes, options) {
|
|
|
430
431
|
const liveUrl = `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
431
432
|
const resolved = resolveServerRoute(liveUrl, routes);
|
|
432
433
|
const bootstrapEpoch = __getNavigationEpoch();
|
|
433
|
-
import("./ssr-
|
|
434
|
-
const { replaceChildrenSafely } = await import("./dispose-
|
|
434
|
+
import("./ssr-EF3IUHTE.js").then(async ({ hydrate }) => {
|
|
435
|
+
const { replaceChildrenSafely } = await import("./dispose-3WDBYJMH.js");
|
|
435
436
|
if (__getNavigationEpoch() !== bootstrapEpoch) return;
|
|
436
437
|
if (resolved.component) {
|
|
437
438
|
hydrate(resolved.component, container);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouterOptions, a as RouteDef } from './routeHead-
|
|
2
|
-
import { A as AsyncRenderOptions, D as DocumentOptions, R as RenderResult } from './ssr-JpGpHnpC.
|
|
1
|
+
import { R as RouterOptions, a as RouteDef } from './routeHead-DLxlq15W.cjs';
|
|
2
|
+
import { A as AsyncRenderOptions, D as DocumentOptions, R as RenderResult } from './ssr-JpGpHnpC.cjs';
|
|
3
3
|
|
|
4
4
|
/** How a route is treated by server renders (see `RouteBase.render`); `"default"` when no record declares one. */
|
|
5
5
|
type RouteRenderMode = "ssr" | "prerender" | "client" | "default";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouterOptions, a as RouteDef } from './routeHead-
|
|
2
|
-
import { A as AsyncRenderOptions, D as DocumentOptions, R as RenderResult } from './ssr-JpGpHnpC.
|
|
1
|
+
import { R as RouterOptions, a as RouteDef } from './routeHead-w8nANZ3M.js';
|
|
2
|
+
import { A as AsyncRenderOptions, D as DocumentOptions, R as RenderResult } from './ssr-JpGpHnpC.js';
|
|
3
3
|
|
|
4
4
|
/** How a route is treated by server renders (see `RouteBase.render`); `"default"` when no record declares one. */
|
|
5
5
|
type RouteRenderMode = "ssr" | "prerender" | "client" | "default";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { C as Component$1, N as NodeChildren } from './types-CJFViL6Q.cjs';
|
|
2
|
+
import { H as HeldCheck, S as StructuralBinding } from './track-core-DN5fYLWi.cjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Creation scopes for adopting hydration (see docs/architecture/hydration-adopt.md).
|
|
@@ -363,12 +364,24 @@ declare class SibuRouter {
|
|
|
363
364
|
private handleLocationChange;
|
|
364
365
|
private getCurrentPath;
|
|
365
366
|
private createRouteContext;
|
|
367
|
+
/**
|
|
368
|
+
* Once no navigation is in flight: if the route is still the placeholder
|
|
369
|
+
* the router started with — every navigation that could have replaced it
|
|
370
|
+
* was cancelled by a guard, failed, or was a duplicate — that IS the
|
|
371
|
+
* outcome, and the outlets that rendered nothing for it settle (see
|
|
372
|
+
* `settleEmpty`). Checked when a navigation has definitively completed,
|
|
373
|
+
* never from `isReady` (set before the guards run). A navigation still
|
|
374
|
+
* pending — a newer one, or a guard that never resolves — keeps them
|
|
375
|
+
* pending; an outlet's enter is bounded by its own deadline then.
|
|
376
|
+
*/
|
|
377
|
+
private settleBootstrap;
|
|
366
378
|
navigate(to: NavigationTarget, options?: {
|
|
367
379
|
replace?: boolean;
|
|
368
380
|
state?: unknown;
|
|
369
381
|
skipHistory?: boolean;
|
|
370
382
|
initialResolution?: boolean;
|
|
371
383
|
}): Promise<NavigationResult>;
|
|
384
|
+
private attemptNavigation;
|
|
372
385
|
private static readonly MAX_REDIRECT_DEPTH;
|
|
373
386
|
private performNavigation;
|
|
374
387
|
private updateHead;
|
|
@@ -403,6 +416,13 @@ declare class SibuRouter {
|
|
|
403
416
|
/**
|
|
404
417
|
* Create exactly one real instance from an already-resolved plan. With a
|
|
405
418
|
* `scope`, the factory runs in it (see `RouteScope`).
|
|
419
|
+
*
|
|
420
|
+
* When the scope belongs to an outlet whose branch is paused (playing a
|
|
421
|
+
* leave it may still be taken back from), a lazy module that resolves does
|
|
422
|
+
* not run its factory yet: the promise stays pending and continues once the
|
|
423
|
+
* branch resumes. If the branch ends, or the outlet's pass was superseded
|
|
424
|
+
* meanwhile, it rejects with a `DOMException` named `"AbortError"`. Genuine
|
|
425
|
+
* loader and component failures reject with their own error, as before.
|
|
406
426
|
*/
|
|
407
427
|
instantiateComponent(plan: RoutePlan, route: RouteDef, routePath: string, scope?: RouteScope): Promise<Element>;
|
|
408
428
|
/** Resolve a route's module/factory without creating any component instance. */
|
|
@@ -480,6 +500,21 @@ declare function setRoutes(routes: RouteDef[]): void;
|
|
|
480
500
|
declare class RouteScope {
|
|
481
501
|
/** Creation scope the instance is built in (adopting hydration); see `adoptScope`. */
|
|
482
502
|
adopt: AdoptScope | null;
|
|
503
|
+
/**
|
|
504
|
+
* The outlet's pause gate: while the branch holding the outlet is paused (it
|
|
505
|
+
* began a leave and may still be taken back), a lazy module that resolves
|
|
506
|
+
* does not get its factory invoked yet; instantiation waits for the branch
|
|
507
|
+
* to resume, and is cancelled if it ends.
|
|
508
|
+
*/
|
|
509
|
+
gate: PauseGate | null;
|
|
510
|
+
/** Whether the outlet pass this instance is for is still the current one. */
|
|
511
|
+
current: (() => boolean) | null;
|
|
512
|
+
/**
|
|
513
|
+
* The instance's structural owner, nested under the outlet's: its factory
|
|
514
|
+
* runs as it, so what it creates is paused with the branch holding the
|
|
515
|
+
* outlet, and ends (`lifecycleScope()` work included) with the instance.
|
|
516
|
+
*/
|
|
517
|
+
owner: StructuralBinding | null;
|
|
483
518
|
private readonly get;
|
|
484
519
|
private readonly set;
|
|
485
520
|
private released;
|
|
@@ -497,6 +532,28 @@ declare class RouteScope {
|
|
|
497
532
|
*/
|
|
498
533
|
release(): void;
|
|
499
534
|
}
|
|
535
|
+
/**
|
|
536
|
+
* Async work an outlet does on behalf of the branch holding it, gated on that
|
|
537
|
+
* branch's lifecycle (see `captureFrozen`): `until()` resolves `true` once the
|
|
538
|
+
* branch is active, `false` once it ended or the outlet was torn down
|
|
539
|
+
* (`close`). Driven by the runtime's resume / end notifications — no polling.
|
|
540
|
+
*/
|
|
541
|
+
interface PauseGate {
|
|
542
|
+
/** The branch is paused or ended: gated work must not run now. */
|
|
543
|
+
held(): boolean;
|
|
544
|
+
until(): Promise<boolean>;
|
|
545
|
+
/** The error an instantiation cancelled by this gate rejects with. */
|
|
546
|
+
cancellation(): DOMException;
|
|
547
|
+
close(): void;
|
|
548
|
+
/** Run `fn` as the branch's structural owner (see `HeldCheck.run`). */
|
|
549
|
+
run<T>(fn: () => T): T;
|
|
550
|
+
/** The branch's lifecycle. */
|
|
551
|
+
frozen: HeldCheck;
|
|
552
|
+
/** Whether `close()` was called. */
|
|
553
|
+
closed(): boolean;
|
|
554
|
+
/** Call `fn` on `close()`, unless the returned function was called first. */
|
|
555
|
+
onClose(fn: () => void): () => void;
|
|
556
|
+
}
|
|
500
557
|
/**
|
|
501
558
|
* Read the current route as a plain snapshot.
|
|
502
559
|
*
|
|
@@ -660,6 +717,41 @@ declare function Route(): Node;
|
|
|
660
717
|
* | excluded by `include` | never cached; disposed on navigation away |
|
|
661
718
|
* | outlet disposed | whole cache disposed and cleared |
|
|
662
719
|
*
|
|
720
|
+
* ## Inactive pages: live by default, suspended on request
|
|
721
|
+
*
|
|
722
|
+
* By default a cached page stays live while it is hidden: its bindings,
|
|
723
|
+
* effects and async work keep running against the current state. With
|
|
724
|
+
* `suspendInactive: true` a page is PAUSED when it is cached and resumed when
|
|
725
|
+
* it is shown again — the same pause a leaving `when()` branch gets:
|
|
726
|
+
*
|
|
727
|
+
* - its DOM, local state, form values and route context are kept as they are
|
|
728
|
+
* (nothing is disposed or rebuilt);
|
|
729
|
+
* - its bindings, effects created while it rendered, and `lifecycleScope()`
|
|
730
|
+
* work do not run; what changed meanwhile is caught up in ONE run when it
|
|
731
|
+
* is shown, against the current state and the route it is shown for;
|
|
732
|
+
* - async work it owns (a `Suspense` result, a nested outlet's page, a core
|
|
733
|
+
* `lazy()` component) is held, not committed, until then;
|
|
734
|
+
* - a page shown inside a branch that is itself paused stays paused until
|
|
735
|
+
* that branch resumes;
|
|
736
|
+
* - eviction and outlet disposal end a suspended page without a catch-up run
|
|
737
|
+
* for what the page owns: its DOM bindings, `lifecycleScope()` work, and
|
|
738
|
+
* effects whose disposal is tied to the page (`scope.effect()`, an effect
|
|
739
|
+
* whose stop is registered on one of its nodes).
|
|
740
|
+
*
|
|
741
|
+
* A plain `effect()` created while the page rendered pauses with it, but
|
|
742
|
+
* nothing disposes it: the page never returned its stop function to anyone.
|
|
743
|
+
* When the page is evicted it is no longer paused, so it runs ONE catch-up
|
|
744
|
+
* against the current state and stays subscribed, re-running on later
|
|
745
|
+
* changes like any unowned effect (as it would have kept doing without
|
|
746
|
+
* `suspendInactive`). Create such work with `scope.effect()`, or register its
|
|
747
|
+
* stop on a node of the page, when eviction must end it.
|
|
748
|
+
*
|
|
749
|
+
* Only the framework's reactive work pauses. Timers, sockets, media and
|
|
750
|
+
* requests keep going unless the page stops them: capture a
|
|
751
|
+
* `lifecycleScope()` while it renders and use `scope.onPause()` /
|
|
752
|
+
* `scope.onResume()` (called in the page's own route context). Pages that
|
|
753
|
+
* are not cached are disposed as before.
|
|
754
|
+
*
|
|
663
755
|
* ## Cache identity is not async ownership
|
|
664
756
|
*
|
|
665
757
|
* The cache key answers *"which cached view is this?"*. It never answers *"may
|
|
@@ -686,6 +778,8 @@ declare function Route(): Node;
|
|
|
686
778
|
declare function KeepAliveRoute(options?: {
|
|
687
779
|
max?: number;
|
|
688
780
|
include?: string[];
|
|
781
|
+
/** Pause a cached page while it is hidden (see above). Default `false`. */
|
|
782
|
+
suspendInactive?: boolean;
|
|
689
783
|
}): Node;
|
|
690
784
|
declare function RouterLink(props: {
|
|
691
785
|
to: NavigationTarget;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { C as Component$1, N as NodeChildren } from './types-CJFViL6Q.js';
|
|
2
|
+
import { H as HeldCheck, S as StructuralBinding } from './track-core-0edROAF5.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Creation scopes for adopting hydration (see docs/architecture/hydration-adopt.md).
|
|
@@ -363,12 +364,24 @@ declare class SibuRouter {
|
|
|
363
364
|
private handleLocationChange;
|
|
364
365
|
private getCurrentPath;
|
|
365
366
|
private createRouteContext;
|
|
367
|
+
/**
|
|
368
|
+
* Once no navigation is in flight: if the route is still the placeholder
|
|
369
|
+
* the router started with — every navigation that could have replaced it
|
|
370
|
+
* was cancelled by a guard, failed, or was a duplicate — that IS the
|
|
371
|
+
* outcome, and the outlets that rendered nothing for it settle (see
|
|
372
|
+
* `settleEmpty`). Checked when a navigation has definitively completed,
|
|
373
|
+
* never from `isReady` (set before the guards run). A navigation still
|
|
374
|
+
* pending — a newer one, or a guard that never resolves — keeps them
|
|
375
|
+
* pending; an outlet's enter is bounded by its own deadline then.
|
|
376
|
+
*/
|
|
377
|
+
private settleBootstrap;
|
|
366
378
|
navigate(to: NavigationTarget, options?: {
|
|
367
379
|
replace?: boolean;
|
|
368
380
|
state?: unknown;
|
|
369
381
|
skipHistory?: boolean;
|
|
370
382
|
initialResolution?: boolean;
|
|
371
383
|
}): Promise<NavigationResult>;
|
|
384
|
+
private attemptNavigation;
|
|
372
385
|
private static readonly MAX_REDIRECT_DEPTH;
|
|
373
386
|
private performNavigation;
|
|
374
387
|
private updateHead;
|
|
@@ -403,6 +416,13 @@ declare class SibuRouter {
|
|
|
403
416
|
/**
|
|
404
417
|
* Create exactly one real instance from an already-resolved plan. With a
|
|
405
418
|
* `scope`, the factory runs in it (see `RouteScope`).
|
|
419
|
+
*
|
|
420
|
+
* When the scope belongs to an outlet whose branch is paused (playing a
|
|
421
|
+
* leave it may still be taken back from), a lazy module that resolves does
|
|
422
|
+
* not run its factory yet: the promise stays pending and continues once the
|
|
423
|
+
* branch resumes. If the branch ends, or the outlet's pass was superseded
|
|
424
|
+
* meanwhile, it rejects with a `DOMException` named `"AbortError"`. Genuine
|
|
425
|
+
* loader and component failures reject with their own error, as before.
|
|
406
426
|
*/
|
|
407
427
|
instantiateComponent(plan: RoutePlan, route: RouteDef, routePath: string, scope?: RouteScope): Promise<Element>;
|
|
408
428
|
/** Resolve a route's module/factory without creating any component instance. */
|
|
@@ -480,6 +500,21 @@ declare function setRoutes(routes: RouteDef[]): void;
|
|
|
480
500
|
declare class RouteScope {
|
|
481
501
|
/** Creation scope the instance is built in (adopting hydration); see `adoptScope`. */
|
|
482
502
|
adopt: AdoptScope | null;
|
|
503
|
+
/**
|
|
504
|
+
* The outlet's pause gate: while the branch holding the outlet is paused (it
|
|
505
|
+
* began a leave and may still be taken back), a lazy module that resolves
|
|
506
|
+
* does not get its factory invoked yet; instantiation waits for the branch
|
|
507
|
+
* to resume, and is cancelled if it ends.
|
|
508
|
+
*/
|
|
509
|
+
gate: PauseGate | null;
|
|
510
|
+
/** Whether the outlet pass this instance is for is still the current one. */
|
|
511
|
+
current: (() => boolean) | null;
|
|
512
|
+
/**
|
|
513
|
+
* The instance's structural owner, nested under the outlet's: its factory
|
|
514
|
+
* runs as it, so what it creates is paused with the branch holding the
|
|
515
|
+
* outlet, and ends (`lifecycleScope()` work included) with the instance.
|
|
516
|
+
*/
|
|
517
|
+
owner: StructuralBinding | null;
|
|
483
518
|
private readonly get;
|
|
484
519
|
private readonly set;
|
|
485
520
|
private released;
|
|
@@ -497,6 +532,28 @@ declare class RouteScope {
|
|
|
497
532
|
*/
|
|
498
533
|
release(): void;
|
|
499
534
|
}
|
|
535
|
+
/**
|
|
536
|
+
* Async work an outlet does on behalf of the branch holding it, gated on that
|
|
537
|
+
* branch's lifecycle (see `captureFrozen`): `until()` resolves `true` once the
|
|
538
|
+
* branch is active, `false` once it ended or the outlet was torn down
|
|
539
|
+
* (`close`). Driven by the runtime's resume / end notifications — no polling.
|
|
540
|
+
*/
|
|
541
|
+
interface PauseGate {
|
|
542
|
+
/** The branch is paused or ended: gated work must not run now. */
|
|
543
|
+
held(): boolean;
|
|
544
|
+
until(): Promise<boolean>;
|
|
545
|
+
/** The error an instantiation cancelled by this gate rejects with. */
|
|
546
|
+
cancellation(): DOMException;
|
|
547
|
+
close(): void;
|
|
548
|
+
/** Run `fn` as the branch's structural owner (see `HeldCheck.run`). */
|
|
549
|
+
run<T>(fn: () => T): T;
|
|
550
|
+
/** The branch's lifecycle. */
|
|
551
|
+
frozen: HeldCheck;
|
|
552
|
+
/** Whether `close()` was called. */
|
|
553
|
+
closed(): boolean;
|
|
554
|
+
/** Call `fn` on `close()`, unless the returned function was called first. */
|
|
555
|
+
onClose(fn: () => void): () => void;
|
|
556
|
+
}
|
|
500
557
|
/**
|
|
501
558
|
* Read the current route as a plain snapshot.
|
|
502
559
|
*
|
|
@@ -660,6 +717,41 @@ declare function Route(): Node;
|
|
|
660
717
|
* | excluded by `include` | never cached; disposed on navigation away |
|
|
661
718
|
* | outlet disposed | whole cache disposed and cleared |
|
|
662
719
|
*
|
|
720
|
+
* ## Inactive pages: live by default, suspended on request
|
|
721
|
+
*
|
|
722
|
+
* By default a cached page stays live while it is hidden: its bindings,
|
|
723
|
+
* effects and async work keep running against the current state. With
|
|
724
|
+
* `suspendInactive: true` a page is PAUSED when it is cached and resumed when
|
|
725
|
+
* it is shown again — the same pause a leaving `when()` branch gets:
|
|
726
|
+
*
|
|
727
|
+
* - its DOM, local state, form values and route context are kept as they are
|
|
728
|
+
* (nothing is disposed or rebuilt);
|
|
729
|
+
* - its bindings, effects created while it rendered, and `lifecycleScope()`
|
|
730
|
+
* work do not run; what changed meanwhile is caught up in ONE run when it
|
|
731
|
+
* is shown, against the current state and the route it is shown for;
|
|
732
|
+
* - async work it owns (a `Suspense` result, a nested outlet's page, a core
|
|
733
|
+
* `lazy()` component) is held, not committed, until then;
|
|
734
|
+
* - a page shown inside a branch that is itself paused stays paused until
|
|
735
|
+
* that branch resumes;
|
|
736
|
+
* - eviction and outlet disposal end a suspended page without a catch-up run
|
|
737
|
+
* for what the page owns: its DOM bindings, `lifecycleScope()` work, and
|
|
738
|
+
* effects whose disposal is tied to the page (`scope.effect()`, an effect
|
|
739
|
+
* whose stop is registered on one of its nodes).
|
|
740
|
+
*
|
|
741
|
+
* A plain `effect()` created while the page rendered pauses with it, but
|
|
742
|
+
* nothing disposes it: the page never returned its stop function to anyone.
|
|
743
|
+
* When the page is evicted it is no longer paused, so it runs ONE catch-up
|
|
744
|
+
* against the current state and stays subscribed, re-running on later
|
|
745
|
+
* changes like any unowned effect (as it would have kept doing without
|
|
746
|
+
* `suspendInactive`). Create such work with `scope.effect()`, or register its
|
|
747
|
+
* stop on a node of the page, when eviction must end it.
|
|
748
|
+
*
|
|
749
|
+
* Only the framework's reactive work pauses. Timers, sockets, media and
|
|
750
|
+
* requests keep going unless the page stops them: capture a
|
|
751
|
+
* `lifecycleScope()` while it renders and use `scope.onPause()` /
|
|
752
|
+
* `scope.onResume()` (called in the page's own route context). Pages that
|
|
753
|
+
* are not cached are disposed as before.
|
|
754
|
+
*
|
|
663
755
|
* ## Cache identity is not async ownership
|
|
664
756
|
*
|
|
665
757
|
* The cache key answers *"which cached view is this?"*. It never answers *"may
|
|
@@ -686,6 +778,8 @@ declare function Route(): Node;
|
|
|
686
778
|
declare function KeepAliveRoute(options?: {
|
|
687
779
|
max?: number;
|
|
688
780
|
include?: string[];
|
|
781
|
+
/** Pause a cached page while it is hidden (see above). Default `false`. */
|
|
782
|
+
suspendInactive?: boolean;
|
|
689
783
|
}): Node;
|
|
690
784
|
declare function RouterLink(props: {
|
|
691
785
|
to: NavigationTarget;
|
|
@@ -19,17 +19,17 @@ import {
|
|
|
19
19
|
ssrSuspense,
|
|
20
20
|
suspenseSwapScript,
|
|
21
21
|
trustHTML
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-DRWOD7RZ.js";
|
|
23
|
+
import "./chunk-MINLMJUY.js";
|
|
24
|
+
import "./chunk-BG4BP44S.js";
|
|
25
25
|
import "./chunk-3HZOSMPX.js";
|
|
26
26
|
import "./chunk-62BDYGAG.js";
|
|
27
|
+
import "./chunk-DNCQDFJJ.js";
|
|
27
28
|
import "./chunk-RVWJGWCL.js";
|
|
28
|
-
import "./chunk-7ZHH77QA.js";
|
|
29
29
|
import "./chunk-B3HOT4TK.js";
|
|
30
30
|
import "./chunk-UYTYNCMZ.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-GFM5WWPU.js";
|
|
32
|
+
import "./chunk-BF3WBJJQ.js";
|
|
33
33
|
import "./chunk-NT3ZYB5S.js";
|
|
34
34
|
import "./chunk-R5U7XKVJ.js";
|
|
35
35
|
export {
|
package/dist/ssr-dom.cjs
CHANGED
|
@@ -77,6 +77,25 @@ function requestSlot(name, create) {
|
|
|
77
77
|
return slots.get(name);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
// src/utils/styleKey.ts
|
|
81
|
+
var EXCEPTIONS = { cssFloat: "float" };
|
|
82
|
+
var VENDOR_PREFIX = /^(webkit|moz|ms|o)-/;
|
|
83
|
+
var cache = /* @__PURE__ */ new Map();
|
|
84
|
+
var CACHE_MAX = 1e3;
|
|
85
|
+
function styleKeyToProperty(key) {
|
|
86
|
+
let name = cache.get(key);
|
|
87
|
+
if (name !== void 0) return name;
|
|
88
|
+
if (key.startsWith("--")) name = key;
|
|
89
|
+
else if (Object.hasOwn(EXCEPTIONS, key)) name = EXCEPTIONS[key];
|
|
90
|
+
else {
|
|
91
|
+
name = key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
92
|
+
if (VENDOR_PREFIX.test(name)) name = `-${name}`;
|
|
93
|
+
}
|
|
94
|
+
if (cache.size >= CACHE_MAX) cache.clear();
|
|
95
|
+
cache.set(key, name);
|
|
96
|
+
return name;
|
|
97
|
+
}
|
|
98
|
+
|
|
80
99
|
// src/platform/serverDom.ts
|
|
81
100
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
82
101
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
@@ -707,9 +726,15 @@ var ServerAttr = class {
|
|
|
707
726
|
get nodeValue() {
|
|
708
727
|
return this._value;
|
|
709
728
|
}
|
|
729
|
+
set nodeValue(v) {
|
|
730
|
+
this.value = v;
|
|
731
|
+
}
|
|
710
732
|
get textContent() {
|
|
711
733
|
return this._value;
|
|
712
734
|
}
|
|
735
|
+
set textContent(v) {
|
|
736
|
+
this.value = v;
|
|
737
|
+
}
|
|
713
738
|
};
|
|
714
739
|
var ServerNamedNodeMap = class extends Array {
|
|
715
740
|
static get [Symbol.species]() {
|
|
@@ -746,12 +771,6 @@ function splitDeclarations(text) {
|
|
|
746
771
|
out.push(text.slice(start));
|
|
747
772
|
return out;
|
|
748
773
|
}
|
|
749
|
-
var CAMEL_EXCEPTIONS = { cssFloat: "float" };
|
|
750
|
-
function toKebab(prop) {
|
|
751
|
-
if (prop.startsWith("--")) return prop;
|
|
752
|
-
if (Object.hasOwn(CAMEL_EXCEPTIONS, prop)) return CAMEL_EXCEPTIONS[prop];
|
|
753
|
-
return prop.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`).replace(/^(webkit|moz|ms)-/, "-$1-");
|
|
754
|
-
}
|
|
755
774
|
var ServerStyle = class {
|
|
756
775
|
constructor(el) {
|
|
757
776
|
this.el = el;
|
|
@@ -846,13 +865,13 @@ function styleProxy(style) {
|
|
|
846
865
|
get(target, key, receiver) {
|
|
847
866
|
if (typeof key === "string" && !(key in target)) {
|
|
848
867
|
if (/^\d+$/.test(key)) return target.item(Number(key));
|
|
849
|
-
return target.getPropertyValue(
|
|
868
|
+
return target.getPropertyValue(styleKeyToProperty(key));
|
|
850
869
|
}
|
|
851
870
|
return Reflect.get(target, key, receiver);
|
|
852
871
|
},
|
|
853
872
|
set(target, key, value, receiver) {
|
|
854
873
|
if (typeof key === "string" && !(key in target)) {
|
|
855
|
-
target.setProperty(
|
|
874
|
+
target.setProperty(styleKeyToProperty(key), value == null ? "" : String(value));
|
|
856
875
|
return true;
|
|
857
876
|
}
|
|
858
877
|
return Reflect.set(target, key, value, receiver);
|
|
@@ -1257,6 +1276,10 @@ var ServerInputElement = class extends ServerHTMLElement {
|
|
|
1257
1276
|
get defaultChecked() {
|
|
1258
1277
|
return this.hasAttribute("checked");
|
|
1259
1278
|
}
|
|
1279
|
+
/** Reflects to the `checked` attribute; `checked` follows it until written (dirty checkedness). */
|
|
1280
|
+
set defaultChecked(v) {
|
|
1281
|
+
this.toggleAttribute("checked", !!v);
|
|
1282
|
+
}
|
|
1260
1283
|
get type() {
|
|
1261
1284
|
return (this.getAttribute("type") ?? "text").toLowerCase();
|
|
1262
1285
|
}
|
|
@@ -1314,8 +1337,10 @@ reflectDisabled(ServerTextAreaElement.prototype);
|
|
|
1314
1337
|
var ServerOptionElement = class extends ServerHTMLElement {
|
|
1315
1338
|
constructor() {
|
|
1316
1339
|
super(...arguments);
|
|
1317
|
-
/** @internal */
|
|
1340
|
+
/** Selectedness; `null` while it follows the `selected` attribute. @internal */
|
|
1318
1341
|
this._selected = null;
|
|
1342
|
+
/** Set by a `selected` write: the attribute no longer decides selectedness. @internal */
|
|
1343
|
+
this._dirty = false;
|
|
1319
1344
|
}
|
|
1320
1345
|
get value() {
|
|
1321
1346
|
return this.getAttribute("value") ?? this.text;
|
|
@@ -1332,18 +1357,48 @@ var ServerOptionElement = class extends ServerHTMLElement {
|
|
|
1332
1357
|
get label() {
|
|
1333
1358
|
return this.getAttribute("label") ?? this.text;
|
|
1334
1359
|
}
|
|
1360
|
+
set label(v) {
|
|
1361
|
+
this.setAttribute("label", v);
|
|
1362
|
+
}
|
|
1335
1363
|
get selected() {
|
|
1336
1364
|
return this._selected ?? this.hasAttribute("selected");
|
|
1337
1365
|
}
|
|
1338
1366
|
set selected(v) {
|
|
1339
1367
|
this._selected = !!v;
|
|
1368
|
+
this._dirty = true;
|
|
1369
|
+
const select = singleSelectOf(this);
|
|
1370
|
+
if (select && v) {
|
|
1371
|
+
for (const o of select.options) if (o !== this) o._selected = false;
|
|
1372
|
+
}
|
|
1340
1373
|
}
|
|
1341
1374
|
get defaultSelected() {
|
|
1342
1375
|
return this.hasAttribute("selected");
|
|
1343
1376
|
}
|
|
1377
|
+
/** Reflects to the `selected` attribute; `selected` follows it unless written. */
|
|
1378
|
+
set defaultSelected(v) {
|
|
1379
|
+
this.toggleAttribute("selected", !!v);
|
|
1380
|
+
if (this._dirty) return;
|
|
1381
|
+
this._selected = null;
|
|
1382
|
+
const select = singleSelectOf(this);
|
|
1383
|
+
if (!select) return;
|
|
1384
|
+
let last = null;
|
|
1385
|
+
for (const o of select.options) if (o.selected) last = o;
|
|
1386
|
+
for (const o of select.options) if (o !== last && o.selected) o._selected = false;
|
|
1387
|
+
}
|
|
1344
1388
|
};
|
|
1389
|
+
function singleSelectOf(option) {
|
|
1390
|
+
let parent = option.parentNode;
|
|
1391
|
+
if (parent instanceof ServerElement && parent.localName === "optgroup") parent = parent.parentNode;
|
|
1392
|
+
return parent instanceof ServerSelectElement && !parent.hasAttribute("multiple") ? parent : null;
|
|
1393
|
+
}
|
|
1345
1394
|
reflectDisabled(ServerOptionElement.prototype);
|
|
1346
1395
|
var ServerSelectElement = class extends ServerHTMLElement {
|
|
1396
|
+
get multiple() {
|
|
1397
|
+
return this.hasAttribute("multiple");
|
|
1398
|
+
}
|
|
1399
|
+
set multiple(v) {
|
|
1400
|
+
this.toggleAttribute("multiple", !!v);
|
|
1401
|
+
}
|
|
1347
1402
|
get options() {
|
|
1348
1403
|
return this.querySelectorAll("option");
|
|
1349
1404
|
}
|
package/dist/ssr-dom.d.cts
CHANGED
|
@@ -132,7 +132,9 @@ declare class ServerAttr {
|
|
|
132
132
|
get value(): string;
|
|
133
133
|
set value(v: string);
|
|
134
134
|
get nodeValue(): string;
|
|
135
|
+
set nodeValue(v: string);
|
|
135
136
|
get textContent(): string;
|
|
137
|
+
set textContent(v: string);
|
|
136
138
|
}
|
|
137
139
|
declare class ServerNamedNodeMap extends Array<ServerAttr> {
|
|
138
140
|
static get [Symbol.species](): ArrayConstructor;
|
package/dist/ssr-dom.d.ts
CHANGED
|
@@ -132,7 +132,9 @@ declare class ServerAttr {
|
|
|
132
132
|
get value(): string;
|
|
133
133
|
set value(v: string);
|
|
134
134
|
get nodeValue(): string;
|
|
135
|
+
set nodeValue(v: string);
|
|
135
136
|
get textContent(): string;
|
|
137
|
+
set textContent(v: string);
|
|
136
138
|
}
|
|
137
139
|
declare class ServerNamedNodeMap extends Array<ServerAttr> {
|
|
138
140
|
static get [Symbol.species](): ArrayConstructor;
|
package/dist/ssr-dom.js
CHANGED