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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { countMoves } from "../../../../../notation";
|
|
2
|
+
import { TwistyPropDerived } from "../../TwistyProp";
|
|
3
|
+
import type { AlgWithIssues } from "./AlgProp";
|
|
4
|
+
|
|
5
|
+
interface NaiveMoveCountPropInputs {
|
|
6
|
+
alg: AlgWithIssues;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// TODO: handle metrics
|
|
10
|
+
export class NaiveMoveCountProp extends TwistyPropDerived<
|
|
11
|
+
NaiveMoveCountPropInputs,
|
|
12
|
+
number | null
|
|
13
|
+
> {
|
|
14
|
+
derive(inputs: NaiveMoveCountPropInputs): number | null {
|
|
15
|
+
if (inputs.alg.issues.errors.length > 0) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return countMoves(inputs.alg.alg);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type { SetupToLocation } from "../../../../old/dom/TwistyPlayerConfig";
|
|
2
1
|
import { SimpleTwistyPropSource } from "../../TwistyProp";
|
|
3
2
|
|
|
3
|
+
// TODO: turn these maps into lists?
|
|
4
|
+
export const setupToLocations = {
|
|
5
|
+
start: true, // default // TODO: "beginning"
|
|
6
|
+
end: true,
|
|
7
|
+
};
|
|
8
|
+
export type SetupToLocation = keyof typeof setupToLocations;
|
|
9
|
+
|
|
4
10
|
export class SetupAnchorProp extends SimpleTwistyPropSource<SetupToLocation> {
|
|
5
11
|
getDefaultValue(): SetupToLocation {
|
|
6
12
|
return "start";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PuzzleLoader } from "../../../../../puzzles";
|
|
2
|
-
import type { PuzzleID } from "../../../../old/dom/TwistyPlayerConfig";
|
|
3
2
|
import { TwistyPropDerived } from "../../TwistyProp";
|
|
3
|
+
import type { PuzzleID } from "./PuzzleIDRequestProp";
|
|
4
4
|
|
|
5
5
|
export class PuzzleIDProp extends TwistyPropDerived<
|
|
6
6
|
{ puzzleLoader: PuzzleLoader },
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import type { PuzzleID } from "../../../../old/dom/TwistyPlayerConfig";
|
|
2
1
|
import {
|
|
3
2
|
NoValueType,
|
|
4
3
|
NO_VALUE,
|
|
5
4
|
SimpleTwistyPropSource,
|
|
6
5
|
} from "../../TwistyProp";
|
|
7
6
|
|
|
7
|
+
export const puzzleIDs = {
|
|
8
|
+
"3x3x3": true, // default
|
|
9
|
+
"custom": true,
|
|
10
|
+
"2x2x2": true,
|
|
11
|
+
"4x4x4": true,
|
|
12
|
+
"5x5x5": true,
|
|
13
|
+
"6x6x6": true,
|
|
14
|
+
"7x7x7": true,
|
|
15
|
+
"40x40x40": true,
|
|
16
|
+
"megaminx": true,
|
|
17
|
+
"pyraminx": true,
|
|
18
|
+
"square1": true,
|
|
19
|
+
"clock": true,
|
|
20
|
+
"skewb": true,
|
|
21
|
+
"fto": true,
|
|
22
|
+
"gigaminx": true,
|
|
23
|
+
"master_tetraminx": true,
|
|
24
|
+
};
|
|
25
|
+
export type PuzzleID = keyof typeof puzzleIDs;
|
|
26
|
+
|
|
8
27
|
// TODO: Ideally we'd use `null` to mean "no value", but `null` has a special meaning
|
|
9
28
|
// for `TwistyProp` and might mess with caching.
|
|
10
29
|
// https://github.com/cubing/cubing.js/blob/63b0a55b83963f68410bb117a2e481052a07e086/src/cubing/twisty/model/TwistyProp.ts#L189-L189
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
PuzzleLoader,
|
|
6
6
|
puzzles,
|
|
7
7
|
} from "../../../../../puzzles";
|
|
8
|
-
import type { PuzzleID } from "../../../../old/dom/TwistyPlayerConfig";
|
|
9
8
|
import { NoValueType, NO_VALUE, TwistyPropDerived } from "../../TwistyProp";
|
|
9
|
+
import type { PuzzleID } from "./PuzzleIDRequestProp";
|
|
10
10
|
8;
|
|
11
11
|
interface PuzzleLoaderPropInputs {
|
|
12
12
|
puzzleIDRequest: PuzzleID | NoValueType;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
MillisecondTimestamp,
|
|
3
|
+
TimeRange,
|
|
4
|
+
} from "../../../controllers/AnimationTypes";
|
|
4
5
|
import type { TimestampRequest } from "./TimestampRequestProp";
|
|
5
6
|
import { TwistyPropDerived } from "../TwistyProp";
|
|
7
|
+
import type { SetupToLocation } from "../puzzle/state/SetupAnchorProp";
|
|
6
8
|
|
|
7
9
|
interface DetailedTimelineInfoInputs {
|
|
8
10
|
timestampRequest: TimestampRequest;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BoundaryType,
|
|
3
|
-
Direction,
|
|
4
|
-
} from "../../../old/animation/cursor/CursorTypes";
|
|
1
|
+
import { BoundaryType, Direction } from "../../../controllers/AnimationTypes";
|
|
5
2
|
import { TwistyPropSource } from "../TwistyProp";
|
|
6
3
|
|
|
7
4
|
export type SimpleDirection = Direction.Forwards | Direction.Backwards;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type { BackViewLayout } from "../../../old/dom/viewers/TwistyViewerWrapper";
|
|
2
1
|
import { SimpleTwistyPropSource } from "../TwistyProp";
|
|
3
2
|
|
|
3
|
+
export const backViewLayouts = {
|
|
4
|
+
"none": true, // default
|
|
5
|
+
"side-by-side": true,
|
|
6
|
+
"top-right": true,
|
|
7
|
+
};
|
|
8
|
+
export type BackViewLayout = keyof typeof backViewLayouts;
|
|
9
|
+
|
|
4
10
|
export type BackViewLayoutWithAuto = BackViewLayout | "auto";
|
|
5
11
|
|
|
6
12
|
export class BackViewProp extends SimpleTwistyPropSource<BackViewLayoutWithAuto> {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type { BackgroundTheme } from "../../../old/dom/TwistyPlayerConfig";
|
|
2
1
|
import { SimpleTwistyPropSource } from "../TwistyProp";
|
|
3
2
|
|
|
3
|
+
export const backgroundThemes = {
|
|
4
|
+
checkered: true, // default
|
|
5
|
+
none: true,
|
|
6
|
+
};
|
|
7
|
+
export type BackgroundTheme = keyof typeof backgroundThemes;
|
|
8
|
+
|
|
4
9
|
export type BackgroundThemeWithAuto = BackgroundTheme | "auto";
|
|
5
10
|
|
|
6
11
|
export class BackgroundProp extends SimpleTwistyPropSource<BackgroundThemeWithAuto> {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type { ControlsLocation } from "../../../old/dom/TwistyPlayerConfig";
|
|
2
1
|
import { SimpleTwistyPropSource } from "../TwistyProp";
|
|
3
2
|
|
|
3
|
+
export const controlsLocations = {
|
|
4
|
+
"bottom-row": true, // default
|
|
5
|
+
"none": true,
|
|
6
|
+
};
|
|
7
|
+
export type ControlsLocation = keyof typeof controlsLocations;
|
|
4
8
|
export type ControlPanelThemeWithAuto = ControlsLocation | "auto";
|
|
5
9
|
|
|
6
10
|
export class ControlPanelProp extends SimpleTwistyPropSource<ControlPanelThemeWithAuto> {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "../../../old/dom/TwistyPlayerConfig";
|
|
1
|
+
import { DEGREES_PER_RADIAN } from "../../../views/3D/TAU";
|
|
2
|
+
import type { PuzzleID } from "../puzzle/structure/PuzzleIDRequestProp";
|
|
3
|
+
import { TwistyPropDerived } from "../TwistyProp";
|
|
5
4
|
import {
|
|
6
5
|
CoordinateDegrees,
|
|
6
|
+
OrbitCoordinates,
|
|
7
7
|
orbitCoordinatesEqual,
|
|
8
8
|
OrbitCoordinatesRequest,
|
|
9
|
-
OrbitCoordinatesV2,
|
|
10
9
|
} from "./OrbitCoordinatesRequestProp";
|
|
11
|
-
import { TwistyPropDerived } from "../TwistyProp";
|
|
12
10
|
import type { VisualizationStrategy } from "./VisualizationStrategyProp";
|
|
13
11
|
|
|
14
12
|
interface OrbitCoordinatesPropInputs {
|
|
@@ -20,20 +18,18 @@ interface OrbitCoordinatesPropInputs {
|
|
|
20
18
|
|
|
21
19
|
export class OrbitCoordinatesProp extends TwistyPropDerived<
|
|
22
20
|
OrbitCoordinatesPropInputs,
|
|
23
|
-
|
|
21
|
+
OrbitCoordinates
|
|
24
22
|
> {
|
|
25
|
-
canReuseValue(v1:
|
|
23
|
+
canReuseValue(v1: OrbitCoordinates, v2: OrbitCoordinates) {
|
|
26
24
|
return orbitCoordinatesEqual(v1, v2);
|
|
27
25
|
}
|
|
28
26
|
|
|
29
|
-
async derive(
|
|
30
|
-
inputs: OrbitCoordinatesPropInputs,
|
|
31
|
-
): Promise<OrbitCoordinatesV2> {
|
|
27
|
+
async derive(inputs: OrbitCoordinatesPropInputs): Promise<OrbitCoordinates> {
|
|
32
28
|
if (inputs.orbitCoordinatesRequest === "auto") {
|
|
33
29
|
return defaultCameraOrbitCoordinates(inputs.puzzleID, inputs.strategy);
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
const req:
|
|
32
|
+
const req: OrbitCoordinates = Object.assign(
|
|
37
33
|
Object.assign(
|
|
38
34
|
{},
|
|
39
35
|
defaultCameraOrbitCoordinates(inputs.puzzleID, inputs.strategy),
|
|
@@ -54,3 +50,78 @@ export class OrbitCoordinatesProp extends TwistyPropDerived<
|
|
|
54
50
|
}
|
|
55
51
|
}
|
|
56
52
|
}
|
|
53
|
+
|
|
54
|
+
// const DEFAULT_CAMERA_Z = 5;
|
|
55
|
+
// // Golden ratio is perfect for FTO and Megaminx.
|
|
56
|
+
// const DEFAULT_CAMERA_Y = DEFAULT_CAMERA_Z * (2 / (1 + Math.sqrt(5)));
|
|
57
|
+
export const centeredCameraOrbitCoordinates: OrbitCoordinates = {
|
|
58
|
+
latitude: 31.717474411461005,
|
|
59
|
+
longitude: 0,
|
|
60
|
+
distance: 5.877852522924731,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// This is tuned so that the hint facelets for 3x3x3 always fit in the canvas.
|
|
64
|
+
export const cubeCube3DCameraOrbitCoordinates: OrbitCoordinates = {
|
|
65
|
+
latitude: 35,
|
|
66
|
+
longitude: 30,
|
|
67
|
+
distance: 6,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// This is tuned so that the hint facelets always fit in the canvas.
|
|
71
|
+
export const cubePG3DCameraOrbitCoordinates: OrbitCoordinates = {
|
|
72
|
+
latitude: 35,
|
|
73
|
+
longitude: 30,
|
|
74
|
+
distance: 6.25,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const megaminxCameraOrbitCoordinates: OrbitCoordinates = {
|
|
78
|
+
latitude: Math.atan(1 / 2) * DEGREES_PER_RADIAN,
|
|
79
|
+
longitude: 0,
|
|
80
|
+
distance: 6.7,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const pyraminxCameraOrbitCoordinates: OrbitCoordinates = {
|
|
84
|
+
latitude: 26.56505117707799,
|
|
85
|
+
longitude: 0,
|
|
86
|
+
distance: 6,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const cornerCameraOrbitCoordinates: OrbitCoordinates = {
|
|
90
|
+
latitude: 35.264389682754654,
|
|
91
|
+
longitude: 45,
|
|
92
|
+
distance: 6.928203230275509,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// TODO
|
|
96
|
+
export function defaultCameraOrbitCoordinates(
|
|
97
|
+
puzzleID: PuzzleID,
|
|
98
|
+
strategy: VisualizationStrategy,
|
|
99
|
+
): OrbitCoordinates {
|
|
100
|
+
if (puzzleID[1] === "x") {
|
|
101
|
+
if (strategy === "Cube3D") {
|
|
102
|
+
return cubeCube3DCameraOrbitCoordinates;
|
|
103
|
+
} else {
|
|
104
|
+
return cubePG3DCameraOrbitCoordinates;
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
switch (puzzleID) {
|
|
108
|
+
case "megaminx":
|
|
109
|
+
case "gigaminx":
|
|
110
|
+
return megaminxCameraOrbitCoordinates;
|
|
111
|
+
case "pyraminx":
|
|
112
|
+
case "master_tetraminx":
|
|
113
|
+
return pyraminxCameraOrbitCoordinates;
|
|
114
|
+
case "skewb":
|
|
115
|
+
return cubePG3DCameraOrbitCoordinates;
|
|
116
|
+
default:
|
|
117
|
+
return centeredCameraOrbitCoordinates;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// TODO: templatize
|
|
122
|
+
export interface ManagedAttribute<K> {
|
|
123
|
+
string: string;
|
|
124
|
+
value: K;
|
|
125
|
+
setString(s: string): boolean;
|
|
126
|
+
setValue(v: K): boolean;
|
|
127
|
+
}
|
|
@@ -3,15 +3,15 @@ import { TwistyPropSource } from "../TwistyProp";
|
|
|
3
3
|
|
|
4
4
|
export type CoordinateDegrees = number;
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface OrbitCoordinates {
|
|
7
7
|
latitude: CoordinateDegrees;
|
|
8
8
|
longitude: CoordinateDegrees;
|
|
9
9
|
distance: number;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function orbitCoordinatesEqual(
|
|
13
|
-
c1:
|
|
14
|
-
c2:
|
|
13
|
+
c1: OrbitCoordinates,
|
|
14
|
+
c2: OrbitCoordinates,
|
|
15
15
|
): boolean {
|
|
16
16
|
return (
|
|
17
17
|
c1.latitude === c2.latitude &&
|
|
@@ -27,23 +27,23 @@ export function orbitCoordinatesEqual(
|
|
|
27
27
|
// distance: 6,
|
|
28
28
|
// });
|
|
29
29
|
|
|
30
|
-
export type OrbitCoordinatesRequest = Partial<
|
|
30
|
+
export type OrbitCoordinatesRequest = Partial<OrbitCoordinates> | "auto";
|
|
31
31
|
|
|
32
32
|
// TODO: Put the "auto" calculations in a separate place.
|
|
33
33
|
export class OrbitCoordinatesRequestProp extends TwistyPropSource<
|
|
34
34
|
OrbitCoordinatesRequest,
|
|
35
|
-
Partial<
|
|
35
|
+
Partial<OrbitCoordinates> | "auto"
|
|
36
36
|
> {
|
|
37
37
|
getDefaultValue(): OrbitCoordinatesRequest {
|
|
38
38
|
return "auto";
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
canReuseValue(v1:
|
|
41
|
+
canReuseValue(v1: OrbitCoordinates, v2: OrbitCoordinates) {
|
|
42
42
|
return v1 === v2 || orbitCoordinatesEqual(v1, v2);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
async derive(
|
|
46
|
-
newCoordinates: Partial<
|
|
46
|
+
newCoordinates: Partial<OrbitCoordinates> | "auto",
|
|
47
47
|
oldValuePromise: Promise<OrbitCoordinatesRequest>,
|
|
48
48
|
): Promise<OrbitCoordinatesRequest> {
|
|
49
49
|
if (newCoordinates === "auto") {
|
|
@@ -55,7 +55,7 @@ export class OrbitCoordinatesRequestProp extends TwistyPropSource<
|
|
|
55
55
|
oldValue = {};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const newValue: Partial<
|
|
58
|
+
const newValue: Partial<OrbitCoordinates> = Object.assign({}, oldValue);
|
|
59
59
|
Object.assign(newValue, newCoordinates);
|
|
60
60
|
|
|
61
61
|
if (typeof newValue.latitude !== "undefined") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TimeRange } from "../../../
|
|
2
|
-
import type { AlgIndexer } from "../../../
|
|
1
|
+
import type { TimeRange } from "../../../controllers/AnimationTypes";
|
|
2
|
+
import type { AlgIndexer } from "../../../controllers/indexer/AlgIndexer";
|
|
3
3
|
import { TwistyPropDerived } from "../TwistyProp";
|
|
4
4
|
|
|
5
5
|
export class TimeRangeProp extends TwistyPropDerived<
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type { ViewerLinkPage } from "../../../old/dom/TwistyPlayerConfig";
|
|
2
1
|
import { SimpleTwistyPropSource } from "../TwistyProp";
|
|
3
2
|
|
|
3
|
+
export const viewerLinkPages = {
|
|
4
|
+
twizzle: true, // default
|
|
5
|
+
none: true,
|
|
6
|
+
};
|
|
7
|
+
export type ViewerLinkPage = keyof typeof viewerLinkPages;
|
|
4
8
|
export type ViewerLinkPageWithAuto = ViewerLinkPage | "auto";
|
|
5
9
|
|
|
6
10
|
export class ViewerLinkProp extends SimpleTwistyPropSource<ViewerLinkPageWithAuto> {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import type { VisualizationFormat } from "../../../old/dom/TwistyPlayerConfig";
|
|
2
1
|
import { SimpleTwistyPropSource } from "../TwistyProp";
|
|
3
2
|
|
|
3
|
+
// TODO: turn these maps into lists?
|
|
4
|
+
export const visualizationFormats = {
|
|
5
|
+
"3D": true, // default
|
|
6
|
+
"2D": true,
|
|
7
|
+
"experimental-2D-LL": true, // TODO
|
|
8
|
+
"PG3D": true,
|
|
9
|
+
};
|
|
10
|
+
export type VisualizationFormat = keyof typeof visualizationFormats;
|
|
4
11
|
export type VisualizationFormatWithAuto = VisualizationFormat | "auto";
|
|
5
12
|
|
|
6
13
|
export class VisualizationFormatProp extends SimpleTwistyPropSource<VisualizationFormatWithAuto> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PuzzleID } from "../../../old/dom/TwistyPlayerConfig";
|
|
2
1
|
import type { VisualizationFormatWithAuto } from "./VisualizationProp";
|
|
3
2
|
import { TwistyPropDerived } from "../TwistyProp";
|
|
3
|
+
import type { PuzzleID } from "../../..";
|
|
4
4
|
|
|
5
5
|
type VisualizationStrategyPropInputs = {
|
|
6
6
|
visualizationRequest: VisualizationFormatWithAuto;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -6,22 +6,18 @@ import {
|
|
|
6
6
|
} from "../../../kpuzzle";
|
|
7
7
|
import type { PuzzleLoader } from "../../../puzzles/PuzzleLoader";
|
|
8
8
|
import type { PuzzleAppearance } from "../../../puzzles/stickerings/appearance";
|
|
9
|
-
import type { PositionListener } from "../../old/animation/cursor/AlgCursor";
|
|
10
9
|
import {
|
|
11
10
|
Direction,
|
|
11
|
+
PositionListener,
|
|
12
12
|
PuzzlePosition,
|
|
13
|
-
} from "../../
|
|
14
|
-
import { RenderScheduler } from "../../
|
|
15
|
-
import { ManagedCustomElement } from "
|
|
16
|
-
import { customElementsShim } from "
|
|
13
|
+
} from "../../controllers/AnimationTypes";
|
|
14
|
+
import { RenderScheduler } from "../../controllers/RenderScheduler";
|
|
15
|
+
import { ManagedCustomElement } from "../ManagedCustomElement";
|
|
16
|
+
import { customElementsShim } from "../node-custom-element-shims";
|
|
17
17
|
import type { TwistyPlayerModel } from "../../model/TwistyPlayerModel";
|
|
18
18
|
import { FreshListenerManager } from "../../model/props/TwistyProp";
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
PuzzleID,
|
|
22
|
-
} from "../../old/dom/TwistyPlayerConfig";
|
|
23
|
-
import { twisty2DSVGCSS } from "../../old/dom/viewers/Twisty2DSVGView.css";
|
|
24
|
-
import type { TwistyViewerElement } from "../../old/dom/viewers/TwistyViewerElement";
|
|
19
|
+
import { twisty2DSVGCSS } from "./Twisty2DPuzzle.css";
|
|
20
|
+
import type { ExperimentalStickering, PuzzleID } from "../..";
|
|
25
21
|
|
|
26
22
|
export interface Twisty2DPuzzleOptions {
|
|
27
23
|
experimentalStickering?: ExperimentalStickering;
|
|
@@ -30,7 +26,7 @@ export interface Twisty2DPuzzleOptions {
|
|
|
30
26
|
// <twisty-2d-svg>
|
|
31
27
|
export class Twisty2DPuzzle
|
|
32
28
|
extends ManagedCustomElement
|
|
33
|
-
implements
|
|
29
|
+
implements PositionListener
|
|
34
30
|
{
|
|
35
31
|
private definition: KPuzzleDefinition;
|
|
36
32
|
public svg: KPuzzleSVGWrapper;
|
|
@@ -2,7 +2,7 @@ import type { PuzzleLoader } from "../../../puzzles";
|
|
|
2
2
|
import type { ExperimentalStickering } from "../../../twisty";
|
|
3
3
|
import type { TwistyPlayerModel } from "../../model/TwistyPlayerModel";
|
|
4
4
|
import { FreshListenerManager } from "../../model/props/TwistyProp";
|
|
5
|
-
import type { Schedulable } from "../../
|
|
5
|
+
import type { Schedulable } from "../../controllers/RenderScheduler";
|
|
6
6
|
import { Twisty2DPuzzle } from "./Twisty2DPuzzle";
|
|
7
7
|
|
|
8
8
|
export class Twisty2DPuzzleWrapper implements Schedulable {
|
|
@@ -3,10 +3,10 @@ import type { PuzzleLoader } from "../../../puzzles";
|
|
|
3
3
|
import { THREEJS } from "../../heavy-code-imports/3d";
|
|
4
4
|
import type { TwistyPlayerModel } from "../../model/TwistyPlayerModel";
|
|
5
5
|
import { FreshListenerManager } from "../../model/props/TwistyProp";
|
|
6
|
-
import type { Schedulable } from "../../
|
|
7
|
-
import { ManagedCustomElement } from "
|
|
8
|
-
import { customElementsShim } from "
|
|
9
|
-
import { twistyViewerWrapperCSS } from "
|
|
6
|
+
import type { Schedulable } from "../../controllers/RenderScheduler";
|
|
7
|
+
import { ManagedCustomElement } from "../ManagedCustomElement";
|
|
8
|
+
import { customElementsShim } from "../node-custom-element-shims";
|
|
9
|
+
import { twistyViewerWrapperCSS } from "../TwistyViewerWrapper.css";
|
|
10
10
|
import { Twisty2DPuzzleWrapper } from "./Twisty2DPuzzleWrapper";
|
|
11
11
|
|
|
12
12
|
export class Twisty2DSceneWrapper
|
|
Binary file
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// export class Drag() {
|
|
2
|
+
|
|
3
|
+
// }
|
|
4
|
+
|
|
5
|
+
interface DragInfo {
|
|
6
|
+
attachedInfo: Record<any, any>;
|
|
7
|
+
hasMoved: boolean;
|
|
8
|
+
lastClientX: number;
|
|
9
|
+
lastClientY: number;
|
|
10
|
+
lastTimeStamp: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type PointerID = number;
|
|
14
|
+
|
|
15
|
+
export interface DragMovementInfo {
|
|
16
|
+
attachedInfo: Record<any, any>;
|
|
17
|
+
movementX: number;
|
|
18
|
+
movementY: number;
|
|
19
|
+
elapsedMs: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface UpInfo {
|
|
23
|
+
attachedInfo: Record<any, any>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface PressInfo {
|
|
27
|
+
normalizedX: number;
|
|
28
|
+
normalizedY: number;
|
|
29
|
+
rightClick: boolean;
|
|
30
|
+
keys: {
|
|
31
|
+
// TODO: group these
|
|
32
|
+
altKey: boolean;
|
|
33
|
+
ctrlOrMetaKey: boolean;
|
|
34
|
+
shiftKey: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Chrome can report movements as low as `0.0000152587890625` even if the cursor did not move at all. So we need a treshold insteadl.
|
|
39
|
+
const MOVEMENT_EPSILON = 0.1; // px
|
|
40
|
+
|
|
41
|
+
export class DragTracker extends EventTarget {
|
|
42
|
+
#dragInfoMap: Map<PointerID, DragInfo> = new Map();
|
|
43
|
+
|
|
44
|
+
constructor(public readonly target: HTMLElement) {
|
|
45
|
+
super();
|
|
46
|
+
target.addEventListener("pointerdown", this.onPointerDown.bind(this));
|
|
47
|
+
// Prevent right-click on desktop (only tested on macOS Chrome/Safari/Firefox) so we can detect right-click moves.
|
|
48
|
+
// TODO: Can we do this selectively, e.g. only on the puzzle? That way we could allow right-click to download the canvas. Unfortunately, it would probably require a sync calculation.
|
|
49
|
+
this.target.addEventListener("contextmenu", (e) => {
|
|
50
|
+
if (e.buttons & 2) {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
// Prevent touch scrolling (preventing default on `pointermove` doesn't work).
|
|
55
|
+
this.target.addEventListener("touchmove", (e) => e.preventDefault());
|
|
56
|
+
// Prevent zooming on double-tap (iOS).
|
|
57
|
+
// This is because `dblclick` works to zoom in, but does *not* work to zoom out. So the user can get stuck zoomed into the player without a way to zoom out.
|
|
58
|
+
this.target.addEventListener("dblclick", (e) => e.preventDefault());
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// This allows us to avoid getting a callback every time the pointer moves over the canvas, until we have a down event.
|
|
62
|
+
// TODO: Ideally we'd also support unregistering when we're certain there are no more active touches. But this means we need to properly handle every way a pointer "click" can end, which is tricky across environments (due to e.g. mouse vs. touch vs. stylues, canvas/viewport/window/scroll boundaries, right-click and other ways of losing focus, etc.), so we conservatively leave the listeners on.
|
|
63
|
+
#lazyListenersRegistered: boolean = false;
|
|
64
|
+
#registerLazyListeners(): void {
|
|
65
|
+
if (this.#lazyListenersRegistered) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
this.target.addEventListener("pointermove", this.onPointerMove.bind(this)); // TODO: only register this after pointer down.
|
|
69
|
+
this.target.addEventListener("pointerup", this.onPointerUp.bind(this));
|
|
70
|
+
this.#lazyListenersRegistered = true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
#clear(e: PointerEvent): void {
|
|
74
|
+
this.#dragInfoMap.delete(e.pointerId);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// `null`: means: ignore this result (no movement, or not
|
|
78
|
+
#trackDrag(e: PointerEvent): {
|
|
79
|
+
movementInfo: DragMovementInfo | null;
|
|
80
|
+
hasMoved: boolean;
|
|
81
|
+
} {
|
|
82
|
+
// TODO: Find a way to detect if this is an active press, in a way that works cross-platform.
|
|
83
|
+
// if (e.buttons === 0) {
|
|
84
|
+
// return { movementInfo: null, hasMoved: false };
|
|
85
|
+
// }
|
|
86
|
+
const existing = this.#dragInfoMap.get(e.pointerId);
|
|
87
|
+
if (!existing) {
|
|
88
|
+
return { movementInfo: null, hasMoved: false };
|
|
89
|
+
}
|
|
90
|
+
// We would try to use `e.movementX`/`e.movementY`, except Safari:
|
|
91
|
+
// - Does not have those values on i[Pad]OS.
|
|
92
|
+
// - Will always report `0` for these values on macOS.
|
|
93
|
+
// https://bugs.webkit.org/show_bug.cgi?id=220194
|
|
94
|
+
//
|
|
95
|
+
// The following are all insufficiently powerful for detecting the Safari `0` bug:
|
|
96
|
+
// - `"movementX" in e`
|
|
97
|
+
// - `e.movementX !== "undefined"`
|
|
98
|
+
// - `e.hasOwnProperty("movementX")`
|
|
99
|
+
|
|
100
|
+
let movementInfo: DragMovementInfo;
|
|
101
|
+
if ((e.movementX ?? 0) !== 0 || (e.movementY ?? 0) !== 0) {
|
|
102
|
+
// We optimistically try to catch sub-pixel movements in Chrome.
|
|
103
|
+
movementInfo = {
|
|
104
|
+
attachedInfo: existing.attachedInfo,
|
|
105
|
+
movementX: e.movementX,
|
|
106
|
+
movementY: e.movementY,
|
|
107
|
+
elapsedMs: e.timeStamp - existing.lastTimeStamp,
|
|
108
|
+
};
|
|
109
|
+
} else {
|
|
110
|
+
movementInfo = {
|
|
111
|
+
attachedInfo: existing.attachedInfo,
|
|
112
|
+
movementX: e.clientX - existing.lastClientX,
|
|
113
|
+
movementY: e.clientY - existing.lastClientY,
|
|
114
|
+
elapsedMs: e.timeStamp - existing.lastTimeStamp,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
existing.lastClientX = e.clientX;
|
|
118
|
+
existing.lastClientY = e.clientY;
|
|
119
|
+
existing.lastTimeStamp = e.timeStamp;
|
|
120
|
+
if (
|
|
121
|
+
Math.abs(movementInfo.movementX) < MOVEMENT_EPSILON &&
|
|
122
|
+
Math.abs(movementInfo.movementY) < MOVEMENT_EPSILON
|
|
123
|
+
) {
|
|
124
|
+
return { movementInfo: null, hasMoved: existing.hasMoved };
|
|
125
|
+
} else {
|
|
126
|
+
existing.hasMoved = true;
|
|
127
|
+
return { movementInfo, hasMoved: existing.hasMoved };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private onPointerDown(e: PointerEvent) {
|
|
132
|
+
this.#registerLazyListeners();
|
|
133
|
+
const newDragInfo: DragInfo = {
|
|
134
|
+
attachedInfo: {},
|
|
135
|
+
hasMoved: false,
|
|
136
|
+
lastClientX: e.clientX,
|
|
137
|
+
lastClientY: e.clientY,
|
|
138
|
+
lastTimeStamp: e.timeStamp,
|
|
139
|
+
};
|
|
140
|
+
this.#dragInfoMap.set(e.pointerId, newDragInfo);
|
|
141
|
+
this.target.setPointerCapture(e.pointerId);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
private onPointerMove(e: PointerEvent) {
|
|
145
|
+
const movementInfo = this.#trackDrag(e).movementInfo;
|
|
146
|
+
if (movementInfo) {
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
this.dispatchEvent(
|
|
149
|
+
new CustomEvent("move", {
|
|
150
|
+
detail: movementInfo,
|
|
151
|
+
}),
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
private onPointerUp(e: PointerEvent) {
|
|
157
|
+
const trackDragResult = this.#trackDrag(e);
|
|
158
|
+
const existing = this.#dragInfoMap.get(e.pointerId)!; // TODO
|
|
159
|
+
this.#clear(e);
|
|
160
|
+
this.target.releasePointerCapture(e.pointerId); // TODO: unnecessary?
|
|
161
|
+
let event: CustomEvent;
|
|
162
|
+
if (trackDragResult.hasMoved) {
|
|
163
|
+
// TODO: send proper movement/momentum since last move event.
|
|
164
|
+
event = new CustomEvent<UpInfo>("up", {
|
|
165
|
+
detail: { attachedInfo: existing.attachedInfo },
|
|
166
|
+
});
|
|
167
|
+
} else {
|
|
168
|
+
const { altKey, ctrlKey, metaKey, shiftKey } = e;
|
|
169
|
+
event = new CustomEvent<PressInfo>("press", {
|
|
170
|
+
detail: {
|
|
171
|
+
normalizedX: (e.offsetX / this.target.offsetWidth) * 2 - 1,
|
|
172
|
+
normalizedY: 1 - (e.offsetY / this.target.offsetHeight) * 2,
|
|
173
|
+
rightClick: !!(e.button & 2),
|
|
174
|
+
keys: {
|
|
175
|
+
altKey,
|
|
176
|
+
ctrlOrMetaKey: ctrlKey || metaKey,
|
|
177
|
+
shiftKey,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
this.dispatchEvent(event);
|
|
183
|
+
}
|
|
184
|
+
}
|