cubing 0.50.1 → 0.51.1
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/lib/cubing/{KPattern.d-Iv89gNss.d.ts → KPattern.d-N-dYG3S_.d.ts} +1 -1
- package/dist/lib/cubing/PuzzleLoader-DUS1aLQG.d.ts +2588 -0
- package/dist/lib/cubing/{TwizzleLink.d-DAfRlszz.d.ts → TwizzleLink.d-Cf4H-1Jc.d.ts} +7 -3
- package/dist/lib/cubing/alg/index.d.ts +5 -4
- package/dist/lib/cubing/alg/index.js +1 -1
- package/dist/lib/cubing/bluetooth/index.d.ts +11 -7
- package/dist/lib/cubing/bluetooth/index.js +19 -11
- package/dist/lib/cubing/bluetooth/index.js.map +2 -2
- package/dist/lib/cubing/{bluetooth-puzzle.d-BfcciXFF.d.ts → bluetooth-puzzle.d-ClBIGffk.d.ts} +2 -2
- package/dist/lib/cubing/chunks/{chunk-VVXSTWUD.js → chunk-2P6TNNY3.js} +3 -3
- package/dist/lib/cubing/chunks/{chunk-VVXSTWUD.js.map → chunk-2P6TNNY3.js.map} +2 -2
- package/dist/lib/cubing/chunks/{chunk-Y3BVWVFU.js → chunk-6APJHPXM.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-P5TX6QDI.js → chunk-74JQNDKL.js} +3 -3
- package/dist/lib/cubing/chunks/{chunk-I4MRKD4Z.js → chunk-7NWFAGQJ.js} +5 -5
- package/dist/lib/cubing/chunks/{chunk-ZKAZJKI6.js → chunk-ASZ33MAN.js} +8 -18
- package/dist/lib/cubing/chunks/chunk-ASZ33MAN.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-EF6G34T7.js → chunk-BKDL54KM.js} +4 -36
- package/dist/lib/cubing/chunks/{chunk-EF6G34T7.js.map → chunk-BKDL54KM.js.map} +2 -2
- package/dist/lib/cubing/chunks/{chunk-RAOTPMYY.js → chunk-DSMNO2NL.js} +3 -3
- package/dist/lib/cubing/chunks/{chunk-YOMULQ2R.js → chunk-SJG4RSQ7.js} +76 -5
- package/dist/lib/cubing/chunks/chunk-SJG4RSQ7.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-TMHVFEOJ.js +13 -0
- package/dist/lib/cubing/chunks/chunk-TMHVFEOJ.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-PP44P6WK.js → chunk-WTZHSZ77.js} +8 -8
- package/dist/lib/cubing/chunks/chunk-WTZHSZ77.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-5QBTMAXK.js → chunk-YUOBAYIL.js} +22 -19
- package/dist/lib/cubing/chunks/chunk-YUOBAYIL.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-H57WKFBE.js → chunk-ZJQ7HF54.js} +2 -2
- package/dist/lib/cubing/chunks/{inside-6OZRJVRY.js → inside-BUUDXGLI.js} +16 -15
- package/dist/lib/cubing/chunks/{inside-6OZRJVRY.js.map → inside-BUUDXGLI.js.map} +1 -1
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-RPVZU2YB.js → search-dynamic-sgs-side-events-3RHFK7AV.js} +6 -6
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-2TYKOUM4.js → search-dynamic-sgs-unofficial-NZE5FKFE.js} +6 -6
- package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-MAI2P7G4.js → search-dynamic-solve-4x4x4-OLMKLMOG.js} +8 -7
- package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-MAI2P7G4.js.map → search-dynamic-solve-4x4x4-OLMKLMOG.js.map} +1 -1
- package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-UOKDYVD5.js → search-dynamic-solve-fto-ONSGYKTM.js} +2 -2
- package/dist/lib/cubing/chunks/{search-dynamic-solve-kilominx-RAZM75GA.js → search-dynamic-solve-kilominx-ZX2CLDKY.js} +2 -2
- package/dist/lib/cubing/chunks/search-worker-entry.js +3 -2
- package/dist/lib/cubing/chunks/search-worker-entry.js.map +1 -1
- package/dist/lib/cubing/chunks/{twisty-dynamic-3d-HF7KVBOE.js → twisty-dynamic-3d-NVEO366S.js} +6 -6
- package/dist/lib/cubing/chunks/{twisty-dynamic-3d-HF7KVBOE.js.map → twisty-dynamic-3d-NVEO366S.js.map} +1 -1
- package/dist/lib/cubing/chunks/{twsearch-MRZGOB6T.js → twsearch-MZJMZQT2.js} +7 -6
- package/dist/lib/cubing/chunks/twsearch-MZJMZQT2.js.map +7 -0
- package/dist/lib/cubing/chunks/twsearch_wasm_bg-AVUYD5YC-GHUKMMEN.js +15 -0
- package/dist/lib/cubing/chunks/twsearch_wasm_bg-AVUYD5YC-GHUKMMEN.js.map +7 -0
- package/dist/lib/cubing/{index-BhH6DKdK.d.ts → index-BW1Xj98G.d.ts} +2 -2
- package/dist/lib/cubing/kpuzzle/index.d.ts +3 -2
- package/dist/lib/cubing/kpuzzle/index.js +2 -2
- package/dist/lib/cubing/notation/index.d.ts +4 -4
- package/dist/lib/cubing/notation/index.js +4 -4
- package/dist/lib/cubing/{parseAlg.d-HDV9mtha.d.ts → parseAlg.d-DhFLCVac.d.ts} +1 -1
- package/dist/lib/cubing/protocol/index.d.ts +3 -2
- package/dist/lib/cubing/protocol/index.js +4 -4
- package/dist/lib/cubing/puzzle-geometry/index.d.ts +4 -3
- package/dist/lib/cubing/puzzle-geometry/index.js +1 -1
- package/dist/lib/cubing/puzzles/index.d.ts +8 -4
- package/dist/lib/cubing/puzzles/index.js +4 -4
- package/dist/lib/cubing/scramble/index.d.ts +4 -3
- package/dist/lib/cubing/scramble/index.js +7 -6
- package/dist/lib/cubing/search/index.d.ts +4 -3
- package/dist/lib/cubing/search/index.js +7 -6
- package/dist/lib/cubing/stream/index.d.ts +6 -3
- package/dist/lib/cubing/stream/index.js +1 -1
- package/dist/lib/cubing/twisty/index.d.ts +5 -5
- package/dist/lib/cubing/twisty/index.js +6 -6
- package/package.json +5 -4
- package/dist/lib/cubing/Alg.d-B5bAxd5U.d.ts +0 -342
- package/dist/lib/cubing/chunks/chunk-5QBTMAXK.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-PP44P6WK.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-YOMULQ2R.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-ZKAZJKI6.js.map +0 -7
- package/dist/lib/cubing/chunks/twsearch-MRZGOB6T.js.map +0 -7
- package/dist/lib/cubing/chunks/twsearch_wasm_bg-V4F3SIUO-QGKWKUFY.js +0 -15
- package/dist/lib/cubing/chunks/twsearch_wasm_bg-V4F3SIUO-QGKWKUFY.js.map +0 -7
- /package/dist/lib/cubing/chunks/{chunk-Y3BVWVFU.js.map → chunk-6APJHPXM.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-P5TX6QDI.js.map → chunk-74JQNDKL.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-I4MRKD4Z.js.map → chunk-7NWFAGQJ.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-RAOTPMYY.js.map → chunk-DSMNO2NL.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-H57WKFBE.js.map → chunk-ZJQ7HF54.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-RPVZU2YB.js.map → search-dynamic-sgs-side-events-3RHFK7AV.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-2TYKOUM4.js.map → search-dynamic-sgs-unofficial-NZE5FKFE.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-UOKDYVD5.js.map → search-dynamic-solve-fto-ONSGYKTM.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-kilominx-RAZM75GA.js.map → search-dynamic-solve-kilominx-ZX2CLDKY.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Texture, Object3D, Raycaster, PerspectiveCamera, Scene, WebGLRenderer } from 'three';
|
|
2
|
-
import { P as PuzzleSpecificSimplifyOptions, M as Move, A as Alg, e as Pause, h as AppendCancelOptions,
|
|
3
|
-
import { P as Parsed } from './parseAlg.d-
|
|
4
|
-
import { s as KPuzzle, d as PuzzleGeometry, K as KPattern, t as KTransformation, u as PuzzleDescriptionString } from './KPattern.d-
|
|
2
|
+
import { P as PuzzleSpecificSimplifyOptions, b as AlgLeaf, M as Move, A as Alg, e as Pause, h as AppendCancelOptions, c as AppendOptions, a as AlgNode, I as IterationDirection } from './PuzzleLoader-DUS1aLQG.js';
|
|
3
|
+
import { P as Parsed } from './parseAlg.d-DhFLCVac.js';
|
|
4
|
+
import { s as KPuzzle, d as PuzzleGeometry, K as KPattern, t as KTransformation, u as PuzzleDescriptionString } from './KPattern.d-N-dYG3S_.js';
|
|
5
5
|
|
|
6
6
|
type FaceletMeshStickeringMask = "regular" | "dim" | "oriented" | "experimentalOriented2" | "ignored" | "invisible";
|
|
7
7
|
type FaceletStickeringMask = {
|
|
@@ -20,6 +20,9 @@ type StickeringMask = {
|
|
|
20
20
|
orbits: Record<string, OrbitStickeringMask>;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
type KeyMapping = {
|
|
24
|
+
[keyCode: string]: AlgLeaf;
|
|
25
|
+
};
|
|
23
26
|
interface PuzzleLoader {
|
|
24
27
|
id: string;
|
|
25
28
|
fullName: string;
|
|
@@ -36,6 +39,7 @@ interface PuzzleLoader {
|
|
|
36
39
|
stickerings?: () => Promise<ExperimentalStickering[]>;
|
|
37
40
|
puzzleSpecificSimplifyOptions?: PuzzleSpecificSimplifyOptions;
|
|
38
41
|
puzzleSpecificSimplifyOptionsPromise?: Promise<PuzzleSpecificSimplifyOptions>;
|
|
42
|
+
keyMapping?: () => Promise<KeyMapping>;
|
|
39
43
|
}
|
|
40
44
|
|
|
41
45
|
declare const experimentalStickerings: Record<string, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as AlgNode, A as Alg, M as Move, c as AppendOptions, G as Grouping, C as Commutator, d as Conjugate, e as Pause, N as Newline, L as LineComment, b as AlgLeaf } from '../
|
|
2
|
-
export { g as AlgBranch, h as AppendCancelOptions, f as MoveModifications, P as PuzzleSpecificSimplifyOptions, Q as QuantumMove, S as SimplifyOptions } from '../
|
|
3
|
-
export { P as ExperimentalParsed } from '../parseAlg.d-
|
|
1
|
+
import { a as AlgNode, A as Alg, M as Move, c as AppendOptions, G as Grouping, C as Commutator, d as Conjugate, e as Pause, N as Newline, L as LineComment, K as KeyMapping, b as AlgLeaf } from '../PuzzleLoader-DUS1aLQG.js';
|
|
2
|
+
export { g as AlgBranch, h as AppendCancelOptions, f as MoveModifications, P as PuzzleSpecificSimplifyOptions, Q as QuantumMove, S as SimplifyOptions } from '../PuzzleLoader-DUS1aLQG.js';
|
|
3
|
+
export { P as ExperimentalParsed } from '../parseAlg.d-DhFLCVac.js';
|
|
4
|
+
import 'three';
|
|
4
5
|
|
|
5
6
|
/** @deprecated */
|
|
6
7
|
type Unit = AlgNode;
|
|
@@ -60,7 +61,7 @@ declare const Example: {
|
|
|
60
61
|
TriplePause: Alg;
|
|
61
62
|
};
|
|
62
63
|
|
|
63
|
-
declare function keyToMove(e: KeyboardEvent): AlgLeaf | null;
|
|
64
|
+
declare function keyToMove(keyMapping: KeyMapping | undefined, e: KeyboardEvent): AlgLeaf | null;
|
|
64
65
|
|
|
65
66
|
interface AlgCubingNetOptions {
|
|
66
67
|
alg?: Alg;
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { K as KPattern } from '../KPattern.d-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
1
|
+
import { K as KPattern } from '../KPattern.d-N-dYG3S_.js';
|
|
2
|
+
import { a as PuzzleID, P as PuzzleLoader } from '../TwizzleLink.d-Cf4H-1Jc.js';
|
|
3
|
+
import { A as Alg, M as Move } from '../PuzzleLoader-DUS1aLQG.js';
|
|
4
|
+
import { B as BluetoothPuzzle } from '../bluetooth-puzzle.d-ClBIGffk.js';
|
|
5
|
+
export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-ClBIGffk.js';
|
|
6
|
+
import 'three';
|
|
7
|
+
import '../parseAlg.d-DhFLCVac.js';
|
|
5
8
|
|
|
6
9
|
declare function enableDebugLogging(enable: boolean): void;
|
|
7
10
|
|
|
8
11
|
/** @category Keyboard Puzzles */
|
|
9
12
|
declare class KeyboardPuzzle extends BluetoothPuzzle {
|
|
10
13
|
private target;
|
|
11
|
-
private
|
|
14
|
+
private keyMappingPromise;
|
|
12
15
|
private pattern;
|
|
13
16
|
listener: (e: KeyboardEvent) => Promise<void>;
|
|
14
|
-
constructor(target: Element);
|
|
17
|
+
constructor(target: Element, puzzle?: PuzzleID | PuzzleLoader);
|
|
15
18
|
name(): string | undefined;
|
|
19
|
+
setPuzzle(puzzle: PuzzleID | PuzzleLoader): Promise<void>;
|
|
16
20
|
disconnect(): void;
|
|
17
21
|
getPattern(): Promise<KPattern>;
|
|
18
22
|
private onKeyDown;
|
|
19
23
|
}
|
|
20
24
|
/** @category Keyboard Puzzles */
|
|
21
|
-
declare function debugKeyboardConnect(target?: any): Promise<KeyboardPuzzle>;
|
|
25
|
+
declare function debugKeyboardConnect(target?: any, puzzle?: PuzzleID | PuzzleLoader): Promise<KeyboardPuzzle>;
|
|
22
26
|
|
|
23
27
|
/******** connect() ********/
|
|
24
28
|
interface BluetoothConnectOptions {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
binaryComponentsToReid3x3x3,
|
|
3
3
|
twizzleBinaryToBinaryComponents
|
|
4
|
-
} from "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-DSMNO2NL.js";
|
|
5
5
|
import {
|
|
6
6
|
cube3x3x3,
|
|
7
7
|
puzzles
|
|
8
|
-
} from "../chunks/chunk-
|
|
8
|
+
} from "../chunks/chunk-SJG4RSQ7.js";
|
|
9
9
|
import {
|
|
10
10
|
experimental3x3x3KPuzzle
|
|
11
|
-
} from "../chunks/chunk-
|
|
11
|
+
} from "../chunks/chunk-2P6TNNY3.js";
|
|
12
12
|
import {
|
|
13
13
|
KPattern
|
|
14
|
-
} from "../chunks/chunk-
|
|
14
|
+
} from "../chunks/chunk-ZJQ7HF54.js";
|
|
15
15
|
import {
|
|
16
16
|
Alg,
|
|
17
17
|
Move,
|
|
18
18
|
experimentalAppendMove,
|
|
19
19
|
keyToMove
|
|
20
|
-
} from "../chunks/chunk-
|
|
20
|
+
} from "../chunks/chunk-BKDL54KM.js";
|
|
21
21
|
|
|
22
22
|
// src/cubing/bluetooth/debug.ts
|
|
23
23
|
var DEBUG_LOGGING_ENABLED = false;
|
|
@@ -132,18 +132,26 @@ var BluetoothPuzzle = class extends EventTarget {
|
|
|
132
132
|
// src/cubing/bluetooth/keyboard.ts
|
|
133
133
|
var KeyboardPuzzle = class extends BluetoothPuzzle {
|
|
134
134
|
// TODO: Decide on the right arguments.
|
|
135
|
-
|
|
135
|
+
// TODO: support tying the puzzle to a TwistyPlayer.
|
|
136
|
+
constructor(target, puzzle = "3x3x3") {
|
|
136
137
|
super();
|
|
137
138
|
this.target = target;
|
|
138
139
|
this.listener = this.onKeyDown.bind(this);
|
|
139
140
|
target.addEventListener("keydown", this.listener);
|
|
141
|
+
this.setPuzzle(puzzle);
|
|
140
142
|
}
|
|
141
|
-
|
|
142
|
-
pattern
|
|
143
|
+
keyMappingPromise;
|
|
144
|
+
pattern;
|
|
143
145
|
listener;
|
|
144
146
|
name() {
|
|
145
147
|
return "Keyboard Input";
|
|
146
148
|
}
|
|
149
|
+
async setPuzzle(puzzle) {
|
|
150
|
+
const puzzlePromise = (async () => typeof puzzle === "string" ? (await import("../puzzles/index.js")).puzzles[puzzle] : puzzle)();
|
|
151
|
+
const kpuzzlePromise = (async () => (await puzzlePromise).kpuzzle())();
|
|
152
|
+
this.keyMappingPromise = (async () => (await puzzlePromise).keyMapping?.())();
|
|
153
|
+
this.pattern = (async () => (await kpuzzlePromise).defaultPattern())();
|
|
154
|
+
}
|
|
147
155
|
disconnect() {
|
|
148
156
|
this.target.removeEventListener("keydown", this.listener);
|
|
149
157
|
}
|
|
@@ -154,7 +162,7 @@ var KeyboardPuzzle = class extends BluetoothPuzzle {
|
|
|
154
162
|
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) {
|
|
155
163
|
return;
|
|
156
164
|
}
|
|
157
|
-
const algLeaf = keyToMove(e);
|
|
165
|
+
const algLeaf = keyToMove(await this.keyMappingPromise, e);
|
|
158
166
|
if (algLeaf) {
|
|
159
167
|
const newPattern = (await this.pattern).applyAlg(new Alg([algLeaf]));
|
|
160
168
|
this.pattern = Promise.resolve(newPattern);
|
|
@@ -167,8 +175,8 @@ var KeyboardPuzzle = class extends BluetoothPuzzle {
|
|
|
167
175
|
}
|
|
168
176
|
}
|
|
169
177
|
};
|
|
170
|
-
async function debugKeyboardConnect(target = window) {
|
|
171
|
-
return new KeyboardPuzzle(target);
|
|
178
|
+
async function debugKeyboardConnect(target = window, puzzle = "3x3x3") {
|
|
179
|
+
return new KeyboardPuzzle(target, puzzle);
|
|
172
180
|
}
|
|
173
181
|
|
|
174
182
|
// src/cubing/bluetooth/connect/index.ts
|