@pyreon/zero 0.12.2 → 0.12.3
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/lib/actions.js +97 -0
- package/lib/actions.js.map +1 -0
- package/lib/ai.js +503 -0
- package/lib/ai.js.map +1 -0
- package/lib/api-routes.js +137 -0
- package/lib/api-routes.js.map +1 -0
- package/lib/compression.js +80 -0
- package/lib/compression.js.map +1 -0
- package/lib/cors.js +57 -0
- package/lib/cors.js.map +1 -0
- package/lib/csp.js +119 -0
- package/lib/csp.js.map +1 -0
- package/lib/env.js +217 -0
- package/lib/env.js.map +1 -0
- package/lib/favicon.js +424 -0
- package/lib/favicon.js.map +1 -0
- package/lib/i18n-routing.js +167 -0
- package/lib/i18n-routing.js.map +1 -0
- package/lib/index.js +80 -22
- package/lib/index.js.map +1 -1
- package/lib/link.js +5 -0
- package/lib/link.js.map +1 -1
- package/lib/logger.js +78 -0
- package/lib/logger.js.map +1 -0
- package/lib/meta.js +336 -0
- package/lib/meta.js.map +1 -0
- package/lib/middleware.js +53 -0
- package/lib/middleware.js.map +1 -0
- package/lib/og-image.js +233 -0
- package/lib/og-image.js.map +1 -0
- package/lib/rate-limit.js +76 -0
- package/lib/rate-limit.js.map +1 -0
- package/lib/testing.js +179 -0
- package/lib/testing.js.map +1 -0
- package/lib/theme.js +11 -2
- package/lib/theme.js.map +1 -1
- package/lib/types/actions.d.ts +27 -24
- package/lib/types/actions.d.ts.map +1 -1
- package/lib/types/ai.d.ts +76 -95
- package/lib/types/ai.d.ts.map +1 -1
- package/lib/types/api-routes.d.ts +37 -33
- package/lib/types/api-routes.d.ts.map +1 -1
- package/lib/types/cache.d.ts +26 -22
- package/lib/types/cache.d.ts.map +1 -1
- package/lib/types/client.d.ts +13 -9
- package/lib/types/client.d.ts.map +1 -1
- package/lib/types/compression.d.ts +14 -10
- package/lib/types/compression.d.ts.map +1 -1
- package/lib/types/config.d.ts +39 -4
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/cors.d.ts +20 -16
- package/lib/types/cors.d.ts.map +1 -1
- package/lib/types/csp.d.ts +42 -61
- package/lib/types/csp.d.ts.map +1 -1
- package/lib/types/env.d.ts +26 -26
- package/lib/types/env.d.ts.map +1 -1
- package/lib/types/favicon.d.ts +58 -54
- package/lib/types/favicon.d.ts.map +1 -1
- package/lib/types/font.d.ts +68 -65
- package/lib/types/font.d.ts.map +1 -1
- package/lib/types/i18n-routing.d.ts +43 -37
- package/lib/types/i18n-routing.d.ts.map +1 -1
- package/lib/types/image-plugin.d.ts +49 -45
- package/lib/types/image-plugin.d.ts.map +1 -1
- package/lib/types/image.d.ts +47 -36
- package/lib/types/image.d.ts.map +1 -1
- package/lib/types/index.d.ts +1961 -56
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/link.d.ts +61 -56
- package/lib/types/link.d.ts.map +1 -1
- package/lib/types/logger.d.ts +37 -48
- package/lib/types/logger.d.ts.map +1 -1
- package/lib/types/meta.d.ts +180 -105
- package/lib/types/meta.d.ts.map +1 -1
- package/lib/types/middleware.d.ts +8 -4
- package/lib/types/middleware.d.ts.map +1 -1
- package/lib/types/og-image.d.ts +63 -59
- package/lib/types/og-image.d.ts.map +1 -1
- package/lib/types/rate-limit.d.ts +20 -16
- package/lib/types/rate-limit.d.ts.map +1 -1
- package/lib/types/script.d.ts +23 -19
- package/lib/types/script.d.ts.map +1 -1
- package/lib/types/seo.d.ts +47 -43
- package/lib/types/seo.d.ts.map +1 -1
- package/lib/types/testing.d.ts +64 -27
- package/lib/types/testing.d.ts.map +1 -1
- package/lib/types/theme.d.ts +22 -12
- package/lib/types/theme.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/actions.ts +1 -3
- package/src/adapters/bun.ts +2 -0
- package/src/adapters/cloudflare.ts +2 -0
- package/src/adapters/netlify.ts +2 -0
- package/src/adapters/node.ts +2 -0
- package/src/adapters/validate.ts +16 -0
- package/src/adapters/vercel.ts +2 -0
- package/src/compression.ts +19 -3
- package/src/entry-server.ts +28 -5
- package/src/index.ts +1 -0
- package/src/link.tsx +6 -0
- package/src/meta.tsx +41 -13
- package/src/rate-limit.ts +11 -9
- package/src/theme.tsx +12 -1
- package/src/vite-plugin.ts +5 -1
- package/lib/types/adapters/bun.d.ts +0 -6
- package/lib/types/adapters/bun.d.ts.map +0 -1
- package/lib/types/adapters/cloudflare.d.ts +0 -26
- package/lib/types/adapters/cloudflare.d.ts.map +0 -1
- package/lib/types/adapters/index.d.ts +0 -13
- package/lib/types/adapters/index.d.ts.map +0 -1
- package/lib/types/adapters/netlify.d.ts +0 -21
- package/lib/types/adapters/netlify.d.ts.map +0 -1
- package/lib/types/adapters/node.d.ts +0 -6
- package/lib/types/adapters/node.d.ts.map +0 -1
- package/lib/types/adapters/static.d.ts +0 -7
- package/lib/types/adapters/static.d.ts.map +0 -1
- package/lib/types/adapters/vercel.d.ts +0 -21
- package/lib/types/adapters/vercel.d.ts.map +0 -1
- package/lib/types/app.d.ts +0 -24
- package/lib/types/app.d.ts.map +0 -1
- package/lib/types/entry-server.d.ts +0 -37
- package/lib/types/entry-server.d.ts.map +0 -1
- package/lib/types/error-overlay.d.ts +0 -6
- package/lib/types/error-overlay.d.ts.map +0 -1
- package/lib/types/fs-router.d.ts +0 -47
- package/lib/types/fs-router.d.ts.map +0 -1
- package/lib/types/isr.d.ts +0 -9
- package/lib/types/isr.d.ts.map +0 -1
- package/lib/types/not-found.d.ts +0 -7
- package/lib/types/not-found.d.ts.map +0 -1
- package/lib/types/types.d.ts +0 -111
- package/lib/types/types.d.ts.map +0 -1
- package/lib/types/utils/use-intersection-observer.d.ts +0 -10
- package/lib/types/utils/use-intersection-observer.d.ts.map +0 -1
- package/lib/types/utils/with-headers.d.ts +0 -6
- package/lib/types/utils/with-headers.d.ts.map +0 -1
- package/lib/types/vite-plugin.d.ts +0 -17
- package/lib/types/vite-plugin.d.ts.map +0 -1
package/lib/types/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"env2.d.ts","names":[],"sources":["../../../src/env.ts"],"mappings":";;AAsBA;;;;;;;;;;;AASA;;;;;;;;;UATiB,mBAAA;EAYf;EAVA,QAAA;EAWe;EATf,OAAA,GAAU,CAAA;EASM;EAPhB,WAAA;AAAA;AAAA,UAGe,YAAA;EACf,MAAA;EACA,KAAA,GAAQ,GAAA,sBAAyB,GAAA,aAAgB,CAAA;EACjD,QAAA;EACA,YAAA,GAAe,CAAA;AAAA;;AA2BjB;;iBAnBgB,GAAA,CAAI,OAAA,GAAU,mBAAA,WAA8B,YAAA;;;;iBAmB5C,GAAA,CAAI,OAAA,GAAU,mBAAA,WAA8B,YAAA;;;AAuB5D;iBAAgB,IAAA,CAAK,OAAA,GAAU,mBAAA,YAA+B,YAAA;;;;iBAsB9C,GAAA,CAAI,OAAA,GAAU,mBAAA,WAA8B,YAAA;;;;iBAwB5C,KAAA,kBAAA,CACd,MAAA,WAAiB,CAAA,IACjB,OAAA,GAAU,mBAAA,CAAoB,CAAA,IAC7B,YAAA,CAAa,CAAA;;KAmEX,WAAA,+BAED,iBAAA,GAAoB,iBAAA,GAAoB,kBAAA,GACxC,YAAA;;KAGC,UAAA,MACH,CAAA,SAAU,YAAA,YAAwB,CAAA,GAClC,CAAA,SAAU,iBAAA,YACV,CAAA,SAAU,iBAAA,YACV,CAAA,SAAU,kBAAA,aACV,CAAA,2BACA,CAAA,2BACA,CAAA;AAAA,KAGG,cAAA,oBACS,CAAA,GAAI,UAAA,CAAW,CAAA,CAAE,CAAA;;AAvF/B;;;;;;;;;;;;;;;;;;;;AAwBC;iBA0Fe,WAAA,WAAsB,MAAA,SAAe,WAAA,EAAA,CACnD,MAAA,EAAQ,CAAA,EACR,MAAA,GAAS,MAAA,+BACR,cAAA,CAAe,CAAA;;;;;;;;;;;;;iBAqCF,SAAA,CAAA,GAAa,MAAA;AAAA,iBACb,SAAA,WAAoB,MAAA,SAAe,WAAA,EAAA,CAAc,MAAA,EAAQ,CAAA,GAAI,cAAA,CAAe,CAAA;;;;;;;;;;;;;;;;;iBAwC5E,MAAA,GAAA,CAAU,KAAA,GAAQ,GAAA,aAAgB,CAAA,GAAI,YAAA,CAAa,CAAA"}
|
package/lib/types/favicon.d.ts
CHANGED
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
|
+
|
|
3
|
+
//#region src/favicon.d.ts
|
|
4
|
+
interface FaviconLocaleConfig {
|
|
5
|
+
/** Locale-specific source icon (SVG or PNG). */
|
|
6
|
+
source: string;
|
|
7
|
+
/** Optional dark mode variant for this locale. */
|
|
8
|
+
darkSource?: string;
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
10
|
+
interface FaviconPluginConfig {
|
|
11
|
+
/** Path to the source icon (SVG or PNG, at least 512x512 for PNG). */
|
|
12
|
+
source: string;
|
|
13
|
+
/** Theme color for web manifest. Default: "#ffffff" */
|
|
14
|
+
themeColor?: string;
|
|
15
|
+
/** Background color for web manifest. Default: "#ffffff" */
|
|
16
|
+
backgroundColor?: string;
|
|
17
|
+
/** App name for web manifest. Uses package.json name if not set. */
|
|
18
|
+
name?: string;
|
|
19
|
+
/** Generate web manifest. Default: true */
|
|
20
|
+
manifest?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Dark mode favicon (SVG only).
|
|
23
|
+
* When provided, the SVG favicon uses prefers-color-scheme media query
|
|
24
|
+
* to switch between light and dark variants.
|
|
25
|
+
*/
|
|
26
|
+
darkSource?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Locale-specific icon overrides. Each key is a locale code,
|
|
29
|
+
* value is a source icon (and optional dark variant).
|
|
30
|
+
* Locales not in this map use the base `source`.
|
|
31
|
+
*
|
|
32
|
+
* Generated files are placed under `/{locale}/` prefix:
|
|
33
|
+
* /de/favicon.svg, /de/favicon-32x32.png, etc.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* faviconPlugin({
|
|
38
|
+
* source: "./icon.svg",
|
|
39
|
+
* locales: {
|
|
40
|
+
* de: { source: "./icon-de.svg" },
|
|
41
|
+
* cs: { source: "./icon-cs.svg" },
|
|
42
|
+
* },
|
|
43
|
+
* })
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
locales?: Record<string, FaviconLocaleConfig>;
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
47
49
|
* Favicon generation Vite plugin.
|
|
@@ -59,7 +61,7 @@ export interface FaviconPluginConfig {
|
|
|
59
61
|
* }
|
|
60
62
|
* ```
|
|
61
63
|
*/
|
|
62
|
-
|
|
64
|
+
declare function faviconPlugin(config: FaviconPluginConfig): Plugin;
|
|
63
65
|
/**
|
|
64
66
|
* Get favicon link tags for a specific locale.
|
|
65
67
|
* Returns link objects suitable for `useHead()` or direct HTML injection.
|
|
@@ -70,16 +72,18 @@ export declare function faviconPlugin(config: FaviconPluginConfig): Plugin;
|
|
|
70
72
|
* // → [{ rel: "icon", type: "image/svg+xml", href: "/de/favicon.svg" }, ...]
|
|
71
73
|
* ```
|
|
72
74
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
declare function faviconLinks(locale: string | undefined, config: FaviconPluginConfig): Array<{
|
|
76
|
+
rel: string;
|
|
77
|
+
type?: string;
|
|
78
|
+
sizes?: string;
|
|
79
|
+
href: string;
|
|
78
80
|
}>;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
interface IcoEntry {
|
|
82
|
+
buffer: Buffer;
|
|
83
|
+
size: number;
|
|
82
84
|
}
|
|
83
85
|
/** @internal Exported for testing */
|
|
84
|
-
|
|
85
|
-
//#
|
|
86
|
+
declare function createIcoFromPngs(entries: IcoEntry[]): Uint8Array;
|
|
87
|
+
//#endregion
|
|
88
|
+
export { FaviconLocaleConfig, FaviconPluginConfig, IcoEntry, createIcoFromPngs, faviconLinks, faviconPlugin };
|
|
89
|
+
//# sourceMappingURL=favicon2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"favicon2.d.ts","names":[],"sources":["../../../src/favicon.ts"],"mappings":";;;UA6BiB,mBAAA;;EAEf,MAAA;EAFkC;EAIlC,UAAA;AAAA;AAAA,UAGe,mBAAA;EAAA;EAEf,MAAA;;EAEA,UAAA;EAFA;EAIA,eAAA;EAAA;EAEA,IAAA;EAEA;EAAA,QAAA;EA0BA;;;;;EApBA,UAAA;EAoD2B;;;;;;;;AAmU7B;;;;;;;;;;;EAnWE,OAAA,GAAU,MAAA,SAAe,mBAAA;AAAA;;AAyZ3B;;;;;;;;;AAMA;;;;;;iBA/XgB,aAAA,CAAc,MAAA,EAAQ,mBAAA,GAAsB,MAAA;;;;;;;;;;;iBAmU5C,YAAA,CACd,MAAA,sBACA,MAAA,EAAQ,mBAAA,GACP,KAAA;EAAQ,GAAA;EAAa,IAAA;EAAe,KAAA;EAAgB,IAAA;AAAA;AAAA,UAmDtC,QAAA;EACf,MAAA,EAAQ,MAAA;EACR,IAAA;AAAA;;iBAIc,iBAAA,CAAkB,OAAA,EAAS,QAAA,KAAa,UAAA"}
|
package/lib/types/font.d.ts
CHANGED
|
@@ -1,81 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
|
+
|
|
3
|
+
//#region src/font.d.ts
|
|
4
|
+
interface FontConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Google Fonts families.
|
|
7
|
+
*
|
|
8
|
+
* Accepts both string shorthand and structured objects:
|
|
9
|
+
* - String: "Inter:wght@400;500;700" or "Inter:wght@100..900"
|
|
10
|
+
* - Object: { family: "Inter", weights: [400, 500, 700] }
|
|
11
|
+
* - Variable: { family: "Inter", variable: true, weightRange: [100, 900] }
|
|
12
|
+
*/
|
|
13
|
+
google?: GoogleFontInput[];
|
|
14
|
+
/** Local font files. */
|
|
15
|
+
local?: LocalFont[];
|
|
16
|
+
/** Default font-display strategy. Default: "swap" */
|
|
17
|
+
display?: FontDisplay;
|
|
18
|
+
/** Preload critical fonts. Default: true */
|
|
19
|
+
preload?: boolean;
|
|
20
|
+
/** Self-host Google Fonts at build time. Default: true */
|
|
21
|
+
selfHost?: boolean;
|
|
22
|
+
/** Fallback font metrics for reducing CLS. */
|
|
23
|
+
fallbacks?: Record<string, FallbackMetrics>;
|
|
22
24
|
}
|
|
23
25
|
/** Static Google Font config. */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
interface GoogleFontStatic {
|
|
27
|
+
family: string;
|
|
28
|
+
weights: number[];
|
|
29
|
+
italic?: boolean;
|
|
30
|
+
variable?: false;
|
|
29
31
|
}
|
|
30
32
|
/** Variable Google Font config. */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
interface GoogleFontVariable {
|
|
34
|
+
family: string;
|
|
35
|
+
/** Weight range as [min, max] tuple. e.g. [100, 900] */
|
|
36
|
+
weightRange: [number, number];
|
|
37
|
+
italic?: boolean;
|
|
38
|
+
variable: true;
|
|
37
39
|
}
|
|
38
40
|
/** Google font input: structured object or string shorthand. */
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
type GoogleFontInput = GoogleFontStatic | GoogleFontVariable | string;
|
|
42
|
+
interface LocalFont {
|
|
43
|
+
family: string;
|
|
44
|
+
src: string;
|
|
45
|
+
/** Single weight (400) or variable range ("100 900"). */
|
|
46
|
+
weight?: number | `${number} ${number}`;
|
|
47
|
+
style?: 'normal' | 'italic';
|
|
48
|
+
display?: FontDisplay;
|
|
47
49
|
}
|
|
48
|
-
|
|
50
|
+
type FontDisplay = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
49
51
|
/** Metrics for generating size-adjusted fallback fonts to reduce CLS. */
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
interface FallbackMetrics {
|
|
53
|
+
/** The fallback font to adjust. e.g. "Arial", "Georgia" */
|
|
54
|
+
fallback: string;
|
|
55
|
+
/** Size adjustment factor. e.g. 1.05 */
|
|
56
|
+
sizeAdjust?: number;
|
|
57
|
+
/** Ascent override percentage. e.g. 90 */
|
|
58
|
+
ascentOverride?: number;
|
|
59
|
+
/** Descent override percentage. e.g. 22 */
|
|
60
|
+
descentOverride?: number;
|
|
61
|
+
/** Line gap override percentage. e.g. 0 */
|
|
62
|
+
lineGapOverride?: number;
|
|
61
63
|
}
|
|
62
64
|
interface ResolvedFontBase {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
family: string;
|
|
66
|
+
italic: boolean;
|
|
65
67
|
}
|
|
66
68
|
interface StaticFont extends ResolvedFontBase {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
variable: false;
|
|
70
|
+
weights: number[];
|
|
69
71
|
}
|
|
70
72
|
interface VariableFont extends ResolvedFontBase {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
variable: true;
|
|
74
|
+
weightRange: [number, number];
|
|
73
75
|
}
|
|
74
76
|
type ResolvedFont = StaticFont | VariableFont;
|
|
75
77
|
/**
|
|
76
78
|
* Normalize a GoogleFontInput (string or object) into a ResolvedFont.
|
|
77
79
|
*/
|
|
78
|
-
|
|
80
|
+
declare function resolveGoogleFont(input: GoogleFontInput): ResolvedFont;
|
|
79
81
|
/**
|
|
80
82
|
* Parse Google Fonts family string shorthand.
|
|
81
83
|
*
|
|
@@ -83,11 +85,11 @@ export declare function resolveGoogleFont(input: GoogleFontInput): ResolvedFont;
|
|
|
83
85
|
* Variable range: "Inter:wght@100..900"
|
|
84
86
|
* Variable with italic: "Inter:ital,wght@100..900"
|
|
85
87
|
*/
|
|
86
|
-
|
|
88
|
+
declare function parseGoogleFamily(input: string): ResolvedFont;
|
|
87
89
|
/**
|
|
88
90
|
* Generate a Google Fonts CSS URL.
|
|
89
91
|
*/
|
|
90
|
-
|
|
92
|
+
declare function googleFontsUrl(families: ResolvedFont[], display?: FontDisplay): string;
|
|
91
93
|
/**
|
|
92
94
|
* Zero font optimization Vite plugin.
|
|
93
95
|
*
|
|
@@ -110,10 +112,11 @@ export declare function googleFontsUrl(families: ResolvedFont[], display?: FontD
|
|
|
110
112
|
* ],
|
|
111
113
|
* }
|
|
112
114
|
*/
|
|
113
|
-
|
|
115
|
+
declare function fontPlugin(config?: FontConfig): Plugin;
|
|
114
116
|
/**
|
|
115
117
|
* Generate CSS variables for font families.
|
|
116
118
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
declare function fontVariables(families: Record<string, string>): string;
|
|
120
|
+
//#endregion
|
|
121
|
+
export { FallbackMetrics, FontConfig, FontDisplay, GoogleFontInput, GoogleFontStatic, GoogleFontVariable, LocalFont, fontPlugin, fontVariables, googleFontsUrl, parseGoogleFamily, resolveGoogleFont };
|
|
122
|
+
//# sourceMappingURL=font2.d.ts.map
|
package/lib/types/font.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"font2.d.ts","names":[],"sources":["../../../src/font.ts"],"mappings":";;;UAciB,UAAA;;AAAjB;;;;;;;EASE,MAAA,GAAS,eAAA;EAUS;EARlB,KAAA,GAAQ,SAAA;EAFR;EAIA,OAAA,GAAU,WAAA;EAFV;EAIA,OAAA;EAFA;EAIA,QAAA;EAFA;EAIA,SAAA,GAAY,MAAA,SAAe,eAAA;AAAA;;UAIZ,gBAAA;EACf,MAAA;EACA,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;UAIe,kBAAA;EACf,MAAA;EANA;EAQA,WAAA;EACA,MAAA;EACA,QAAA;AAAA;;KAIU,eAAA,GAAkB,gBAAA,GAAmB,kBAAA;AAAA,UAEhC,SAAA;EACf,MAAA;EACA,GAAA;EATA;EAWA,MAAA;EACA,KAAA;EACA,OAAA,GAAU,WAAA;AAAA;AAAA,KAGA,WAAA;;UAGK,eAAA;EAdkD;EAgBjE,QAAA;EAdwB;EAgBxB,UAAA;EAVqB;EAYrB,cAAA;EAhBA;EAkBA,eAAA;EAfA;EAiBA,eAAA;AAAA;AAAA,UAGQ,gBAAA;EACR,MAAA;EACA,MAAA;AAAA;AAAA,UAGQ,UAAA,SAAmB,gBAAA;EAC3B,QAAA;EACA,OAAA;AAAA;AAAA,UAGQ,YAAA,SAAqB,gBAAA;EAC7B,QAAA;EACA,WAAA;AAAA;AAAA,KAGG,YAAA,GAAe,UAAA,GAAa,YAAA;;;;iBAKjB,iBAAA,CAAkB,KAAA,EAAO,eAAA,GAAkB,YAAA;;AAtB1D;;;;;AAIO;iBA+CQ,iBAAA,CAAkB,KAAA,WAAgB,YAAA;;;;iBA8DlC,cAAA,CAAe,QAAA,EAAU,YAAA,IAAgB,OAAA,GAAS,WAAA;;;;AAxGzD;;;;;;;;;AAKI;;;;;AAQb;;;;;iBAoSgB,UAAA,CAAW,MAAA,GAAQ,UAAA,GAAkB,MAAA;;;;iBAgHrC,aAAA,CAAc,QAAA,EAAU,MAAA"}
|
|
@@ -1,51 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import * as _pyreon_core0 from "@pyreon/core";
|
|
2
|
+
import * as _pyreon_reactivity0 from "@pyreon/reactivity";
|
|
3
|
+
import { Plugin } from "vite";
|
|
4
|
+
|
|
5
|
+
//#region src/i18n-routing.d.ts
|
|
6
|
+
interface I18nRoutingConfig {
|
|
7
|
+
/** Supported locales. e.g. ["en", "de", "cs"] */
|
|
8
|
+
locales: string[];
|
|
9
|
+
/** Default locale — served without prefix (/ instead of /en/). */
|
|
10
|
+
defaultLocale: string;
|
|
11
|
+
/** Redirect root to detected locale. Default: true */
|
|
12
|
+
detectLocale?: boolean;
|
|
13
|
+
/** Cookie name to persist locale preference. Default: "locale" */
|
|
14
|
+
cookieName?: string;
|
|
15
|
+
/** URL strategy. Default: "prefix-except-default" */
|
|
16
|
+
strategy?: 'prefix' | 'prefix-except-default';
|
|
13
17
|
}
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
interface LocaleContext {
|
|
19
|
+
/** Current locale code. e.g. "en", "de" */
|
|
20
|
+
locale: string;
|
|
21
|
+
/** All supported locales. */
|
|
22
|
+
locales: string[];
|
|
23
|
+
/** Default locale. */
|
|
24
|
+
defaultLocale: string;
|
|
25
|
+
/** Build a localized path. e.g. localePath("/about", "de") → "/de/about" */
|
|
26
|
+
localePath: (path: string, locale?: string) => string;
|
|
27
|
+
/** Get hreflang alternates for the current path. */
|
|
28
|
+
alternates: () => Array<{
|
|
16
29
|
locale: string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/** Default locale. */
|
|
20
|
-
defaultLocale: string;
|
|
21
|
-
/** Build a localized path. e.g. localePath("/about", "de") → "/de/about" */
|
|
22
|
-
localePath: (path: string, locale?: string) => string;
|
|
23
|
-
/** Get hreflang alternates for the current path. */
|
|
24
|
-
alternates: () => Array<{
|
|
25
|
-
locale: string;
|
|
26
|
-
url: string;
|
|
27
|
-
}>;
|
|
30
|
+
url: string;
|
|
31
|
+
}>;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* Detect preferred locale from Accept-Language header.
|
|
31
35
|
*/
|
|
32
|
-
|
|
36
|
+
declare function detectLocaleFromHeader(acceptLanguage: string | null | undefined, locales: string[], defaultLocale: string): string;
|
|
33
37
|
/**
|
|
34
38
|
* Extract locale from a URL path.
|
|
35
39
|
* Returns { locale, pathWithoutLocale }.
|
|
36
40
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
declare function extractLocaleFromPath(path: string, locales: string[], defaultLocale: string): {
|
|
42
|
+
locale: string;
|
|
43
|
+
pathWithoutLocale: string;
|
|
40
44
|
};
|
|
41
45
|
/**
|
|
42
46
|
* Build a localized path.
|
|
43
47
|
*/
|
|
44
|
-
|
|
48
|
+
declare function buildLocalePath(path: string, locale: string, defaultLocale: string, strategy: 'prefix' | 'prefix-except-default'): string;
|
|
45
49
|
/**
|
|
46
50
|
* Create a LocaleContext for use in components and loaders.
|
|
47
51
|
*/
|
|
48
|
-
|
|
52
|
+
declare function createLocaleContext(locale: string, path: string, config: I18nRoutingConfig): LocaleContext;
|
|
49
53
|
/**
|
|
50
54
|
* I18n routing middleware for Zero's server.
|
|
51
55
|
*
|
|
@@ -68,11 +72,11 @@ export declare function createLocaleContext(locale: string, path: string, config
|
|
|
68
72
|
* })
|
|
69
73
|
* ```
|
|
70
74
|
*/
|
|
71
|
-
|
|
75
|
+
declare function i18nRouting(config: I18nRoutingConfig): Plugin;
|
|
72
76
|
/** @internal Context for the current locale. */
|
|
73
|
-
|
|
77
|
+
declare const LocaleCtx: _pyreon_core0.Context<string>;
|
|
74
78
|
/** Current locale signal — set by the server middleware or client-side detection. */
|
|
75
|
-
|
|
79
|
+
declare const localeSignal: _pyreon_reactivity0.Signal<string>;
|
|
76
80
|
/**
|
|
77
81
|
* Read the current locale reactively.
|
|
78
82
|
*
|
|
@@ -85,7 +89,7 @@ export declare const localeSignal: import("@pyreon/reactivity").Signal<string>;
|
|
|
85
89
|
* const locale = useLocale() // "en", "de", etc.
|
|
86
90
|
* ```
|
|
87
91
|
*/
|
|
88
|
-
|
|
92
|
+
declare function useLocale(): string;
|
|
89
93
|
/**
|
|
90
94
|
* Set the locale client-side and update the URL.
|
|
91
95
|
*
|
|
@@ -94,5 +98,7 @@ export declare function useLocale(): string;
|
|
|
94
98
|
* <button onClick={() => setLocale('de')}>Deutsch</button>
|
|
95
99
|
* ```
|
|
96
100
|
*/
|
|
97
|
-
|
|
98
|
-
//#
|
|
101
|
+
declare function setLocale(locale: string, config: I18nRoutingConfig): void;
|
|
102
|
+
//#endregion
|
|
103
|
+
export { I18nRoutingConfig, LocaleContext, LocaleCtx, buildLocalePath, createLocaleContext, detectLocaleFromHeader, extractLocaleFromPath, i18nRouting, localeSignal, setLocale, useLocale };
|
|
104
|
+
//# sourceMappingURL=i18n-routing2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-
|
|
1
|
+
{"version":3,"file":"i18n-routing2.d.ts","names":[],"sources":["../../../src/i18n-routing.ts"],"mappings":";;;;;UAiBiB,iBAAA;;EAEf,OAAA;;EAEA,aAAA;EAJgC;EAMhC,YAAA;EANgC;EAQhC,UAAA;EAJA;EAMA,QAAA;AAAA;AAAA,UAGe,aAAA;EAHP;EAKR,MAAA;EAFe;EAIf,OAAA;;EAEA,aAAA;EAJA;EAMA,UAAA,GAAa,IAAA,UAAc,MAAA;EAF3B;EAIA,UAAA,QAAkB,KAAA;IAAQ,MAAA;IAAgB,GAAA;EAAA;AAAA;;;;iBAM5B,sBAAA,CACd,cAAA,6BACA,OAAA,YACA,aAAA;AAHF;;;;AAAA,iBA8BgB,qBAAA,CACd,IAAA,UACA,OAAA,YACA,aAAA;EACG,MAAA;EAAgB,iBAAA;AAAA;;AAJrB;;iBAqBgB,eAAA,CACd,IAAA,UACA,MAAA,UACA,aAAA,UACA,QAAA;;;;iBAYc,mBAAA,CACd,MAAA,UACA,IAAA,UACA,MAAA,EAAQ,iBAAA,GACP,aAAA;;;;;AApBH;;;;;;;;;;AAgBA;;;;;;;;iBAyDgB,WAAA,CAAY,MAAA,EAAQ,iBAAA,GAAoB,MAAA;;cA2E3C,SAAA,EAAuC,aAAA,CAA9B,OAAA;AA3EtB;AAAA,cA8Ea,YAAA,EAA2B,mBAAA,CAAf,MAAA;;;;;;;;AAHzB;;;;;iBAiBgB,SAAA,CAAA;;;;;AAAhB;;;;iBAYgB,SAAA,CACd,MAAA,UACA,MAAA,EAAQ,iBAAA"}
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
|
+
|
|
3
|
+
//#region src/image-plugin.d.ts
|
|
4
|
+
interface ImagePluginConfig {
|
|
5
|
+
/** Output directory for processed images. Default: "assets/img" */
|
|
6
|
+
outDir?: string;
|
|
7
|
+
/** Default widths for responsive images. Default: [640, 1024, 1920] */
|
|
8
|
+
widths?: number[];
|
|
9
|
+
/** Output formats. Default: ["webp"] */
|
|
10
|
+
formats?: ImageFormat[];
|
|
11
|
+
/** Quality for lossy formats (1-100). Default: 80 */
|
|
12
|
+
quality?: number;
|
|
13
|
+
/** Blur placeholder size in px. Default: 16 */
|
|
14
|
+
placeholderSize?: number;
|
|
15
|
+
/** File patterns to process. Default: /\.(jpe?g|png|webp|avif)$/i */
|
|
16
|
+
include?: RegExp;
|
|
15
17
|
}
|
|
16
|
-
|
|
18
|
+
type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png';
|
|
17
19
|
/** Per-format source set for <picture> <source> elements. */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
interface FormatSource {
|
|
21
|
+
/** MIME type. e.g. "image/webp", "image/avif" */
|
|
22
|
+
type: string;
|
|
23
|
+
/** srcset string for this format. e.g. "/img-640.webp 640w, /img-1920.webp 1920w" */
|
|
24
|
+
srcset: string;
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
interface ProcessedImage {
|
|
27
|
+
/** Fallback source path (last format, largest width). */
|
|
28
|
+
src: string;
|
|
29
|
+
/** Fallback srcset string (last format). */
|
|
30
|
+
srcset: string;
|
|
31
|
+
/** Intrinsic width. */
|
|
32
|
+
width: number;
|
|
33
|
+
/** Intrinsic height. */
|
|
34
|
+
height: number;
|
|
35
|
+
/** Base64 blur placeholder data URI. */
|
|
36
|
+
placeholder: string;
|
|
37
|
+
/** Per-format source sets for <picture> element. Ordered by priority (best format first). */
|
|
38
|
+
formats: FormatSource[];
|
|
39
|
+
/** Flat list of all sources. */
|
|
40
|
+
sources: Array<{
|
|
26
41
|
src: string;
|
|
27
|
-
/** Fallback srcset string (last format). */
|
|
28
|
-
srcset: string;
|
|
29
|
-
/** Intrinsic width. */
|
|
30
42
|
width: number;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/** Base64 blur placeholder data URI. */
|
|
34
|
-
placeholder: string;
|
|
35
|
-
/** Per-format source sets for <picture> element. Ordered by priority (best format first). */
|
|
36
|
-
formats: FormatSource[];
|
|
37
|
-
/** Flat list of all sources. */
|
|
38
|
-
sources: Array<{
|
|
39
|
-
src: string;
|
|
40
|
-
width: number;
|
|
41
|
-
format: string;
|
|
42
|
-
}>;
|
|
43
|
+
format: string;
|
|
44
|
+
}>;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* Zero image processing Vite plugin.
|
|
@@ -65,15 +67,17 @@ export interface ProcessedImage {
|
|
|
65
67
|
*
|
|
66
68
|
* <Image {...hero} alt="Hero" priority />
|
|
67
69
|
*/
|
|
68
|
-
|
|
70
|
+
declare function imagePlugin(config?: ImagePluginConfig): Plugin;
|
|
69
71
|
/** @internal Exported for testing */
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
declare function parseJpegDimensions(buffer: Buffer): {
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
73
75
|
};
|
|
74
76
|
/** @internal Exported for testing */
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
declare function parseWebPDimensions(buffer: Buffer): {
|
|
78
|
+
width: number;
|
|
79
|
+
height: number;
|
|
78
80
|
};
|
|
79
|
-
//#
|
|
81
|
+
//#endregion
|
|
82
|
+
export { FormatSource, ImageFormat, ImagePluginConfig, ProcessedImage, imagePlugin, parseJpegDimensions, parseWebPDimensions };
|
|
83
|
+
//# sourceMappingURL=image-plugin2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-
|
|
1
|
+
{"version":3,"file":"image-plugin2.d.ts","names":[],"sources":["../../../src/image-plugin.ts"],"mappings":";;;UA+BiB,iBAAA;;EAEf,MAAA;EAFgC;EAIhC,MAAA;EAQgB;EANhB,OAAA,GAAU,WAAA;EAFV;EAIA,OAAA;EAFU;EAIV,eAAA;EAAA;EAEA,OAAA,GAAU,MAAA;AAAA;AAAA,KAGA,WAAA;;UAGK,YAAA;EAHM;EAKrB,IAAA;EALqB;EAOrB,MAAA;AAAA;AAAA,UAGe,cAAA;;EAEf,GAAA;EALM;EAON,MAAA;EAJ6B;EAM7B,KAAA;EAQc;EANd,MAAA;EAJA;EAMA,WAAA;EAFA;EAIA,OAAA,EAAS,YAAA;EAAT;EAEA,OAAA,EAAS,KAAA;IAAQ,GAAA;IAAa,KAAA;IAAe,MAAA;EAAA;AAAA;;;AA6B/C;;;;;;;;;AA4NA;;;;;;;;;;AAqBA;;;iBAjPgB,WAAA,CAAY,MAAA,GAAQ,iBAAA,GAAyB,MAAA;;iBA4N7C,mBAAA,CAAoB,MAAA,EAAQ,MAAA;EAC1C,KAAA;EACA,MAAA;AAAA;;iBAmBc,mBAAA,CAAoB,MAAA,EAAQ,MAAA;EAC1C,KAAA;EACA,MAAA;AAAA"}
|