@vertz/ui 0.2.15 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/dist/shared/chunk-14eqne2a.js +10 -0
- package/dist/shared/{chunk-dksg08fq.js → chunk-1rxa2fz4.js} +2 -8
- package/dist/shared/{chunk-8hsz5y4a.js → chunk-4fwcwxn6.js} +14 -4
- package/dist/shared/{chunk-hw67ckr3.js → chunk-4mtn7af6.js} +230 -19
- package/dist/shared/{chunk-4txc67nd.js → chunk-6jyt4ycw.js} +67 -2
- package/dist/shared/{chunk-83g4h38e.js → chunk-6wd36w21.js} +1 -0
- package/dist/shared/{chunk-h89w580h.js → chunk-afawz764.js} +1 -1
- package/dist/shared/{chunk-nn9v1zmk.js → chunk-b0qqqk03.js} +86 -21
- package/dist/shared/{chunk-1wby7nex.js → chunk-dhehvmj0.js} +161 -9
- package/dist/shared/{chunk-wymw818z.js → chunk-fkbgbf3n.js} +48 -9
- package/dist/shared/{chunk-5dbq8jp9.js → chunk-j09yyh34.js} +72 -6
- package/dist/shared/chunk-mtsvrj9e.js +23 -0
- package/dist/shared/chunk-pnv25zep.js +7 -0
- package/dist/shared/{chunk-j6qyxfdc.js → chunk-vndfjfdy.js} +3 -3
- package/dist/src/auth/public.d.ts +56 -9
- package/dist/src/auth/public.js +189 -13
- package/dist/src/css/public.d.ts +110 -2
- package/dist/src/css/public.js +8 -4
- package/dist/src/form/public.d.ts +29 -6
- package/dist/src/form/public.js +2 -2
- package/dist/src/index.d.ts +284 -13
- package/dist/src/index.js +161 -14
- package/dist/src/internals.d.ts +141 -5
- package/dist/src/internals.js +17 -9
- package/dist/src/query/public.js +4 -3
- package/dist/src/router/public.d.ts +17 -4
- package/dist/src/router/public.js +17 -11
- package/dist/src/test/index.d.ts +5 -0
- package/dist/src/test/index.js +4 -3
- package/package.json +3 -3
- package/reactivity.json +1 -11
package/dist/src/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
fadeIn,
|
|
7
7
|
fadeOut,
|
|
8
8
|
hydrate,
|
|
9
|
+
hydrateIslands,
|
|
9
10
|
isQueryDescriptor,
|
|
10
11
|
keyframes,
|
|
11
12
|
onAnimationsComplete,
|
|
@@ -20,33 +21,32 @@ import {
|
|
|
20
21
|
slideOutToTop,
|
|
21
22
|
zoomIn,
|
|
22
23
|
zoomOut
|
|
23
|
-
} from "../shared/chunk-
|
|
24
|
+
} from "../shared/chunk-6jyt4ycw.js";
|
|
24
25
|
import {
|
|
26
|
+
Link,
|
|
25
27
|
Outlet,
|
|
26
28
|
OutletContext,
|
|
27
|
-
RouterContext,
|
|
28
29
|
RouterView,
|
|
29
30
|
createLink,
|
|
30
31
|
parseSearchParams,
|
|
31
|
-
useParams,
|
|
32
|
-
useRouter,
|
|
33
32
|
useSearchParams
|
|
34
|
-
} from "../shared/chunk-
|
|
35
|
-
import"../shared/chunk-
|
|
33
|
+
} from "../shared/chunk-b0qqqk03.js";
|
|
34
|
+
import"../shared/chunk-1rxa2fz4.js";
|
|
36
35
|
import {
|
|
37
36
|
createRouter
|
|
38
|
-
} from "../shared/chunk-
|
|
37
|
+
} from "../shared/chunk-fkbgbf3n.js";
|
|
39
38
|
import {
|
|
40
39
|
defineRoutes
|
|
41
|
-
} from "../shared/chunk-
|
|
40
|
+
} from "../shared/chunk-6wd36w21.js";
|
|
42
41
|
import {
|
|
43
42
|
createFieldState,
|
|
44
43
|
form,
|
|
45
44
|
formDataToObject,
|
|
46
45
|
validate
|
|
47
|
-
} from "../shared/chunk-
|
|
46
|
+
} from "../shared/chunk-j09yyh34.js";
|
|
48
47
|
import {
|
|
49
48
|
EntityStore,
|
|
49
|
+
FieldSelectionTracker,
|
|
50
50
|
QueryEnvelopeStore,
|
|
51
51
|
getEntityStore,
|
|
52
52
|
getMutationEventBus,
|
|
@@ -57,14 +57,16 @@ import {
|
|
|
57
57
|
queryMatch,
|
|
58
58
|
registerRelationSchema,
|
|
59
59
|
resetRelationSchemas_TEST_ONLY
|
|
60
|
-
} from "../shared/chunk-
|
|
60
|
+
} from "../shared/chunk-4mtn7af6.js";
|
|
61
61
|
import"../shared/chunk-jrtrk5z4.js";
|
|
62
62
|
import {
|
|
63
63
|
ThemeProvider,
|
|
64
64
|
children,
|
|
65
|
+
compileFonts,
|
|
65
66
|
compileTheme,
|
|
66
67
|
css,
|
|
67
68
|
defineTheme,
|
|
69
|
+
font,
|
|
68
70
|
getInjectedCSS,
|
|
69
71
|
globalCss,
|
|
70
72
|
injectCSS,
|
|
@@ -72,16 +74,29 @@ import {
|
|
|
72
74
|
resolveChildren,
|
|
73
75
|
s,
|
|
74
76
|
variants
|
|
75
|
-
} from "../shared/chunk-
|
|
77
|
+
} from "../shared/chunk-dhehvmj0.js";
|
|
78
|
+
import {
|
|
79
|
+
RouterContext,
|
|
80
|
+
useParams,
|
|
81
|
+
useRouter
|
|
82
|
+
} from "../shared/chunk-mtsvrj9e.js";
|
|
83
|
+
import"../shared/chunk-pnv25zep.js";
|
|
84
|
+
import {
|
|
85
|
+
isBrowser
|
|
86
|
+
} from "../shared/chunk-14eqne2a.js";
|
|
76
87
|
import {
|
|
77
88
|
__append,
|
|
78
89
|
__element,
|
|
79
90
|
__enterChildren,
|
|
80
91
|
__exitChildren,
|
|
81
92
|
__staticText,
|
|
93
|
+
claimElement,
|
|
82
94
|
endHydration,
|
|
95
|
+
enterChildren,
|
|
96
|
+
exitChildren,
|
|
97
|
+
getIsHydrating,
|
|
83
98
|
startHydration
|
|
84
|
-
} from "../shared/chunk-
|
|
99
|
+
} from "../shared/chunk-vndfjfdy.js";
|
|
85
100
|
import"../shared/chunk-prj7nm08.js";
|
|
86
101
|
import {
|
|
87
102
|
RENDER_NODE_BRAND,
|
|
@@ -89,7 +104,7 @@ import {
|
|
|
89
104
|
getAdapter,
|
|
90
105
|
isRenderNode,
|
|
91
106
|
setAdapter
|
|
92
|
-
} from "../shared/chunk-
|
|
107
|
+
} from "../shared/chunk-afawz764.js";
|
|
93
108
|
import {
|
|
94
109
|
DisposalScopeError,
|
|
95
110
|
_tryOnCleanup,
|
|
@@ -106,7 +121,7 @@ import {
|
|
|
106
121
|
signal,
|
|
107
122
|
untrack,
|
|
108
123
|
useContext
|
|
109
|
-
} from "../shared/chunk-
|
|
124
|
+
} from "../shared/chunk-4fwcwxn6.js";
|
|
110
125
|
// src/component/error-boundary-context.ts
|
|
111
126
|
var handlerStack = [];
|
|
112
127
|
function pushErrorHandler(handler) {
|
|
@@ -620,6 +635,128 @@ function createDialogStack(container) {
|
|
|
620
635
|
});
|
|
621
636
|
}
|
|
622
637
|
}
|
|
638
|
+
// src/image/config.ts
|
|
639
|
+
var optimizerBaseUrl = null;
|
|
640
|
+
function configureImageOptimizer(baseUrl) {
|
|
641
|
+
optimizerBaseUrl = baseUrl;
|
|
642
|
+
}
|
|
643
|
+
function isOptimizerConfigured() {
|
|
644
|
+
return optimizerBaseUrl !== null;
|
|
645
|
+
}
|
|
646
|
+
function buildOptimizedUrl(src, width, height, quality, fit) {
|
|
647
|
+
if (!optimizerBaseUrl)
|
|
648
|
+
return null;
|
|
649
|
+
if (!src.startsWith("http://") && !src.startsWith("https://"))
|
|
650
|
+
return null;
|
|
651
|
+
const params = new URLSearchParams({
|
|
652
|
+
url: src,
|
|
653
|
+
w: String(width),
|
|
654
|
+
h: String(height),
|
|
655
|
+
q: String(quality),
|
|
656
|
+
fit
|
|
657
|
+
});
|
|
658
|
+
return `${optimizerBaseUrl}?${params}`;
|
|
659
|
+
}
|
|
660
|
+
// src/image/image.ts
|
|
661
|
+
var BUILD_ONLY_PROPS = new Set([
|
|
662
|
+
"src",
|
|
663
|
+
"width",
|
|
664
|
+
"height",
|
|
665
|
+
"alt",
|
|
666
|
+
"class",
|
|
667
|
+
"style",
|
|
668
|
+
"loading",
|
|
669
|
+
"decoding",
|
|
670
|
+
"fetchpriority",
|
|
671
|
+
"priority",
|
|
672
|
+
"quality",
|
|
673
|
+
"fit",
|
|
674
|
+
"pictureClass"
|
|
675
|
+
]);
|
|
676
|
+
function Image({
|
|
677
|
+
src,
|
|
678
|
+
width,
|
|
679
|
+
height,
|
|
680
|
+
alt,
|
|
681
|
+
class: className,
|
|
682
|
+
style,
|
|
683
|
+
loading = "lazy",
|
|
684
|
+
decoding = "async",
|
|
685
|
+
fetchpriority,
|
|
686
|
+
priority,
|
|
687
|
+
quality = 80,
|
|
688
|
+
fit = "cover",
|
|
689
|
+
pictureClass: _pictureClass,
|
|
690
|
+
...rest
|
|
691
|
+
}) {
|
|
692
|
+
const resolvedLoading = priority ? "eager" : loading;
|
|
693
|
+
const resolvedDecoding = priority ? "sync" : decoding;
|
|
694
|
+
const resolvedFetchpriority = priority ? "high" : fetchpriority;
|
|
695
|
+
const optimizedSrc = buildOptimizedUrl(src, width, height, quality, fit);
|
|
696
|
+
if (isOptimizerConfigured() && optimizedSrc === null) {
|
|
697
|
+
console.info(`[vertz] <Image src="${src}"> was not optimized — only absolute HTTP(S) URLs are rewritten. ` + "Relative paths and data URIs are served as-is.");
|
|
698
|
+
}
|
|
699
|
+
const el = document.createElement("img");
|
|
700
|
+
el.setAttribute("src", optimizedSrc ?? src);
|
|
701
|
+
el.setAttribute("width", String(width));
|
|
702
|
+
el.setAttribute("height", String(height));
|
|
703
|
+
el.setAttribute("alt", alt);
|
|
704
|
+
el.setAttribute("loading", resolvedLoading);
|
|
705
|
+
el.setAttribute("decoding", resolvedDecoding);
|
|
706
|
+
if (resolvedFetchpriority)
|
|
707
|
+
el.setAttribute("fetchpriority", resolvedFetchpriority);
|
|
708
|
+
if (className)
|
|
709
|
+
el.setAttribute("class", className);
|
|
710
|
+
if (style)
|
|
711
|
+
el.setAttribute("style", style);
|
|
712
|
+
for (const [key, value] of Object.entries(rest)) {
|
|
713
|
+
if (!BUILD_ONLY_PROPS.has(key) && value != null) {
|
|
714
|
+
el.setAttribute(key, String(value));
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
return el;
|
|
718
|
+
}
|
|
719
|
+
// src/island/island.ts
|
|
720
|
+
function validateSerializable(props, islandId) {
|
|
721
|
+
for (const [key, value] of Object.entries(props)) {
|
|
722
|
+
if (typeof value === "function") {
|
|
723
|
+
throw new Error(`[vertz] Island "${islandId}" received a function prop "${key}". ` + "Island props must be JSON-serializable. Define event handlers inside the island component instead.");
|
|
724
|
+
}
|
|
725
|
+
if (typeof value === "symbol") {
|
|
726
|
+
throw new Error(`[vertz] Island "${islandId}" received a Symbol prop "${key}". ` + "Island props must be JSON-serializable.");
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
function Island({ id, component: Component, props = {} }) {
|
|
731
|
+
const islandId = id ?? Component.name ?? "Island";
|
|
732
|
+
validateSerializable(props, islandId);
|
|
733
|
+
if (getIsHydrating()) {
|
|
734
|
+
const claimed = claimElement("div");
|
|
735
|
+
if (claimed) {
|
|
736
|
+
enterChildren(claimed);
|
|
737
|
+
claimElement("script");
|
|
738
|
+
Component(props);
|
|
739
|
+
exitChildren();
|
|
740
|
+
return claimed;
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
const wrapper = document.createElement("div");
|
|
744
|
+
wrapper.setAttribute("data-v-island", islandId);
|
|
745
|
+
const script = document.createElement("script");
|
|
746
|
+
script.setAttribute("data-v-island-props", "");
|
|
747
|
+
script.setAttribute("type", "application/json");
|
|
748
|
+
script.textContent = JSON.stringify(props);
|
|
749
|
+
wrapper.appendChild(script);
|
|
750
|
+
const content = Component(props);
|
|
751
|
+
if (content != null) {
|
|
752
|
+
if (content instanceof Node) {
|
|
753
|
+
wrapper.appendChild(content);
|
|
754
|
+
} else if (typeof content === "string") {
|
|
755
|
+
wrapper.appendChild(document.createTextNode(content));
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
return wrapper;
|
|
759
|
+
}
|
|
623
760
|
// src/mount.ts
|
|
624
761
|
var MOUNTED_KEY = Symbol.for("vertz:mounted-roots");
|
|
625
762
|
var _global = globalThis;
|
|
@@ -766,8 +903,10 @@ export {
|
|
|
766
903
|
keyframes,
|
|
767
904
|
isRenderNode,
|
|
768
905
|
isQueryDescriptor,
|
|
906
|
+
isBrowser,
|
|
769
907
|
invalidate,
|
|
770
908
|
injectCSS,
|
|
909
|
+
hydrateIslands,
|
|
771
910
|
hydrate,
|
|
772
911
|
globalCss,
|
|
773
912
|
getRelationSchema,
|
|
@@ -777,6 +916,7 @@ export {
|
|
|
777
916
|
getAdapter,
|
|
778
917
|
formDataToObject,
|
|
779
918
|
form,
|
|
919
|
+
font,
|
|
780
920
|
fadeOut,
|
|
781
921
|
fadeIn,
|
|
782
922
|
defineTheme,
|
|
@@ -790,9 +930,12 @@ export {
|
|
|
790
930
|
createDialogStack,
|
|
791
931
|
createDOMAdapter,
|
|
792
932
|
createContext,
|
|
933
|
+
configureImageOptimizer,
|
|
793
934
|
computed,
|
|
794
935
|
compileTheme,
|
|
936
|
+
compileFonts,
|
|
795
937
|
children,
|
|
938
|
+
buildOptimizedUrl,
|
|
796
939
|
batch,
|
|
797
940
|
accordionUp,
|
|
798
941
|
accordionDown,
|
|
@@ -811,6 +954,10 @@ export {
|
|
|
811
954
|
OutletContext,
|
|
812
955
|
Outlet,
|
|
813
956
|
ListTransition,
|
|
957
|
+
Link,
|
|
958
|
+
Island,
|
|
959
|
+
Image,
|
|
960
|
+
FieldSelectionTracker,
|
|
814
961
|
ErrorBoundary,
|
|
815
962
|
EntityStore,
|
|
816
963
|
DisposalScopeError,
|
package/dist/src/internals.d.ts
CHANGED
|
@@ -80,6 +80,49 @@ declare function getContextScope(): ContextScope | null;
|
|
|
80
80
|
* @internal
|
|
81
81
|
*/
|
|
82
82
|
declare function setContextScope(scope: ContextScope | null): ContextScope | null;
|
|
83
|
+
interface FontSrc {
|
|
84
|
+
path: string;
|
|
85
|
+
weight?: string | number;
|
|
86
|
+
style?: "normal" | "italic";
|
|
87
|
+
}
|
|
88
|
+
type FallbackFontName = "Arial" | "Times New Roman" | "Courier New";
|
|
89
|
+
interface FontFallbackMetrics {
|
|
90
|
+
/** CSS ascent-override value, e.g., '94.52%' */
|
|
91
|
+
ascentOverride: string;
|
|
92
|
+
/** CSS descent-override value, e.g., '24.60%' */
|
|
93
|
+
descentOverride: string;
|
|
94
|
+
/** CSS line-gap-override value, e.g., '0.00%' */
|
|
95
|
+
lineGapOverride: string;
|
|
96
|
+
/** CSS size-adjust value, e.g., '104.88%' */
|
|
97
|
+
sizeAdjust: string;
|
|
98
|
+
/** System font used as fallback base. */
|
|
99
|
+
fallbackFont: FallbackFontName;
|
|
100
|
+
}
|
|
101
|
+
interface CompileFontsOptions {
|
|
102
|
+
/** Pre-computed fallback metrics per font key. Provided by @vertz/ui-server at build/SSR time. */
|
|
103
|
+
fallbackMetrics?: Record<string, FontFallbackMetrics>;
|
|
104
|
+
}
|
|
105
|
+
type FontStyle = "normal" | "italic";
|
|
106
|
+
type FontDisplay = "auto" | "block" | "swap" | "fallback" | "optional";
|
|
107
|
+
interface FontDescriptor {
|
|
108
|
+
readonly __brand: "FontDescriptor";
|
|
109
|
+
readonly family: string;
|
|
110
|
+
readonly weight: string;
|
|
111
|
+
readonly style: FontStyle;
|
|
112
|
+
readonly display: FontDisplay;
|
|
113
|
+
readonly src?: string | FontSrc[];
|
|
114
|
+
readonly fallback: string[];
|
|
115
|
+
readonly subsets: string[];
|
|
116
|
+
readonly unicodeRange?: string;
|
|
117
|
+
readonly adjustFontFallback: boolean | FallbackFontName;
|
|
118
|
+
}
|
|
119
|
+
/** Structured description of a resource to preload. */
|
|
120
|
+
interface PreloadItem {
|
|
121
|
+
href: string;
|
|
122
|
+
as: "font" | "image" | "style" | "script";
|
|
123
|
+
type?: string;
|
|
124
|
+
crossorigin?: boolean;
|
|
125
|
+
}
|
|
83
126
|
/** Color tokens: a map of color names to their raw/contextual values. */
|
|
84
127
|
type ColorTokens = Record<string, Record<string, string>>;
|
|
85
128
|
/** Spacing tokens: a flat map of names to CSS values. */
|
|
@@ -90,6 +133,8 @@ interface Theme {
|
|
|
90
133
|
colors: ColorTokens;
|
|
91
134
|
/** Spacing scale tokens. */
|
|
92
135
|
spacing?: SpacingTokens;
|
|
136
|
+
/** Font descriptors keyed by token name. */
|
|
137
|
+
fonts?: Record<string, FontDescriptor>;
|
|
93
138
|
}
|
|
94
139
|
/** Output of compileTheme(). */
|
|
95
140
|
interface CompiledTheme {
|
|
@@ -97,6 +142,15 @@ interface CompiledTheme {
|
|
|
97
142
|
css: string;
|
|
98
143
|
/** Flat list of token dot-paths (e.g., 'primary.500', 'background'). */
|
|
99
144
|
tokens: string[];
|
|
145
|
+
/** Font preload link tags for injection into <head>. */
|
|
146
|
+
preloadTags: string;
|
|
147
|
+
/** Structured preload data for generating HTTP Link headers. */
|
|
148
|
+
preloadItems: PreloadItem[];
|
|
149
|
+
}
|
|
150
|
+
/** Options for compileTheme(). */
|
|
151
|
+
interface CompileThemeOptions {
|
|
152
|
+
/** Pre-computed font fallback metrics for zero-CLS font loading. */
|
|
153
|
+
fallbackMetrics?: CompileFontsOptions["fallbackMetrics"];
|
|
100
154
|
}
|
|
101
155
|
/**
|
|
102
156
|
* Compile a theme into CSS custom properties.
|
|
@@ -108,7 +162,7 @@ interface CompiledTheme {
|
|
|
108
162
|
* @param theme - A theme object from defineTheme().
|
|
109
163
|
* @returns Compiled CSS and token list.
|
|
110
164
|
*/
|
|
111
|
-
declare function compileTheme(theme: Theme): CompiledTheme;
|
|
165
|
+
declare function compileTheme(theme: Theme, options?: CompileThemeOptions): CompiledTheme;
|
|
112
166
|
/**
|
|
113
167
|
* Shared CSS token lookup tables.
|
|
114
168
|
*
|
|
@@ -383,12 +437,23 @@ declare function clearChildren(container: Node): void;
|
|
|
383
437
|
* @returns A dispose function to stop the reactive list reconciliation
|
|
384
438
|
*/
|
|
385
439
|
declare function __list<T>(container: HTMLElement, items: Signal<T[]> | (() => T[]), keyFn: (item: T, index: number) => string | number, renderFn: (item: T) => Node): DisposeFn;
|
|
440
|
+
/**
|
|
441
|
+
* Returns true when running in a real browser environment.
|
|
442
|
+
* Returns false on the server, even if `window` exists (DOM shim).
|
|
443
|
+
*
|
|
444
|
+
* Uses `hasSSRResolver()` — which returns true when an SSR resolver
|
|
445
|
+
* has been registered — instead of `getSSRContext()` which only returns
|
|
446
|
+
* a value inside `ssrStorage.run()`. This correctly identifies server
|
|
447
|
+
* module-scope code (e.g., HMR re-imports where `createRouter()` runs
|
|
448
|
+
* at import time, outside any SSR render context).
|
|
449
|
+
*/
|
|
450
|
+
declare function isBrowser(): boolean;
|
|
386
451
|
/** A function returning a dynamic import of a component module. */
|
|
387
452
|
type ComponentLoader = () => Promise<{
|
|
388
453
|
default: ComponentFunction;
|
|
389
454
|
}>;
|
|
390
|
-
/** A component function that takes props and an element to mount into. */
|
|
391
|
-
type ComponentFunction = (props: Record<string, unknown>, el
|
|
455
|
+
/** A component function that takes props and optionally an element to mount into. May return a Node. */
|
|
456
|
+
type ComponentFunction = (props: Record<string, unknown>, el?: Element) => Node | void;
|
|
392
457
|
/** Maps component IDs to their dynamic import loaders. */
|
|
393
458
|
type ComponentRegistry = Record<string, ComponentLoader>;
|
|
394
459
|
/**
|
|
@@ -413,14 +478,27 @@ interface CacheStore<T = unknown> {
|
|
|
413
478
|
clear?(): void;
|
|
414
479
|
}
|
|
415
480
|
/**
|
|
416
|
-
* Default in-memory cache backed by a Map.
|
|
481
|
+
* Default in-memory cache backed by a Map with optional LRU eviction.
|
|
482
|
+
*
|
|
483
|
+
* When `maxSize` is finite, least-recently-used entries are evicted on `set()`
|
|
484
|
+
* when the cache exceeds the limit. `get()` promotes entries to most-recently-used.
|
|
417
485
|
*/
|
|
418
486
|
declare class MemoryCache<T = unknown> implements CacheStore<T> {
|
|
419
487
|
private _store;
|
|
488
|
+
private _maxSize;
|
|
489
|
+
private _refs;
|
|
490
|
+
private _orphans;
|
|
491
|
+
constructor(options?: {
|
|
492
|
+
maxSize?: number;
|
|
493
|
+
});
|
|
420
494
|
get(key: string): T | undefined;
|
|
421
495
|
set(key: string, value: T): void;
|
|
422
496
|
delete(key: string): void;
|
|
423
497
|
clear(): void;
|
|
498
|
+
/** Mark a cache key as actively used by a query instance. */
|
|
499
|
+
retain(key: string): void;
|
|
500
|
+
/** Release a cache key when a query instance disposes or changes key. */
|
|
501
|
+
release(key: string): void;
|
|
424
502
|
}
|
|
425
503
|
/**
|
|
426
504
|
* Derive a cache key from a thunk function.
|
|
@@ -492,6 +570,8 @@ interface RouteConfig<
|
|
|
492
570
|
searchParams?: SearchParamSchema<TSearch>;
|
|
493
571
|
/** Nested child routes. */
|
|
494
572
|
children?: RouteDefinitionMap;
|
|
573
|
+
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
574
|
+
prerender?: boolean;
|
|
495
575
|
}
|
|
496
576
|
/** A map of path patterns to route configs (user input format). */
|
|
497
577
|
interface RouteDefinitionMap {
|
|
@@ -513,6 +593,8 @@ interface CompiledRoute {
|
|
|
513
593
|
searchParams?: RouteConfig["searchParams"];
|
|
514
594
|
/** Compiled children. */
|
|
515
595
|
children?: CompiledRoute[];
|
|
596
|
+
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
597
|
+
prerender?: boolean;
|
|
516
598
|
}
|
|
517
599
|
/** A single matched route entry in the matched chain. */
|
|
518
600
|
interface MatchedRoute {
|
|
@@ -666,11 +748,22 @@ interface SerializedStore {
|
|
|
666
748
|
}>;
|
|
667
749
|
}
|
|
668
750
|
/**
|
|
751
|
+
* Options for mergeWithSelect — metadata about field selection.
|
|
752
|
+
*/
|
|
753
|
+
interface MergeSelectOptions {
|
|
754
|
+
/** Fields that were part of the query's select set */
|
|
755
|
+
fields: string[];
|
|
756
|
+
/** Query source identifier for diagnostics (e.g., 'GET:/users') */
|
|
757
|
+
querySource: string;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
669
760
|
* Options for EntityStore constructor.
|
|
670
761
|
*/
|
|
671
762
|
interface EntityStoreOptions {
|
|
672
763
|
/** Initial data to hydrate from (SSR). */
|
|
673
764
|
initialData?: SerializedStore;
|
|
765
|
+
/** Enable dev-mode field selection tracking (zero overhead when false). */
|
|
766
|
+
devMode?: boolean;
|
|
674
767
|
}
|
|
675
768
|
/**
|
|
676
769
|
* EntityStore - Normalized, signal-backed entity cache for @vertz/ui.
|
|
@@ -682,6 +775,7 @@ declare class EntityStore {
|
|
|
682
775
|
private _entities;
|
|
683
776
|
private _typeListeners;
|
|
684
777
|
private _queryIndices;
|
|
778
|
+
private _fieldTracker;
|
|
685
779
|
/** Public accessor for query indices — used by optimistic handlers and tests. */
|
|
686
780
|
get queryIndices(): QueryResultIndex;
|
|
687
781
|
constructor(options?: EntityStoreOptions);
|
|
@@ -705,6 +799,14 @@ declare class EntityStore {
|
|
|
705
799
|
id: string;
|
|
706
800
|
}>(type: string, data: T | T[]): void;
|
|
707
801
|
/**
|
|
802
|
+
* Merge entities with field selection metadata.
|
|
803
|
+
* Registers the select set for dev-mode access warnings.
|
|
804
|
+
* In production (devMode: false), behaves identically to merge().
|
|
805
|
+
*/
|
|
806
|
+
mergeWithSelect<T extends {
|
|
807
|
+
id: string;
|
|
808
|
+
}>(type: string, data: T | T[], selectOptions: MergeSelectOptions): void;
|
|
809
|
+
/**
|
|
708
810
|
* Remove an entity from the store.
|
|
709
811
|
* Triggers type change listeners and removes from query indices.
|
|
710
812
|
*/
|
|
@@ -790,8 +892,15 @@ declare class EntityStore {
|
|
|
790
892
|
private _mergeOne;
|
|
791
893
|
/**
|
|
792
894
|
* Recompute the visible signal value from base + all layers.
|
|
895
|
+
* Uses lastPlainVisible for equality check to avoid triggering
|
|
896
|
+
* field selection Proxy warnings during internal store operations.
|
|
793
897
|
*/
|
|
794
898
|
private _recomputeVisible;
|
|
899
|
+
/**
|
|
900
|
+
* Wrap entity in dev-mode Proxy for field selection warnings.
|
|
901
|
+
* No-op when devMode is off or no tracking exists.
|
|
902
|
+
*/
|
|
903
|
+
private _wrapWithFieldProxy;
|
|
795
904
|
private _getOrCreateTypeMap;
|
|
796
905
|
private _getOrCreateListeners;
|
|
797
906
|
private _notifyTypeChange;
|
|
@@ -843,8 +952,35 @@ interface SSRRenderContext {
|
|
|
843
952
|
errors: unknown[];
|
|
844
953
|
/** Global per-query timeout override (ms). */
|
|
845
954
|
globalSSRTimeout?: number;
|
|
955
|
+
/**
|
|
956
|
+
* Lazy route component Promises registered by RouterView during Pass 1.
|
|
957
|
+
* Keyed by CompiledRoute object identity to avoid pattern string collisions.
|
|
958
|
+
*/
|
|
959
|
+
pendingRouteComponents?: Map<object, Promise<{
|
|
960
|
+
default: () => Node;
|
|
961
|
+
}>>;
|
|
962
|
+
/**
|
|
963
|
+
* Resolved sync factories, populated between Pass 1 and Pass 2.
|
|
964
|
+
* Keyed by CompiledRoute object identity.
|
|
965
|
+
*/
|
|
966
|
+
resolvedComponents?: Map<object, () => Node>;
|
|
967
|
+
/**
|
|
968
|
+
* Route patterns discovered by createRouter() during SSR.
|
|
969
|
+
* Used by the build pipeline to discover which routes to pre-render.
|
|
970
|
+
*/
|
|
971
|
+
discoveredRoutes?: string[];
|
|
846
972
|
}
|
|
847
973
|
type SSRContextResolver = () => SSRRenderContext | undefined;
|
|
848
974
|
declare function registerSSRResolver(resolver: SSRContextResolver | null): void;
|
|
849
975
|
declare function getSSRContext(): SSRRenderContext | undefined;
|
|
850
|
-
|
|
976
|
+
/**
|
|
977
|
+
* Returns true when an SSR resolver has been registered.
|
|
978
|
+
*
|
|
979
|
+
* This indicates we are running on the server — regardless of whether
|
|
980
|
+
* an SSR render is currently active. The resolver is registered once
|
|
981
|
+
* at import time by `@vertz/ui-server` and never cleared during the
|
|
982
|
+
* server's lifetime. Stored on globalThis so it survives require.cache
|
|
983
|
+
* clears during HMR module re-evaluation.
|
|
984
|
+
*/
|
|
985
|
+
declare function hasSSRResolver(): boolean;
|
|
986
|
+
export { stopSignalCollection, startSignalCollection, setContextScope, setAdapter, runCleanups, resolveComponent, removeNode, registerSSRResolver, pushScope, popScope, onCleanup, onAnimationsComplete, matchRoute, matchPath, lifecycleEffect, isRenderNode, isBrowser, insertBefore, hasSSRResolver, getSSRContext, getContextScope, getAdapter, executeLoaders, domEffect, deserializeProps, deriveKey, createDOMAdapter, compileTheme, clearChildren, _tryOnCleanup, __text, __staticText, __show, __on, __list, __insert, __exitChildren, __enterChildren, __element, __conditional, __classList, __child, __attr, __append, SSRRenderContext, SSRQueryEntry, SPACING_SCALE, SIZE_KEYWORDS, SHADOW_SCALE, RenderText, RenderNode, RenderElement, RenderAdapter, RENDER_NODE_BRAND, RADIUS_SCALE, QueryEnvelopeStore, PropertyMapping, PSEUDO_PREFIXES, PSEUDO_MAP, PROPERTY_MAP, MemoryCache, MatchResult, LINE_HEIGHT_SCALE, KEYWORD_MAP, HEIGHT_AXIS_PROPERTIES, FONT_WEIGHT_SCALE, FONT_SIZE_SCALE, EntityStore, DISPLAY_MAP, CSS_COLOR_KEYWORDS, CSSDeclarationEntry, CONTENT_MAP, COLOR_NAMESPACES, ALIGNMENT_MAP };
|
package/dist/src/internals.js
CHANGED
|
@@ -2,24 +2,23 @@ import {
|
|
|
2
2
|
deserializeProps,
|
|
3
3
|
onAnimationsComplete,
|
|
4
4
|
resolveComponent
|
|
5
|
-
} from "../shared/chunk-
|
|
5
|
+
} from "../shared/chunk-6jyt4ycw.js";
|
|
6
6
|
import {
|
|
7
7
|
__attr,
|
|
8
8
|
__classList,
|
|
9
|
-
__on,
|
|
10
9
|
__show
|
|
11
|
-
} from "../shared/chunk-
|
|
10
|
+
} from "../shared/chunk-1rxa2fz4.js";
|
|
12
11
|
import {
|
|
13
12
|
executeLoaders,
|
|
14
13
|
matchPath,
|
|
15
14
|
matchRoute
|
|
16
|
-
} from "../shared/chunk-
|
|
15
|
+
} from "../shared/chunk-6wd36w21.js";
|
|
17
16
|
import {
|
|
18
17
|
EntityStore,
|
|
19
18
|
MemoryCache,
|
|
20
19
|
QueryEnvelopeStore,
|
|
21
20
|
deriveKey
|
|
22
|
-
} from "../shared/chunk-
|
|
21
|
+
} from "../shared/chunk-4mtn7af6.js";
|
|
23
22
|
import"../shared/chunk-jrtrk5z4.js";
|
|
24
23
|
import {
|
|
25
24
|
ALIGNMENT_MAP,
|
|
@@ -40,7 +39,13 @@ import {
|
|
|
40
39
|
SIZE_KEYWORDS,
|
|
41
40
|
SPACING_SCALE,
|
|
42
41
|
compileTheme
|
|
43
|
-
} from "../shared/chunk-
|
|
42
|
+
} from "../shared/chunk-dhehvmj0.js";
|
|
43
|
+
import {
|
|
44
|
+
__on
|
|
45
|
+
} from "../shared/chunk-pnv25zep.js";
|
|
46
|
+
import {
|
|
47
|
+
isBrowser
|
|
48
|
+
} from "../shared/chunk-14eqne2a.js";
|
|
44
49
|
import {
|
|
45
50
|
__append,
|
|
46
51
|
__child,
|
|
@@ -53,7 +58,7 @@ import {
|
|
|
53
58
|
claimComment,
|
|
54
59
|
claimText,
|
|
55
60
|
getIsHydrating
|
|
56
|
-
} from "../shared/chunk-
|
|
61
|
+
} from "../shared/chunk-vndfjfdy.js";
|
|
57
62
|
import"../shared/chunk-prj7nm08.js";
|
|
58
63
|
import {
|
|
59
64
|
RENDER_NODE_BRAND,
|
|
@@ -61,12 +66,13 @@ import {
|
|
|
61
66
|
getAdapter,
|
|
62
67
|
isRenderNode,
|
|
63
68
|
setAdapter
|
|
64
|
-
} from "../shared/chunk-
|
|
69
|
+
} from "../shared/chunk-afawz764.js";
|
|
65
70
|
import {
|
|
66
71
|
_tryOnCleanup,
|
|
67
72
|
domEffect,
|
|
68
73
|
getContextScope,
|
|
69
74
|
getSSRContext,
|
|
75
|
+
hasSSRResolver,
|
|
70
76
|
lifecycleEffect,
|
|
71
77
|
onCleanup,
|
|
72
78
|
popScope,
|
|
@@ -77,7 +83,7 @@ import {
|
|
|
77
83
|
signal,
|
|
78
84
|
startSignalCollection,
|
|
79
85
|
stopSignalCollection
|
|
80
|
-
} from "../shared/chunk-
|
|
86
|
+
} from "../shared/chunk-4fwcwxn6.js";
|
|
81
87
|
// src/dom/conditional.ts
|
|
82
88
|
function normalizeNode(branchResult) {
|
|
83
89
|
if (branchResult == null || typeof branchResult === "boolean") {
|
|
@@ -325,7 +331,9 @@ export {
|
|
|
325
331
|
matchPath,
|
|
326
332
|
lifecycleEffect,
|
|
327
333
|
isRenderNode,
|
|
334
|
+
isBrowser,
|
|
328
335
|
insertBefore,
|
|
336
|
+
hasSSRResolver,
|
|
329
337
|
getSSRContext,
|
|
330
338
|
getContextScope,
|
|
331
339
|
getAdapter,
|
package/dist/src/query/public.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
query,
|
|
3
3
|
queryMatch
|
|
4
|
-
} from "../../shared/chunk-
|
|
4
|
+
} from "../../shared/chunk-4mtn7af6.js";
|
|
5
5
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
6
|
-
import"../../shared/chunk-
|
|
7
|
-
import"../../shared/chunk-
|
|
6
|
+
import"../../shared/chunk-14eqne2a.js";
|
|
7
|
+
import"../../shared/chunk-afawz764.js";
|
|
8
|
+
import"../../shared/chunk-4fwcwxn6.js";
|
|
8
9
|
|
|
9
10
|
// src/query/public.ts
|
|
10
11
|
import { isQueryDescriptor } from "@vertz/fetch";
|