@cosmicdrift/kumiko-headless 0.338.0 → 0.340.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apex/css.js +8 -0
- package/dist/apex/lightbox.d.ts +3 -3
- package/dist/apex/lightbox.js +42 -7
- package/package.json +2 -2
package/dist/apex/css.js
CHANGED
|
@@ -70,6 +70,14 @@ const HERO = `
|
|
|
70
70
|
border: 1px solid var(--border); border-radius: 0.5rem; background: var(--bg-card); color: var(--fg);
|
|
71
71
|
font-size: 1.5rem; line-height: 1; cursor: pointer; }
|
|
72
72
|
.apex-lightbox__close:hover { background: var(--bg-muted); }
|
|
73
|
+
.apex-lightbox__prev, .apex-lightbox__next { position: fixed; top: 50%; transform: translateY(-50%); z-index: 1;
|
|
74
|
+
width: 2.5rem; height: 2.5rem; border: 1px solid var(--border); border-radius: 0.5rem;
|
|
75
|
+
background: var(--bg-card); color: var(--fg); font-size: 1.75rem; line-height: 1; cursor: pointer; }
|
|
76
|
+
.apex-lightbox__prev { left: 1rem; }
|
|
77
|
+
.apex-lightbox__next { right: 1rem; }
|
|
78
|
+
.apex-lightbox__prev:hover, .apex-lightbox__next:hover { background: var(--bg-muted); }
|
|
79
|
+
.apex-lightbox__prev[hidden], .apex-lightbox__next[hidden] { display: none; }
|
|
80
|
+
.apex-dark .apex-lightbox__prev, .apex-dark .apex-lightbox__next { background: var(--on-dark); color: var(--primary); border-color: var(--on-dark-border); }
|
|
73
81
|
.apex-dark .apex-lightbox__close { background: var(--on-dark); color: var(--primary); border-color: var(--on-dark-border); }
|
|
74
82
|
`;
|
|
75
83
|
const FEATURES = `
|
package/dist/apex/lightbox.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const APEX_LIGHTBOX_HTML = "<dialog id=\"apex-lightbox\" class=\"apex-lightbox\" aria-label=\"Screenshot preview\">\n <button type=\"button\" class=\"apex-lightbox__close\" aria-label=\"Close\">×</button>\n <img class=\"apex-lightbox__img\" alt=\"\" />\n</dialog>";
|
|
1
|
+
export declare const APEX_LIGHTBOX_HTML = "<dialog id=\"apex-lightbox\" class=\"apex-lightbox\" aria-label=\"Screenshot preview\">\n <button type=\"button\" class=\"apex-lightbox__close\" aria-label=\"Close\">×</button>\n <button type=\"button\" class=\"apex-lightbox__prev\" aria-label=\"Previous screenshot\">‹</button>\n <button type=\"button\" class=\"apex-lightbox__next\" aria-label=\"Next screenshot\">›</button>\n <img class=\"apex-lightbox__img\" alt=\"\" />\n</dialog>";
|
|
2
2
|
/** ponytail: one delegated listener; no-op when no .shot-frame on the page. */
|
|
3
|
-
export declare const APEX_LIGHTBOX_SCRIPT = "<script>\n(function () {\n var dlg = document.getElementById(\"apex-lightbox\");\n if (!dlg) return;\n var img = dlg.querySelector(\".apex-lightbox__img\");\n var closeBtn = dlg.querySelector(\".apex-lightbox__close\");\n if (!img || !closeBtn) return;\n function
|
|
4
|
-
export declare const APEX_LIGHTBOX_SCRIPT_CSP_HASH = "sha256-
|
|
3
|
+
export declare const APEX_LIGHTBOX_SCRIPT = "<script>\n(function () {\n var dlg = document.getElementById(\"apex-lightbox\");\n if (!dlg) return;\n var img = dlg.querySelector(\".apex-lightbox__img\");\n var closeBtn = dlg.querySelector(\".apex-lightbox__close\");\n var prevBtn = dlg.querySelector(\".apex-lightbox__prev\");\n var nextBtn = dlg.querySelector(\".apex-lightbox__next\");\n if (!img || !closeBtn || !prevBtn || !nextBtn) return;\n var shots = [];\n var current = 0;\n function show(i) {\n var shot = shots[i];\n current = i;\n img.src = shot.currentSrc || shot.src;\n img.alt = shot.alt || \"\";\n }\n function step(delta) {\n if (shots.length < 2) return;\n show((current + delta + shots.length) % shots.length);\n }\n function open(target) {\n shots = Array.prototype.slice.call(document.querySelectorAll(\".shot-frame img\"));\n var start = shots.indexOf(target);\n if (start < 0) {\n shots = [target];\n start = 0;\n }\n show(start);\n prevBtn.hidden = nextBtn.hidden = shots.length < 2;\n if (typeof dlg.showModal === \"function\") dlg.showModal();\n }\n function close() {\n if (dlg.open) dlg.close();\n }\n document.addEventListener(\"click\", function (e) {\n var t = e.target;\n if (!(t instanceof HTMLImageElement)) return;\n if (!t.closest(\".shot-frame\")) return;\n e.preventDefault();\n open(t);\n });\n closeBtn.addEventListener(\"click\", close);\n prevBtn.addEventListener(\"click\", function () { step(-1); });\n nextBtn.addEventListener(\"click\", function () { step(1); });\n document.addEventListener(\"keydown\", function (e) {\n if (!dlg.open) return;\n if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n step(-1);\n } else if (e.key === \"ArrowRight\") {\n e.preventDefault();\n step(1);\n }\n });\n dlg.addEventListener(\"click\", function (e) {\n if (e.target === dlg) close();\n });\n dlg.addEventListener(\"cancel\", function (e) {\n e.preventDefault();\n close();\n });\n})();\n</script>";
|
|
4
|
+
export declare const APEX_LIGHTBOX_SCRIPT_CSP_HASH = "sha256-CLZlqZx0zShYKXq1Qg6+VYMTEC6tqiIlNf6JPA1nLck=";
|
package/dist/apex/lightbox.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
// Vanilla lightbox for Apex marketing pages — click .shot-frame img to enlarge
|
|
1
|
+
// Vanilla lightbox for Apex marketing pages — click .shot-frame img to enlarge,
|
|
2
|
+
// prev/next (buttons or arrow keys) walks all .shot-frame images on the page.
|
|
2
3
|
// Injected by renderApexPage; no React, no per-app wiring.
|
|
3
4
|
export const APEX_LIGHTBOX_HTML = `<dialog id="apex-lightbox" class="apex-lightbox" aria-label="Screenshot preview">
|
|
4
5
|
<button type="button" class="apex-lightbox__close" aria-label="Close">×</button>
|
|
6
|
+
<button type="button" class="apex-lightbox__prev" aria-label="Previous screenshot">‹</button>
|
|
7
|
+
<button type="button" class="apex-lightbox__next" aria-label="Next screenshot">›</button>
|
|
5
8
|
<img class="apex-lightbox__img" alt="" />
|
|
6
9
|
</dialog>`;
|
|
7
10
|
// Split from APEX_LIGHTBOX_SCRIPT so APEX_LIGHTBOX_SCRIPT_CSP_HASH hashes
|
|
@@ -13,10 +16,30 @@ const APEX_LIGHTBOX_SCRIPT_BODY = `
|
|
|
13
16
|
if (!dlg) return;
|
|
14
17
|
var img = dlg.querySelector(".apex-lightbox__img");
|
|
15
18
|
var closeBtn = dlg.querySelector(".apex-lightbox__close");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
var prevBtn = dlg.querySelector(".apex-lightbox__prev");
|
|
20
|
+
var nextBtn = dlg.querySelector(".apex-lightbox__next");
|
|
21
|
+
if (!img || !closeBtn || !prevBtn || !nextBtn) return;
|
|
22
|
+
var shots = [];
|
|
23
|
+
var current = 0;
|
|
24
|
+
function show(i) {
|
|
25
|
+
var shot = shots[i];
|
|
26
|
+
current = i;
|
|
27
|
+
img.src = shot.currentSrc || shot.src;
|
|
28
|
+
img.alt = shot.alt || "";
|
|
29
|
+
}
|
|
30
|
+
function step(delta) {
|
|
31
|
+
if (shots.length < 2) return;
|
|
32
|
+
show((current + delta + shots.length) % shots.length);
|
|
33
|
+
}
|
|
34
|
+
function open(target) {
|
|
35
|
+
shots = Array.prototype.slice.call(document.querySelectorAll(".shot-frame img"));
|
|
36
|
+
var start = shots.indexOf(target);
|
|
37
|
+
if (start < 0) {
|
|
38
|
+
shots = [target];
|
|
39
|
+
start = 0;
|
|
40
|
+
}
|
|
41
|
+
show(start);
|
|
42
|
+
prevBtn.hidden = nextBtn.hidden = shots.length < 2;
|
|
20
43
|
if (typeof dlg.showModal === "function") dlg.showModal();
|
|
21
44
|
}
|
|
22
45
|
function close() {
|
|
@@ -27,9 +50,21 @@ const APEX_LIGHTBOX_SCRIPT_BODY = `
|
|
|
27
50
|
if (!(t instanceof HTMLImageElement)) return;
|
|
28
51
|
if (!t.closest(".shot-frame")) return;
|
|
29
52
|
e.preventDefault();
|
|
30
|
-
open(t
|
|
53
|
+
open(t);
|
|
31
54
|
});
|
|
32
55
|
closeBtn.addEventListener("click", close);
|
|
56
|
+
prevBtn.addEventListener("click", function () { step(-1); });
|
|
57
|
+
nextBtn.addEventListener("click", function () { step(1); });
|
|
58
|
+
document.addEventListener("keydown", function (e) {
|
|
59
|
+
if (!dlg.open) return;
|
|
60
|
+
if (e.key === "ArrowLeft") {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
step(-1);
|
|
63
|
+
} else if (e.key === "ArrowRight") {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
step(1);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
33
68
|
dlg.addEventListener("click", function (e) {
|
|
34
69
|
if (e.target === dlg) close();
|
|
35
70
|
});
|
|
@@ -43,4 +78,4 @@ const APEX_LIGHTBOX_SCRIPT_BODY = `
|
|
|
43
78
|
export const APEX_LIGHTBOX_SCRIPT = `<script>${APEX_LIGHTBOX_SCRIPT_BODY}</script>`;
|
|
44
79
|
// CSP hash-source for the inline script above; apex output is often
|
|
45
80
|
// pre-rendered, so a per-request nonce can't work. Guarded by lightbox.test.ts.
|
|
46
|
-
export const APEX_LIGHTBOX_SCRIPT_CSP_HASH = "sha256-
|
|
81
|
+
export const APEX_LIGHTBOX_SCRIPT_CSP_HASH = "sha256-CLZlqZx0zShYKXq1Qg6+VYMTEC6tqiIlNf6JPA1nLck=";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-headless",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.340.0",
|
|
4
4
|
"description": "Headless UI logic for Kumiko — Dispatcher contract, Form-Controller, View-Model, Nav-Resolver. Plattform- und React-frei; jeder Renderer (renderer, renderer-web, renderer-native, …) komponiert darauf.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
39
|
+
"@cosmicdrift/kumiko-framework": "0.340.0",
|
|
40
40
|
"temporal-polyfill": "^0.3.2",
|
|
41
41
|
"zod": "^4.4.3"
|
|
42
42
|
},
|