cubing 0.53.12 → 0.53.13

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.
@@ -1,4 +1,4 @@
1
- import { M as Move, A as Alg } from './PuzzleLoader-BN2CTwbG.js';
1
+ import { M as Move, A as Alg } from './PuzzleLoader-BYI7PA7C.js';
2
2
 
3
3
  type KPatternData = Record<string, KPatternOrbitData>;
4
4
  interface KPatternOrbitData {
@@ -2321,6 +2321,7 @@ interface TwistyPlayerConfig {
2321
2321
  experimentalHintSprite?: string | null;
2322
2322
  experimentalMovePressCancelOptions?: AppendCancelOptions;
2323
2323
  }
2324
+ declare const intersectedCallback: unique symbol;
2324
2325
  /**
2325
2326
  * TwistyPlayer is the heart of `cubing.js`. It can be used to display a puzzle on a web page like this:
2326
2327
  *
@@ -2347,6 +2348,7 @@ declare class TwistyPlayer extends TwistyPlayerSettable implements TwistyAnimati
2347
2348
  experimentalCanvasClickCallback: (...args: any) => void;
2348
2349
  constructor(config?: TwistyPlayerConfig);
2349
2350
  connectedCallback(): Promise<void>;
2351
+ [intersectedCallback](): Promise<void>;
2350
2352
  /** @deprecated */
2351
2353
  experimentalSetFlashLevel(newLevel: "auto" | "none"): void;
2352
2354
  flash(): void;
@@ -1,7 +1,7 @@
1
1
  import { Texture, Object3D, Raycaster, PerspectiveCamera, Scene, WebGLRenderer } from 'three';
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-BN2CTwbG.js';
3
- import { P as Parsed } from './parseAlg.d-DewXU-Sn.js';
4
- import { s as KPuzzle, d as PuzzleGeometry, K as KPattern, t as KTransformation, u as PuzzleDescriptionString } from './KPattern.d-DdYwFXdd.js';
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-BYI7PA7C.js';
3
+ import { P as Parsed } from './parseAlg.d-BMkZo3Y-.js';
4
+ import { s as KPuzzle, d as PuzzleGeometry, K as KPattern, t as KTransformation, u as PuzzleDescriptionString } from './KPattern.d-B8PBnjzZ.js';
5
5
 
6
6
  type FaceletMeshStickeringMask = "regular" | "dim" | "oriented" | "experimentalOriented2" | "ignored" | "invisible" | "mystery";
7
7
  type FaceletStickeringMask = {
@@ -1114,6 +1114,7 @@ interface TwistyPlayerConfig {
1114
1114
  experimentalHintSprite?: string | null;
1115
1115
  experimentalMovePressCancelOptions?: AppendCancelOptions;
1116
1116
  }
1117
+ declare const intersectedCallback: unique symbol;
1117
1118
  /**
1118
1119
  * TwistyPlayer is the heart of `cubing.js`. It can be used to display a puzzle on a web page like this:
1119
1120
  *
@@ -1140,6 +1141,7 @@ declare class TwistyPlayer extends TwistyPlayerSettable implements TwistyAnimati
1140
1141
  experimentalCanvasClickCallback: (...args: any) => void;
1141
1142
  constructor(config?: TwistyPlayerConfig);
1142
1143
  connectedCallback(): Promise<void>;
1144
+ [intersectedCallback](): Promise<void>;
1143
1145
  /** @deprecated */
1144
1146
  experimentalSetFlashLevel(newLevel: "auto" | "none"): void;
1145
1147
  flash(): void;
@@ -1,6 +1,6 @@
1
- import { a as AlgNode, A as Alg, M as Move, c as AppendOptions, K as KeyMapping, b as AlgLeaf, G as Grouping, C as Commutator, d as Conjugate, e as Pause, N as Newline, L as LineComment } from '../PuzzleLoader-BN2CTwbG.js';
2
- export { g as AlgBranch, h as AppendCancelOptions, E as ExperimentalNotationType, i as ExperimentalSerializationOptions, f as MoveModifications, P as PuzzleSpecificSimplifyOptions, Q as QuantumMove, S as SimplifyOptions } from '../PuzzleLoader-BN2CTwbG.js';
3
- export { P as ExperimentalParsed } from '../parseAlg.d-DewXU-Sn.js';
1
+ import { a as AlgNode, A as Alg, M as Move, c as AppendOptions, K as KeyMapping, b as AlgLeaf, G as Grouping, C as Commutator, d as Conjugate, e as Pause, N as Newline, L as LineComment } from '../PuzzleLoader-BYI7PA7C.js';
2
+ export { g as AlgBranch, h as AppendCancelOptions, E as ExperimentalNotationType, i as ExperimentalSerializationOptions, f as MoveModifications, P as PuzzleSpecificSimplifyOptions, Q as QuantumMove, S as SimplifyOptions } from '../PuzzleLoader-BYI7PA7C.js';
3
+ export { P as ExperimentalParsed } from '../parseAlg.d-BMkZo3Y-.js';
4
4
  import 'three';
5
5
 
6
6
  /** @deprecated */
@@ -1,10 +1,10 @@
1
- import { K as KPattern } from '../KPattern.d-DdYwFXdd.js';
2
- import { a as PuzzleID, P as PuzzleLoader } from '../TwizzleLink.d-BzfMIk_O.js';
3
- import { A as Alg, M as Move } from '../PuzzleLoader-BN2CTwbG.js';
4
- import { B as BluetoothPuzzle } from '../bluetooth-puzzle.d-C-95fTCe.js';
5
- export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-C-95fTCe.js';
1
+ import { K as KPattern } from '../KPattern.d-B8PBnjzZ.js';
2
+ import { a as PuzzleID, P as PuzzleLoader } from '../TwizzleLink.d-Bxv5QZmG.js';
3
+ import { A as Alg, M as Move } from '../PuzzleLoader-BYI7PA7C.js';
4
+ import { B as BluetoothPuzzle } from '../bluetooth-puzzle.d-SLdses2g.js';
5
+ export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-SLdses2g.js';
6
6
  import 'three';
7
- import '../parseAlg.d-DewXU-Sn.js';
7
+ import '../parseAlg.d-BMkZo3Y-.js';
8
8
 
9
9
  declare function enableDebugLogging(enable: boolean): void;
10
10
 
@@ -1,5 +1,5 @@
1
- import { b as AlgLeaf } from './PuzzleLoader-BN2CTwbG.js';
2
- import { K as KPattern } from './KPattern.d-DdYwFXdd.js';
1
+ import { b as AlgLeaf } from './PuzzleLoader-BYI7PA7C.js';
2
+ import { K as KPattern } from './KPattern.d-B8PBnjzZ.js';
3
3
 
4
4
  interface StreamTransformer {
5
5
  transformAlgLeaf(algLeafEvent: AlgLeafEvent): void;
@@ -1,5 +1,5 @@
1
- import { A as Alg } from './PuzzleLoader-BN2CTwbG.js';
2
- import { K as KPattern, s as KPuzzle } from './KPattern.d-DdYwFXdd.js';
1
+ import { A as Alg } from './PuzzleLoader-BYI7PA7C.js';
2
+ import { K as KPattern, s as KPuzzle } from './KPattern.d-B8PBnjzZ.js';
3
3
 
4
4
  declare enum PrefetchLevel {
5
5
  Auto = "auto",
@@ -1,3 +1,3 @@
1
- export { K as KPattern, w as KPatternData, x as KPatternOrbitData, s as KPuzzle, v as KPuzzleDefinition, t as KTransformation, y as KTransformationData, z as KTransformationOrbitData } from '../KPattern.d-DdYwFXdd.js';
2
- import '../PuzzleLoader-BN2CTwbG.js';
1
+ export { K as KPattern, w as KPatternData, x as KPatternOrbitData, s as KPuzzle, v as KPuzzleDefinition, t as KTransformation, y as KTransformationData, z as KTransformationOrbitData } from '../KPattern.d-B8PBnjzZ.js';
2
+ import '../PuzzleLoader-BYI7PA7C.js';
3
3
  import 'three';
@@ -1,8 +1,8 @@
1
- import { A as Alg } from '../PuzzleLoader-BN2CTwbG.js';
2
- import { P as PuzzleLoader } from '../TwizzleLink.d-BzfMIk_O.js';
1
+ import { A as Alg } from '../PuzzleLoader-BYI7PA7C.js';
2
+ import { P as PuzzleLoader } from '../TwizzleLink.d-Bxv5QZmG.js';
3
3
  import 'three';
4
- import '../parseAlg.d-DewXU-Sn.js';
5
- import '../KPattern.d-DdYwFXdd.js';
4
+ import '../parseAlg.d-BMkZo3Y-.js';
5
+ import '../KPattern.d-B8PBnjzZ.js';
6
6
 
7
7
  declare enum CommonMetric {
8
8
  OuterBlockTurnMetric = "OBTM",
@@ -1,4 +1,4 @@
1
- import { A as Alg, a as AlgNode } from './PuzzleLoader-BN2CTwbG.js';
1
+ import { A as Alg, a as AlgNode } from './PuzzleLoader-BYI7PA7C.js';
2
2
 
3
3
  declare const startCharIndexKey: unique symbol;
4
4
  declare const endCharIndexKey: unique symbol;
@@ -1,5 +1,5 @@
1
- import '../PuzzleLoader-BN2CTwbG.js';
2
- import { K as KPattern } from '../KPattern.d-DdYwFXdd.js';
1
+ import '../PuzzleLoader-BYI7PA7C.js';
2
+ import { K as KPattern } from '../KPattern.d-B8PBnjzZ.js';
3
3
  import 'three';
4
4
 
5
5
  type Binary3x3x3Pattern = Uint8Array;
@@ -1,6 +1,6 @@
1
- import { P as Perm } from '../KPattern.d-DdYwFXdd.js';
2
- export { q as EXPERIMENTAL_PUZZLE_BASE_SHAPES, n as EXPERIMENTAL_PUZZLE_CUT_TYPES, k as ExperimentalPGNotation, r as ExperimentalPuzzleBaseShape, l as ExperimentalPuzzleCutDescription, o as ExperimentalPuzzleCutType, m as ExperimentalPuzzleDescription, j as ExperimentalPuzzleGeometryOptions, d as PuzzleGeometry, Q as Quat, S as StickerDat, e as StickerDatAxis, f as StickerDatFace, h as StickerDatSticker, c as getPG3DNamedPuzzles, g as getPuzzleDescriptionString, a as getPuzzleGeometryByDesc, b as getPuzzleGeometryByName, i as parseOptions, p as parsePuzzleDescription } from '../KPattern.d-DdYwFXdd.js';
3
- import '../PuzzleLoader-BN2CTwbG.js';
1
+ import { P as Perm } from '../KPattern.d-B8PBnjzZ.js';
2
+ export { q as EXPERIMENTAL_PUZZLE_BASE_SHAPES, n as EXPERIMENTAL_PUZZLE_CUT_TYPES, k as ExperimentalPGNotation, r as ExperimentalPuzzleBaseShape, l as ExperimentalPuzzleCutDescription, o as ExperimentalPuzzleCutType, m as ExperimentalPuzzleDescription, j as ExperimentalPuzzleGeometryOptions, d as PuzzleGeometry, Q as Quat, S as StickerDat, e as StickerDatAxis, f as StickerDatFace, h as StickerDatSticker, c as getPG3DNamedPuzzles, g as getPuzzleDescriptionString, a as getPuzzleGeometryByDesc, b as getPuzzleGeometryByName, i as parseOptions, p as parsePuzzleDescription } from '../KPattern.d-B8PBnjzZ.js';
3
+ import '../PuzzleLoader-BYI7PA7C.js';
4
4
  import 'three';
5
5
 
6
6
  declare function schreierSims(g: Perm[], disp: (s: string) => void): bigint;
@@ -1,8 +1,8 @@
1
- import { a as PuzzleID, P as PuzzleLoader, E as ExperimentalStickering, S as StickeringMask } from '../TwizzleLink.d-BzfMIk_O.js';
2
- import { P as PuzzleSpecificSimplifyOptions, b as AlgLeaf } from '../PuzzleLoader-BN2CTwbG.js';
3
- import { s as KPuzzle, d as PuzzleGeometry } from '../KPattern.d-DdYwFXdd.js';
1
+ import { a as PuzzleID, P as PuzzleLoader, E as ExperimentalStickering, S as StickeringMask } from '../TwizzleLink.d-Bxv5QZmG.js';
2
+ import { P as PuzzleSpecificSimplifyOptions, b as AlgLeaf } from '../PuzzleLoader-BYI7PA7C.js';
3
+ import { s as KPuzzle, d as PuzzleGeometry } from '../KPattern.d-B8PBnjzZ.js';
4
4
  import 'three';
5
- import '../parseAlg.d-DewXU-Sn.js';
5
+ import '../parseAlg.d-BMkZo3Y-.js';
6
6
 
7
7
  interface EventInfo {
8
8
  puzzleID: PuzzleID;
@@ -1,4 +1,4 @@
1
- export { r as randomScrambleForEvent } from '../index-CB2Rc3zO.js';
2
- import '../PuzzleLoader-BN2CTwbG.js';
3
- import '../KPattern.d-DdYwFXdd.js';
1
+ export { r as randomScrambleForEvent } from '../index-C0GtBTdp.js';
2
+ import '../PuzzleLoader-BYI7PA7C.js';
3
+ import '../KPattern.d-B8PBnjzZ.js';
4
4
  import 'three';
@@ -1,6 +1,6 @@
1
- export { a as experimentalSolve2x2x2, e as experimentalSolve3x3x3IgnoringCenters, f as experimentalSolveTwsearch, d as setSearchDebug, c as solveMegaminx, b as solvePyraminx, s as solveSkewb } from '../index-CB2Rc3zO.js';
2
- import '../PuzzleLoader-BN2CTwbG.js';
3
- import { K as KPattern } from '../KPattern.d-DdYwFXdd.js';
1
+ export { a as experimentalSolve2x2x2, e as experimentalSolve3x3x3IgnoringCenters, f as experimentalSolveTwsearch, d as setSearchDebug, c as solveMegaminx, b as solvePyraminx, s as solveSkewb } from '../index-C0GtBTdp.js';
2
+ import '../PuzzleLoader-BYI7PA7C.js';
3
+ import { K as KPattern } from '../KPattern.d-B8PBnjzZ.js';
4
4
  import 'three';
5
5
 
6
6
  declare function random333Pattern(): Promise<KPattern>;
@@ -1,9 +1,9 @@
1
- import '../PuzzleLoader-BN2CTwbG.js';
2
- import '../TwizzleLink.d-BzfMIk_O.js';
3
- import { A as AlgLeafEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-C-95fTCe.js';
1
+ import '../PuzzleLoader-BYI7PA7C.js';
2
+ import '../TwizzleLink.d-Bxv5QZmG.js';
3
+ import { A as AlgLeafEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-SLdses2g.js';
4
4
  import 'three';
5
- import '../parseAlg.d-DewXU-Sn.js';
6
- import '../KPattern.d-DdYwFXdd.js';
5
+ import '../parseAlg.d-BMkZo3Y-.js';
6
+ import '../KPattern.d-B8PBnjzZ.js';
7
7
 
8
8
  interface ProxyMoveEvent {
9
9
  event: "move";
@@ -1,9 +1,9 @@
1
- import { A as AlgIndexer, T as Timestamp, D as Duration, S as StickeringMask } from '../TwizzleLink.d-BzfMIk_O.js';
2
- export { B as BackViewLayout, N as EXPERIMENTAL_PROP_NO_VALUE, M as ExperimentalMillisecondTimestamp, E as ExperimentalStickering, a as PuzzleID, d as TwistyAlgEditor, c as TwistyAlgViewer, b as TwistyPlayer, e as TwistyPlayerConfig, g as TwizzleLink, V as VisualizationFormat, f as backViewLayouts } from '../TwizzleLink.d-BzfMIk_O.js';
3
- import { A as Alg, M as Move } from '../PuzzleLoader-BN2CTwbG.js';
4
- import { s as KPuzzle, K as KPattern, t as KTransformation } from '../KPattern.d-DdYwFXdd.js';
1
+ import { A as AlgIndexer, T as Timestamp, D as Duration, S as StickeringMask } from '../TwizzleLink.d-Bxv5QZmG.js';
2
+ export { B as BackViewLayout, N as EXPERIMENTAL_PROP_NO_VALUE, M as ExperimentalMillisecondTimestamp, E as ExperimentalStickering, a as PuzzleID, d as TwistyAlgEditor, c as TwistyAlgViewer, b as TwistyPlayer, e as TwistyPlayerConfig, g as TwizzleLink, V as VisualizationFormat, f as backViewLayouts } from '../TwizzleLink.d-Bxv5QZmG.js';
3
+ import { A as Alg, M as Move } from '../PuzzleLoader-BYI7PA7C.js';
4
+ import { s as KPuzzle, K as KPattern, t as KTransformation } from '../KPattern.d-B8PBnjzZ.js';
5
5
  import 'three';
6
- import '../parseAlg.d-DewXU-Sn.js';
6
+ import '../parseAlg.d-BMkZo3Y-.js';
7
7
 
8
8
  declare const twistyDebugGlobals: {
9
9
  shareAllNewRenderers: "auto" | "always" | "never";
@@ -4251,6 +4251,21 @@ var configKeys = Object.fromEntries(
4251
4251
  var propOnly = {
4252
4252
  experimentalMovePressCancelOptions: true
4253
4253
  };
4254
+ var cachedSharedIntersectionObserver;
4255
+ var intersectedCallback = Symbol("intersectedCallback");
4256
+ function waitForIntersection(player) {
4257
+ cachedSharedIntersectionObserver ??= new IntersectionObserver(
4258
+ (entries, observer) => {
4259
+ for (const entry of entries) {
4260
+ if (entry.isIntersecting && entry.intersectionRect.height > 0) {
4261
+ entry.target[intersectedCallback]();
4262
+ observer.unobserve(entry.target);
4263
+ }
4264
+ }
4265
+ }
4266
+ );
4267
+ cachedSharedIntersectionObserver.observe(player);
4268
+ }
4254
4269
  var TwistyPlayer = class extends TwistyPlayerSettable {
4255
4270
  controller = new TwistyPlayerController(
4256
4271
  this.experimentalModel,
@@ -4285,11 +4300,14 @@ var TwistyPlayer = class extends TwistyPlayerSettable {
4285
4300
  #alreadyConnected = false;
4286
4301
  // TODO: support resetting
4287
4302
  async connectedCallback() {
4303
+ this.addCSS(twistyPlayerCSS);
4304
+ waitForIntersection(this);
4305
+ }
4306
+ async [intersectedCallback]() {
4288
4307
  if (this.#alreadyConnected) {
4289
4308
  return;
4290
4309
  }
4291
4310
  this.#alreadyConnected = true;
4292
- this.addCSS(twistyPlayerCSS);
4293
4311
  this.addElement(this.#visualizationWrapperElem).classList.add(
4294
4312
  "visualization-wrapper"
4295
4313
  );