davaux 0.8.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/BASELINE.md +169 -0
- package/CLAUDE.md +518 -0
- package/LICENSE +21 -0
- package/README.md +36 -0
- package/ROADMAP.md +198 -0
- package/build.mjs +101 -0
- package/client/control.ts +247 -0
- package/client/hydrate.ts +37 -0
- package/client/index.ts +19 -0
- package/client/jsx-runtime.ts +209 -0
- package/client/resource.ts +122 -0
- package/client/signal.ts +211 -0
- package/client/store.ts +110 -0
- package/client/useHead.ts +63 -0
- package/dist/build/config.d.ts +3 -0
- package/dist/build/config.d.ts.map +1 -0
- package/dist/build/config.js +38 -0
- package/dist/build/config.js.map +7 -0
- package/dist/build/index.d.ts +2 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +13 -0
- package/dist/build/index.js.map +7 -0
- package/dist/build/plugins.d.ts +7 -0
- package/dist/build/plugins.d.ts.map +1 -0
- package/dist/build/plugins.js +85 -0
- package/dist/build/plugins.js.map +7 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +427 -0
- package/dist/cli.js.map +7 -0
- package/dist/client/control.d.ts +49 -0
- package/dist/client/control.d.ts.map +1 -0
- package/dist/client/control.js +154 -0
- package/dist/client/control.js.map +7 -0
- package/dist/client/hydrate.d.ts +7 -0
- package/dist/client/hydrate.d.ts.map +1 -0
- package/dist/client/hydrate.js +23 -0
- package/dist/client/hydrate.js.map +7 -0
- package/dist/client/index.d.ts +12 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +32 -0
- package/dist/client/index.js.map +7 -0
- package/dist/client/jsx-runtime.d.ts +40 -0
- package/dist/client/jsx-runtime.d.ts.map +1 -0
- package/dist/client/jsx-runtime.js +139 -0
- package/dist/client/jsx-runtime.js.map +7 -0
- package/dist/client/resource.d.ts +31 -0
- package/dist/client/resource.d.ts.map +1 -0
- package/dist/client/resource.js +64 -0
- package/dist/client/resource.js.map +7 -0
- package/dist/client/signal.d.ts +90 -0
- package/dist/client/signal.d.ts.map +1 -0
- package/dist/client/signal.js +115 -0
- package/dist/client/signal.js.map +7 -0
- package/dist/client/store.d.ts +26 -0
- package/dist/client/store.d.ts.map +1 -0
- package/dist/client/store.js +63 -0
- package/dist/client/store.js.map +7 -0
- package/dist/client/useHead.d.ts +28 -0
- package/dist/client/useHead.d.ts.map +1 -0
- package/dist/client/useHead.js +33 -0
- package/dist/client/useHead.js.map +7 -0
- package/dist/config.d.ts +182 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +21 -0
- package/dist/config.js.map +7 -0
- package/dist/create-multisite.d.ts +2 -0
- package/dist/create-multisite.d.ts.map +1 -0
- package/dist/create-multisite.js +291 -0
- package/dist/create-multisite.js.map +7 -0
- package/dist/create.d.ts +2 -0
- package/dist/create.d.ts.map +1 -0
- package/dist/create.js +179 -0
- package/dist/create.js.map +7 -0
- package/dist/dev/blueprints.d.ts +11 -0
- package/dist/dev/blueprints.d.ts.map +1 -0
- package/dist/dev/blueprints.js +65 -0
- package/dist/dev/blueprints.js.map +7 -0
- package/dist/dev/components.d.ts +19 -0
- package/dist/dev/components.d.ts.map +1 -0
- package/dist/dev/components.js +87 -0
- package/dist/dev/components.js.map +7 -0
- package/dist/dev/insert.d.ts +11 -0
- package/dist/dev/insert.d.ts.map +1 -0
- package/dist/dev/insert.js +160 -0
- package/dist/dev/insert.js.map +7 -0
- package/dist/dev/remove.d.ts +53 -0
- package/dist/dev/remove.d.ts.map +1 -0
- package/dist/dev/remove.js +518 -0
- package/dist/dev/remove.js.map +7 -0
- package/dist/dev/watch.d.ts +26 -0
- package/dist/dev/watch.d.ts.map +1 -0
- package/dist/dev/watch.js +2905 -0
- package/dist/dev/watch.js.map +7 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +63 -0
- package/dist/errors.js.map +7 -0
- package/dist/generate.d.ts +2 -0
- package/dist/generate.d.ts.map +1 -0
- package/dist/generate.js +191 -0
- package/dist/generate.js.map +7 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +7 -0
- package/dist/island.d.ts +24 -0
- package/dist/island.d.ts.map +1 -0
- package/dist/island.js +15 -0
- package/dist/island.js.map +7 -0
- package/dist/jsx-runtime.d.ts +406 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +90 -0
- package/dist/jsx-runtime.js.map +7 -0
- package/dist/link.d.ts +27 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +29 -0
- package/dist/link.js.map +7 -0
- package/dist/oml/fragment.d.ts +16 -0
- package/dist/oml/fragment.d.ts.map +1 -0
- package/dist/oml/fragment.js +26 -0
- package/dist/oml/fragment.js.map +7 -0
- package/dist/oml/index.d.ts +11 -0
- package/dist/oml/index.d.ts.map +1 -0
- package/dist/oml/index.js +21 -0
- package/dist/oml/index.js.map +7 -0
- package/dist/oml/jsx-runtime.d.ts +34 -0
- package/dist/oml/jsx-runtime.d.ts.map +1 -0
- package/dist/oml/jsx-runtime.js +59 -0
- package/dist/oml/jsx-runtime.js.map +7 -0
- package/dist/oml/jsx.d.ts +14 -0
- package/dist/oml/jsx.d.ts.map +1 -0
- package/dist/oml/jsx.js +96 -0
- package/dist/oml/jsx.js.map +7 -0
- package/dist/oml/page.d.ts +7 -0
- package/dist/oml/page.d.ts.map +1 -0
- package/dist/oml/page.js +6 -0
- package/dist/oml/page.js.map +7 -0
- package/dist/oml/render.d.ts +13 -0
- package/dist/oml/render.d.ts.map +1 -0
- package/dist/oml/render.js +117 -0
- package/dist/oml/render.js.map +7 -0
- package/dist/oml/types.d.ts +79 -0
- package/dist/oml/types.d.ts.map +1 -0
- package/dist/oml/types.js +64 -0
- package/dist/oml/types.js.map +7 -0
- package/dist/router/handler.d.ts +53 -0
- package/dist/router/handler.d.ts.map +1 -0
- package/dist/router/handler.js +342 -0
- package/dist/router/handler.js.map +7 -0
- package/dist/router/matcher.d.ts +21 -0
- package/dist/router/matcher.d.ts.map +1 -0
- package/dist/router/matcher.js +28 -0
- package/dist/router/matcher.js.map +7 -0
- package/dist/router/scanner.d.ts +17 -0
- package/dist/router/scanner.d.ts.map +1 -0
- package/dist/router/scanner.js +197 -0
- package/dist/router/scanner.js.map +7 -0
- package/dist/server/index.d.ts +23 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +29 -0
- package/dist/server/index.js.map +7 -0
- package/dist/signal.d.ts +15 -0
- package/dist/signal.d.ts.map +1 -0
- package/dist/signal.js +29 -0
- package/dist/signal.js.map +7 -0
- package/dist/ssg.d.ts +45 -0
- package/dist/ssg.d.ts.map +1 -0
- package/dist/ssg.js +175 -0
- package/dist/ssg.js.map +7 -0
- package/dist/test/actions.test.d.ts +2 -0
- package/dist/test/actions.test.d.ts.map +1 -0
- package/dist/test/body-limits.test.d.ts +2 -0
- package/dist/test/body-limits.test.d.ts.map +1 -0
- package/dist/test/errors.test.d.ts +2 -0
- package/dist/test/errors.test.d.ts.map +1 -0
- package/dist/test/fixtures/routes/[id].page.d.ts +4 -0
- package/dist/test/fixtures/routes/[id].page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_error.d.ts +3 -0
- package/dist/test/fixtures/routes/_error.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_global.d.ts +3 -0
- package/dist/test/fixtures/routes/_global.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_layout-template.d.ts +3 -0
- package/dist/test/fixtures/routes/_layout-template.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_layout.d.ts +3 -0
- package/dist/test/fixtures/routes/_layout.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_layout_scripts.d.ts +3 -0
- package/dist/test/fixtures/routes/_layout_scripts.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_middleware.d.ts +3 -0
- package/dist/test/fixtures/routes/_middleware.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_redirect301_mw.d.ts +3 -0
- package/dist/test/fixtures/routes/_redirect301_mw.d.ts.map +1 -0
- package/dist/test/fixtures/routes/_redirect_mw.d.ts +3 -0
- package/dist/test/fixtures/routes/_redirect_mw.d.ts.map +1 -0
- package/dist/test/fixtures/routes/about.page.d.ts +3 -0
- package/dist/test/fixtures/routes/about.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/action.page.d.ts +6 -0
- package/dist/test/fixtures/routes/action.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/form-all.post.d.ts +3 -0
- package/dist/test/fixtures/routes/api/form-all.post.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/form-limited.post.d.ts +6 -0
- package/dist/test/fixtures/routes/api/form-limited.post.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/response-obj.get.d.ts +3 -0
- package/dist/test/fixtures/routes/api/response-obj.get.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/upload.post.d.ts +12 -0
- package/dist/test/fixtures/routes/api/upload.post.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/users.get.d.ts +6 -0
- package/dist/test/fixtures/routes/api/users.get.d.ts.map +1 -0
- package/dist/test/fixtures/routes/api/xml.get.d.ts +3 -0
- package/dist/test/fixtures/routes/api/xml.get.d.ts.map +1 -0
- package/dist/test/fixtures/routes/auth/_middleware.d.ts +3 -0
- package/dist/test/fixtures/routes/auth/_middleware.d.ts.map +1 -0
- package/dist/test/fixtures/routes/auth/protected.page.d.ts +3 -0
- package/dist/test/fixtures/routes/auth/protected.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/index.page.d.ts +3 -0
- package/dist/test/fixtures/routes/index.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/oml.page.d.ts +3 -0
- package/dist/test/fixtures/routes/oml.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/redirect.page.d.ts +3 -0
- package/dist/test/fixtures/routes/redirect.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/ssg/[slug].page.d.ts +5 -0
- package/dist/test/fixtures/routes/ssg/[slug].page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/ssg/server.page.d.ts +4 -0
- package/dist/test/fixtures/routes/ssg/server.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/state.page.d.ts +3 -0
- package/dist/test/fixtures/routes/state.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/throw.page.d.ts +3 -0
- package/dist/test/fixtures/routes/throw.page.d.ts.map +1 -0
- package/dist/test/fixtures/routes/wiki/[...slug].page.d.ts +3 -0
- package/dist/test/fixtures/routes/wiki/[...slug].page.d.ts.map +1 -0
- package/dist/test/helpers.d.ts +37 -0
- package/dist/test/helpers.d.ts.map +1 -0
- package/dist/test/layouts.test.d.ts +2 -0
- package/dist/test/layouts.test.d.ts.map +1 -0
- package/dist/test/middleware.test.d.ts +2 -0
- package/dist/test/middleware.test.d.ts.map +1 -0
- package/dist/test/multipart.test.d.ts +2 -0
- package/dist/test/multipart.test.d.ts.map +1 -0
- package/dist/test/oml-routing.test.d.ts +2 -0
- package/dist/test/oml-routing.test.d.ts.map +1 -0
- package/dist/test/oml.test.d.ts +2 -0
- package/dist/test/oml.test.d.ts.map +1 -0
- package/dist/test/redirects.test.d.ts +2 -0
- package/dist/test/redirects.test.d.ts.map +1 -0
- package/dist/test/routing.test.d.ts +2 -0
- package/dist/test/routing.test.d.ts.map +1 -0
- package/dist/test/ssg.test.d.ts +2 -0
- package/dist/test/ssg.test.d.ts.map +1 -0
- package/dist/test/web-response.test.d.ts +2 -0
- package/dist/test/web-response.test.d.ts.map +1 -0
- package/dist/types.d.ts +314 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +292 -0
- package/dist/types.js.map +7 -0
- package/package.json +103 -0
- package/pka.config.json +32 -0
- package/src/build/config.ts +42 -0
- package/src/build/index.ts +6 -0
- package/src/build/plugins.ts +118 -0
- package/src/cli.ts +502 -0
- package/src/config.ts +197 -0
- package/src/create-multisite.ts +310 -0
- package/src/create.ts +194 -0
- package/src/dev/blueprints.ts +75 -0
- package/src/dev/components.ts +108 -0
- package/src/dev/insert.ts +221 -0
- package/src/dev/remove.ts +677 -0
- package/src/dev/watch.ts +3098 -0
- package/src/env.d.ts +5 -0
- package/src/errors.ts +64 -0
- package/src/generate.ts +228 -0
- package/src/index.ts +67 -0
- package/src/island.ts +47 -0
- package/src/jsx-runtime.d.ts +408 -0
- package/src/jsx-runtime.d.ts.map +1 -0
- package/src/jsx-runtime.ts +536 -0
- package/src/link.ts +49 -0
- package/src/oml/fragment.ts +54 -0
- package/src/oml/index.ts +21 -0
- package/src/oml/jsx-runtime.ts +121 -0
- package/src/oml/jsx.ts +151 -0
- package/src/oml/page.ts +13 -0
- package/src/oml/render.ts +181 -0
- package/src/oml/types.ts +159 -0
- package/src/router/handler.ts +515 -0
- package/src/router/matcher.ts +52 -0
- package/src/router/scanner.ts +272 -0
- package/src/server/index.ts +49 -0
- package/src/signal.ts +39 -0
- package/src/ssg.ts +253 -0
- package/src/test/actions.test.ts +40 -0
- package/src/test/body-limits.test.ts +83 -0
- package/src/test/errors.test.ts +53 -0
- package/src/test/fixtures/routes/[id].page.ts +3 -0
- package/src/test/fixtures/routes/_error.ts +6 -0
- package/src/test/fixtures/routes/_global.ts +8 -0
- package/src/test/fixtures/routes/_layout-template.ts +7 -0
- package/src/test/fixtures/routes/_layout.ts +7 -0
- package/src/test/fixtures/routes/_layout_scripts.ts +8 -0
- package/src/test/fixtures/routes/_middleware.ts +8 -0
- package/src/test/fixtures/routes/_redirect301_mw.ts +5 -0
- package/src/test/fixtures/routes/_redirect_mw.ts +5 -0
- package/src/test/fixtures/routes/about.page.ts +6 -0
- package/src/test/fixtures/routes/action.page.ts +11 -0
- package/src/test/fixtures/routes/api/form-all.post.ts +5 -0
- package/src/test/fixtures/routes/api/form-limited.post.ts +6 -0
- package/src/test/fixtures/routes/api/response-obj.get.ts +17 -0
- package/src/test/fixtures/routes/api/upload.post.ts +14 -0
- package/src/test/fixtures/routes/api/users.get.ts +3 -0
- package/src/test/fixtures/routes/api/xml.get.ts +5 -0
- package/src/test/fixtures/routes/auth/_middleware.ts +11 -0
- package/src/test/fixtures/routes/auth/protected.page.ts +3 -0
- package/src/test/fixtures/routes/index.page.ts +3 -0
- package/src/test/fixtures/routes/oml.page.ts +7 -0
- package/src/test/fixtures/routes/redirect.page.ts +3 -0
- package/src/test/fixtures/routes/ssg/[slug].page.ts +8 -0
- package/src/test/fixtures/routes/ssg/server.page.ts +5 -0
- package/src/test/fixtures/routes/state.page.ts +4 -0
- package/src/test/fixtures/routes/throw.page.ts +5 -0
- package/src/test/fixtures/routes/wiki/[...slug].page.ts +3 -0
- package/src/test/helpers.ts +132 -0
- package/src/test/layouts.test.ts +76 -0
- package/src/test/middleware.test.ts +69 -0
- package/src/test/multipart.test.ts +91 -0
- package/src/test/oml-routing.test.ts +59 -0
- package/src/test/oml.test.ts +429 -0
- package/src/test/redirects.test.ts +32 -0
- package/src/test/routing.test.ts +118 -0
- package/src/test/ssg.test.ts +273 -0
- package/src/test/web-response.test.ts +33 -0
- package/src/types.ts +670 -0
- package/tsconfig.client.json +17 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { createEffect, createSignal } from "./signal.js";
|
|
2
|
+
function flatNodes(node) {
|
|
3
|
+
if (node instanceof DocumentFragment) return [...node.childNodes];
|
|
4
|
+
return [node];
|
|
5
|
+
}
|
|
6
|
+
function For(props) {
|
|
7
|
+
const anchor = document.createTextNode("");
|
|
8
|
+
if (!props.key) {
|
|
9
|
+
let prevNodes = [];
|
|
10
|
+
let initialized2 = false;
|
|
11
|
+
createEffect(() => {
|
|
12
|
+
const items = typeof props.each === "function" ? props.each() : props.each;
|
|
13
|
+
const newNodes = items.flatMap((item, i) => flatNodes(props.children(item, () => i)));
|
|
14
|
+
if (!initialized2) {
|
|
15
|
+
initialized2 = true;
|
|
16
|
+
prevNodes = newNodes;
|
|
17
|
+
} else {
|
|
18
|
+
const parent = anchor.parentNode;
|
|
19
|
+
if (parent) {
|
|
20
|
+
for (const n of newNodes) parent.insertBefore(n, anchor);
|
|
21
|
+
for (const n of prevNodes) n.parentNode?.removeChild(n);
|
|
22
|
+
prevNodes = newNodes;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const frag2 = document.createDocumentFragment();
|
|
27
|
+
for (const n of prevNodes) frag2.append(n);
|
|
28
|
+
frag2.append(anchor);
|
|
29
|
+
return frag2;
|
|
30
|
+
}
|
|
31
|
+
const keyFn = props.key;
|
|
32
|
+
const entries = /* @__PURE__ */ new Map();
|
|
33
|
+
let initialized = false;
|
|
34
|
+
createEffect(() => {
|
|
35
|
+
const items = typeof props.each === "function" ? props.each() : props.each;
|
|
36
|
+
const nextKeys = /* @__PURE__ */ new Set();
|
|
37
|
+
const ordered = [];
|
|
38
|
+
for (let i = 0; i < items.length; i++) {
|
|
39
|
+
const k = keyFn(items[i]);
|
|
40
|
+
nextKeys.add(k);
|
|
41
|
+
let entry = entries.get(k);
|
|
42
|
+
if (entry) {
|
|
43
|
+
entry.setIndex(i);
|
|
44
|
+
} else {
|
|
45
|
+
const [index, setIndex] = createSignal(i);
|
|
46
|
+
entry = { nodes: flatNodes(props.children(items[i], index)), setIndex };
|
|
47
|
+
entries.set(k, entry);
|
|
48
|
+
}
|
|
49
|
+
ordered.push(entry);
|
|
50
|
+
}
|
|
51
|
+
if (!initialized) {
|
|
52
|
+
initialized = true;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
for (const [k, entry] of entries) {
|
|
56
|
+
if (!nextKeys.has(k)) {
|
|
57
|
+
for (const n of entry.nodes) n.parentNode?.removeChild(n);
|
|
58
|
+
entries.delete(k);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const parent = anchor.parentNode;
|
|
62
|
+
if (parent) {
|
|
63
|
+
let ref = anchor;
|
|
64
|
+
for (let i = ordered.length - 1; i >= 0; i--) {
|
|
65
|
+
const { nodes } = ordered[i];
|
|
66
|
+
for (let ni = nodes.length - 1; ni >= 0; ni--) {
|
|
67
|
+
parent.insertBefore(nodes[ni], ref);
|
|
68
|
+
}
|
|
69
|
+
ref = nodes[0];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const frag = document.createDocumentFragment();
|
|
74
|
+
for (const [, { nodes }] of entries) {
|
|
75
|
+
for (const n of nodes) frag.append(n);
|
|
76
|
+
}
|
|
77
|
+
frag.append(anchor);
|
|
78
|
+
return frag;
|
|
79
|
+
}
|
|
80
|
+
function Show(props) {
|
|
81
|
+
const anchor = document.createTextNode("");
|
|
82
|
+
let childNodes = null;
|
|
83
|
+
let fallbackNodes = null;
|
|
84
|
+
function getChildNodes() {
|
|
85
|
+
if (childNodes !== null) return childNodes;
|
|
86
|
+
const raw = typeof props.children === "function" ? props.children() : props.children;
|
|
87
|
+
childNodes = flatNodes(
|
|
88
|
+
Array.isArray(raw) ? (() => {
|
|
89
|
+
const f = document.createDocumentFragment();
|
|
90
|
+
for (const n of raw) f.append(n);
|
|
91
|
+
return f;
|
|
92
|
+
})() : raw
|
|
93
|
+
);
|
|
94
|
+
return childNodes;
|
|
95
|
+
}
|
|
96
|
+
function getFallbackNodes() {
|
|
97
|
+
if (fallbackNodes !== null) return fallbackNodes;
|
|
98
|
+
if (!props.fallback) {
|
|
99
|
+
fallbackNodes = [];
|
|
100
|
+
return fallbackNodes;
|
|
101
|
+
}
|
|
102
|
+
const raw = typeof props.fallback === "function" ? props.fallback() : props.fallback;
|
|
103
|
+
fallbackNodes = flatNodes(raw);
|
|
104
|
+
return fallbackNodes;
|
|
105
|
+
}
|
|
106
|
+
let prevVisible;
|
|
107
|
+
createEffect(() => {
|
|
108
|
+
const visible = typeof props.when === "function" ? props.when() : props.when;
|
|
109
|
+
if (visible === prevVisible) return;
|
|
110
|
+
prevVisible = visible;
|
|
111
|
+
const parent = anchor.parentNode;
|
|
112
|
+
if (!parent) return;
|
|
113
|
+
const toAdd = visible ? getChildNodes() : getFallbackNodes();
|
|
114
|
+
const toRemove = visible ? fallbackNodes ?? [] : childNodes ?? [];
|
|
115
|
+
for (const n of toAdd) parent.insertBefore(n, anchor);
|
|
116
|
+
for (const n of toRemove) n.parentNode?.removeChild(n);
|
|
117
|
+
});
|
|
118
|
+
const frag = document.createDocumentFragment();
|
|
119
|
+
const initialVisible = typeof props.when === "function" ? props.when() : props.when;
|
|
120
|
+
const initialNodes = initialVisible ? getChildNodes() : getFallbackNodes();
|
|
121
|
+
for (const n of initialNodes) frag.append(n);
|
|
122
|
+
frag.append(anchor);
|
|
123
|
+
return frag;
|
|
124
|
+
}
|
|
125
|
+
function ErrorBoundary(props) {
|
|
126
|
+
let nodes = [];
|
|
127
|
+
let caught = null;
|
|
128
|
+
try {
|
|
129
|
+
const raw = props.children();
|
|
130
|
+
nodes = Array.isArray(raw) ? flatNodes(
|
|
131
|
+
(() => {
|
|
132
|
+
const f = document.createDocumentFragment();
|
|
133
|
+
for (const n of raw) f.append(n);
|
|
134
|
+
return f;
|
|
135
|
+
})()
|
|
136
|
+
) : flatNodes(raw);
|
|
137
|
+
} catch (e) {
|
|
138
|
+
caught = e instanceof Error ? e : new Error(String(e));
|
|
139
|
+
}
|
|
140
|
+
const frag = document.createDocumentFragment();
|
|
141
|
+
if (caught !== null) {
|
|
142
|
+
const fallback = typeof props.fallback === "function" ? props.fallback(caught) : props.fallback;
|
|
143
|
+
for (const n of flatNodes(fallback)) frag.append(n);
|
|
144
|
+
} else {
|
|
145
|
+
for (const n of nodes) frag.append(n);
|
|
146
|
+
}
|
|
147
|
+
return frag;
|
|
148
|
+
}
|
|
149
|
+
export {
|
|
150
|
+
ErrorBoundary,
|
|
151
|
+
For,
|
|
152
|
+
Show
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=control.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../client/control.ts"],
|
|
4
|
+
"sourcesContent": ["import { createEffect, createSignal } from './signal.js'\n\n// DocumentFragment is consumed on first insert, so we must spread its children\n// into a plain array before we can track and re-attach them.\nfunction flatNodes(node: Node): Node[] {\n if (node instanceof DocumentFragment) return [...node.childNodes]\n return [node]\n}\n\n// \u2500\u2500\u2500 <For> \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface ForProps<T> {\n each: (() => T[]) | T[]\n /** When provided, enables keyed diffing: nodes are reused/moved instead of\n * destroyed and recreated on every array change. The key must be unique\n * within the list. Same key \u2192 same DOM node; the index signal updates in place. */\n key?: (item: T) => string | number\n children: (item: T, index: () => number) => Node\n}\n\n/**\n * Render a reactive list. Re-renders the full list on every array change by default.\n * Pass `key` to enable keyed diffing \u2014 each item's DOM node is created once per key\n * and moved or removed rather than destroyed and recreated on every update.\n * The `index` argument to the render function is a reactive signal that stays\n * correct as items are inserted, removed, or reordered.\n */\nexport function For<T>(props: ForProps<T>): Node {\n const anchor = document.createTextNode('')\n\n if (!props.key) {\n // Non-keyed: full re-render on every change.\n let prevNodes: Node[] = []\n let initialized = false\n\n createEffect(() => {\n const items = typeof props.each === 'function' ? props.each() : props.each\n const newNodes: Node[] = items.flatMap((item, i) => flatNodes(props.children(item, () => i)))\n\n if (!initialized) {\n initialized = true\n prevNodes = newNodes\n } else {\n const parent = anchor.parentNode\n if (parent) {\n for (const n of newNodes) parent.insertBefore(n, anchor)\n for (const n of prevNodes) n.parentNode?.removeChild(n)\n prevNodes = newNodes\n }\n }\n })\n\n const frag = document.createDocumentFragment()\n for (const n of prevNodes) frag.append(n)\n frag.append(anchor)\n return frag as unknown as Node\n }\n\n // Keyed diffing: create once per key, move/update on subsequent changes.\n type Entry = { nodes: Node[]; setIndex: (i: number) => void }\n const keyFn = props.key\n const entries = new Map<string | number, Entry>()\n let initialized = false\n\n createEffect(() => {\n const items = typeof props.each === 'function' ? props.each() : props.each\n const nextKeys = new Set<string | number>()\n const ordered: Entry[] = []\n\n for (let i = 0; i < items.length; i++) {\n const k = keyFn(items[i])\n nextKeys.add(k)\n let entry = entries.get(k)\n if (entry) {\n entry.setIndex(i)\n } else {\n const [index, setIndex] = createSignal(i)\n entry = { nodes: flatNodes(props.children(items[i], index)), setIndex }\n entries.set(k, entry)\n }\n ordered.push(entry)\n }\n\n if (!initialized) {\n initialized = true\n return\n }\n\n // Remove entries no longer in the list.\n for (const [k, entry] of entries) {\n if (!nextKeys.has(k)) {\n for (const n of entry.nodes) n.parentNode?.removeChild(n)\n entries.delete(k)\n }\n }\n\n // Reorder: walk backwards, inserting each entry's nodes before a running\n // reference node. This places every entry exactly once in O(n) DOM ops.\n const parent = anchor.parentNode\n if (parent) {\n let ref: Node = anchor\n for (let i = ordered.length - 1; i >= 0; i--) {\n const { nodes } = ordered[i]\n for (let ni = nodes.length - 1; ni >= 0; ni--) {\n parent.insertBefore(nodes[ni], ref)\n }\n ref = nodes[0]\n }\n }\n })\n\n // Initial fragment \u2014 entries were populated synchronously by the first\n // effect run above; anchor hasn't been inserted yet so no DOM ops ran.\n const frag = document.createDocumentFragment()\n for (const [, { nodes }] of entries) {\n for (const n of nodes) frag.append(n)\n }\n frag.append(anchor)\n return frag as unknown as Node\n}\n\n// \u2500\u2500\u2500 <Show> \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Conditional rendering. Children and fallback are resolved lazily \u2014 pass a\n// function child `() => <Node>` to defer construction until `when` is first\n// true. Once resolved, nodes are cached and only attached/detached on toggle.\n\nexport interface ShowProps {\n when: (() => boolean) | boolean\n children: Node | Node[] | (() => Node | Node[])\n fallback?: Node | (() => Node)\n}\n\n/**\n * Conditionally render content. Children and fallback are cached after first\n * construction and only attached or detached as the condition toggles.\n *\n * Pass a function child `() => <Node>` to defer construction until `when` is\n * first true \u2014 useful when children contain expensive effects or data fetching.\n */\nexport function Show(props: ShowProps): Node {\n const anchor = document.createTextNode('')\n\n let childNodes: Node[] | null = null\n let fallbackNodes: Node[] | null = null\n\n function getChildNodes(): Node[] {\n if (childNodes !== null) return childNodes\n const raw = typeof props.children === 'function' ? props.children() : props.children\n childNodes = flatNodes(\n Array.isArray(raw)\n ? (() => {\n const f = document.createDocumentFragment()\n for (const n of raw) f.append(n)\n return f\n })()\n : raw,\n )\n return childNodes\n }\n\n function getFallbackNodes(): Node[] {\n if (fallbackNodes !== null) return fallbackNodes\n if (!props.fallback) {\n fallbackNodes = []\n return fallbackNodes\n }\n const raw = typeof props.fallback === 'function' ? props.fallback() : props.fallback\n fallbackNodes = flatNodes(raw)\n return fallbackNodes\n }\n\n let prevVisible: boolean | undefined\n\n createEffect(() => {\n const visible = typeof props.when === 'function' ? props.when() : props.when\n if (visible === prevVisible) return\n prevVisible = visible\n\n const parent = anchor.parentNode\n if (!parent) return\n\n const toAdd = visible ? getChildNodes() : getFallbackNodes()\n const toRemove = visible ? (fallbackNodes ?? []) : (childNodes ?? [])\n\n for (const n of toAdd) parent.insertBefore(n, anchor)\n for (const n of toRemove) n.parentNode?.removeChild(n)\n })\n\n const frag = document.createDocumentFragment()\n const initialVisible = typeof props.when === 'function' ? props.when() : props.when\n const initialNodes = initialVisible ? getChildNodes() : getFallbackNodes()\n for (const n of initialNodes) frag.append(n)\n frag.append(anchor)\n return frag as unknown as Node\n}\n\n// \u2500\u2500\u2500 <ErrorBoundary> \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface ErrorBoundaryProps {\n /** Rendered when children throw. Receives the caught error if passed as a function. */\n fallback: Node | ((error: Error) => Node)\n /** Must be a function so construction is deferred into the try/catch. */\n children: () => Node | Node[]\n}\n\n/**\n * Catch errors thrown during the initial construction of children \u2014 including\n * errors in the first run of any `createEffect` inside them \u2014 and render\n * `fallback` instead.\n *\n * Children must be a function so their construction is deferred into the\n * boundary's try/catch. A plain JSX child would be evaluated before\n * `ErrorBoundary` runs and could not be caught.\n *\n * Errors from subsequent reactive updates are not caught \u2014 add try/catch\n * inside those effects for fine-grained recovery.\n */\nexport function ErrorBoundary(props: ErrorBoundaryProps): Node {\n let nodes: Node[] = []\n let caught: Error | null = null\n\n try {\n const raw = props.children()\n nodes = Array.isArray(raw)\n ? flatNodes(\n (() => {\n const f = document.createDocumentFragment()\n for (const n of raw) f.append(n)\n return f\n })(),\n )\n : flatNodes(raw)\n } catch (e) {\n caught = e instanceof Error ? e : new Error(String(e))\n }\n\n const frag = document.createDocumentFragment()\n\n if (caught !== null) {\n const fallback = typeof props.fallback === 'function' ? props.fallback(caught) : props.fallback\n for (const n of flatNodes(fallback)) frag.append(n)\n } else {\n for (const n of nodes) frag.append(n)\n }\n\n return frag as unknown as Node\n}\n"],
|
|
5
|
+
"mappings": "AAAA,S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Q,MAAM,QAAQ,GAAG,IACrB;AAAA,OACG,MAAM;AACL,cAAM,IAAI,SAAS,uBAAuB;AAC1C,mBAAW,KAAK,IAAK,GAAE,OAAO,CAAC;AAC/B,eAAO;AAAA,MACT,GAAG;AAAA,IACL,IACA,UAAU,GAAG;AAAA,EACnB,SAAS,GAAG;AACV,aAAS,aAAa,QAAQ,IAAI,IAAI,MAAM,OAAO,CAAC,CAAC;AAAA,EACvD;AAEA,QAAM,OAAO,SAAS,uBAAuB;AAE7C,MAAI,WAAW,MAAM;AACnB,UAAM,WAAW,OAAO,MAAM,aAAa,aAAa,MAAM,SAAS,MAAM,IAAI,MAAM;AACvF,eAAW,KAAK,UAAU,QAAQ,EAAG,MAAK,OAAO,CAAC;AAAA,EACpD,OAAO;AACL,eAAW,KAAK,MAAO,MAAK,OAAO,CAAC;AAAA,EACtC;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": ["initialized", "frag"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydrate.d.ts","sourceRoot":"","sources":["../../client/hydrate.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,cAAc;IAC7B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;KAAE,CAAC,CAAA;CACzF;AAED,wBAAsB,OAAO,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BrE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRoot } from "./signal.js";
|
|
2
|
+
async function hydrate(manifest) {
|
|
3
|
+
const islands = document.querySelectorAll("[data-island]");
|
|
4
|
+
await Promise.all(
|
|
5
|
+
Array.from(islands).map(async (el) => {
|
|
6
|
+
const id = el.dataset.island;
|
|
7
|
+
if (!id || !(id in manifest)) return;
|
|
8
|
+
let props = {};
|
|
9
|
+
try {
|
|
10
|
+
props = JSON.parse(el.dataset.props ?? "{}");
|
|
11
|
+
} catch {
|
|
12
|
+
console.warn(`[davaux] Failed to parse props for island "${id}"`);
|
|
13
|
+
}
|
|
14
|
+
const { default: Component } = await manifest[id]();
|
|
15
|
+
const node = createRoot(() => Component(props));
|
|
16
|
+
el.replaceChildren(node);
|
|
17
|
+
})
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
hydrate
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=hydrate.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../client/hydrate.ts"],
|
|
4
|
+
"sourcesContent": ["// Island hydration \u2014 runs in the browser after the server-rendered page loads.\n// Finds [data-island] elements, imports the matching component module, and\n// mounts it with the serialized props so signals become reactive.\n\nimport { createRoot } from './signal.js'\n\nexport interface IslandManifest {\n [islandId: string]: () => Promise<{ default: (props: Record<string, unknown>) => Node }>\n}\n\nexport async function hydrate(manifest: IslandManifest): Promise<void> {\n const islands = document.querySelectorAll<HTMLElement>('[data-island]')\n\n await Promise.all(\n Array.from(islands).map(async (el) => {\n const id = el.dataset.island\n if (!id || !(id in manifest)) return\n\n let props: Record<string, unknown> = {}\n try {\n props = JSON.parse(el.dataset.props ?? '{}')\n } catch {\n console.warn(`[davaux] Failed to parse props for island \"${id}\"`)\n }\n\n const { default: Component } = await manifest[id]()\n\n // Run the component inside a reactive root so any onCleanup() calls\n // (e.g. from createResource refetchInterval) are collected and can be\n // disposed if the island is ever unmounted.\n const node = createRoot(() => Component(props))\n\n // Replace server-rendered children with the live DOM subtree\n el.replaceChildren(node)\n }),\n )\n}\n"],
|
|
5
|
+
"mappings": "AAIA,SAAS,kBAAkB;AAM3B,eAAsB,QAAQ,UAAyC;AACrE,QAAM,UAAU,SAAS,iBAA8B,eAAe;AAEtE,QAAM,QAAQ;AAAA,IACZ,MAAM,KAAK,OAAO,EAAE,IAAI,OAAO,OAAO;AACpC,YAAM,KAAK,GAAG,QAAQ;AACtB,UAAI,CAAC,MAAM,EAAE,MAAM,UAAW;AAE9B,UAAI,QAAiC,CAAC;AACtC,UAAI;AACF,gBAAQ,KAAK,MAAM,GAAG,QAAQ,SAAS,IAAI;AAAA,MAC7C,QAAQ;AACN,gBAAQ,KAAK,8CAA8C,EAAE,GAAG;AAAA,MAClE;AAEA,YAAM,EAAE,SAAS,UAAU,IAAI,MAAM,SAAS,EAAE,EAAE;AAKlD,YAAM,OAAO,WAAW,MAAM,UAAU,KAAK,CAAC;AAG9C,SAAG,gBAAgB,IAAI;AAAA,IACzB,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { ErrorBoundaryProps, ForProps, ShowProps } from './control.js';
|
|
2
|
+
export { ErrorBoundary, For, Show } from './control.js';
|
|
3
|
+
export type { IslandManifest } from './hydrate.js';
|
|
4
|
+
export { hydrate } from './hydrate.js';
|
|
5
|
+
export type { Resource, ResourceOptions, ResourceReturn } from './resource.js';
|
|
6
|
+
export { createEventSource, createResource } from './resource.js';
|
|
7
|
+
export { batch, createEffect, createMemo, createRoot, createSignal, onCleanup, untrack, } from './signal.js';
|
|
8
|
+
export type { SetStoreFn, Updater } from './store.js';
|
|
9
|
+
export { createStore } from './store.js';
|
|
10
|
+
export type { MetaDescriptor, UseHeadOptions } from './useHead.js';
|
|
11
|
+
export { useHead } from './useHead.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC3E,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EACL,KAAK,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,YAAY,EACZ,SAAS,EACT,OAAO,GACR,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ErrorBoundary, For, Show } from "./control.js";
|
|
2
|
+
import { hydrate } from "./hydrate.js";
|
|
3
|
+
import { createEventSource, createResource } from "./resource.js";
|
|
4
|
+
import {
|
|
5
|
+
batch,
|
|
6
|
+
createEffect,
|
|
7
|
+
createMemo,
|
|
8
|
+
createRoot,
|
|
9
|
+
createSignal,
|
|
10
|
+
onCleanup,
|
|
11
|
+
untrack
|
|
12
|
+
} from "./signal.js";
|
|
13
|
+
import { createStore } from "./store.js";
|
|
14
|
+
import { useHead } from "./useHead.js";
|
|
15
|
+
export {
|
|
16
|
+
ErrorBoundary,
|
|
17
|
+
For,
|
|
18
|
+
Show,
|
|
19
|
+
batch,
|
|
20
|
+
createEffect,
|
|
21
|
+
createEventSource,
|
|
22
|
+
createMemo,
|
|
23
|
+
createResource,
|
|
24
|
+
createRoot,
|
|
25
|
+
createSignal,
|
|
26
|
+
createStore,
|
|
27
|
+
hydrate,
|
|
28
|
+
onCleanup,
|
|
29
|
+
untrack,
|
|
30
|
+
useHead
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../client/index.ts"],
|
|
4
|
+
"sourcesContent": ["export type { ErrorBoundaryProps, ForProps, ShowProps } from './control.js'\nexport { ErrorBoundary, For, Show } from './control.js'\nexport type { IslandManifest } from './hydrate.js'\nexport { hydrate } from './hydrate.js'\nexport type { Resource, ResourceOptions, ResourceReturn } from './resource.js'\nexport { createEventSource, createResource } from './resource.js'\nexport {\n batch,\n createEffect,\n createMemo,\n createRoot,\n createSignal,\n onCleanup,\n untrack,\n} from './signal.js'\nexport type { SetStoreFn, Updater } from './store.js'\nexport { createStore } from './store.js'\nexport type { MetaDescriptor, UseHeadOptions } from './useHead.js'\nexport { useHead } from './useHead.js'\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,eAAe,KAAK,YAAY;AAEzC,SAAS,eAAe;AAExB,SAAS,mBAAmB,sBAAsB;AAClD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,mBAAmB;AAE5B,SAAS,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type Child = Node | string | number | boolean | null | undefined | (() => Child) | Child[];
|
|
2
|
+
type StyleObject = Record<string, string | number>;
|
|
3
|
+
export type Props = {
|
|
4
|
+
children?: Child | Child[];
|
|
5
|
+
key?: string | number;
|
|
6
|
+
ref?: ((el: Element) => void) | {
|
|
7
|
+
current: Element | null;
|
|
8
|
+
};
|
|
9
|
+
style?: string | StyleObject;
|
|
10
|
+
className?: string;
|
|
11
|
+
htmlFor?: string;
|
|
12
|
+
[prop: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
export type ComponentType<P extends Props = Props> = (props: P) => Node;
|
|
15
|
+
export declare function jsx(type: string | ComponentType, props: Props, _key?: string | number): Node;
|
|
16
|
+
export declare const jsxs: typeof jsx;
|
|
17
|
+
export declare const jsxDEV: typeof jsx;
|
|
18
|
+
export declare const Fragment = "__Fragment__";
|
|
19
|
+
export declare namespace JSX {
|
|
20
|
+
export type Element = Node;
|
|
21
|
+
/** Reactive child: a signal getter (or any zero-arg fn) re-runs on signal change. */
|
|
22
|
+
export type ReactiveChild = () => Child;
|
|
23
|
+
export type Child = Node | string | number | boolean | null | undefined | ReactiveChild | Child[];
|
|
24
|
+
export interface ElementChildrenAttribute {
|
|
25
|
+
children: object;
|
|
26
|
+
}
|
|
27
|
+
export interface IntrinsicAttributes {
|
|
28
|
+
key?: string | number;
|
|
29
|
+
}
|
|
30
|
+
interface DOMAttributes {
|
|
31
|
+
children?: Child | Child[];
|
|
32
|
+
[attr: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
export interface IntrinsicElements {
|
|
35
|
+
[tag: string]: DOMAttributes;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=jsx-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../client/jsx-runtime.ts"],"names":[],"mappings":"AAOA,KAAK,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,EAAE,CAAA;AAC1F,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;AAElD,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,CAAA;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,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Aa,CAAA;KAC7B;;CACF"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { createEffect } from "./signal.js";
|
|
2
|
+
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
3
|
+
const SVG_TAGS = /* @__PURE__ */ new Set([
|
|
4
|
+
"svg",
|
|
5
|
+
"circle",
|
|
6
|
+
"rect",
|
|
7
|
+
"path",
|
|
8
|
+
"line",
|
|
9
|
+
"polyline",
|
|
10
|
+
"polygon",
|
|
11
|
+
"ellipse",
|
|
12
|
+
"g",
|
|
13
|
+
"text",
|
|
14
|
+
"defs",
|
|
15
|
+
"use",
|
|
16
|
+
"symbol",
|
|
17
|
+
"clipPath",
|
|
18
|
+
"mask",
|
|
19
|
+
"filter",
|
|
20
|
+
"linearGradient",
|
|
21
|
+
"radialGradient",
|
|
22
|
+
"stop",
|
|
23
|
+
"pattern",
|
|
24
|
+
"image",
|
|
25
|
+
"foreignObject"
|
|
26
|
+
]);
|
|
27
|
+
function normalizeAttrName(key) {
|
|
28
|
+
if (key === "className") return "class";
|
|
29
|
+
if (key === "htmlFor") return "for";
|
|
30
|
+
if (key === "tabIndex") return "tabindex";
|
|
31
|
+
return key;
|
|
32
|
+
}
|
|
33
|
+
function applyStyle(el, style) {
|
|
34
|
+
if (typeof style === "string") {
|
|
35
|
+
el.style.cssText = style;
|
|
36
|
+
} else {
|
|
37
|
+
for (const [k, v] of Object.entries(style)) {
|
|
38
|
+
el.style.setProperty(
|
|
39
|
+
k.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`),
|
|
40
|
+
String(v)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function applyProp(el, key, value) {
|
|
46
|
+
if (key === "ref") {
|
|
47
|
+
if (typeof value === "function") value(el);
|
|
48
|
+
else if (value && typeof value === "object" && "current" in value) {
|
|
49
|
+
;
|
|
50
|
+
value.current = el;
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (key === "style") {
|
|
55
|
+
applyStyle(el, value);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (key.startsWith("on") && key[2] === key[2]?.toUpperCase()) {
|
|
59
|
+
const event = key.slice(2).toLowerCase();
|
|
60
|
+
el.addEventListener(event, value);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const attr = normalizeAttrName(key);
|
|
64
|
+
if (value === false || value == null) {
|
|
65
|
+
el.removeAttribute(attr);
|
|
66
|
+
} else if (value === true) {
|
|
67
|
+
el.setAttribute(attr, "");
|
|
68
|
+
} else {
|
|
69
|
+
el.setAttribute(attr, String(value));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function toNode(child) {
|
|
73
|
+
if (child == null || child === false) return document.createTextNode("");
|
|
74
|
+
if (Array.isArray(child)) return child.flatMap((c) => toNode(c));
|
|
75
|
+
if (child instanceof Node) return child;
|
|
76
|
+
if (typeof child === "function") {
|
|
77
|
+
const anchor = document.createTextNode("");
|
|
78
|
+
let prevNodes = [];
|
|
79
|
+
let initialized = false;
|
|
80
|
+
createEffect(() => {
|
|
81
|
+
const newNodes = [toNode(child())].flat();
|
|
82
|
+
if (!initialized) {
|
|
83
|
+
initialized = true;
|
|
84
|
+
prevNodes = newNodes;
|
|
85
|
+
} else {
|
|
86
|
+
const parent = anchor.parentNode;
|
|
87
|
+
if (parent) {
|
|
88
|
+
for (const n of newNodes) parent.insertBefore(n, anchor);
|
|
89
|
+
for (const n of prevNodes) n.parentNode?.removeChild(n);
|
|
90
|
+
prevNodes = newNodes;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const frag = document.createDocumentFragment();
|
|
95
|
+
for (const n of prevNodes) frag.append(n);
|
|
96
|
+
frag.append(anchor);
|
|
97
|
+
return frag;
|
|
98
|
+
}
|
|
99
|
+
return document.createTextNode(String(child));
|
|
100
|
+
}
|
|
101
|
+
function mountChildren(el, children) {
|
|
102
|
+
if (children == null) return;
|
|
103
|
+
const flat = Array.isArray(children) ? children : [children];
|
|
104
|
+
for (const child of flat) {
|
|
105
|
+
const nodes = [toNode(child)].flat();
|
|
106
|
+
el.append(...nodes);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function jsx(type, props, _key) {
|
|
110
|
+
if (typeof type === "function") {
|
|
111
|
+
return type(props);
|
|
112
|
+
}
|
|
113
|
+
if (type === Fragment) {
|
|
114
|
+
const frag = document.createDocumentFragment();
|
|
115
|
+
mountChildren(frag, props.children);
|
|
116
|
+
return frag;
|
|
117
|
+
}
|
|
118
|
+
const el = SVG_TAGS.has(type) ? document.createElementNS(SVG_NAMESPACE, type) : document.createElement(type);
|
|
119
|
+
for (const [key, value] of Object.entries(props)) {
|
|
120
|
+
if (key === "children") continue;
|
|
121
|
+
if (typeof value === "function" && !key.startsWith("on")) {
|
|
122
|
+
createEffect(() => applyProp(el, key, value()));
|
|
123
|
+
} else {
|
|
124
|
+
applyProp(el, key, value);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
mountChildren(el, props.children);
|
|
128
|
+
return el;
|
|
129
|
+
}
|
|
130
|
+
const jsxs = jsx;
|
|
131
|
+
const jsxDEV = jsx;
|
|
132
|
+
const Fragment = "__Fragment__";
|
|
133
|
+
export {
|
|
134
|
+
Fragment,
|
|
135
|
+
jsx,
|
|
136
|
+
jsxDEV,
|
|
137
|
+
jsxs
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../client/jsx-runtime.ts"],
|
|
4
|
+
"sourcesContent": ["// Client JSX runtime \u2014 creates live DOM nodes instead of HTML strings.\n// When a signal is read during prop/child evaluation, a subscription is\n// created so that DOM node updates automatically when the signal changes.\n// No virtual DOM: changes are applied directly and surgically.\n\nimport { createEffect } from './signal.js'\n\ntype Child = Node | string | number | boolean | null | undefined | (() => Child) | Child[]\ntype StyleObject = Record<string, string | number>\n\nexport type Props = {\n children?: Child | Child[]\n key?: string | number\n ref?: ((el: Element) => void) | { current: Element | null }\n style?: string | StyleObject\n className?: string\n htmlFor?: string\n [prop: string]: unknown\n}\n\nexport type ComponentType<P extends Props = Props> = (props: P) => Node\n\nconst SVG_NAMESPACE = 'http://www.w3.org/2000/svg'\nconst SVG_TAGS = new Set([\n 'svg',\n 'circle',\n 'rect',\n 'path',\n 'line',\n 'polyline',\n 'polygon',\n 'ellipse',\n 'g',\n 'text',\n 'defs',\n 'use',\n 'symbol',\n 'clipPath',\n 'mask',\n 'filter',\n 'linearGradient',\n 'radialGradient',\n 'stop',\n 'pattern',\n 'image',\n 'foreignObject',\n])\n\nfunction normalizeAttrName(key: string): string {\n if (key === 'className') return 'class'\n if (key === 'htmlFor') return 'for'\n if (key === 'tabIndex') return 'tabindex'\n return key\n}\n\nfunction applyStyle(el: HTMLElement, style: string | StyleObject): void {\n if (typeof style === 'string') {\n el.style.cssText = style\n } else {\n for (const [k, v] of Object.entries(style)) {\n // camelCase \u2192 kebab-case for CSS custom properties and standard props\n el.style.setProperty(\n k.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`),\n String(v),\n )\n }\n }\n}\n\nfunction applyProp(el: Element, key: string, value: unknown): void {\n if (key === 'ref') {\n if (typeof value === 'function') (value as (el: Element) => void)(el)\n else if (value && typeof value === 'object' && 'current' in value) {\n ;(value as { current: Element | null }).current = el\n }\n return\n }\n\n if (key === 'style') {\n applyStyle(el as HTMLElement, value as string | StyleObject)\n return\n }\n\n // Event handlers\n if (key.startsWith('on') && key[2] === key[2]?.toUpperCase()) {\n const event = key.slice(2).toLowerCase()\n el.addEventListener(event, value as EventListener)\n return\n }\n\n const attr = normalizeAttrName(key)\n\n if (value === false || value == null) {\n el.removeAttribute(attr)\n } else if (value === true) {\n el.setAttribute(attr, '')\n } else {\n el.setAttribute(attr, String(value))\n }\n}\n\nfunction toNode(child: Child): Node | Node[] {\n if (child == null || child === false) return document.createTextNode('')\n if (Array.isArray(child)) return child.flatMap((c) => toNode(c))\n if (child instanceof Node) return child\n if (typeof child === 'function') {\n // Reactive child \u2014 re-evaluates when signals it reads change.\n // The effect runs synchronously before `anchor` has a parent, so we\n // capture the initial nodes here and return them in a fragment so they\n // are inserted into the DOM immediately. Updates insert before `anchor`.\n const anchor = document.createTextNode('')\n let prevNodes: Node[] = []\n let initialized = false\n\n createEffect(() => {\n const newNodes = [toNode((child as () => Child)())].flat()\n if (!initialized) {\n initialized = true\n prevNodes = newNodes\n } else {\n const parent = anchor.parentNode\n if (parent) {\n for (const n of newNodes) parent.insertBefore(n, anchor)\n for (const n of prevNodes) n.parentNode?.removeChild(n)\n prevNodes = newNodes\n }\n }\n })\n\n const frag = document.createDocumentFragment()\n for (const n of prevNodes) frag.append(n)\n frag.append(anchor)\n return frag as unknown as Node\n }\n return document.createTextNode(String(child))\n}\n\nfunction mountChildren(el: Element, children: Child | Child[] | undefined): void {\n if (children == null) return\n\n const flat = Array.isArray(children) ? children : [children]\n for (const child of flat) {\n const nodes = [toNode(child)].flat()\n el.append(...nodes)\n }\n}\n\nexport function jsx(type: string | ComponentType, props: Props, _key?: string | number): Node {\n if (typeof type === 'function') {\n return type(props)\n }\n\n if (type === Fragment) {\n const frag = document.createDocumentFragment()\n mountChildren(frag as unknown as Element, props.children)\n return frag\n }\n\n const el = SVG_TAGS.has(type)\n ? document.createElementNS(SVG_NAMESPACE, type)\n : document.createElement(type)\n\n for (const [key, value] of Object.entries(props)) {\n if (key === 'children') continue\n\n if (typeof value === 'function' && !key.startsWith('on')) {\n // Reactive prop \u2014 re-run when the signal it reads changes\n createEffect(() => applyProp(el, key, (value as () => unknown)()))\n } else {\n applyProp(el, key, value)\n }\n }\n\n mountChildren(el, props.children)\n\n return el\n}\n\nexport const jsxs = jsx\nexport const jsxDEV = jsx\n\nexport const Fragment = '__Fragment__'\n\n// Client-side JSX namespace. JSX.Element is Node (a live DOM node),\n// not Promise<string> \u2014 the two runtimes are intentionally separate.\nexport namespace JSX {\n export type Element = Node\n\n /** Reactive child: a signal getter (or any zero-arg fn) re-runs on signal change. */\n export type ReactiveChild = () => Child\n export type Child = Node | string | number | boolean | null | undefined | ReactiveChild | Child[]\n\n export interface ElementChildrenAttribute {\n children: object\n }\n\n export interface IntrinsicAttributes {\n key?: string | number\n }\n\n interface DOMAttributes {\n children?: Child | Child[]\n [attr: string]: unknown\n }\n\n export interface IntrinsicElements {\n [tag: string]: DOMAttributes\n }\n}\n"],
|
|
5
|
+
"mappings": "AAKA,SAAS,oBAAoB;AAiB7B,MAAM,gBAAgB;AACtB,MAAM,WAAW,oBAAI,IAAI;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,kBAAkB,KAAqB;AAC9C,MAAI,QAAQ,YAAa,QAAO;AAChC,MAAI,QAAQ,UAAW,QAAO;AAC9B,MAAI,QAAQ,WAAY,QAAO;AAC/B,SAAO;AACT;AAEA,SAAS,WAAW,IAAiB,OAAmC;AACtE,MAAI,OAAO,UAAU,UAAU;AAC7B,OAAG,MAAM,UAAU;AAAA,EACrB,OAAO;AACL,eAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,KAAK,GAAG;AAE1C,SAAG,MAAM;AAAA,QACP,EAAE,QAAQ,UAAU,CAAC,MAAM,IAAI,EAAE,YAAY,CAAC,EAAE;AAAA,QAChD,OAAO,CAAC;AAAA,MACV;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,UAAU,IAAa,KAAa,OAAsB;AACjE,MAAI,QAAQ,OAAO;AACjB,QAAI,OAAO,UAAU,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+
/** A reactive async data accessor. Call it like a signal to read the resolved
|
|
2
|
+
* value. Read `.loading` and `.error` inside effects or JSX to react to state changes. */
|
|
3
|
+
export type Resource<T> = (() => T | undefined) & {
|
|
4
|
+
readonly loading: boolean;
|
|
5
|
+
readonly error: Error | undefined;
|
|
6
|
+
};
|
|
7
|
+
/** Options for `createResource`. */
|
|
8
|
+
export interface ResourceOptions {
|
|
9
|
+
/** Poll the fetcher on this interval (ms). Cleared when the reactive scope is disposed. */
|
|
10
|
+
refetchInterval?: number;
|
|
11
|
+
}
|
|
12
|
+
export type ResourceReturn<T> = [resource: Resource<T>, actions: {
|
|
13
|
+
refetch: () => void;
|
|
14
|
+
}];
|
|
15
|
+
/** No-source: fetcher is called immediately and on every `refetch()`. */
|
|
16
|
+
export declare function createResource<T>(fetcher: () => Promise<T>, options?: ResourceOptions): ResourceReturn<T>;
|
|
17
|
+
/** Reactive source: re-fetches whenever the source signal changes.
|
|
18
|
+
* Skips fetching when source returns `false`, `null`, or `undefined`. */
|
|
19
|
+
export declare function createResource<T, S>(source: () => S | false | null | undefined, fetcher: (src: S) => Promise<T>, options?: ResourceOptions): ResourceReturn<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Subscribe to a [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)
|
|
22
|
+
* endpoint. Returns a signal getter that holds the latest event's `data` string
|
|
23
|
+
* (`undefined` until the first message arrives) and the raw `EventSource` instance.
|
|
24
|
+
* The connection is closed when the reactive scope is disposed.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const [message] = createEventSource('/api/events')
|
|
28
|
+
* <p>Latest: {() => message() ?? '—'}</p>
|
|
29
|
+
*/
|
|
30
|
+
export declare function createEventSource(url: string): [() => string | undefined, EventSource];
|
|
31
|
+
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../client/resource.ts"],"names":[],"mappings":"AAIA;0FAC0F;AAC1F,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG;IAChD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;CAClC,CAAA;AAED,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,2FAA2F;IAC3F,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CAAA;AAEzF,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACzB,OAAO,CAAC,EAAE,eAAe,GACxB,cAAc,CAAC,CAAC,CAAC,CAAA;AAEpB;0EAC0E;AAC1E,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,EACjC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,EAC1C,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EAC/B,OAAO,CAAC,EAAE,eAAe,GACxB,cAAc,CAAC,CAAC,CAAC,CAAA;AA2EpB;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,SAAS,EAAE,WAAW,CAAC,CAKtF"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createEffect, createSignal, onCleanup, untrack } from "./signal.js";
|
|
2
|
+
function createResource(fetcherOrSource, fetcherOrOptions, maybeOptions) {
|
|
3
|
+
const hasSource = typeof fetcherOrOptions === "function";
|
|
4
|
+
const options = hasSource ? maybeOptions ?? {} : fetcherOrOptions ?? {};
|
|
5
|
+
const initialSrc = hasSource ? untrack(fetcherOrSource) : null;
|
|
6
|
+
const startLoading = !hasSource || initialSrc != null && initialSrc !== false;
|
|
7
|
+
const [data, setData] = createSignal(void 0);
|
|
8
|
+
const [loading, setLoading] = createSignal(startLoading);
|
|
9
|
+
const [error, setError] = createSignal(void 0);
|
|
10
|
+
let version = 0;
|
|
11
|
+
async function execute(call) {
|
|
12
|
+
const v = ++version;
|
|
13
|
+
setLoading(true);
|
|
14
|
+
setError(void 0);
|
|
15
|
+
try {
|
|
16
|
+
const result = await untrack(call);
|
|
17
|
+
if (v !== version) return;
|
|
18
|
+
setData(result);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
if (v !== version) return;
|
|
21
|
+
setError(e instanceof Error ? e : new Error(String(e)));
|
|
22
|
+
} finally {
|
|
23
|
+
if (v === version) setLoading(false);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
let refetch = () => {
|
|
27
|
+
};
|
|
28
|
+
if (hasSource) {
|
|
29
|
+
const source = fetcherOrSource;
|
|
30
|
+
const fetcher = fetcherOrOptions;
|
|
31
|
+
refetch = () => {
|
|
32
|
+
const src = untrack(source);
|
|
33
|
+
if (src != null && src !== false) execute(() => fetcher(src));
|
|
34
|
+
};
|
|
35
|
+
createEffect(() => {
|
|
36
|
+
const src = source();
|
|
37
|
+
if (src == null || src === false) return;
|
|
38
|
+
execute(() => fetcher(src));
|
|
39
|
+
});
|
|
40
|
+
} else {
|
|
41
|
+
const fetcher = fetcherOrSource;
|
|
42
|
+
refetch = () => execute(fetcher);
|
|
43
|
+
refetch();
|
|
44
|
+
}
|
|
45
|
+
if (options.refetchInterval) {
|
|
46
|
+
const id = setInterval(refetch, options.refetchInterval);
|
|
47
|
+
onCleanup(() => clearInterval(id));
|
|
48
|
+
}
|
|
49
|
+
const resource = data;
|
|
50
|
+
Object.defineProperty(resource, "loading", { get: loading, enumerable: true });
|
|
51
|
+
Object.defineProperty(resource, "error", { get: error, enumerable: true });
|
|
52
|
+
return [resource, { refetch }];
|
|
53
|
+
}
|
|
54
|
+
function createEventSource(url) {
|
|
55
|
+
const [message, setMessage] = createSignal(void 0);
|
|
56
|
+
const es = new EventSource(url);
|
|
57
|
+
es.onmessage = (e) => setMessage(String(e.data));
|
|
58
|
+
return [message, es];
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
createEventSource,
|
|
62
|
+
createResource
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=resource.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../client/resource.ts"],
|
|
4
|
+
"sourcesContent": ["import { createEffect, createSignal, onCleanup, untrack } from './signal.js'\n\n// \u2500\u2500\u2500 createResource \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/** A reactive async data accessor. Call it like a signal to read the resolved\n * value. Read `.loading` and `.error` inside effects or JSX to react to state changes. */\nexport type Resource<T> = (() => T | undefined) & {\n readonly loading: boolean\n readonly error: Error | undefined\n}\n\n/** Options for `createResource`. */\nexport interface ResourceOptions {\n /** Poll the fetcher on this interval (ms). Cleared when the reactive scope is disposed. */\n refetchInterval?: number\n}\n\nexport type ResourceReturn<T> = [resource: Resource<T>, actions: { refetch: () => void }]\n\n/** No-source: fetcher is called immediately and on every `refetch()`. */\nexport function createResource<T>(\n fetcher: () => Promise<T>,\n options?: ResourceOptions,\n): ResourceReturn<T>\n\n/** Reactive source: re-fetches whenever the source signal changes.\n * Skips fetching when source returns `false`, `null`, or `undefined`. */\nexport function createResource<T, S>(\n source: () => S | false | null | undefined,\n fetcher: (src: S) => Promise<T>,\n options?: ResourceOptions,\n): ResourceReturn<T>\n\nexport function createResource<T, S = never>(\n fetcherOrSource: (() => Promise<T>) | (() => S | false | null | undefined),\n fetcherOrOptions?: ((src: S) => Promise<T>) | ResourceOptions,\n maybeOptions?: ResourceOptions,\n): ResourceReturn<T> {\n const hasSource = typeof fetcherOrOptions === 'function'\n const options: ResourceOptions = hasSource\n ? (maybeOptions ?? {})\n : ((fetcherOrOptions as ResourceOptions | undefined) ?? {})\n\n // When using a source, don't start in loading=true if source is initially falsy.\n const initialSrc = hasSource ? untrack(fetcherOrSource as () => unknown) : null\n const startLoading = !hasSource || (initialSrc != null && initialSrc !== false)\n\n const [data, setData] = createSignal<T | undefined>(undefined)\n const [loading, setLoading] = createSignal(startLoading)\n const [error, setError] = createSignal<Error | undefined>(undefined)\n\n // Version counter discards results from superseded in-flight requests.\n let version = 0\n\n async function execute(call: () => Promise<T>): Promise<void> {\n const v = ++version\n setLoading(true)\n setError(undefined)\n try {\n const result = await untrack(call)\n if (v !== version) return\n setData(result)\n } catch (e) {\n if (v !== version) return\n setError(e instanceof Error ? e : new Error(String(e)))\n } finally {\n if (v === version) setLoading(false)\n }\n }\n\n let refetch: () => void = () => {}\n\n if (hasSource) {\n const source = fetcherOrSource as () => S | false | null | undefined\n const fetcher = fetcherOrOptions as (src: S) => Promise<T>\n\n refetch = () => {\n const src = untrack(source)\n if (src != null && src !== false) execute(() => fetcher(src as S))\n }\n\n createEffect(() => {\n const src = source()\n if (src == null || src === false) return\n execute(() => fetcher(src))\n })\n } else {\n const fetcher = fetcherOrSource as () => Promise<T>\n refetch = () => execute(fetcher)\n refetch()\n }\n\n if (options.refetchInterval) {\n const id = setInterval(refetch, options.refetchInterval)\n onCleanup(() => clearInterval(id))\n }\n\n const resource = data as Resource<T>\n Object.defineProperty(resource, 'loading', { get: loading, enumerable: true })\n Object.defineProperty(resource, 'error', { get: error, enumerable: true })\n\n return [resource, { refetch }]\n}\n\n// \u2500\u2500\u2500 createEventSource \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Subscribe to a [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)\n * endpoint. Returns a signal getter that holds the latest event's `data` string\n * (`undefined` until the first message arrives) and the raw `EventSource` instance.\n * The connection is closed when the reactive scope is disposed.\n *\n * @example\n * const [message] = createEventSource('/api/events')\n * <p>Latest: {() => message() ?? '\u2014'}</p>\n */\nexport function createEventSource(url: string): [() => string | undefined, EventSource] {\n const [message, setMessage] = createSignal<string | undefined>(undefined)\n const es = new EventSource(url)\n es.onmessage = (e: MessageEvent) => setMessage(String(e.data))\n return [message, es]\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAc,cAAc,WAAW,eAAe;AAiCxD,SAAS,eACd,iBACA,kBACA,cACmB;AACnB,QAAM,YAAY,OAAO,qBAAqB;AAC9C,QAAM,UAA2B,YAC5B,gBAAgB,CAAC,IAChB,oBAAoD,CAAC;AAG3D,QAAM,aAAa,YAAY,QAAQ,eAAgC,IAAI;AAC3E,QAAM,eAAe,CAAC,aAAc,cAAc,QAAQ,eAAe;AAEzE,QAAM,CAAC,MAAM,OAAO,IAAI,aAA4B,MAAS;AAC7D,QAAM,CAAC,SAAS,UAAU,IAAI,aAAa,YAAY;AACvD,QAAM,CAAC,OAAO,QAAQ,IAAI,aAAgC,MAAS;AAGnE,MAAI,UAAU;AAEd,iBAAe,QAAQ,MAAuC;AAC5D,UAAM,IAAI,EAAE;AACZ,eAAW,IAAI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