@kawaijs/renderer-dom 0.1.11 → 0.1.13
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 +34 -12
- package/dist/asset-fallbacks.d.ts +13 -0
- package/dist/asset-fallbacks.d.ts.map +1 -0
- package/dist/asset-fallbacks.js +41 -0
- package/dist/asset-fallbacks.js.map +1 -0
- package/dist/components/choice-menu.d.ts +12 -0
- package/dist/components/choice-menu.d.ts.map +1 -0
- package/dist/components/choice-menu.js +43 -0
- package/dist/components/choice-menu.js.map +1 -0
- package/dist/components/dialogue-box.d.ts +29 -0
- package/dist/components/dialogue-box.d.ts.map +1 -0
- package/dist/components/dialogue-box.js +155 -0
- package/dist/components/dialogue-box.js.map +1 -0
- package/dist/components/hotspot-layer.d.ts +13 -0
- package/dist/components/hotspot-layer.d.ts.map +1 -0
- package/dist/components/hotspot-layer.js +48 -0
- package/dist/components/hotspot-layer.js.map +1 -0
- package/dist/components/main-menu.d.ts +36 -0
- package/dist/components/main-menu.d.ts.map +1 -0
- package/dist/components/main-menu.js +258 -0
- package/dist/components/main-menu.js.map +1 -0
- package/dist/components/quick-menu.d.ts +22 -0
- package/dist/components/quick-menu.d.ts.map +1 -0
- package/dist/components/quick-menu.js +59 -0
- package/dist/components/quick-menu.js.map +1 -0
- package/dist/components/stage-layer.d.ts +39 -0
- package/dist/components/stage-layer.d.ts.map +1 -0
- package/dist/components/stage-layer.js +257 -0
- package/dist/components/stage-layer.js.map +1 -0
- package/dist/components/vfx-layer.d.ts +32 -0
- package/dist/components/vfx-layer.d.ts.map +1 -0
- package/dist/components/vfx-layer.js +357 -0
- package/dist/components/vfx-layer.js.map +1 -0
- package/dist/embed.d.ts +5 -0
- package/dist/embed.d.ts.map +1 -0
- package/dist/embed.js +17 -0
- package/dist/embed.js.map +1 -0
- package/dist/icons.d.ts +31 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +31 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +31 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +69 -3
- package/dist/index.js.map +1 -1
- package/dist/layout/viewport-adapter.d.ts +52 -0
- package/dist/layout/viewport-adapter.d.ts.map +1 -0
- package/dist/layout/viewport-adapter.js +146 -0
- package/dist/layout/viewport-adapter.js.map +1 -0
- package/dist/modals/about-modal.d.ts +3 -0
- package/dist/modals/about-modal.d.ts.map +1 -0
- package/dist/modals/about-modal.js +59 -0
- package/dist/modals/about-modal.js.map +1 -0
- package/dist/modals/achievements-modal.d.ts +4 -0
- package/dist/modals/achievements-modal.d.ts.map +1 -0
- package/dist/modals/achievements-modal.js +103 -0
- package/dist/modals/achievements-modal.js.map +1 -0
- package/dist/modals/confirm-modal.d.ts +9 -0
- package/dist/modals/confirm-modal.d.ts.map +1 -0
- package/dist/modals/confirm-modal.js +80 -0
- package/dist/modals/confirm-modal.js.map +1 -0
- package/dist/modals/gallery-modal.d.ts +4 -0
- package/dist/modals/gallery-modal.d.ts.map +1 -0
- package/dist/modals/gallery-modal.js +128 -0
- package/dist/modals/gallery-modal.js.map +1 -0
- package/dist/modals/history-modal.d.ts +3 -0
- package/dist/modals/history-modal.d.ts.map +1 -0
- package/dist/modals/history-modal.js +66 -0
- package/dist/modals/history-modal.js.map +1 -0
- package/dist/modals/input-modal.d.ts +10 -0
- package/dist/modals/input-modal.d.ts.map +1 -0
- package/dist/modals/input-modal.js +62 -0
- package/dist/modals/input-modal.js.map +1 -0
- package/dist/modals/save-load-modal.d.ts +3 -0
- package/dist/modals/save-load-modal.d.ts.map +1 -0
- package/dist/modals/save-load-modal.js +262 -0
- package/dist/modals/save-load-modal.js.map +1 -0
- package/dist/modals/settings-modal.d.ts +14 -0
- package/dist/modals/settings-modal.d.ts.map +1 -0
- package/dist/modals/settings-modal.js +128 -0
- package/dist/modals/settings-modal.js.map +1 -0
- package/dist/renderer.d.ts +65 -56
- package/dist/renderer.d.ts.map +1 -1
- package/dist/renderer.js +655 -734
- package/dist/renderer.js.map +1 -1
- package/dist/share-meta.d.ts +27 -0
- package/dist/share-meta.d.ts.map +1 -0
- package/dist/share-meta.js +113 -0
- package/dist/share-meta.js.map +1 -0
- package/dist/touch.d.ts +16 -0
- package/dist/touch.d.ts.map +1 -0
- package/dist/touch.js +66 -0
- package/dist/touch.js.map +1 -0
- package/dist/types.d.ts +134 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +85 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/focus-trap.d.ts +6 -0
- package/dist/utils/focus-trap.d.ts.map +1 -0
- package/dist/utils/focus-trap.js +52 -0
- package/dist/utils/focus-trap.js.map +1 -0
- package/dist/utils/rich-text.d.ts +7 -0
- package/dist/utils/rich-text.d.ts.map +1 -0
- package/dist/utils/rich-text.js +31 -0
- package/dist/utils/rich-text.js.map +1 -0
- package/package.json +17 -3
- package/src/theme.css +2081 -685
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vfx-layer.js","sourceRoot":"","sources":["../../src/components/vfx-layer.ts"],"names":[],"mappings":"AAeA,SAAS,gBAAgB;IACvB,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,KAAK,CAAC;IAChD,MAAM,IAAI,GAAI,SAAiE,CAAC,UAAU,CAAC;IAC3F,IAAI,IAAI,EAAE,QAAQ;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QAC5C,IAAI,MAAM,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC/E,IAAI,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,OAAO,IAAI,MAAM,CAAC,UAAU,GAAG,GAAG;YAAE,OAAO,IAAI,CAAC;IAC7F,CAAC;IACD,MAAM,GAAG,GAAI,SAAmD,CAAC,YAAY,CAAC;IAC9E,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GA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AC,WAAW,GAAG,CAAC,CAAC;IACtB,CAAC;CACF"}
|
package/dist/embed.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../src/embed.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAUzD"}
|
package/dist/embed.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect iframe / minimal-player embed mode from `?embed=1` (or true/yes).
|
|
3
|
+
*/
|
|
4
|
+
export function resolveEmbedMode(search) {
|
|
5
|
+
let query = search;
|
|
6
|
+
if (query === undefined && typeof window !== 'undefined') {
|
|
7
|
+
query = window.location.search;
|
|
8
|
+
}
|
|
9
|
+
if (!query)
|
|
10
|
+
return false;
|
|
11
|
+
const value = new URLSearchParams(query).get('embed');
|
|
12
|
+
if (!value)
|
|
13
|
+
return false;
|
|
14
|
+
const normalized = value.trim().toLowerCase();
|
|
15
|
+
return normalized === '1' || normalized === 'true' || normalized === 'yes';
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=embed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.js","sourceRoot":"","sources":["../src/embed.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAe;IAC9C,IAAI,KAAK,GAAG,MAAM,CAAC;IACnB,IAAI,KAAK,KAAK,SAAS,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QACzD,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IACjC,CAAC;IACD,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtD,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAO,UAAU,KAAK,GAAG,IAAI,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,KAAK,CAAC;AAC7E,CAAC"}
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const SVG_ICONS: {
|
|
2
|
+
home: string;
|
|
3
|
+
play: string;
|
|
4
|
+
info: string;
|
|
5
|
+
power: string;
|
|
6
|
+
back: string;
|
|
7
|
+
history: string;
|
|
8
|
+
save: string;
|
|
9
|
+
load: string;
|
|
10
|
+
auto: string;
|
|
11
|
+
skip: string;
|
|
12
|
+
settings: string;
|
|
13
|
+
volumeOn: string;
|
|
14
|
+
volumeMute: string;
|
|
15
|
+
trash: string;
|
|
16
|
+
close: string;
|
|
17
|
+
arrowDown: string;
|
|
18
|
+
replay: string;
|
|
19
|
+
clock: string;
|
|
20
|
+
calendar: string;
|
|
21
|
+
bookmark: string;
|
|
22
|
+
messageSquare: string;
|
|
23
|
+
quote: string;
|
|
24
|
+
plus: string;
|
|
25
|
+
sparkles: string;
|
|
26
|
+
check: string;
|
|
27
|
+
sakura: string;
|
|
28
|
+
image: string;
|
|
29
|
+
lock: string;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BrB,CAAC"}
|
package/dist/icons.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const SVG_ICONS = {
|
|
2
|
+
home: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>',
|
|
3
|
+
play: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"/></svg>',
|
|
4
|
+
info: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>',
|
|
5
|
+
power: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18.36 6.64a9 9 0 1 1-12.73 0"/><line x1="12" y1="2" x2="12" y2="12"/></svg>',
|
|
6
|
+
back: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>',
|
|
7
|
+
history: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><polyline points="12 7 12 12 15 15"/></svg>',
|
|
8
|
+
save: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>',
|
|
9
|
+
load: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>',
|
|
10
|
+
auto: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"/></svg>',
|
|
11
|
+
skip: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 4 15 12 5 20 5 4"/><line x1="19" y1="5" x2="19" y2="19"/></svg>',
|
|
12
|
+
settings: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0 .33-1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>',
|
|
13
|
+
volumeOn: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"/></svg>',
|
|
14
|
+
volumeMute: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><line x1="23" y1="9" x2="17" y2="15"/><line x1="17" y1="9" x2="23" y2="15"/></svg>',
|
|
15
|
+
trash: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>',
|
|
16
|
+
close: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',
|
|
17
|
+
arrowDown: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',
|
|
18
|
+
replay: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/></svg>',
|
|
19
|
+
clock: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',
|
|
20
|
+
calendar: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>',
|
|
21
|
+
bookmark: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/></svg>',
|
|
22
|
+
messageSquare: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>',
|
|
23
|
+
quote: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"/><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"/></svg>',
|
|
24
|
+
plus: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>',
|
|
25
|
+
sparkles: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/></svg>',
|
|
26
|
+
check: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',
|
|
27
|
+
sakura: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a4 4 0 0 1 4 4c0 1.5-.8 2.8-2 3.5 1.2.7 2 2 2 3.5a4 4 0 0 1-4 4 4 4 0 0 1-4-4c0-1.5.8-2.8 2-3.5-1.2-.7-2-2-2-3.5a4 4 0 0 1 4-4z"/><circle cx="12" cy="11" r="1.5"/></svg>',
|
|
28
|
+
image: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',
|
|
29
|
+
lock: '<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>'
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,mSAAmS;IACzS,IAAI,EAAE,qOAAqO;IAC3O,IAAI,EAAE,8SAA8S;IACpT,KAAK,EAAE,8QAA8Q;IACrR,IAAI,EAAE,kOAAkO;IACxO,OAAO,EAAE,mQAAmQ;IAC5Q,IAAI,EAAE,qVAAqV;IAC3V,IAAI,EAAE,sRAAsR;IAC5R,IAAI,EAAE,qOAAqO;IAC3O,IAAI,EAAE,2QAA2Q;IACjR,QAAQ,EAAE,w8BAAw8B;IACl9B,QAAQ,EAAE,2TAA2T;IACrU,UAAU,EAAE,gUAAgU;IAC5U,KAAK,EAAE,wYAAwY;IAC/Y,KAAK,EAAE,yQAAyQ;IAChR,SAAS,EAAE,kOAAkO;IAC7O,MAAM,EAAE,8QAA8Q;IACtR,KAAK,EAAE,oQAAoQ;IAC3Q,QAAQ,EAAE,qWAAqW;IAC/W,QAAQ,EAAE,4PAA4P;IACtQ,aAAa,EAAE,wQAAwQ;IACvR,KAAK,EAAE,qfAAqf;IAC5f,IAAI,EAAE,2QAA2Q;IACjR,QAAQ,EAAE,gXAAgX;IAC1X,KAAK,EAAE,kOAAkO;IACzO,MAAM,EAAE,gXAAgX;IACxX,KAAK,EAAE,+TAA+T;IACtU,IAAI,EAAE,4RAA4R;CACnS,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,41 @@
|
|
|
1
1
|
export * from './renderer.js';
|
|
2
|
+
export * from './share-meta.js';
|
|
3
|
+
export * from './embed.js';
|
|
4
|
+
export * from './touch.js';
|
|
2
5
|
import type { StoryPackage } from '@kawaijs/ast';
|
|
3
6
|
import { StoryVM } from '@kawaijs/runtime';
|
|
4
7
|
import { DOMRenderer, type DOMRendererOptions } from './renderer.js';
|
|
8
|
+
export interface MountKawaAppOptions extends Omit<DOMRendererOptions, 'container'> {
|
|
9
|
+
/**
|
|
10
|
+
* Deep-link label override. When omitted, reads `?at=` or `?label=` from the URL.
|
|
11
|
+
* Internal labels (`__…`) are ignored.
|
|
12
|
+
*/
|
|
13
|
+
startLabel?: string;
|
|
14
|
+
/** Optional URL search string for deep-link / embed / continue / lang detection. */
|
|
15
|
+
search?: string;
|
|
16
|
+
/** Optional URL hash for continue-link detection. */
|
|
17
|
+
hash?: string;
|
|
18
|
+
/** Skip applying a continue-link from the URL. */
|
|
19
|
+
ignoreContinueLink?: boolean;
|
|
20
|
+
/** Force language for `{t:key}` tables. Falls back to `?lang=`. */
|
|
21
|
+
lang?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a public deep-link label from options or the current URL.
|
|
25
|
+
* Returns undefined when missing / invalid / internal.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveDeepLinkLabel(story: StoryPackage, options?: {
|
|
28
|
+
startLabel?: string;
|
|
29
|
+
search?: string;
|
|
30
|
+
}): string | undefined;
|
|
31
|
+
export declare function resolveLangCode(options?: {
|
|
32
|
+
lang?: string;
|
|
33
|
+
search?: string;
|
|
34
|
+
}): string | undefined;
|
|
5
35
|
/**
|
|
6
36
|
* High-level helper to initialize and mount a visual novel into the DOM.
|
|
7
37
|
*/
|
|
8
|
-
export declare function mountKawaApp(story: StoryPackage, container: HTMLElement, options?:
|
|
38
|
+
export declare function mountKawaApp(story: StoryPackage, container: HTMLElement, options?: MountKawaAppOptions): {
|
|
9
39
|
vm: StoryVM;
|
|
10
40
|
renderer: DOMRenderer;
|
|
11
41
|
};
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACL,OAAO,EAGR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAsB,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGzF,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC;IAChF;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,YAAY,EACnB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD,MAAM,GAAG,SAAS,CAapB;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAUhG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,mBAAmB,GAC5B;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,WAAW,CAAA;CAAE,CAoDxC"}
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,83 @@
|
|
|
1
1
|
export * from './renderer.js';
|
|
2
|
-
|
|
2
|
+
export * from './share-meta.js';
|
|
3
|
+
export * from './embed.js';
|
|
4
|
+
export * from './touch.js';
|
|
5
|
+
import { StoryVM, decodeContinueToken, resolveContinueToken } from '@kawaijs/runtime';
|
|
3
6
|
import { DOMRenderer, preloadStoryAssets } from './renderer.js';
|
|
7
|
+
import { resolveEmbedMode } from './embed.js';
|
|
8
|
+
/**
|
|
9
|
+
* Resolve a public deep-link label from options or the current URL.
|
|
10
|
+
* Returns undefined when missing / invalid / internal.
|
|
11
|
+
*/
|
|
12
|
+
export function resolveDeepLinkLabel(story, options) {
|
|
13
|
+
const fromOpt = options?.startLabel?.trim();
|
|
14
|
+
let candidate = fromOpt || undefined;
|
|
15
|
+
if (!candidate && typeof window !== 'undefined') {
|
|
16
|
+
const search = options?.search ?? window.location.search;
|
|
17
|
+
const params = new URLSearchParams(search);
|
|
18
|
+
candidate = (params.get('at') ?? params.get('label') ?? '').trim() || undefined;
|
|
19
|
+
}
|
|
20
|
+
if (!candidate || candidate.startsWith('__'))
|
|
21
|
+
return undefined;
|
|
22
|
+
if (!story.labels[candidate])
|
|
23
|
+
return undefined;
|
|
24
|
+
return candidate;
|
|
25
|
+
}
|
|
26
|
+
export function resolveLangCode(options) {
|
|
27
|
+
const fromOpt = options?.lang?.trim().toLowerCase();
|
|
28
|
+
if (fromOpt)
|
|
29
|
+
return fromOpt;
|
|
30
|
+
let search = options?.search;
|
|
31
|
+
if (search === undefined && typeof window !== 'undefined') {
|
|
32
|
+
search = window.location.search;
|
|
33
|
+
}
|
|
34
|
+
if (!search)
|
|
35
|
+
return undefined;
|
|
36
|
+
const code = new URLSearchParams(search).get('lang')?.trim().toLowerCase();
|
|
37
|
+
return code || undefined;
|
|
38
|
+
}
|
|
4
39
|
/**
|
|
5
40
|
* High-level helper to initialize and mount a visual novel into the DOM.
|
|
6
41
|
*/
|
|
7
42
|
export function mountKawaApp(story, container, options) {
|
|
8
43
|
preloadStoryAssets(story, options?.assetResolver);
|
|
44
|
+
const continueToken = options?.ignoreContinueLink
|
|
45
|
+
? undefined
|
|
46
|
+
: resolveContinueToken(options?.search, options?.hash);
|
|
47
|
+
const continueSlot = continueToken ? decodeContinueToken(continueToken) : null;
|
|
48
|
+
const deepLink = continueSlot ? undefined : resolveDeepLinkLabel(story, options);
|
|
49
|
+
const embed = options?.embed ?? resolveEmbedMode(options?.search);
|
|
50
|
+
const lang = resolveLangCode(options);
|
|
51
|
+
const { startLabel: _ignored, search: _search, hash: _hash, ignoreContinueLink: _icl, lang: _lang, ...rendererOptions } = options ?? {};
|
|
52
|
+
const skipMenu = Boolean(deepLink || embed || continueSlot);
|
|
9
53
|
const vm = new StoryVM(story);
|
|
10
54
|
const renderer = new DOMRenderer(vm, {
|
|
11
55
|
container,
|
|
12
|
-
...
|
|
56
|
+
...rendererOptions,
|
|
57
|
+
embed,
|
|
58
|
+
syncUrlLabel: rendererOptions.syncUrlLabel ?? Boolean(deepLink || embed),
|
|
59
|
+
mainMenu: skipMenu
|
|
60
|
+
? { ...rendererOptions.mainMenu, enabled: false }
|
|
61
|
+
: rendererOptions.mainMenu
|
|
13
62
|
});
|
|
14
|
-
|
|
63
|
+
if (continueSlot) {
|
|
64
|
+
const res = vm.loadFromSlot(continueSlot);
|
|
65
|
+
if (!res.success) {
|
|
66
|
+
if (!renderer.isMainMenuActive()) {
|
|
67
|
+
vm.start(deepLink);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else if (deepLink) {
|
|
72
|
+
vm.start(deepLink);
|
|
73
|
+
}
|
|
74
|
+
else if (!renderer.isMainMenuActive()) {
|
|
75
|
+
vm.start();
|
|
76
|
+
}
|
|
77
|
+
vm.hydrateAchievements();
|
|
78
|
+
if (lang) {
|
|
79
|
+
vm.setLang(lang);
|
|
80
|
+
}
|
|
15
81
|
return { vm, renderer };
|
|
16
82
|
}
|
|
17
83
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAG3B,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAA2B,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAkB9C;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAmB,EACnB,OAAkD;IAElD,MAAM,OAAO,GAAG,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAC5C,IAAI,SAAS,GAAG,OAAO,IAAI,SAAS,CAAC;IAErC,IAAI,CAAC,SAAS,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QACzD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;QAC3C,S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EAAE,EAAE,CAAC;gBACjC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC;SAAM,IAAI,QAAQ,EAAE,CAAC;QACpB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrB,CAAC;SAAM,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,EAAE,CAAC;QACxC,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;IAED,EAAE,CAAC,mBAAmB,EAAE,CAAC;IACzB,IAAI,IAAI,EAAE,CAAC;QACT,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface VirtualCanvasConfig {
|
|
2
|
+
readonly width: number;
|
|
3
|
+
readonly height: number;
|
|
4
|
+
readonly scaleMode: 'contain' | 'cover' | 'stretch';
|
|
5
|
+
}
|
|
6
|
+
export interface ViewportMetrics {
|
|
7
|
+
readonly containerWidth: number;
|
|
8
|
+
readonly containerHeight: number;
|
|
9
|
+
readonly virtualWidth: number;
|
|
10
|
+
readonly virtualHeight: number;
|
|
11
|
+
readonly stageWidth: number;
|
|
12
|
+
readonly stageHeight: number;
|
|
13
|
+
readonly scale: number;
|
|
14
|
+
readonly offsetX: number;
|
|
15
|
+
readonly offsetY: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Layout Contract Implementation:
|
|
19
|
+
* Story coordinates -> Virtual canvas (1920x1080) -> Viewport adapter -> DOM layout
|
|
20
|
+
*
|
|
21
|
+
* Ensures scene semantics, positioning, and visual composition remain completely
|
|
22
|
+
* decoupled from physical screen and browser dimensions.
|
|
23
|
+
*/
|
|
24
|
+
export declare class ViewportAdapter {
|
|
25
|
+
private readonly container;
|
|
26
|
+
private readonly stageEl;
|
|
27
|
+
private readonly config;
|
|
28
|
+
private resizeObserver?;
|
|
29
|
+
private windowResizeListener?;
|
|
30
|
+
private currentMetrics;
|
|
31
|
+
constructor(container: HTMLElement, stageEl: HTMLElement, config?: Partial<VirtualCanvasConfig>);
|
|
32
|
+
computeMetrics(): ViewportMetrics;
|
|
33
|
+
applyMetrics(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Translates story coordinates (normalized 0..1) to virtual canvas coordinates.
|
|
36
|
+
*/
|
|
37
|
+
storyToVirtual(normX: number, normY: number): {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Translates story coordinates directly to stage pixels.
|
|
43
|
+
*/
|
|
44
|
+
storyToStagePixels(normX: number, normY: number): {
|
|
45
|
+
px: number;
|
|
46
|
+
py: number;
|
|
47
|
+
};
|
|
48
|
+
getMetrics(): ViewportMetrics;
|
|
49
|
+
private initObserver;
|
|
50
|
+
destroy(): void;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=viewport-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-adapter.d.ts","sourceRoot":"","sources":["../../src/layout/viewport-adapter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;CACrD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,oBAAoB,CAAC,CAAa;IAC1C,OAAO,CAAC,cAAc,CAAkB;gBAE5B,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC;IAcxF,cAAc,IAAI,eAAe;IA6DjC,YAAY,IAAI,IAAI;IAc3B;;OAEG;IACI,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAO7E;;OAEG;IACI,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE;IAQ5E,UAAU,IAAI,eAAe;IAIpC,OAAO,CAAC,YAAY;IAqBb,OAAO,IAAI,IAAI;CAQvB"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout Contract Implementation:
|
|
3
|
+
* Story coordinates -> Virtual canvas (1920x1080) -> Viewport adapter -> DOM layout
|
|
4
|
+
*
|
|
5
|
+
* Ensures scene semantics, positioning, and visual composition remain completely
|
|
6
|
+
* decoupled from physical screen and browser dimensions.
|
|
7
|
+
*/
|
|
8
|
+
export class ViewportAdapter {
|
|
9
|
+
container;
|
|
10
|
+
stageEl;
|
|
11
|
+
config;
|
|
12
|
+
resizeObserver;
|
|
13
|
+
windowResizeListener;
|
|
14
|
+
currentMetrics;
|
|
15
|
+
constructor(container, stageEl, config) {
|
|
16
|
+
this.container = container;
|
|
17
|
+
this.stageEl = stageEl;
|
|
18
|
+
this.config = {
|
|
19
|
+
width: config?.width ?? 1920,
|
|
20
|
+
height: config?.height ?? 1080,
|
|
21
|
+
scaleMode: config?.scaleMode ?? 'contain'
|
|
22
|
+
};
|
|
23
|
+
this.currentMetrics = this.computeMetrics();
|
|
24
|
+
this.applyMetrics();
|
|
25
|
+
this.initObserver();
|
|
26
|
+
}
|
|
27
|
+
computeMetrics() {
|
|
28
|
+
const containerRect = this.container.getBoundingClientRect();
|
|
29
|
+
const containerWidth = Math.max(containerRect.width, 320);
|
|
30
|
+
const containerHeight = Math.max(containerRect.height, 180);
|
|
31
|
+
const { width: virtualWidth, height: virtualHeight, scaleMode } = this.config;
|
|
32
|
+
let scale = 1;
|
|
33
|
+
let stageWidth = virtualWidth;
|
|
34
|
+
let stageHeight = virtualHeight;
|
|
35
|
+
// Portrait phones: letterboxed 16:9 shrinks the whole UI (menu included) to ~220px.
|
|
36
|
+
// Fill the viewport so Start / dialogue remain tappable.
|
|
37
|
+
const isPortrait = containerHeight > containerWidth * 1.05;
|
|
38
|
+
const preferFill = isPortrait &&
|
|
39
|
+
typeof window !== 'undefined' &&
|
|
40
|
+
typeof window.matchMedia === 'function' &&
|
|
41
|
+
(window.matchMedia('(max-width: 900px)').matches ||
|
|
42
|
+
window.matchMedia('(pointer: coarse)').matches);
|
|
43
|
+
if (preferFill && scaleMode !== 'stretch') {
|
|
44
|
+
stageWidth = Math.round(containerWidth);
|
|
45
|
+
stageHeight = Math.round(containerHeight);
|
|
46
|
+
// Fit virtual width; extra vertical space is usable UI chrome.
|
|
47
|
+
scale = stageWidth / virtualWidth;
|
|
48
|
+
}
|
|
49
|
+
else if (scaleMode === 'contain') {
|
|
50
|
+
const scaleX = containerWidth / virtualWidth;
|
|
51
|
+
const scaleY = containerHeight / virtualHeight;
|
|
52
|
+
scale = Math.min(scaleX, scaleY);
|
|
53
|
+
stageWidth = Math.round(virtualWidth * scale);
|
|
54
|
+
stageHeight = Math.round(virtualHeight * scale);
|
|
55
|
+
}
|
|
56
|
+
else if (scaleMode === 'cover') {
|
|
57
|
+
const scaleX = containerWidth / virtualWidth;
|
|
58
|
+
const scaleY = containerHeight / virtualHeight;
|
|
59
|
+
scale = Math.max(scaleX, scaleY);
|
|
60
|
+
stageWidth = Math.round(virtualWidth * scale);
|
|
61
|
+
stageHeight = Math.round(virtualHeight * scale);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
// stretch
|
|
65
|
+
stageWidth = containerWidth;
|
|
66
|
+
stageHeight = containerHeight;
|
|
67
|
+
scale = containerWidth / virtualWidth;
|
|
68
|
+
}
|
|
69
|
+
const offsetX = Math.max(0, Math.round((containerWidth - stageWidth) / 2));
|
|
70
|
+
const offsetY = Math.max(0, Math.round((containerHeight - stageHeight) / 2));
|
|
71
|
+
return {
|
|
72
|
+
containerWidth,
|
|
73
|
+
containerHeight,
|
|
74
|
+
virtualWidth,
|
|
75
|
+
virtualHeight,
|
|
76
|
+
stageWidth,
|
|
77
|
+
stageHeight,
|
|
78
|
+
scale,
|
|
79
|
+
offsetX,
|
|
80
|
+
offsetY
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
applyMetrics() {
|
|
84
|
+
const m = this.computeMetrics();
|
|
85
|
+
this.currentMetrics = m;
|
|
86
|
+
this.stageEl.style.setProperty('--kawa-virtual-width', `${m.virtualWidth}px`);
|
|
87
|
+
this.stageEl.style.setProperty('--kawa-virtual-height', `${m.virtualHeight}px`);
|
|
88
|
+
this.stageEl.style.setProperty('--kawa-stage-width', `${m.stageWidth}px`);
|
|
89
|
+
this.stageEl.style.setProperty('--kawa-stage-height', `${m.stageHeight}px`);
|
|
90
|
+
this.stageEl.style.setProperty('--kawa-stage-scale', `${m.scale}`);
|
|
91
|
+
this.stageEl.style.width = `${m.stageWidth}px`;
|
|
92
|
+
this.stageEl.style.height = `${m.stageHeight}px`;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Translates story coordinates (normalized 0..1) to virtual canvas coordinates.
|
|
96
|
+
*/
|
|
97
|
+
storyToVirtual(normX, normY) {
|
|
98
|
+
return {
|
|
99
|
+
x: normX * this.config.width,
|
|
100
|
+
y: normY * this.config.height
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Translates story coordinates directly to stage pixels.
|
|
105
|
+
*/
|
|
106
|
+
storyToStagePixels(normX, normY) {
|
|
107
|
+
const virt = this.storyToVirtual(normX, normY);
|
|
108
|
+
return {
|
|
109
|
+
px: Math.round(virt.x * this.currentMetrics.scale),
|
|
110
|
+
py: Math.round(virt.y * this.currentMetrics.scale)
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
getMetrics() {
|
|
114
|
+
return this.currentMetrics;
|
|
115
|
+
}
|
|
116
|
+
initObserver() {
|
|
117
|
+
let raf = 0;
|
|
118
|
+
const schedule = () => {
|
|
119
|
+
if (raf)
|
|
120
|
+
return;
|
|
121
|
+
raf = requestAnimationFrame(() => {
|
|
122
|
+
raf = 0;
|
|
123
|
+
this.applyMetrics();
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
127
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
128
|
+
schedule();
|
|
129
|
+
});
|
|
130
|
+
this.resizeObserver.observe(this.container);
|
|
131
|
+
}
|
|
132
|
+
else if (typeof window !== 'undefined') {
|
|
133
|
+
this.windowResizeListener = () => schedule();
|
|
134
|
+
window.addEventListener('resize', this.windowResizeListener, { passive: true });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
destroy() {
|
|
138
|
+
if (this.resizeObserver) {
|
|
139
|
+
this.resizeObserver.disconnect();
|
|
140
|
+
}
|
|
141
|
+
if (this.windowResizeListener && typeof window !== 'undefined') {
|
|
142
|
+
window.removeEventListener('resize', this.windowResizeListener);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=viewport-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-adapter.js","sourceRoot":"","sources":["../../src/layout/viewport-adapter.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,MAAM,OAAO,eAAe;IACT,SAAS,CAAc;IACvB,OAAO,CAAc;IACrB,MAAM,CAAsB;IACrC,cAAc,CAAkB;IAChC,oBAAoB,CAAc;IAClC,cAAc,CAAkB;IAExC,YAAY,SAAsB,EAAE,OAAoB,EAAE,MAAqC;QAC7F,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG;YACZ,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,IAAI;YAC5B,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI;YAC9B,SAAS,EAAE,MAAM,EAAE,SAAS,IAAI,SAAS;SAC1C,CAAC;QAEF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5C,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAEM,cAAc;QACnB,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,CAAC;QAC7D,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC1D,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE5D,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAA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
|
2
|
+
import { escapeHtml } from '../utils/rich-text.js';
|
|
3
|
+
import { trapFocus } from '../utils/focus-trap.js';
|
|
4
|
+
export function showAboutModal(rootEl, options) {
|
|
5
|
+
const existing = rootEl.querySelector('.kawa-modal-overlay:not(.kawa-confirm-overlay)');
|
|
6
|
+
if (existing)
|
|
7
|
+
existing.remove();
|
|
8
|
+
const overlay = document.createElement('div');
|
|
9
|
+
overlay.className = 'kawa-modal-overlay';
|
|
10
|
+
const card = document.createElement('div');
|
|
11
|
+
card.className = 'kawa-modal-card kawa-about-card';
|
|
12
|
+
card.setAttribute('role', 'dialog');
|
|
13
|
+
card.setAttribute('aria-modal', 'true');
|
|
14
|
+
card.setAttribute('aria-label', 'About Visual Novel');
|
|
15
|
+
const header = document.createElement('div');
|
|
16
|
+
header.className = 'kawa-modal-header';
|
|
17
|
+
const title = document.createElement('div');
|
|
18
|
+
title.className = 'kawa-modal-title';
|
|
19
|
+
title.innerHTML = `${SVG_ICONS.info} <span>About</span>`;
|
|
20
|
+
const releaseFocus = trapFocus(card);
|
|
21
|
+
const close = () => {
|
|
22
|
+
releaseFocus();
|
|
23
|
+
overlay.remove();
|
|
24
|
+
};
|
|
25
|
+
const closeBtn = document.createElement('button');
|
|
26
|
+
closeBtn.type = 'button';
|
|
27
|
+
closeBtn.className = 'kawa-btn';
|
|
28
|
+
closeBtn.innerHTML = `${SVG_ICONS.close} <span>Close</span>`;
|
|
29
|
+
closeBtn.setAttribute('aria-label', 'Close about modal');
|
|
30
|
+
closeBtn.addEventListener('click', (e) => {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
close();
|
|
33
|
+
});
|
|
34
|
+
header.appendChild(title);
|
|
35
|
+
header.appendChild(closeBtn);
|
|
36
|
+
const body = document.createElement('div');
|
|
37
|
+
body.className = 'kawa-modal-body kawa-about-body';
|
|
38
|
+
const gameTitle = escapeHtml(options?.title || 'Kawaijs Visual Novel');
|
|
39
|
+
const gameSub = escapeHtml(options?.subtitle || 'A modern web-native visual novel');
|
|
40
|
+
// customFooter is intentionally HTML for developer-authored footers; escape by default
|
|
41
|
+
// unless it looks like intentional markup from the engine default.
|
|
42
|
+
const rawFooter = options?.customFooter;
|
|
43
|
+
const customFooter = rawFooter ? escapeHtml(rawFooter) : 'Powered by Kawaijs Engine';
|
|
44
|
+
body.innerHTML = `
|
|
45
|
+
<div class="kawa-about-content">
|
|
46
|
+
<div class="kawa-about-logo-badge">${SVG_ICONS.sakura}</div>
|
|
47
|
+
<h2 class="kawa-about-game-title">${gameTitle}</h2>
|
|
48
|
+
<p class="kawa-about-game-sub">${gameSub}</p>
|
|
49
|
+
<div class="kawa-about-divider"></div>
|
|
50
|
+
<p class="kawa-about-info">Built with <strong>Kawaijs</strong> — a web-native visual novel engine and toolchain inspired by Ren'Py.</p>
|
|
51
|
+
<div class="kawa-about-footer-text">${customFooter}</div>
|
|
52
|
+
</div>
|
|
53
|
+
`;
|
|
54
|
+
card.appendChild(header);
|
|
55
|
+
card.appendChild(body);
|
|
56
|
+
overlay.appendChild(card);
|
|
57
|
+
rootEl.appendChild(overlay);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=about-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"about-modal.js","sourceRoot":"","sources":["../../src/modals/about-modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,cAAc,CAAC,MAAmB,EAAE,OAAyB;IAC3E,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC,gDAAgD,CAAC,CAAC;IACxF,IAAI,QAAQ;QAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,OA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,CAAC,CAAC;IAEH,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC1B,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE7B,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,GAAG,iCAAiC,CAAC;IAEnD,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,EAAE,KAAK,IAAI,sBAAsB,CAAC,CAAC;IACvE,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,QAAQ,IAAI,kCAAkC,CAAC,CAAC;IACpF,uFAAuF;IACvF,mEAAmE;IACnE,MAAM,SAAS,GAAG,OAAO,EAAE,YAAY,CAAC;IACxC,MAAM,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC;IAErF,IAAI,CAAC,SAAS,GAAG;;2CAEwB,SAAS,CAAC,MAAM;0CACjB,SAAS;uCACZ,OAAO;;;4CAGF,YAAY;;GAErD,CAAC;IAEF,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StoryVM } from '@kawaijs/runtime';
|
|
2
|
+
import type { AchievementDefinition } from '@kawaijs/ast';
|
|
3
|
+
export declare function showAchievementsModal(rootEl: HTMLElement, vm: StoryVM, catalog?: readonly AchievementDefinition[]): void;
|
|
4
|
+
//# sourceMappingURL=achievements-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"achievements-modal.d.ts","sourceRoot":"","sources":["../../src/modals/achievements-modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAoB,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAK1D,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,WAAW,EACnB,EAAE,EAAE,OAAO,EACX,OAAO,GAAE,SAAS,qBAAqB,EAAO,GAC7C,IAAI,CA6GN"}
|