@novely/solid-renderer 0.7.0 → 0.9.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/actions.d.ts +2 -0
- package/dist/components/ControlPanelButtons.d.ts +9 -0
- package/dist/components/Icon.d.ts +2 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/context/index.d.ts +4 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useMedia.d.ts +2 -0
- package/dist/index.jsx +297 -162
- package/dist/renderer.d.ts +3 -3
- package/dist/screens/index.d.ts +6 -0
- package/dist/styles/index.css +84 -14
- package/dist/utils.d.ts +3 -1
- package/package.json +2 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VoidComponent, type Accessor, type Setter } from 'solid-js';
|
|
2
|
+
interface ControlPanelButtonsProps {
|
|
3
|
+
openSettings: () => void;
|
|
4
|
+
closeDropdown: () => void;
|
|
5
|
+
auto: Accessor<boolean>;
|
|
6
|
+
setAuto: Setter<boolean>;
|
|
7
|
+
}
|
|
8
|
+
declare const ControlPanelButtons: VoidComponent<ControlPanelButtonsProps>;
|
|
9
|
+
export { ControlPanelButtons };
|
package/dist/context/index.d.ts
CHANGED
|
@@ -5,7 +5,10 @@ interface DataContext {
|
|
|
5
5
|
storeDataUpdate: (fn: (prev: StorageData) => StorageData) => void;
|
|
6
6
|
options: RendererInit;
|
|
7
7
|
renderer: Renderer;
|
|
8
|
-
t: (key: BaseTranslationStrings | (string &
|
|
8
|
+
t: (key: BaseTranslationStrings | (string & Record<never, never>)) => string;
|
|
9
|
+
media: {
|
|
10
|
+
hyperWide: Accessor<boolean>;
|
|
11
|
+
};
|
|
9
12
|
}
|
|
10
13
|
interface ProviderProps {
|
|
11
14
|
storeData: Stored<StorageData>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useMedia } from './useMedia';
|
package/dist/index.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/renderer.tsx
|
|
2
|
-
import { Switch, Match, createEffect as
|
|
2
|
+
import { Switch, Match, createEffect as createEffect5 } from "solid-js";
|
|
3
3
|
import { createStore } from "solid-js/store";
|
|
4
4
|
|
|
5
5
|
// src/utils.ts
|
|
@@ -48,9 +48,40 @@ var onKey = (cb, ...keys) => {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
+
var toMedia = (media) => {
|
|
52
|
+
if (media === "portrait" || media === "landscape") {
|
|
53
|
+
return `(orientation: ${media})`;
|
|
54
|
+
}
|
|
55
|
+
return media;
|
|
56
|
+
};
|
|
57
|
+
var findLast = (array, fn) => {
|
|
58
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
59
|
+
if (fn(array[i])) {
|
|
60
|
+
return array[i];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return;
|
|
64
|
+
};
|
|
51
65
|
|
|
52
66
|
// src/context/index.tsx
|
|
53
67
|
import { from, createContext, useContext, Show } from "solid-js";
|
|
68
|
+
|
|
69
|
+
// src/hooks/useMedia.ts
|
|
70
|
+
import { createSignal, onCleanup } from "solid-js";
|
|
71
|
+
var useMedia = (media) => {
|
|
72
|
+
const mq = matchMedia(media);
|
|
73
|
+
const [matches, setMatches] = createSignal(mq.matches);
|
|
74
|
+
const handleChange = (e) => {
|
|
75
|
+
setMatches(e.matches);
|
|
76
|
+
};
|
|
77
|
+
typeof mq.addEventListener === "function" ? mq.addEventListener("change", handleChange) : mq.addListener(handleChange);
|
|
78
|
+
onCleanup(() => {
|
|
79
|
+
typeof mq.removeEventListener === "function" ? mq.removeEventListener("change", handleChange) : mq.removeListener(handleChange);
|
|
80
|
+
});
|
|
81
|
+
return matches;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// src/context/index.tsx
|
|
54
85
|
var Context = createContext();
|
|
55
86
|
var Provider = (props) => {
|
|
56
87
|
const storeData = from(props.storeData);
|
|
@@ -61,6 +92,9 @@ var Provider = (props) => {
|
|
|
61
92
|
renderer: props.renderer,
|
|
62
93
|
t(key) {
|
|
63
94
|
return props.options.t(key, this.storeData().meta[0]);
|
|
95
|
+
},
|
|
96
|
+
media: {
|
|
97
|
+
hyperWide: useMedia("(max-aspect-ratio: 0.26)")
|
|
64
98
|
}
|
|
65
99
|
};
|
|
66
100
|
return <Context.Provider value={value}><Show when={storeData()}>{props.children}</Show></Context.Provider>;
|
|
@@ -69,8 +103,114 @@ var useData = () => {
|
|
|
69
103
|
return useContext(Context);
|
|
70
104
|
};
|
|
71
105
|
|
|
106
|
+
// src/screens/custom-screen.tsx
|
|
107
|
+
import { createEffect, createSignal as createSignal2, Show as Show2 } from "solid-js";
|
|
108
|
+
var CustomScreen = (props) => {
|
|
109
|
+
const [dom, setDOM] = createSignal2(null);
|
|
110
|
+
let unmount;
|
|
111
|
+
createEffect(() => {
|
|
112
|
+
if (unmount)
|
|
113
|
+
unmount();
|
|
114
|
+
if (props.state.screen in props.state.screens) {
|
|
115
|
+
const current = props.state.screens[props.state.screen]();
|
|
116
|
+
setDOM(current.mount());
|
|
117
|
+
unmount = current.unmount;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
setDOM(null);
|
|
121
|
+
unmount = void 0;
|
|
122
|
+
});
|
|
123
|
+
const onClick = ({ target }) => {
|
|
124
|
+
if (target instanceof HTMLElement && target.dataset.novelyGoto) {
|
|
125
|
+
props.setState("screen", target.dataset.novelyGoto);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
return <Show2 when={dom()}><div class="root custom" onClick={onClick}>{dom()}</div></Show2>;
|
|
129
|
+
};
|
|
130
|
+
|
|
72
131
|
// src/screens/game.tsx
|
|
73
|
-
import { createSignal as
|
|
132
|
+
import { createSignal as createSignal4, untrack as untrack3, For, Show as Show5, createUniqueId, createEffect as createEffect4 } from "solid-js";
|
|
133
|
+
|
|
134
|
+
// src/components/Character.tsx
|
|
135
|
+
import { setAttribute, effect } from "solid-js/web";
|
|
136
|
+
var Character = (props) => {
|
|
137
|
+
const canvas = () => props.characters[props.character].canvas;
|
|
138
|
+
effect(() => setAttribute(canvas(), "style", props.data.style));
|
|
139
|
+
return <>{canvas()}</>;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// src/components/ControlPanelButtons.tsx
|
|
143
|
+
import { Show as Show3 } from "solid-js";
|
|
144
|
+
var ControlPanelButtons = (props) => {
|
|
145
|
+
const data = useData();
|
|
146
|
+
return <>
|
|
147
|
+
<button
|
|
148
|
+
role="menuitem"
|
|
149
|
+
type="button"
|
|
150
|
+
class="button control-panel__button"
|
|
151
|
+
title={data.t("GoBack")}
|
|
152
|
+
onClick={data.options.back}
|
|
153
|
+
>
|
|
154
|
+
<span class="control-panel__button__content">{data.t("GoBack")}</span>
|
|
155
|
+
<Icon class="control-panel__button__icon" children={Icon.Back()} />
|
|
156
|
+
</button>
|
|
157
|
+
<button
|
|
158
|
+
role="menuitem"
|
|
159
|
+
type="button"
|
|
160
|
+
class="button control-panel__button"
|
|
161
|
+
title={data.t("DoSave")}
|
|
162
|
+
onClick={() => {
|
|
163
|
+
data.options.save(false, "manual");
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
<span class="control-panel__button__content">{data.t("DoSave")}</span>
|
|
167
|
+
<Icon class="control-panel__button__icon" children={Icon.Save()} />
|
|
168
|
+
</button>
|
|
169
|
+
<button
|
|
170
|
+
role="menuitem"
|
|
171
|
+
type="button"
|
|
172
|
+
class="button control-panel__button control-panel__button--auto-mode"
|
|
173
|
+
title={data.t(props.auto() ? "Stop" : "Auto")}
|
|
174
|
+
onClick={() => {
|
|
175
|
+
props.setAuto((prev) => !prev);
|
|
176
|
+
}}
|
|
177
|
+
>{data.t(props.auto() ? "Stop" : "Auto")}</button>
|
|
178
|
+
<button
|
|
179
|
+
role="menuitem"
|
|
180
|
+
type="button"
|
|
181
|
+
class="button control-panel__button"
|
|
182
|
+
title={data.t("Settings")}
|
|
183
|
+
onClick={() => {
|
|
184
|
+
data.options.save(false, "auto");
|
|
185
|
+
props.openSettings();
|
|
186
|
+
}}
|
|
187
|
+
>
|
|
188
|
+
<span class="control-panel__button__content">{data.t("Settings")}</span>
|
|
189
|
+
<Icon class="control-panel__button__icon" children={Icon.Settings()} />
|
|
190
|
+
</button>
|
|
191
|
+
<button
|
|
192
|
+
role="menuitem"
|
|
193
|
+
type="button"
|
|
194
|
+
class="button control-panel__button"
|
|
195
|
+
title={data.t("Exit")}
|
|
196
|
+
onClick={() => {
|
|
197
|
+
data.options.exit();
|
|
198
|
+
}}
|
|
199
|
+
>
|
|
200
|
+
<span class="control-panel__button__content">{data.t("Exit")}</span>
|
|
201
|
+
<Icon class="control-panel__button__icon" children={Icon.Exit()} />
|
|
202
|
+
</button>
|
|
203
|
+
<Show3 when={data.media.hyperWide()}><button
|
|
204
|
+
role="menuitem"
|
|
205
|
+
type="button"
|
|
206
|
+
class="button control-panel__button"
|
|
207
|
+
title={data.t("CloseMenu")}
|
|
208
|
+
onClick={() => {
|
|
209
|
+
props.closeDropdown();
|
|
210
|
+
}}
|
|
211
|
+
><Icon children={Icon.Close()} /></button></Show3>
|
|
212
|
+
</>;
|
|
213
|
+
};
|
|
74
214
|
|
|
75
215
|
// src/components/DialogName.tsx
|
|
76
216
|
var DialogName = (props) => {
|
|
@@ -89,21 +229,57 @@ var DialogName = (props) => {
|
|
|
89
229
|
>{props.name || <> </>}</span>;
|
|
90
230
|
};
|
|
91
231
|
|
|
92
|
-
// src/components/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
232
|
+
// src/components/Icon.tsx
|
|
233
|
+
var Icon = (props) => {
|
|
234
|
+
return <svg
|
|
235
|
+
width="24"
|
|
236
|
+
height="24"
|
|
237
|
+
viewBox="0 0 24 24"
|
|
238
|
+
fill="none"
|
|
239
|
+
stroke="currentColor"
|
|
240
|
+
stroke-linecap="round"
|
|
241
|
+
stroke-linejoin="round"
|
|
242
|
+
stroke-width="1.5"
|
|
243
|
+
{...props}
|
|
244
|
+
>{props.children}</svg>;
|
|
245
|
+
};
|
|
246
|
+
Icon.Back = () => {
|
|
247
|
+
return <path d="m9.75 12 8.5-6.25v12.5L9.75 12ZM5.75 5.75v12.5" />;
|
|
248
|
+
};
|
|
249
|
+
Icon.Save = () => {
|
|
250
|
+
return <>
|
|
251
|
+
<path d="M6.75 19.25h10.5a2 2 0 0 0 2-2V9.828a2 2 0 0 0-.586-1.414l-3.078-3.078a2 2 0 0 0-1.414-.586H6.75a2 2 0 0 0-2 2v10.5a2 2 0 0 0 2 2Z" />
|
|
252
|
+
<path d="M8.75 19v-3.25a1 1 0 0 1 1-1h4.5a1 1 0 0 1 1 1V19M8.75 5v3.25" />
|
|
253
|
+
</>;
|
|
254
|
+
};
|
|
255
|
+
Icon.Settings = () => {
|
|
256
|
+
return <>
|
|
257
|
+
<path d="M13.12 5.613a1 1 0 0 0-.991-.863h-.258a1 1 0 0 0-.99.863l-.087.632c-.056.403-.354.724-.732.874a5.225 5.225 0 0 0-.167.07c-.373.163-.81.15-1.136-.095l-.308-.23a1 1 0 0 0-1.307.092l-.188.188a1 1 0 0 0-.092 1.307l.23.308c.244.325.258.763.095 1.136a5.225 5.225 0 0 0-.07.167c-.15.378-.47.676-.874.732l-.632.087a1 1 0 0 0-.863.99v.258a1 1 0 0 0 .863.99l.632.087c.403.056.724.354.874.732l.07.167c.163.373.15.81-.095 1.136l-.23.308a1 1 0 0 0 .092 1.307l.188.188a1 1 0 0 0 1.307.093l.308-.231c.325-.244.763-.258 1.136-.095a5.4 5.4 0 0 0 .167.07c.378.15.676.47.732.874l.087.632a1 1 0 0 0 .99.863h.258a1 1 0 0 0 .99-.863l.087-.632c.056-.403.354-.724.732-.874a5.12 5.12 0 0 0 .167-.07c.373-.163.81-.15 1.136.095l.308.23a1 1 0 0 0 1.307-.092l.188-.188a1 1 0 0 0 .093-1.307l-.231-.308c-.244-.325-.258-.763-.095-1.136l.07-.167c.15-.378.47-.676.874-.732l.632-.087a1 1 0 0 0 .863-.99v-.258a1 1 0 0 0-.863-.99l-.632-.087c-.403-.056-.724-.354-.874-.732a5.168 5.168 0 0 0-.07-.167c-.163-.373-.15-.81.095-1.136l.23-.308a1 1 0 0 0-.092-1.307l-.188-.188a1 1 0 0 0-1.307-.092l-.308.23c-.325.244-.763.258-1.136.095a5.185 5.185 0 0 0-.167-.07c-.378-.15-.676-.47-.732-.874l-.087-.632Z" />
|
|
258
|
+
<path d="M13.25 12a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Z" />
|
|
259
|
+
</>;
|
|
260
|
+
};
|
|
261
|
+
Icon.Exit = () => {
|
|
262
|
+
return <path d="m15.75 8.75 3.5 3.25-3.5 3.25M19 12h-8.25M15.25 4.75h-8.5a2 2 0 0 0-2 2v10.5a2 2 0 0 0 2 2h8.5" />;
|
|
263
|
+
};
|
|
264
|
+
Icon.Menu = () => {
|
|
265
|
+
return <path d="M4.75 5.75h14.5M4.75 18.25h14.5M4.75 12h14.5" />;
|
|
266
|
+
};
|
|
267
|
+
Icon.Close = () => {
|
|
268
|
+
return <path d="m17.25 6.75-10.5 10.5M6.75 6.75l10.5 10.5" />;
|
|
98
269
|
};
|
|
99
270
|
|
|
100
271
|
// src/components/Modal.tsx
|
|
101
|
-
import { untrack, createEffect, on, onCleanup, Show as
|
|
272
|
+
import { untrack, createEffect as createEffect2, on, onCleanup as onCleanup3, Show as Show4 } from "solid-js";
|
|
273
|
+
|
|
274
|
+
// src/actions.ts
|
|
275
|
+
import { onCleanup as onCleanup2 } from "solid-js";
|
|
102
276
|
var clickOutside = (node, handler) => {
|
|
103
277
|
const handleClick = (event) => node && !node.contains(event.target) && !event.defaultPrevented && handler && handler();
|
|
104
278
|
document.addEventListener("click", handleClick, true);
|
|
105
|
-
|
|
279
|
+
onCleanup2(() => document.removeEventListener("click", handleClick, true));
|
|
106
280
|
};
|
|
281
|
+
|
|
282
|
+
// src/components/Modal.tsx
|
|
107
283
|
var Modal = (props) => {
|
|
108
284
|
let modalWindow;
|
|
109
285
|
const handleKeydown = (event) => {
|
|
@@ -129,10 +305,10 @@ var Modal = (props) => {
|
|
|
129
305
|
props.setIsOpen && props.setIsOpen(false);
|
|
130
306
|
props.onClose && untrack(props.onClose);
|
|
131
307
|
};
|
|
132
|
-
|
|
308
|
+
createEffect2(on(props.isOpen, (isOpen) => isOpen && props.onClose && untrack(props.onClose), { defer: true }));
|
|
133
309
|
addEventListener("keydown", handleKeydown);
|
|
134
|
-
|
|
135
|
-
return <
|
|
310
|
+
onCleanup3(() => removeEventListener("keydown", handleKeydown));
|
|
311
|
+
return <Show4 when={props.isOpen()}><div
|
|
136
312
|
role="dialog"
|
|
137
313
|
class="dialog"
|
|
138
314
|
aria-modal={true}
|
|
@@ -140,44 +316,11 @@ var Modal = (props) => {
|
|
|
140
316
|
modalWindow = element;
|
|
141
317
|
clickOutside(element, close);
|
|
142
318
|
}}
|
|
143
|
-
>{props.children}</div></
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
// src/components/Icon.tsx
|
|
147
|
-
var Icon = (props) => {
|
|
148
|
-
return <svg
|
|
149
|
-
width="24"
|
|
150
|
-
height="24"
|
|
151
|
-
viewBox="0 0 24 24"
|
|
152
|
-
fill="none"
|
|
153
|
-
stroke="currentColor"
|
|
154
|
-
stroke-linecap="round"
|
|
155
|
-
stroke-linejoin="round"
|
|
156
|
-
stroke-width="1.5"
|
|
157
|
-
{...props}
|
|
158
|
-
>{props.children}</svg>;
|
|
159
|
-
};
|
|
160
|
-
Icon.Back = () => {
|
|
161
|
-
return <path d="m9.75 12 8.5-6.25v12.5L9.75 12ZM5.75 5.75v12.5" />;
|
|
162
|
-
};
|
|
163
|
-
Icon.Save = () => {
|
|
164
|
-
return <>
|
|
165
|
-
<path d="M6.75 19.25h10.5a2 2 0 0 0 2-2V9.828a2 2 0 0 0-.586-1.414l-3.078-3.078a2 2 0 0 0-1.414-.586H6.75a2 2 0 0 0-2 2v10.5a2 2 0 0 0 2 2Z" />
|
|
166
|
-
<path d="M8.75 19v-3.25a1 1 0 0 1 1-1h4.5a1 1 0 0 1 1 1V19M8.75 5v3.25" />
|
|
167
|
-
</>;
|
|
168
|
-
};
|
|
169
|
-
Icon.Settings = () => {
|
|
170
|
-
return <>
|
|
171
|
-
<path d="M13.12 5.613a1 1 0 0 0-.991-.863h-.258a1 1 0 0 0-.99.863l-.087.632c-.056.403-.354.724-.732.874a5.225 5.225 0 0 0-.167.07c-.373.163-.81.15-1.136-.095l-.308-.23a1 1 0 0 0-1.307.092l-.188.188a1 1 0 0 0-.092 1.307l.23.308c.244.325.258.763.095 1.136a5.225 5.225 0 0 0-.07.167c-.15.378-.47.676-.874.732l-.632.087a1 1 0 0 0-.863.99v.258a1 1 0 0 0 .863.99l.632.087c.403.056.724.354.874.732l.07.167c.163.373.15.81-.095 1.136l-.23.308a1 1 0 0 0 .092 1.307l.188.188a1 1 0 0 0 1.307.093l.308-.231c.325-.244.763-.258 1.136-.095a5.4 5.4 0 0 0 .167.07c.378.15.676.47.732.874l.087.632a1 1 0 0 0 .99.863h.258a1 1 0 0 0 .99-.863l.087-.632c.056-.403.354-.724.732-.874a5.12 5.12 0 0 0 .167-.07c.373-.163.81-.15 1.136.095l.308.23a1 1 0 0 0 1.307-.092l.188-.188a1 1 0 0 0 .093-1.307l-.231-.308c-.244-.325-.258-.763-.095-1.136l.07-.167c.15-.378.47-.676.874-.732l.632-.087a1 1 0 0 0 .863-.99v-.258a1 1 0 0 0-.863-.99l-.632-.087c-.403-.056-.724-.354-.874-.732a5.168 5.168 0 0 0-.07-.167c-.163-.373-.15-.81.095-1.136l.23-.308a1 1 0 0 0-.092-1.307l-.188-.188a1 1 0 0 0-1.307-.092l-.308.23c-.325.244-.763.258-1.136.095a5.185 5.185 0 0 0-.167-.07c-.378-.15-.676-.47-.732-.874l-.087-.632Z" />
|
|
172
|
-
<path d="M13.25 12a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Z" />
|
|
173
|
-
</>;
|
|
174
|
-
};
|
|
175
|
-
Icon.Exit = () => {
|
|
176
|
-
return <path d="m15.75 8.75 3.5 3.25-3.5 3.25M19 12h-8.25M15.25 4.75h-8.5a2 2 0 0 0-2 2v10.5a2 2 0 0 0 2 2h8.5" />;
|
|
319
|
+
>{props.children}</div></Show4>;
|
|
177
320
|
};
|
|
178
321
|
|
|
179
322
|
// src/components/Typewriter.tsx
|
|
180
|
-
import { untrack as untrack2, createEffect as
|
|
323
|
+
import { untrack as untrack2, createEffect as createEffect3, onCleanup as onCleanup4, createSignal as createSignal3 } from "solid-js";
|
|
181
324
|
|
|
182
325
|
// ../typewriter/dist/index.js
|
|
183
326
|
var defaultSpeed = () => {
|
|
@@ -195,8 +338,8 @@ var collectTextNodes = (el) => {
|
|
|
195
338
|
};
|
|
196
339
|
var map = (it, cb) => {
|
|
197
340
|
const result = [];
|
|
198
|
-
for (const value of
|
|
199
|
-
const val = cb(value, result
|
|
341
|
+
for (const value of it) {
|
|
342
|
+
const val = cb(value, result.at(-1));
|
|
200
343
|
if (val) {
|
|
201
344
|
result.push(val);
|
|
202
345
|
}
|
|
@@ -238,10 +381,10 @@ var typewriter = ({ node, text, ended, speed = defaultSpeed }) => {
|
|
|
238
381
|
start = time;
|
|
239
382
|
timeout = speed();
|
|
240
383
|
process();
|
|
241
|
-
} else if (
|
|
242
|
-
enqueue();
|
|
243
|
-
} else {
|
|
384
|
+
} else if (end) {
|
|
244
385
|
dequeue();
|
|
386
|
+
} else {
|
|
387
|
+
enqueue();
|
|
245
388
|
}
|
|
246
389
|
};
|
|
247
390
|
const process = () => {
|
|
@@ -303,10 +446,10 @@ var PRM = matchMedia("(prefers-reduced-motion: reduce)");
|
|
|
303
446
|
var createTypewriter = ({ resolve }) => {
|
|
304
447
|
let bypassed = false;
|
|
305
448
|
let typewriter2;
|
|
306
|
-
const [state, setState] =
|
|
449
|
+
const [state, setState] = createSignal3("idle");
|
|
307
450
|
const Typewriter = (props) => {
|
|
308
451
|
let node;
|
|
309
|
-
|
|
452
|
+
createEffect3(() => {
|
|
310
453
|
const text = props.content;
|
|
311
454
|
typewriter2?.destroy();
|
|
312
455
|
setState("idle");
|
|
@@ -332,7 +475,7 @@ var createTypewriter = ({ resolve }) => {
|
|
|
332
475
|
});
|
|
333
476
|
bypassed = false;
|
|
334
477
|
});
|
|
335
|
-
|
|
478
|
+
onCleanup4(() => {
|
|
336
479
|
setState("idle");
|
|
337
480
|
typewriter2?.destroy();
|
|
338
481
|
bypassed = false;
|
|
@@ -368,7 +511,7 @@ var Game = (props) => {
|
|
|
368
511
|
"background-color": is ? void 0 : props.state.background
|
|
369
512
|
};
|
|
370
513
|
};
|
|
371
|
-
const [auto, setAuto] =
|
|
514
|
+
const [auto, setAuto] = createSignal4(false);
|
|
372
515
|
const onChoicesButtonClick = ([disabled, i]) => {
|
|
373
516
|
if (disabled)
|
|
374
517
|
return;
|
|
@@ -431,8 +574,15 @@ var Game = (props) => {
|
|
|
431
574
|
resolve();
|
|
432
575
|
}
|
|
433
576
|
});
|
|
577
|
+
const controlPanelMenuID = createUniqueId();
|
|
578
|
+
const [controlPanelMenuExpanded, setControlPanelMenuExpanded] = createSignal4(false);
|
|
579
|
+
createEffect4(() => {
|
|
580
|
+
if (!data.media.hyperWide()) {
|
|
581
|
+
setControlPanelMenuExpanded(false);
|
|
582
|
+
}
|
|
583
|
+
});
|
|
434
584
|
return <div class="root game" style={background()}>
|
|
435
|
-
<div data-characters={true} class="characters"><For each={Object.entries(props.state.characters)}>{([character, data2]) => <
|
|
585
|
+
<div data-characters={true} class="characters"><For each={Object.entries(props.state.characters)}>{([character, data2]) => <Show5 when={data2.visible}><Character character={character} data={data2} characters={store.characters} /></Show5>}</For></div>
|
|
436
586
|
<div
|
|
437
587
|
class="action-dialog"
|
|
438
588
|
classList={{
|
|
@@ -455,7 +605,7 @@ var Game = (props) => {
|
|
|
455
605
|
onKeyPress={onKey(DialogWriter.clear, "Enter")}
|
|
456
606
|
onKeyDown={onKey(DialogWriter.clear, " ")}
|
|
457
607
|
>
|
|
458
|
-
<div class="action-dialog-person"><
|
|
608
|
+
<div class="action-dialog-person"><Show5 when={props.state.dialog.emotion} keyed>{(emotion) => {
|
|
459
609
|
const character = props.state.dialog.character;
|
|
460
610
|
if (!character)
|
|
461
611
|
return null;
|
|
@@ -467,7 +617,7 @@ var Game = (props) => {
|
|
|
467
617
|
return image;
|
|
468
618
|
const [canvas] = canvasDrawImages(void 0, void 0, Object.values(image));
|
|
469
619
|
return canvas;
|
|
470
|
-
}}</
|
|
620
|
+
}}</Show5></div>
|
|
471
621
|
<div class="action-dialog-content"><DialogWriter.Typewriter
|
|
472
622
|
attributes={{
|
|
473
623
|
title: DialogWriter.state() === "idle" ? void 0 : data.t(DialogWriter.state() === "processing" ? "CompleteText" : "GoForward")
|
|
@@ -487,7 +637,7 @@ var Game = (props) => {
|
|
|
487
637
|
data-used={Boolean(props.state.choices.question)}
|
|
488
638
|
aria-hidden={!props.state.choices.question}
|
|
489
639
|
>{props.state.choices.question || <> </>}</span>
|
|
490
|
-
<For each={props.state.choices.choices}>{([text,
|
|
640
|
+
<For each={props.state.choices.choices}>{([text, , active], i) => {
|
|
491
641
|
const disabled = active ? !active() : false;
|
|
492
642
|
const index = i();
|
|
493
643
|
return <button
|
|
@@ -559,67 +709,67 @@ var Game = (props) => {
|
|
|
559
709
|
/></div>
|
|
560
710
|
<div
|
|
561
711
|
class="control-panel"
|
|
562
|
-
classList={{
|
|
563
|
-
"control-panel--center": controls === "inside"
|
|
564
|
-
}}
|
|
565
712
|
>
|
|
566
|
-
<
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
>
|
|
572
|
-
<span class="control-panel__button__content">{data.t("GoBack")}</span>
|
|
573
|
-
<Icon class="control-panel__button__icon" children={Icon.Back()} />
|
|
574
|
-
</button>
|
|
575
|
-
<button
|
|
713
|
+
<Show5
|
|
714
|
+
when={data.media.hyperWide()}
|
|
715
|
+
><Show5
|
|
716
|
+
when={!controlPanelMenuExpanded()}
|
|
717
|
+
><button
|
|
576
718
|
type="button"
|
|
577
719
|
class="button control-panel__button"
|
|
578
|
-
title={data.t("
|
|
720
|
+
title={data.t("OpenMenu")}
|
|
721
|
+
aria-controls={controlPanelMenuID}
|
|
722
|
+
aria-expanded={controlPanelMenuExpanded()}
|
|
579
723
|
onClick={() => {
|
|
580
|
-
|
|
724
|
+
setControlPanelMenuExpanded((prev) => !prev);
|
|
581
725
|
}}
|
|
582
|
-
>
|
|
583
|
-
|
|
584
|
-
<
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
726
|
+
><Icon children={Icon.Menu()} /></button></Show5></Show5>
|
|
727
|
+
<Show5 when={data.media.hyperWide() && controlPanelMenuExpanded() && !props.state.exitPromptShown}>
|
|
728
|
+
<span class="control-panel-container-fix" aria-hidden="true"></span>
|
|
729
|
+
<div class="control-panel-container-backdrop" />
|
|
730
|
+
</Show5>
|
|
731
|
+
<div
|
|
732
|
+
role="menubar"
|
|
733
|
+
id={controlPanelMenuID}
|
|
734
|
+
class="control-panel-container"
|
|
735
|
+
classList={{
|
|
736
|
+
"control-panel-container--center": controls === "inside",
|
|
737
|
+
"control-panel-container--wide-closed": data.media.hyperWide() && !controlPanelMenuExpanded(),
|
|
738
|
+
"control-panel-container--wide-open": data.media.hyperWide() && controlPanelMenuExpanded()
|
|
592
739
|
}}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
740
|
+
ref={(element) => {
|
|
741
|
+
clickOutside(element, () => {
|
|
742
|
+
if (untrack3(data.media.hyperWide) && untrack3(controlPanelMenuExpanded)) {
|
|
743
|
+
setControlPanelMenuExpanded(false);
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
}}
|
|
747
|
+
><ControlPanelButtons
|
|
748
|
+
openSettings={() => {
|
|
600
749
|
props.setState("screen", "settings");
|
|
601
750
|
}}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
<Icon class="control-panel__button__icon" children={Icon.Settings()} />
|
|
605
|
-
</button>
|
|
606
|
-
<button
|
|
607
|
-
type="button"
|
|
608
|
-
class="button control-panel__button"
|
|
609
|
-
title={data.t("Exit")}
|
|
610
|
-
onClick={() => {
|
|
611
|
-
data.options.exit();
|
|
751
|
+
closeDropdown={() => {
|
|
752
|
+
setControlPanelMenuExpanded(false);
|
|
612
753
|
}}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
</button>
|
|
754
|
+
auto={auto}
|
|
755
|
+
setAuto={setAuto}
|
|
756
|
+
/></div>
|
|
617
757
|
</div>
|
|
618
758
|
</div>;
|
|
619
759
|
};
|
|
620
760
|
|
|
761
|
+
// src/screens/loading.tsx
|
|
762
|
+
var Loading = () => {
|
|
763
|
+
return <div class="root loading"><div class="loading__animation">
|
|
764
|
+
<div />
|
|
765
|
+
<div />
|
|
766
|
+
<div />
|
|
767
|
+
<div />
|
|
768
|
+
</div></div>;
|
|
769
|
+
};
|
|
770
|
+
|
|
621
771
|
// src/screens/mainmenu.tsx
|
|
622
|
-
import { For as For2, Show as
|
|
772
|
+
import { For as For2, Show as Show6 } from "solid-js";
|
|
623
773
|
var MainMenu = (props) => {
|
|
624
774
|
const data = useData();
|
|
625
775
|
const language = () => data.storeData().meta[0];
|
|
@@ -631,31 +781,25 @@ var MainMenu = (props) => {
|
|
|
631
781
|
<button type="button" class="button main-menu__button" onClick={() => data.options.restore()}>{data.t("LoadSave")}</button>
|
|
632
782
|
<button type="button" class="button main-menu__button" onClick={() => props.setState("screen", "saves")}>{data.t("Saves")}</button>
|
|
633
783
|
<button type="button" class="button main-menu__button" onClick={() => props.setState("screen", "settings")}>{data.t("Settings")}</button>
|
|
634
|
-
<
|
|
784
|
+
<Show6 when={language()} keyed>{(_) => <For2 each={props.state.mainmenu.items}>{(item) => <button {...item(goto)} />}</For2>}</Show6>
|
|
635
785
|
</div>;
|
|
636
786
|
};
|
|
637
787
|
|
|
638
788
|
// src/screens/saves.tsx
|
|
639
|
-
import { Show as
|
|
789
|
+
import { Show as Show7, For as For3 } from "solid-js";
|
|
640
790
|
var Saves = (props) => {
|
|
641
791
|
const data = useData();
|
|
642
792
|
const saves = () => data.storeData().saves;
|
|
643
793
|
const language = () => data.storeData().meta[0];
|
|
644
794
|
const removeSave = (date) => {
|
|
645
|
-
const _saves = saves();
|
|
646
|
-
for (let i = 0; i < _saves.length; i++) {
|
|
647
|
-
const current = _saves[i];
|
|
648
|
-
if (current[2][0] === date) {
|
|
649
|
-
_saves.splice(i, 1);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
795
|
data.storeDataUpdate((prev) => {
|
|
653
|
-
|
|
796
|
+
prev.saves = saves().filter((save) => save[2][0] !== date);
|
|
797
|
+
return prev;
|
|
654
798
|
});
|
|
655
799
|
};
|
|
656
800
|
return <div class="root saves">
|
|
657
801
|
<div class="saves__column"><button type="button" class="button saves__button" onClick={() => props.setState("screen", "mainmenu")}>{data.t("GoBack")}</button></div>
|
|
658
|
-
<div class="saves__list-container"><
|
|
802
|
+
<div class="saves__list-container"><Show7
|
|
659
803
|
when={saves().length > 0}
|
|
660
804
|
fallback={<div class="saves__list saves__list--empty">{data.t("NoSaves")}</div>}
|
|
661
805
|
><ol class="saves__list"><For3 each={saves()}>{(save) => {
|
|
@@ -679,7 +823,7 @@ var Saves = (props) => {
|
|
|
679
823
|
aria-label={data.t("LoadASaveFrom") + " " + stringDate}
|
|
680
824
|
onClick={() => data.options.set(save)}
|
|
681
825
|
>
|
|
682
|
-
{stringDate}
|
|
826
|
+
<span>{stringDate}</span>
|
|
683
827
|
<span class="saves__button-load__type">{stringType}</span>
|
|
684
828
|
</button>
|
|
685
829
|
<button
|
|
@@ -689,12 +833,12 @@ var Saves = (props) => {
|
|
|
689
833
|
onClick={[removeSave, date]}
|
|
690
834
|
><span>{data.t("Remove")}</span></button>
|
|
691
835
|
</li>;
|
|
692
|
-
}}</For3></ol></
|
|
836
|
+
}}</For3></ol></Show7></div>
|
|
693
837
|
</div>;
|
|
694
838
|
};
|
|
695
839
|
|
|
696
840
|
// src/screens/settings.tsx
|
|
697
|
-
import { For as For4, createUniqueId, createMemo } from "solid-js";
|
|
841
|
+
import { For as For4, createUniqueId as createUniqueId2, createMemo } from "solid-js";
|
|
698
842
|
var Settings = (props) => {
|
|
699
843
|
const data = useData();
|
|
700
844
|
const language = () => data.storeData().meta[0];
|
|
@@ -714,8 +858,8 @@ var Settings = (props) => {
|
|
|
714
858
|
return prev.meta[1] = value, prev;
|
|
715
859
|
});
|
|
716
860
|
};
|
|
717
|
-
const languageSelectID =
|
|
718
|
-
const speedSelectID =
|
|
861
|
+
const languageSelectID = createUniqueId2();
|
|
862
|
+
const speedSelectID = createUniqueId2();
|
|
719
863
|
return <div class="root settings">
|
|
720
864
|
<div class="settings__column">
|
|
721
865
|
<button type="button" class="button settings__button" onClick={() => props.setState("screen", "mainmenu")}>{data.t("HomeScreen")}</button>
|
|
@@ -734,41 +878,6 @@ var Settings = (props) => {
|
|
|
734
878
|
</div>;
|
|
735
879
|
};
|
|
736
880
|
|
|
737
|
-
// src/screens/loading.tsx
|
|
738
|
-
var Loading = () => {
|
|
739
|
-
return <div class="root loading"><div class="loading__animation">
|
|
740
|
-
<div />
|
|
741
|
-
<div />
|
|
742
|
-
<div />
|
|
743
|
-
<div />
|
|
744
|
-
</div></div>;
|
|
745
|
-
};
|
|
746
|
-
|
|
747
|
-
// src/screens/custom-screen.tsx
|
|
748
|
-
import { createEffect as createEffect3, createSignal as createSignal3, Show as Show6 } from "solid-js";
|
|
749
|
-
var CustomScreen = (props) => {
|
|
750
|
-
const [dom, setDOM] = createSignal3(null);
|
|
751
|
-
let unmount;
|
|
752
|
-
createEffect3(() => {
|
|
753
|
-
if (unmount)
|
|
754
|
-
unmount();
|
|
755
|
-
if (props.state.screen in props.state.screens) {
|
|
756
|
-
const current = props.state.screens[props.state.screen]();
|
|
757
|
-
setDOM(current.mount());
|
|
758
|
-
unmount = current.unmount;
|
|
759
|
-
return;
|
|
760
|
-
}
|
|
761
|
-
setDOM(null);
|
|
762
|
-
unmount = void 0;
|
|
763
|
-
});
|
|
764
|
-
const onClick = ({ target }) => {
|
|
765
|
-
if (target instanceof HTMLElement && target.dataset.novelyGoto) {
|
|
766
|
-
props.setState("screen", target.dataset.novelyGoto);
|
|
767
|
-
}
|
|
768
|
-
};
|
|
769
|
-
return <Show6 when={dom()}><div class="root custom" onClick={onClick}>{dom()}</div></Show6>;
|
|
770
|
-
};
|
|
771
|
-
|
|
772
881
|
// src/renderer.tsx
|
|
773
882
|
var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypewriterWhenGoingBack = true } = {}) => {
|
|
774
883
|
const [state, setState] = createStore({
|
|
@@ -812,12 +921,37 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
812
921
|
let renderer;
|
|
813
922
|
let options;
|
|
814
923
|
let root;
|
|
924
|
+
let currentBackground;
|
|
815
925
|
return {
|
|
816
926
|
createRenderer(init) {
|
|
817
927
|
options = init, characters = init.characters;
|
|
818
928
|
return renderer = {
|
|
819
929
|
background(background) {
|
|
820
|
-
|
|
930
|
+
currentBackground = background;
|
|
931
|
+
if (typeof background === "string") {
|
|
932
|
+
setState("background", background);
|
|
933
|
+
return;
|
|
934
|
+
}
|
|
935
|
+
for (const [key, value] of Object.entries(background)) {
|
|
936
|
+
delete background[key];
|
|
937
|
+
background[toMedia(key)] = value;
|
|
938
|
+
}
|
|
939
|
+
const mediaQueries = Object.keys(background).map((media) => matchMedia(media));
|
|
940
|
+
const handle = () => {
|
|
941
|
+
if (currentBackground !== background) {
|
|
942
|
+
for (const mq of mediaQueries) {
|
|
943
|
+
mq.onchange = null;
|
|
944
|
+
}
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
const last = findLast(mediaQueries, ({ matches }) => matches);
|
|
948
|
+
const bg = last ? background[last.media] : "";
|
|
949
|
+
setState("background", bg);
|
|
950
|
+
};
|
|
951
|
+
for (const mq of mediaQueries) {
|
|
952
|
+
mq.onchange = handle;
|
|
953
|
+
}
|
|
954
|
+
handle();
|
|
821
955
|
},
|
|
822
956
|
character(character) {
|
|
823
957
|
if (store.characters[character])
|
|
@@ -958,10 +1092,11 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
958
1092
|
});
|
|
959
1093
|
};
|
|
960
1094
|
const input = <input type="text" name="novely-input" required autocomplete="off" onInput={onInputHandler} />;
|
|
961
|
-
if (setup)
|
|
1095
|
+
if (setup) {
|
|
962
1096
|
setup(input, (callback) => {
|
|
963
1097
|
setState("input", { cleanup: callback });
|
|
964
1098
|
});
|
|
1099
|
+
}
|
|
965
1100
|
setState("input", {
|
|
966
1101
|
element: input,
|
|
967
1102
|
question,
|
|
@@ -1044,7 +1179,7 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1044
1179
|
};
|
|
1045
1180
|
},
|
|
1046
1181
|
Novely(props) {
|
|
1047
|
-
|
|
1182
|
+
createEffect5(() => {
|
|
1048
1183
|
const screen = state.screen;
|
|
1049
1184
|
if (fullscreen && document.fullscreenEnabled) {
|
|
1050
1185
|
if (screen === "game" && !document.fullscreenElement) {
|
package/dist/renderer.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ type StateScreen = () => {
|
|
|
114
114
|
unmount?(): void;
|
|
115
115
|
};
|
|
116
116
|
type StateScreens = Record<string, StateScreen>;
|
|
117
|
-
type StateMainmenuItems = ((goto: (name: NovelyScreen | (string &
|
|
117
|
+
type StateMainmenuItems = ((goto: (name: NovelyScreen | (string & Record<never, never>)) => void) => JSX.ButtonHTMLAttributes<HTMLButtonElement>)[];
|
|
118
118
|
interface State {
|
|
119
119
|
background: string;
|
|
120
120
|
characters: Record<string, StateCharacter>;
|
|
@@ -127,7 +127,7 @@ interface State {
|
|
|
127
127
|
items: StateMainmenuItems;
|
|
128
128
|
};
|
|
129
129
|
text: StateText;
|
|
130
|
-
screen: NovelyScreen | (string &
|
|
130
|
+
screen: NovelyScreen | (string & Record<never, never>);
|
|
131
131
|
exitPromptShown: boolean;
|
|
132
132
|
}
|
|
133
133
|
interface SolidRendererStore extends RendererStore {
|
|
@@ -155,7 +155,7 @@ declare const createSolidRenderer: ({ fullscreen, controls, skipTypewriterWhenGo
|
|
|
155
155
|
createRenderer(init: RendererInit): Renderer;
|
|
156
156
|
Novely(props: Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'ref'>): JSX.Element;
|
|
157
157
|
registerScreen(name: string, screen: StateScreen): void;
|
|
158
|
-
registerMainmenuItem(fn: (goto: (name: NovelyScreen | (string &
|
|
158
|
+
registerMainmenuItem(fn: (goto: (name: NovelyScreen | (string & Record<never, never>)) => void) => JSX.ButtonHTMLAttributes<HTMLButtonElement>): void;
|
|
159
159
|
};
|
|
160
160
|
export { createSolidRenderer };
|
|
161
161
|
export type { State, StateScreen, StateScreens, SolidRendererStore };
|
package/dist/styles/index.css
CHANGED
|
@@ -71,34 +71,63 @@
|
|
|
71
71
|
}
|
|
72
72
|
.characters > canvas {
|
|
73
73
|
min-width: unset;
|
|
74
|
-
max-width:
|
|
75
|
-
max-height:
|
|
74
|
+
max-width: 50%;
|
|
75
|
+
max-height: 85%;
|
|
76
76
|
position: relative;
|
|
77
77
|
}
|
|
78
|
+
@media (max-aspect-ratio: .26) {
|
|
79
|
+
.characters {
|
|
80
|
+
padding-bottom: 50vh;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
78
83
|
|
|
79
84
|
/* src/styles/characters/index.css */
|
|
80
85
|
|
|
81
86
|
/* src/styles/control-panel/control-panel.css */
|
|
82
87
|
.control-panel {
|
|
83
88
|
z-index: 30;
|
|
84
|
-
justify-content: end;
|
|
85
|
-
display: flex;
|
|
86
89
|
position: fixed;
|
|
87
90
|
bottom: .4rem;
|
|
88
91
|
right: .4rem;
|
|
89
92
|
}
|
|
90
|
-
.control-panel
|
|
93
|
+
.control-panel-container {
|
|
94
|
+
justify-content: end;
|
|
95
|
+
width: 100%;
|
|
96
|
+
display: flex;
|
|
97
|
+
}
|
|
98
|
+
.control-panel-container--center:not(.control-panel-container--wide-open) {
|
|
91
99
|
bottom: calc(var(--novely-dialog-border-width, 3px) + .4rem);
|
|
92
100
|
justify-content: center;
|
|
93
|
-
|
|
101
|
+
position: fixed;
|
|
94
102
|
left: 50%;
|
|
95
103
|
right: 50%;
|
|
96
104
|
transform: translateX(-50%);
|
|
97
105
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
.control-panel-container--wide-closed {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
.control-panel-container--wide-open {
|
|
110
|
+
z-index: 30;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
width: calc(100% - .8rem);
|
|
113
|
+
display: flex;
|
|
114
|
+
position: fixed;
|
|
115
|
+
bottom: .4rem;
|
|
116
|
+
left: .4rem;
|
|
117
|
+
}
|
|
118
|
+
.control-panel-container-backdrop {
|
|
119
|
+
z-index: 23;
|
|
120
|
+
background-color: var(--novely-control-panel-container-backdrop-background-color, #1616166c);
|
|
121
|
+
position: fixed;
|
|
122
|
+
top: 0;
|
|
123
|
+
bottom: 0;
|
|
124
|
+
left: 0;
|
|
125
|
+
right: 0;
|
|
126
|
+
}
|
|
127
|
+
.control-panel-container-fix {
|
|
128
|
+
vertical-align: middle;
|
|
129
|
+
height: 100vh;
|
|
130
|
+
display: inline-block;
|
|
102
131
|
}
|
|
103
132
|
|
|
104
133
|
/* src/styles/control-panel/button/button.css */
|
|
@@ -114,7 +143,7 @@
|
|
|
114
143
|
.control-panel__button--auto-mode {
|
|
115
144
|
display: none;
|
|
116
145
|
}
|
|
117
|
-
@media (orientation: portrait) {
|
|
146
|
+
@media (orientation: portrait) and (min-aspect-ratio: .26) {
|
|
118
147
|
.control-panel__button__icon {
|
|
119
148
|
display: block;
|
|
120
149
|
}
|
|
@@ -130,7 +159,7 @@
|
|
|
130
159
|
}
|
|
131
160
|
@media (prefers-reduced-motion: no-preference) {
|
|
132
161
|
.control-panel__button--auto-mode {
|
|
133
|
-
display:
|
|
162
|
+
display: inline-block;
|
|
134
163
|
}
|
|
135
164
|
}
|
|
136
165
|
|
|
@@ -297,6 +326,14 @@
|
|
|
297
326
|
text-shadow: none;
|
|
298
327
|
}
|
|
299
328
|
}
|
|
329
|
+
@media (max-aspect-ratio: .26) {
|
|
330
|
+
.action-dialog {
|
|
331
|
+
height: unset;
|
|
332
|
+
}
|
|
333
|
+
.action-dialog-container {
|
|
334
|
+
height: 50vh !important;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
300
337
|
@media only screen and (orientation: landscape) and (pointer: coarse) {
|
|
301
338
|
.action-dialog-content {
|
|
302
339
|
text-shadow: none;
|
|
@@ -384,7 +421,7 @@
|
|
|
384
421
|
margin: .4rem 0;
|
|
385
422
|
}
|
|
386
423
|
.input-dialog-label > input {
|
|
387
|
-
min-width: 10rem;
|
|
424
|
+
min-width: min(10rem, 100%);
|
|
388
425
|
max-width: 100%;
|
|
389
426
|
}
|
|
390
427
|
.input-dialog-panel {
|
|
@@ -426,6 +463,11 @@
|
|
|
426
463
|
gap: .5rem;
|
|
427
464
|
display: flex;
|
|
428
465
|
}
|
|
466
|
+
@media (max-aspect-ratio: .26) {
|
|
467
|
+
.exit-dialog-panel-buttons {
|
|
468
|
+
flex-direction: column;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
429
471
|
|
|
430
472
|
/* src/styles/exit-dialog/index.css */
|
|
431
473
|
|
|
@@ -565,6 +607,11 @@
|
|
|
565
607
|
flex-direction: column-reverse;
|
|
566
608
|
}
|
|
567
609
|
}
|
|
610
|
+
@media (max-aspect-ratio: .26) {
|
|
611
|
+
.saves {
|
|
612
|
+
padding: 0 .1rem;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
568
615
|
|
|
569
616
|
/* src/styles/saves/button/button.css */
|
|
570
617
|
.saves__button {
|
|
@@ -588,6 +635,12 @@
|
|
|
588
635
|
margin-top: 4px;
|
|
589
636
|
}
|
|
590
637
|
}
|
|
638
|
+
@media (max-aspect-ratio: .26) {
|
|
639
|
+
.saves__button-load {
|
|
640
|
+
flex-direction: column;
|
|
641
|
+
display: flex;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
591
644
|
|
|
592
645
|
/* src/styles/saves/list/list.css */
|
|
593
646
|
.saves__list-container {
|
|
@@ -603,7 +656,6 @@
|
|
|
603
656
|
border-radius: var(--novely-saves-list-border-radius, 14px);
|
|
604
657
|
background-color: var(--novely-saves-list-background-color, #ffffff57);
|
|
605
658
|
place-content: flex-start center;
|
|
606
|
-
justify-items: stretch;
|
|
607
659
|
width: 100%;
|
|
608
660
|
height: 80%;
|
|
609
661
|
margin-top: 0;
|
|
@@ -612,6 +664,7 @@
|
|
|
612
664
|
padding-right: 0;
|
|
613
665
|
list-style: none;
|
|
614
666
|
display: grid;
|
|
667
|
+
overflow-x: hidden;
|
|
615
668
|
overflow-y: scroll;
|
|
616
669
|
touch-action: auto !important;
|
|
617
670
|
}
|
|
@@ -651,6 +704,23 @@
|
|
|
651
704
|
flex-direction: column;
|
|
652
705
|
}
|
|
653
706
|
}
|
|
707
|
+
@media (max-aspect-ratio: .26) {
|
|
708
|
+
.saves {
|
|
709
|
+
padding: 0 .1rem;
|
|
710
|
+
}
|
|
711
|
+
.saves__list {
|
|
712
|
+
border-radius: var(--novely-saves-list-border-radius, 7px);
|
|
713
|
+
}
|
|
714
|
+
.saves__list::-webkit-scrollbar {
|
|
715
|
+
width: 7px;
|
|
716
|
+
}
|
|
717
|
+
.saves__list::-webkit-scrollbar-track {
|
|
718
|
+
border-radius: var(--novely-scrollbar-track-border-radius, 3.5px);
|
|
719
|
+
}
|
|
720
|
+
.saves__list::-webkit-scrollbar-thumb {
|
|
721
|
+
border-radius: var(--novely-scrollbar-thumb-border-radius, 3.5px);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
654
724
|
|
|
655
725
|
/* src/styles/saves/column/column.css */
|
|
656
726
|
@media (orientation: portrait) {
|
package/dist/utils.d.ts
CHANGED
|
@@ -8,4 +8,6 @@ declare const canvasDrawImages: (canvas: HTMLCanvasElement | undefined, ctx: Can
|
|
|
8
8
|
declare const url: <T extends string>(str: T) => `url(${T})`;
|
|
9
9
|
declare const escape: (str: string) => string;
|
|
10
10
|
declare const onKey: (cb: (event: KeyboardEvent) => void, ...keys: string[]) => (e: KeyboardEvent) => void;
|
|
11
|
-
|
|
11
|
+
declare const toMedia: (media: 'portrait' | 'landscape' | (string & Record<never, never>)) => string;
|
|
12
|
+
declare const findLast: <T>(array: T[], fn: (item: T) => boolean) => T | undefined;
|
|
13
|
+
export { isCSSImage, canvasDrawImages, url, createImage, capitalize, escape, onKey, toMedia, findLast };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novely/solid-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"build": "node ./build.js && tsc"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"esbuild": "^0.
|
|
18
|
-
"lightningcss": "^1.21.5",
|
|
17
|
+
"esbuild": "^0.19.2",
|
|
19
18
|
"typescript": "^5.1.6"
|
|
20
19
|
},
|
|
21
20
|
"dependencies": {
|