@puzzmo/sdk 1.0.71 → 1.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -6
- package/dist/{createSimulator-uk8H5md8.cjs → createSimulator-Bb1LTB5P.cjs} +44 -44
- package/dist/createSimulator-Bb1LTB5P.cjs.map +1 -0
- package/dist/{createSimulator-treFHkmV.js → createSimulator-CYo2KWWM.js} +480 -440
- package/dist/createSimulator-CYo2KWWM.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +154 -91
- package/dist/index.js.map +1 -1
- package/dist/sdk.d.ts +66 -4
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.gameReady.spec.d.ts +2 -0
- package/dist/sdk.gameReady.spec.d.ts.map +1 -0
- package/dist/simulator/createSimulator.d.ts.map +1 -1
- package/dist/simulator/index.cjs +1 -1
- package/dist/simulator/index.js +1 -1
- package/dist/simulator/standalone.cjs +1 -1
- package/dist/simulator/standalone.js +1 -1
- package/dist/simulator/state.d.ts.map +1 -1
- package/dist/simulator/types.d.ts +5 -0
- package/dist/simulator/types.d.ts.map +1 -1
- package/dist/simulator/views/ThumbView.d.ts.map +1 -1
- package/dist/thumbnailMotion.cjs +5 -0
- package/dist/thumbnailMotion.cjs.map +1 -0
- package/dist/thumbnailMotion.d.ts +119 -0
- package/dist/thumbnailMotion.d.ts.map +1 -0
- package/dist/thumbnailMotion.js +453 -0
- package/dist/thumbnailMotion.js.map +1 -0
- package/dist/thumbnailMotion.spec.d.ts +2 -0
- package/dist/thumbnailMotion.spec.d.ts.map +1 -0
- package/dist/types.d.ts +55 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -1
- package/dist/createSimulator-treFHkmV.js.map +0 -1
- package/dist/createSimulator-uk8H5md8.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -273,9 +273,9 @@ function S() {
|
|
|
273
273
|
* The host<->game contract this SDK speaks, declared in READY and READY_GAME_LOADED: games read
|
|
274
274
|
* `game` and `session`, and handle `session` being absent. Hosts on "1.0" always send a session.
|
|
275
275
|
*/
|
|
276
|
-
var C = "1.1", w = S();
|
|
276
|
+
var C = "1.1", w = S(), T = 1e4;
|
|
277
277
|
/** Creates a Puzzmo SDK instance for communicating with the Puzzmo host */
|
|
278
|
-
const
|
|
278
|
+
const E = (r = {}) => {
|
|
279
279
|
var i;
|
|
280
280
|
let a = null, s = null, c = () => {
|
|
281
281
|
var e;
|
|
@@ -284,58 +284,66 @@ const T = (r = {}) => {
|
|
|
284
284
|
var e, t;
|
|
285
285
|
return (e = (t = c()) == null ? void 0 : t.id) == null ? null : e;
|
|
286
286
|
}, u = () => {
|
|
287
|
-
var e, t;
|
|
288
|
-
return (e = a == null || (
|
|
287
|
+
var e, t, n, r;
|
|
288
|
+
return (e = (t = a == null || (n = a.session) == null ? void 0 : n.puzzle.puzzle) == null ? a == null || (r = a.repeatablePuzzle) == null ? void 0 : r.puzzle : t) == null ? null : e;
|
|
289
289
|
}, p = () => {
|
|
290
290
|
var e, t;
|
|
291
291
|
return (e = (t = c()) == null ? void 0 : t.boardState) == null ? null : e;
|
|
292
292
|
}, m = () => {
|
|
293
293
|
var e;
|
|
294
294
|
return (e = a == null ? void 0 : a.theme) == null ? null : e;
|
|
295
|
-
}, h = () => {
|
|
295
|
+
}, h = null, g = 0, _ = !1, v = () => {
|
|
296
296
|
var e, t;
|
|
297
297
|
return (e = (t = c()) == null ? void 0 : t.completed) == null ? !1 : e;
|
|
298
|
-
},
|
|
299
|
-
if (
|
|
300
|
-
|
|
298
|
+
}, b = !1, S = (e) => {
|
|
299
|
+
if (b) return;
|
|
300
|
+
b = !0;
|
|
301
301
|
let t = a ? "the host sent no play session, so there is no gameplay to save to" : "it was called before gameReady() resolved";
|
|
302
302
|
console.warn(`[Puzzmo SDK] ${e}() was ignored: ${t}`);
|
|
303
|
-
},
|
|
304
|
-
|
|
305
|
-
},
|
|
306
|
-
|
|
307
|
-
if (
|
|
308
|
-
let [e, t] =
|
|
303
|
+
}, E = /* @__PURE__ */ new Map(), k = null, A = null, j = !1, M = (e, t) => {
|
|
304
|
+
j || A == null || A.trackEvent(e, t);
|
|
305
|
+
}, N = x(), P = null, F = null, I = () => {
|
|
306
|
+
P || (P = setInterval(() => {
|
|
307
|
+
if (N.isPaused()) return;
|
|
308
|
+
let [e, t] = N.display();
|
|
309
309
|
w.sendMessage("TIMER_TICK", { display: [e, t] });
|
|
310
|
-
}, 500),
|
|
311
|
-
|
|
310
|
+
}, 500), F = setInterval(() => {
|
|
311
|
+
N.isPaused() || w.sendMessage("TIMER_SYNC", Math.floor(N.timeWithoutPenaltySecs()));
|
|
312
312
|
}, 1e4));
|
|
313
|
-
},
|
|
314
|
-
|
|
315
|
-
},
|
|
316
|
-
let n =
|
|
313
|
+
}, L = () => {
|
|
314
|
+
P && (clearInterval(P), P = null), F && (clearInterval(F), F = null);
|
|
315
|
+
}, R = (e, t) => {
|
|
316
|
+
let n = E.get(e);
|
|
317
317
|
n && n.forEach((e) => e(t));
|
|
318
318
|
};
|
|
319
319
|
w.onMessage("START_GAME", () => {
|
|
320
|
-
|
|
320
|
+
N._init(), I(), R("start");
|
|
321
321
|
});
|
|
322
|
-
let
|
|
323
|
-
let e =
|
|
324
|
-
|
|
325
|
-
},
|
|
326
|
-
let e =
|
|
327
|
-
|
|
322
|
+
let z = () => {
|
|
323
|
+
let e = N.isPaused();
|
|
324
|
+
N._pause(), N.isPaused() !== e && R("pause");
|
|
325
|
+
}, B = () => {
|
|
326
|
+
let e = N.isPaused();
|
|
327
|
+
N._resume(), N.isPaused() !== e && R("resume");
|
|
328
328
|
};
|
|
329
|
-
w.onMessage("PAUSE_GAME",
|
|
330
|
-
|
|
331
|
-
}), w.onMessage("KEYBOARD_KEY_PRESS", (e) =>
|
|
332
|
-
|
|
329
|
+
w.onMessage("PAUSE_GAME", z), w.onMessage("RESUME_GAME", B), w.onMessage("SETTINGS_UPDATE", (e) => {
|
|
330
|
+
k = t(t({}, k), e), R("settingsUpdate", k);
|
|
331
|
+
}), w.onMessage("KEYBOARD_KEY_PRESS", (e) => R("keyboardKeyPress", e)), w.onMessage("KEYBOARD_CURSOR_CHANGE", (e) => R("keyboardCursorChange", e)), w.onMessage("KEYBOARD_CURSOR_END", () => R("keyboardCursorEnd"));
|
|
332
|
+
let V = /* @__PURE__ */ new Map(), H = 0;
|
|
333
|
+
w.onMessage("PUZZLE_DATA", (e) => {
|
|
334
|
+
let t = V.get(e.nonce);
|
|
335
|
+
t && (V.delete(e.nonce), "failed" in e ? t.reject(Error(e.error)) : t.resolve({
|
|
336
|
+
puzzleKey: e.puzzle.key,
|
|
337
|
+
puzzleString: e.puzzle.puzzle
|
|
338
|
+
}));
|
|
339
|
+
}), w.onMessage("RETRY_PUZZLE", () => {
|
|
340
|
+
N._reset(), L(), R("retry");
|
|
333
341
|
}), w.onMessage("READY_DATA", (e) => {
|
|
334
342
|
var t;
|
|
335
343
|
let n = o(e);
|
|
336
344
|
a = n;
|
|
337
345
|
let r = (t = n.session) == null ? void 0 : t.gameplay;
|
|
338
|
-
if (
|
|
346
|
+
if (k === null) {
|
|
339
347
|
var i, c;
|
|
340
348
|
let e = n.game.slug, t = e ? (i = n.userState) == null || (i = i.gameSettings) == null ? void 0 : i[e] : null;
|
|
341
349
|
if (typeof t == "string") try {
|
|
@@ -343,61 +351,64 @@ const T = (r = {}) => {
|
|
|
343
351
|
} catch (e) {
|
|
344
352
|
t = null;
|
|
345
353
|
}
|
|
346
|
-
|
|
354
|
+
k = (c = t) == null ? {} : c;
|
|
347
355
|
}
|
|
348
356
|
if (r) {
|
|
349
357
|
var l, u;
|
|
350
358
|
let e = ((l = r.elapsedTimeSecs) == null ? 0 : l) * 1e3, t = ((u = r.additionalTimeAddedSecs) == null ? 0 : u) * 1e3;
|
|
351
|
-
|
|
359
|
+
N._reset(e, t);
|
|
352
360
|
}
|
|
353
|
-
if (!
|
|
361
|
+
if (!A) {
|
|
354
362
|
var p;
|
|
355
|
-
|
|
363
|
+
A = d(n), j = (p = r == null ? void 0 : r.completed) == null ? !1 : p, A && f((e) => A.trackLinkClick(e));
|
|
356
364
|
}
|
|
357
365
|
s && (s(n), s = null);
|
|
358
366
|
});
|
|
359
|
-
let
|
|
360
|
-
timeMs: () =>
|
|
361
|
-
timeSecs: () =>
|
|
362
|
-
addedTimeMs: () =>
|
|
363
|
-
addedTimeSecs: () =>
|
|
364
|
-
timeWithoutPenaltySecs: () =>
|
|
365
|
-
display: () =>
|
|
366
|
-
addPenalty: (e) =>
|
|
367
|
-
setPenalty: (e) =>
|
|
368
|
-
isPaused: () =>
|
|
369
|
-
isRunning: () =>
|
|
370
|
-
pause:
|
|
371
|
-
resume:
|
|
372
|
-
},
|
|
367
|
+
let U = {
|
|
368
|
+
timeMs: () => N.timeMs(),
|
|
369
|
+
timeSecs: () => N.timeSecs(),
|
|
370
|
+
addedTimeMs: () => N.addedTimeMs(),
|
|
371
|
+
addedTimeSecs: () => N.addedTimeSecs(),
|
|
372
|
+
timeWithoutPenaltySecs: () => N.timeWithoutPenaltySecs(),
|
|
373
|
+
display: () => N.display(),
|
|
374
|
+
addPenalty: (e) => N.addPenalty(e),
|
|
375
|
+
setPenalty: (e) => N.setPenalty(e),
|
|
376
|
+
isPaused: () => N.isPaused(),
|
|
377
|
+
isRunning: () => N.isRunning(),
|
|
378
|
+
pause: z,
|
|
379
|
+
resume: B
|
|
380
|
+
}, W = {
|
|
373
381
|
send: (e, t) => w.sendMessage(e, t),
|
|
374
382
|
on: (e, t) => w.onMessage(e, t),
|
|
375
|
-
timer:
|
|
383
|
+
timer: U,
|
|
376
384
|
bootstrap: () => a
|
|
377
|
-
},
|
|
378
|
-
for (let e of (i = r.plugins) == null ? [] : i)
|
|
385
|
+
}, G = {};
|
|
386
|
+
for (let e of (i = r.plugins) == null ? [] : i) G[e.name] = e.setup(W);
|
|
379
387
|
return {
|
|
380
|
-
timer:
|
|
381
|
-
plugins:
|
|
388
|
+
timer: U,
|
|
389
|
+
plugins: G,
|
|
382
390
|
gameReady: function() {
|
|
383
391
|
var e = n(function* () {
|
|
392
|
+
var e, n;
|
|
384
393
|
if (w.sendMessage("READY", { runtimeContract: C }), !a) {
|
|
385
|
-
var
|
|
386
|
-
let
|
|
387
|
-
yield new Promise((
|
|
388
|
-
s =
|
|
389
|
-
s && (s = null, n(/* @__PURE__ */ Error(`Timeout waiting for READY_DATA after ${
|
|
390
|
-
},
|
|
394
|
+
var i;
|
|
395
|
+
let e = (i = r.timeout) == null ? 5e3 : i;
|
|
396
|
+
yield new Promise((t, n) => {
|
|
397
|
+
s = t, setTimeout(() => {
|
|
398
|
+
s && (s = null, n(/* @__PURE__ */ Error(`Timeout waiting for READY_DATA after ${e}ms`)));
|
|
399
|
+
}, e);
|
|
391
400
|
});
|
|
392
401
|
}
|
|
393
|
-
let
|
|
402
|
+
let o = p();
|
|
394
403
|
return t(t({}, {
|
|
404
|
+
mode: a != null && a.repeatable ? "repeatable" : "puzzle",
|
|
395
405
|
puzzleString: u(),
|
|
396
|
-
|
|
406
|
+
puzzleKey: a != null && a.repeatable ? (e = (n = a.repeatablePuzzle) == null ? void 0 : n.key) == null ? null : e : null,
|
|
407
|
+
inputString: o,
|
|
397
408
|
theme: m(),
|
|
398
|
-
completed:
|
|
409
|
+
completed: v(),
|
|
399
410
|
readyData: a
|
|
400
|
-
}), {}, { boardState:
|
|
411
|
+
}), {}, { boardState: o });
|
|
401
412
|
});
|
|
402
413
|
return function() {
|
|
403
414
|
return e.apply(this, arguments);
|
|
@@ -408,37 +419,37 @@ const T = (r = {}) => {
|
|
|
408
419
|
state: e,
|
|
409
420
|
gameRuntimeContract: C,
|
|
410
421
|
embedRuntimeContract: "1.0"
|
|
411
|
-
}),
|
|
422
|
+
}), M("READY_GAME_LOADED");
|
|
412
423
|
},
|
|
413
|
-
on: (e, t) => (
|
|
424
|
+
on: (e, t) => (E.has(e) || E.set(e, /* @__PURE__ */ new Set()), E.get(e).add(t), () => {
|
|
414
425
|
var n;
|
|
415
|
-
(n =
|
|
426
|
+
(n = E.get(e)) == null || n.delete(t);
|
|
416
427
|
}),
|
|
417
428
|
off: (e, t) => {
|
|
418
429
|
var n;
|
|
419
|
-
(n =
|
|
430
|
+
(n = E.get(e)) == null || n.delete(t);
|
|
420
431
|
},
|
|
421
432
|
updateGameState: (e, t) => {
|
|
422
433
|
var n, r;
|
|
423
434
|
let i = l();
|
|
424
|
-
if (!i) return
|
|
435
|
+
if (!i) return S("updateGameState");
|
|
425
436
|
w.sendMessage("UPLOAD_NEW_GAME_STATE", {
|
|
426
437
|
id: i,
|
|
427
438
|
input: {
|
|
428
439
|
boardState: e,
|
|
429
|
-
elapsedTimeSecs: (n = t == null ? void 0 : t.elapsedTimeSecs) == null ?
|
|
430
|
-
additionalTimeAddedSecs: (r = t == null ? void 0 : t.additionalTimeAddedSecs) == null ?
|
|
440
|
+
elapsedTimeSecs: (n = t == null ? void 0 : t.elapsedTimeSecs) == null ? N.timeWithoutPenaltySecs() : n,
|
|
441
|
+
additionalTimeAddedSecs: (r = t == null ? void 0 : t.additionalTimeAddedSecs) == null ? N.addedTimeSecs() : r,
|
|
431
442
|
collabUserReferences: []
|
|
432
443
|
}
|
|
433
|
-
}),
|
|
444
|
+
}), M("UPLOAD_NEW_GAME_STATE");
|
|
434
445
|
},
|
|
435
446
|
gameCompleted: (n, r) => {
|
|
436
447
|
var i, o, s, c, u;
|
|
437
|
-
|
|
448
|
+
N._conclude(), L();
|
|
438
449
|
let { inputString: d } = n, f = t(t({}, e(n, y)), {}, {
|
|
439
450
|
boardState: d == null ? n.boardState : d,
|
|
440
|
-
elapsedTimeSecs: (i = n.elapsedTimeSecs) == null ?
|
|
441
|
-
additionalTimeAddedSecs: (o = n.additionalTimeAddedSecs) == null ?
|
|
451
|
+
elapsedTimeSecs: (i = n.elapsedTimeSecs) == null ? N.timeWithoutPenaltySecs() : i,
|
|
452
|
+
additionalTimeAddedSecs: (o = n.additionalTimeAddedSecs) == null ? N.addedTimeSecs() : o
|
|
442
453
|
}), p = (s = r == null ? void 0 : r.deeds) == null ? [] : s;
|
|
443
454
|
p.push({
|
|
444
455
|
id: "points",
|
|
@@ -452,7 +463,7 @@ const T = (r = {}) => {
|
|
|
452
463
|
id: m == null ? void 0 : m,
|
|
453
464
|
input: f,
|
|
454
465
|
config: r
|
|
455
|
-
}),
|
|
466
|
+
}), M("GAME_COMPLETED", { input: f })) : S("gameCompleted");
|
|
456
467
|
},
|
|
457
468
|
showCompletionScreen: (e) => {
|
|
458
469
|
w.sendMessage("SHOW_GAME_COMPLETE_SCREEN", {
|
|
@@ -462,10 +473,10 @@ const T = (r = {}) => {
|
|
|
462
473
|
},
|
|
463
474
|
hitCheckpoint: (e, t, n) => {
|
|
464
475
|
var r;
|
|
465
|
-
if (!l()) return
|
|
476
|
+
if (!l()) return S("hitCheckpoint");
|
|
466
477
|
let i = (r = p()) == null ? "" : r, a = {
|
|
467
|
-
elapsedTimeSecs:
|
|
468
|
-
additionalTimeAddedSecs:
|
|
478
|
+
elapsedTimeSecs: N.timeWithoutPenaltySecs(),
|
|
479
|
+
additionalTimeAddedSecs: N.addedTimeSecs()
|
|
469
480
|
};
|
|
470
481
|
w.sendMessage("HIT_CHECKPOINT", {
|
|
471
482
|
checkpointName: e,
|
|
@@ -477,16 +488,66 @@ const T = (r = {}) => {
|
|
|
477
488
|
augConfig: n == null ? {} : n
|
|
478
489
|
});
|
|
479
490
|
},
|
|
491
|
+
completeRepeatableRun: (e, n) => {
|
|
492
|
+
var r, i;
|
|
493
|
+
let a = N.timeWithoutPenaltySecs(), o = a >= g ? a - g : a;
|
|
494
|
+
g = a;
|
|
495
|
+
let s = Math.round((r = e == null ? void 0 : e.elapsedTimeSecs) == null ? o : r), c = [...((i = n == null ? void 0 : n.deeds) == null ? [] : i).filter((e) => e.id !== "time"), {
|
|
496
|
+
id: "time",
|
|
497
|
+
value: s
|
|
498
|
+
}], l = e == null ? void 0 : e.puzzleKey;
|
|
499
|
+
w.sendMessage("COMPLETE_REPEATABLE_RUN", { input: t({
|
|
500
|
+
deedValues: c,
|
|
501
|
+
elapsedTimeSecs: s
|
|
502
|
+
}, l ? { puzzleKey: l } : {}) }), M("COMPLETE_REPEATABLE_RUN", { elapsedTimeSecs: s });
|
|
503
|
+
},
|
|
504
|
+
requestPuzzle: (e) => new Promise((t, n) => {
|
|
505
|
+
let r = `puzzle-${++H}`, i = setTimeout(() => {
|
|
506
|
+
V.delete(r) && n(/* @__PURE__ */ Error(`Timeout waiting for PUZZLE_DATA after ${T}ms`));
|
|
507
|
+
}, T), a = (e) => (t) => {
|
|
508
|
+
clearTimeout(i), e(t);
|
|
509
|
+
};
|
|
510
|
+
V.set(r, {
|
|
511
|
+
resolve: a(t),
|
|
512
|
+
reject: a(n)
|
|
513
|
+
}), w.sendMessage("REQUEST_PUZZLE", {
|
|
514
|
+
nonce: r,
|
|
515
|
+
buckets: e != null && e.buckets ? [...e.buckets] : void 0,
|
|
516
|
+
exclude: e != null && e.exclude ? [...e.exclude] : void 0
|
|
517
|
+
});
|
|
518
|
+
}),
|
|
519
|
+
storage: {
|
|
520
|
+
get: () => {
|
|
521
|
+
if (h) return h;
|
|
522
|
+
let e = a == null ? void 0 : a.viewerStorage;
|
|
523
|
+
return e && e.state != null ? {
|
|
524
|
+
state: e.state,
|
|
525
|
+
stateVersion: e.stateVersion
|
|
526
|
+
} : null;
|
|
527
|
+
},
|
|
528
|
+
set: (e, t = 1) => {
|
|
529
|
+
let n = new TextEncoder().encode(e).length;
|
|
530
|
+
if (n > O) throw Error(`[sdk.storage] State is ${n} bytes, over the ${O} byte cap`);
|
|
531
|
+
if (!Number.isInteger(t) || t < 1) throw Error("[sdk.storage] stateVersion must be a positive integer");
|
|
532
|
+
a && !a.repeatable && !_ && (_ = !0, console.warn("[sdk.storage] Only repeat play saves storage for now; this write lasts until the page reloads")), h = {
|
|
533
|
+
state: e,
|
|
534
|
+
stateVersion: t
|
|
535
|
+
}, w.sendMessage("UPDATE_GAME_USER_STATE", {
|
|
536
|
+
state: e,
|
|
537
|
+
stateVersion: t
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
},
|
|
480
541
|
settings: {
|
|
481
|
-
initialize: (e) => (
|
|
542
|
+
initialize: (e) => (k = t(t({}, D(e)), k), w.sendMessage("INITIALIZE_SETTINGS", {
|
|
482
543
|
components: e,
|
|
483
|
-
settings:
|
|
484
|
-
}),
|
|
544
|
+
settings: k
|
|
545
|
+
}), k),
|
|
485
546
|
get: () => {
|
|
486
547
|
var e;
|
|
487
|
-
return (e =
|
|
548
|
+
return (e = k) == null ? {} : e;
|
|
488
549
|
},
|
|
489
|
-
update: (e) => (
|
|
550
|
+
update: (e) => (k = t(t({}, k), e), w.sendMessage("UPDATE_SETTINGS_FROM_EMBED", { settings: k }), k)
|
|
490
551
|
},
|
|
491
552
|
keyboard: {
|
|
492
553
|
show: (e) => {
|
|
@@ -515,11 +576,13 @@ const T = (r = {}) => {
|
|
|
515
576
|
};
|
|
516
577
|
};
|
|
517
578
|
/** Walks settings UI components (recursing into split groups) collecting name → defaultValue pairs */
|
|
518
|
-
function
|
|
579
|
+
function D(e) {
|
|
519
580
|
let t = {};
|
|
520
|
-
for (let n of e) n.type === "split" ? Object.assign(t,
|
|
581
|
+
for (let n of e) n.type === "split" ? Object.assign(t, D(n.content)) : "name" in n && (t[n.name] = n.defaultValue);
|
|
521
582
|
return t;
|
|
522
583
|
}
|
|
584
|
+
/** The largest state `sdk.storage.set()` takes, matching the API's cap */
|
|
585
|
+
var O = 64 * 1024;
|
|
523
586
|
/**
|
|
524
587
|
* A standard QWERTY layout with Enter and Backspace — a reasonable default for
|
|
525
588
|
* any game that needs text input. Customize from here by spreading and overriding.
|
|
@@ -532,7 +595,7 @@ function E(e) {
|
|
|
532
595
|
* // Extend with dynamic disabled letters
|
|
533
596
|
* sdk.keyboard.show({ ...defaultKeyboardConfig, disabled: usedLetters })
|
|
534
597
|
*/
|
|
535
|
-
const
|
|
598
|
+
const k = {
|
|
536
599
|
layout: [
|
|
537
600
|
"qwertyuiop",
|
|
538
601
|
"asdfghjkl",
|
|
@@ -548,7 +611,7 @@ const D = {
|
|
|
548
611
|
xl: [],
|
|
549
612
|
l: ["↵", "⌫"],
|
|
550
613
|
supportsDragCursor: !1
|
|
551
|
-
},
|
|
614
|
+
}, A = (e) => {
|
|
552
615
|
let n = {};
|
|
553
616
|
for (let a of e) for (let e of a.keys) {
|
|
554
617
|
var r, i;
|
|
@@ -558,11 +621,11 @@ const D = {
|
|
|
558
621
|
return n;
|
|
559
622
|
};
|
|
560
623
|
/** Custom error class for workshop import failures */
|
|
561
|
-
var
|
|
624
|
+
var j = class extends Error {
|
|
562
625
|
constructor(e, t, n) {
|
|
563
626
|
super(t), this.type = e, this.originalError = n, this.name = "EditorImportError";
|
|
564
627
|
}
|
|
565
628
|
};
|
|
566
|
-
export {
|
|
629
|
+
export { j as EditorImportError, E as createPuzzmoSDK, k as defaultKeyboardConfig, A as keyStylesFromRules };
|
|
567
630
|
|
|
568
631
|
//# sourceMappingURL=index.js.map
|