@pyreon/zero 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -57
- package/lib/_chunks/app-BbPT0Y5M.js +36 -0
- package/lib/{fs-router-Bacdhsq-.js → _chunks/fs-router-DvBlRzmP.js} +21 -5
- package/lib/_chunks/use-intersection-observer-C6opeplh.js +29 -0
- package/lib/actions.js +24 -3
- package/lib/ai.js +1 -102
- package/lib/client.js +3 -33
- package/lib/csp.js +12 -9
- package/lib/favicon.js +1 -1
- package/lib/font.js +1 -1
- package/lib/image-plugin.js +1 -1
- package/lib/image.js +3 -27
- package/lib/index.js +8 -1085
- package/lib/link.js +3 -27
- package/lib/meta.js +1 -25
- package/lib/script.js +2 -26
- package/lib/seo.js +4 -4
- package/lib/server.js +275 -2129
- package/lib/testing.js +1 -69
- package/lib/theme.js +52 -22
- package/lib/types/config.d.ts +115 -0
- package/lib/types/csp.d.ts +9 -1
- package/lib/types/index.d.ts +120 -1
- package/lib/types/server.d.ts +192 -17
- package/lib/types/theme.d.ts +11 -2
- package/package.json +10 -10
- package/src/actions.ts +43 -5
- package/src/adapters/bun.ts +35 -7
- package/src/adapters/cloudflare.ts +17 -12
- package/src/adapters/netlify.ts +7 -1
- package/src/adapters/node.ts +33 -6
- package/src/adapters/vercel.ts +25 -4
- package/src/csp.ts +10 -7
- package/src/fs-router.ts +2 -1
- package/src/isr.ts +256 -51
- package/src/manifest.ts +23 -10
- package/src/server.ts +2 -1
- package/src/ssg-plugin.ts +27 -7
- package/src/theme.tsx +94 -38
- package/src/types.ts +76 -0
- package/lib/api-routes-CMsLztoj.js +0 -148
- package/lib/fs-router-3xzp-4Wj.js +0 -32
- package/lib/rolldown-runtime-CjeV3_4I.js +0 -18
package/lib/font.js
CHANGED
package/lib/image-plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
2
|
import { basename, extname, join } from "node:path";
|
|
3
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
4
4
|
|
|
5
5
|
//#region src/image-plugin.ts
|
|
6
6
|
let sharpWarned = false;
|
package/lib/image.js
CHANGED
|
@@ -1,32 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as useIntersectionObserver } from "./_chunks/use-intersection-observer-C6opeplh.js";
|
|
2
|
+
import { createRef } from "@pyreon/core";
|
|
3
3
|
import { jsx, jsxs } from "@pyreon/core/jsx-runtime";
|
|
4
|
+
import { signal } from "@pyreon/reactivity";
|
|
4
5
|
|
|
5
|
-
//#region src/utils/use-intersection-observer.ts
|
|
6
|
-
/**
|
|
7
|
-
* Observes an element and calls `onIntersect` once it enters the viewport.
|
|
8
|
-
* Automatically disconnects after the first intersection.
|
|
9
|
-
*
|
|
10
|
-
* @param getElement - Getter for the target element (may be undefined before mount).
|
|
11
|
-
* @param onIntersect - Callback fired when the element becomes visible.
|
|
12
|
-
* @param rootMargin - IntersectionObserver rootMargin. Default: "200px".
|
|
13
|
-
*/
|
|
14
|
-
function useIntersectionObserver(getElement, onIntersect, rootMargin = "200px") {
|
|
15
|
-
onMount(() => {
|
|
16
|
-
const el = getElement();
|
|
17
|
-
if (!el) return void 0;
|
|
18
|
-
const observer = new IntersectionObserver((entries) => {
|
|
19
|
-
for (const entry of entries) if (entry.isIntersecting) {
|
|
20
|
-
onIntersect();
|
|
21
|
-
observer.disconnect();
|
|
22
|
-
}
|
|
23
|
-
}, { rootMargin });
|
|
24
|
-
observer.observe(el);
|
|
25
|
-
onUnmount(() => observer.disconnect());
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
6
|
//#region src/image.tsx
|
|
31
7
|
/**
|
|
32
8
|
* Composable that provides all image optimization behavior — lazy loading,
|