@novely/solid-renderer 0.9.1 → 0.9.3-next
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 +10 -25
- package/dist/context/index.d.ts +4 -1
- package/dist/index.jsx +2479 -495
- package/dist/renderer.d.ts +12 -5
- package/dist/styles/index.css +11 -11
- package/dist/utils.d.ts +2 -1
- package/package.json +2 -1
package/dist/index.jsx
CHANGED
|
@@ -1,6 +1,1651 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// ../../node_modules/.pnpm/solid-js@1.7.3/node_modules/solid-js/dist/solid.js
|
|
2
|
+
var sharedConfig = {
|
|
3
|
+
context: void 0,
|
|
4
|
+
registry: void 0
|
|
5
|
+
};
|
|
6
|
+
function setHydrateContext(context) {
|
|
7
|
+
sharedConfig.context = context;
|
|
8
|
+
}
|
|
9
|
+
function nextHydrateContext() {
|
|
10
|
+
return {
|
|
11
|
+
...sharedConfig.context,
|
|
12
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
13
|
+
count: 0
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
var equalFn = (a, b) => a === b;
|
|
17
|
+
var $PROXY = Symbol("solid-proxy");
|
|
18
|
+
var $TRACK = Symbol("solid-track");
|
|
19
|
+
var $DEVCOMP = Symbol("solid-dev-component");
|
|
20
|
+
var signalOptions = {
|
|
21
|
+
equals: equalFn
|
|
22
|
+
};
|
|
23
|
+
var ERROR = null;
|
|
24
|
+
var runEffects = runQueue;
|
|
25
|
+
var STALE = 1;
|
|
26
|
+
var PENDING = 2;
|
|
27
|
+
var UNOWNED = {
|
|
28
|
+
owned: null,
|
|
29
|
+
cleanups: null,
|
|
30
|
+
context: null,
|
|
31
|
+
owner: null
|
|
32
|
+
};
|
|
33
|
+
var Owner = null;
|
|
34
|
+
var Transition = null;
|
|
35
|
+
var Scheduler = null;
|
|
36
|
+
var ExternalSourceFactory = null;
|
|
37
|
+
var Listener = null;
|
|
38
|
+
var Updates = null;
|
|
39
|
+
var Effects = null;
|
|
40
|
+
var ExecCount = 0;
|
|
41
|
+
var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
42
|
+
function createRoot(fn, detachedOwner) {
|
|
43
|
+
const listener = Listener, owner = Owner, unowned = fn.length === 0, root = unowned ? UNOWNED : {
|
|
44
|
+
owned: null,
|
|
45
|
+
cleanups: null,
|
|
46
|
+
context: null,
|
|
47
|
+
owner: detachedOwner === void 0 ? owner : detachedOwner
|
|
48
|
+
}, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
|
|
49
|
+
Owner = root;
|
|
50
|
+
Listener = null;
|
|
51
|
+
try {
|
|
52
|
+
return runUpdates(updateFn, true);
|
|
53
|
+
} finally {
|
|
54
|
+
Listener = listener;
|
|
55
|
+
Owner = owner;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function createSignal(value, options) {
|
|
59
|
+
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
60
|
+
const s = {
|
|
61
|
+
value,
|
|
62
|
+
observers: null,
|
|
63
|
+
observerSlots: null,
|
|
64
|
+
comparator: options.equals || void 0
|
|
65
|
+
};
|
|
66
|
+
const setter = (value2) => {
|
|
67
|
+
if (typeof value2 === "function") {
|
|
68
|
+
if (Transition && Transition.running && Transition.sources.has(s))
|
|
69
|
+
value2 = value2(s.tValue);
|
|
70
|
+
else
|
|
71
|
+
value2 = value2(s.value);
|
|
72
|
+
}
|
|
73
|
+
return writeSignal(s, value2);
|
|
74
|
+
};
|
|
75
|
+
return [readSignal.bind(s), setter];
|
|
76
|
+
}
|
|
77
|
+
function createRenderEffect(fn, value, options) {
|
|
78
|
+
const c = createComputation(fn, value, false, STALE);
|
|
79
|
+
if (Scheduler && Transition && Transition.running)
|
|
80
|
+
Updates.push(c);
|
|
81
|
+
else
|
|
82
|
+
updateComputation(c);
|
|
83
|
+
}
|
|
84
|
+
function createEffect(fn, value, options) {
|
|
85
|
+
runEffects = runUserEffects;
|
|
86
|
+
const c = createComputation(fn, value, false, STALE), s = SuspenseContext && lookup(Owner, SuspenseContext.id);
|
|
87
|
+
if (s)
|
|
88
|
+
c.suspense = s;
|
|
89
|
+
if (!options || !options.render)
|
|
90
|
+
c.user = true;
|
|
91
|
+
Effects ? Effects.push(c) : updateComputation(c);
|
|
92
|
+
}
|
|
93
|
+
function createMemo(fn, value, options) {
|
|
94
|
+
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
95
|
+
const c = createComputation(fn, value, true, 0);
|
|
96
|
+
c.observers = null;
|
|
97
|
+
c.observerSlots = null;
|
|
98
|
+
c.comparator = options.equals || void 0;
|
|
99
|
+
if (Scheduler && Transition && Transition.running) {
|
|
100
|
+
c.tState = STALE;
|
|
101
|
+
Updates.push(c);
|
|
102
|
+
} else
|
|
103
|
+
updateComputation(c);
|
|
104
|
+
return readSignal.bind(c);
|
|
105
|
+
}
|
|
106
|
+
function batch(fn) {
|
|
107
|
+
return runUpdates(fn, false);
|
|
108
|
+
}
|
|
109
|
+
function untrack(fn) {
|
|
110
|
+
if (Listener === null)
|
|
111
|
+
return fn();
|
|
112
|
+
const listener = Listener;
|
|
113
|
+
Listener = null;
|
|
114
|
+
try {
|
|
115
|
+
return fn();
|
|
116
|
+
} finally {
|
|
117
|
+
Listener = listener;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function on(deps, fn, options) {
|
|
121
|
+
const isArray = Array.isArray(deps);
|
|
122
|
+
let prevInput;
|
|
123
|
+
let defer = options && options.defer;
|
|
124
|
+
return (prevValue) => {
|
|
125
|
+
let input;
|
|
126
|
+
if (isArray) {
|
|
127
|
+
input = Array(deps.length);
|
|
128
|
+
for (let i = 0; i < deps.length; i++)
|
|
129
|
+
input[i] = deps[i]();
|
|
130
|
+
} else
|
|
131
|
+
input = deps();
|
|
132
|
+
if (defer) {
|
|
133
|
+
defer = false;
|
|
134
|
+
return void 0;
|
|
135
|
+
}
|
|
136
|
+
const result = untrack(() => fn(input, prevInput, prevValue));
|
|
137
|
+
prevInput = input;
|
|
138
|
+
return result;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function onCleanup(fn) {
|
|
142
|
+
if (Owner === null)
|
|
143
|
+
;
|
|
144
|
+
else if (Owner.cleanups === null)
|
|
145
|
+
Owner.cleanups = [fn];
|
|
146
|
+
else
|
|
147
|
+
Owner.cleanups.push(fn);
|
|
148
|
+
return fn;
|
|
149
|
+
}
|
|
150
|
+
function getListener() {
|
|
151
|
+
return Listener;
|
|
152
|
+
}
|
|
153
|
+
function startTransition(fn) {
|
|
154
|
+
if (Transition && Transition.running) {
|
|
155
|
+
fn();
|
|
156
|
+
return Transition.done;
|
|
157
|
+
}
|
|
158
|
+
const l = Listener;
|
|
159
|
+
const o = Owner;
|
|
160
|
+
return Promise.resolve().then(() => {
|
|
161
|
+
Listener = l;
|
|
162
|
+
Owner = o;
|
|
163
|
+
let t;
|
|
164
|
+
if (Scheduler || SuspenseContext) {
|
|
165
|
+
t = Transition || (Transition = {
|
|
166
|
+
sources: /* @__PURE__ */ new Set(),
|
|
167
|
+
effects: [],
|
|
168
|
+
promises: /* @__PURE__ */ new Set(),
|
|
169
|
+
disposed: /* @__PURE__ */ new Set(),
|
|
170
|
+
queue: /* @__PURE__ */ new Set(),
|
|
171
|
+
running: true
|
|
172
|
+
});
|
|
173
|
+
t.done || (t.done = new Promise((res) => t.resolve = res));
|
|
174
|
+
t.running = true;
|
|
175
|
+
}
|
|
176
|
+
runUpdates(fn, false);
|
|
177
|
+
Listener = Owner = null;
|
|
178
|
+
return t ? t.done : void 0;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function createContext(defaultValue, options) {
|
|
182
|
+
const id = Symbol("context");
|
|
183
|
+
return {
|
|
184
|
+
id,
|
|
185
|
+
Provider: createProvider(id),
|
|
186
|
+
defaultValue
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function useContext(context) {
|
|
190
|
+
let ctx;
|
|
191
|
+
return (ctx = lookup(Owner, context.id)) !== void 0 ? ctx : context.defaultValue;
|
|
192
|
+
}
|
|
193
|
+
function children(fn) {
|
|
194
|
+
const children2 = createMemo(fn);
|
|
195
|
+
const memo = createMemo(() => resolveChildren(children2()));
|
|
196
|
+
memo.toArray = () => {
|
|
197
|
+
const c = memo();
|
|
198
|
+
return Array.isArray(c) ? c : c != null ? [c] : [];
|
|
199
|
+
};
|
|
200
|
+
return memo;
|
|
201
|
+
}
|
|
202
|
+
var SuspenseContext;
|
|
203
|
+
function readSignal() {
|
|
204
|
+
const runningTransition = Transition && Transition.running;
|
|
205
|
+
if (this.sources && (runningTransition ? this.tState : this.state)) {
|
|
206
|
+
if ((runningTransition ? this.tState : this.state) === STALE)
|
|
207
|
+
updateComputation(this);
|
|
208
|
+
else {
|
|
209
|
+
const updates = Updates;
|
|
210
|
+
Updates = null;
|
|
211
|
+
runUpdates(() => lookUpstream(this), false);
|
|
212
|
+
Updates = updates;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (Listener) {
|
|
216
|
+
const sSlot = this.observers ? this.observers.length : 0;
|
|
217
|
+
if (!Listener.sources) {
|
|
218
|
+
Listener.sources = [this];
|
|
219
|
+
Listener.sourceSlots = [sSlot];
|
|
220
|
+
} else {
|
|
221
|
+
Listener.sources.push(this);
|
|
222
|
+
Listener.sourceSlots.push(sSlot);
|
|
223
|
+
}
|
|
224
|
+
if (!this.observers) {
|
|
225
|
+
this.observers = [Listener];
|
|
226
|
+
this.observerSlots = [Listener.sources.length - 1];
|
|
227
|
+
} else {
|
|
228
|
+
this.observers.push(Listener);
|
|
229
|
+
this.observerSlots.push(Listener.sources.length - 1);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (runningTransition && Transition.sources.has(this))
|
|
233
|
+
return this.tValue;
|
|
234
|
+
return this.value;
|
|
235
|
+
}
|
|
236
|
+
function writeSignal(node, value, isComp) {
|
|
237
|
+
let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
|
|
238
|
+
if (!node.comparator || !node.comparator(current, value)) {
|
|
239
|
+
if (Transition) {
|
|
240
|
+
const TransitionRunning = Transition.running;
|
|
241
|
+
if (TransitionRunning || !isComp && Transition.sources.has(node)) {
|
|
242
|
+
Transition.sources.add(node);
|
|
243
|
+
node.tValue = value;
|
|
244
|
+
}
|
|
245
|
+
if (!TransitionRunning)
|
|
246
|
+
node.value = value;
|
|
247
|
+
} else
|
|
248
|
+
node.value = value;
|
|
249
|
+
if (node.observers && node.observers.length) {
|
|
250
|
+
runUpdates(() => {
|
|
251
|
+
for (let i = 0; i < node.observers.length; i += 1) {
|
|
252
|
+
const o = node.observers[i];
|
|
253
|
+
const TransitionRunning = Transition && Transition.running;
|
|
254
|
+
if (TransitionRunning && Transition.disposed.has(o))
|
|
255
|
+
continue;
|
|
256
|
+
if (TransitionRunning ? !o.tState : !o.state) {
|
|
257
|
+
if (o.pure)
|
|
258
|
+
Updates.push(o);
|
|
259
|
+
else
|
|
260
|
+
Effects.push(o);
|
|
261
|
+
if (o.observers)
|
|
262
|
+
markDownstream(o);
|
|
263
|
+
}
|
|
264
|
+
if (!TransitionRunning)
|
|
265
|
+
o.state = STALE;
|
|
266
|
+
else
|
|
267
|
+
o.tState = STALE;
|
|
268
|
+
}
|
|
269
|
+
if (Updates.length > 1e6) {
|
|
270
|
+
Updates = [];
|
|
271
|
+
if (false)
|
|
272
|
+
;
|
|
273
|
+
throw new Error();
|
|
274
|
+
}
|
|
275
|
+
}, false);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return value;
|
|
279
|
+
}
|
|
280
|
+
function updateComputation(node) {
|
|
281
|
+
if (!node.fn)
|
|
282
|
+
return;
|
|
283
|
+
cleanNode(node);
|
|
284
|
+
const owner = Owner, listener = Listener, time = ExecCount;
|
|
285
|
+
Listener = Owner = node;
|
|
286
|
+
runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
|
|
287
|
+
if (Transition && !Transition.running && Transition.sources.has(node)) {
|
|
288
|
+
queueMicrotask(() => {
|
|
289
|
+
runUpdates(() => {
|
|
290
|
+
Transition && (Transition.running = true);
|
|
291
|
+
Listener = Owner = node;
|
|
292
|
+
runComputation(node, node.tValue, time);
|
|
293
|
+
Listener = Owner = null;
|
|
294
|
+
}, false);
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
Listener = listener;
|
|
298
|
+
Owner = owner;
|
|
299
|
+
}
|
|
300
|
+
function runComputation(node, value, time) {
|
|
301
|
+
let nextValue;
|
|
302
|
+
try {
|
|
303
|
+
nextValue = node.fn(value);
|
|
304
|
+
} catch (err) {
|
|
305
|
+
if (node.pure) {
|
|
306
|
+
if (Transition && Transition.running) {
|
|
307
|
+
node.tState = STALE;
|
|
308
|
+
node.tOwned && node.tOwned.forEach(cleanNode);
|
|
309
|
+
node.tOwned = void 0;
|
|
310
|
+
} else {
|
|
311
|
+
node.state = STALE;
|
|
312
|
+
node.owned && node.owned.forEach(cleanNode);
|
|
313
|
+
node.owned = null;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
node.updatedAt = time + 1;
|
|
317
|
+
return handleError(err);
|
|
318
|
+
}
|
|
319
|
+
if (!node.updatedAt || node.updatedAt <= time) {
|
|
320
|
+
if (node.updatedAt != null && "observers" in node) {
|
|
321
|
+
writeSignal(node, nextValue, true);
|
|
322
|
+
} else if (Transition && Transition.running && node.pure) {
|
|
323
|
+
Transition.sources.add(node);
|
|
324
|
+
node.tValue = nextValue;
|
|
325
|
+
} else
|
|
326
|
+
node.value = nextValue;
|
|
327
|
+
node.updatedAt = time;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function createComputation(fn, init, pure, state = STALE, options) {
|
|
331
|
+
const c = {
|
|
332
|
+
fn,
|
|
333
|
+
state,
|
|
334
|
+
updatedAt: null,
|
|
335
|
+
owned: null,
|
|
336
|
+
sources: null,
|
|
337
|
+
sourceSlots: null,
|
|
338
|
+
cleanups: null,
|
|
339
|
+
value: init,
|
|
340
|
+
owner: Owner,
|
|
341
|
+
context: null,
|
|
342
|
+
pure
|
|
343
|
+
};
|
|
344
|
+
if (Transition && Transition.running) {
|
|
345
|
+
c.state = 0;
|
|
346
|
+
c.tState = state;
|
|
347
|
+
}
|
|
348
|
+
if (Owner === null)
|
|
349
|
+
;
|
|
350
|
+
else if (Owner !== UNOWNED) {
|
|
351
|
+
if (Transition && Transition.running && Owner.pure) {
|
|
352
|
+
if (!Owner.tOwned)
|
|
353
|
+
Owner.tOwned = [c];
|
|
354
|
+
else
|
|
355
|
+
Owner.tOwned.push(c);
|
|
356
|
+
} else {
|
|
357
|
+
if (!Owner.owned)
|
|
358
|
+
Owner.owned = [c];
|
|
359
|
+
else
|
|
360
|
+
Owner.owned.push(c);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (ExternalSourceFactory) {
|
|
364
|
+
const [track, trigger] = createSignal(void 0, {
|
|
365
|
+
equals: false
|
|
366
|
+
});
|
|
367
|
+
const ordinary = ExternalSourceFactory(c.fn, trigger);
|
|
368
|
+
onCleanup(() => ordinary.dispose());
|
|
369
|
+
const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
|
|
370
|
+
const inTransition = ExternalSourceFactory(c.fn, triggerInTransition);
|
|
371
|
+
c.fn = (x) => {
|
|
372
|
+
track();
|
|
373
|
+
return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
return c;
|
|
377
|
+
}
|
|
378
|
+
function runTop(node) {
|
|
379
|
+
const runningTransition = Transition && Transition.running;
|
|
380
|
+
if ((runningTransition ? node.tState : node.state) === 0)
|
|
381
|
+
return;
|
|
382
|
+
if ((runningTransition ? node.tState : node.state) === PENDING)
|
|
383
|
+
return lookUpstream(node);
|
|
384
|
+
if (node.suspense && untrack(node.suspense.inFallback))
|
|
385
|
+
return node.suspense.effects.push(node);
|
|
386
|
+
const ancestors = [node];
|
|
387
|
+
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
388
|
+
if (runningTransition && Transition.disposed.has(node))
|
|
389
|
+
return;
|
|
390
|
+
if (runningTransition ? node.tState : node.state)
|
|
391
|
+
ancestors.push(node);
|
|
392
|
+
}
|
|
393
|
+
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
394
|
+
node = ancestors[i];
|
|
395
|
+
if (runningTransition) {
|
|
396
|
+
let top = node, prev = ancestors[i + 1];
|
|
397
|
+
while ((top = top.owner) && top !== prev) {
|
|
398
|
+
if (Transition.disposed.has(top))
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
if ((runningTransition ? node.tState : node.state) === STALE) {
|
|
403
|
+
updateComputation(node);
|
|
404
|
+
} else if ((runningTransition ? node.tState : node.state) === PENDING) {
|
|
405
|
+
const updates = Updates;
|
|
406
|
+
Updates = null;
|
|
407
|
+
runUpdates(() => lookUpstream(node, ancestors[0]), false);
|
|
408
|
+
Updates = updates;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
function runUpdates(fn, init) {
|
|
413
|
+
if (Updates)
|
|
414
|
+
return fn();
|
|
415
|
+
let wait = false;
|
|
416
|
+
if (!init)
|
|
417
|
+
Updates = [];
|
|
418
|
+
if (Effects)
|
|
419
|
+
wait = true;
|
|
420
|
+
else
|
|
421
|
+
Effects = [];
|
|
422
|
+
ExecCount++;
|
|
423
|
+
try {
|
|
424
|
+
const res = fn();
|
|
425
|
+
completeUpdates(wait);
|
|
426
|
+
return res;
|
|
427
|
+
} catch (err) {
|
|
428
|
+
if (!wait)
|
|
429
|
+
Effects = null;
|
|
430
|
+
Updates = null;
|
|
431
|
+
handleError(err);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function completeUpdates(wait) {
|
|
435
|
+
if (Updates) {
|
|
436
|
+
if (Scheduler && Transition && Transition.running)
|
|
437
|
+
scheduleQueue(Updates);
|
|
438
|
+
else
|
|
439
|
+
runQueue(Updates);
|
|
440
|
+
Updates = null;
|
|
441
|
+
}
|
|
442
|
+
if (wait)
|
|
443
|
+
return;
|
|
444
|
+
let res;
|
|
445
|
+
if (Transition) {
|
|
446
|
+
if (!Transition.promises.size && !Transition.queue.size) {
|
|
447
|
+
const sources = Transition.sources;
|
|
448
|
+
const disposed = Transition.disposed;
|
|
449
|
+
Effects.push.apply(Effects, Transition.effects);
|
|
450
|
+
res = Transition.resolve;
|
|
451
|
+
for (const e2 of Effects) {
|
|
452
|
+
"tState" in e2 && (e2.state = e2.tState);
|
|
453
|
+
delete e2.tState;
|
|
454
|
+
}
|
|
455
|
+
Transition = null;
|
|
456
|
+
runUpdates(() => {
|
|
457
|
+
for (const d of disposed)
|
|
458
|
+
cleanNode(d);
|
|
459
|
+
for (const v of sources) {
|
|
460
|
+
v.value = v.tValue;
|
|
461
|
+
if (v.owned) {
|
|
462
|
+
for (let i = 0, len = v.owned.length; i < len; i++)
|
|
463
|
+
cleanNode(v.owned[i]);
|
|
464
|
+
}
|
|
465
|
+
if (v.tOwned)
|
|
466
|
+
v.owned = v.tOwned;
|
|
467
|
+
delete v.tValue;
|
|
468
|
+
delete v.tOwned;
|
|
469
|
+
v.tState = 0;
|
|
470
|
+
}
|
|
471
|
+
setTransPending(false);
|
|
472
|
+
}, false);
|
|
473
|
+
} else if (Transition.running) {
|
|
474
|
+
Transition.running = false;
|
|
475
|
+
Transition.effects.push.apply(Transition.effects, Effects);
|
|
476
|
+
Effects = null;
|
|
477
|
+
setTransPending(true);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
const e = Effects;
|
|
482
|
+
Effects = null;
|
|
483
|
+
if (e.length)
|
|
484
|
+
runUpdates(() => runEffects(e), false);
|
|
485
|
+
if (res)
|
|
486
|
+
res();
|
|
487
|
+
}
|
|
488
|
+
function runQueue(queue) {
|
|
489
|
+
for (let i = 0; i < queue.length; i++)
|
|
490
|
+
runTop(queue[i]);
|
|
491
|
+
}
|
|
492
|
+
function scheduleQueue(queue) {
|
|
493
|
+
for (let i = 0; i < queue.length; i++) {
|
|
494
|
+
const item = queue[i];
|
|
495
|
+
const tasks = Transition.queue;
|
|
496
|
+
if (!tasks.has(item)) {
|
|
497
|
+
tasks.add(item);
|
|
498
|
+
Scheduler(() => {
|
|
499
|
+
tasks.delete(item);
|
|
500
|
+
runUpdates(() => {
|
|
501
|
+
Transition.running = true;
|
|
502
|
+
runTop(item);
|
|
503
|
+
}, false);
|
|
504
|
+
Transition && (Transition.running = false);
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
function runUserEffects(queue) {
|
|
510
|
+
let i, userLength = 0;
|
|
511
|
+
for (i = 0; i < queue.length; i++) {
|
|
512
|
+
const e = queue[i];
|
|
513
|
+
if (!e.user)
|
|
514
|
+
runTop(e);
|
|
515
|
+
else
|
|
516
|
+
queue[userLength++] = e;
|
|
517
|
+
}
|
|
518
|
+
if (sharedConfig.context)
|
|
519
|
+
setHydrateContext();
|
|
520
|
+
for (i = 0; i < userLength; i++)
|
|
521
|
+
runTop(queue[i]);
|
|
522
|
+
}
|
|
523
|
+
function lookUpstream(node, ignore) {
|
|
524
|
+
const runningTransition = Transition && Transition.running;
|
|
525
|
+
if (runningTransition)
|
|
526
|
+
node.tState = 0;
|
|
527
|
+
else
|
|
528
|
+
node.state = 0;
|
|
529
|
+
for (let i = 0; i < node.sources.length; i += 1) {
|
|
530
|
+
const source = node.sources[i];
|
|
531
|
+
if (source.sources) {
|
|
532
|
+
const state = runningTransition ? source.tState : source.state;
|
|
533
|
+
if (state === STALE) {
|
|
534
|
+
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
|
|
535
|
+
runTop(source);
|
|
536
|
+
} else if (state === PENDING)
|
|
537
|
+
lookUpstream(source, ignore);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
function markDownstream(node) {
|
|
542
|
+
const runningTransition = Transition && Transition.running;
|
|
543
|
+
for (let i = 0; i < node.observers.length; i += 1) {
|
|
544
|
+
const o = node.observers[i];
|
|
545
|
+
if (runningTransition ? !o.tState : !o.state) {
|
|
546
|
+
if (runningTransition)
|
|
547
|
+
o.tState = PENDING;
|
|
548
|
+
else
|
|
549
|
+
o.state = PENDING;
|
|
550
|
+
if (o.pure)
|
|
551
|
+
Updates.push(o);
|
|
552
|
+
else
|
|
553
|
+
Effects.push(o);
|
|
554
|
+
o.observers && markDownstream(o);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
function cleanNode(node) {
|
|
559
|
+
let i;
|
|
560
|
+
if (node.sources) {
|
|
561
|
+
while (node.sources.length) {
|
|
562
|
+
const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;
|
|
563
|
+
if (obs && obs.length) {
|
|
564
|
+
const n = obs.pop(), s = source.observerSlots.pop();
|
|
565
|
+
if (index < obs.length) {
|
|
566
|
+
n.sourceSlots[s] = index;
|
|
567
|
+
obs[index] = n;
|
|
568
|
+
source.observerSlots[index] = s;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
if (Transition && Transition.running && node.pure) {
|
|
574
|
+
if (node.tOwned) {
|
|
575
|
+
for (i = node.tOwned.length - 1; i >= 0; i--)
|
|
576
|
+
cleanNode(node.tOwned[i]);
|
|
577
|
+
delete node.tOwned;
|
|
578
|
+
}
|
|
579
|
+
reset(node, true);
|
|
580
|
+
} else if (node.owned) {
|
|
581
|
+
for (i = node.owned.length - 1; i >= 0; i--)
|
|
582
|
+
cleanNode(node.owned[i]);
|
|
583
|
+
node.owned = null;
|
|
584
|
+
}
|
|
585
|
+
if (node.cleanups) {
|
|
586
|
+
for (i = node.cleanups.length - 1; i >= 0; i--)
|
|
587
|
+
node.cleanups[i]();
|
|
588
|
+
node.cleanups = null;
|
|
589
|
+
}
|
|
590
|
+
if (Transition && Transition.running)
|
|
591
|
+
node.tState = 0;
|
|
592
|
+
else
|
|
593
|
+
node.state = 0;
|
|
594
|
+
node.context = null;
|
|
595
|
+
}
|
|
596
|
+
function reset(node, top) {
|
|
597
|
+
if (!top) {
|
|
598
|
+
node.tState = 0;
|
|
599
|
+
Transition.disposed.add(node);
|
|
600
|
+
}
|
|
601
|
+
if (node.owned) {
|
|
602
|
+
for (let i = 0; i < node.owned.length; i++)
|
|
603
|
+
reset(node.owned[i]);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
function castError(err) {
|
|
607
|
+
if (err instanceof Error)
|
|
608
|
+
return err;
|
|
609
|
+
return new Error(typeof err === "string" ? err : "Unknown error", {
|
|
610
|
+
cause: err
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
function runErrors(fns, err) {
|
|
614
|
+
for (const f of fns)
|
|
615
|
+
f(err);
|
|
616
|
+
}
|
|
617
|
+
function handleError(err) {
|
|
618
|
+
const fns = ERROR && lookup(Owner, ERROR);
|
|
619
|
+
if (!fns)
|
|
620
|
+
throw err;
|
|
621
|
+
const error = castError(err);
|
|
622
|
+
if (Effects)
|
|
623
|
+
Effects.push({
|
|
624
|
+
fn() {
|
|
625
|
+
runErrors(fns, error);
|
|
626
|
+
},
|
|
627
|
+
state: STALE
|
|
628
|
+
});
|
|
629
|
+
else
|
|
630
|
+
runErrors(fns, error);
|
|
631
|
+
}
|
|
632
|
+
function lookup(owner, key) {
|
|
633
|
+
return owner ? owner.context && owner.context[key] !== void 0 ? owner.context[key] : lookup(owner.owner, key) : void 0;
|
|
634
|
+
}
|
|
635
|
+
function resolveChildren(children2) {
|
|
636
|
+
if (typeof children2 === "function" && !children2.length)
|
|
637
|
+
return resolveChildren(children2());
|
|
638
|
+
if (Array.isArray(children2)) {
|
|
639
|
+
const results = [];
|
|
640
|
+
for (let i = 0; i < children2.length; i++) {
|
|
641
|
+
const result = resolveChildren(children2[i]);
|
|
642
|
+
Array.isArray(result) ? results.push.apply(results, result) : results.push(result);
|
|
643
|
+
}
|
|
644
|
+
return results;
|
|
645
|
+
}
|
|
646
|
+
return children2;
|
|
647
|
+
}
|
|
648
|
+
function createProvider(id, options) {
|
|
649
|
+
return function provider(props) {
|
|
650
|
+
let res;
|
|
651
|
+
createRenderEffect(() => res = untrack(() => {
|
|
652
|
+
Owner.context = {
|
|
653
|
+
[id]: props.value
|
|
654
|
+
};
|
|
655
|
+
return children(() => props.children);
|
|
656
|
+
}), void 0);
|
|
657
|
+
return res;
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
function from(producer) {
|
|
661
|
+
const [s, set] = createSignal(void 0, {
|
|
662
|
+
equals: false
|
|
663
|
+
});
|
|
664
|
+
if ("subscribe" in producer) {
|
|
665
|
+
const unsub = producer.subscribe((v) => set(() => v));
|
|
666
|
+
onCleanup(() => "unsubscribe" in unsub ? unsub.unsubscribe() : unsub());
|
|
667
|
+
} else {
|
|
668
|
+
const clean = producer(set);
|
|
669
|
+
onCleanup(clean);
|
|
670
|
+
}
|
|
671
|
+
return s;
|
|
672
|
+
}
|
|
673
|
+
var FALLBACK = Symbol("fallback");
|
|
674
|
+
function dispose(d) {
|
|
675
|
+
for (let i = 0; i < d.length; i++)
|
|
676
|
+
d[i]();
|
|
677
|
+
}
|
|
678
|
+
function mapArray(list, mapFn, options = {}) {
|
|
679
|
+
let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;
|
|
680
|
+
onCleanup(() => dispose(disposers));
|
|
681
|
+
return () => {
|
|
682
|
+
let newItems = list() || [], i, j;
|
|
683
|
+
newItems[$TRACK];
|
|
684
|
+
return untrack(() => {
|
|
685
|
+
let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;
|
|
686
|
+
if (newLen === 0) {
|
|
687
|
+
if (len !== 0) {
|
|
688
|
+
dispose(disposers);
|
|
689
|
+
disposers = [];
|
|
690
|
+
items = [];
|
|
691
|
+
mapped = [];
|
|
692
|
+
len = 0;
|
|
693
|
+
indexes && (indexes = []);
|
|
694
|
+
}
|
|
695
|
+
if (options.fallback) {
|
|
696
|
+
items = [FALLBACK];
|
|
697
|
+
mapped[0] = createRoot((disposer) => {
|
|
698
|
+
disposers[0] = disposer;
|
|
699
|
+
return options.fallback();
|
|
700
|
+
});
|
|
701
|
+
len = 1;
|
|
702
|
+
}
|
|
703
|
+
} else if (len === 0) {
|
|
704
|
+
mapped = new Array(newLen);
|
|
705
|
+
for (j = 0; j < newLen; j++) {
|
|
706
|
+
items[j] = newItems[j];
|
|
707
|
+
mapped[j] = createRoot(mapper);
|
|
708
|
+
}
|
|
709
|
+
len = newLen;
|
|
710
|
+
} else {
|
|
711
|
+
temp = new Array(newLen);
|
|
712
|
+
tempdisposers = new Array(newLen);
|
|
713
|
+
indexes && (tempIndexes = new Array(newLen));
|
|
714
|
+
for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)
|
|
715
|
+
;
|
|
716
|
+
for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
|
|
717
|
+
temp[newEnd] = mapped[end];
|
|
718
|
+
tempdisposers[newEnd] = disposers[end];
|
|
719
|
+
indexes && (tempIndexes[newEnd] = indexes[end]);
|
|
720
|
+
}
|
|
721
|
+
newIndices = /* @__PURE__ */ new Map();
|
|
722
|
+
newIndicesNext = new Array(newEnd + 1);
|
|
723
|
+
for (j = newEnd; j >= start; j--) {
|
|
724
|
+
item = newItems[j];
|
|
725
|
+
i = newIndices.get(item);
|
|
726
|
+
newIndicesNext[j] = i === void 0 ? -1 : i;
|
|
727
|
+
newIndices.set(item, j);
|
|
728
|
+
}
|
|
729
|
+
for (i = start; i <= end; i++) {
|
|
730
|
+
item = items[i];
|
|
731
|
+
j = newIndices.get(item);
|
|
732
|
+
if (j !== void 0 && j !== -1) {
|
|
733
|
+
temp[j] = mapped[i];
|
|
734
|
+
tempdisposers[j] = disposers[i];
|
|
735
|
+
indexes && (tempIndexes[j] = indexes[i]);
|
|
736
|
+
j = newIndicesNext[j];
|
|
737
|
+
newIndices.set(item, j);
|
|
738
|
+
} else
|
|
739
|
+
disposers[i]();
|
|
740
|
+
}
|
|
741
|
+
for (j = start; j < newLen; j++) {
|
|
742
|
+
if (j in temp) {
|
|
743
|
+
mapped[j] = temp[j];
|
|
744
|
+
disposers[j] = tempdisposers[j];
|
|
745
|
+
if (indexes) {
|
|
746
|
+
indexes[j] = tempIndexes[j];
|
|
747
|
+
indexes[j](j);
|
|
748
|
+
}
|
|
749
|
+
} else
|
|
750
|
+
mapped[j] = createRoot(mapper);
|
|
751
|
+
}
|
|
752
|
+
mapped = mapped.slice(0, len = newLen);
|
|
753
|
+
items = newItems.slice(0);
|
|
754
|
+
}
|
|
755
|
+
return mapped;
|
|
756
|
+
});
|
|
757
|
+
function mapper(disposer) {
|
|
758
|
+
disposers[j] = disposer;
|
|
759
|
+
if (indexes) {
|
|
760
|
+
const [s, set] = createSignal(j);
|
|
761
|
+
indexes[j] = set;
|
|
762
|
+
return mapFn(newItems[j], s);
|
|
763
|
+
}
|
|
764
|
+
return mapFn(newItems[j]);
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
var hydrationEnabled = false;
|
|
769
|
+
function createComponent(Comp, props) {
|
|
770
|
+
if (hydrationEnabled) {
|
|
771
|
+
if (sharedConfig.context) {
|
|
772
|
+
const c = sharedConfig.context;
|
|
773
|
+
setHydrateContext(nextHydrateContext());
|
|
774
|
+
const r = untrack(() => Comp(props || {}));
|
|
775
|
+
setHydrateContext(c);
|
|
776
|
+
return r;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
return untrack(() => Comp(props || {}));
|
|
780
|
+
}
|
|
781
|
+
function trueFn() {
|
|
782
|
+
return true;
|
|
783
|
+
}
|
|
784
|
+
var propTraps = {
|
|
785
|
+
get(_, property, receiver) {
|
|
786
|
+
if (property === $PROXY)
|
|
787
|
+
return receiver;
|
|
788
|
+
return _.get(property);
|
|
789
|
+
},
|
|
790
|
+
has(_, property) {
|
|
791
|
+
if (property === $PROXY)
|
|
792
|
+
return true;
|
|
793
|
+
return _.has(property);
|
|
794
|
+
},
|
|
795
|
+
set: trueFn,
|
|
796
|
+
deleteProperty: trueFn,
|
|
797
|
+
getOwnPropertyDescriptor(_, property) {
|
|
798
|
+
return {
|
|
799
|
+
configurable: true,
|
|
800
|
+
enumerable: true,
|
|
801
|
+
get() {
|
|
802
|
+
return _.get(property);
|
|
803
|
+
},
|
|
804
|
+
set: trueFn,
|
|
805
|
+
deleteProperty: trueFn
|
|
806
|
+
};
|
|
807
|
+
},
|
|
808
|
+
ownKeys(_) {
|
|
809
|
+
return _.keys();
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
function resolveSource(s) {
|
|
813
|
+
return !(s = typeof s === "function" ? s() : s) ? {} : s;
|
|
814
|
+
}
|
|
815
|
+
function mergeProps(...sources) {
|
|
816
|
+
let proxy = false;
|
|
817
|
+
for (let i = 0; i < sources.length; i++) {
|
|
818
|
+
const s = sources[i];
|
|
819
|
+
proxy = proxy || !!s && $PROXY in s;
|
|
820
|
+
sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
|
|
821
|
+
}
|
|
822
|
+
if (proxy) {
|
|
823
|
+
return new Proxy({
|
|
824
|
+
get(property) {
|
|
825
|
+
for (let i = sources.length - 1; i >= 0; i--) {
|
|
826
|
+
const v = resolveSource(sources[i])[property];
|
|
827
|
+
if (v !== void 0)
|
|
828
|
+
return v;
|
|
829
|
+
}
|
|
830
|
+
},
|
|
831
|
+
has(property) {
|
|
832
|
+
for (let i = sources.length - 1; i >= 0; i--) {
|
|
833
|
+
if (property in resolveSource(sources[i]))
|
|
834
|
+
return true;
|
|
835
|
+
}
|
|
836
|
+
return false;
|
|
837
|
+
},
|
|
838
|
+
keys() {
|
|
839
|
+
const keys = [];
|
|
840
|
+
for (let i = 0; i < sources.length; i++)
|
|
841
|
+
keys.push(...Object.keys(resolveSource(sources[i])));
|
|
842
|
+
return [...new Set(keys)];
|
|
843
|
+
}
|
|
844
|
+
}, propTraps);
|
|
845
|
+
}
|
|
846
|
+
const target = {};
|
|
847
|
+
for (let i = sources.length - 1; i >= 0; i--) {
|
|
848
|
+
if (sources[i]) {
|
|
849
|
+
const descriptors = Object.getOwnPropertyDescriptors(sources[i]);
|
|
850
|
+
for (const key in descriptors) {
|
|
851
|
+
if (key in target)
|
|
852
|
+
continue;
|
|
853
|
+
Object.defineProperty(target, key, {
|
|
854
|
+
enumerable: true,
|
|
855
|
+
get() {
|
|
856
|
+
for (let i2 = sources.length - 1; i2 >= 0; i2--) {
|
|
857
|
+
const v = (sources[i2] || {})[key];
|
|
858
|
+
if (v !== void 0)
|
|
859
|
+
return v;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
return target;
|
|
867
|
+
}
|
|
868
|
+
var counter = 0;
|
|
869
|
+
function createUniqueId() {
|
|
870
|
+
const ctx = sharedConfig.context;
|
|
871
|
+
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
872
|
+
}
|
|
873
|
+
var narrowedError = (name) => `Stale read from <${name}>.`;
|
|
874
|
+
function For(props) {
|
|
875
|
+
const fallback = "fallback" in props && {
|
|
876
|
+
fallback: () => props.fallback
|
|
877
|
+
};
|
|
878
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
|
|
879
|
+
}
|
|
880
|
+
function Show(props) {
|
|
881
|
+
const keyed = props.keyed;
|
|
882
|
+
const condition = createMemo(() => props.when, void 0, {
|
|
883
|
+
equals: (a, b) => keyed ? a === b : !a === !b
|
|
884
|
+
});
|
|
885
|
+
return createMemo(() => {
|
|
886
|
+
const c = condition();
|
|
887
|
+
if (c) {
|
|
888
|
+
const child = props.children;
|
|
889
|
+
const fn = typeof child === "function" && child.length > 0;
|
|
890
|
+
return fn ? untrack(() => child(keyed ? c : () => {
|
|
891
|
+
if (!untrack(condition))
|
|
892
|
+
throw narrowedError("Show");
|
|
893
|
+
return props.when;
|
|
894
|
+
})) : child;
|
|
895
|
+
}
|
|
896
|
+
return props.fallback;
|
|
897
|
+
}, void 0, void 0);
|
|
898
|
+
}
|
|
899
|
+
function Switch(props) {
|
|
900
|
+
let keyed = false;
|
|
901
|
+
const equals = (a, b) => a[0] === b[0] && (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
902
|
+
const conditions = children(() => props.children), evalConditions = createMemo(() => {
|
|
903
|
+
let conds = conditions();
|
|
904
|
+
if (!Array.isArray(conds))
|
|
905
|
+
conds = [conds];
|
|
906
|
+
for (let i = 0; i < conds.length; i++) {
|
|
907
|
+
const c = conds[i].when;
|
|
908
|
+
if (c) {
|
|
909
|
+
keyed = !!conds[i].keyed;
|
|
910
|
+
return [i, c, conds[i]];
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
return [-1];
|
|
914
|
+
}, void 0, {
|
|
915
|
+
equals
|
|
916
|
+
});
|
|
917
|
+
return createMemo(() => {
|
|
918
|
+
const [index, when, cond] = evalConditions();
|
|
919
|
+
if (index < 0)
|
|
920
|
+
return props.fallback;
|
|
921
|
+
const c = cond.children;
|
|
922
|
+
const fn = typeof c === "function" && c.length > 0;
|
|
923
|
+
return fn ? untrack(() => c(keyed ? when : () => {
|
|
924
|
+
if (untrack(evalConditions)[0] !== index)
|
|
925
|
+
throw narrowedError("Match");
|
|
926
|
+
return cond.when;
|
|
927
|
+
})) : c;
|
|
928
|
+
}, void 0, void 0);
|
|
929
|
+
}
|
|
930
|
+
function Match(props) {
|
|
931
|
+
return props;
|
|
932
|
+
}
|
|
933
|
+
var SuspenseListContext = createContext();
|
|
934
|
+
|
|
935
|
+
// ../../node_modules/.pnpm/solid-js@1.7.3/node_modules/solid-js/web/dist/web.js
|
|
936
|
+
var booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
937
|
+
var Properties = /* @__PURE__ */ new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
938
|
+
var ChildProperties = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
939
|
+
var Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
940
|
+
className: "class",
|
|
941
|
+
htmlFor: "for"
|
|
942
|
+
});
|
|
943
|
+
var PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
944
|
+
class: "className",
|
|
945
|
+
formnovalidate: {
|
|
946
|
+
$: "formNoValidate",
|
|
947
|
+
BUTTON: 1,
|
|
948
|
+
INPUT: 1
|
|
949
|
+
},
|
|
950
|
+
ismap: {
|
|
951
|
+
$: "isMap",
|
|
952
|
+
IMG: 1
|
|
953
|
+
},
|
|
954
|
+
nomodule: {
|
|
955
|
+
$: "noModule",
|
|
956
|
+
SCRIPT: 1
|
|
957
|
+
},
|
|
958
|
+
playsinline: {
|
|
959
|
+
$: "playsInline",
|
|
960
|
+
VIDEO: 1
|
|
961
|
+
},
|
|
962
|
+
readonly: {
|
|
963
|
+
$: "readOnly",
|
|
964
|
+
INPUT: 1,
|
|
965
|
+
TEXTAREA: 1
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
function getPropAlias(prop, tagName) {
|
|
969
|
+
const a = PropAliases[prop];
|
|
970
|
+
return typeof a === "object" ? a[tagName] ? a["$"] : void 0 : a;
|
|
971
|
+
}
|
|
972
|
+
var DelegatedEvents = /* @__PURE__ */ new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
973
|
+
var SVGNamespace = {
|
|
974
|
+
xlink: "http://www.w3.org/1999/xlink",
|
|
975
|
+
xml: "http://www.w3.org/XML/1998/namespace"
|
|
976
|
+
};
|
|
977
|
+
function reconcileArrays(parentNode, a, b) {
|
|
978
|
+
let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map2 = null;
|
|
979
|
+
while (aStart < aEnd || bStart < bEnd) {
|
|
980
|
+
if (a[aStart] === b[bStart]) {
|
|
981
|
+
aStart++;
|
|
982
|
+
bStart++;
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
while (a[aEnd - 1] === b[bEnd - 1]) {
|
|
986
|
+
aEnd--;
|
|
987
|
+
bEnd--;
|
|
988
|
+
}
|
|
989
|
+
if (aEnd === aStart) {
|
|
990
|
+
const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
|
|
991
|
+
while (bStart < bEnd)
|
|
992
|
+
parentNode.insertBefore(b[bStart++], node);
|
|
993
|
+
} else if (bEnd === bStart) {
|
|
994
|
+
while (aStart < aEnd) {
|
|
995
|
+
if (!map2 || !map2.has(a[aStart]))
|
|
996
|
+
a[aStart].remove();
|
|
997
|
+
aStart++;
|
|
998
|
+
}
|
|
999
|
+
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
1000
|
+
const node = a[--aEnd].nextSibling;
|
|
1001
|
+
parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
|
|
1002
|
+
parentNode.insertBefore(b[--bEnd], node);
|
|
1003
|
+
a[aEnd] = b[bEnd];
|
|
1004
|
+
} else {
|
|
1005
|
+
if (!map2) {
|
|
1006
|
+
map2 = /* @__PURE__ */ new Map();
|
|
1007
|
+
let i = bStart;
|
|
1008
|
+
while (i < bEnd)
|
|
1009
|
+
map2.set(b[i], i++);
|
|
1010
|
+
}
|
|
1011
|
+
const index = map2.get(a[aStart]);
|
|
1012
|
+
if (index != null) {
|
|
1013
|
+
if (bStart < index && index < bEnd) {
|
|
1014
|
+
let i = aStart, sequence = 1, t;
|
|
1015
|
+
while (++i < aEnd && i < bEnd) {
|
|
1016
|
+
if ((t = map2.get(a[i])) == null || t !== index + sequence)
|
|
1017
|
+
break;
|
|
1018
|
+
sequence++;
|
|
1019
|
+
}
|
|
1020
|
+
if (sequence > index - bStart) {
|
|
1021
|
+
const node = a[aStart];
|
|
1022
|
+
while (bStart < index)
|
|
1023
|
+
parentNode.insertBefore(b[bStart++], node);
|
|
1024
|
+
} else
|
|
1025
|
+
parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
1026
|
+
} else
|
|
1027
|
+
aStart++;
|
|
1028
|
+
} else
|
|
1029
|
+
a[aStart++].remove();
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
var $$EVENTS = "_$DX_DELEGATE";
|
|
1034
|
+
function render(code, element, init, options = {}) {
|
|
1035
|
+
let disposer;
|
|
1036
|
+
createRoot((dispose2) => {
|
|
1037
|
+
disposer = dispose2;
|
|
1038
|
+
element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init);
|
|
1039
|
+
}, options.owner);
|
|
1040
|
+
return () => {
|
|
1041
|
+
disposer();
|
|
1042
|
+
element.textContent = "";
|
|
1043
|
+
};
|
|
1044
|
+
}
|
|
1045
|
+
function template(html, isCE, isSVG) {
|
|
1046
|
+
let node;
|
|
1047
|
+
const create = () => {
|
|
1048
|
+
const t = document.createElement("template");
|
|
1049
|
+
t.innerHTML = html;
|
|
1050
|
+
return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
1051
|
+
};
|
|
1052
|
+
const fn = isCE ? () => (node || (node = create())).cloneNode(true) : () => untrack(() => document.importNode(node || (node = create()), true));
|
|
1053
|
+
fn.cloneNode = fn;
|
|
1054
|
+
return fn;
|
|
1055
|
+
}
|
|
1056
|
+
function delegateEvents(eventNames, document2 = window.document) {
|
|
1057
|
+
const e = document2[$$EVENTS] || (document2[$$EVENTS] = /* @__PURE__ */ new Set());
|
|
1058
|
+
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
1059
|
+
const name = eventNames[i];
|
|
1060
|
+
if (!e.has(name)) {
|
|
1061
|
+
e.add(name);
|
|
1062
|
+
document2.addEventListener(name, eventHandler);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
function setAttribute(node, name, value) {
|
|
1067
|
+
if (value == null)
|
|
1068
|
+
node.removeAttribute(name);
|
|
1069
|
+
else
|
|
1070
|
+
node.setAttribute(name, value);
|
|
1071
|
+
}
|
|
1072
|
+
function setAttributeNS(node, namespace, name, value) {
|
|
1073
|
+
if (value == null)
|
|
1074
|
+
node.removeAttributeNS(namespace, name);
|
|
1075
|
+
else
|
|
1076
|
+
node.setAttributeNS(namespace, name, value);
|
|
1077
|
+
}
|
|
1078
|
+
function className(node, value) {
|
|
1079
|
+
if (value == null)
|
|
1080
|
+
node.removeAttribute("class");
|
|
1081
|
+
else
|
|
1082
|
+
node.className = value;
|
|
1083
|
+
}
|
|
1084
|
+
function addEventListener2(node, name, handler, delegate) {
|
|
1085
|
+
if (delegate) {
|
|
1086
|
+
if (Array.isArray(handler)) {
|
|
1087
|
+
node[`$$${name}`] = handler[0];
|
|
1088
|
+
node[`$$${name}Data`] = handler[1];
|
|
1089
|
+
} else
|
|
1090
|
+
node[`$$${name}`] = handler;
|
|
1091
|
+
} else if (Array.isArray(handler)) {
|
|
1092
|
+
const handlerFn = handler[0];
|
|
1093
|
+
node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e));
|
|
1094
|
+
} else
|
|
1095
|
+
node.addEventListener(name, handler);
|
|
1096
|
+
}
|
|
1097
|
+
function classList(node, value, prev = {}) {
|
|
1098
|
+
const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev);
|
|
1099
|
+
let i, len;
|
|
1100
|
+
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
1101
|
+
const key = prevKeys[i];
|
|
1102
|
+
if (!key || key === "undefined" || value[key])
|
|
1103
|
+
continue;
|
|
1104
|
+
toggleClassKey(node, key, false);
|
|
1105
|
+
delete prev[key];
|
|
1106
|
+
}
|
|
1107
|
+
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
1108
|
+
const key = classKeys[i], classValue = !!value[key];
|
|
1109
|
+
if (!key || key === "undefined" || prev[key] === classValue || !classValue)
|
|
1110
|
+
continue;
|
|
1111
|
+
toggleClassKey(node, key, true);
|
|
1112
|
+
prev[key] = classValue;
|
|
1113
|
+
}
|
|
1114
|
+
return prev;
|
|
1115
|
+
}
|
|
1116
|
+
function style(node, value, prev) {
|
|
1117
|
+
if (!value)
|
|
1118
|
+
return prev ? setAttribute(node, "style") : value;
|
|
1119
|
+
const nodeStyle = node.style;
|
|
1120
|
+
if (typeof value === "string")
|
|
1121
|
+
return nodeStyle.cssText = value;
|
|
1122
|
+
typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
|
|
1123
|
+
prev || (prev = {});
|
|
1124
|
+
value || (value = {});
|
|
1125
|
+
let v, s;
|
|
1126
|
+
for (s in prev) {
|
|
1127
|
+
value[s] == null && nodeStyle.removeProperty(s);
|
|
1128
|
+
delete prev[s];
|
|
1129
|
+
}
|
|
1130
|
+
for (s in value) {
|
|
1131
|
+
v = value[s];
|
|
1132
|
+
if (v !== prev[s]) {
|
|
1133
|
+
nodeStyle.setProperty(s, v);
|
|
1134
|
+
prev[s] = v;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
return prev;
|
|
1138
|
+
}
|
|
1139
|
+
function spread(node, props = {}, isSVG, skipChildren) {
|
|
1140
|
+
const prevProps = {};
|
|
1141
|
+
if (!skipChildren) {
|
|
1142
|
+
createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
1143
|
+
}
|
|
1144
|
+
createRenderEffect(() => props.ref && props.ref(node));
|
|
1145
|
+
createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
1146
|
+
return prevProps;
|
|
1147
|
+
}
|
|
1148
|
+
function use(fn, element, arg) {
|
|
1149
|
+
return untrack(() => fn(element, arg));
|
|
1150
|
+
}
|
|
1151
|
+
function insert(parent, accessor, marker, initial) {
|
|
1152
|
+
if (marker !== void 0 && !initial)
|
|
1153
|
+
initial = [];
|
|
1154
|
+
if (typeof accessor !== "function")
|
|
1155
|
+
return insertExpression(parent, accessor, initial, marker);
|
|
1156
|
+
createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial);
|
|
1157
|
+
}
|
|
1158
|
+
function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
|
|
1159
|
+
props || (props = {});
|
|
1160
|
+
for (const prop in prevProps) {
|
|
1161
|
+
if (!(prop in props)) {
|
|
1162
|
+
if (prop === "children")
|
|
1163
|
+
continue;
|
|
1164
|
+
prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
for (const prop in props) {
|
|
1168
|
+
if (prop === "children") {
|
|
1169
|
+
if (!skipChildren)
|
|
1170
|
+
insertExpression(node, props.children);
|
|
1171
|
+
continue;
|
|
1172
|
+
}
|
|
1173
|
+
const value = props[prop];
|
|
1174
|
+
prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
function toPropertyName(name) {
|
|
1178
|
+
return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
|
|
1179
|
+
}
|
|
1180
|
+
function toggleClassKey(node, key, value) {
|
|
1181
|
+
const classNames = key.trim().split(/\s+/);
|
|
1182
|
+
for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
|
|
1183
|
+
node.classList.toggle(classNames[i], value);
|
|
1184
|
+
}
|
|
1185
|
+
function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
1186
|
+
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
1187
|
+
if (prop === "style")
|
|
1188
|
+
return style(node, value, prev);
|
|
1189
|
+
if (prop === "classList")
|
|
1190
|
+
return classList(node, value, prev);
|
|
1191
|
+
if (value === prev)
|
|
1192
|
+
return prev;
|
|
1193
|
+
if (prop === "ref") {
|
|
1194
|
+
if (!skipRef)
|
|
1195
|
+
value(node);
|
|
1196
|
+
} else if (prop.slice(0, 3) === "on:") {
|
|
1197
|
+
const e = prop.slice(3);
|
|
1198
|
+
prev && node.removeEventListener(e, prev);
|
|
1199
|
+
value && node.addEventListener(e, value);
|
|
1200
|
+
} else if (prop.slice(0, 10) === "oncapture:") {
|
|
1201
|
+
const e = prop.slice(10);
|
|
1202
|
+
prev && node.removeEventListener(e, prev, true);
|
|
1203
|
+
value && node.addEventListener(e, value, true);
|
|
1204
|
+
} else if (prop.slice(0, 2) === "on") {
|
|
1205
|
+
const name = prop.slice(2).toLowerCase();
|
|
1206
|
+
const delegate = DelegatedEvents.has(name);
|
|
1207
|
+
if (!delegate && prev) {
|
|
1208
|
+
const h = Array.isArray(prev) ? prev[0] : prev;
|
|
1209
|
+
node.removeEventListener(name, h);
|
|
1210
|
+
}
|
|
1211
|
+
if (delegate || value) {
|
|
1212
|
+
addEventListener2(node, name, value, delegate);
|
|
1213
|
+
delegate && delegateEvents([name]);
|
|
1214
|
+
}
|
|
1215
|
+
} else if (prop.slice(0, 5) === "attr:") {
|
|
1216
|
+
setAttribute(node, prop.slice(5), value);
|
|
1217
|
+
} else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-"))) {
|
|
1218
|
+
if (forceProp) {
|
|
1219
|
+
prop = prop.slice(5);
|
|
1220
|
+
isProp = true;
|
|
1221
|
+
}
|
|
1222
|
+
if (prop === "class" || prop === "className")
|
|
1223
|
+
className(node, value);
|
|
1224
|
+
else if (isCE && !isProp && !isChildProp)
|
|
1225
|
+
node[toPropertyName(prop)] = value;
|
|
1226
|
+
else
|
|
1227
|
+
node[propAlias || prop] = value;
|
|
1228
|
+
} else {
|
|
1229
|
+
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
1230
|
+
if (ns)
|
|
1231
|
+
setAttributeNS(node, ns, prop, value);
|
|
1232
|
+
else
|
|
1233
|
+
setAttribute(node, Aliases[prop] || prop, value);
|
|
1234
|
+
}
|
|
1235
|
+
return value;
|
|
1236
|
+
}
|
|
1237
|
+
function eventHandler(e) {
|
|
1238
|
+
const key = `$$${e.type}`;
|
|
1239
|
+
let node = e.composedPath && e.composedPath()[0] || e.target;
|
|
1240
|
+
if (e.target !== node) {
|
|
1241
|
+
Object.defineProperty(e, "target", {
|
|
1242
|
+
configurable: true,
|
|
1243
|
+
value: node
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
Object.defineProperty(e, "currentTarget", {
|
|
1247
|
+
configurable: true,
|
|
1248
|
+
get() {
|
|
1249
|
+
return node || document;
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1252
|
+
if (sharedConfig.registry && !sharedConfig.done)
|
|
1253
|
+
sharedConfig.done = _$HY.done = true;
|
|
1254
|
+
while (node) {
|
|
1255
|
+
const handler = node[key];
|
|
1256
|
+
if (handler && !node.disabled) {
|
|
1257
|
+
const data = node[`${key}Data`];
|
|
1258
|
+
data !== void 0 ? handler.call(node, data, e) : handler.call(node, e);
|
|
1259
|
+
if (e.cancelBubble)
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
node = node._$host || node.parentNode || node.host;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
1266
|
+
if (sharedConfig.context) {
|
|
1267
|
+
!current && (current = [...parent.childNodes]);
|
|
1268
|
+
let cleaned = [];
|
|
1269
|
+
for (let i = 0; i < current.length; i++) {
|
|
1270
|
+
const node = current[i];
|
|
1271
|
+
if (node.nodeType === 8 && node.data.slice(0, 2) === "!$")
|
|
1272
|
+
node.remove();
|
|
1273
|
+
else
|
|
1274
|
+
cleaned.push(node);
|
|
1275
|
+
}
|
|
1276
|
+
current = cleaned;
|
|
1277
|
+
}
|
|
1278
|
+
while (typeof current === "function")
|
|
1279
|
+
current = current();
|
|
1280
|
+
if (value === current)
|
|
1281
|
+
return current;
|
|
1282
|
+
const t = typeof value, multi = marker !== void 0;
|
|
1283
|
+
parent = multi && current[0] && current[0].parentNode || parent;
|
|
1284
|
+
if (t === "string" || t === "number") {
|
|
1285
|
+
if (sharedConfig.context)
|
|
1286
|
+
return current;
|
|
1287
|
+
if (t === "number")
|
|
1288
|
+
value = value.toString();
|
|
1289
|
+
if (multi) {
|
|
1290
|
+
let node = current[0];
|
|
1291
|
+
if (node && node.nodeType === 3) {
|
|
1292
|
+
node.data = value;
|
|
1293
|
+
} else
|
|
1294
|
+
node = document.createTextNode(value);
|
|
1295
|
+
current = cleanChildren(parent, current, marker, node);
|
|
1296
|
+
} else {
|
|
1297
|
+
if (current !== "" && typeof current === "string") {
|
|
1298
|
+
current = parent.firstChild.data = value;
|
|
1299
|
+
} else
|
|
1300
|
+
current = parent.textContent = value;
|
|
1301
|
+
}
|
|
1302
|
+
} else if (value == null || t === "boolean") {
|
|
1303
|
+
if (sharedConfig.context)
|
|
1304
|
+
return current;
|
|
1305
|
+
current = cleanChildren(parent, current, marker);
|
|
1306
|
+
} else if (t === "function") {
|
|
1307
|
+
createRenderEffect(() => {
|
|
1308
|
+
let v = value();
|
|
1309
|
+
while (typeof v === "function")
|
|
1310
|
+
v = v();
|
|
1311
|
+
current = insertExpression(parent, v, current, marker);
|
|
1312
|
+
});
|
|
1313
|
+
return () => current;
|
|
1314
|
+
} else if (Array.isArray(value)) {
|
|
1315
|
+
const array = [];
|
|
1316
|
+
const currentArray = current && Array.isArray(current);
|
|
1317
|
+
if (normalizeIncomingArray(array, value, current, unwrapArray)) {
|
|
1318
|
+
createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
|
|
1319
|
+
return () => current;
|
|
1320
|
+
}
|
|
1321
|
+
if (sharedConfig.context) {
|
|
1322
|
+
if (!array.length)
|
|
1323
|
+
return current;
|
|
1324
|
+
for (let i = 0; i < array.length; i++) {
|
|
1325
|
+
if (array[i].parentNode)
|
|
1326
|
+
return current = array;
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
if (array.length === 0) {
|
|
1330
|
+
current = cleanChildren(parent, current, marker);
|
|
1331
|
+
if (multi)
|
|
1332
|
+
return current;
|
|
1333
|
+
} else if (currentArray) {
|
|
1334
|
+
if (current.length === 0) {
|
|
1335
|
+
appendNodes(parent, array, marker);
|
|
1336
|
+
} else
|
|
1337
|
+
reconcileArrays(parent, current, array);
|
|
1338
|
+
} else {
|
|
1339
|
+
current && cleanChildren(parent);
|
|
1340
|
+
appendNodes(parent, array);
|
|
1341
|
+
}
|
|
1342
|
+
current = array;
|
|
1343
|
+
} else if (value instanceof Node) {
|
|
1344
|
+
if (sharedConfig.context && value.parentNode)
|
|
1345
|
+
return current = multi ? [value] : value;
|
|
1346
|
+
if (Array.isArray(current)) {
|
|
1347
|
+
if (multi)
|
|
1348
|
+
return current = cleanChildren(parent, current, marker, value);
|
|
1349
|
+
cleanChildren(parent, current, null, value);
|
|
1350
|
+
} else if (current == null || current === "" || !parent.firstChild) {
|
|
1351
|
+
parent.appendChild(value);
|
|
1352
|
+
} else
|
|
1353
|
+
parent.replaceChild(value, parent.firstChild);
|
|
1354
|
+
current = value;
|
|
1355
|
+
} else
|
|
1356
|
+
console.warn(`Unrecognized value. Skipped inserting`, value);
|
|
1357
|
+
return current;
|
|
1358
|
+
}
|
|
1359
|
+
function normalizeIncomingArray(normalized, array, current, unwrap2) {
|
|
1360
|
+
let dynamic = false;
|
|
1361
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
1362
|
+
let item = array[i], prev = current && current[i];
|
|
1363
|
+
if (item instanceof Node) {
|
|
1364
|
+
normalized.push(item);
|
|
1365
|
+
} else if (item == null || item === true || item === false)
|
|
1366
|
+
;
|
|
1367
|
+
else if (Array.isArray(item)) {
|
|
1368
|
+
dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
|
|
1369
|
+
} else if (typeof item === "function") {
|
|
1370
|
+
if (unwrap2) {
|
|
1371
|
+
while (typeof item === "function")
|
|
1372
|
+
item = item();
|
|
1373
|
+
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
1374
|
+
} else {
|
|
1375
|
+
normalized.push(item);
|
|
1376
|
+
dynamic = true;
|
|
1377
|
+
}
|
|
1378
|
+
} else {
|
|
1379
|
+
const value = String(item);
|
|
1380
|
+
if (prev && prev.nodeType === 3) {
|
|
1381
|
+
prev.data = value;
|
|
1382
|
+
normalized.push(prev);
|
|
1383
|
+
} else
|
|
1384
|
+
normalized.push(document.createTextNode(value));
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
return dynamic;
|
|
1388
|
+
}
|
|
1389
|
+
function appendNodes(parent, array, marker = null) {
|
|
1390
|
+
for (let i = 0, len = array.length; i < len; i++)
|
|
1391
|
+
parent.insertBefore(array[i], marker);
|
|
1392
|
+
}
|
|
1393
|
+
function cleanChildren(parent, current, marker, replacement) {
|
|
1394
|
+
if (marker === void 0)
|
|
1395
|
+
return parent.textContent = "";
|
|
1396
|
+
const node = replacement || document.createTextNode("");
|
|
1397
|
+
if (current.length) {
|
|
1398
|
+
let inserted = false;
|
|
1399
|
+
for (let i = current.length - 1; i >= 0; i--) {
|
|
1400
|
+
const el = current[i];
|
|
1401
|
+
if (node !== el) {
|
|
1402
|
+
const isParent = el.parentNode === parent;
|
|
1403
|
+
if (!inserted && !i)
|
|
1404
|
+
isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
|
|
1405
|
+
else
|
|
1406
|
+
isParent && el.remove();
|
|
1407
|
+
} else
|
|
1408
|
+
inserted = true;
|
|
1409
|
+
}
|
|
1410
|
+
} else
|
|
1411
|
+
parent.insertBefore(node, marker);
|
|
1412
|
+
return [node];
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
// ../../node_modules/.pnpm/solid-js@1.7.3/node_modules/solid-js/store/dist/store.js
|
|
1416
|
+
var $RAW = Symbol("store-raw");
|
|
1417
|
+
var $NODE = Symbol("store-node");
|
|
1418
|
+
function wrap$1(value) {
|
|
1419
|
+
let p = value[$PROXY];
|
|
1420
|
+
if (!p) {
|
|
1421
|
+
Object.defineProperty(value, $PROXY, {
|
|
1422
|
+
value: p = new Proxy(value, proxyTraps$1)
|
|
1423
|
+
});
|
|
1424
|
+
if (!Array.isArray(value)) {
|
|
1425
|
+
const keys = Object.keys(value), desc = Object.getOwnPropertyDescriptors(value);
|
|
1426
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
1427
|
+
const prop = keys[i];
|
|
1428
|
+
if (desc[prop].get) {
|
|
1429
|
+
Object.defineProperty(value, prop, {
|
|
1430
|
+
enumerable: desc[prop].enumerable,
|
|
1431
|
+
get: desc[prop].get.bind(p)
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
return p;
|
|
1438
|
+
}
|
|
1439
|
+
function isWrappable(obj) {
|
|
1440
|
+
let proto;
|
|
1441
|
+
return obj != null && typeof obj === "object" && (obj[$PROXY] || !(proto = Object.getPrototypeOf(obj)) || proto === Object.prototype || Array.isArray(obj));
|
|
1442
|
+
}
|
|
1443
|
+
function unwrap(item, set = /* @__PURE__ */ new Set()) {
|
|
1444
|
+
let result, unwrapped, v, prop;
|
|
1445
|
+
if (result = item != null && item[$RAW])
|
|
1446
|
+
return result;
|
|
1447
|
+
if (!isWrappable(item) || set.has(item))
|
|
1448
|
+
return item;
|
|
1449
|
+
if (Array.isArray(item)) {
|
|
1450
|
+
if (Object.isFrozen(item))
|
|
1451
|
+
item = item.slice(0);
|
|
1452
|
+
else
|
|
1453
|
+
set.add(item);
|
|
1454
|
+
for (let i = 0, l = item.length; i < l; i++) {
|
|
1455
|
+
v = item[i];
|
|
1456
|
+
if ((unwrapped = unwrap(v, set)) !== v)
|
|
1457
|
+
item[i] = unwrapped;
|
|
1458
|
+
}
|
|
1459
|
+
} else {
|
|
1460
|
+
if (Object.isFrozen(item))
|
|
1461
|
+
item = Object.assign({}, item);
|
|
1462
|
+
else
|
|
1463
|
+
set.add(item);
|
|
1464
|
+
const keys = Object.keys(item), desc = Object.getOwnPropertyDescriptors(item);
|
|
1465
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
1466
|
+
prop = keys[i];
|
|
1467
|
+
if (desc[prop].get)
|
|
1468
|
+
continue;
|
|
1469
|
+
v = item[prop];
|
|
1470
|
+
if ((unwrapped = unwrap(v, set)) !== v)
|
|
1471
|
+
item[prop] = unwrapped;
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
return item;
|
|
1475
|
+
}
|
|
1476
|
+
function getDataNodes(target) {
|
|
1477
|
+
let nodes = target[$NODE];
|
|
1478
|
+
if (!nodes)
|
|
1479
|
+
Object.defineProperty(target, $NODE, {
|
|
1480
|
+
value: nodes = /* @__PURE__ */ Object.create(null)
|
|
1481
|
+
});
|
|
1482
|
+
return nodes;
|
|
1483
|
+
}
|
|
1484
|
+
function getDataNode(nodes, property, value) {
|
|
1485
|
+
return nodes[property] || (nodes[property] = createDataNode(value));
|
|
1486
|
+
}
|
|
1487
|
+
function proxyDescriptor$1(target, property) {
|
|
1488
|
+
const desc = Reflect.getOwnPropertyDescriptor(target, property);
|
|
1489
|
+
if (!desc || desc.get || !desc.configurable || property === $PROXY || property === $NODE)
|
|
1490
|
+
return desc;
|
|
1491
|
+
delete desc.value;
|
|
1492
|
+
delete desc.writable;
|
|
1493
|
+
desc.get = () => target[$PROXY][property];
|
|
1494
|
+
return desc;
|
|
1495
|
+
}
|
|
1496
|
+
function trackSelf(target) {
|
|
1497
|
+
if (getListener()) {
|
|
1498
|
+
const nodes = getDataNodes(target);
|
|
1499
|
+
(nodes._ || (nodes._ = createDataNode()))();
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
function ownKeys(target) {
|
|
1503
|
+
trackSelf(target);
|
|
1504
|
+
return Reflect.ownKeys(target);
|
|
1505
|
+
}
|
|
1506
|
+
function createDataNode(value) {
|
|
1507
|
+
const [s, set] = createSignal(value, {
|
|
1508
|
+
equals: false,
|
|
1509
|
+
internal: true
|
|
1510
|
+
});
|
|
1511
|
+
s.$ = set;
|
|
1512
|
+
return s;
|
|
1513
|
+
}
|
|
1514
|
+
var proxyTraps$1 = {
|
|
1515
|
+
get(target, property, receiver) {
|
|
1516
|
+
if (property === $RAW)
|
|
1517
|
+
return target;
|
|
1518
|
+
if (property === $PROXY)
|
|
1519
|
+
return receiver;
|
|
1520
|
+
if (property === $TRACK) {
|
|
1521
|
+
trackSelf(target);
|
|
1522
|
+
return receiver;
|
|
1523
|
+
}
|
|
1524
|
+
const nodes = getDataNodes(target);
|
|
1525
|
+
const tracked = nodes[property];
|
|
1526
|
+
let value = tracked ? tracked() : target[property];
|
|
1527
|
+
if (property === $NODE || property === "__proto__")
|
|
1528
|
+
return value;
|
|
1529
|
+
if (!tracked) {
|
|
1530
|
+
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
1531
|
+
if (getListener() && (typeof value !== "function" || target.hasOwnProperty(property)) && !(desc && desc.get))
|
|
1532
|
+
value = getDataNode(nodes, property, value)();
|
|
1533
|
+
}
|
|
1534
|
+
return isWrappable(value) ? wrap$1(value) : value;
|
|
1535
|
+
},
|
|
1536
|
+
has(target, property) {
|
|
1537
|
+
if (property === $RAW || property === $PROXY || property === $TRACK || property === $NODE || property === "__proto__")
|
|
1538
|
+
return true;
|
|
1539
|
+
this.get(target, property, target);
|
|
1540
|
+
return property in target;
|
|
1541
|
+
},
|
|
1542
|
+
set() {
|
|
1543
|
+
return true;
|
|
1544
|
+
},
|
|
1545
|
+
deleteProperty() {
|
|
1546
|
+
return true;
|
|
1547
|
+
},
|
|
1548
|
+
ownKeys,
|
|
1549
|
+
getOwnPropertyDescriptor: proxyDescriptor$1
|
|
1550
|
+
};
|
|
1551
|
+
function setProperty(state, property, value, deleting = false) {
|
|
1552
|
+
if (!deleting && state[property] === value)
|
|
1553
|
+
return;
|
|
1554
|
+
const prev = state[property], len = state.length;
|
|
1555
|
+
if (value === void 0)
|
|
1556
|
+
delete state[property];
|
|
1557
|
+
else
|
|
1558
|
+
state[property] = value;
|
|
1559
|
+
let nodes = getDataNodes(state), node;
|
|
1560
|
+
if (node = getDataNode(nodes, property, prev))
|
|
1561
|
+
node.$(() => value);
|
|
1562
|
+
if (Array.isArray(state) && state.length !== len)
|
|
1563
|
+
(node = getDataNode(nodes, "length", len)) && node.$(state.length);
|
|
1564
|
+
(node = nodes._) && node.$();
|
|
1565
|
+
}
|
|
1566
|
+
function mergeStoreNode(state, value) {
|
|
1567
|
+
const keys = Object.keys(value);
|
|
1568
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
1569
|
+
const key = keys[i];
|
|
1570
|
+
setProperty(state, key, value[key]);
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
function updateArray(current, next) {
|
|
1574
|
+
if (typeof next === "function")
|
|
1575
|
+
next = next(current);
|
|
1576
|
+
next = unwrap(next);
|
|
1577
|
+
if (Array.isArray(next)) {
|
|
1578
|
+
if (current === next)
|
|
1579
|
+
return;
|
|
1580
|
+
let i = 0, len = next.length;
|
|
1581
|
+
for (; i < len; i++) {
|
|
1582
|
+
const value = next[i];
|
|
1583
|
+
if (current[i] !== value)
|
|
1584
|
+
setProperty(current, i, value);
|
|
1585
|
+
}
|
|
1586
|
+
setProperty(current, "length", len);
|
|
1587
|
+
} else
|
|
1588
|
+
mergeStoreNode(current, next);
|
|
1589
|
+
}
|
|
1590
|
+
function updatePath(current, path, traversed = []) {
|
|
1591
|
+
let part, prev = current;
|
|
1592
|
+
if (path.length > 1) {
|
|
1593
|
+
part = path.shift();
|
|
1594
|
+
const partType = typeof part, isArray = Array.isArray(current);
|
|
1595
|
+
if (Array.isArray(part)) {
|
|
1596
|
+
for (let i = 0; i < part.length; i++) {
|
|
1597
|
+
updatePath(current, [part[i]].concat(path), traversed);
|
|
1598
|
+
}
|
|
1599
|
+
return;
|
|
1600
|
+
} else if (isArray && partType === "function") {
|
|
1601
|
+
for (let i = 0; i < current.length; i++) {
|
|
1602
|
+
if (part(current[i], i))
|
|
1603
|
+
updatePath(current, [i].concat(path), traversed);
|
|
1604
|
+
}
|
|
1605
|
+
return;
|
|
1606
|
+
} else if (isArray && partType === "object") {
|
|
1607
|
+
const {
|
|
1608
|
+
from: from2 = 0,
|
|
1609
|
+
to = current.length - 1,
|
|
1610
|
+
by = 1
|
|
1611
|
+
} = part;
|
|
1612
|
+
for (let i = from2; i <= to; i += by) {
|
|
1613
|
+
updatePath(current, [i].concat(path), traversed);
|
|
1614
|
+
}
|
|
1615
|
+
return;
|
|
1616
|
+
} else if (path.length > 1) {
|
|
1617
|
+
updatePath(current[part], path, [part].concat(traversed));
|
|
1618
|
+
return;
|
|
1619
|
+
}
|
|
1620
|
+
prev = current[part];
|
|
1621
|
+
traversed = [part].concat(traversed);
|
|
1622
|
+
}
|
|
1623
|
+
let value = path[0];
|
|
1624
|
+
if (typeof value === "function") {
|
|
1625
|
+
value = value(prev, traversed);
|
|
1626
|
+
if (value === prev)
|
|
1627
|
+
return;
|
|
1628
|
+
}
|
|
1629
|
+
if (part === void 0 && value == void 0)
|
|
1630
|
+
return;
|
|
1631
|
+
value = unwrap(value);
|
|
1632
|
+
if (part === void 0 || isWrappable(prev) && isWrappable(value) && !Array.isArray(value)) {
|
|
1633
|
+
mergeStoreNode(prev, value);
|
|
1634
|
+
} else
|
|
1635
|
+
setProperty(current, part, value);
|
|
1636
|
+
}
|
|
1637
|
+
function createStore(...[store, options]) {
|
|
1638
|
+
const unwrappedStore = unwrap(store || {});
|
|
1639
|
+
const isArray = Array.isArray(unwrappedStore);
|
|
1640
|
+
const wrappedStore = wrap$1(unwrappedStore);
|
|
1641
|
+
function setStore(...args) {
|
|
1642
|
+
batch(() => {
|
|
1643
|
+
isArray && args.length === 1 ? updateArray(unwrappedStore, args[0]) : updatePath(unwrappedStore, args);
|
|
1644
|
+
});
|
|
1645
|
+
}
|
|
1646
|
+
return [wrappedStore, setStore];
|
|
1647
|
+
}
|
|
1648
|
+
var $ROOT = Symbol("store-root");
|
|
4
1649
|
|
|
5
1650
|
// src/utils.ts
|
|
6
1651
|
var capitalize = (str) => {
|
|
@@ -62,12 +1707,19 @@ var findLast = (array, fn) => {
|
|
|
62
1707
|
}
|
|
63
1708
|
return;
|
|
64
1709
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
1710
|
+
var simple = (fn) => {
|
|
1711
|
+
return (...args) => {
|
|
1712
|
+
let result;
|
|
1713
|
+
batch(() => {
|
|
1714
|
+
untrack(() => {
|
|
1715
|
+
result = fn(...args);
|
|
1716
|
+
});
|
|
1717
|
+
});
|
|
1718
|
+
return result;
|
|
1719
|
+
};
|
|
1720
|
+
};
|
|
68
1721
|
|
|
69
1722
|
// src/hooks/useMedia.ts
|
|
70
|
-
import { createSignal, onCleanup } from "solid-js";
|
|
71
1723
|
var useMedia = (media) => {
|
|
72
1724
|
const mq = matchMedia(media);
|
|
73
1725
|
const [matches, setMatches] = createSignal(mq.matches);
|
|
@@ -85,9 +1737,12 @@ var useMedia = (media) => {
|
|
|
85
1737
|
var Context = createContext();
|
|
86
1738
|
var Provider = (props) => {
|
|
87
1739
|
const storeData = from(props.storeData);
|
|
1740
|
+
const coreData = from(props.coreData);
|
|
88
1741
|
const value = {
|
|
89
1742
|
storeData,
|
|
90
1743
|
storeDataUpdate: props.storeData.update,
|
|
1744
|
+
coreData,
|
|
1745
|
+
coreDataUpdate: props.coreData.update,
|
|
91
1746
|
options: props.options,
|
|
92
1747
|
renderer: props.renderer,
|
|
93
1748
|
t(key) {
|
|
@@ -97,16 +1752,28 @@ var Provider = (props) => {
|
|
|
97
1752
|
hyperWide: useMedia("(max-aspect-ratio: 0.26)")
|
|
98
1753
|
}
|
|
99
1754
|
};
|
|
100
|
-
return
|
|
1755
|
+
return createComponent(Context.Provider, {
|
|
1756
|
+
value,
|
|
1757
|
+
get children() {
|
|
1758
|
+
return createComponent(Show, {
|
|
1759
|
+
get when() {
|
|
1760
|
+
return storeData();
|
|
1761
|
+
},
|
|
1762
|
+
get children() {
|
|
1763
|
+
return props.children;
|
|
1764
|
+
}
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
});
|
|
101
1768
|
};
|
|
102
1769
|
var useData = () => {
|
|
103
1770
|
return useContext(Context);
|
|
104
1771
|
};
|
|
105
1772
|
|
|
106
1773
|
// src/screens/custom-screen.tsx
|
|
107
|
-
|
|
1774
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div class="root custom">`);
|
|
108
1775
|
var CustomScreen = (props) => {
|
|
109
|
-
const [dom, setDOM] =
|
|
1776
|
+
const [dom, setDOM] = createSignal(null);
|
|
110
1777
|
let unmount;
|
|
111
1778
|
createEffect(() => {
|
|
112
1779
|
if (unmount)
|
|
@@ -120,166 +1787,196 @@ var CustomScreen = (props) => {
|
|
|
120
1787
|
setDOM(null);
|
|
121
1788
|
unmount = void 0;
|
|
122
1789
|
});
|
|
123
|
-
const onClick = ({
|
|
1790
|
+
const onClick = ({
|
|
1791
|
+
target
|
|
1792
|
+
}) => {
|
|
124
1793
|
if (target instanceof HTMLElement && target.dataset.novelyGoto) {
|
|
125
1794
|
props.setState("screen", target.dataset.novelyGoto);
|
|
126
1795
|
}
|
|
127
1796
|
};
|
|
128
|
-
return
|
|
1797
|
+
return createComponent(Show, {
|
|
1798
|
+
get when() {
|
|
1799
|
+
return dom();
|
|
1800
|
+
},
|
|
1801
|
+
get children() {
|
|
1802
|
+
const _el$ = _tmpl$();
|
|
1803
|
+
_el$.$$click = onClick;
|
|
1804
|
+
insert(_el$, dom);
|
|
1805
|
+
return _el$;
|
|
1806
|
+
}
|
|
1807
|
+
});
|
|
129
1808
|
};
|
|
130
|
-
|
|
131
|
-
// src/screens/game.tsx
|
|
132
|
-
import { createSignal as createSignal4, untrack as untrack3, For, Show as Show5, createUniqueId, createEffect as createEffect4 } from "solid-js";
|
|
1809
|
+
delegateEvents(["click"]);
|
|
133
1810
|
|
|
134
1811
|
// src/components/Character.tsx
|
|
135
|
-
import { setAttribute, effect } from "solid-js/web";
|
|
136
1812
|
var Character = (props) => {
|
|
137
1813
|
const canvas = () => props.characters[props.character].canvas;
|
|
138
|
-
|
|
139
|
-
return
|
|
1814
|
+
createRenderEffect(() => setAttribute(canvas(), "style", props.data.style));
|
|
1815
|
+
return createMemo(canvas);
|
|
140
1816
|
};
|
|
141
1817
|
|
|
142
1818
|
// src/components/ControlPanelButtons.tsx
|
|
143
|
-
|
|
1819
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button"><span class="control-panel__button__content">`);
|
|
1820
|
+
var _tmpl$22 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button control-panel__button--auto-mode">`);
|
|
1821
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button">`);
|
|
144
1822
|
var ControlPanelButtons = (props) => {
|
|
145
1823
|
const data = useData();
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
1824
|
+
return [(() => {
|
|
1825
|
+
const _el$ = _tmpl$2(), _el$2 = _el$.firstChild;
|
|
1826
|
+
addEventListener2(_el$, "click", data.options.back, true);
|
|
1827
|
+
insert(_el$2, () => data.t("GoBack"));
|
|
1828
|
+
insert(_el$, createComponent(Icon, {
|
|
1829
|
+
"class": "control-panel__button__icon",
|
|
1830
|
+
get children() {
|
|
1831
|
+
return Icon.Back();
|
|
1832
|
+
}
|
|
1833
|
+
}), null);
|
|
1834
|
+
createRenderEffect(() => setAttribute(_el$, "title", data.t("GoBack")));
|
|
1835
|
+
return _el$;
|
|
1836
|
+
})(), (() => {
|
|
1837
|
+
const _el$3 = _tmpl$2(), _el$4 = _el$3.firstChild;
|
|
1838
|
+
_el$3.$$click = () => {
|
|
1839
|
+
data.options.save(false, "manual");
|
|
1840
|
+
};
|
|
1841
|
+
insert(_el$4, () => data.t("DoSave"));
|
|
1842
|
+
insert(_el$3, createComponent(Icon, {
|
|
1843
|
+
"class": "control-panel__button__icon",
|
|
1844
|
+
get children() {
|
|
1845
|
+
return Icon.Save();
|
|
1846
|
+
}
|
|
1847
|
+
}), null);
|
|
1848
|
+
createRenderEffect(() => setAttribute(_el$3, "title", data.t("DoSave")));
|
|
1849
|
+
return _el$3;
|
|
1850
|
+
})(), (() => {
|
|
1851
|
+
const _el$5 = _tmpl$22();
|
|
1852
|
+
_el$5.$$click = () => {
|
|
1853
|
+
props.setAuto((prev) => !prev);
|
|
1854
|
+
};
|
|
1855
|
+
insert(_el$5, () => data.t(props.auto() ? "Stop" : "Auto"));
|
|
1856
|
+
createRenderEffect(() => setAttribute(_el$5, "title", data.t(props.auto() ? "Stop" : "Auto")));
|
|
1857
|
+
return _el$5;
|
|
1858
|
+
})(), (() => {
|
|
1859
|
+
const _el$6 = _tmpl$2(), _el$7 = _el$6.firstChild;
|
|
1860
|
+
_el$6.$$click = () => {
|
|
1861
|
+
data.options.save(false, "auto");
|
|
1862
|
+
props.openSettings();
|
|
1863
|
+
};
|
|
1864
|
+
insert(_el$7, () => data.t("Settings"));
|
|
1865
|
+
insert(_el$6, createComponent(Icon, {
|
|
1866
|
+
"class": "control-panel__button__icon",
|
|
1867
|
+
get children() {
|
|
1868
|
+
return Icon.Settings();
|
|
1869
|
+
}
|
|
1870
|
+
}), null);
|
|
1871
|
+
createRenderEffect(() => setAttribute(_el$6, "title", data.t("Settings")));
|
|
1872
|
+
return _el$6;
|
|
1873
|
+
})(), (() => {
|
|
1874
|
+
const _el$8 = _tmpl$2(), _el$9 = _el$8.firstChild;
|
|
1875
|
+
_el$8.$$click = () => {
|
|
1876
|
+
data.options.exit();
|
|
1877
|
+
};
|
|
1878
|
+
insert(_el$9, () => data.t("Exit"));
|
|
1879
|
+
insert(_el$8, createComponent(Icon, {
|
|
1880
|
+
"class": "control-panel__button__icon",
|
|
1881
|
+
get children() {
|
|
1882
|
+
return Icon.Exit();
|
|
1883
|
+
}
|
|
1884
|
+
}), null);
|
|
1885
|
+
createRenderEffect(() => setAttribute(_el$8, "title", data.t("Exit")));
|
|
1886
|
+
return _el$8;
|
|
1887
|
+
})(), createComponent(Show, {
|
|
1888
|
+
get when() {
|
|
1889
|
+
return data.media.hyperWide();
|
|
1890
|
+
},
|
|
1891
|
+
get children() {
|
|
1892
|
+
const _el$10 = _tmpl$3();
|
|
1893
|
+
_el$10.$$click = () => {
|
|
209
1894
|
props.closeDropdown();
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
1895
|
+
};
|
|
1896
|
+
insert(_el$10, createComponent(Icon, {
|
|
1897
|
+
get children() {
|
|
1898
|
+
return Icon.Close();
|
|
1899
|
+
}
|
|
1900
|
+
}));
|
|
1901
|
+
createRenderEffect(() => setAttribute(_el$10, "title", data.t("CloseMenu")));
|
|
1902
|
+
return _el$10;
|
|
1903
|
+
}
|
|
1904
|
+
})];
|
|
213
1905
|
};
|
|
1906
|
+
delegateEvents(["click"]);
|
|
214
1907
|
|
|
215
1908
|
// src/components/DialogName.tsx
|
|
1909
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<span class="action-dialog-name">`);
|
|
216
1910
|
var DialogName = (props) => {
|
|
217
1911
|
const color = () => {
|
|
218
1912
|
const c = props.character;
|
|
219
1913
|
const cs = props.characters;
|
|
220
1914
|
return c ? c in cs ? cs[c].color : "#000" : "#000";
|
|
221
1915
|
};
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
1916
|
+
return (() => {
|
|
1917
|
+
const _el$ = _tmpl$4();
|
|
1918
|
+
insert(_el$, () => props.name || " ");
|
|
1919
|
+
createRenderEffect((_p$) => {
|
|
1920
|
+
const _v$ = color(), _v$2 = props.character ? 1 : 0, _v$3 = props.character ? "visible" : "hidden";
|
|
1921
|
+
_v$ !== _p$._v$ && ((_p$._v$ = _v$) != null ? _el$.style.setProperty("color", _v$) : _el$.style.removeProperty("color"));
|
|
1922
|
+
_v$2 !== _p$._v$2 && ((_p$._v$2 = _v$2) != null ? _el$.style.setProperty("opacity", _v$2) : _el$.style.removeProperty("opacity"));
|
|
1923
|
+
_v$3 !== _p$._v$3 && ((_p$._v$3 = _v$3) != null ? _el$.style.setProperty("visibility", _v$3) : _el$.style.removeProperty("visibility"));
|
|
1924
|
+
return _p$;
|
|
1925
|
+
}, {
|
|
1926
|
+
_v$: void 0,
|
|
1927
|
+
_v$2: void 0,
|
|
1928
|
+
_v$3: void 0
|
|
1929
|
+
});
|
|
1930
|
+
return _el$;
|
|
1931
|
+
})();
|
|
230
1932
|
};
|
|
231
1933
|
|
|
232
1934
|
// src/components/Icon.tsx
|
|
1935
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5">`);
|
|
1936
|
+
var _tmpl$23 = /* @__PURE__ */ template(`<svg><path d="m9.75 12 8.5-6.25v12.5L9.75 12ZM5.75 5.75v12.5"></svg>`, false, true);
|
|
1937
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<svg><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"></svg>`, false, true);
|
|
1938
|
+
var _tmpl$42 = /* @__PURE__ */ template(`<svg><path d="M8.75 19v-3.25a1 1 0 0 1 1-1h4.5a1 1 0 0 1 1 1V19M8.75 5v3.25"></svg>`, false, true);
|
|
1939
|
+
var _tmpl$52 = /* @__PURE__ */ template(`<svg><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"></svg>`, false, true);
|
|
1940
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<svg><path d="M13.25 12a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Z"></svg>`, false, true);
|
|
1941
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<svg><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"></svg>`, false, true);
|
|
1942
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<svg><path d="M4.75 5.75h14.5M4.75 18.25h14.5M4.75 12h14.5"></svg>`, false, true);
|
|
1943
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<svg><path d="m17.25 6.75-10.5 10.5M6.75 6.75l10.5 10.5"></svg>`, false, true);
|
|
233
1944
|
var Icon = (props) => {
|
|
234
|
-
return
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
stroke-linecap="round"
|
|
241
|
-
stroke-linejoin="round"
|
|
242
|
-
stroke-width="1.5"
|
|
243
|
-
{...props}
|
|
244
|
-
>{props.children}</svg>;
|
|
1945
|
+
return (() => {
|
|
1946
|
+
const _el$ = _tmpl$5();
|
|
1947
|
+
spread(_el$, props, true, true);
|
|
1948
|
+
insert(_el$, () => props.children);
|
|
1949
|
+
return _el$;
|
|
1950
|
+
})();
|
|
245
1951
|
};
|
|
246
1952
|
Icon.Back = () => {
|
|
247
|
-
return
|
|
1953
|
+
return _tmpl$23();
|
|
248
1954
|
};
|
|
249
1955
|
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
|
-
</>;
|
|
1956
|
+
return [_tmpl$32(), _tmpl$42()];
|
|
254
1957
|
};
|
|
255
1958
|
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
|
-
</>;
|
|
1959
|
+
return [_tmpl$52(), _tmpl$6()];
|
|
260
1960
|
};
|
|
261
1961
|
Icon.Exit = () => {
|
|
262
|
-
return
|
|
1962
|
+
return _tmpl$7();
|
|
263
1963
|
};
|
|
264
1964
|
Icon.Menu = () => {
|
|
265
|
-
return
|
|
1965
|
+
return _tmpl$8();
|
|
266
1966
|
};
|
|
267
1967
|
Icon.Close = () => {
|
|
268
|
-
return
|
|
1968
|
+
return _tmpl$9();
|
|
269
1969
|
};
|
|
270
1970
|
|
|
271
|
-
// src/components/Modal.tsx
|
|
272
|
-
import { untrack, createEffect as createEffect2, on, onCleanup as onCleanup3, Show as Show4 } from "solid-js";
|
|
273
|
-
|
|
274
1971
|
// src/actions.ts
|
|
275
|
-
import { onCleanup as onCleanup2 } from "solid-js";
|
|
276
1972
|
var clickOutside = (node, handler) => {
|
|
277
1973
|
const handleClick = (event) => node && !node.contains(event.target) && !event.defaultPrevented && handler && handler();
|
|
278
1974
|
document.addEventListener("click", handleClick, true);
|
|
279
|
-
|
|
1975
|
+
onCleanup(() => document.removeEventListener("click", handleClick, true));
|
|
280
1976
|
};
|
|
281
1977
|
|
|
282
1978
|
// src/components/Modal.tsx
|
|
1979
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div role="dialog" class="dialog">`);
|
|
283
1980
|
var Modal = (props) => {
|
|
284
1981
|
let modalWindow;
|
|
285
1982
|
const handleKeydown = (event) => {
|
|
@@ -305,23 +2002,28 @@ var Modal = (props) => {
|
|
|
305
2002
|
props.setIsOpen && props.setIsOpen(false);
|
|
306
2003
|
props.onClose && untrack(props.onClose);
|
|
307
2004
|
};
|
|
308
|
-
|
|
2005
|
+
createEffect(on(props.isOpen, (isOpen) => isOpen && props.onClose && untrack(props.onClose), {
|
|
2006
|
+
defer: true
|
|
2007
|
+
}));
|
|
309
2008
|
addEventListener("keydown", handleKeydown);
|
|
310
|
-
|
|
311
|
-
return
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
2009
|
+
onCleanup(() => removeEventListener("keydown", handleKeydown));
|
|
2010
|
+
return createComponent(Show, {
|
|
2011
|
+
get when() {
|
|
2012
|
+
return props.isOpen();
|
|
2013
|
+
},
|
|
2014
|
+
get children() {
|
|
2015
|
+
const _el$ = _tmpl$10();
|
|
2016
|
+
use((element) => {
|
|
2017
|
+
modalWindow = element;
|
|
2018
|
+
clickOutside(element, close);
|
|
2019
|
+
}, _el$);
|
|
2020
|
+
setAttribute(_el$, "aria-modal", true);
|
|
2021
|
+
insert(_el$, () => props.children);
|
|
2022
|
+
return _el$;
|
|
2023
|
+
}
|
|
2024
|
+
});
|
|
320
2025
|
};
|
|
321
2026
|
|
|
322
|
-
// src/components/Typewriter.tsx
|
|
323
|
-
import { untrack as untrack2, createEffect as createEffect3, onCleanup as onCleanup4, createSignal as createSignal3 } from "solid-js";
|
|
324
|
-
|
|
325
2027
|
// ../typewriter/dist/index.js
|
|
326
2028
|
var defaultSpeed = () => {
|
|
327
2029
|
return Math.min(90 * Math.random() + 100, 90);
|
|
@@ -442,14 +2144,17 @@ var TEXT_SPEED_MAP = {
|
|
|
442
2144
|
};
|
|
443
2145
|
|
|
444
2146
|
// src/components/Typewriter.tsx
|
|
2147
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<span>`);
|
|
445
2148
|
var PRM = matchMedia("(prefers-reduced-motion: reduce)");
|
|
446
|
-
var createTypewriter = ({
|
|
2149
|
+
var createTypewriter = ({
|
|
2150
|
+
resolve
|
|
2151
|
+
}) => {
|
|
447
2152
|
let bypassed = false;
|
|
448
2153
|
let typewriter2;
|
|
449
|
-
const [state, setState] =
|
|
2154
|
+
const [state, setState] = createSignal("idle");
|
|
450
2155
|
const Typewriter = (props) => {
|
|
451
2156
|
let node;
|
|
452
|
-
|
|
2157
|
+
createEffect(() => {
|
|
453
2158
|
const text = props.content;
|
|
454
2159
|
typewriter2?.destroy();
|
|
455
2160
|
setState("idle");
|
|
@@ -457,7 +2162,7 @@ var createTypewriter = ({ resolve }) => {
|
|
|
457
2162
|
return;
|
|
458
2163
|
if (!node)
|
|
459
2164
|
return;
|
|
460
|
-
if (PRM.matches ||
|
|
2165
|
+
if (PRM.matches || untrack(() => props.ignore)) {
|
|
461
2166
|
node.innerHTML = text;
|
|
462
2167
|
bypassed = true;
|
|
463
2168
|
setState("done");
|
|
@@ -469,18 +2174,24 @@ var createTypewriter = ({ resolve }) => {
|
|
|
469
2174
|
text,
|
|
470
2175
|
ended() {
|
|
471
2176
|
setState("done");
|
|
472
|
-
|
|
2177
|
+
untrack(() => props.ended(PRM.matches));
|
|
473
2178
|
},
|
|
474
|
-
speed: TEXT_SPEED_MAP[
|
|
2179
|
+
speed: TEXT_SPEED_MAP[untrack(() => props.speed)]
|
|
475
2180
|
});
|
|
476
2181
|
bypassed = false;
|
|
477
2182
|
});
|
|
478
|
-
|
|
2183
|
+
onCleanup(() => {
|
|
479
2184
|
setState("idle");
|
|
480
2185
|
typewriter2?.destroy();
|
|
481
2186
|
bypassed = false;
|
|
482
2187
|
});
|
|
483
|
-
return
|
|
2188
|
+
return (() => {
|
|
2189
|
+
const _el$ = _tmpl$11();
|
|
2190
|
+
const _ref$ = node;
|
|
2191
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : node = _el$;
|
|
2192
|
+
spread(_el$, mergeProps(() => props.attributes), false, false);
|
|
2193
|
+
return _el$;
|
|
2194
|
+
})();
|
|
484
2195
|
};
|
|
485
2196
|
const clear = () => {
|
|
486
2197
|
const reduced = PRM.matches;
|
|
@@ -501,9 +2212,24 @@ var createTypewriter = ({ resolve }) => {
|
|
|
501
2212
|
};
|
|
502
2213
|
|
|
503
2214
|
// src/screens/game.tsx
|
|
2215
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<div class="dialog-container"><span class="dialog-fix" aria-hidden="true">​</span><div class="dialog-panel"><span class="dialog-panel-label">`);
|
|
2216
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<div class="dialog-container"><span class="dialog-fix" aria-hidden="true">​</span><div class="dialog-panel input-dialog-panel"><label for="novely-input" class="input-dialog-label"><span></span><span aria-live="polite" aria-atomic="true"></span></label><button type="submit" class="button dialog-input__button">`);
|
|
2217
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<div class="dialog-container"><span class="dialog-fix" aria-hidden="true">​</span><div class="dialog-backdrop"></div><div class="dialog-panel exit-dialog-panel"><span class="dialog-panel-label"></span><div class="exit-dialog-panel-buttons"><button type="button" class="button"></button><button type="button" class="button">`);
|
|
2218
|
+
var _tmpl$43 = /* @__PURE__ */ template(`<button type="button" class="button control-panel__button">`);
|
|
2219
|
+
var _tmpl$53 = /* @__PURE__ */ template(`<span class="control-panel-container-fix" aria-hidden="true">​`);
|
|
2220
|
+
var _tmpl$62 = /* @__PURE__ */ template(`<div class="control-panel-container-backdrop">`);
|
|
2221
|
+
var _tmpl$72 = /* @__PURE__ */ template(`<div class="root game"><div class="characters"></div><div class="action-dialog"><div class="action-dialog-container" role="button" tabindex="0"><div class="action-dialog-person"></div><div class="action-dialog-content"></div></div></div><div></div><div class="action-text" role="button" tabindex="0"></div><div class="control-panel"><div role="menubar" class="control-panel-container">`);
|
|
2222
|
+
var _tmpl$82 = /* @__PURE__ */ template(`<button type="button" class="button">`);
|
|
504
2223
|
var Game = (props) => {
|
|
505
2224
|
const data = useData();
|
|
506
|
-
const {
|
|
2225
|
+
const {
|
|
2226
|
+
setState,
|
|
2227
|
+
characters,
|
|
2228
|
+
store,
|
|
2229
|
+
renderer,
|
|
2230
|
+
controls,
|
|
2231
|
+
skipTypewriterWhenGoingBack
|
|
2232
|
+
} = props;
|
|
507
2233
|
const background = () => {
|
|
508
2234
|
const is = isCSSImage(props.state.background);
|
|
509
2235
|
return {
|
|
@@ -511,7 +2237,7 @@ var Game = (props) => {
|
|
|
511
2237
|
"background-color": is ? void 0 : props.state.background
|
|
512
2238
|
};
|
|
513
2239
|
};
|
|
514
|
-
const [auto, setAuto] =
|
|
2240
|
+
const [auto, setAuto] = createSignal(false);
|
|
515
2241
|
const onChoicesButtonClick = ([disabled, i]) => {
|
|
516
2242
|
if (disabled)
|
|
517
2243
|
return;
|
|
@@ -543,20 +2269,23 @@ var Game = (props) => {
|
|
|
543
2269
|
const speed = () => data.storeData().meta[1];
|
|
544
2270
|
const onWriterEnd = (cb) => {
|
|
545
2271
|
return (prm) => {
|
|
546
|
-
const next =
|
|
2272
|
+
const next = untrack(auto);
|
|
547
2273
|
if (!next)
|
|
548
2274
|
return;
|
|
549
2275
|
if (prm) {
|
|
550
2276
|
setAuto(false);
|
|
551
2277
|
} else {
|
|
552
|
-
|
|
2278
|
+
untrack(cb);
|
|
553
2279
|
}
|
|
554
2280
|
};
|
|
555
2281
|
};
|
|
556
2282
|
const TextWriter = createTypewriter({
|
|
557
2283
|
resolve() {
|
|
558
2284
|
const resolve = props.state.text.resolve;
|
|
559
|
-
setState("text", {
|
|
2285
|
+
setState("text", {
|
|
2286
|
+
content: "",
|
|
2287
|
+
resolve: void 0
|
|
2288
|
+
});
|
|
560
2289
|
resolve();
|
|
561
2290
|
}
|
|
562
2291
|
});
|
|
@@ -575,218 +2304,321 @@ var Game = (props) => {
|
|
|
575
2304
|
}
|
|
576
2305
|
});
|
|
577
2306
|
const controlPanelMenuID = createUniqueId();
|
|
578
|
-
const [controlPanelMenuExpanded, setControlPanelMenuExpanded] =
|
|
579
|
-
|
|
2307
|
+
const [controlPanelMenuExpanded, setControlPanelMenuExpanded] = createSignal(false);
|
|
2308
|
+
createEffect(() => {
|
|
580
2309
|
if (!data.media.hyperWide()) {
|
|
581
2310
|
setControlPanelMenuExpanded(false);
|
|
582
2311
|
}
|
|
583
2312
|
});
|
|
584
|
-
return
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
aria-disabled={!props.state.dialog.content}
|
|
602
|
-
role="button"
|
|
603
|
-
tabIndex={0}
|
|
604
|
-
onClick={DialogWriter.clear}
|
|
605
|
-
onKeyPress={onKey(DialogWriter.clear, "Enter")}
|
|
606
|
-
onKeyDown={onKey(DialogWriter.clear, " ")}
|
|
607
|
-
>
|
|
608
|
-
<div class="action-dialog-person"><Show5 when={props.state.dialog.emotion} keyed>{(emotion) => {
|
|
609
|
-
const character = props.state.dialog.character;
|
|
610
|
-
if (!character)
|
|
611
|
-
return null;
|
|
612
|
-
if (!store["characters"][character] || !store["characters"][character]["emotions"][emotion]) {
|
|
613
|
-
renderer.character(character).withEmotion(emotion);
|
|
614
|
-
}
|
|
615
|
-
const image = store["characters"][character]["emotions"][emotion];
|
|
616
|
-
if ("src" in image)
|
|
617
|
-
return image;
|
|
618
|
-
const [canvas] = canvasDrawImages(void 0, void 0, Object.values(image));
|
|
619
|
-
return canvas;
|
|
620
|
-
}}</Show5></div>
|
|
621
|
-
<div class="action-dialog-content"><DialogWriter.Typewriter
|
|
622
|
-
attributes={{
|
|
623
|
-
title: DialogWriter.state() === "idle" ? void 0 : data.t(DialogWriter.state() === "processing" ? "CompleteText" : "GoForward")
|
|
624
|
-
}}
|
|
625
|
-
content={props.state.dialog.content}
|
|
626
|
-
ignore={skipTypewriterWhenGoingBack && props.state.dialog.goingBack}
|
|
627
|
-
speed={speed()}
|
|
628
|
-
ended={onWriterEnd(DialogWriter.clear)}
|
|
629
|
-
/></div>
|
|
630
|
-
</div>
|
|
631
|
-
</div>
|
|
632
|
-
<Modal isOpen={() => props.state.choices.visible} trapFocus={() => !props.state.exitPromptShown}><div class="dialog-container">
|
|
633
|
-
<span class="dialog-fix" aria-hidden="true"></span>
|
|
634
|
-
<div class="dialog-panel">
|
|
635
|
-
<span
|
|
636
|
-
class="dialog-panel-label"
|
|
637
|
-
data-used={Boolean(props.state.choices.question)}
|
|
638
|
-
aria-hidden={!props.state.choices.question}
|
|
639
|
-
>{props.state.choices.question || <> </>}</span>
|
|
640
|
-
<For each={props.state.choices.choices}>{([text, , active], i) => {
|
|
641
|
-
const disabled = active ? !active() : false;
|
|
642
|
-
const index = i();
|
|
643
|
-
return <button
|
|
644
|
-
type="button"
|
|
645
|
-
class="button"
|
|
646
|
-
aria-disabled={disabled}
|
|
647
|
-
onClick={[onChoicesButtonClick, [disabled, index]]}
|
|
648
|
-
>{text}</button>;
|
|
649
|
-
}}</For>
|
|
650
|
-
</div>
|
|
651
|
-
</div></Modal>
|
|
652
|
-
<Modal isOpen={() => props.state.input.visible} trapFocus={() => !props.state.exitPromptShown}><div class="dialog-container">
|
|
653
|
-
<span class="dialog-fix" aria-hidden="true"></span>
|
|
654
|
-
<div class="dialog-panel input-dialog-panel">
|
|
655
|
-
<label for="novely-input" class="input-dialog-label">
|
|
656
|
-
<span>{props.state.input.question}</span>
|
|
657
|
-
{props.state.input.element}
|
|
658
|
-
<span aria-live="polite" aria-atomic="true">{props.state.input.error}</span>
|
|
659
|
-
</label>
|
|
660
|
-
<button
|
|
661
|
-
type="submit"
|
|
662
|
-
class="button dialog-input__button"
|
|
663
|
-
onClick={onInputButtonClick}
|
|
664
|
-
aria-disabled={Boolean(props.state.input.error)}
|
|
665
|
-
>{data.t("Sumbit")}</button>
|
|
666
|
-
</div>
|
|
667
|
-
</div></Modal>
|
|
668
|
-
<Modal isOpen={() => props.state.exitPromptShown} trapFocus={() => props.state.exitPromptShown}><div class="dialog-container">
|
|
669
|
-
<span class="dialog-fix" aria-hidden="true"></span>
|
|
670
|
-
<div class="dialog-backdrop" />
|
|
671
|
-
<div class="dialog-panel exit-dialog-panel">
|
|
672
|
-
<span class="dialog-panel-label">{data.t("ExitDialogWarning")}</span>
|
|
673
|
-
<div class="exit-dialog-panel-buttons">
|
|
674
|
-
<button
|
|
675
|
-
type="button"
|
|
676
|
-
class="button"
|
|
677
|
-
onClick={() => {
|
|
678
|
-
setState("exitPromptShown", false);
|
|
679
|
-
}}
|
|
680
|
-
>{data.t("ExitDialogBack")}</button>
|
|
681
|
-
<button
|
|
682
|
-
type="button"
|
|
683
|
-
class="button"
|
|
684
|
-
onClick={() => {
|
|
685
|
-
data.options.exit(true);
|
|
686
|
-
}}
|
|
687
|
-
>{data.t("ExitDialogExit")}</button>
|
|
688
|
-
</div>
|
|
689
|
-
</div>
|
|
690
|
-
</div></Modal>
|
|
691
|
-
<div data-custom={true}><For each={layers()}>{(value) => value.dom}</For></div>
|
|
692
|
-
<div
|
|
693
|
-
class="action-text"
|
|
694
|
-
data-shown={Boolean(props.state.text.content)}
|
|
695
|
-
aria-disabled={!props.state.text.content}
|
|
696
|
-
role="button"
|
|
697
|
-
tabIndex={0}
|
|
698
|
-
onClick={TextWriter.clear}
|
|
699
|
-
onKeyPress={onKey(TextWriter.clear, "Enter")}
|
|
700
|
-
onKeyDown={onKey(TextWriter.clear, " ")}
|
|
701
|
-
><TextWriter.Typewriter
|
|
702
|
-
attributes={{
|
|
703
|
-
title: TextWriter.state() === "idle" ? void 0 : data.t(TextWriter.state() === "processing" ? "CompleteText" : "GoForward")
|
|
704
|
-
}}
|
|
705
|
-
content={props.state.text.content}
|
|
706
|
-
ignore={skipTypewriterWhenGoingBack && props.state.text.goingBack}
|
|
707
|
-
speed={speed()}
|
|
708
|
-
ended={onWriterEnd(TextWriter.clear)}
|
|
709
|
-
/></div>
|
|
710
|
-
<div
|
|
711
|
-
class="control-panel"
|
|
712
|
-
>
|
|
713
|
-
<Show5
|
|
714
|
-
when={data.media.hyperWide()}
|
|
715
|
-
><Show5
|
|
716
|
-
when={!controlPanelMenuExpanded()}
|
|
717
|
-
><button
|
|
718
|
-
type="button"
|
|
719
|
-
class="button control-panel__button"
|
|
720
|
-
title={data.t("OpenMenu")}
|
|
721
|
-
aria-controls={controlPanelMenuID}
|
|
722
|
-
aria-expanded={controlPanelMenuExpanded()}
|
|
723
|
-
onClick={() => {
|
|
724
|
-
setControlPanelMenuExpanded((prev) => !prev);
|
|
725
|
-
}}
|
|
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()
|
|
739
|
-
}}
|
|
740
|
-
ref={(element) => {
|
|
741
|
-
clickOutside(element, () => {
|
|
742
|
-
if (untrack3(data.media.hyperWide) && untrack3(controlPanelMenuExpanded)) {
|
|
743
|
-
setControlPanelMenuExpanded(false);
|
|
2313
|
+
return (() => {
|
|
2314
|
+
const _el$ = _tmpl$72(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$26 = _el$3.nextSibling, _el$27 = _el$26.nextSibling, _el$28 = _el$27.nextSibling, _el$32 = _el$28.firstChild;
|
|
2315
|
+
setAttribute(_el$2, "data-characters", true);
|
|
2316
|
+
insert(_el$2, createComponent(For, {
|
|
2317
|
+
get each() {
|
|
2318
|
+
return Object.entries(props.state.characters);
|
|
2319
|
+
},
|
|
2320
|
+
children: ([character, data2]) => createComponent(Show, {
|
|
2321
|
+
get when() {
|
|
2322
|
+
return data2.visible;
|
|
2323
|
+
},
|
|
2324
|
+
get children() {
|
|
2325
|
+
return createComponent(Character, {
|
|
2326
|
+
character,
|
|
2327
|
+
data: data2,
|
|
2328
|
+
get characters() {
|
|
2329
|
+
return store.characters;
|
|
744
2330
|
}
|
|
745
2331
|
});
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
2332
|
+
}
|
|
2333
|
+
})
|
|
2334
|
+
}));
|
|
2335
|
+
insert(_el$3, createComponent(DialogName, {
|
|
2336
|
+
get character() {
|
|
2337
|
+
return props.state.dialog.character;
|
|
2338
|
+
},
|
|
2339
|
+
get name() {
|
|
2340
|
+
return props.state.dialog.name;
|
|
2341
|
+
},
|
|
2342
|
+
characters
|
|
2343
|
+
}), _el$4);
|
|
2344
|
+
addEventListener2(_el$4, "keydown", onKey(DialogWriter.clear, " "), true);
|
|
2345
|
+
addEventListener2(_el$4, "keypress", onKey(DialogWriter.clear, "Enter"));
|
|
2346
|
+
addEventListener2(_el$4, "click", DialogWriter.clear, true);
|
|
2347
|
+
insert(_el$5, createComponent(Show, {
|
|
2348
|
+
get when() {
|
|
2349
|
+
return props.state.dialog.emotion;
|
|
2350
|
+
},
|
|
2351
|
+
keyed: true,
|
|
2352
|
+
children: (emotion) => {
|
|
2353
|
+
const character = props.state.dialog.character;
|
|
2354
|
+
if (!character)
|
|
2355
|
+
return null;
|
|
2356
|
+
if (!store["characters"][character] || !store["characters"][character]["emotions"][emotion]) {
|
|
2357
|
+
renderer.character(character).withEmotion(emotion);
|
|
2358
|
+
}
|
|
2359
|
+
const image = store["characters"][character]["emotions"][emotion];
|
|
2360
|
+
if ("src" in image)
|
|
2361
|
+
return image;
|
|
2362
|
+
const [canvas] = canvasDrawImages(void 0, void 0, Object.values(image));
|
|
2363
|
+
return canvas;
|
|
2364
|
+
}
|
|
2365
|
+
}));
|
|
2366
|
+
insert(_el$6, createComponent(DialogWriter.Typewriter, {
|
|
2367
|
+
get attributes() {
|
|
2368
|
+
return {
|
|
2369
|
+
title: DialogWriter.state() === "idle" ? void 0 : data.t(DialogWriter.state() === "processing" ? "CompleteText" : "GoForward")
|
|
2370
|
+
};
|
|
2371
|
+
},
|
|
2372
|
+
get content() {
|
|
2373
|
+
return props.state.dialog.content;
|
|
2374
|
+
},
|
|
2375
|
+
get ignore() {
|
|
2376
|
+
return skipTypewriterWhenGoingBack && props.state.dialog.goingBack;
|
|
2377
|
+
},
|
|
2378
|
+
get speed() {
|
|
2379
|
+
return speed();
|
|
2380
|
+
},
|
|
2381
|
+
get ended() {
|
|
2382
|
+
return onWriterEnd(DialogWriter.clear);
|
|
2383
|
+
}
|
|
2384
|
+
}));
|
|
2385
|
+
insert(_el$, createComponent(Modal, {
|
|
2386
|
+
isOpen: () => props.state.choices.visible,
|
|
2387
|
+
trapFocus: () => !props.state.exitPromptShown,
|
|
2388
|
+
get children() {
|
|
2389
|
+
const _el$7 = _tmpl$12(), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$10 = _el$9.firstChild;
|
|
2390
|
+
insert(_el$10, () => props.state.choices.question || " ");
|
|
2391
|
+
insert(_el$9, createComponent(For, {
|
|
2392
|
+
get each() {
|
|
2393
|
+
return props.state.choices.choices;
|
|
2394
|
+
},
|
|
2395
|
+
children: ([text, , active], i) => {
|
|
2396
|
+
const disabled = active ? !active() : false;
|
|
2397
|
+
const index = i();
|
|
2398
|
+
return (() => {
|
|
2399
|
+
const _el$33 = _tmpl$82();
|
|
2400
|
+
_el$33.$$click = onChoicesButtonClick;
|
|
2401
|
+
_el$33.$$clickData = [disabled, index];
|
|
2402
|
+
setAttribute(_el$33, "aria-disabled", disabled);
|
|
2403
|
+
insert(_el$33, text);
|
|
2404
|
+
return _el$33;
|
|
2405
|
+
})();
|
|
2406
|
+
}
|
|
2407
|
+
}), null);
|
|
2408
|
+
createRenderEffect((_p$) => {
|
|
2409
|
+
const _v$ = Boolean(props.state.choices.question), _v$2 = !props.state.choices.question;
|
|
2410
|
+
_v$ !== _p$._v$ && setAttribute(_el$10, "data-used", _p$._v$ = _v$);
|
|
2411
|
+
_v$2 !== _p$._v$2 && setAttribute(_el$10, "aria-hidden", _p$._v$2 = _v$2);
|
|
2412
|
+
return _p$;
|
|
2413
|
+
}, {
|
|
2414
|
+
_v$: void 0,
|
|
2415
|
+
_v$2: void 0
|
|
2416
|
+
});
|
|
2417
|
+
return _el$7;
|
|
2418
|
+
}
|
|
2419
|
+
}), _el$26);
|
|
2420
|
+
insert(_el$, createComponent(Modal, {
|
|
2421
|
+
isOpen: () => props.state.input.visible,
|
|
2422
|
+
trapFocus: () => !props.state.exitPromptShown,
|
|
2423
|
+
get children() {
|
|
2424
|
+
const _el$11 = _tmpl$24(), _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$17 = _el$14.nextSibling;
|
|
2425
|
+
insert(_el$15, () => props.state.input.question);
|
|
2426
|
+
insert(_el$14, () => props.state.input.element, _el$16);
|
|
2427
|
+
insert(_el$16, () => props.state.input.error);
|
|
2428
|
+
_el$17.$$click = onInputButtonClick;
|
|
2429
|
+
insert(_el$17, () => data.t("Sumbit"));
|
|
2430
|
+
createRenderEffect(() => setAttribute(_el$17, "aria-disabled", Boolean(props.state.input.error)));
|
|
2431
|
+
return _el$11;
|
|
2432
|
+
}
|
|
2433
|
+
}), _el$26);
|
|
2434
|
+
insert(_el$, createComponent(Modal, {
|
|
2435
|
+
isOpen: () => props.state.exitPromptShown,
|
|
2436
|
+
trapFocus: () => props.state.exitPromptShown,
|
|
2437
|
+
get children() {
|
|
2438
|
+
const _el$18 = _tmpl$33(), _el$19 = _el$18.firstChild, _el$20 = _el$19.nextSibling, _el$21 = _el$20.nextSibling, _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling;
|
|
2439
|
+
insert(_el$22, () => data.t("ExitDialogWarning"));
|
|
2440
|
+
_el$24.$$click = () => {
|
|
2441
|
+
setState("exitPromptShown", false);
|
|
2442
|
+
};
|
|
2443
|
+
insert(_el$24, () => data.t("ExitDialogBack"));
|
|
2444
|
+
_el$25.$$click = () => {
|
|
2445
|
+
data.options.exit(true);
|
|
2446
|
+
};
|
|
2447
|
+
insert(_el$25, () => data.t("ExitDialogExit"));
|
|
2448
|
+
return _el$18;
|
|
2449
|
+
}
|
|
2450
|
+
}), _el$26);
|
|
2451
|
+
setAttribute(_el$26, "data-custom", true);
|
|
2452
|
+
insert(_el$26, createComponent(For, {
|
|
2453
|
+
get each() {
|
|
2454
|
+
return layers();
|
|
2455
|
+
},
|
|
2456
|
+
children: (value) => value.dom
|
|
2457
|
+
}));
|
|
2458
|
+
addEventListener2(_el$27, "keydown", onKey(TextWriter.clear, " "), true);
|
|
2459
|
+
addEventListener2(_el$27, "keypress", onKey(TextWriter.clear, "Enter"));
|
|
2460
|
+
addEventListener2(_el$27, "click", TextWriter.clear, true);
|
|
2461
|
+
insert(_el$27, createComponent(TextWriter.Typewriter, {
|
|
2462
|
+
get attributes() {
|
|
2463
|
+
return {
|
|
2464
|
+
title: TextWriter.state() === "idle" ? void 0 : data.t(TextWriter.state() === "processing" ? "CompleteText" : "GoForward")
|
|
2465
|
+
};
|
|
2466
|
+
},
|
|
2467
|
+
get content() {
|
|
2468
|
+
return props.state.text.content;
|
|
2469
|
+
},
|
|
2470
|
+
get ignore() {
|
|
2471
|
+
return skipTypewriterWhenGoingBack && props.state.text.goingBack;
|
|
2472
|
+
},
|
|
2473
|
+
get speed() {
|
|
2474
|
+
return speed();
|
|
2475
|
+
},
|
|
2476
|
+
get ended() {
|
|
2477
|
+
return onWriterEnd(TextWriter.clear);
|
|
2478
|
+
}
|
|
2479
|
+
}));
|
|
2480
|
+
insert(_el$28, createComponent(Show, {
|
|
2481
|
+
get when() {
|
|
2482
|
+
return data.media.hyperWide();
|
|
2483
|
+
},
|
|
2484
|
+
get children() {
|
|
2485
|
+
return createComponent(Show, {
|
|
2486
|
+
get when() {
|
|
2487
|
+
return !controlPanelMenuExpanded();
|
|
2488
|
+
},
|
|
2489
|
+
get children() {
|
|
2490
|
+
const _el$29 = _tmpl$43();
|
|
2491
|
+
_el$29.$$click = () => {
|
|
2492
|
+
setControlPanelMenuExpanded((prev) => !prev);
|
|
2493
|
+
};
|
|
2494
|
+
setAttribute(_el$29, "aria-controls", controlPanelMenuID);
|
|
2495
|
+
insert(_el$29, createComponent(Icon, {
|
|
2496
|
+
get children() {
|
|
2497
|
+
return Icon.Menu();
|
|
2498
|
+
}
|
|
2499
|
+
}));
|
|
2500
|
+
createRenderEffect((_p$) => {
|
|
2501
|
+
const _v$3 = data.t("OpenMenu"), _v$4 = controlPanelMenuExpanded();
|
|
2502
|
+
_v$3 !== _p$._v$3 && setAttribute(_el$29, "title", _p$._v$3 = _v$3);
|
|
2503
|
+
_v$4 !== _p$._v$4 && setAttribute(_el$29, "aria-expanded", _p$._v$4 = _v$4);
|
|
2504
|
+
return _p$;
|
|
2505
|
+
}, {
|
|
2506
|
+
_v$3: void 0,
|
|
2507
|
+
_v$4: void 0
|
|
2508
|
+
});
|
|
2509
|
+
return _el$29;
|
|
2510
|
+
}
|
|
2511
|
+
});
|
|
2512
|
+
}
|
|
2513
|
+
}), _el$32);
|
|
2514
|
+
insert(_el$28, createComponent(Show, {
|
|
2515
|
+
get when() {
|
|
2516
|
+
return data.media.hyperWide() && controlPanelMenuExpanded() && !props.state.exitPromptShown;
|
|
2517
|
+
},
|
|
2518
|
+
get children() {
|
|
2519
|
+
return [_tmpl$53(), _tmpl$62()];
|
|
2520
|
+
}
|
|
2521
|
+
}), _el$32);
|
|
2522
|
+
use((element) => {
|
|
2523
|
+
clickOutside(element, () => {
|
|
2524
|
+
if (untrack(data.media.hyperWide) && untrack(controlPanelMenuExpanded)) {
|
|
752
2525
|
setControlPanelMenuExpanded(false);
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
2526
|
+
}
|
|
2527
|
+
});
|
|
2528
|
+
}, _el$32);
|
|
2529
|
+
setAttribute(_el$32, "id", controlPanelMenuID);
|
|
2530
|
+
_el$32.classList.toggle("control-panel-container--center", !!(controls === "inside"));
|
|
2531
|
+
insert(_el$32, createComponent(ControlPanelButtons, {
|
|
2532
|
+
openSettings: () => {
|
|
2533
|
+
props.setState("screen", "settings");
|
|
2534
|
+
},
|
|
2535
|
+
closeDropdown: () => {
|
|
2536
|
+
setControlPanelMenuExpanded(false);
|
|
2537
|
+
},
|
|
2538
|
+
auto,
|
|
2539
|
+
setAuto
|
|
2540
|
+
}));
|
|
2541
|
+
createRenderEffect((_p$) => {
|
|
2542
|
+
const _v$5 = background(), _v$6 = !!props.state.dialog.visible, _v$7 = !props.state.dialog.visible, _v$8 = !(props.state.dialog.character && props.state.dialog.emotion), _v$9 = !props.state.dialog.content, _v$10 = Boolean(props.state.text.content), _v$11 = !props.state.text.content, _v$12 = !!(data.media.hyperWide() && !controlPanelMenuExpanded()), _v$13 = !!(data.media.hyperWide() && controlPanelMenuExpanded());
|
|
2543
|
+
_p$._v$5 = style(_el$, _v$5, _p$._v$5);
|
|
2544
|
+
_v$6 !== _p$._v$6 && _el$3.classList.toggle("action-dialog--visible", _p$._v$6 = _v$6);
|
|
2545
|
+
_v$7 !== _p$._v$7 && _el$3.classList.toggle("action-dialog--hidden", _p$._v$7 = _v$7);
|
|
2546
|
+
_v$8 !== _p$._v$8 && setAttribute(_el$4, "data-no-person", _p$._v$8 = _v$8);
|
|
2547
|
+
_v$9 !== _p$._v$9 && setAttribute(_el$4, "aria-disabled", _p$._v$9 = _v$9);
|
|
2548
|
+
_v$10 !== _p$._v$10 && setAttribute(_el$27, "data-shown", _p$._v$10 = _v$10);
|
|
2549
|
+
_v$11 !== _p$._v$11 && setAttribute(_el$27, "aria-disabled", _p$._v$11 = _v$11);
|
|
2550
|
+
_v$12 !== _p$._v$12 && _el$32.classList.toggle("control-panel-container--wide-closed", _p$._v$12 = _v$12);
|
|
2551
|
+
_v$13 !== _p$._v$13 && _el$32.classList.toggle("control-panel-container--wide-open", _p$._v$13 = _v$13);
|
|
2552
|
+
return _p$;
|
|
2553
|
+
}, {
|
|
2554
|
+
_v$5: void 0,
|
|
2555
|
+
_v$6: void 0,
|
|
2556
|
+
_v$7: void 0,
|
|
2557
|
+
_v$8: void 0,
|
|
2558
|
+
_v$9: void 0,
|
|
2559
|
+
_v$10: void 0,
|
|
2560
|
+
_v$11: void 0,
|
|
2561
|
+
_v$12: void 0,
|
|
2562
|
+
_v$13: void 0
|
|
2563
|
+
});
|
|
2564
|
+
return _el$;
|
|
2565
|
+
})();
|
|
759
2566
|
};
|
|
2567
|
+
delegateEvents(["click", "keydown"]);
|
|
760
2568
|
|
|
761
2569
|
// src/screens/loading.tsx
|
|
2570
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div class="root loading"><div class="loading__animation"><div></div><div></div><div></div><div>`);
|
|
762
2571
|
var Loading = () => {
|
|
763
|
-
return
|
|
764
|
-
<div />
|
|
765
|
-
<div />
|
|
766
|
-
<div />
|
|
767
|
-
<div />
|
|
768
|
-
</div></div>;
|
|
2572
|
+
return _tmpl$13();
|
|
769
2573
|
};
|
|
770
2574
|
|
|
771
2575
|
// src/screens/mainmenu.tsx
|
|
772
|
-
|
|
2576
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<div class="root main-menu"><button type="button" class="button main-menu__button"></button><button type="button" class="button main-menu__button"></button><button type="button" class="button main-menu__button"></button><button type="button" class="button main-menu__button">`);
|
|
2577
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<button>`);
|
|
773
2578
|
var MainMenu = (props) => {
|
|
774
2579
|
const data = useData();
|
|
775
2580
|
const language = () => data.storeData().meta[0];
|
|
776
|
-
const goto = (screen) => {
|
|
2581
|
+
const goto = simple((screen) => {
|
|
2582
|
+
if (!data.coreData().dataLoaded)
|
|
2583
|
+
return;
|
|
777
2584
|
props.setState("screen", screen);
|
|
778
|
-
};
|
|
779
|
-
return
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
2585
|
+
});
|
|
2586
|
+
return (() => {
|
|
2587
|
+
const _el$ = _tmpl$14(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling;
|
|
2588
|
+
addEventListener2(_el$2, "click", data.options.newGame, true);
|
|
2589
|
+
insert(_el$2, () => data.t("NewGame"));
|
|
2590
|
+
_el$3.$$click = () => data.options.restore();
|
|
2591
|
+
insert(_el$3, () => data.t("LoadSave"));
|
|
2592
|
+
_el$4.$$click = () => props.setState("screen", "saves");
|
|
2593
|
+
insert(_el$4, () => data.t("Saves"));
|
|
2594
|
+
_el$5.$$click = () => props.setState("screen", "settings");
|
|
2595
|
+
insert(_el$5, () => data.t("Settings"));
|
|
2596
|
+
insert(_el$, createComponent(Show, {
|
|
2597
|
+
get when() {
|
|
2598
|
+
return language();
|
|
2599
|
+
},
|
|
2600
|
+
keyed: true,
|
|
2601
|
+
children: (_) => createComponent(For, {
|
|
2602
|
+
get each() {
|
|
2603
|
+
return props.state.mainmenu.items;
|
|
2604
|
+
},
|
|
2605
|
+
children: (item) => (() => {
|
|
2606
|
+
const _el$6 = _tmpl$25();
|
|
2607
|
+
spread(_el$6, mergeProps(() => item(goto)), false, false);
|
|
2608
|
+
return _el$6;
|
|
2609
|
+
})()
|
|
2610
|
+
})
|
|
2611
|
+
}), null);
|
|
2612
|
+
return _el$;
|
|
2613
|
+
})();
|
|
786
2614
|
};
|
|
2615
|
+
delegateEvents(["click"]);
|
|
787
2616
|
|
|
788
2617
|
// src/screens/saves.tsx
|
|
789
|
-
|
|
2618
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<ol class="saves__list">`);
|
|
2619
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div class="root saves"><div class="saves__column"><button type="button" class="button saves__button"></button></div><div class="saves__list-container">`);
|
|
2620
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<div class="saves__list saves__list--empty">`);
|
|
2621
|
+
var _tmpl$44 = /* @__PURE__ */ template(`<li class="saves__list-item"><button type="button" class="button saves__button-load"><span></span><span class="saves__button-load__type"></span></button><button type="reset" class="button saves__button-reset"><span>`);
|
|
790
2622
|
var Saves = (props) => {
|
|
791
2623
|
const data = useData();
|
|
792
2624
|
const saves = () => data.storeData().saves;
|
|
@@ -797,89 +2629,149 @@ var Saves = (props) => {
|
|
|
797
2629
|
return prev;
|
|
798
2630
|
});
|
|
799
2631
|
};
|
|
800
|
-
return
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
2632
|
+
return (() => {
|
|
2633
|
+
const _el$ = _tmpl$26(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
|
|
2634
|
+
_el$3.$$click = () => props.setState("screen", "mainmenu");
|
|
2635
|
+
insert(_el$3, () => data.t("GoBack"));
|
|
2636
|
+
insert(_el$4, createComponent(Show, {
|
|
2637
|
+
get when() {
|
|
2638
|
+
return saves().length > 0;
|
|
2639
|
+
},
|
|
2640
|
+
get fallback() {
|
|
2641
|
+
return (() => {
|
|
2642
|
+
const _el$6 = _tmpl$34();
|
|
2643
|
+
insert(_el$6, () => data.t("NoSaves"));
|
|
2644
|
+
return _el$6;
|
|
2645
|
+
})();
|
|
2646
|
+
},
|
|
2647
|
+
get children() {
|
|
2648
|
+
const _el$5 = _tmpl$15();
|
|
2649
|
+
insert(_el$5, createComponent(For, {
|
|
2650
|
+
get each() {
|
|
2651
|
+
return saves();
|
|
2652
|
+
},
|
|
2653
|
+
children: (save) => {
|
|
2654
|
+
const [date, type] = save[2];
|
|
2655
|
+
const stringDate = capitalize(new Date(date).toLocaleDateString(language(), {
|
|
2656
|
+
weekday: "long",
|
|
2657
|
+
year: "numeric",
|
|
2658
|
+
month: "long",
|
|
2659
|
+
day: "numeric",
|
|
2660
|
+
hour: "numeric",
|
|
2661
|
+
minute: "numeric",
|
|
2662
|
+
second: "numeric"
|
|
2663
|
+
}));
|
|
2664
|
+
const stringType = data.t(type === "auto" ? "Automatic" : "Manual");
|
|
2665
|
+
return (() => {
|
|
2666
|
+
const _el$7 = _tmpl$44(), _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$10 = _el$9.nextSibling, _el$11 = _el$8.nextSibling, _el$12 = _el$11.firstChild;
|
|
2667
|
+
_el$8.$$click = () => data.options.set(save);
|
|
2668
|
+
insert(_el$9, stringDate);
|
|
2669
|
+
insert(_el$10, stringType);
|
|
2670
|
+
_el$11.$$click = removeSave;
|
|
2671
|
+
_el$11.$$clickData = date;
|
|
2672
|
+
insert(_el$12, () => data.t("Remove"));
|
|
2673
|
+
createRenderEffect((_p$) => {
|
|
2674
|
+
const _v$ = data.t("LoadASaveFrom") + " " + stringDate, _v$2 = data.t("DeleteASaveFrom") + " " + stringDate;
|
|
2675
|
+
_v$ !== _p$._v$ && setAttribute(_el$8, "aria-label", _p$._v$ = _v$);
|
|
2676
|
+
_v$2 !== _p$._v$2 && setAttribute(_el$11, "aria-label", _p$._v$2 = _v$2);
|
|
2677
|
+
return _p$;
|
|
2678
|
+
}, {
|
|
2679
|
+
_v$: void 0,
|
|
2680
|
+
_v$2: void 0
|
|
2681
|
+
});
|
|
2682
|
+
return _el$7;
|
|
2683
|
+
})();
|
|
2684
|
+
}
|
|
2685
|
+
}));
|
|
2686
|
+
return _el$5;
|
|
2687
|
+
}
|
|
2688
|
+
}));
|
|
2689
|
+
return _el$;
|
|
2690
|
+
})();
|
|
838
2691
|
};
|
|
2692
|
+
delegateEvents(["click"]);
|
|
839
2693
|
|
|
840
2694
|
// src/screens/settings.tsx
|
|
841
|
-
|
|
2695
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<div class="root settings"><div class="settings__column"><button type="button" class="button settings__button"></button><button type="button" class="button settings__button"></button></div><div class="settings__column"><div class="select"><label class="select__label"></label><select class="select__select"></select></div><div class="select"><label class="select__label"></label><select class="select__select">`);
|
|
2696
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<option>`);
|
|
842
2697
|
var Settings = (props) => {
|
|
843
2698
|
const data = useData();
|
|
844
2699
|
const language = () => data.storeData().meta[0];
|
|
845
2700
|
const textSpeed = () => data.storeData().meta[1];
|
|
846
|
-
const languageNames = createMemo(
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
2701
|
+
const languageNames = createMemo(() => new Intl.DisplayNames([language()], {
|
|
2702
|
+
type: "language"
|
|
2703
|
+
}));
|
|
2704
|
+
const onLanguageSelect = ({
|
|
2705
|
+
currentTarget: {
|
|
2706
|
+
value
|
|
2707
|
+
}
|
|
2708
|
+
}) => {
|
|
852
2709
|
data.storeDataUpdate((prev) => {
|
|
853
2710
|
return prev.meta[0] = value, prev;
|
|
854
2711
|
});
|
|
855
2712
|
};
|
|
856
|
-
const onSpeedSelect = ({
|
|
2713
|
+
const onSpeedSelect = ({
|
|
2714
|
+
currentTarget: {
|
|
2715
|
+
value
|
|
2716
|
+
}
|
|
2717
|
+
}) => {
|
|
857
2718
|
data.storeDataUpdate((prev) => {
|
|
858
2719
|
return prev.meta[1] = value, prev;
|
|
859
2720
|
});
|
|
860
2721
|
};
|
|
861
|
-
const languageSelectID =
|
|
862
|
-
const speedSelectID =
|
|
863
|
-
return
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
2722
|
+
const languageSelectID = createUniqueId();
|
|
2723
|
+
const speedSelectID = createUniqueId();
|
|
2724
|
+
return (() => {
|
|
2725
|
+
const _el$ = _tmpl$16(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$6.nextSibling, _el$10 = _el$9.firstChild, _el$11 = _el$10.nextSibling;
|
|
2726
|
+
_el$3.$$click = () => props.setState("screen", "mainmenu");
|
|
2727
|
+
insert(_el$3, () => data.t("HomeScreen"));
|
|
2728
|
+
_el$4.$$click = () => data.options.restore();
|
|
2729
|
+
insert(_el$4, () => data.t("ToTheGame"));
|
|
2730
|
+
setAttribute(_el$7, "for", languageSelectID);
|
|
2731
|
+
insert(_el$7, () => data.t("Language"));
|
|
2732
|
+
_el$8.addEventListener("change", onLanguageSelect);
|
|
2733
|
+
setAttribute(_el$8, "id", languageSelectID);
|
|
2734
|
+
insert(_el$8, createComponent(For, {
|
|
2735
|
+
get each() {
|
|
2736
|
+
return data.options.languages;
|
|
2737
|
+
},
|
|
2738
|
+
children: (lang) => (() => {
|
|
2739
|
+
const _el$12 = _tmpl$27();
|
|
2740
|
+
_el$12.value = lang;
|
|
2741
|
+
insert(_el$12, () => capitalize(languageNames().of(lang) || lang));
|
|
2742
|
+
createRenderEffect(() => _el$12.selected = lang === language());
|
|
2743
|
+
return _el$12;
|
|
2744
|
+
})()
|
|
2745
|
+
}));
|
|
2746
|
+
setAttribute(_el$10, "for", speedSelectID);
|
|
2747
|
+
insert(_el$10, () => data.t("TextSpeed"));
|
|
2748
|
+
_el$11.addEventListener("change", onSpeedSelect);
|
|
2749
|
+
setAttribute(_el$11, "id", speedSelectID);
|
|
2750
|
+
insert(_el$11, createComponent(For, {
|
|
2751
|
+
each: ["Slow", "Medium", "Fast", "Auto"],
|
|
2752
|
+
children: (speed) => (() => {
|
|
2753
|
+
const _el$13 = _tmpl$27();
|
|
2754
|
+
_el$13.value = speed;
|
|
2755
|
+
insert(_el$13, () => data.t("TextSpeed" + speed));
|
|
2756
|
+
createRenderEffect(() => _el$13.selected = speed === textSpeed());
|
|
2757
|
+
return _el$13;
|
|
2758
|
+
})()
|
|
2759
|
+
}));
|
|
2760
|
+
return _el$;
|
|
2761
|
+
})();
|
|
879
2762
|
};
|
|
2763
|
+
delegateEvents(["click"]);
|
|
880
2764
|
|
|
881
2765
|
// src/renderer.tsx
|
|
882
|
-
var
|
|
2766
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<div>`);
|
|
2767
|
+
var _tmpl$28 = /* @__PURE__ */ template(`<canvas>`);
|
|
2768
|
+
var _tmpl$35 = /* @__PURE__ */ template(`<input type="text" name="novely-input" required autocomplete="off">`);
|
|
2769
|
+
var createSolidRenderer = ({
|
|
2770
|
+
fullscreen = false,
|
|
2771
|
+
controls = "outside",
|
|
2772
|
+
skipTypewriterWhenGoingBack = true,
|
|
2773
|
+
target = document.body
|
|
2774
|
+
} = {}) => {
|
|
883
2775
|
const [state, setState] = createStore({
|
|
884
2776
|
background: "",
|
|
885
2777
|
characters: {},
|
|
@@ -922,6 +2814,100 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
922
2814
|
let options;
|
|
923
2815
|
let root;
|
|
924
2816
|
let currentBackground;
|
|
2817
|
+
let unmount;
|
|
2818
|
+
const Novely = () => {
|
|
2819
|
+
createEffect(() => {
|
|
2820
|
+
const screen = state.screen;
|
|
2821
|
+
if (fullscreen && document.fullscreenEnabled) {
|
|
2822
|
+
if (screen === "game" && !document.fullscreenElement) {
|
|
2823
|
+
document.documentElement.requestFullscreen().catch(() => {
|
|
2824
|
+
});
|
|
2825
|
+
} else if (screen === "mainmenu" && document.fullscreenElement && "exitFullscreen" in document) {
|
|
2826
|
+
document.exitFullscreen().catch(() => {
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
});
|
|
2831
|
+
return (() => {
|
|
2832
|
+
const _el$ = _tmpl$17();
|
|
2833
|
+
const _ref$ = root;
|
|
2834
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : root = _el$;
|
|
2835
|
+
insert(_el$, createComponent(Provider, {
|
|
2836
|
+
get storeData() {
|
|
2837
|
+
return options.$;
|
|
2838
|
+
},
|
|
2839
|
+
get coreData() {
|
|
2840
|
+
return options.$$;
|
|
2841
|
+
},
|
|
2842
|
+
options,
|
|
2843
|
+
renderer,
|
|
2844
|
+
get children() {
|
|
2845
|
+
return [createComponent(Switch, {
|
|
2846
|
+
get children() {
|
|
2847
|
+
return [createComponent(Match, {
|
|
2848
|
+
get when() {
|
|
2849
|
+
return state.screen === "game";
|
|
2850
|
+
},
|
|
2851
|
+
get children() {
|
|
2852
|
+
return createComponent(Game, {
|
|
2853
|
+
state,
|
|
2854
|
+
setState,
|
|
2855
|
+
store,
|
|
2856
|
+
characters,
|
|
2857
|
+
renderer,
|
|
2858
|
+
controls,
|
|
2859
|
+
skipTypewriterWhenGoingBack
|
|
2860
|
+
});
|
|
2861
|
+
}
|
|
2862
|
+
}), createComponent(Match, {
|
|
2863
|
+
get when() {
|
|
2864
|
+
return state.screen === "mainmenu";
|
|
2865
|
+
},
|
|
2866
|
+
get children() {
|
|
2867
|
+
return createComponent(MainMenu, {
|
|
2868
|
+
state,
|
|
2869
|
+
setState
|
|
2870
|
+
});
|
|
2871
|
+
}
|
|
2872
|
+
}), createComponent(Match, {
|
|
2873
|
+
get when() {
|
|
2874
|
+
return state.screen === "saves";
|
|
2875
|
+
},
|
|
2876
|
+
get children() {
|
|
2877
|
+
return createComponent(Saves, {
|
|
2878
|
+
setState
|
|
2879
|
+
});
|
|
2880
|
+
}
|
|
2881
|
+
}), createComponent(Match, {
|
|
2882
|
+
get when() {
|
|
2883
|
+
return state.screen === "settings";
|
|
2884
|
+
},
|
|
2885
|
+
get children() {
|
|
2886
|
+
return createComponent(Settings, {
|
|
2887
|
+
setState
|
|
2888
|
+
});
|
|
2889
|
+
}
|
|
2890
|
+
}), createComponent(Match, {
|
|
2891
|
+
get when() {
|
|
2892
|
+
return state.screen === "loading";
|
|
2893
|
+
},
|
|
2894
|
+
get children() {
|
|
2895
|
+
return createComponent(Loading, {});
|
|
2896
|
+
}
|
|
2897
|
+
})];
|
|
2898
|
+
}
|
|
2899
|
+
}), createComponent(CustomScreen, {
|
|
2900
|
+
get name() {
|
|
2901
|
+
return state.screen;
|
|
2902
|
+
},
|
|
2903
|
+
state,
|
|
2904
|
+
setState
|
|
2905
|
+
})];
|
|
2906
|
+
}
|
|
2907
|
+
}));
|
|
2908
|
+
return _el$;
|
|
2909
|
+
})();
|
|
2910
|
+
};
|
|
925
2911
|
return {
|
|
926
2912
|
createRenderer(init) {
|
|
927
2913
|
options = init, characters = init.characters;
|
|
@@ -944,7 +2930,9 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
944
2930
|
}
|
|
945
2931
|
return;
|
|
946
2932
|
}
|
|
947
|
-
const last = findLast(mediaQueries, ({
|
|
2933
|
+
const last = findLast(mediaQueries, ({
|
|
2934
|
+
matches
|
|
2935
|
+
}) => matches);
|
|
948
2936
|
const bg = last ? background[last.media] : "";
|
|
949
2937
|
setState("background", bg);
|
|
950
2938
|
};
|
|
@@ -956,7 +2944,11 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
956
2944
|
character(character) {
|
|
957
2945
|
if (store.characters[character])
|
|
958
2946
|
return store.characters[character];
|
|
959
|
-
const canvas =
|
|
2947
|
+
const canvas = (() => {
|
|
2948
|
+
const _el$2 = _tmpl$28();
|
|
2949
|
+
setAttribute(_el$2, "data-character", character);
|
|
2950
|
+
return _el$2;
|
|
2951
|
+
})();
|
|
960
2952
|
const ctx = canvas.getContext("2d");
|
|
961
2953
|
return store.characters[character] = {
|
|
962
2954
|
canvas,
|
|
@@ -964,20 +2956,20 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
964
2956
|
emotions: {},
|
|
965
2957
|
withEmotion(emotion) {
|
|
966
2958
|
const stored = this.emotions[emotion];
|
|
967
|
-
const
|
|
2959
|
+
const render2 = (...images) => {
|
|
968
2960
|
return () => {
|
|
969
2961
|
canvasDrawImages(canvas, ctx, images);
|
|
970
2962
|
};
|
|
971
2963
|
};
|
|
972
2964
|
if (stored) {
|
|
973
2965
|
if (stored instanceof HTMLImageElement) {
|
|
974
|
-
return
|
|
2966
|
+
return render2(stored);
|
|
975
2967
|
}
|
|
976
|
-
return
|
|
2968
|
+
return render2(...Object.values(stored));
|
|
977
2969
|
}
|
|
978
2970
|
const emotionData = characters[character].emotions[emotion];
|
|
979
2971
|
if (typeof emotionData === "string") {
|
|
980
|
-
return
|
|
2972
|
+
return render2(this.emotions[emotion] = createImage(emotionData));
|
|
981
2973
|
}
|
|
982
2974
|
const head = createImage(emotionData.head);
|
|
983
2975
|
const left = createImage(emotionData.body.left);
|
|
@@ -987,33 +2979,45 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
987
2979
|
left,
|
|
988
2980
|
right
|
|
989
2981
|
};
|
|
990
|
-
return
|
|
2982
|
+
return render2(head, left, right);
|
|
991
2983
|
},
|
|
992
|
-
append(
|
|
2984
|
+
append(className2, style2) {
|
|
993
2985
|
clearTimeout(state.characters[character]?.timeoutId);
|
|
994
|
-
setState("characters", character, {
|
|
995
|
-
|
|
2986
|
+
setState("characters", character, {
|
|
2987
|
+
style: style2,
|
|
2988
|
+
visible: true
|
|
2989
|
+
});
|
|
2990
|
+
const {
|
|
2991
|
+
canvas: element
|
|
2992
|
+
} = store.characters[character];
|
|
996
2993
|
element.className = "";
|
|
997
|
-
if (
|
|
2994
|
+
if (className2) {
|
|
998
2995
|
void element.offsetHeight;
|
|
999
|
-
element.className =
|
|
2996
|
+
element.className = className2;
|
|
1000
2997
|
}
|
|
1001
2998
|
},
|
|
1002
|
-
remove(
|
|
2999
|
+
remove(className2, style2, duration) {
|
|
1003
3000
|
return (resolve, restoring) => {
|
|
1004
3001
|
if (restoring) {
|
|
1005
|
-
setState("characters", character, {
|
|
3002
|
+
setState("characters", character, {
|
|
3003
|
+
visible: false
|
|
3004
|
+
});
|
|
1006
3005
|
resolve();
|
|
1007
3006
|
return;
|
|
1008
3007
|
}
|
|
1009
3008
|
const timeoutId = setTimeout(() => {
|
|
1010
|
-
setState("characters", character, {
|
|
3009
|
+
setState("characters", character, {
|
|
3010
|
+
visible: false
|
|
3011
|
+
});
|
|
1011
3012
|
resolve();
|
|
1012
3013
|
}, duration);
|
|
1013
|
-
if (
|
|
1014
|
-
store.characters[character].canvas.className =
|
|
3014
|
+
if (className2) {
|
|
3015
|
+
store.characters[character].canvas.className = className2;
|
|
1015
3016
|
}
|
|
1016
|
-
setState("characters", character, {
|
|
3017
|
+
setState("characters", character, {
|
|
3018
|
+
style: style2,
|
|
3019
|
+
timeoutId
|
|
3020
|
+
});
|
|
1017
3021
|
};
|
|
1018
3022
|
}
|
|
1019
3023
|
};
|
|
@@ -1033,7 +3037,12 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1033
3037
|
},
|
|
1034
3038
|
choices(question, choices) {
|
|
1035
3039
|
return (resolve) => {
|
|
1036
|
-
setState("choices", {
|
|
3040
|
+
setState("choices", {
|
|
3041
|
+
choices,
|
|
3042
|
+
question,
|
|
3043
|
+
resolve,
|
|
3044
|
+
visible: true
|
|
3045
|
+
});
|
|
1037
3046
|
};
|
|
1038
3047
|
},
|
|
1039
3048
|
clear(goingBack, keep, keepCharacters) {
|
|
@@ -1056,12 +3065,20 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1056
3065
|
error: ""
|
|
1057
3066
|
});
|
|
1058
3067
|
if (!keep.has("dialog"))
|
|
1059
|
-
setState("dialog", {
|
|
3068
|
+
setState("dialog", {
|
|
3069
|
+
visible: false,
|
|
3070
|
+
content: "",
|
|
3071
|
+
name: ""
|
|
3072
|
+
});
|
|
1060
3073
|
if (!keep.has("text"))
|
|
1061
|
-
setState("text", {
|
|
3074
|
+
setState("text", {
|
|
3075
|
+
content: ""
|
|
3076
|
+
});
|
|
1062
3077
|
for (const character of Object.keys(state.characters)) {
|
|
1063
3078
|
if (!keepCharacters.has(character))
|
|
1064
|
-
setState("characters", character, {
|
|
3079
|
+
setState("characters", character, {
|
|
3080
|
+
visible: false
|
|
3081
|
+
});
|
|
1065
3082
|
}
|
|
1066
3083
|
for (const [id, layer] of Object.entries(state.layers)) {
|
|
1067
3084
|
if (!layer)
|
|
@@ -1076,7 +3093,9 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1076
3093
|
input(question, onInput, setup) {
|
|
1077
3094
|
return (resolve) => {
|
|
1078
3095
|
const error = (value) => {
|
|
1079
|
-
setState("input", {
|
|
3096
|
+
setState("input", {
|
|
3097
|
+
error: value
|
|
3098
|
+
});
|
|
1080
3099
|
};
|
|
1081
3100
|
const onInputHandler = (event) => {
|
|
1082
3101
|
let value;
|
|
@@ -1091,10 +3110,16 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1091
3110
|
}
|
|
1092
3111
|
});
|
|
1093
3112
|
};
|
|
1094
|
-
const input =
|
|
3113
|
+
const input = (() => {
|
|
3114
|
+
const _el$3 = _tmpl$35();
|
|
3115
|
+
_el$3.$$input = onInputHandler;
|
|
3116
|
+
return _el$3;
|
|
3117
|
+
})();
|
|
1095
3118
|
if (setup) {
|
|
1096
3119
|
setup(input, (callback) => {
|
|
1097
|
-
setState("input", {
|
|
3120
|
+
setState("input", {
|
|
3121
|
+
cleanup: callback
|
|
3122
|
+
});
|
|
1098
3123
|
});
|
|
1099
3124
|
}
|
|
1100
3125
|
setState("input", {
|
|
@@ -1103,7 +3128,9 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1103
3128
|
visible: true,
|
|
1104
3129
|
resolve
|
|
1105
3130
|
});
|
|
1106
|
-
input.dispatchEvent(new InputEvent("input", {
|
|
3131
|
+
input.dispatchEvent(new InputEvent("input", {
|
|
3132
|
+
bubbles: true
|
|
3133
|
+
}));
|
|
1107
3134
|
};
|
|
1108
3135
|
},
|
|
1109
3136
|
music(source, method) {
|
|
@@ -1129,7 +3156,7 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1129
3156
|
return store.audio[method] = handle;
|
|
1130
3157
|
},
|
|
1131
3158
|
custom(fn, goingBack, resolve) {
|
|
1132
|
-
const get = (id,
|
|
3159
|
+
const get = (id, insert2 = true) => {
|
|
1133
3160
|
const cached = state.layers[id];
|
|
1134
3161
|
if (cached)
|
|
1135
3162
|
return cached.value;
|
|
@@ -1139,7 +3166,11 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1139
3166
|
const clearManager = () => {
|
|
1140
3167
|
clear(), setState("layers", id, void 0);
|
|
1141
3168
|
};
|
|
1142
|
-
const element =
|
|
3169
|
+
const element = insert2 ? (() => {
|
|
3170
|
+
const _el$4 = _tmpl$17();
|
|
3171
|
+
setAttribute(_el$4, "id", id);
|
|
3172
|
+
return _el$4;
|
|
3173
|
+
})() : null;
|
|
1143
3174
|
setState("layers", id, {
|
|
1144
3175
|
fn,
|
|
1145
3176
|
dom: element,
|
|
@@ -1165,7 +3196,11 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1165
3196
|
return result;
|
|
1166
3197
|
},
|
|
1167
3198
|
text(content, resolve, goingBack) {
|
|
1168
|
-
setState("text", {
|
|
3199
|
+
setState("text", {
|
|
3200
|
+
content,
|
|
3201
|
+
resolve,
|
|
3202
|
+
goingBack
|
|
3203
|
+
});
|
|
1169
3204
|
},
|
|
1170
3205
|
store,
|
|
1171
3206
|
ui: {
|
|
@@ -1174,72 +3209,20 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1174
3209
|
},
|
|
1175
3210
|
showExitPrompt() {
|
|
1176
3211
|
setState("exitPromptShown", true);
|
|
3212
|
+
},
|
|
3213
|
+
start() {
|
|
3214
|
+
unmount?.();
|
|
3215
|
+
unmount = render(() => createComponent(Novely, {}), target);
|
|
3216
|
+
return {
|
|
3217
|
+
unmount() {
|
|
3218
|
+
unmount?.();
|
|
3219
|
+
unmount = void 0;
|
|
3220
|
+
}
|
|
3221
|
+
};
|
|
1177
3222
|
}
|
|
1178
3223
|
}
|
|
1179
3224
|
};
|
|
1180
3225
|
},
|
|
1181
|
-
Novely(props) {
|
|
1182
|
-
createEffect5(() => {
|
|
1183
|
-
const screen = state.screen;
|
|
1184
|
-
if (fullscreen && document.fullscreenEnabled) {
|
|
1185
|
-
if (screen === "game" && !document.fullscreenElement) {
|
|
1186
|
-
document.documentElement.requestFullscreen().catch(() => {
|
|
1187
|
-
});
|
|
1188
|
-
} else if (screen === "mainmenu" && document.fullscreenElement && "exitFullscreen" in document) {
|
|
1189
|
-
document.exitFullscreen().catch(() => {
|
|
1190
|
-
});
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
});
|
|
1194
|
-
return <div {...props} ref={root}><Provider storeData={options.$} options={options} renderer={renderer}>
|
|
1195
|
-
<Switch>
|
|
1196
|
-
<Match when={state.screen === "game"}><Game
|
|
1197
|
-
state={state}
|
|
1198
|
-
setState={
|
|
1199
|
-
/* @once */
|
|
1200
|
-
setState
|
|
1201
|
-
}
|
|
1202
|
-
store={
|
|
1203
|
-
/* @once */
|
|
1204
|
-
store
|
|
1205
|
-
}
|
|
1206
|
-
characters={
|
|
1207
|
-
/* @once */
|
|
1208
|
-
characters
|
|
1209
|
-
}
|
|
1210
|
-
renderer={
|
|
1211
|
-
/* @once */
|
|
1212
|
-
renderer
|
|
1213
|
-
}
|
|
1214
|
-
controls={
|
|
1215
|
-
/* @once */
|
|
1216
|
-
controls
|
|
1217
|
-
}
|
|
1218
|
-
skipTypewriterWhenGoingBack={
|
|
1219
|
-
/* @once */
|
|
1220
|
-
skipTypewriterWhenGoingBack
|
|
1221
|
-
}
|
|
1222
|
-
/></Match>
|
|
1223
|
-
<Match when={state.screen === "mainmenu"}><MainMenu state={state} setState={
|
|
1224
|
-
/* @once */
|
|
1225
|
-
setState
|
|
1226
|
-
} /></Match>
|
|
1227
|
-
<Match when={state.screen === "saves"}><Saves setState={
|
|
1228
|
-
/* @once */
|
|
1229
|
-
setState
|
|
1230
|
-
} /></Match>
|
|
1231
|
-
<Match when={state.screen === "settings"}><Settings setState={
|
|
1232
|
-
/* @once */
|
|
1233
|
-
setState
|
|
1234
|
-
} /></Match>
|
|
1235
|
-
<Match when={state.screen === "loading"}><Loading /></Match>
|
|
1236
|
-
</Switch>
|
|
1237
|
-
<CustomScreen name={state.screen} state={state} setState={
|
|
1238
|
-
/* @once */
|
|
1239
|
-
setState
|
|
1240
|
-
} />
|
|
1241
|
-
</Provider></div>;
|
|
1242
|
-
},
|
|
1243
3226
|
registerScreen(name, screen) {
|
|
1244
3227
|
setState("screens", name, () => screen);
|
|
1245
3228
|
},
|
|
@@ -1248,6 +3231,7 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1248
3231
|
}
|
|
1249
3232
|
};
|
|
1250
3233
|
};
|
|
3234
|
+
delegateEvents(["input"]);
|
|
1251
3235
|
export {
|
|
1252
3236
|
createSolidRenderer
|
|
1253
3237
|
};
|