cubing 0.21.1 → 0.22.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/README.md +4 -7
- package/{src/cubing/kpuzzle → dist}/.DS_Store +0 -0
- package/dist/bin/order.js +16675 -0
- package/dist/bin/order.js.map +7 -0
- package/dist/bin/puzzle-geometry-bin.js +13 -9
- package/dist/bin/puzzle-geometry-bin.js.map +2 -2
- package/dist/bundle-global/cubing.bundle-global.js +555 -298
- package/dist/esm/3d-M7GBIT3X.js +21 -0
- package/dist/esm/3d-M7GBIT3X.js.map +7 -0
- package/dist/esm/alg/index.js +1 -1
- package/dist/esm/bluetooth/index.js +10 -8
- package/dist/esm/bluetooth/index.js.map +3 -3
- package/dist/esm/{chunk-RE7MIN5R.js → chunk-4IUYLRHT.js} +2 -2
- package/dist/esm/{chunk-RE7MIN5R.js.map → chunk-4IUYLRHT.js.map} +0 -0
- package/dist/esm/{chunk-CSVAFZSB.js → chunk-6BZSKSG7.js} +724 -735
- package/dist/esm/chunk-6BZSKSG7.js.map +7 -0
- package/dist/esm/{chunk-BU5PUJK3.js → chunk-EWRBHQFX.js} +1 -1
- package/dist/esm/{chunk-BU5PUJK3.js.map → chunk-EWRBHQFX.js.map} +1 -1
- package/dist/esm/{chunk-APIIMJG6.js → chunk-GF76PWEV.js} +450 -1052
- package/dist/esm/chunk-GF76PWEV.js.map +7 -0
- package/dist/esm/{chunk-MUQMBH2S.js → chunk-R3HRHYIW.js} +16 -4
- package/dist/esm/chunk-R3HRHYIW.js.map +7 -0
- package/dist/esm/{chunk-YV3RT5PX.js → chunk-X6JHXPDX.js} +2 -2
- package/dist/esm/{chunk-YV3RT5PX.js.map → chunk-X6JHXPDX.js.map} +0 -0
- package/dist/esm/esm-test-worker.js +2 -2
- package/dist/esm/esm-test-worker.js.map +2 -2
- package/dist/esm/kpuzzle/index.js +2 -2
- package/dist/esm/{node-WEHVBEKP.js → node-HFBX5WHK.js} +2 -2
- package/dist/esm/{node-WEHVBEKP.js.map → node-HFBX5WHK.js.map} +1 -1
- package/dist/esm/{node-BSAQKO3G.js → node-SP4L2AKI.js} +2 -2
- package/dist/esm/{node-BSAQKO3G.js.map → node-SP4L2AKI.js.map} +1 -1
- package/dist/esm/notation/index.js +2 -2
- package/dist/esm/protocol/index.js +2 -2
- package/dist/esm/puzzle-geometry/index.js +14 -10
- package/dist/esm/puzzle-geometry/index.js.map +2 -2
- package/dist/esm/puzzles/index.js +3 -3
- package/dist/esm/scramble/index.js +4 -4
- package/dist/esm/search/index.js +4 -4
- package/dist/esm/stream/index.js +1 -1
- package/dist/esm/twisty/index.js +729 -2346
- package/dist/esm/twisty/index.js.map +3 -3
- package/dist/esm/worker-inside-generated-string-RQYYANYQ.js +3107 -0
- package/dist/esm/worker-inside-generated-string-RQYYANYQ.js.map +7 -0
- package/dist/types/alg/index.d.ts +1 -0
- package/dist/types/alg/index.d.ts.map +1 -1
- package/dist/types/alg/units/leaves/Move.d.ts +1 -1
- package/dist/types/alg/units/leaves/Move.d.ts.map +1 -1
- package/dist/types/bluetooth/smart-puzzle/gan.d.ts.map +1 -1
- package/dist/types/cubing.bundle-global.d.ts +1 -24
- package/dist/types/cubing.bundle-global.d.ts.map +1 -1
- package/dist/types/cubing.bundle-global.exports.d.ts +25 -0
- package/dist/types/cubing.bundle-global.exports.d.ts.map +1 -0
- package/dist/types/puzzle-geometry/PGPuzzles.spec.d.ts +3 -0
- package/dist/types/puzzle-geometry/PGPuzzles.spec.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts +7 -3
- package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/index.d.ts +1 -1
- package/dist/types/puzzle-geometry/index.d.ts.map +1 -1
- package/dist/types/puzzles/index.d.ts +1 -1
- package/dist/types/puzzles/index.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/cube-stickerings.d.ts.map +1 -1
- package/dist/types/search/inside/api.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/4x4x4.d.ts +1 -1
- package/dist/types/search/inside/solve/puzzles/4x4x4.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/fto.d.ts +6 -0
- package/dist/types/search/inside/solve/puzzles/fto.d.ts.map +1 -0
- package/dist/types/search/inside/solve/puzzles/fto.sgs.json.d.ts +5 -0
- package/dist/types/search/inside/solve/puzzles/fto.sgs.json.d.ts.map +1 -0
- package/dist/types/search/inside/solve/tremble.d.ts.map +1 -1
- package/dist/types/search/worker-inside-generated-string.d.ts +1 -1
- package/dist/types/search/worker-inside-generated-string.d.ts.map +1 -1
- package/dist/types/twisty/{old/animation/cursor/CursorTypes.d.ts → controllers/AnimationTypes.d.ts} +10 -3
- package/dist/types/twisty/controllers/AnimationTypes.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/RenderScheduler.d.ts +0 -0
- package/dist/types/twisty/controllers/RenderScheduler.d.ts.map +1 -0
- package/dist/types/twisty/controllers/TwistyAnimationController.d.ts +1 -1
- package/dist/types/twisty/controllers/TwistyAnimationController.d.ts.map +1 -1
- package/dist/types/twisty/{old/animation → controllers}/easing.d.ts +0 -0
- package/dist/types/twisty/controllers/easing.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/AlgDuration.d.ts +2 -2
- package/dist/types/twisty/controllers/indexer/AlgDuration.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/AlgIndexer.d.ts +3 -3
- package/dist/types/twisty/controllers/indexer/AlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/SimpleAlgIndexer.d.ts +3 -3
- package/dist/types/twisty/controllers/indexer/SimpleAlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts +3 -3
- package/dist/types/twisty/controllers/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts +3 -3
- package/dist/types/twisty/controllers/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/simultaneous-moves/simul-moves.d.ts +2 -2
- package/dist/types/twisty/controllers/indexer/simultaneous-moves/simul-moves.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/tree/AlgWalker.d.ts +2 -2
- package/dist/types/twisty/controllers/indexer/tree/AlgWalker.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/tree/TreeAlgIndexer.d.ts +3 -3
- package/dist/types/twisty/controllers/indexer/tree/TreeAlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/controllers/indexer/tree/chunkAlgs.d.ts +3 -0
- package/dist/types/twisty/controllers/indexer/tree/chunkAlgs.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/stream/timeline-move-calculation-draft.d.ts +2 -2
- package/dist/types/twisty/controllers/stream/timeline-move-calculation-draft.d.ts.map +1 -0
- package/dist/types/twisty/heavy-code-imports/dynamic-entries/3d.d.ts +1 -2
- package/dist/types/twisty/heavy-code-imports/dynamic-entries/3d.d.ts.map +1 -1
- package/dist/types/twisty/index.d.ts +9 -12
- package/dist/types/twisty/index.d.ts.map +1 -1
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts +11 -0
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts.map +1 -1
- package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts +1 -1
- package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/display/FoundationDisplayProp.d.ts +6 -0
- package/dist/types/twisty/model/props/puzzle/display/FoundationDisplayProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts +5 -1
- package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts +46 -1
- package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts +2 -2
- package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentTransformationProp.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentTransformationProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorProp.d.ts +5 -2
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/IndexerProp.d.ts +2 -2
- package/dist/types/twisty/model/props/puzzle/state/IndexerProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/LegacyPositionProp.d.ts +2 -2
- package/dist/types/twisty/model/props/puzzle/state/LegacyPositionProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/MovePressInputProp.d.ts +11 -0
- package/dist/types/twisty/model/props/puzzle/state/MovePressInputProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/NaiveMoveCountProp.d.ts +10 -0
- package/dist/types/twisty/model/props/puzzle/state/NaiveMoveCountProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/SetupAnchorProp.d.ts +5 -1
- package/dist/types/twisty/model/props/puzzle/state/SetupAnchorProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDProp.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.d.ts +19 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleLoaderProp.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleLoaderProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts +2 -3
- package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts +1 -1
- package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts +1 -1
- package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts +6 -1
- package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts +5 -1
- package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts +5 -1
- package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts +18 -5
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts +6 -6
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts +2 -2
- package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts +5 -1
- package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts +7 -1
- package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts +1 -1
- package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts.map +1 -1
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.css.d.ts +3 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.css.d.ts.map +1 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.d.ts +4 -6
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.d.ts.map +1 -1
- package/dist/types/twisty/views/2D/Twisty2DPuzzleWrapper.d.ts +1 -1
- package/dist/types/twisty/views/2D/Twisty2DPuzzleWrapper.d.ts.map +1 -1
- package/dist/types/twisty/views/2D/Twisty2DSceneWrapper.d.ts +2 -2
- package/dist/types/twisty/views/2D/Twisty2DSceneWrapper.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/DragTracker.d.ts +28 -0
- package/dist/types/twisty/views/3D/DragTracker.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/RendererPool.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts +6 -1
- package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts +9 -4
- package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/Twisty3DVantage.css.d.ts +3 -0
- package/dist/types/twisty/views/3D/Twisty3DVantage.css.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts +12 -8
- package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/TwistyOrbitControls.d.ts +24 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControls.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControls.spec.d.ts +5 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControls.spec.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/puzzles/Cube3D.d.ts +4 -4
- package/dist/types/twisty/views/3D/puzzles/Cube3D.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/puzzles/PG3D.d.ts +17 -10
- package/dist/types/twisty/views/3D/puzzles/PG3D.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/puzzles/Twisty3DPuzzle.d.ts +1 -1
- package/dist/types/twisty/views/3D/puzzles/Twisty3DPuzzle.d.ts.map +1 -1
- package/dist/types/twisty/{old/dom/element → views}/ClassListManager.d.ts +0 -0
- package/dist/types/twisty/views/ClassListManager.d.ts.map +1 -0
- package/dist/types/twisty/{old/dom/element → views}/ManagedCustomElement.d.ts +0 -0
- package/dist/types/twisty/views/ManagedCustomElement.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/LeafTokens.d.ts +1 -1
- package/dist/types/twisty/views/TwistyAlgEditor/LeafTokens.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.d.ts +1 -1
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts +2 -1
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyAlgViewer.css.d.ts +1 -1
- package/dist/types/twisty/views/TwistyAlgViewer.css.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyAlgViewer.d.ts +2 -2
- package/dist/types/twisty/views/TwistyAlgViewer.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyPlayer.css.d.ts +3 -0
- package/dist/types/twisty/views/TwistyPlayer.css.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyPlayer.d.ts +7 -3
- package/dist/types/twisty/views/TwistyPlayer.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts +7 -4
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyViewerWrapper.css.d.ts +3 -0
- package/dist/types/twisty/views/TwistyViewerWrapper.css.d.ts.map +1 -0
- package/dist/types/twisty/{old/dom/viewers → views}/canvas.d.ts +0 -0
- package/dist/types/twisty/views/canvas.d.ts.map +1 -0
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.css.d.ts +4 -0
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.css.d.ts.map +1 -0
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.d.ts +1 -1
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.d.ts.map +1 -1
- package/dist/types/twisty/views/control-panel/TwistyScrubber.css.d.ts +3 -0
- package/dist/types/twisty/{old/dom/controls → views/control-panel}/TwistyScrubber.css.d.ts.map +1 -1
- package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts +1 -1
- package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts.map +1 -1
- package/dist/types/twisty/{old/dom/element → views}/node-custom-element-shims.d.ts +0 -0
- package/dist/types/twisty/views/node-custom-element-shims.d.ts.map +1 -0
- package/dist/types/twisty/views/stream/TwistyStreamSource.css.d.ts +3 -0
- package/dist/types/twisty/views/stream/TwistyStreamSource.css.d.ts.map +1 -0
- package/dist/types/twisty/{old/dom → views}/stream/TwistyStreamSource.d.ts +1 -1
- package/dist/types/twisty/views/stream/TwistyStreamSource.d.ts.map +1 -0
- package/dist/types/{search/vendor → vendor}/comlink-everywhere/inside/index.d.ts +0 -0
- package/dist/types/vendor/comlink-everywhere/inside/index.d.ts.map +1 -0
- package/dist/types/{search/vendor → vendor}/comlink-everywhere/inside/node.d.ts +0 -0
- package/dist/types/vendor/comlink-everywhere/inside/node.d.ts.map +1 -0
- package/dist/types/{search/vendor → vendor}/comlink-everywhere/outside/index.d.ts +0 -0
- package/dist/types/vendor/comlink-everywhere/outside/index.d.ts.map +1 -0
- package/dist/types/{search/vendor → vendor}/comlink-everywhere/outside/node.d.ts +0 -0
- package/dist/types/vendor/comlink-everywhere/outside/node.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/cstimer/src/js/lib/mathlib.d.ts +0 -0
- package/dist/types/vendor/cstimer/src/js/lib/mathlib.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/cstimer/src/js/scramble/scramble_444.d.ts +1 -1
- package/dist/types/vendor/cstimer/src/js/scramble/scramble_444.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/min2phase/gwt.d.ts +0 -0
- package/dist/types/vendor/min2phase/gwt.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/random-uint-below/get-random-values.d.ts +0 -0
- package/dist/types/vendor/random-uint-below/get-random-values.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/random-uint-below/index.d.ts +1 -1
- package/dist/types/vendor/random-uint-below/index.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/random-uint-below/random-choice.d.ts +0 -0
- package/dist/types/vendor/random-uint-below/random-choice.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor/random-uint-below/random-int.d.ts → vendor/random-uint-below/random53BitValue.d.ts} +1 -1
- package/dist/types/vendor/random-uint-below/random53BitValue.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/sq12phase/scramble_sq1.d.ts +0 -0
- package/dist/types/vendor/sq12phase/scramble_sq1.d.ts.map +1 -0
- package/dist/types/{bluetooth/smart-puzzle → vendor/unsafe-raw-aes}/unsafe-raw-aes.d.ts +0 -0
- package/dist/types/vendor/unsafe-raw-aes/unsafe-raw-aes.d.ts.map +1 -0
- package/docs/.DS_Store +0 -0
- package/docs/cubing/.DS_Store +0 -0
- package/docs/cubing/api/index.html +11 -52
- package/docs/cubing/index.html +67 -27
- package/docs/main.css +7 -6
- package/package.json +8 -9
- package/src/cubing/.DS_Store +0 -0
- package/src/cubing/alg/index.ts +1 -0
- package/src/cubing/alg/units/leaves/Move.ts +1 -1
- package/src/cubing/bluetooth/smart-puzzle/gan.ts +4 -1
- package/src/cubing/bluetooth/smart-timer/GanTimer.ts +1 -1
- package/src/cubing/cubing.bundle-global.exports.ts +25 -0
- package/src/cubing/cubing.bundle-global.ts +3 -27
- package/src/cubing/puzzle-geometry/PGPuzzles.spec.ts +4 -0
- package/src/cubing/puzzle-geometry/PuzzleGeometry.ts +20 -8
- package/src/cubing/puzzle-geometry/index.ts +2 -2
- package/src/cubing/puzzles/.DS_Store +0 -0
- package/src/cubing/puzzles/implementations/.DS_Store +0 -0
- package/src/cubing/puzzles/index.ts +1 -1
- package/src/cubing/puzzles/stickerings/cube-stickerings.ts +18 -0
- package/src/cubing/puzzles/stickerings/global-custom-stickering-hack.ts +1 -1
- package/src/cubing/search/.DS_Store +0 -0
- package/src/cubing/search/esm-test-worker.js +1 -1
- package/src/cubing/search/inside/.DS_Store +0 -0
- package/src/cubing/search/inside/api.ts +3 -0
- package/src/cubing/search/inside/entry.js +1 -1
- package/src/cubing/search/inside/inside-worker.ts +1 -1
- package/src/cubing/search/inside/solve/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/addOrientationSuffix.ts +1 -1
- package/src/cubing/{alg → search/inside/solve/puzzles}/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/puzzles/2x2x2.ts +1 -1
- package/src/cubing/search/inside/solve/puzzles/3x3x3/index.ts +2 -2
- package/src/cubing/search/inside/solve/puzzles/4x4x4.ts +2 -2
- package/src/cubing/search/inside/solve/puzzles/big-cubes.ts +1 -1
- package/src/cubing/search/inside/solve/puzzles/clock.ts +1 -1
- package/src/cubing/search/inside/solve/puzzles/{FTO.sgs → fto.sgs.json.ts} +116 -80
- package/src/cubing/search/inside/solve/puzzles/fto.ts +58 -0
- package/src/cubing/search/inside/solve/puzzles/sq1.ts +1 -1
- package/src/cubing/search/inside/solve/puzzles/wca-minx.ts +1 -1
- package/src/cubing/search/inside/solve/tremble.ts +2 -1
- package/src/cubing/search/inside/solve/vendor/.DS_Store +0 -0
- package/src/cubing/search/instantiator.ts +1 -1
- package/src/cubing/search/worker-inside-generated-string.js +1 -1
- package/src/cubing/twisty/.DS_Store +0 -0
- package/src/cubing/{alg/units → twisty/controllers}/.DS_Store +0 -0
- package/src/cubing/twisty/{old/animation/cursor/CursorTypes.ts → controllers/AnimationTypes.ts} +11 -2
- package/src/cubing/twisty/{old/animation → controllers}/RenderScheduler.ts +0 -0
- package/src/cubing/twisty/controllers/TwistyAnimationController.ts +4 -4
- package/src/cubing/twisty/controllers/animation/.DS_Store +0 -0
- package/src/cubing/twisty/{old/animation → controllers}/easing.ts +0 -0
- package/src/cubing/{stream → twisty/controllers/indexer}/.DS_Store +0 -0
- package/src/cubing/twisty/{old/animation → controllers}/indexer/AlgDuration.ts +2 -2
- package/src/cubing/twisty/{old/animation → controllers}/indexer/AlgIndexer.ts +4 -4
- package/src/cubing/twisty/{old/animation → controllers}/indexer/SimpleAlgIndexer.ts +4 -4
- package/src/cubing/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexer.ts +3 -3
- package/src/cubing/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.ts +3 -3
- package/src/cubing/twisty/{old/animation → controllers}/indexer/simultaneous-moves/simul-moves.ts +2 -2
- package/src/cubing/twisty/{old/animation → controllers}/indexer/tree/AlgWalker.ts +4 -4
- package/src/cubing/twisty/{old/animation → controllers}/indexer/tree/TreeAlgIndexer.ts +3 -3
- package/src/cubing/twisty/{old/animation → controllers}/indexer/tree/chunkAlgs.ts +2 -2
- package/src/cubing/twisty/{old/animation → controllers}/stream/timeline-move-calculation-draft.spec.ts.TODO +0 -0
- package/src/cubing/twisty/{old/animation → controllers}/stream/timeline-move-calculation-draft.ts +2 -2
- package/src/cubing/twisty/heavy-code-imports/.DS_Store +0 -0
- package/src/cubing/twisty/heavy-code-imports/dynamic-entries/3d.ts +2 -12
- package/src/cubing/twisty/index.ts +12 -19
- package/src/cubing/twisty/model/.DS_Store +0 -0
- package/src/cubing/twisty/model/TwistyPlayerModel.ts +38 -7
- package/src/cubing/twisty/model/props/.DS_Store +0 -0
- package/src/cubing/twisty/model/props/TwistyPropDebugger.ts +3 -3
- package/src/cubing/twisty/model/props/puzzle/.DS_Store +0 -0
- package/src/cubing/twisty/model/props/puzzle/display/FoundationDisplayProp.ts +9 -0
- package/src/cubing/twisty/model/props/puzzle/display/HintFaceletProp.ts +6 -1
- package/src/cubing/twisty/model/props/puzzle/display/StickeringProp.ts +49 -1
- package/src/cubing/twisty/model/props/puzzle/state/AlgTransformationProp.ts +1 -1
- package/src/cubing/twisty/model/props/puzzle/state/AnchoredStartProp.ts +2 -2
- package/src/cubing/twisty/model/props/puzzle/state/CurrentLeavesProp.ts +2 -2
- package/src/cubing/twisty/model/props/puzzle/state/CurrentLeavesSimplified.ts +1 -1
- package/src/cubing/twisty/model/props/puzzle/state/CurrentTransformationProp.ts +1 -1
- package/src/cubing/twisty/model/props/puzzle/state/IndexerConstructorProp.ts +12 -5
- package/src/cubing/twisty/model/props/puzzle/state/IndexerProp.ts +2 -2
- package/src/cubing/twisty/model/props/puzzle/state/LegacyPositionProp.ts +2 -2
- package/src/cubing/twisty/model/props/puzzle/state/MovePressInputProp.ts +14 -0
- package/src/cubing/twisty/model/props/puzzle/state/NaiveMoveCountProp.ts +20 -0
- package/src/cubing/twisty/model/props/puzzle/state/SetupAnchorProp.ts +7 -1
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleIDProp.ts +1 -1
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.ts +20 -1
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleLoaderProp.ts +1 -1
- package/src/cubing/twisty/model/props/timeline/DetailedTimelineInfoProp.ts +5 -3
- package/src/cubing/twisty/model/props/timeline/PlayingInfoProp.ts +1 -4
- package/src/cubing/twisty/model/props/timeline/TimestampRequestProp.ts +1 -1
- package/src/cubing/twisty/model/props/viewer/BackViewProp.ts +7 -1
- package/src/cubing/twisty/model/props/viewer/BackgroundProp.ts +6 -1
- package/src/cubing/twisty/model/props/viewer/ControlPanelProp.ts +5 -1
- package/src/cubing/twisty/model/props/viewer/OrbitCoordinatesProp.ts +83 -12
- package/src/cubing/twisty/model/props/viewer/OrbitCoordinatesRequestProp.ts +8 -8
- package/src/cubing/twisty/model/props/viewer/TimeRangeProp.ts +2 -2
- package/src/cubing/twisty/model/props/viewer/ViewerLinkProp.ts +5 -1
- package/src/cubing/twisty/model/props/viewer/VisualizationProp.ts +8 -1
- package/src/cubing/twisty/model/props/viewer/VisualizationStrategyProp.ts +1 -1
- package/src/cubing/twisty/old/.DS_Store +0 -0
- package/src/cubing/twisty/old/animation/.DS_Store +0 -0
- package/src/cubing/twisty/old/dom/.DS_Store +0 -0
- package/src/cubing/twisty/views/.DS_Store +0 -0
- package/src/cubing/twisty/{old/dom/viewers/Twisty2DSVGView.css.ts → views/2D/Twisty2DPuzzle.css.ts} +1 -1
- package/src/cubing/twisty/views/2D/Twisty2DPuzzle.ts +8 -12
- package/src/cubing/twisty/views/2D/Twisty2DPuzzleWrapper.ts +1 -1
- package/src/cubing/twisty/views/2D/Twisty2DSceneWrapper.ts +4 -4
- package/src/cubing/{bluetooth → twisty/views/3D}/.DS_Store +0 -0
- package/src/cubing/twisty/views/3D/DragTracker.ts +184 -0
- package/src/cubing/twisty/views/3D/RendererPool.ts +2 -1
- package/src/cubing/twisty/views/3D/Twisty3DPuzzleWrapper.ts +51 -5
- package/src/cubing/twisty/views/3D/Twisty3DSceneWrapper.ts +51 -10
- package/src/cubing/twisty/{old/dom/viewers/Twisty3DCanvas.css.ts → views/3D/Twisty3DVantage.css.ts} +2 -2
- package/src/cubing/twisty/views/3D/Twisty3DVantage.ts +103 -35
- package/src/cubing/twisty/views/3D/TwistyOrbitControls.spec.ts +213 -0
- package/src/cubing/twisty/views/3D/TwistyOrbitControls.ts +176 -0
- package/src/cubing/twisty/views/3D/puzzles/Cube3D.ts +5 -9
- package/src/cubing/twisty/views/3D/puzzles/PG3D.ts +127 -37
- package/src/cubing/twisty/views/3D/puzzles/Twisty3DPuzzle.ts +1 -1
- package/src/cubing/twisty/{old/dom/element → views}/ClassListManager.ts +0 -0
- package/src/cubing/twisty/{old/dom/element → views}/ManagedCustomElement.ts +0 -0
- package/src/cubing/twisty/views/TwistyAlgEditor/LeafTokens.ts +1 -1
- package/src/cubing/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.ts +1 -1
- package/src/cubing/twisty/views/TwistyAlgEditor/TwistyAlgEditor.ts +11 -4
- package/src/cubing/twisty/views/TwistyAlgViewer.css.ts +1 -1
- package/src/cubing/twisty/views/TwistyAlgViewer.ts +4 -4
- package/src/cubing/twisty/{old/dom → views}/TwistyPlayer.css.ts +4 -1
- package/src/cubing/twisty/views/TwistyPlayer.ts +16 -25
- package/src/cubing/twisty/views/TwistyPlayerSettable.ts +14 -10
- package/src/cubing/twisty/{old/dom/viewers → views}/TwistyViewerWrapper.css.ts +1 -1
- package/src/cubing/twisty/{old/dom/viewers → views}/canvas.ts +0 -0
- package/src/cubing/twisty/{old/dom/controls/buttons.css.ts → views/control-panel/TwistyButtonsV2.css.ts} +1 -1
- package/src/cubing/twisty/views/control-panel/TwistyButtonsV2.ts +5 -8
- package/src/cubing/twisty/{old/dom/controls → views/control-panel}/TwistyScrubber.css.ts +1 -1
- package/src/cubing/twisty/views/control-panel/TwistyScrubberV2.ts +3 -3
- package/src/cubing/twisty/{old/dom/element → views}/node-custom-element-shims.ts +2 -2
- package/src/cubing/twisty/{old/dom → views}/stream/TwistyStreamSource.css.ts +1 -1
- package/src/cubing/twisty/{old/dom → views}/stream/TwistyStreamSource.ts +9 -9
- package/src/cubing/vendor/.DS_Store +0 -0
- package/src/cubing/{twisty/old/animation/indexer → vendor/comlink-everywhere}/.DS_Store +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/comlink-everywhere.webloc +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/inside/index.d.ts +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/inside/index.js +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/inside/node.js +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/outside/index.d.ts +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/outside/index.js +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/outside/node.js +0 -0
- package/src/cubing/vendor/cstimer/.DS_Store +0 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/cstimer/LICENSE +0 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/cstimer/src/js/lib/mathlib.ts +0 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/cstimer/src/js/scramble/scramble_444.ts +3 -3
- package/src/cubing/{search/inside/solve/vendor → vendor}/min2phase/gwt.d.ts +0 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/min2phase/gwt.js +0 -0
- package/src/cubing/vendor/random-uint-below/get-random-values.ts +23 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/random-uint-below/index.ts +2 -2
- package/src/cubing/{search/inside/solve/vendor → vendor}/random-uint-below/random-choice.ts +1 -1
- package/src/cubing/{search/inside/solve/vendor/random-uint-below/random-int.ts → vendor/random-uint-below/random53BitValue.ts} +0 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/sq12phase/scramble_sq1.js +0 -0
- package/src/cubing/{bluetooth/smart-puzzle → vendor/unsafe-raw-aes}/unsafe-raw-aes.ts +18 -20
- package/dist/esm/3d-B25DP5PE.js +0 -39
- package/dist/esm/3d-B25DP5PE.js.map +0 -7
- package/dist/esm/chunk-APIIMJG6.js.map +0 -7
- package/dist/esm/chunk-CSVAFZSB.js.map +0 -7
- package/dist/esm/chunk-MUQMBH2S.js.map +0 -7
- package/dist/esm/worker-inside-generated-string-KDZOUGJF.js +0 -2831
- package/dist/esm/worker-inside-generated-string-KDZOUGJF.js.map +0 -7
- package/dist/types/bluetooth/smart-puzzle/unsafe-raw-aes.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/lib/mathlib.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/scramble/scramble_444.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/min2phase/gwt.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/random-uint-below/get-random-values.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/random-uint-below/index.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/random-uint-below/random-choice.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/random-uint-below/random-int.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/sq12phase/scramble_sq1.d.ts.map +0 -1
- package/dist/types/search/vendor/comlink-everywhere/inside/index.d.ts.map +0 -1
- package/dist/types/search/vendor/comlink-everywhere/inside/node.d.ts.map +0 -1
- package/dist/types/search/vendor/comlink-everywhere/outside/index.d.ts.map +0 -1
- package/dist/types/search/vendor/comlink-everywhere/outside/node.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/RenderScheduler.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/Timeline.d.ts +0 -72
- package/dist/types/twisty/old/animation/Timeline.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/cursor/AlgCursor.d.ts +0 -53
- package/dist/types/twisty/old/animation/cursor/AlgCursor.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/cursor/CursorTypes.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/easing.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/AlgDuration.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/AlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/SimpleAlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/simul-moves.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/tree/AlgWalker.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/tree/TreeAlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/tree/chunkAlgs.d.ts +0 -3
- package/dist/types/twisty/old/animation/indexer/tree/chunkAlgs.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/stream/timeline-move-calculation-draft.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.d.ts +0 -52
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyPlayer.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/TwistyPlayer.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyPlayer.d.ts +0 -92
- package/dist/types/twisty/old/dom/TwistyPlayer.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyPlayer.spec.d.ts +0 -5
- package/dist/types/twisty/old/dom/TwistyPlayer.spec.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyPlayerConfig.d.ts +0 -165
- package/dist/types/twisty/old/dom/TwistyPlayerConfig.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/controls/TwistyControlElement.d.ts +0 -2
- package/dist/types/twisty/old/dom/controls/TwistyControlElement.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/controls/TwistyScrubber.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/controls/TwistyScrubber.d.ts +0 -14
- package/dist/types/twisty/old/dom/controls/TwistyScrubber.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/controls/buttons.css.d.ts +0 -4
- package/dist/types/twisty/old/dom/controls/buttons.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/controls/buttons.d.ts +0 -40
- package/dist/types/twisty/old/dom/controls/buttons.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/controls/buttons.spec.d.ts +0 -5
- package/dist/types/twisty/old/dom/controls/buttons.spec.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/element/ClassListManager.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/element/ElementConfig.d.ts +0 -49
- package/dist/types/twisty/old/dom/element/ElementConfig.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/element/ManagedCustomElement.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/element/node-custom-element-shims.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/stream/TwistyStreamSource.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/stream/TwistyStreamSource.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/stream/TwistyStreamSource.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVG.d.ts +0 -26
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVG.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVGView.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVGView.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.d.ts +0 -41
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/TwistyOrbitControls.d.ts +0 -59
- package/dist/types/twisty/old/dom/viewers/TwistyOrbitControls.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/TwistyViewerElement.d.ts +0 -4
- package/dist/types/twisty/old/dom/viewers/TwistyViewerElement.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.d.ts +0 -18
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/canvas.d.ts.map +0 -1
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts +0 -41
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts.map +0 -1
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.spec.d.ts +0 -5
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.spec.d.ts.map +0 -1
- package/dist/types/twisty/views/3D/puzzles/TwistyTestBox.d.ts +0 -9
- package/dist/types/twisty/views/3D/puzzles/TwistyTestBox.d.ts.map +0 -1
- package/src/cubing/search/inside/solve/vendor/random-uint-below/get-random-values.ts +0 -38
- package/src/cubing/twisty/old/animation/Timeline.ts +0 -378
- package/src/cubing/twisty/old/animation/cursor/AlgCursor.ts +0 -252
- package/src/cubing/twisty/old/dom/TwistyAlgViewerV1.css.ts +0 -25
- package/src/cubing/twisty/old/dom/TwistyAlgViewerV1.ts +0 -516
- package/src/cubing/twisty/old/dom/TwistyPlayer.spec.ts +0 -25
- package/src/cubing/twisty/old/dom/TwistyPlayer.ts +0 -927
- package/src/cubing/twisty/old/dom/TwistyPlayerConfig.ts +0 -378
- package/src/cubing/twisty/old/dom/controls/TwistyControlElement.ts +0 -1
- package/src/cubing/twisty/old/dom/controls/TwistyScrubber.ts +0 -53
- package/src/cubing/twisty/old/dom/controls/buttons.spec.ts +0 -37
- package/src/cubing/twisty/old/dom/controls/buttons.ts +0 -326
- package/src/cubing/twisty/old/dom/element/ElementConfig.ts +0 -180
- package/src/cubing/twisty/old/dom/viewers/Twisty2DSVG.ts +0 -118
- package/src/cubing/twisty/old/dom/viewers/Twisty3DCanvas.ts +0 -256
- package/src/cubing/twisty/old/dom/viewers/TwistyOrbitControls.ts +0 -420
- package/src/cubing/twisty/old/dom/viewers/TwistyViewerElement.ts +0 -5
- package/src/cubing/twisty/old/dom/viewers/TwistyViewerWrapper.ts +0 -45
- package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.spec.ts +0 -209
- package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.ts +0 -270
- package/src/cubing/twisty/views/3D/puzzles/TwistyTestBox.ts +0 -22
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
import { RenderScheduler } from "./RenderScheduler";
|
|
2
|
-
import type { AlgCursor, TimeRange } from "./cursor/AlgCursor";
|
|
3
|
-
import {
|
|
4
|
-
BoundaryType,
|
|
5
|
-
Direction,
|
|
6
|
-
directionScalar,
|
|
7
|
-
MillisecondTimestamp,
|
|
8
|
-
} from "./cursor/CursorTypes";
|
|
9
|
-
|
|
10
|
-
// YouTube keeps playing on jump, but it also stays frozen while the cursor is
|
|
11
|
-
// down. So I think it would be good for this to be false, but only if we
|
|
12
|
-
// implement a "start jumping" event that pauses until "finish jumping" while
|
|
13
|
-
// the scrubber is active.
|
|
14
|
-
const PAUSE_ON_JUMP = true;
|
|
15
|
-
|
|
16
|
-
// TODO: We use symbols to avoid exposing `number` values. Is this performant enough? Should/can we use symbols?
|
|
17
|
-
export enum TimelineAction {
|
|
18
|
-
StartingToPlay = "StartingToPlay", // TODO playing backwards.
|
|
19
|
-
Pausing = "Pausing",
|
|
20
|
-
Jumping = "Jumping",
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// TODO: We use symbols to avoid exposing `number` values. Is this performant enough? Should/can we use symbols?
|
|
24
|
-
export enum TimestampLocationType {
|
|
25
|
-
StartOfTimeline = "Start",
|
|
26
|
-
EndOfTimeline = "End",
|
|
27
|
-
StartOfMove = "StartOfMove",
|
|
28
|
-
EndOfMove = "EndOfMove",
|
|
29
|
-
MiddleOfMove = "MiddleOfMove",
|
|
30
|
-
BetweenMoves = "BetweenMoves",
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface TimelineActionEvent {
|
|
34
|
-
action: TimelineAction;
|
|
35
|
-
locationType: TimestampLocationType;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// This should be used by classes that (directly or indirectly) update puzzle
|
|
39
|
-
// state based on a timestamp. It fires every time the timestamp is changed for
|
|
40
|
-
// a new render (e.g. 60 times a second during animation), and only fires if the
|
|
41
|
-
// timestamp has changed since the last call. This means you can use it as a
|
|
42
|
-
// reliable callback telling you when to schedule a new render.
|
|
43
|
-
export interface TimelineTimestampListener {
|
|
44
|
-
onTimelineTimestampChange(timestamp: MillisecondTimestamp): void;
|
|
45
|
-
onTimeRangeChange(timeRange: TimeRange): void;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// This should be used by classes that (directly or indirectly) update UI (e.g.
|
|
49
|
-
// pause/play buttons).
|
|
50
|
-
//
|
|
51
|
-
// Note: the action events of a `Timeline` are not necessarily coordinated with
|
|
52
|
-
// the timestamp events, since timestamp events are tied to animation frames.
|
|
53
|
-
// For example, if you receive a "pausing" event, the final frame may already
|
|
54
|
-
// have been drawn, or may be drawn in the near future.
|
|
55
|
-
export interface TimelineActionListener {
|
|
56
|
-
onTimelineAction(actionEvent: TimelineActionEvent): void;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface TimelineTimestampDispatcher {
|
|
60
|
-
addTimestampListener(timestampListener: TimelineTimestampListener): void;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface TimelineActionDispatcher {
|
|
64
|
-
addActionListener(actionListener: TimelineActionListener): void;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// `performance.now()` is rounded for security concerns, so it's usually not
|
|
68
|
-
// accurate to the millisecond. So we round it, which lets us work with whole ms
|
|
69
|
-
// everywhere.
|
|
70
|
-
function getNow(): MillisecondTimestamp {
|
|
71
|
-
return Math.round(performance.now());
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export class Timeline
|
|
75
|
-
implements TimelineTimestampDispatcher, TimelineActionDispatcher
|
|
76
|
-
{
|
|
77
|
-
animating: boolean = false;
|
|
78
|
-
tempoScale: number = 1;
|
|
79
|
-
private cursors: Set<AlgCursor> = new Set();
|
|
80
|
-
private timestampListeners: Set<TimelineTimestampListener> = new Set();
|
|
81
|
-
private actionListeners: Set<TimelineActionListener> = new Set();
|
|
82
|
-
timestamp: number = 0;
|
|
83
|
-
lastAnimFrameNow: DOMHighResTimeStamp = 0;
|
|
84
|
-
lastAnimFrameTimestamp: MillisecondTimestamp;
|
|
85
|
-
private scheduler: RenderScheduler;
|
|
86
|
-
|
|
87
|
-
direction: Direction.Backwards | Direction.Forwards = Direction.Forwards; // TODO: handle pausing here?
|
|
88
|
-
|
|
89
|
-
boundaryType: BoundaryType = BoundaryType.EntireTimeline;
|
|
90
|
-
cachedNextBoundary: MillisecondTimestamp;
|
|
91
|
-
|
|
92
|
-
constructor() {
|
|
93
|
-
const animFrame = (_now: MillisecondTimestamp): void => {
|
|
94
|
-
if (this.animating) {
|
|
95
|
-
const now = getNow(); // TODO: See if we can use the rAF value without monotonicity issues.;
|
|
96
|
-
this.timestamp =
|
|
97
|
-
this.timestamp +
|
|
98
|
-
this.tempoScale *
|
|
99
|
-
directionScalar(this.direction) *
|
|
100
|
-
(now - this.lastAnimFrameNow);
|
|
101
|
-
this.lastAnimFrameNow = now;
|
|
102
|
-
|
|
103
|
-
const atOrPastBoundary =
|
|
104
|
-
this.direction === Direction.Backwards
|
|
105
|
-
? this.timestamp <= this.cachedNextBoundary
|
|
106
|
-
: this.timestamp >= this.cachedNextBoundary;
|
|
107
|
-
if (atOrPastBoundary) {
|
|
108
|
-
this.timestamp = this.cachedNextBoundary;
|
|
109
|
-
if (this.animating) {
|
|
110
|
-
this.animating = false;
|
|
111
|
-
this.dispatchAction(TimelineAction.Pausing);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (this.timestamp !== this.lastAnimFrameTimestamp) {
|
|
117
|
-
this.dispatchTimestamp();
|
|
118
|
-
this.lastAnimFrameTimestamp = this.timestamp;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (this.animating) {
|
|
122
|
-
this.scheduler.requestAnimFrame();
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
this.scheduler = new RenderScheduler(animFrame);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
public addCursor(cursor: AlgCursor): void {
|
|
129
|
-
this.cursors.add(cursor);
|
|
130
|
-
this.dispatchTimeRange();
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
removeCursor(cursor: AlgCursor): void {
|
|
134
|
-
this.cursors.delete(cursor);
|
|
135
|
-
this.clampTimestampToRange();
|
|
136
|
-
this.dispatchTimeRange();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// TODO: test
|
|
140
|
-
private clampTimestampToRange(): void {
|
|
141
|
-
const timeRange = this.timeRange();
|
|
142
|
-
if (this.timestamp < timeRange.start) {
|
|
143
|
-
this.setTimestamp(timeRange.start);
|
|
144
|
-
}
|
|
145
|
-
if (this.timestamp > timeRange.end) {
|
|
146
|
-
this.setTimestamp(timeRange.end);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// In the future, this might do some calculations or caching.
|
|
151
|
-
public onCursorChange(_cursor: AlgCursor): void {
|
|
152
|
-
if (this.timestamp > this.maxTimestamp()) {
|
|
153
|
-
this.timestamp = this.maxTimestamp();
|
|
154
|
-
}
|
|
155
|
-
this.dispatchTimeRange();
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
timeRange(): TimeRange {
|
|
159
|
-
let start = 0;
|
|
160
|
-
let end = 0;
|
|
161
|
-
for (const cursor of this.cursors) {
|
|
162
|
-
const cursorTimeRange = cursor.timeRange();
|
|
163
|
-
start = Math.min(start, cursorTimeRange.start);
|
|
164
|
-
end = Math.max(end, cursorTimeRange.end);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return { start, end };
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
minTimestamp(): number {
|
|
171
|
-
// TODO: Calculate and cache this value every time there's a new cursor.
|
|
172
|
-
return this.timeRange().start;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
maxTimestamp(): number {
|
|
176
|
-
// TODO: Calculate and cache this value every time there's a new cursor.
|
|
177
|
-
return this.timeRange().end;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
private dispatchTimeRange(): void {
|
|
181
|
-
const timeRange = this.timeRange();
|
|
182
|
-
for (const listener of this.cursors) {
|
|
183
|
-
// TODO: dedup in case the timestamp hasn't changed sine last time.
|
|
184
|
-
listener.onTimeRangeChange(timeRange);
|
|
185
|
-
}
|
|
186
|
-
// TODO: Combine loops without extra memory?
|
|
187
|
-
for (const listener of this.timestampListeners) {
|
|
188
|
-
// TODO: dedup in case the timestamp hasn't changed sine last time.
|
|
189
|
-
listener.onTimeRangeChange(timeRange);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
private dispatchTimestamp(): void {
|
|
194
|
-
for (const listener of this.cursors) {
|
|
195
|
-
// TODO: dedup in case the timestamp hasn't changed sine last time.
|
|
196
|
-
listener.onTimelineTimestampChange(this.timestamp);
|
|
197
|
-
}
|
|
198
|
-
// TODO: Combine loops without extra memory?
|
|
199
|
-
for (const listener of this.timestampListeners) {
|
|
200
|
-
// TODO: dedup in case the timestamp hasn't changed sine last time.
|
|
201
|
-
listener.onTimelineTimestampChange(this.timestamp);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
addTimestampListener(timestampListener: TimelineTimestampListener): void {
|
|
206
|
-
this.timestampListeners.add(timestampListener);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
removeTimestampListener(timestampListener: TimelineTimestampListener): void {
|
|
210
|
-
this.timestampListeners.delete(timestampListener);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
addActionListener(actionListener: TimelineActionListener): void {
|
|
214
|
-
this.actionListeners.add(actionListener);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
removeActionListener(actionListener: TimelineActionListener): void {
|
|
218
|
-
this.actionListeners.delete(actionListener);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
play(): void {
|
|
222
|
-
this.experimentalPlay(Direction.Forwards, BoundaryType.EntireTimeline);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
experimentalPlay(
|
|
226
|
-
direction: Direction.Backwards | Direction.Forwards,
|
|
227
|
-
boundaryType: BoundaryType = BoundaryType.EntireTimeline,
|
|
228
|
-
): void {
|
|
229
|
-
this.direction = direction;
|
|
230
|
-
this.boundaryType = boundaryType;
|
|
231
|
-
const nextBoundary = this.nextBoundary(
|
|
232
|
-
this.timestamp,
|
|
233
|
-
direction,
|
|
234
|
-
this.boundaryType,
|
|
235
|
-
);
|
|
236
|
-
if (nextBoundary === null) {
|
|
237
|
-
return; // Nowhere to end, so we don't animate.
|
|
238
|
-
}
|
|
239
|
-
this.cachedNextBoundary = nextBoundary;
|
|
240
|
-
if (!this.animating) {
|
|
241
|
-
this.animating = true;
|
|
242
|
-
this.lastAnimFrameNow = getNow();
|
|
243
|
-
this.dispatchAction(TimelineAction.StartingToPlay);
|
|
244
|
-
this.scheduler.requestAnimFrame();
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// Non-inclusive
|
|
249
|
-
private nextBoundary(
|
|
250
|
-
timestamp: MillisecondTimestamp,
|
|
251
|
-
direction: Direction.Backwards | Direction.Forwards,
|
|
252
|
-
boundaryType: BoundaryType = BoundaryType.EntireTimeline,
|
|
253
|
-
): MillisecondTimestamp | null {
|
|
254
|
-
switch (boundaryType) {
|
|
255
|
-
case BoundaryType.EntireTimeline: {
|
|
256
|
-
switch (direction) {
|
|
257
|
-
case Direction.Backwards:
|
|
258
|
-
return timestamp <= this.minTimestamp()
|
|
259
|
-
? null
|
|
260
|
-
: this.minTimestamp();
|
|
261
|
-
case Direction.Forwards:
|
|
262
|
-
return timestamp >= this.maxTimestamp()
|
|
263
|
-
? null
|
|
264
|
-
: this.maxTimestamp();
|
|
265
|
-
default:
|
|
266
|
-
throw new Error("invalid direction");
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
case BoundaryType.Move: {
|
|
270
|
-
let result: null | MillisecondTimestamp = null;
|
|
271
|
-
for (const cursor of this.cursors) {
|
|
272
|
-
const boundaryTimestamp = cursor.moveBoundary(timestamp, direction);
|
|
273
|
-
if (boundaryTimestamp !== null) {
|
|
274
|
-
switch (direction) {
|
|
275
|
-
case Direction.Backwards: {
|
|
276
|
-
result = Math.min(
|
|
277
|
-
result ?? boundaryTimestamp,
|
|
278
|
-
boundaryTimestamp,
|
|
279
|
-
);
|
|
280
|
-
break;
|
|
281
|
-
}
|
|
282
|
-
case Direction.Forwards: {
|
|
283
|
-
result = Math.max(
|
|
284
|
-
result ?? boundaryTimestamp,
|
|
285
|
-
boundaryTimestamp,
|
|
286
|
-
);
|
|
287
|
-
break;
|
|
288
|
-
}
|
|
289
|
-
default:
|
|
290
|
-
throw new Error("invalid direction");
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
return result;
|
|
295
|
-
}
|
|
296
|
-
default:
|
|
297
|
-
throw new Error("invalid boundary type");
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// One more render may be dispatched after this.
|
|
302
|
-
pause(): void {
|
|
303
|
-
// TODO: error if already paused?
|
|
304
|
-
if (this.animating) {
|
|
305
|
-
this.animating = false;
|
|
306
|
-
this.dispatchAction(TimelineAction.Pausing);
|
|
307
|
-
this.scheduler.requestAnimFrame();
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
playPause(): void {
|
|
312
|
-
if (this.animating) {
|
|
313
|
-
this.pause();
|
|
314
|
-
} else {
|
|
315
|
-
if (this.timestamp >= this.maxTimestamp()) {
|
|
316
|
-
this.timestamp = 0;
|
|
317
|
-
}
|
|
318
|
-
this.experimentalPlay(Direction.Forwards, BoundaryType.EntireTimeline);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
setTimestamp(timestamp: MillisecondTimestamp): void {
|
|
323
|
-
const oldTimestamp = this.timestamp;
|
|
324
|
-
this.timestamp = timestamp;
|
|
325
|
-
this.lastAnimFrameNow = getNow();
|
|
326
|
-
|
|
327
|
-
if (oldTimestamp !== timestamp) {
|
|
328
|
-
this.dispatchAction(TimelineAction.Jumping);
|
|
329
|
-
this.scheduler.requestAnimFrame();
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
if (PAUSE_ON_JUMP) {
|
|
333
|
-
this.animating = false;
|
|
334
|
-
this.dispatchAction(TimelineAction.Pausing);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
jumpToStart(): void {
|
|
339
|
-
this.setTimestamp(this.minTimestamp());
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
jumpToEnd(): void {
|
|
343
|
-
this.setTimestamp(this.maxTimestamp());
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
/** @deprecated */
|
|
347
|
-
experimentalJumpToLastMove(): void {
|
|
348
|
-
let max: MillisecondTimestamp = 0;
|
|
349
|
-
for (const cursor of this.cursors) {
|
|
350
|
-
max = Math.max(
|
|
351
|
-
max,
|
|
352
|
-
cursor.experimentalTimestampForStartOfLastMove() ?? 0,
|
|
353
|
-
);
|
|
354
|
-
}
|
|
355
|
-
this.setTimestamp(max);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
private dispatchAction(event: TimelineAction): void {
|
|
359
|
-
let locationType = TimestampLocationType.MiddleOfMove; // TODO
|
|
360
|
-
switch (this.timestamp) {
|
|
361
|
-
// TODO
|
|
362
|
-
case this.minTimestamp():
|
|
363
|
-
locationType = TimestampLocationType.StartOfTimeline;
|
|
364
|
-
break;
|
|
365
|
-
case this.maxTimestamp():
|
|
366
|
-
locationType = TimestampLocationType.EndOfTimeline;
|
|
367
|
-
break;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
const actionEvent: TimelineActionEvent = {
|
|
371
|
-
action: event,
|
|
372
|
-
locationType,
|
|
373
|
-
};
|
|
374
|
-
for (const listener of this.actionListeners) {
|
|
375
|
-
listener.onTimelineAction(actionEvent);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-case-declarations */
|
|
2
|
-
// TODO: private vs. public properties/methods.
|
|
3
|
-
// TODO: optional construtor arguments for DOM elements
|
|
4
|
-
// TODO: figure out what can be moved into a worker using OffscreenCanvas https://developers.google.com/web/updates/2018/08/offscreen-canvas
|
|
5
|
-
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-empty-interface */
|
|
7
|
-
|
|
8
|
-
// start of imports
|
|
9
|
-
import { Alg, Move, Pause } from "../../../../alg";
|
|
10
|
-
import {
|
|
11
|
-
KPuzzle,
|
|
12
|
-
KPuzzleDefinition,
|
|
13
|
-
Transformation,
|
|
14
|
-
} from "../../../../kpuzzle";
|
|
15
|
-
import { KPuzzleWrapper } from "../../../views/3D/puzzles/KPuzzleWrapper";
|
|
16
|
-
import type { AlgIndexer } from "../indexer/AlgIndexer";
|
|
17
|
-
import { TreeAlgIndexer } from "../indexer/tree/TreeAlgIndexer";
|
|
18
|
-
import type { Timeline, TimelineTimestampListener } from "../Timeline";
|
|
19
|
-
import {
|
|
20
|
-
Direction,
|
|
21
|
-
directionScalar,
|
|
22
|
-
MillisecondTimestamp,
|
|
23
|
-
PuzzlePosition,
|
|
24
|
-
} from "./CursorTypes";
|
|
25
|
-
// end of imports
|
|
26
|
-
|
|
27
|
-
// Model
|
|
28
|
-
|
|
29
|
-
export interface PositionListener {
|
|
30
|
-
onPositionChange(position: PuzzlePosition): void;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface PositionDispatcher {
|
|
34
|
-
addPositionListener(positionListener: PositionListener): void;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface TimeRange {
|
|
38
|
-
start: MillisecondTimestamp;
|
|
39
|
-
end: MillisecondTimestamp;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export type IndexerConstructor = new (
|
|
43
|
-
puzzle: KPuzzleWrapper,
|
|
44
|
-
alg: Alg,
|
|
45
|
-
) => AlgIndexer<KPuzzleWrapper>;
|
|
46
|
-
|
|
47
|
-
export class AlgCursor
|
|
48
|
-
implements TimelineTimestampListener, PositionDispatcher
|
|
49
|
-
{
|
|
50
|
-
private indexer: AlgIndexer<KPuzzleWrapper>;
|
|
51
|
-
private positionListeners: Set<PositionListener> = new Set(); // TODO: accessor instead of direct access
|
|
52
|
-
private ksolvePuzzle: KPuzzleWrapper;
|
|
53
|
-
private startState: Transformation;
|
|
54
|
-
private indexerConstructor: IndexerConstructor = TreeAlgIndexer;
|
|
55
|
-
constructor(
|
|
56
|
-
private timeline: Timeline,
|
|
57
|
-
private def: KPuzzleDefinition,
|
|
58
|
-
private alg: Alg,
|
|
59
|
-
startStateAlg?: Alg, // TODO: accept actual start state
|
|
60
|
-
indexerConstructor?: IndexerConstructor,
|
|
61
|
-
) {
|
|
62
|
-
this.ksolvePuzzle = new KPuzzleWrapper(def);
|
|
63
|
-
if (indexerConstructor) {
|
|
64
|
-
this.indexerConstructor = indexerConstructor;
|
|
65
|
-
}
|
|
66
|
-
this.instantiateIndexer(alg);
|
|
67
|
-
this.startState = startStateAlg
|
|
68
|
-
? this.algToState(startStateAlg)
|
|
69
|
-
: this.ksolvePuzzle.startState();
|
|
70
|
-
timeline.addTimestampListener(this);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
setStartState(startState: Transformation): void {
|
|
74
|
-
this.startState = startState;
|
|
75
|
-
this.dispatchPositionForTimestamp(this.timeline.timestamp);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** @deprecated */
|
|
79
|
-
public experimentalSetIndexer(indexerConstructor: IndexerConstructor): void {
|
|
80
|
-
this.indexerConstructor = indexerConstructor;
|
|
81
|
-
this.instantiateIndexer(this.alg);
|
|
82
|
-
this.timeline.onCursorChange(this);
|
|
83
|
-
this.dispatchPositionForTimestamp(this.timeline.timestamp);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
private instantiateIndexer(alg: Alg): void {
|
|
87
|
-
this.indexer = new this.indexerConstructor(this.ksolvePuzzle, alg);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** @deprecated */
|
|
91
|
-
algToState(s: Alg): Transformation {
|
|
92
|
-
const kpuzzle = new KPuzzle(this.def);
|
|
93
|
-
kpuzzle.applyAlg(s);
|
|
94
|
-
return this.ksolvePuzzle.combine(this.def.startPieces, kpuzzle.state);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
timeRange(): TimeRange {
|
|
98
|
-
return {
|
|
99
|
-
start: 0,
|
|
100
|
-
end: this.indexer.algDuration(),
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/** @deprecated */
|
|
105
|
-
experimentalTimestampForStartOfLastMove(): MillisecondTimestamp {
|
|
106
|
-
const numMoves = this.indexer.numAnimatedLeaves();
|
|
107
|
-
if (numMoves > 0) {
|
|
108
|
-
return this.indexer.indexToMoveStartTimestamp(numMoves - 1);
|
|
109
|
-
}
|
|
110
|
-
return 0;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
addPositionListener(positionListener: PositionListener): void {
|
|
114
|
-
this.positionListeners.add(positionListener);
|
|
115
|
-
this.dispatchPositionForTimestamp(this.timeline.timestamp, [
|
|
116
|
-
positionListener,
|
|
117
|
-
]); // TODO: should this be a separate dispatch, or should the listener manually ask for the position?
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
removePositionListener(positionListener: PositionListener): void {
|
|
121
|
-
this.positionListeners.delete(positionListener);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
onTimelineTimestampChange(timestamp: MillisecondTimestamp): void {
|
|
125
|
-
this.dispatchPositionForTimestamp(timestamp);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
private dispatchPositionForTimestamp(
|
|
129
|
-
timestamp: MillisecondTimestamp,
|
|
130
|
-
listeners: PositionListener[] | Set<PositionListener> = this
|
|
131
|
-
.positionListeners,
|
|
132
|
-
): void {
|
|
133
|
-
let position: PuzzlePosition;
|
|
134
|
-
if (this.indexer.timestampToPosition) {
|
|
135
|
-
position = this.indexer.timestampToPosition(timestamp, this.startState);
|
|
136
|
-
} else {
|
|
137
|
-
const idx = this.indexer.timestampToIndex(timestamp);
|
|
138
|
-
const state = this.indexer.stateAtIndex(
|
|
139
|
-
idx,
|
|
140
|
-
this.startState,
|
|
141
|
-
) as Transformation; // TODO
|
|
142
|
-
position = {
|
|
143
|
-
state,
|
|
144
|
-
movesInProgress: [],
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
if (this.indexer.numAnimatedLeaves() > 0) {
|
|
148
|
-
const move = this.indexer.getAnimLeaf(idx)?.as(Move);
|
|
149
|
-
if (!move) {
|
|
150
|
-
return; // TODO
|
|
151
|
-
}
|
|
152
|
-
const fraction =
|
|
153
|
-
(timestamp - this.indexer.indexToMoveStartTimestamp(idx)) /
|
|
154
|
-
this.indexer.moveDuration(idx);
|
|
155
|
-
if (fraction === 1) {
|
|
156
|
-
// TODO: push this into the indexer
|
|
157
|
-
position.state = this.ksolvePuzzle.combine(
|
|
158
|
-
state,
|
|
159
|
-
this.ksolvePuzzle.stateFromMove(move),
|
|
160
|
-
) as Transformation;
|
|
161
|
-
} else if (fraction > 0) {
|
|
162
|
-
if (move) {
|
|
163
|
-
position.movesInProgress.push({
|
|
164
|
-
move,
|
|
165
|
-
direction: Direction.Forwards,
|
|
166
|
-
fraction,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
for (const listener of listeners) {
|
|
174
|
-
listener.onPositionChange(position);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
onTimeRangeChange(_timeRange: TimeRange): void {
|
|
179
|
-
// nothing to do
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
setAlg(alg: Alg, indexerConstructor?: IndexerConstructor): void {
|
|
183
|
-
indexerConstructor ??= this.indexerConstructor;
|
|
184
|
-
if (
|
|
185
|
-
alg.isIdentical(this.alg) &&
|
|
186
|
-
this.indexerConstructor === indexerConstructor
|
|
187
|
-
) {
|
|
188
|
-
// TODO: this is a hacky optimization.
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
this.indexerConstructor = indexerConstructor;
|
|
192
|
-
this.alg = alg;
|
|
193
|
-
this.instantiateIndexer(alg);
|
|
194
|
-
this.timeline.onCursorChange(this);
|
|
195
|
-
this.dispatchPositionForTimestamp(this.timeline.timestamp);
|
|
196
|
-
// TODO: Handle state change.
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
moveBoundary(
|
|
200
|
-
timestamp: MillisecondTimestamp,
|
|
201
|
-
direction: Direction.Backwards | Direction.Forwards,
|
|
202
|
-
): MillisecondTimestamp | null {
|
|
203
|
-
if (this.indexer.numAnimatedLeaves() === 0) {
|
|
204
|
-
return null;
|
|
205
|
-
}
|
|
206
|
-
// TODO: define semantics of indexing edge cases and remove this hack.
|
|
207
|
-
const offsetHack = directionScalar(direction) * 0.001;
|
|
208
|
-
const idx = this.indexer.timestampToIndex(timestamp + offsetHack);
|
|
209
|
-
const moveStart = this.indexer.indexToMoveStartTimestamp(idx);
|
|
210
|
-
|
|
211
|
-
if (direction === Direction.Backwards) {
|
|
212
|
-
return timestamp >= moveStart ? moveStart : null;
|
|
213
|
-
} else {
|
|
214
|
-
const moveEnd = moveStart + this.indexer.moveDuration(idx);
|
|
215
|
-
return timestamp <= moveEnd ? moveEnd : null;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
setPuzzle(
|
|
220
|
-
def: KPuzzleDefinition,
|
|
221
|
-
alg: Alg = this.alg,
|
|
222
|
-
startStateAlg?: Alg,
|
|
223
|
-
): void {
|
|
224
|
-
this.ksolvePuzzle = new KPuzzleWrapper(def);
|
|
225
|
-
this.def = def;
|
|
226
|
-
this.indexer = new this.indexerConstructor(this.ksolvePuzzle, alg);
|
|
227
|
-
if (alg !== this.alg) {
|
|
228
|
-
this.timeline.onCursorChange(this);
|
|
229
|
-
}
|
|
230
|
-
this.setStartState(
|
|
231
|
-
startStateAlg
|
|
232
|
-
? this.algToState(startStateAlg)
|
|
233
|
-
: this.ksolvePuzzle.startState(),
|
|
234
|
-
);
|
|
235
|
-
this.alg = alg;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/** @deprecated */
|
|
239
|
-
experimentalTimestampFromIndex(index: number): MillisecondTimestamp {
|
|
240
|
-
return this.indexer.indexToMoveStartTimestamp(index);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/** @deprecated */
|
|
244
|
-
experimentalIndexFromTimestamp(timestamp: MillisecondTimestamp): number {
|
|
245
|
-
return this.indexer.timestampToIndex(timestamp);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/** @deprecated */
|
|
249
|
-
experimentalLeafAtIndex(index: number): Move | Pause | null {
|
|
250
|
-
return this.indexer.getAnimLeaf(index);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CSSSource } from "./element/ManagedCustomElement";
|
|
2
|
-
|
|
3
|
-
export const twistyAlgViewerCSS = new CSSSource(`
|
|
4
|
-
:host {
|
|
5
|
-
display: inline-grid;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
a:not(:hover) {
|
|
9
|
-
color: inherit;
|
|
10
|
-
text-decoration: none;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
twisty-alg-leaf-elem.twisty-alg-comment {
|
|
14
|
-
color: rgba(0, 0, 0, 0.4);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.wrapper.current-move {
|
|
18
|
-
background: rgba(66, 133, 244, 0.3);
|
|
19
|
-
margin-left: -0.1em;
|
|
20
|
-
margin-right: -0.1em;
|
|
21
|
-
padding-left: 0.1em;
|
|
22
|
-
padding-right: 0.1em;
|
|
23
|
-
border-radius: 0.1em;
|
|
24
|
-
}
|
|
25
|
-
`);
|