cubing 0.63.6 → 0.63.8

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.
@@ -4,10 +4,10 @@
4
4
  var packageVersion = (
5
5
  // biome-ignore lint/suspicious/noTsIgnore: This comment is stil present in the compiled file, where an error is *not* expected.
6
6
  /** @ts-ignore Populated by `esbuild` at compile time. */
7
- "0.63.6"
7
+ "0.63.8"
8
8
  );
9
9
 
10
10
  export {
11
11
  packageVersion
12
12
  };
13
- //# sourceMappingURL=chunk-RHJ7ANWU.js.map
13
+ //# sourceMappingURL=chunk-EWR23OA4.js.map
package/dist/bin/order.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env -S node --
2
2
  import {
3
3
  packageVersion
4
- } from "./chunks/chunk-RHJ7ANWU.js";
4
+ } from "./chunks/chunk-EWR23OA4.js";
5
5
 
6
6
  // src/bin/order.ts
7
7
  import { basename } from "node:path";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env -S node --
2
2
  import {
3
3
  packageVersion
4
- } from "./chunks/chunk-RHJ7ANWU.js";
4
+ } from "./chunks/chunk-EWR23OA4.js";
5
5
 
6
6
  // src/bin/puzzle-geometry-bin.ts
7
7
  import { basename } from "node:path";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env -S node --
2
2
  import {
3
3
  packageVersion
4
- } from "./chunks/chunk-RHJ7ANWU.js";
4
+ } from "./chunks/chunk-EWR23OA4.js";
5
5
 
6
6
  // src/bin/scramble.ts
7
7
  import { basename } from "node:path";
package/dist/bin/svg.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env -S node --
2
2
  import {
3
3
  packageVersion
4
- } from "./chunks/chunk-RHJ7ANWU.js";
4
+ } from "./chunks/chunk-EWR23OA4.js";
5
5
 
6
6
  // src/bin/svg.ts
7
7
  import { basename } from "node:path";
@@ -1,2 +1,2 @@
1
- import { At as Move, Ct as AlgLeaf, Dt as Grouping, Et as LineComment, Ft as ExperimentalNotationType, It as ExperimentalSerializationOptions, Mt as QuantumMove, Nt as Conjugate, Ot as GroupingModifications, Pt as Commutator, St as AlgBranch, Tt as Newline, _t as experimentalAppendMove, a as functionFromTraversal, bt as SimplifyOptions, f as Parsed, ft as experimentalIs, gt as Alg, ht as AlgBuilder, i as TraversalUp, jt as MoveModifications, kt as Pause, mt as setAlgDebug, n as experimentalAlgCubingNetLink, o as keyToMove, pt as Example, r as TraversalDownUp, t as AlgCubingNetOptions, vt as AppendCancelOptions, wt as AlgNode, xt as Unit, yt as PuzzleSpecificSimplifyOptions } from "../index-BXHm_6gm.js";
1
+ import { At as Move, Ct as AlgLeaf, Dt as Grouping, Et as LineComment, Ft as ExperimentalNotationType, It as ExperimentalSerializationOptions, Mt as QuantumMove, Nt as Conjugate, Ot as GroupingModifications, Pt as Commutator, St as AlgBranch, Tt as Newline, _t as experimentalAppendMove, a as functionFromTraversal, bt as SimplifyOptions, f as Parsed, ft as experimentalIs, gt as Alg, ht as AlgBuilder, i as TraversalUp, jt as MoveModifications, kt as Pause, mt as setAlgDebug, n as experimentalAlgCubingNetLink, o as keyToMove, pt as Example, r as TraversalDownUp, t as AlgCubingNetOptions, vt as AppendCancelOptions, wt as AlgNode, xt as Unit, yt as PuzzleSpecificSimplifyOptions } from "../index-B2leUGbW.js";
2
2
  export { Alg, AlgBranch, AlgBuilder, AlgCubingNetOptions, AlgLeaf, AlgNode, AppendCancelOptions, Commutator, Conjugate, Example, ExperimentalNotationType, Parsed as ExperimentalParsed, ExperimentalSerializationOptions, Grouping, GroupingModifications, LineComment, Move, MoveModifications, Newline, Pause, PuzzleSpecificSimplifyOptions, QuantumMove, SimplifyOptions, TraversalDownUp, TraversalUp, Unit, experimentalAlgCubingNetLink, experimentalAppendMove, experimentalIs, functionFromTraversal, keyToMove, setAlgDebug };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="web-bluetooth" />
2
2
 
3
- import { At as Move, D as PuzzleID, I as MillisecondTimestamp, R as KPattern, c as PuzzleLoader, gt as Alg, s as KeyMapping } from "../index-BXHm_6gm.js";
4
- import { a as OrientationEvent, i as AlgLeafEvent } from "../index-Cvk652Bd.js";
3
+ import { At as Move, D as PuzzleID, I as MillisecondTimestamp, R as KPattern, c as PuzzleLoader, gt as Alg, s as KeyMapping } from "../index-B2leUGbW.js";
4
+ import { a as OrientationEvent, i as AlgLeafEvent } from "../index-BLw2OxXo.js";
5
5
 
6
6
  //#region src/cubing/bluetooth/debug.d.ts
7
7
  declare function enableDebugLogging(enable: boolean): void;
@@ -2488,7 +2488,7 @@ interface DataUp {
2488
2488
  moveCount: number;
2489
2489
  element: TwistyAlgWrapperElem | TwistyAlgLeafElem;
2490
2490
  }
2491
- declare class TwistyAlgLeafElem extends ManagedCustomElement {
2491
+ declare class TwistyAlgLeafElem extends HTMLElementShim {
2492
2492
  algOrAlgNode: Alg | AlgNode;
2493
2493
  constructor(className: string, text: string, dataDown: DataDown, algOrAlgNode: Alg | AlgNode, offsetIntoMove: boolean, clickable: boolean);
2494
2494
  pathToIndex(_index: number): (TwistyAlgWrapperElem | TwistyAlgLeafElem)[];
@@ -2510,7 +2510,7 @@ declare class MoveHighlighter {
2510
2510
  set(move: Parsed<Move> | null): void;
2511
2511
  }
2512
2512
  /** @category Other Custom Elements */
2513
- declare class TwistyAlgViewer extends HTMLElementShim {
2513
+ declare class TwistyAlgViewer extends ManagedCustomElement {
2514
2514
  #private;
2515
2515
  highlighter: MoveHighlighter;
2516
2516
  lastClickTimestamp: number | null;
@@ -1,4 +1,4 @@
1
- import { Ct as AlgLeaf, R as KPattern } from "./index-BXHm_6gm.js";
1
+ import { Ct as AlgLeaf, R as KPattern } from "./index-B2leUGbW.js";
2
2
 
3
3
  //#region src/cubing/stream/events.d.ts
4
4
  /** @category Smart Puzzles */
@@ -1,2 +1,2 @@
1
- import { B as KTransformation, G as KTransformationData, H as KPatternData, K as KTransformationOrbitData, R as KPattern, U as KPatternOrbitData, V as KPuzzleDefinition, W as KPuzzleOrbitDefinition, z as KPuzzle } from "../index-BXHm_6gm.js";
1
+ import { B as KTransformation, G as KTransformationData, H as KPatternData, K as KTransformationOrbitData, R as KPattern, U as KPatternOrbitData, V as KPuzzleDefinition, W as KPuzzleOrbitDefinition, z as KPuzzle } from "../index-B2leUGbW.js";
2
2
  export { KPattern, KPatternData, KPatternOrbitData, KPuzzle, KPuzzleDefinition, KPuzzleOrbitDefinition, KTransformation, KTransformationData, KTransformationOrbitData };
@@ -1,4 +1,4 @@
1
- import { M as LeafCount, c as PuzzleLoader, gt as Alg } from "../index-BXHm_6gm.js";
1
+ import { M as LeafCount, c as PuzzleLoader, gt as Alg } from "../index-B2leUGbW.js";
2
2
 
3
3
  //#region src/cubing/notation/CountAnimatedLeaves.d.ts
4
4
  declare const countAnimatedLeaves: (alg: Alg) => LeafCount;
@@ -1,4 +1,4 @@
1
- import { R as KPattern, gt as Alg, z as KPuzzle } from "./index-BXHm_6gm.js";
1
+ import { R as KPattern, gt as Alg, z as KPuzzle } from "./index-B2leUGbW.js";
2
2
  //#region src/cubing/search/inside/solve/puzzles/3x3x3/index.d.ts
3
3
  declare function random333Pattern(): Promise<KPattern>;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { R as KPattern } from "../index-BXHm_6gm.js";
1
+ import { R as KPattern } from "../index-B2leUGbW.js";
2
2
 
3
3
  //#region src/cubing/protocol/binary/binary3x3x3.d.ts
4
4
  type Binary3x3x3Pattern = Uint8Array;
@@ -1,2 +1,2 @@
1
- import { $ as PuzzleDescription, J as PUZZLE_BASE_SHAPES, L as schreierSims, Q as PuzzleCutType, X as PuzzleBaseShape, Y as PUZZLE_CUT_TYPES, Z as PuzzleCutDescription, at as getPG3DNamedPuzzles, ct as getPuzzleGeometryByName, dt as PuzzleGeometryOptions, et as PuzzleGeometry, it as StickerDatSticker, lt as parsePuzzleDescription, nt as StickerDatAxis, ot as getPuzzleDescriptionString, q as PGNotation, rt as StickerDatFace, st as getPuzzleGeometryByDesc, tt as StickerDat, ut as Quat } from "../index-BXHm_6gm.js";
1
+ import { $ as PuzzleDescription, J as PUZZLE_BASE_SHAPES, L as schreierSims, Q as PuzzleCutType, X as PuzzleBaseShape, Y as PUZZLE_CUT_TYPES, Z as PuzzleCutDescription, at as getPG3DNamedPuzzles, ct as getPuzzleGeometryByName, dt as PuzzleGeometryOptions, et as PuzzleGeometry, it as StickerDatSticker, lt as parsePuzzleDescription, nt as StickerDatAxis, ot as getPuzzleDescriptionString, q as PGNotation, rt as StickerDatFace, st as getPuzzleGeometryByDesc, tt as StickerDat, ut as Quat } from "../index-B2leUGbW.js";
2
2
  export { PUZZLE_BASE_SHAPES as EXPERIMENTAL_PUZZLE_BASE_SHAPES, PUZZLE_CUT_TYPES as EXPERIMENTAL_PUZZLE_CUT_TYPES, PGNotation as ExperimentalPGNotation, PuzzleBaseShape as ExperimentalPuzzleBaseShape, PuzzleCutDescription as ExperimentalPuzzleCutDescription, PuzzleCutType as ExperimentalPuzzleCutType, PuzzleDescription as ExperimentalPuzzleDescription, PuzzleGeometryOptions as ExperimentalPuzzleGeometryOptions, PuzzleGeometry, Quat, StickerDat, StickerDatAxis, StickerDatFace, StickerDatSticker, getPG3DNamedPuzzles, getPuzzleDescriptionString, getPuzzleGeometryByDesc, getPuzzleGeometryByName, parsePuzzleDescription, schreierSims };
@@ -1,2 +1,2 @@
1
- import { _ as cube2x2x2, b as wcaEventInfo, c as PuzzleLoader, g as cube3x3x3, h as puzzles, v as eventInfo, x as wcaEvents, y as twizzleEvents } from "../index-BXHm_6gm.js";
1
+ import { _ as cube2x2x2, b as wcaEventInfo, c as PuzzleLoader, g as cube3x3x3, h as puzzles, v as eventInfo, x as wcaEvents, y as twizzleEvents } from "../index-B2leUGbW.js";
2
2
  export { PuzzleLoader, cube2x2x2, cube3x3x3, eventInfo, puzzles, twizzleEvents, wcaEventInfo, wcaEvents };
@@ -1,2 +1,2 @@
1
- import { i as randomScrambleForEvent, t as deriveScrambleForEvent } from "../outside-C2ODxIX_.js";
1
+ import { i as randomScrambleForEvent, t as deriveScrambleForEvent } from "../outside-V6_PW1ZK.js";
2
2
  export { deriveScrambleForEvent as experimentalDeriveScrambleForEvent, randomScrambleForEvent };
@@ -1,4 +1,4 @@
1
- import { a as setSearchDebug, c as solveSkewb, l as solveTwips, n as experimentalSolve2x2x2, o as solveMegaminx, r as experimentalSolve3x3x3IgnoringCenters, s as solvePyraminx, u as random333Pattern } from "../outside-C2ODxIX_.js";
1
+ import { a as setSearchDebug, c as solveSkewb, l as solveTwips, n as experimentalSolve2x2x2, o as solveMegaminx, r as experimentalSolve3x3x3IgnoringCenters, s as solvePyraminx, u as random333Pattern } from "../outside-V6_PW1ZK.js";
2
2
 
3
3
  //#region src/cubing/search/index.d.ts
4
4
  /** @deprecated */
@@ -1,2 +1,2 @@
1
- import { a as OrientationEvent, c as ProxyOrientationEvent, i as AlgLeafEvent, l as ProxyResetEvent, n as WebSocketProxySender, o as ProxyEvent, r as TwizzleStreamServer, s as ProxyMoveEvent, t as WebSocketProxyReceiver } from "../index-Cvk652Bd.js";
1
+ import { a as OrientationEvent, c as ProxyOrientationEvent, i as AlgLeafEvent, l as ProxyResetEvent, n as WebSocketProxySender, o as ProxyEvent, r as TwizzleStreamServer, s as ProxyMoveEvent, t as WebSocketProxyReceiver } from "../index-BLw2OxXo.js";
2
2
  export { AlgLeafEvent as ExperimentalAlgLeafEvent, OrientationEvent as ExperimentalOrientationEvent, ProxyEvent as ExperimentalProxyEvent, ProxyMoveEvent as ExperimentalProxyMoveEvent, ProxyOrientationEvent as ExperimentalProxyOrientationEvent, ProxyResetEvent as ExperimentalProxyResetEvent, TwizzleStreamServer as ExperimentalTwizzleStreamServer, WebSocketProxyReceiver as ExperimentalWebSocketProxyReceiver, WebSocketProxySender as ExperimentalWebSocketProxySender };
@@ -1,2 +1,2 @@
1
- import { A as SimpleAlgIndexer, C as VisualizationFormat, D as PuzzleID, E as ExperimentalStickering, F as MillisecondDuration, I as MillisecondTimestamp, M as LeafCount, N as LeafIndex, O as setTwistyDebug, P as NO_VALUE, S as TwistyAnimatedSVG, T as backViewLayouts, d as TwistyAlgEditor, j as AlgIndexer, k as TreeAlgIndexer, l as TwizzleLink, m as TwistyPlayerConfig, p as TwistyPlayer, u as TwistyAlgViewer, w as BackViewLayout } from "../index-BXHm_6gm.js";
1
+ import { A as SimpleAlgIndexer, C as VisualizationFormat, D as PuzzleID, E as ExperimentalStickering, F as MillisecondDuration, I as MillisecondTimestamp, M as LeafCount, N as LeafIndex, O as setTwistyDebug, P as NO_VALUE, S as TwistyAnimatedSVG, T as backViewLayouts, d as TwistyAlgEditor, j as AlgIndexer, k as TreeAlgIndexer, l as TwizzleLink, m as TwistyPlayerConfig, p as TwistyPlayer, u as TwistyAlgViewer, w as BackViewLayout } from "../index-B2leUGbW.js";
2
2
  export { AlgIndexer, BackViewLayout, NO_VALUE as EXPERIMENTAL_PROP_NO_VALUE, LeafCount as ExperimentalLeafCount, LeafIndex as ExperimentalLeafIndex, MillisecondDuration as ExperimentalMillisecondDuration, MillisecondTimestamp as ExperimentalMillisecondTimestamp, TwistyAnimatedSVG as ExperimentalSVGAnimator, ExperimentalStickering, PuzzleID, SimpleAlgIndexer, TreeAlgIndexer, TwistyAlgEditor, TwistyAlgViewer, TwistyPlayer, TwistyPlayerConfig, TwizzleLink, VisualizationFormat, backViewLayouts, setTwistyDebug };
@@ -5308,23 +5308,43 @@ twistyAlgViewerCSS.replaceSync(
5308
5308
  `
5309
5309
  :host {
5310
5310
  display: inline;
5311
+ --comment-opacity: 0.4;
5312
+ --active-background-shade: rgba(66, 133, 244);
5311
5313
  }
5312
5314
 
5313
5315
  .wrapper {
5314
5316
  display: inline;
5317
+ --current-color: currentColor
5315
5318
  }
5316
5319
 
5317
- a:not(:hover) {
5318
- color: inherit;
5319
- text-decoration: none;
5320
+ a {
5321
+ color: currentColor;
5322
+
5323
+ &:not(:hover) {
5324
+ text-decoration: none;
5325
+ }
5326
+
5327
+ &:hover {
5328
+ background: color-mix(in oklab, currentColor 20%, transparent);
5329
+ }
5330
+
5331
+ &:active {
5332
+ color: currentColor;
5333
+ animation: 1s linear flash;
5334
+ }
5335
+ }
5336
+
5337
+ @keyframes flash {
5338
+ from { opacity: 0.5; }
5339
+ to { opacity: 1; }
5320
5340
  }
5321
5341
 
5322
- twisty-alg-leaf-elem.twisty-alg-comment {
5323
- color: rgba(0, 0, 0, 0.4);
5342
+ twisty-alg-leaf-elem.twisty-alg-line-comment {
5343
+ opacity: var(--comment-opacity);
5324
5344
  }
5325
5345
 
5326
- .wrapper.current-move {
5327
- background: rgba(66, 133, 244, 0.3);
5346
+ .current-move {
5347
+ background: color-mix(in oklab, var(--active-background-shade) 30%, transparent);
5328
5348
  margin-left: -0.1em;
5329
5349
  margin-right: -0.1em;
5330
5350
  padding-left: 0.1em;
@@ -5336,16 +5356,13 @@ twisty-alg-leaf-elem.twisty-alg-comment {
5336
5356
 
5337
5357
  // src/cubing/twisty/views/TwistyAlgViewer.ts
5338
5358
  var DEFAULT_OFFSET_FRACTION = 0.25;
5339
- var TwistyAlgLeafElem = class extends ManagedCustomElement {
5359
+ var TwistyAlgLeafElem = class extends HTMLElementShim {
5340
5360
  constructor(className, text, dataDown, algOrAlgNode, offsetIntoMove, clickable) {
5341
- super({ mode: "open" });
5361
+ super();
5342
5362
  this.algOrAlgNode = algOrAlgNode;
5343
5363
  this.classList.add(className);
5344
- this.addCSS(twistyAlgViewerCSS);
5345
5364
  if (clickable) {
5346
- const anchor = this.contentWrapper.appendChild(
5347
- document.createElement("a")
5348
- );
5365
+ const anchor = this.appendChild(document.createElement("a"));
5349
5366
  anchor.href = "#";
5350
5367
  anchor.textContent = text;
5351
5368
  anchor.addEventListener("click", (e) => {
@@ -5356,9 +5373,7 @@ var TwistyAlgLeafElem = class extends ManagedCustomElement {
5356
5373
  );
5357
5374
  });
5358
5375
  } else {
5359
- this.contentWrapper.appendChild(
5360
- document.createElement("span")
5361
- ).textContent = text;
5376
+ this.appendChild(document.createElement("span")).textContent = text;
5362
5377
  }
5363
5378
  }
5364
5379
  algOrAlgNode;
@@ -5366,7 +5381,7 @@ var TwistyAlgLeafElem = class extends ManagedCustomElement {
5366
5381
  return [];
5367
5382
  }
5368
5383
  setCurrentMove(current) {
5369
- this.contentWrapper.classList.toggle("current-move", current);
5384
+ this.classList.toggle("current-move", current);
5370
5385
  }
5371
5386
  };
5372
5387
  customElementsShim.define("twisty-alg-leaf-elem", TwistyAlgLeafElem);
@@ -5379,7 +5394,9 @@ var TwistyAlgWrapperElem = class extends HTMLElementShim {
5379
5394
  algOrAlgNode;
5380
5395
  queue = [];
5381
5396
  addString(str) {
5382
- this.queue.push(document.createTextNode(str));
5397
+ const span = document.createElement("span");
5398
+ span.textContent = str;
5399
+ this.queue.push(span);
5383
5400
  }
5384
5401
  addElem(dataUp) {
5385
5402
  this.queue.push(dataUp.element);
@@ -5626,20 +5643,20 @@ var MoveHighlighter = class {
5626
5643
  if (this.currentElem === newElem) {
5627
5644
  return;
5628
5645
  }
5629
- this.currentElem?.classList.remove("twisty-alg-current-move");
5630
5646
  this.currentElem?.setCurrentMove(false);
5631
- newElem?.classList.add("twisty-alg-current-move");
5632
5647
  newElem?.setCurrentMove(true);
5633
5648
  this.currentElem = newElem;
5634
5649
  }
5635
5650
  };
5636
- var TwistyAlgViewer = class extends HTMLElementShim {
5651
+ var TwistyAlgViewer = class extends ManagedCustomElement {
5637
5652
  highlighter = new MoveHighlighter();
5638
5653
  #domTree;
5654
+ #domTreeAlg;
5639
5655
  #twistyPlayer = null;
5640
5656
  lastClickTimestamp = null;
5641
5657
  constructor(options) {
5642
- super();
5658
+ super({ mode: "open" });
5659
+ this.addCSS(twistyAlgViewerCSS);
5643
5660
  if (options?.twistyPlayer) {
5644
5661
  this.twistyPlayer = options?.twistyPlayer;
5645
5662
  }
@@ -5647,13 +5664,17 @@ var TwistyAlgViewer = class extends HTMLElementShim {
5647
5664
  connectedCallback() {
5648
5665
  }
5649
5666
  setAlg(alg) {
5667
+ if (this.#domTreeAlg?.isIdentical(alg)) {
5668
+ return;
5669
+ }
5650
5670
  this.#domTree = algToDOMTree(alg, {
5651
5671
  earliestMoveIndex: 0,
5652
5672
  twistyAlgViewer: this,
5653
5673
  direction: 1 /* Forwards */
5654
5674
  }).element;
5655
- this.textContent = "";
5656
- this.appendChild(this.#domTree);
5675
+ this.#domTreeAlg = alg;
5676
+ this.contentWrapper.textContent = "";
5677
+ this.contentWrapper.appendChild(this.#domTree);
5657
5678
  }
5658
5679
  get twistyPlayer() {
5659
5680
  return this.#twistyPlayer;
@@ -5675,9 +5696,6 @@ var TwistyAlgViewer = class extends HTMLElementShim {
5675
5696
  this.setAlg(algWithIssues.alg);
5676
5697
  }
5677
5698
  );
5678
- const sourceAlg = (await this.#twistyPlayer.experimentalModel.alg.get()).alg;
5679
- const parsedAlg = startCharIndexKey in sourceAlg ? sourceAlg : Alg.fromString(sourceAlg.toString());
5680
- this.setAlg(parsedAlg);
5681
5699
  twistyPlayer.experimentalModel.currentMoveInfo.addFreshListener(
5682
5700
  (currentMoveInfo) => {
5683
5701
  let moveInfo = currentMoveInfo.currentMoves[0];
@@ -5897,7 +5915,6 @@ twizzleLinkForumTweaksCSS.replaceSync(`
5897
5915
  background: #262626;
5898
5916
  --text-color: 142, 142, 142;
5899
5917
  border-color: #FFFFFF44;
5900
- color-scheme: dark;
5901
5918
  }
5902
5919
 
5903
5920
  .wrapper.dark-mode .heading:not(.title) {