@novely/solid-renderer 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Icon.d.ts +2 -0
- package/dist/context/index.d.ts +4 -1
- package/dist/index.jsx +2494 -495
- package/dist/renderer.d.ts +12 -5
- package/dist/styles/index.css +3 -2
- 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,211 @@ 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"><span class="control-panel__button__content">`);
|
|
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
|
-
class
|
|
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(), _el$6 = _el$5.firstChild;
|
|
1852
|
+
_el$5.$$click = () => {
|
|
1853
|
+
props.setAuto((prev) => !prev);
|
|
1854
|
+
};
|
|
1855
|
+
insert(_el$6, () => data.t(props.auto() ? "Stop" : "Auto"));
|
|
1856
|
+
insert(_el$5, createComponent(Icon, {
|
|
1857
|
+
"class": "control-panel__button__icon",
|
|
1858
|
+
get children() {
|
|
1859
|
+
return createMemo(() => !!props.auto())() ? createComponent(Icon.Stop, {}) : createComponent(Icon.Play, {});
|
|
1860
|
+
}
|
|
1861
|
+
}), null);
|
|
1862
|
+
createRenderEffect(() => setAttribute(_el$5, "title", data.t(props.auto() ? "Stop" : "Auto")));
|
|
1863
|
+
return _el$5;
|
|
1864
|
+
})(), (() => {
|
|
1865
|
+
const _el$7 = _tmpl$2(), _el$8 = _el$7.firstChild;
|
|
1866
|
+
_el$7.$$click = () => {
|
|
1867
|
+
data.options.save(false, "auto");
|
|
1868
|
+
props.openSettings();
|
|
1869
|
+
};
|
|
1870
|
+
insert(_el$8, () => data.t("Settings"));
|
|
1871
|
+
insert(_el$7, createComponent(Icon, {
|
|
1872
|
+
"class": "control-panel__button__icon",
|
|
1873
|
+
get children() {
|
|
1874
|
+
return Icon.Settings();
|
|
1875
|
+
}
|
|
1876
|
+
}), null);
|
|
1877
|
+
createRenderEffect(() => setAttribute(_el$7, "title", data.t("Settings")));
|
|
1878
|
+
return _el$7;
|
|
1879
|
+
})(), (() => {
|
|
1880
|
+
const _el$9 = _tmpl$2(), _el$10 = _el$9.firstChild;
|
|
1881
|
+
_el$9.$$click = () => {
|
|
1882
|
+
data.options.exit();
|
|
1883
|
+
};
|
|
1884
|
+
insert(_el$10, () => data.t("Exit"));
|
|
1885
|
+
insert(_el$9, createComponent(Icon, {
|
|
1886
|
+
"class": "control-panel__button__icon",
|
|
1887
|
+
get children() {
|
|
1888
|
+
return Icon.Exit();
|
|
1889
|
+
}
|
|
1890
|
+
}), null);
|
|
1891
|
+
createRenderEffect(() => setAttribute(_el$9, "title", data.t("Exit")));
|
|
1892
|
+
return _el$9;
|
|
1893
|
+
})(), createComponent(Show, {
|
|
1894
|
+
get when() {
|
|
1895
|
+
return data.media.hyperWide();
|
|
1896
|
+
},
|
|
1897
|
+
get children() {
|
|
1898
|
+
const _el$11 = _tmpl$3();
|
|
1899
|
+
_el$11.$$click = () => {
|
|
209
1900
|
props.closeDropdown();
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
1901
|
+
};
|
|
1902
|
+
insert(_el$11, createComponent(Icon, {
|
|
1903
|
+
get children() {
|
|
1904
|
+
return Icon.Close();
|
|
1905
|
+
}
|
|
1906
|
+
}));
|
|
1907
|
+
createRenderEffect(() => setAttribute(_el$11, "title", data.t("CloseMenu")));
|
|
1908
|
+
return _el$11;
|
|
1909
|
+
}
|
|
1910
|
+
})];
|
|
213
1911
|
};
|
|
1912
|
+
delegateEvents(["click"]);
|
|
214
1913
|
|
|
215
1914
|
// src/components/DialogName.tsx
|
|
1915
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<span class="action-dialog-name">`);
|
|
216
1916
|
var DialogName = (props) => {
|
|
217
1917
|
const color = () => {
|
|
218
1918
|
const c = props.character;
|
|
219
1919
|
const cs = props.characters;
|
|
220
1920
|
return c ? c in cs ? cs[c].color : "#000" : "#000";
|
|
221
1921
|
};
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
1922
|
+
return (() => {
|
|
1923
|
+
const _el$ = _tmpl$4();
|
|
1924
|
+
insert(_el$, () => props.name || " ");
|
|
1925
|
+
createRenderEffect((_p$) => {
|
|
1926
|
+
const _v$ = color(), _v$2 = props.character ? 1 : 0, _v$3 = props.character ? "visible" : "hidden";
|
|
1927
|
+
_v$ !== _p$._v$ && ((_p$._v$ = _v$) != null ? _el$.style.setProperty("color", _v$) : _el$.style.removeProperty("color"));
|
|
1928
|
+
_v$2 !== _p$._v$2 && ((_p$._v$2 = _v$2) != null ? _el$.style.setProperty("opacity", _v$2) : _el$.style.removeProperty("opacity"));
|
|
1929
|
+
_v$3 !== _p$._v$3 && ((_p$._v$3 = _v$3) != null ? _el$.style.setProperty("visibility", _v$3) : _el$.style.removeProperty("visibility"));
|
|
1930
|
+
return _p$;
|
|
1931
|
+
}, {
|
|
1932
|
+
_v$: void 0,
|
|
1933
|
+
_v$2: void 0,
|
|
1934
|
+
_v$3: void 0
|
|
1935
|
+
});
|
|
1936
|
+
return _el$;
|
|
1937
|
+
})();
|
|
230
1938
|
};
|
|
231
1939
|
|
|
232
1940
|
// src/components/Icon.tsx
|
|
1941
|
+
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">`);
|
|
1942
|
+
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);
|
|
1943
|
+
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);
|
|
1944
|
+
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);
|
|
1945
|
+
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);
|
|
1946
|
+
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);
|
|
1947
|
+
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);
|
|
1948
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<svg><path d="M4.75 5.75h14.5M4.75 18.25h14.5M4.75 12h14.5"></svg>`, false, true);
|
|
1949
|
+
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);
|
|
1950
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<svg><path d="M4.75 6.75a2 2 0 0 1 2-2h10.5a2 2 0 0 1 2 2v10.5a2 2 0 0 1-2 2H6.75a2 2 0 0 1-2-2V6.75Z"></svg>`, false, true);
|
|
1951
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<svg><path d="m15.25 12-5.5-3.25v6.5l5.5-3.25Z"></svg>`, false, true);
|
|
1952
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<svg><rect width="12.5" height="12.5" x="5.75" y="5.75" rx="1"></svg>`, false, true);
|
|
233
1953
|
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>;
|
|
1954
|
+
return (() => {
|
|
1955
|
+
const _el$ = _tmpl$5();
|
|
1956
|
+
spread(_el$, props, true, true);
|
|
1957
|
+
insert(_el$, () => props.children);
|
|
1958
|
+
return _el$;
|
|
1959
|
+
})();
|
|
245
1960
|
};
|
|
246
1961
|
Icon.Back = () => {
|
|
247
|
-
return
|
|
1962
|
+
return _tmpl$23();
|
|
248
1963
|
};
|
|
249
1964
|
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
|
-
</>;
|
|
1965
|
+
return [_tmpl$32(), _tmpl$42()];
|
|
254
1966
|
};
|
|
255
1967
|
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
|
-
</>;
|
|
1968
|
+
return [_tmpl$52(), _tmpl$6()];
|
|
260
1969
|
};
|
|
261
1970
|
Icon.Exit = () => {
|
|
262
|
-
return
|
|
1971
|
+
return _tmpl$7();
|
|
263
1972
|
};
|
|
264
1973
|
Icon.Menu = () => {
|
|
265
|
-
return
|
|
1974
|
+
return _tmpl$8();
|
|
266
1975
|
};
|
|
267
1976
|
Icon.Close = () => {
|
|
268
|
-
return
|
|
1977
|
+
return _tmpl$9();
|
|
1978
|
+
};
|
|
1979
|
+
Icon.Play = () => {
|
|
1980
|
+
return [_tmpl$10(), _tmpl$11()];
|
|
1981
|
+
};
|
|
1982
|
+
Icon.Stop = () => {
|
|
1983
|
+
return _tmpl$12();
|
|
269
1984
|
};
|
|
270
|
-
|
|
271
|
-
// src/components/Modal.tsx
|
|
272
|
-
import { untrack, createEffect as createEffect2, on, onCleanup as onCleanup3, Show as Show4 } from "solid-js";
|
|
273
1985
|
|
|
274
1986
|
// src/actions.ts
|
|
275
|
-
import { onCleanup as onCleanup2 } from "solid-js";
|
|
276
1987
|
var clickOutside = (node, handler) => {
|
|
277
1988
|
const handleClick = (event) => node && !node.contains(event.target) && !event.defaultPrevented && handler && handler();
|
|
278
1989
|
document.addEventListener("click", handleClick, true);
|
|
279
|
-
|
|
1990
|
+
onCleanup(() => document.removeEventListener("click", handleClick, true));
|
|
280
1991
|
};
|
|
281
1992
|
|
|
282
1993
|
// src/components/Modal.tsx
|
|
1994
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div role="dialog" class="dialog">`);
|
|
283
1995
|
var Modal = (props) => {
|
|
284
1996
|
let modalWindow;
|
|
285
1997
|
const handleKeydown = (event) => {
|
|
@@ -305,23 +2017,28 @@ var Modal = (props) => {
|
|
|
305
2017
|
props.setIsOpen && props.setIsOpen(false);
|
|
306
2018
|
props.onClose && untrack(props.onClose);
|
|
307
2019
|
};
|
|
308
|
-
|
|
2020
|
+
createEffect(on(props.isOpen, (isOpen) => isOpen && props.onClose && untrack(props.onClose), {
|
|
2021
|
+
defer: true
|
|
2022
|
+
}));
|
|
309
2023
|
addEventListener("keydown", handleKeydown);
|
|
310
|
-
|
|
311
|
-
return
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
2024
|
+
onCleanup(() => removeEventListener("keydown", handleKeydown));
|
|
2025
|
+
return createComponent(Show, {
|
|
2026
|
+
get when() {
|
|
2027
|
+
return props.isOpen();
|
|
2028
|
+
},
|
|
2029
|
+
get children() {
|
|
2030
|
+
const _el$ = _tmpl$13();
|
|
2031
|
+
use((element) => {
|
|
2032
|
+
modalWindow = element;
|
|
2033
|
+
clickOutside(element, close);
|
|
2034
|
+
}, _el$);
|
|
2035
|
+
setAttribute(_el$, "aria-modal", true);
|
|
2036
|
+
insert(_el$, () => props.children);
|
|
2037
|
+
return _el$;
|
|
2038
|
+
}
|
|
2039
|
+
});
|
|
320
2040
|
};
|
|
321
2041
|
|
|
322
|
-
// src/components/Typewriter.tsx
|
|
323
|
-
import { untrack as untrack2, createEffect as createEffect3, onCleanup as onCleanup4, createSignal as createSignal3 } from "solid-js";
|
|
324
|
-
|
|
325
2042
|
// ../typewriter/dist/index.js
|
|
326
2043
|
var defaultSpeed = () => {
|
|
327
2044
|
return Math.min(90 * Math.random() + 100, 90);
|
|
@@ -442,14 +2159,17 @@ var TEXT_SPEED_MAP = {
|
|
|
442
2159
|
};
|
|
443
2160
|
|
|
444
2161
|
// src/components/Typewriter.tsx
|
|
2162
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<span>`);
|
|
445
2163
|
var PRM = matchMedia("(prefers-reduced-motion: reduce)");
|
|
446
|
-
var createTypewriter = ({
|
|
2164
|
+
var createTypewriter = ({
|
|
2165
|
+
resolve
|
|
2166
|
+
}) => {
|
|
447
2167
|
let bypassed = false;
|
|
448
2168
|
let typewriter2;
|
|
449
|
-
const [state, setState] =
|
|
2169
|
+
const [state, setState] = createSignal("idle");
|
|
450
2170
|
const Typewriter = (props) => {
|
|
451
2171
|
let node;
|
|
452
|
-
|
|
2172
|
+
createEffect(() => {
|
|
453
2173
|
const text = props.content;
|
|
454
2174
|
typewriter2?.destroy();
|
|
455
2175
|
setState("idle");
|
|
@@ -457,7 +2177,7 @@ var createTypewriter = ({ resolve }) => {
|
|
|
457
2177
|
return;
|
|
458
2178
|
if (!node)
|
|
459
2179
|
return;
|
|
460
|
-
if (PRM.matches ||
|
|
2180
|
+
if (PRM.matches || untrack(() => props.ignore)) {
|
|
461
2181
|
node.innerHTML = text;
|
|
462
2182
|
bypassed = true;
|
|
463
2183
|
setState("done");
|
|
@@ -469,18 +2189,24 @@ var createTypewriter = ({ resolve }) => {
|
|
|
469
2189
|
text,
|
|
470
2190
|
ended() {
|
|
471
2191
|
setState("done");
|
|
472
|
-
|
|
2192
|
+
untrack(() => props.ended(PRM.matches));
|
|
473
2193
|
},
|
|
474
|
-
speed: TEXT_SPEED_MAP[
|
|
2194
|
+
speed: TEXT_SPEED_MAP[untrack(() => props.speed)]
|
|
475
2195
|
});
|
|
476
2196
|
bypassed = false;
|
|
477
2197
|
});
|
|
478
|
-
|
|
2198
|
+
onCleanup(() => {
|
|
479
2199
|
setState("idle");
|
|
480
2200
|
typewriter2?.destroy();
|
|
481
2201
|
bypassed = false;
|
|
482
2202
|
});
|
|
483
|
-
return
|
|
2203
|
+
return (() => {
|
|
2204
|
+
const _el$ = _tmpl$14();
|
|
2205
|
+
const _ref$ = node;
|
|
2206
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : node = _el$;
|
|
2207
|
+
spread(_el$, mergeProps(() => props.attributes), false, false);
|
|
2208
|
+
return _el$;
|
|
2209
|
+
})();
|
|
484
2210
|
};
|
|
485
2211
|
const clear = () => {
|
|
486
2212
|
const reduced = PRM.matches;
|
|
@@ -501,9 +2227,24 @@ var createTypewriter = ({ resolve }) => {
|
|
|
501
2227
|
};
|
|
502
2228
|
|
|
503
2229
|
// src/screens/game.tsx
|
|
2230
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<div class="dialog-container"><span class="dialog-fix" aria-hidden="true">​</span><div class="dialog-panel"><span class="dialog-panel-label">`);
|
|
2231
|
+
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">`);
|
|
2232
|
+
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">`);
|
|
2233
|
+
var _tmpl$43 = /* @__PURE__ */ template(`<button type="button" class="button control-panel__button">`);
|
|
2234
|
+
var _tmpl$53 = /* @__PURE__ */ template(`<span class="control-panel-container-fix" aria-hidden="true">​`);
|
|
2235
|
+
var _tmpl$62 = /* @__PURE__ */ template(`<div class="control-panel-container-backdrop">`);
|
|
2236
|
+
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">`);
|
|
2237
|
+
var _tmpl$82 = /* @__PURE__ */ template(`<button type="button" class="button">`);
|
|
504
2238
|
var Game = (props) => {
|
|
505
2239
|
const data = useData();
|
|
506
|
-
const {
|
|
2240
|
+
const {
|
|
2241
|
+
setState,
|
|
2242
|
+
characters,
|
|
2243
|
+
store,
|
|
2244
|
+
renderer,
|
|
2245
|
+
controls,
|
|
2246
|
+
skipTypewriterWhenGoingBack
|
|
2247
|
+
} = props;
|
|
507
2248
|
const background = () => {
|
|
508
2249
|
const is = isCSSImage(props.state.background);
|
|
509
2250
|
return {
|
|
@@ -511,7 +2252,7 @@ var Game = (props) => {
|
|
|
511
2252
|
"background-color": is ? void 0 : props.state.background
|
|
512
2253
|
};
|
|
513
2254
|
};
|
|
514
|
-
const [auto, setAuto] =
|
|
2255
|
+
const [auto, setAuto] = createSignal(false);
|
|
515
2256
|
const onChoicesButtonClick = ([disabled, i]) => {
|
|
516
2257
|
if (disabled)
|
|
517
2258
|
return;
|
|
@@ -543,20 +2284,23 @@ var Game = (props) => {
|
|
|
543
2284
|
const speed = () => data.storeData().meta[1];
|
|
544
2285
|
const onWriterEnd = (cb) => {
|
|
545
2286
|
return (prm) => {
|
|
546
|
-
const next =
|
|
2287
|
+
const next = untrack(auto);
|
|
547
2288
|
if (!next)
|
|
548
2289
|
return;
|
|
549
2290
|
if (prm) {
|
|
550
2291
|
setAuto(false);
|
|
551
2292
|
} else {
|
|
552
|
-
|
|
2293
|
+
untrack(cb);
|
|
553
2294
|
}
|
|
554
2295
|
};
|
|
555
2296
|
};
|
|
556
2297
|
const TextWriter = createTypewriter({
|
|
557
2298
|
resolve() {
|
|
558
2299
|
const resolve = props.state.text.resolve;
|
|
559
|
-
setState("text", {
|
|
2300
|
+
setState("text", {
|
|
2301
|
+
content: "",
|
|
2302
|
+
resolve: void 0
|
|
2303
|
+
});
|
|
560
2304
|
resolve();
|
|
561
2305
|
}
|
|
562
2306
|
});
|
|
@@ -575,218 +2319,321 @@ var Game = (props) => {
|
|
|
575
2319
|
}
|
|
576
2320
|
});
|
|
577
2321
|
const controlPanelMenuID = createUniqueId();
|
|
578
|
-
const [controlPanelMenuExpanded, setControlPanelMenuExpanded] =
|
|
579
|
-
|
|
2322
|
+
const [controlPanelMenuExpanded, setControlPanelMenuExpanded] = createSignal(false);
|
|
2323
|
+
createEffect(() => {
|
|
580
2324
|
if (!data.media.hyperWide()) {
|
|
581
2325
|
setControlPanelMenuExpanded(false);
|
|
582
2326
|
}
|
|
583
2327
|
});
|
|
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);
|
|
2328
|
+
return (() => {
|
|
2329
|
+
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;
|
|
2330
|
+
setAttribute(_el$2, "data-characters", true);
|
|
2331
|
+
insert(_el$2, createComponent(For, {
|
|
2332
|
+
get each() {
|
|
2333
|
+
return Object.entries(props.state.characters);
|
|
2334
|
+
},
|
|
2335
|
+
children: ([character, data2]) => createComponent(Show, {
|
|
2336
|
+
get when() {
|
|
2337
|
+
return data2.visible;
|
|
2338
|
+
},
|
|
2339
|
+
get children() {
|
|
2340
|
+
return createComponent(Character, {
|
|
2341
|
+
character,
|
|
2342
|
+
data: data2,
|
|
2343
|
+
get characters() {
|
|
2344
|
+
return store.characters;
|
|
744
2345
|
}
|
|
745
2346
|
});
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
2347
|
+
}
|
|
2348
|
+
})
|
|
2349
|
+
}));
|
|
2350
|
+
insert(_el$3, createComponent(DialogName, {
|
|
2351
|
+
get character() {
|
|
2352
|
+
return props.state.dialog.character;
|
|
2353
|
+
},
|
|
2354
|
+
get name() {
|
|
2355
|
+
return props.state.dialog.name;
|
|
2356
|
+
},
|
|
2357
|
+
characters
|
|
2358
|
+
}), _el$4);
|
|
2359
|
+
addEventListener2(_el$4, "keydown", onKey(DialogWriter.clear, " "), true);
|
|
2360
|
+
addEventListener2(_el$4, "keypress", onKey(DialogWriter.clear, "Enter"));
|
|
2361
|
+
addEventListener2(_el$4, "click", DialogWriter.clear, true);
|
|
2362
|
+
insert(_el$5, createComponent(Show, {
|
|
2363
|
+
get when() {
|
|
2364
|
+
return props.state.dialog.emotion;
|
|
2365
|
+
},
|
|
2366
|
+
keyed: true,
|
|
2367
|
+
children: (emotion) => {
|
|
2368
|
+
const character = props.state.dialog.character;
|
|
2369
|
+
if (!character)
|
|
2370
|
+
return null;
|
|
2371
|
+
if (!store["characters"][character] || !store["characters"][character]["emotions"][emotion]) {
|
|
2372
|
+
renderer.character(character).withEmotion(emotion);
|
|
2373
|
+
}
|
|
2374
|
+
const image = store["characters"][character]["emotions"][emotion];
|
|
2375
|
+
if ("src" in image)
|
|
2376
|
+
return image;
|
|
2377
|
+
const [canvas] = canvasDrawImages(void 0, void 0, Object.values(image));
|
|
2378
|
+
return canvas;
|
|
2379
|
+
}
|
|
2380
|
+
}));
|
|
2381
|
+
insert(_el$6, createComponent(DialogWriter.Typewriter, {
|
|
2382
|
+
get attributes() {
|
|
2383
|
+
return {
|
|
2384
|
+
title: DialogWriter.state() === "idle" ? void 0 : data.t(DialogWriter.state() === "processing" ? "CompleteText" : "GoForward")
|
|
2385
|
+
};
|
|
2386
|
+
},
|
|
2387
|
+
get content() {
|
|
2388
|
+
return props.state.dialog.content;
|
|
2389
|
+
},
|
|
2390
|
+
get ignore() {
|
|
2391
|
+
return skipTypewriterWhenGoingBack && props.state.dialog.goingBack;
|
|
2392
|
+
},
|
|
2393
|
+
get speed() {
|
|
2394
|
+
return speed();
|
|
2395
|
+
},
|
|
2396
|
+
get ended() {
|
|
2397
|
+
return onWriterEnd(DialogWriter.clear);
|
|
2398
|
+
}
|
|
2399
|
+
}));
|
|
2400
|
+
insert(_el$, createComponent(Modal, {
|
|
2401
|
+
isOpen: () => props.state.choices.visible,
|
|
2402
|
+
trapFocus: () => !props.state.exitPromptShown,
|
|
2403
|
+
get children() {
|
|
2404
|
+
const _el$7 = _tmpl$15(), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$10 = _el$9.firstChild;
|
|
2405
|
+
insert(_el$10, () => props.state.choices.question || " ");
|
|
2406
|
+
insert(_el$9, createComponent(For, {
|
|
2407
|
+
get each() {
|
|
2408
|
+
return props.state.choices.choices;
|
|
2409
|
+
},
|
|
2410
|
+
children: ([text, , active], i) => {
|
|
2411
|
+
const disabled = active ? !active() : false;
|
|
2412
|
+
const index = i();
|
|
2413
|
+
return (() => {
|
|
2414
|
+
const _el$33 = _tmpl$82();
|
|
2415
|
+
_el$33.$$click = onChoicesButtonClick;
|
|
2416
|
+
_el$33.$$clickData = [disabled, index];
|
|
2417
|
+
setAttribute(_el$33, "aria-disabled", disabled);
|
|
2418
|
+
insert(_el$33, text);
|
|
2419
|
+
return _el$33;
|
|
2420
|
+
})();
|
|
2421
|
+
}
|
|
2422
|
+
}), null);
|
|
2423
|
+
createRenderEffect((_p$) => {
|
|
2424
|
+
const _v$ = Boolean(props.state.choices.question), _v$2 = !props.state.choices.question;
|
|
2425
|
+
_v$ !== _p$._v$ && setAttribute(_el$10, "data-used", _p$._v$ = _v$);
|
|
2426
|
+
_v$2 !== _p$._v$2 && setAttribute(_el$10, "aria-hidden", _p$._v$2 = _v$2);
|
|
2427
|
+
return _p$;
|
|
2428
|
+
}, {
|
|
2429
|
+
_v$: void 0,
|
|
2430
|
+
_v$2: void 0
|
|
2431
|
+
});
|
|
2432
|
+
return _el$7;
|
|
2433
|
+
}
|
|
2434
|
+
}), _el$26);
|
|
2435
|
+
insert(_el$, createComponent(Modal, {
|
|
2436
|
+
isOpen: () => props.state.input.visible,
|
|
2437
|
+
trapFocus: () => !props.state.exitPromptShown,
|
|
2438
|
+
get children() {
|
|
2439
|
+
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;
|
|
2440
|
+
insert(_el$15, () => props.state.input.question);
|
|
2441
|
+
insert(_el$14, () => props.state.input.element, _el$16);
|
|
2442
|
+
insert(_el$16, () => props.state.input.error);
|
|
2443
|
+
_el$17.$$click = onInputButtonClick;
|
|
2444
|
+
insert(_el$17, () => data.t("Sumbit"));
|
|
2445
|
+
createRenderEffect(() => setAttribute(_el$17, "aria-disabled", Boolean(props.state.input.error)));
|
|
2446
|
+
return _el$11;
|
|
2447
|
+
}
|
|
2448
|
+
}), _el$26);
|
|
2449
|
+
insert(_el$, createComponent(Modal, {
|
|
2450
|
+
isOpen: () => props.state.exitPromptShown,
|
|
2451
|
+
trapFocus: () => props.state.exitPromptShown,
|
|
2452
|
+
get children() {
|
|
2453
|
+
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;
|
|
2454
|
+
insert(_el$22, () => data.t("ExitDialogWarning"));
|
|
2455
|
+
_el$24.$$click = () => {
|
|
2456
|
+
setState("exitPromptShown", false);
|
|
2457
|
+
};
|
|
2458
|
+
insert(_el$24, () => data.t("ExitDialogBack"));
|
|
2459
|
+
_el$25.$$click = () => {
|
|
2460
|
+
data.options.exit(true);
|
|
2461
|
+
};
|
|
2462
|
+
insert(_el$25, () => data.t("ExitDialogExit"));
|
|
2463
|
+
return _el$18;
|
|
2464
|
+
}
|
|
2465
|
+
}), _el$26);
|
|
2466
|
+
setAttribute(_el$26, "data-custom", true);
|
|
2467
|
+
insert(_el$26, createComponent(For, {
|
|
2468
|
+
get each() {
|
|
2469
|
+
return layers();
|
|
2470
|
+
},
|
|
2471
|
+
children: (value) => value.dom
|
|
2472
|
+
}));
|
|
2473
|
+
addEventListener2(_el$27, "keydown", onKey(TextWriter.clear, " "), true);
|
|
2474
|
+
addEventListener2(_el$27, "keypress", onKey(TextWriter.clear, "Enter"));
|
|
2475
|
+
addEventListener2(_el$27, "click", TextWriter.clear, true);
|
|
2476
|
+
insert(_el$27, createComponent(TextWriter.Typewriter, {
|
|
2477
|
+
get attributes() {
|
|
2478
|
+
return {
|
|
2479
|
+
title: TextWriter.state() === "idle" ? void 0 : data.t(TextWriter.state() === "processing" ? "CompleteText" : "GoForward")
|
|
2480
|
+
};
|
|
2481
|
+
},
|
|
2482
|
+
get content() {
|
|
2483
|
+
return props.state.text.content;
|
|
2484
|
+
},
|
|
2485
|
+
get ignore() {
|
|
2486
|
+
return skipTypewriterWhenGoingBack && props.state.text.goingBack;
|
|
2487
|
+
},
|
|
2488
|
+
get speed() {
|
|
2489
|
+
return speed();
|
|
2490
|
+
},
|
|
2491
|
+
get ended() {
|
|
2492
|
+
return onWriterEnd(TextWriter.clear);
|
|
2493
|
+
}
|
|
2494
|
+
}));
|
|
2495
|
+
insert(_el$28, createComponent(Show, {
|
|
2496
|
+
get when() {
|
|
2497
|
+
return data.media.hyperWide();
|
|
2498
|
+
},
|
|
2499
|
+
get children() {
|
|
2500
|
+
return createComponent(Show, {
|
|
2501
|
+
get when() {
|
|
2502
|
+
return !controlPanelMenuExpanded();
|
|
2503
|
+
},
|
|
2504
|
+
get children() {
|
|
2505
|
+
const _el$29 = _tmpl$43();
|
|
2506
|
+
_el$29.$$click = () => {
|
|
2507
|
+
setControlPanelMenuExpanded((prev) => !prev);
|
|
2508
|
+
};
|
|
2509
|
+
setAttribute(_el$29, "aria-controls", controlPanelMenuID);
|
|
2510
|
+
insert(_el$29, createComponent(Icon, {
|
|
2511
|
+
get children() {
|
|
2512
|
+
return Icon.Menu();
|
|
2513
|
+
}
|
|
2514
|
+
}));
|
|
2515
|
+
createRenderEffect((_p$) => {
|
|
2516
|
+
const _v$3 = data.t("OpenMenu"), _v$4 = controlPanelMenuExpanded();
|
|
2517
|
+
_v$3 !== _p$._v$3 && setAttribute(_el$29, "title", _p$._v$3 = _v$3);
|
|
2518
|
+
_v$4 !== _p$._v$4 && setAttribute(_el$29, "aria-expanded", _p$._v$4 = _v$4);
|
|
2519
|
+
return _p$;
|
|
2520
|
+
}, {
|
|
2521
|
+
_v$3: void 0,
|
|
2522
|
+
_v$4: void 0
|
|
2523
|
+
});
|
|
2524
|
+
return _el$29;
|
|
2525
|
+
}
|
|
2526
|
+
});
|
|
2527
|
+
}
|
|
2528
|
+
}), _el$32);
|
|
2529
|
+
insert(_el$28, createComponent(Show, {
|
|
2530
|
+
get when() {
|
|
2531
|
+
return data.media.hyperWide() && controlPanelMenuExpanded() && !props.state.exitPromptShown;
|
|
2532
|
+
},
|
|
2533
|
+
get children() {
|
|
2534
|
+
return [_tmpl$53(), _tmpl$62()];
|
|
2535
|
+
}
|
|
2536
|
+
}), _el$32);
|
|
2537
|
+
use((element) => {
|
|
2538
|
+
clickOutside(element, () => {
|
|
2539
|
+
if (untrack(data.media.hyperWide) && untrack(controlPanelMenuExpanded)) {
|
|
752
2540
|
setControlPanelMenuExpanded(false);
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
2541
|
+
}
|
|
2542
|
+
});
|
|
2543
|
+
}, _el$32);
|
|
2544
|
+
setAttribute(_el$32, "id", controlPanelMenuID);
|
|
2545
|
+
_el$32.classList.toggle("control-panel-container--center", !!(controls === "inside"));
|
|
2546
|
+
insert(_el$32, createComponent(ControlPanelButtons, {
|
|
2547
|
+
openSettings: () => {
|
|
2548
|
+
props.setState("screen", "settings");
|
|
2549
|
+
},
|
|
2550
|
+
closeDropdown: () => {
|
|
2551
|
+
setControlPanelMenuExpanded(false);
|
|
2552
|
+
},
|
|
2553
|
+
auto,
|
|
2554
|
+
setAuto
|
|
2555
|
+
}));
|
|
2556
|
+
createRenderEffect((_p$) => {
|
|
2557
|
+
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());
|
|
2558
|
+
_p$._v$5 = style(_el$, _v$5, _p$._v$5);
|
|
2559
|
+
_v$6 !== _p$._v$6 && _el$3.classList.toggle("action-dialog--visible", _p$._v$6 = _v$6);
|
|
2560
|
+
_v$7 !== _p$._v$7 && _el$3.classList.toggle("action-dialog--hidden", _p$._v$7 = _v$7);
|
|
2561
|
+
_v$8 !== _p$._v$8 && setAttribute(_el$4, "data-no-person", _p$._v$8 = _v$8);
|
|
2562
|
+
_v$9 !== _p$._v$9 && setAttribute(_el$4, "aria-disabled", _p$._v$9 = _v$9);
|
|
2563
|
+
_v$10 !== _p$._v$10 && setAttribute(_el$27, "data-shown", _p$._v$10 = _v$10);
|
|
2564
|
+
_v$11 !== _p$._v$11 && setAttribute(_el$27, "aria-disabled", _p$._v$11 = _v$11);
|
|
2565
|
+
_v$12 !== _p$._v$12 && _el$32.classList.toggle("control-panel-container--wide-closed", _p$._v$12 = _v$12);
|
|
2566
|
+
_v$13 !== _p$._v$13 && _el$32.classList.toggle("control-panel-container--wide-open", _p$._v$13 = _v$13);
|
|
2567
|
+
return _p$;
|
|
2568
|
+
}, {
|
|
2569
|
+
_v$5: void 0,
|
|
2570
|
+
_v$6: void 0,
|
|
2571
|
+
_v$7: void 0,
|
|
2572
|
+
_v$8: void 0,
|
|
2573
|
+
_v$9: void 0,
|
|
2574
|
+
_v$10: void 0,
|
|
2575
|
+
_v$11: void 0,
|
|
2576
|
+
_v$12: void 0,
|
|
2577
|
+
_v$13: void 0
|
|
2578
|
+
});
|
|
2579
|
+
return _el$;
|
|
2580
|
+
})();
|
|
759
2581
|
};
|
|
2582
|
+
delegateEvents(["click", "keydown"]);
|
|
760
2583
|
|
|
761
2584
|
// src/screens/loading.tsx
|
|
2585
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<div class="root loading"><div class="loading__animation"><div></div><div></div><div></div><div>`);
|
|
762
2586
|
var Loading = () => {
|
|
763
|
-
return
|
|
764
|
-
<div />
|
|
765
|
-
<div />
|
|
766
|
-
<div />
|
|
767
|
-
<div />
|
|
768
|
-
</div></div>;
|
|
2587
|
+
return _tmpl$16();
|
|
769
2588
|
};
|
|
770
2589
|
|
|
771
2590
|
// src/screens/mainmenu.tsx
|
|
772
|
-
|
|
2591
|
+
var _tmpl$17 = /* @__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">`);
|
|
2592
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<button>`);
|
|
773
2593
|
var MainMenu = (props) => {
|
|
774
2594
|
const data = useData();
|
|
775
2595
|
const language = () => data.storeData().meta[0];
|
|
776
|
-
const goto = (screen) => {
|
|
2596
|
+
const goto = simple((screen) => {
|
|
2597
|
+
if (!data.coreData().dataLoaded)
|
|
2598
|
+
return;
|
|
777
2599
|
props.setState("screen", screen);
|
|
778
|
-
};
|
|
779
|
-
return
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
2600
|
+
});
|
|
2601
|
+
return (() => {
|
|
2602
|
+
const _el$ = _tmpl$17(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling;
|
|
2603
|
+
addEventListener2(_el$2, "click", data.options.newGame, true);
|
|
2604
|
+
insert(_el$2, () => data.t("NewGame"));
|
|
2605
|
+
_el$3.$$click = () => data.options.restore();
|
|
2606
|
+
insert(_el$3, () => data.t("LoadSave"));
|
|
2607
|
+
_el$4.$$click = () => props.setState("screen", "saves");
|
|
2608
|
+
insert(_el$4, () => data.t("Saves"));
|
|
2609
|
+
_el$5.$$click = () => props.setState("screen", "settings");
|
|
2610
|
+
insert(_el$5, () => data.t("Settings"));
|
|
2611
|
+
insert(_el$, createComponent(Show, {
|
|
2612
|
+
get when() {
|
|
2613
|
+
return language();
|
|
2614
|
+
},
|
|
2615
|
+
keyed: true,
|
|
2616
|
+
children: (_) => createComponent(For, {
|
|
2617
|
+
get each() {
|
|
2618
|
+
return props.state.mainmenu.items;
|
|
2619
|
+
},
|
|
2620
|
+
children: (item) => (() => {
|
|
2621
|
+
const _el$6 = _tmpl$25();
|
|
2622
|
+
spread(_el$6, mergeProps(() => item(goto)), false, false);
|
|
2623
|
+
return _el$6;
|
|
2624
|
+
})()
|
|
2625
|
+
})
|
|
2626
|
+
}), null);
|
|
2627
|
+
return _el$;
|
|
2628
|
+
})();
|
|
786
2629
|
};
|
|
2630
|
+
delegateEvents(["click"]);
|
|
787
2631
|
|
|
788
2632
|
// src/screens/saves.tsx
|
|
789
|
-
|
|
2633
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<ol class="saves__list">`);
|
|
2634
|
+
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">`);
|
|
2635
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<div class="saves__list saves__list--empty">`);
|
|
2636
|
+
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
2637
|
var Saves = (props) => {
|
|
791
2638
|
const data = useData();
|
|
792
2639
|
const saves = () => data.storeData().saves;
|
|
@@ -797,89 +2644,149 @@ var Saves = (props) => {
|
|
|
797
2644
|
return prev;
|
|
798
2645
|
});
|
|
799
2646
|
};
|
|
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
|
-
|
|
2647
|
+
return (() => {
|
|
2648
|
+
const _el$ = _tmpl$26(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
|
|
2649
|
+
_el$3.$$click = () => props.setState("screen", "mainmenu");
|
|
2650
|
+
insert(_el$3, () => data.t("GoBack"));
|
|
2651
|
+
insert(_el$4, createComponent(Show, {
|
|
2652
|
+
get when() {
|
|
2653
|
+
return saves().length > 0;
|
|
2654
|
+
},
|
|
2655
|
+
get fallback() {
|
|
2656
|
+
return (() => {
|
|
2657
|
+
const _el$6 = _tmpl$34();
|
|
2658
|
+
insert(_el$6, () => data.t("NoSaves"));
|
|
2659
|
+
return _el$6;
|
|
2660
|
+
})();
|
|
2661
|
+
},
|
|
2662
|
+
get children() {
|
|
2663
|
+
const _el$5 = _tmpl$18();
|
|
2664
|
+
insert(_el$5, createComponent(For, {
|
|
2665
|
+
get each() {
|
|
2666
|
+
return saves();
|
|
2667
|
+
},
|
|
2668
|
+
children: (save) => {
|
|
2669
|
+
const [date, type] = save[2];
|
|
2670
|
+
const stringDate = capitalize(new Date(date).toLocaleDateString(language(), {
|
|
2671
|
+
weekday: "long",
|
|
2672
|
+
year: "numeric",
|
|
2673
|
+
month: "long",
|
|
2674
|
+
day: "numeric",
|
|
2675
|
+
hour: "numeric",
|
|
2676
|
+
minute: "numeric",
|
|
2677
|
+
second: "numeric"
|
|
2678
|
+
}));
|
|
2679
|
+
const stringType = data.t(type === "auto" ? "Automatic" : "Manual");
|
|
2680
|
+
return (() => {
|
|
2681
|
+
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;
|
|
2682
|
+
_el$8.$$click = () => data.options.set(save);
|
|
2683
|
+
insert(_el$9, stringDate);
|
|
2684
|
+
insert(_el$10, stringType);
|
|
2685
|
+
_el$11.$$click = removeSave;
|
|
2686
|
+
_el$11.$$clickData = date;
|
|
2687
|
+
insert(_el$12, () => data.t("Remove"));
|
|
2688
|
+
createRenderEffect((_p$) => {
|
|
2689
|
+
const _v$ = data.t("LoadASaveFrom") + " " + stringDate, _v$2 = data.t("DeleteASaveFrom") + " " + stringDate;
|
|
2690
|
+
_v$ !== _p$._v$ && setAttribute(_el$8, "aria-label", _p$._v$ = _v$);
|
|
2691
|
+
_v$2 !== _p$._v$2 && setAttribute(_el$11, "aria-label", _p$._v$2 = _v$2);
|
|
2692
|
+
return _p$;
|
|
2693
|
+
}, {
|
|
2694
|
+
_v$: void 0,
|
|
2695
|
+
_v$2: void 0
|
|
2696
|
+
});
|
|
2697
|
+
return _el$7;
|
|
2698
|
+
})();
|
|
2699
|
+
}
|
|
2700
|
+
}));
|
|
2701
|
+
return _el$5;
|
|
2702
|
+
}
|
|
2703
|
+
}));
|
|
2704
|
+
return _el$;
|
|
2705
|
+
})();
|
|
838
2706
|
};
|
|
2707
|
+
delegateEvents(["click"]);
|
|
839
2708
|
|
|
840
2709
|
// src/screens/settings.tsx
|
|
841
|
-
|
|
2710
|
+
var _tmpl$19 = /* @__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">`);
|
|
2711
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<option>`);
|
|
842
2712
|
var Settings = (props) => {
|
|
843
2713
|
const data = useData();
|
|
844
2714
|
const language = () => data.storeData().meta[0];
|
|
845
2715
|
const textSpeed = () => data.storeData().meta[1];
|
|
846
|
-
const languageNames = createMemo(
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
2716
|
+
const languageNames = createMemo(() => new Intl.DisplayNames([language()], {
|
|
2717
|
+
type: "language"
|
|
2718
|
+
}));
|
|
2719
|
+
const onLanguageSelect = ({
|
|
2720
|
+
currentTarget: {
|
|
2721
|
+
value
|
|
2722
|
+
}
|
|
2723
|
+
}) => {
|
|
852
2724
|
data.storeDataUpdate((prev) => {
|
|
853
2725
|
return prev.meta[0] = value, prev;
|
|
854
2726
|
});
|
|
855
2727
|
};
|
|
856
|
-
const onSpeedSelect = ({
|
|
2728
|
+
const onSpeedSelect = ({
|
|
2729
|
+
currentTarget: {
|
|
2730
|
+
value
|
|
2731
|
+
}
|
|
2732
|
+
}) => {
|
|
857
2733
|
data.storeDataUpdate((prev) => {
|
|
858
2734
|
return prev.meta[1] = value, prev;
|
|
859
2735
|
});
|
|
860
2736
|
};
|
|
861
|
-
const languageSelectID =
|
|
862
|
-
const speedSelectID =
|
|
863
|
-
return
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
2737
|
+
const languageSelectID = createUniqueId();
|
|
2738
|
+
const speedSelectID = createUniqueId();
|
|
2739
|
+
return (() => {
|
|
2740
|
+
const _el$ = _tmpl$19(), _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;
|
|
2741
|
+
_el$3.$$click = () => props.setState("screen", "mainmenu");
|
|
2742
|
+
insert(_el$3, () => data.t("HomeScreen"));
|
|
2743
|
+
_el$4.$$click = () => data.options.restore();
|
|
2744
|
+
insert(_el$4, () => data.t("ToTheGame"));
|
|
2745
|
+
setAttribute(_el$7, "for", languageSelectID);
|
|
2746
|
+
insert(_el$7, () => data.t("Language"));
|
|
2747
|
+
_el$8.addEventListener("change", onLanguageSelect);
|
|
2748
|
+
setAttribute(_el$8, "id", languageSelectID);
|
|
2749
|
+
insert(_el$8, createComponent(For, {
|
|
2750
|
+
get each() {
|
|
2751
|
+
return data.options.languages;
|
|
2752
|
+
},
|
|
2753
|
+
children: (lang) => (() => {
|
|
2754
|
+
const _el$12 = _tmpl$27();
|
|
2755
|
+
_el$12.value = lang;
|
|
2756
|
+
insert(_el$12, () => capitalize(languageNames().of(lang) || lang));
|
|
2757
|
+
createRenderEffect(() => _el$12.selected = lang === language());
|
|
2758
|
+
return _el$12;
|
|
2759
|
+
})()
|
|
2760
|
+
}));
|
|
2761
|
+
setAttribute(_el$10, "for", speedSelectID);
|
|
2762
|
+
insert(_el$10, () => data.t("TextSpeed"));
|
|
2763
|
+
_el$11.addEventListener("change", onSpeedSelect);
|
|
2764
|
+
setAttribute(_el$11, "id", speedSelectID);
|
|
2765
|
+
insert(_el$11, createComponent(For, {
|
|
2766
|
+
each: ["Slow", "Medium", "Fast", "Auto"],
|
|
2767
|
+
children: (speed) => (() => {
|
|
2768
|
+
const _el$13 = _tmpl$27();
|
|
2769
|
+
_el$13.value = speed;
|
|
2770
|
+
insert(_el$13, () => data.t("TextSpeed" + speed));
|
|
2771
|
+
createRenderEffect(() => _el$13.selected = speed === textSpeed());
|
|
2772
|
+
return _el$13;
|
|
2773
|
+
})()
|
|
2774
|
+
}));
|
|
2775
|
+
return _el$;
|
|
2776
|
+
})();
|
|
879
2777
|
};
|
|
2778
|
+
delegateEvents(["click"]);
|
|
880
2779
|
|
|
881
2780
|
// src/renderer.tsx
|
|
882
|
-
var
|
|
2781
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<div>`);
|
|
2782
|
+
var _tmpl$28 = /* @__PURE__ */ template(`<canvas>`);
|
|
2783
|
+
var _tmpl$35 = /* @__PURE__ */ template(`<input type="text" name="novely-input" required autocomplete="off">`);
|
|
2784
|
+
var createSolidRenderer = ({
|
|
2785
|
+
fullscreen = false,
|
|
2786
|
+
controls = "outside",
|
|
2787
|
+
skipTypewriterWhenGoingBack = true,
|
|
2788
|
+
target = document.body
|
|
2789
|
+
} = {}) => {
|
|
883
2790
|
const [state, setState] = createStore({
|
|
884
2791
|
background: "",
|
|
885
2792
|
characters: {},
|
|
@@ -922,6 +2829,100 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
922
2829
|
let options;
|
|
923
2830
|
let root;
|
|
924
2831
|
let currentBackground;
|
|
2832
|
+
let unmount;
|
|
2833
|
+
const Novely = () => {
|
|
2834
|
+
createEffect(() => {
|
|
2835
|
+
const screen = state.screen;
|
|
2836
|
+
if (fullscreen && document.fullscreenEnabled) {
|
|
2837
|
+
if (screen === "game" && !document.fullscreenElement) {
|
|
2838
|
+
document.documentElement.requestFullscreen().catch(() => {
|
|
2839
|
+
});
|
|
2840
|
+
} else if (screen === "mainmenu" && document.fullscreenElement && "exitFullscreen" in document) {
|
|
2841
|
+
document.exitFullscreen().catch(() => {
|
|
2842
|
+
});
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
});
|
|
2846
|
+
return (() => {
|
|
2847
|
+
const _el$ = _tmpl$20();
|
|
2848
|
+
const _ref$ = root;
|
|
2849
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : root = _el$;
|
|
2850
|
+
insert(_el$, createComponent(Provider, {
|
|
2851
|
+
get storeData() {
|
|
2852
|
+
return options.$;
|
|
2853
|
+
},
|
|
2854
|
+
get coreData() {
|
|
2855
|
+
return options.$$;
|
|
2856
|
+
},
|
|
2857
|
+
options,
|
|
2858
|
+
renderer,
|
|
2859
|
+
get children() {
|
|
2860
|
+
return [createComponent(Switch, {
|
|
2861
|
+
get children() {
|
|
2862
|
+
return [createComponent(Match, {
|
|
2863
|
+
get when() {
|
|
2864
|
+
return state.screen === "game";
|
|
2865
|
+
},
|
|
2866
|
+
get children() {
|
|
2867
|
+
return createComponent(Game, {
|
|
2868
|
+
state,
|
|
2869
|
+
setState,
|
|
2870
|
+
store,
|
|
2871
|
+
characters,
|
|
2872
|
+
renderer,
|
|
2873
|
+
controls,
|
|
2874
|
+
skipTypewriterWhenGoingBack
|
|
2875
|
+
});
|
|
2876
|
+
}
|
|
2877
|
+
}), createComponent(Match, {
|
|
2878
|
+
get when() {
|
|
2879
|
+
return state.screen === "mainmenu";
|
|
2880
|
+
},
|
|
2881
|
+
get children() {
|
|
2882
|
+
return createComponent(MainMenu, {
|
|
2883
|
+
state,
|
|
2884
|
+
setState
|
|
2885
|
+
});
|
|
2886
|
+
}
|
|
2887
|
+
}), createComponent(Match, {
|
|
2888
|
+
get when() {
|
|
2889
|
+
return state.screen === "saves";
|
|
2890
|
+
},
|
|
2891
|
+
get children() {
|
|
2892
|
+
return createComponent(Saves, {
|
|
2893
|
+
setState
|
|
2894
|
+
});
|
|
2895
|
+
}
|
|
2896
|
+
}), createComponent(Match, {
|
|
2897
|
+
get when() {
|
|
2898
|
+
return state.screen === "settings";
|
|
2899
|
+
},
|
|
2900
|
+
get children() {
|
|
2901
|
+
return createComponent(Settings, {
|
|
2902
|
+
setState
|
|
2903
|
+
});
|
|
2904
|
+
}
|
|
2905
|
+
}), createComponent(Match, {
|
|
2906
|
+
get when() {
|
|
2907
|
+
return state.screen === "loading";
|
|
2908
|
+
},
|
|
2909
|
+
get children() {
|
|
2910
|
+
return createComponent(Loading, {});
|
|
2911
|
+
}
|
|
2912
|
+
})];
|
|
2913
|
+
}
|
|
2914
|
+
}), createComponent(CustomScreen, {
|
|
2915
|
+
get name() {
|
|
2916
|
+
return state.screen;
|
|
2917
|
+
},
|
|
2918
|
+
state,
|
|
2919
|
+
setState
|
|
2920
|
+
})];
|
|
2921
|
+
}
|
|
2922
|
+
}));
|
|
2923
|
+
return _el$;
|
|
2924
|
+
})();
|
|
2925
|
+
};
|
|
925
2926
|
return {
|
|
926
2927
|
createRenderer(init) {
|
|
927
2928
|
options = init, characters = init.characters;
|
|
@@ -944,7 +2945,9 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
944
2945
|
}
|
|
945
2946
|
return;
|
|
946
2947
|
}
|
|
947
|
-
const last = findLast(mediaQueries, ({
|
|
2948
|
+
const last = findLast(mediaQueries, ({
|
|
2949
|
+
matches
|
|
2950
|
+
}) => matches);
|
|
948
2951
|
const bg = last ? background[last.media] : "";
|
|
949
2952
|
setState("background", bg);
|
|
950
2953
|
};
|
|
@@ -956,7 +2959,11 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
956
2959
|
character(character) {
|
|
957
2960
|
if (store.characters[character])
|
|
958
2961
|
return store.characters[character];
|
|
959
|
-
const canvas =
|
|
2962
|
+
const canvas = (() => {
|
|
2963
|
+
const _el$2 = _tmpl$28();
|
|
2964
|
+
setAttribute(_el$2, "data-character", character);
|
|
2965
|
+
return _el$2;
|
|
2966
|
+
})();
|
|
960
2967
|
const ctx = canvas.getContext("2d");
|
|
961
2968
|
return store.characters[character] = {
|
|
962
2969
|
canvas,
|
|
@@ -964,20 +2971,20 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
964
2971
|
emotions: {},
|
|
965
2972
|
withEmotion(emotion) {
|
|
966
2973
|
const stored = this.emotions[emotion];
|
|
967
|
-
const
|
|
2974
|
+
const render2 = (...images) => {
|
|
968
2975
|
return () => {
|
|
969
2976
|
canvasDrawImages(canvas, ctx, images);
|
|
970
2977
|
};
|
|
971
2978
|
};
|
|
972
2979
|
if (stored) {
|
|
973
2980
|
if (stored instanceof HTMLImageElement) {
|
|
974
|
-
return
|
|
2981
|
+
return render2(stored);
|
|
975
2982
|
}
|
|
976
|
-
return
|
|
2983
|
+
return render2(...Object.values(stored));
|
|
977
2984
|
}
|
|
978
2985
|
const emotionData = characters[character].emotions[emotion];
|
|
979
2986
|
if (typeof emotionData === "string") {
|
|
980
|
-
return
|
|
2987
|
+
return render2(this.emotions[emotion] = createImage(emotionData));
|
|
981
2988
|
}
|
|
982
2989
|
const head = createImage(emotionData.head);
|
|
983
2990
|
const left = createImage(emotionData.body.left);
|
|
@@ -987,33 +2994,45 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
987
2994
|
left,
|
|
988
2995
|
right
|
|
989
2996
|
};
|
|
990
|
-
return
|
|
2997
|
+
return render2(head, left, right);
|
|
991
2998
|
},
|
|
992
|
-
append(
|
|
2999
|
+
append(className2, style2) {
|
|
993
3000
|
clearTimeout(state.characters[character]?.timeoutId);
|
|
994
|
-
setState("characters", character, {
|
|
995
|
-
|
|
3001
|
+
setState("characters", character, {
|
|
3002
|
+
style: style2,
|
|
3003
|
+
visible: true
|
|
3004
|
+
});
|
|
3005
|
+
const {
|
|
3006
|
+
canvas: element
|
|
3007
|
+
} = store.characters[character];
|
|
996
3008
|
element.className = "";
|
|
997
|
-
if (
|
|
3009
|
+
if (className2) {
|
|
998
3010
|
void element.offsetHeight;
|
|
999
|
-
element.className =
|
|
3011
|
+
element.className = className2;
|
|
1000
3012
|
}
|
|
1001
3013
|
},
|
|
1002
|
-
remove(
|
|
3014
|
+
remove(className2, style2, duration) {
|
|
1003
3015
|
return (resolve, restoring) => {
|
|
1004
3016
|
if (restoring) {
|
|
1005
|
-
setState("characters", character, {
|
|
3017
|
+
setState("characters", character, {
|
|
3018
|
+
visible: false
|
|
3019
|
+
});
|
|
1006
3020
|
resolve();
|
|
1007
3021
|
return;
|
|
1008
3022
|
}
|
|
1009
3023
|
const timeoutId = setTimeout(() => {
|
|
1010
|
-
setState("characters", character, {
|
|
3024
|
+
setState("characters", character, {
|
|
3025
|
+
visible: false
|
|
3026
|
+
});
|
|
1011
3027
|
resolve();
|
|
1012
3028
|
}, duration);
|
|
1013
|
-
if (
|
|
1014
|
-
store.characters[character].canvas.className =
|
|
3029
|
+
if (className2) {
|
|
3030
|
+
store.characters[character].canvas.className = className2;
|
|
1015
3031
|
}
|
|
1016
|
-
setState("characters", character, {
|
|
3032
|
+
setState("characters", character, {
|
|
3033
|
+
style: style2,
|
|
3034
|
+
timeoutId
|
|
3035
|
+
});
|
|
1017
3036
|
};
|
|
1018
3037
|
}
|
|
1019
3038
|
};
|
|
@@ -1033,7 +3052,12 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1033
3052
|
},
|
|
1034
3053
|
choices(question, choices) {
|
|
1035
3054
|
return (resolve) => {
|
|
1036
|
-
setState("choices", {
|
|
3055
|
+
setState("choices", {
|
|
3056
|
+
choices,
|
|
3057
|
+
question,
|
|
3058
|
+
resolve,
|
|
3059
|
+
visible: true
|
|
3060
|
+
});
|
|
1037
3061
|
};
|
|
1038
3062
|
},
|
|
1039
3063
|
clear(goingBack, keep, keepCharacters) {
|
|
@@ -1056,12 +3080,20 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1056
3080
|
error: ""
|
|
1057
3081
|
});
|
|
1058
3082
|
if (!keep.has("dialog"))
|
|
1059
|
-
setState("dialog", {
|
|
3083
|
+
setState("dialog", {
|
|
3084
|
+
visible: false,
|
|
3085
|
+
content: "",
|
|
3086
|
+
name: ""
|
|
3087
|
+
});
|
|
1060
3088
|
if (!keep.has("text"))
|
|
1061
|
-
setState("text", {
|
|
3089
|
+
setState("text", {
|
|
3090
|
+
content: ""
|
|
3091
|
+
});
|
|
1062
3092
|
for (const character of Object.keys(state.characters)) {
|
|
1063
3093
|
if (!keepCharacters.has(character))
|
|
1064
|
-
setState("characters", character, {
|
|
3094
|
+
setState("characters", character, {
|
|
3095
|
+
visible: false
|
|
3096
|
+
});
|
|
1065
3097
|
}
|
|
1066
3098
|
for (const [id, layer] of Object.entries(state.layers)) {
|
|
1067
3099
|
if (!layer)
|
|
@@ -1076,7 +3108,9 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1076
3108
|
input(question, onInput, setup) {
|
|
1077
3109
|
return (resolve) => {
|
|
1078
3110
|
const error = (value) => {
|
|
1079
|
-
setState("input", {
|
|
3111
|
+
setState("input", {
|
|
3112
|
+
error: value
|
|
3113
|
+
});
|
|
1080
3114
|
};
|
|
1081
3115
|
const onInputHandler = (event) => {
|
|
1082
3116
|
let value;
|
|
@@ -1091,10 +3125,16 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1091
3125
|
}
|
|
1092
3126
|
});
|
|
1093
3127
|
};
|
|
1094
|
-
const input =
|
|
3128
|
+
const input = (() => {
|
|
3129
|
+
const _el$3 = _tmpl$35();
|
|
3130
|
+
_el$3.$$input = onInputHandler;
|
|
3131
|
+
return _el$3;
|
|
3132
|
+
})();
|
|
1095
3133
|
if (setup) {
|
|
1096
3134
|
setup(input, (callback) => {
|
|
1097
|
-
setState("input", {
|
|
3135
|
+
setState("input", {
|
|
3136
|
+
cleanup: callback
|
|
3137
|
+
});
|
|
1098
3138
|
});
|
|
1099
3139
|
}
|
|
1100
3140
|
setState("input", {
|
|
@@ -1103,7 +3143,9 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1103
3143
|
visible: true,
|
|
1104
3144
|
resolve
|
|
1105
3145
|
});
|
|
1106
|
-
input.dispatchEvent(new InputEvent("input", {
|
|
3146
|
+
input.dispatchEvent(new InputEvent("input", {
|
|
3147
|
+
bubbles: true
|
|
3148
|
+
}));
|
|
1107
3149
|
};
|
|
1108
3150
|
},
|
|
1109
3151
|
music(source, method) {
|
|
@@ -1129,7 +3171,7 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1129
3171
|
return store.audio[method] = handle;
|
|
1130
3172
|
},
|
|
1131
3173
|
custom(fn, goingBack, resolve) {
|
|
1132
|
-
const get = (id,
|
|
3174
|
+
const get = (id, insert2 = true) => {
|
|
1133
3175
|
const cached = state.layers[id];
|
|
1134
3176
|
if (cached)
|
|
1135
3177
|
return cached.value;
|
|
@@ -1139,7 +3181,11 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1139
3181
|
const clearManager = () => {
|
|
1140
3182
|
clear(), setState("layers", id, void 0);
|
|
1141
3183
|
};
|
|
1142
|
-
const element =
|
|
3184
|
+
const element = insert2 ? (() => {
|
|
3185
|
+
const _el$4 = _tmpl$20();
|
|
3186
|
+
setAttribute(_el$4, "id", id);
|
|
3187
|
+
return _el$4;
|
|
3188
|
+
})() : null;
|
|
1143
3189
|
setState("layers", id, {
|
|
1144
3190
|
fn,
|
|
1145
3191
|
dom: element,
|
|
@@ -1165,7 +3211,11 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1165
3211
|
return result;
|
|
1166
3212
|
},
|
|
1167
3213
|
text(content, resolve, goingBack) {
|
|
1168
|
-
setState("text", {
|
|
3214
|
+
setState("text", {
|
|
3215
|
+
content,
|
|
3216
|
+
resolve,
|
|
3217
|
+
goingBack
|
|
3218
|
+
});
|
|
1169
3219
|
},
|
|
1170
3220
|
store,
|
|
1171
3221
|
ui: {
|
|
@@ -1174,72 +3224,20 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1174
3224
|
},
|
|
1175
3225
|
showExitPrompt() {
|
|
1176
3226
|
setState("exitPromptShown", true);
|
|
3227
|
+
},
|
|
3228
|
+
start() {
|
|
3229
|
+
unmount?.();
|
|
3230
|
+
unmount = render(() => createComponent(Novely, {}), target);
|
|
3231
|
+
return {
|
|
3232
|
+
unmount() {
|
|
3233
|
+
unmount?.();
|
|
3234
|
+
unmount = void 0;
|
|
3235
|
+
}
|
|
3236
|
+
};
|
|
1177
3237
|
}
|
|
1178
3238
|
}
|
|
1179
3239
|
};
|
|
1180
3240
|
},
|
|
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
3241
|
registerScreen(name, screen) {
|
|
1244
3242
|
setState("screens", name, () => screen);
|
|
1245
3243
|
},
|
|
@@ -1248,6 +3246,7 @@ var createSolidRenderer = ({ fullscreen = false, controls = "outside", skipTypew
|
|
|
1248
3246
|
}
|
|
1249
3247
|
};
|
|
1250
3248
|
};
|
|
3249
|
+
delegateEvents(["input"]);
|
|
1251
3250
|
export {
|
|
1252
3251
|
createSolidRenderer
|
|
1253
3252
|
};
|