cubing 0.21.0-pre8 → 0.21.2
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/{src/cubing/search/inside/solve → dist}/.DS_Store +0 -0
- package/dist/bin/puzzle-geometry-bin.js +1 -1
- package/dist/bin/puzzle-geometry-bin.js.map +2 -2
- package/dist/bundle-global/cubing.bundle-global.js +876 -797
- package/dist/esm/{3d-TYWC5MQY.js → 3d-B25DP5PE.js} +3 -3
- package/dist/esm/{3d-TYWC5MQY.js.map → 3d-B25DP5PE.js.map} +0 -0
- package/dist/esm/bluetooth/index.js +1 -1
- package/dist/esm/bluetooth/index.js.map +1 -1
- package/dist/esm/{chunk-6BXLPCNQ.js → chunk-APIIMJG6.js} +98 -95
- package/dist/esm/chunk-APIIMJG6.js.map +7 -0
- package/dist/esm/{chunk-HUPF5GPN.js → chunk-CSVAFZSB.js} +3 -3
- package/dist/esm/{chunk-HUPF5GPN.js.map → chunk-CSVAFZSB.js.map} +0 -0
- package/dist/esm/{chunk-L6K5FKPV.js → chunk-MUQMBH2S.js} +48 -26
- package/dist/esm/{chunk-L6K5FKPV.js.map → chunk-MUQMBH2S.js.map} +2 -2
- package/dist/esm/puzzle-geometry/index.js +1 -1
- package/dist/esm/puzzle-geometry/index.js.map +2 -2
- package/dist/esm/puzzles/index.js +5 -5
- package/dist/esm/scramble/index.js +2 -2
- package/dist/esm/search/index.js +2 -2
- package/dist/esm/twisty/index.js +313 -78
- package/dist/esm/twisty/index.js.map +3 -3
- package/dist/esm/{worker-inside-generated-string-DOHINKQX.js → worker-inside-generated-string-KDZOUGJF.js} +20 -20
- package/dist/esm/worker-inside-generated-string-KDZOUGJF.js.map +7 -0
- package/{src/cubing/search/inside/solve/vendor/cstimer → dist/types}/.DS_Store +0 -0
- package/dist/types/bluetooth/smart-puzzle/bluetooth-puzzle.d.ts +1 -1
- package/dist/types/bluetooth/smart-puzzle/bluetooth-puzzle.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/puzzles/implementations/fto/index.d.ts +2 -2
- package/dist/types/puzzles/implementations/fto/index.d.ts.map +1 -1
- package/dist/types/puzzles/index.d.ts +5 -1
- package/dist/types/puzzles/index.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/fto-stickerings.d.ts.map +1 -1
- package/dist/types/search/inside/api.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/controllers/TwistyAnimationController.d.ts +4 -1
- package/dist/types/twisty/controllers/TwistyAnimationController.d.ts.map +1 -1
- package/dist/types/twisty/index.d.ts +3 -2
- package/dist/types/twisty/index.d.ts.map +1 -1
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts +41 -37
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts.map +1 -1
- package/dist/types/twisty/model/UserVisibleErrorTracker.d.ts +11 -0
- package/dist/types/twisty/model/UserVisibleErrorTracker.d.ts.map +1 -0
- package/dist/types/twisty/model/{TwistyProp.d.ts → props/TwistyProp.d.ts} +3 -1
- package/dist/types/twisty/model/props/TwistyProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{TwistyProp.spec.d.ts → props/TwistyProp.spec.d.ts} +0 -0
- package/dist/types/twisty/model/props/TwistyProp.spec.d.ts.map +1 -0
- package/dist/types/twisty/model/{TwistyPropDebugger.d.ts → props/TwistyPropDebugger.d.ts} +2 -2
- package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/general}/URLProp.d.ts +0 -0
- package/dist/types/twisty/model/props/general/URLProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/puzzle/display}/HintFaceletProp.d.ts +2 -2
- package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-1 → props/puzzle/display}/SpriteProp.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/display/SpriteProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts +6 -0
- package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/puzzle/state}/AlgProp.d.ts +2 -2
- package/dist/types/twisty/model/props/puzzle/state/AlgProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-4 → props/puzzle/state}/AlgTransformationProp.d.ts +4 -4
- package/dist/types/twisty/model/props/puzzle/state/AlgTransformationProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-6 → props/puzzle/state}/AnchoredStartProp.d.ts +4 -4
- package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/CatchUpMoveProp.d.ts +11 -0
- package/dist/types/twisty/model/props/puzzle/state/CatchUpMoveProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts +14 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-9 → props/puzzle/state}/CurrentLeavesSimplified.d.ts +3 -3
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-10 → props/puzzle/state}/CurrentTransformationProp.d.ts +4 -4
- package/dist/types/twisty/model/props/puzzle/state/CurrentTransformationProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorProp.d.ts +17 -0
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/puzzle/state}/IndexerConstructorRequestProp.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorRequestProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/IndexerProp.d.ts +15 -0
- package/dist/types/twisty/model/props/puzzle/state/IndexerProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/LegacyPositionProp.d.ts +12 -0
- package/dist/types/twisty/model/props/puzzle/state/LegacyPositionProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-3 → props/puzzle/state}/PuzzleAlgProp.d.ts +3 -3
- package/dist/types/twisty/model/props/puzzle/state/PuzzleAlgProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/SetupAnchorProp.d.ts +6 -0
- package/dist/types/twisty/model/props/puzzle/state/SetupAnchorProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleDefProp.d.ts +11 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleDefProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleDescriptionProp.d.ts +6 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleDescriptionProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDProp.d.ts +11 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.d.ts +6 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleLoaderProp.d.ts +13 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleLoaderProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-8 → props/timeline}/CoarseTimelineInfoProp.d.ts +3 -3
- package/dist/types/twisty/model/props/timeline/CoarseTimelineInfoProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-7 → props/timeline}/DetailedTimelineInfoProp.d.ts +4 -4
- package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/timeline}/PlayingInfoProp.d.ts +1 -1
- package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/timeline}/TempoScaleProp.d.ts +0 -0
- package/dist/types/twisty/model/props/timeline/TempoScaleProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/timeline}/TimestampRequestProp.d.ts +1 -1
- package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/viewer}/BackViewProp.d.ts +1 -1
- package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/viewer}/BackgroundProp.d.ts +1 -1
- package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-9 → props/viewer}/ButtonAppearanceProp.d.ts +3 -3
- package/dist/types/twisty/model/props/viewer/ButtonAppearanceProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/viewer}/ControlPanelProp.d.ts +1 -1
- package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/viewer}/LatitudeLimit.d.ts +0 -0
- package/dist/types/twisty/model/props/viewer/LatitudeLimit.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-4 → props/viewer}/OrbitCoordinatesProp.d.ts +3 -3
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/viewer}/OrbitCoordinatesRequestProp.d.ts +0 -0
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-6 → props/viewer}/TimeRangeProp.d.ts +2 -2
- package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/viewer}/ViewerLinkProp.d.ts +1 -1
- package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-0 → props/viewer}/VisualizationProp.d.ts +1 -1
- package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts.map +1 -0
- package/dist/types/twisty/model/{depth-3 → props/viewer}/VisualizationStrategyProp.d.ts +2 -2
- package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts.map +1 -0
- package/dist/types/twisty/old/animation/indexer/AlgIndexer.d.ts.map +1 -1
- package/dist/types/twisty/old/dom/TwistyPlayer.css.d.ts.map +1 -1
- package/dist/types/twisty/old/dom/TwistyPlayerConfig.d.ts +2 -1
- package/dist/types/twisty/old/dom/TwistyPlayerConfig.d.ts.map +1 -1
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.d.ts +0 -1
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/RendererPool.d.ts +4 -0
- package/dist/types/twisty/views/3D/RendererPool.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts +1 -1
- package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts +2 -1
- package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts +5 -3
- package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts +1 -1
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyAlgEditor/model.d.ts +2 -2
- package/dist/types/twisty/views/TwistyAlgEditor/model.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyPlayer.d.ts +12 -7
- package/dist/types/twisty/views/TwistyPlayer.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts +8 -8
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts.map +1 -1
- 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/TwistyScrubberV2.d.ts +1 -1
- package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts.map +1 -1
- package/dist/types/vendor/three/examples/jsm/libs/stats.modified.module.d.ts +33 -0
- package/dist/types/vendor/three/examples/jsm/libs/stats.modified.module.d.ts.map +1 -0
- package/docs/.DS_Store +0 -0
- package/docs/cubing/.DS_Store +0 -0
- package/docs/cubing/scramble/index.html +35 -19
- package/package.json +5 -5
- package/src/cubing/.DS_Store +0 -0
- package/src/cubing/bluetooth/connect/index.ts +1 -1
- package/src/cubing/bluetooth/smart-puzzle/bluetooth-puzzle.ts +1 -1
- package/src/cubing/cubing.bundle-global.ts +5 -1
- package/src/cubing/puzzle-geometry/PermOriSet.ts +1 -1
- package/src/cubing/puzzles/PuzzleLoader.ts +1 -1
- package/src/cubing/puzzles/implementations/fto/index.ts +19 -11
- package/src/cubing/puzzles/index.ts +25 -18
- package/src/cubing/puzzles/stickerings/fto-stickerings.ts +9 -0
- package/src/cubing/search/inside/api.spec.ts +1 -0
- package/src/cubing/search/inside/api.ts +1 -0
- package/src/cubing/search/worker-inside-generated-string.js +1 -1
- package/src/cubing/twisty/.DS_Store +0 -0
- package/src/cubing/twisty/controllers/TwistyAnimationController.ts +80 -3
- package/src/cubing/twisty/index.ts +2 -2
- package/src/cubing/twisty/model/TwistyPlayerModel.ts +52 -41
- package/src/cubing/twisty/model/UserVisibleErrorTracker.ts +22 -0
- package/src/cubing/twisty/model/{TwistyProp.spec.ts → props/TwistyProp.spec.ts} +0 -0
- package/src/cubing/twisty/model/{TwistyProp.ts → props/TwistyProp.ts} +17 -9
- package/src/cubing/twisty/model/{TwistyPropDebugger.ts → props/TwistyPropDebugger.ts} +7 -7
- package/src/cubing/twisty/model/{depth-0 → props/general}/URLProp.ts +0 -0
- package/src/cubing/twisty/model/{depth-0 → props/puzzle/display}/HintFaceletProp.ts +2 -2
- package/src/cubing/twisty/model/{depth-1 → props/puzzle/display}/SpriteProp.ts +2 -2
- package/src/cubing/twisty/model/{depth-0 → props/puzzle/display}/StickeringProp.ts +2 -2
- package/src/cubing/twisty/model/{depth-0 → props/puzzle/state}/AlgProp.ts +3 -3
- package/src/cubing/twisty/model/{depth-4 → props/puzzle/state}/AlgTransformationProp.ts +6 -6
- package/src/cubing/twisty/model/{depth-6 → props/puzzle/state}/AnchoredStartProp.ts +4 -4
- package/src/cubing/twisty/model/props/puzzle/state/CatchUpMoveProp.ts +17 -0
- package/src/cubing/twisty/model/{depth-8 → props/puzzle/state}/CurrentLeavesProp.ts +27 -9
- package/src/cubing/twisty/model/{depth-9 → props/puzzle/state}/CurrentLeavesSimplified.ts +4 -4
- package/src/cubing/twisty/model/{depth-10 → props/puzzle/state}/CurrentTransformationProp.ts +5 -5
- package/src/cubing/twisty/model/{depth-4 → props/puzzle/state}/IndexerConstructorProp.ts +10 -10
- package/src/cubing/twisty/model/{depth-0 → props/puzzle/state}/IndexerConstructorRequestProp.ts +1 -1
- package/src/cubing/twisty/model/{depth-5 → props/puzzle/state}/IndexerProp.ts +6 -6
- package/src/cubing/twisty/model/{depth-11 → props/puzzle/state}/LegacyPositionProp.ts +4 -4
- package/src/cubing/twisty/model/{depth-3 → props/puzzle/state}/PuzzleAlgProp.ts +4 -4
- package/src/cubing/twisty/model/{depth-0 → props/puzzle/state}/SetupAnchorProp.ts +2 -2
- package/src/cubing/twisty/model/{depth-2 → props/puzzle/structure}/PuzzleDefProp.ts +3 -3
- package/src/cubing/twisty/model/{depth-0 → props/puzzle/structure}/PuzzleDescriptionProp.ts +6 -2
- package/src/cubing/twisty/model/{depth-2 → props/puzzle/structure}/PuzzleIDProp.ts +3 -3
- package/src/cubing/twisty/model/{depth-0 → props/puzzle/structure}/PuzzleIDRequestProp.ts +6 -2
- package/src/cubing/twisty/model/{depth-1 → props/puzzle/structure}/PuzzleLoaderProp.ts +11 -5
- package/src/cubing/twisty/model/{depth-8 → props/timeline}/CoarseTimelineInfoProp.ts +3 -3
- package/src/cubing/twisty/model/{depth-7 → props/timeline}/DetailedTimelineInfoProp.ts +4 -4
- package/src/cubing/twisty/model/{depth-0 → props/timeline}/PlayingInfoProp.ts +1 -1
- package/src/cubing/twisty/model/{depth-0 → props/timeline}/TempoScaleProp.ts +0 -0
- package/src/cubing/twisty/model/{depth-0 → props/timeline}/TimestampRequestProp.ts +1 -1
- package/src/cubing/twisty/model/{depth-0 → props/viewer}/BackViewProp.ts +1 -1
- package/src/cubing/twisty/model/{depth-0 → props/viewer}/BackgroundProp.ts +1 -1
- package/src/cubing/twisty/model/{depth-9 → props/viewer}/ButtonAppearanceProp.ts +4 -4
- package/src/cubing/twisty/model/{depth-0 → props/viewer}/ControlPanelProp.ts +1 -1
- package/src/cubing/twisty/model/{depth-0 → props/viewer}/LatitudeLimit.ts +0 -0
- package/src/cubing/twisty/model/{depth-4 → props/viewer}/OrbitCoordinatesProp.ts +3 -3
- package/src/cubing/twisty/model/{depth-0 → props/viewer}/OrbitCoordinatesRequestProp.ts +1 -1
- package/src/cubing/twisty/model/{depth-6 → props/viewer}/TimeRangeProp.ts +2 -2
- package/src/cubing/twisty/model/{depth-0 → props/viewer}/ViewerLinkProp.ts +1 -1
- package/src/cubing/twisty/model/{depth-0 → props/viewer}/VisualizationProp.ts +1 -1
- package/src/cubing/twisty/model/{depth-3 → props/viewer}/VisualizationStrategyProp.ts +2 -2
- package/src/cubing/twisty/old/animation/indexer/AlgIndexer.ts +1 -0
- package/src/cubing/twisty/old/dom/TwistyPlayer.css.ts +20 -0
- package/src/cubing/twisty/old/dom/TwistyPlayerConfig.ts +2 -1
- package/src/cubing/twisty/old/dom/viewers/Twisty3DCanvas.ts +3 -10
- package/src/cubing/twisty/{old → views}/.DS_Store +0 -0
- package/src/cubing/twisty/views/2D/Twisty2DPuzzle.ts +2 -2
- package/src/cubing/twisty/views/2D/Twisty2DPuzzleWrapper.ts +1 -1
- package/src/cubing/twisty/views/2D/Twisty2DSceneWrapper.ts +1 -1
- package/src/cubing/{search/inside → twisty/views/3D}/.DS_Store +0 -0
- package/src/cubing/twisty/views/3D/RendererPool.ts +53 -0
- package/src/cubing/twisty/views/3D/Twisty3DPuzzleWrapper.ts +9 -8
- package/src/cubing/twisty/views/3D/Twisty3DSceneWrapper.ts +7 -3
- package/src/cubing/twisty/views/3D/Twisty3DVantage.ts +69 -33
- package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.spec.ts +7 -7
- package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.ts +1 -1
- package/src/cubing/twisty/views/TwistyAlgEditor/TwistyAlgEditor.ts +6 -2
- package/src/cubing/twisty/views/TwistyAlgEditor/model.ts +2 -2
- package/src/cubing/twisty/views/TwistyAlgViewer.ts +2 -2
- package/src/cubing/twisty/views/TwistyPlayer.ts +67 -11
- package/src/cubing/twisty/views/TwistyPlayerSettable.ts +8 -8
- package/src/cubing/twisty/views/control-panel/TwistyButtonsV2.ts +1 -1
- package/src/cubing/twisty/views/control-panel/TwistyScrubberV2.ts +1 -1
- package/src/cubing/vendor/three/examples/jsm/libs/stats.modified.module.ts +179 -0
- package/dist/esm/chunk-6BXLPCNQ.js.map +0 -7
- package/dist/esm/worker-inside-generated-string-DOHINKQX.js.map +0 -7
- package/dist/types/twisty/model/TwistyProp.d.ts.map +0 -1
- package/dist/types/twisty/model/TwistyProp.spec.d.ts.map +0 -1
- package/dist/types/twisty/model/TwistyPropDebugger.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/AlgProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/BackViewProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/BackgroundProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/ControlPanelProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/HintFaceletProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/IndexerConstructorRequestProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/LatitudeLimit.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/OrbitCoordinatesRequestProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/PlayingInfoProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/PuzzleDescriptionProp.d.ts +0 -6
- package/dist/types/twisty/model/depth-0/PuzzleDescriptionProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/PuzzleIDRequestProp.d.ts +0 -6
- package/dist/types/twisty/model/depth-0/PuzzleIDRequestProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/SetupAnchorProp.d.ts +0 -6
- package/dist/types/twisty/model/depth-0/SetupAnchorProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/StickeringProp.d.ts +0 -6
- package/dist/types/twisty/model/depth-0/StickeringProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/TempoScaleProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/TimestampRequestProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/URLProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/ViewerLinkProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-0/VisualizationProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-1/PuzzleLoaderProp.d.ts +0 -13
- package/dist/types/twisty/model/depth-1/PuzzleLoaderProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-1/SpriteProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-10/CurrentTransformationProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-11/LegacyPositionProp.d.ts +0 -12
- package/dist/types/twisty/model/depth-11/LegacyPositionProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-2/PuzzleDefProp.d.ts +0 -11
- package/dist/types/twisty/model/depth-2/PuzzleDefProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-2/PuzzleIDProp.d.ts +0 -11
- package/dist/types/twisty/model/depth-2/PuzzleIDProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-3/PuzzleAlgProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-3/VisualizationStrategyProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-4/AlgTransformationProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-4/IndexerConstructorProp.d.ts +0 -17
- package/dist/types/twisty/model/depth-4/IndexerConstructorProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-4/OrbitCoordinatesProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-5/IndexerProp.d.ts +0 -15
- package/dist/types/twisty/model/depth-5/IndexerProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-6/AnchoredStartProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-6/TimeRangeProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-7/DetailedTimelineInfoProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-8/CoarseTimelineInfoProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-8/CurrentLeavesProp.d.ts +0 -12
- package/dist/types/twisty/model/depth-8/CurrentLeavesProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-9/ButtonAppearanceProp.d.ts.map +0 -1
- package/dist/types/twisty/model/depth-9/CurrentLeavesSimplified.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/dist/types/vendor/three/examples/jsm/libs/stats.module.d.ts +0 -21
- package/dist/types/vendor/three/examples/jsm/libs/stats.module.d.ts.map +0 -1
- package/src/cubing/alg/.DS_Store +0 -0
- package/src/cubing/bluetooth/.DS_Store +0 -0
- package/src/cubing/kpuzzle/.DS_Store +0 -0
- package/src/cubing/puzzles/.DS_Store +0 -0
- package/src/cubing/search/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/src/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/.DS_Store +0 -0
- package/src/cubing/stream/.DS_Store +0 -0
- package/src/cubing/twisty/old/dom/.DS_Store +0 -0
- package/src/cubing/twisty/views/3D/puzzles/TwistyTestBox.ts +0 -22
- package/src/cubing/vendor/.DS_Store +0 -0
- package/src/cubing/vendor/three/examples/jsm/libs/stats.module.d.ts +0 -24
- package/src/cubing/vendor/three/examples/jsm/libs/stats.module.js +0 -179
package/dist/esm/twisty/index.js
CHANGED
|
@@ -15,13 +15,12 @@ import {
|
|
|
15
15
|
controlsLocations,
|
|
16
16
|
customElementsShim,
|
|
17
17
|
defaultCameraOrbitCoordinates,
|
|
18
|
-
experimentalSetShareAllNewRenderers,
|
|
19
18
|
experimentalShowRenderStats,
|
|
20
19
|
pixelRatio,
|
|
21
20
|
pyraminxLookAt,
|
|
22
21
|
twisty3DCanvasCSS,
|
|
23
22
|
twistyViewerWrapperCSS
|
|
24
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-APIIMJG6.js";
|
|
25
24
|
import {
|
|
26
25
|
countAnimatedLeaves,
|
|
27
26
|
countMoves
|
|
@@ -31,7 +30,7 @@ import {
|
|
|
31
30
|
cubeAppearance,
|
|
32
31
|
customPGPuzzleLoader,
|
|
33
32
|
puzzles
|
|
34
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-MUQMBH2S.js";
|
|
35
34
|
import {
|
|
36
35
|
KPuzzle,
|
|
37
36
|
KPuzzleSVGWrapper,
|
|
@@ -162,6 +161,54 @@ function modIntoRange(v, rangeMin, rangeMax) {
|
|
|
162
161
|
}
|
|
163
162
|
|
|
164
163
|
// src/cubing/twisty/controllers/TwistyAnimationController.ts
|
|
164
|
+
var CatchUpHelper = class {
|
|
165
|
+
constructor(model) {
|
|
166
|
+
this.model = model;
|
|
167
|
+
this.catchingUp = false;
|
|
168
|
+
this.pendingFrame = false;
|
|
169
|
+
this.scheduler = new RenderScheduler(this.animFrame.bind(this));
|
|
170
|
+
this.catchUpMs = 500;
|
|
171
|
+
this.lastTimestamp = 0;
|
|
172
|
+
}
|
|
173
|
+
start() {
|
|
174
|
+
if (!this.catchingUp) {
|
|
175
|
+
this.lastTimestamp = performance.now();
|
|
176
|
+
}
|
|
177
|
+
this.catchingUp = true;
|
|
178
|
+
this.pendingFrame = true;
|
|
179
|
+
this.scheduler.requestAnimFrame();
|
|
180
|
+
}
|
|
181
|
+
stop() {
|
|
182
|
+
this.catchingUp = false;
|
|
183
|
+
this.scheduler.cancelAnimFrame();
|
|
184
|
+
}
|
|
185
|
+
animFrame(timestamp) {
|
|
186
|
+
this.scheduler.requestAnimFrame();
|
|
187
|
+
const delta = (timestamp - this.lastTimestamp) / this.catchUpMs;
|
|
188
|
+
this.lastTimestamp = timestamp;
|
|
189
|
+
this.model.catchUpMoveProp.set((async () => {
|
|
190
|
+
const previousCatchUpMove = await this.model.catchUpMoveProp.get();
|
|
191
|
+
if (previousCatchUpMove.move === null) {
|
|
192
|
+
return previousCatchUpMove;
|
|
193
|
+
}
|
|
194
|
+
const amount = previousCatchUpMove.amount + delta;
|
|
195
|
+
if (amount >= 1) {
|
|
196
|
+
this.pendingFrame = true;
|
|
197
|
+
this.stop();
|
|
198
|
+
this.model.timestampRequestProp.set("end");
|
|
199
|
+
return {
|
|
200
|
+
move: null,
|
|
201
|
+
amount: 0
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
this.pendingFrame = false;
|
|
205
|
+
return {
|
|
206
|
+
move: previousCatchUpMove.move,
|
|
207
|
+
amount
|
|
208
|
+
};
|
|
209
|
+
})());
|
|
210
|
+
}
|
|
211
|
+
};
|
|
165
212
|
var _effectiveTimestampMilliseconds, effectiveTimestampMilliseconds_fn, _animFrameEffectiveTimestampStaleDropper;
|
|
166
213
|
var TwistyAnimationController = class {
|
|
167
214
|
constructor(model, delegate) {
|
|
@@ -175,12 +222,21 @@ var TwistyAnimationController = class {
|
|
|
175
222
|
this.model = model;
|
|
176
223
|
this.lastTimestampPromise = __privateMethod(this, _effectiveTimestampMilliseconds, effectiveTimestampMilliseconds_fn).call(this);
|
|
177
224
|
this.model.playingInfoProp.addFreshListener(this.onPlayingProp.bind(this));
|
|
225
|
+
this.catchUpHelper = new CatchUpHelper(this.model);
|
|
226
|
+
this.model.catchUpMoveProp.addFreshListener(this.onCatchUpMoveProp.bind(this));
|
|
178
227
|
}
|
|
179
228
|
async onPlayingProp(playingInfo) {
|
|
180
229
|
if (playingInfo.playing !== this.playing) {
|
|
181
230
|
playingInfo.playing ? this.play(playingInfo) : this.pause();
|
|
182
231
|
}
|
|
183
232
|
}
|
|
233
|
+
async onCatchUpMoveProp(catchUpMove) {
|
|
234
|
+
const catchingUp = catchUpMove.move !== null;
|
|
235
|
+
if (catchingUp !== this.catchUpHelper.catchingUp) {
|
|
236
|
+
catchingUp ? this.catchUpHelper.start() : this.catchUpHelper.stop();
|
|
237
|
+
}
|
|
238
|
+
this.scheduler.requestAnimFrame();
|
|
239
|
+
}
|
|
184
240
|
jumpToStart(options) {
|
|
185
241
|
this.model.timestampRequestProp.set("start");
|
|
186
242
|
this.pause();
|
|
@@ -247,7 +303,7 @@ var TwistyAnimationController = class {
|
|
|
247
303
|
this.model.currentLeavesProp.get()
|
|
248
304
|
]));
|
|
249
305
|
const [playingInfo, lastTimestamp, timeRange, tempoScale, currentMoveInfo] = freshenerResult;
|
|
250
|
-
if (playingInfo.playing
|
|
306
|
+
if (!playingInfo.playing) {
|
|
251
307
|
this.playing = false;
|
|
252
308
|
return;
|
|
253
309
|
}
|
|
@@ -377,6 +433,26 @@ twisty-scrubber {
|
|
|
377
433
|
width: 100%;
|
|
378
434
|
height: 100%;
|
|
379
435
|
}
|
|
436
|
+
|
|
437
|
+
.error-elem {
|
|
438
|
+
width: 100%;
|
|
439
|
+
height: 100%;
|
|
440
|
+
display: none;
|
|
441
|
+
place-content: center;
|
|
442
|
+
font-family: sans-serif;
|
|
443
|
+
box-shadow: inset 0 0 2em rgb(255, 0, 0);
|
|
444
|
+
color: red;
|
|
445
|
+
text-shadow: 0 0 0.2em white;
|
|
446
|
+
background: rgba(255, 255, 255, 0.25);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.wrapper.error .visualization-wrapper {
|
|
450
|
+
display: none;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.wrapper.error .error-elem {
|
|
454
|
+
display: grid;
|
|
455
|
+
}
|
|
380
456
|
`);
|
|
381
457
|
|
|
382
458
|
// src/cubing/vendor/p-lazy/p-lazy.ts
|
|
@@ -420,11 +496,11 @@ function from(function_) {
|
|
|
420
496
|
// src/cubing/twisty/heavy-code-imports/3d.ts
|
|
421
497
|
var cachedConstructorProxy = null;
|
|
422
498
|
async function proxy3D() {
|
|
423
|
-
return cachedConstructorProxy ?? (cachedConstructorProxy = import("../3d-
|
|
499
|
+
return cachedConstructorProxy ?? (cachedConstructorProxy = import("../3d-B25DP5PE.js"));
|
|
424
500
|
}
|
|
425
501
|
var THREEJS = from(async () => (await proxy3D()).T3I);
|
|
426
502
|
|
|
427
|
-
// src/cubing/twisty/model/TwistyProp.ts
|
|
503
|
+
// src/cubing/twisty/model/props/TwistyProp.ts
|
|
428
504
|
var globalSourceGeneration = 0;
|
|
429
505
|
var _children, _rawListeners, _scheduleRawDispatch, scheduleRawDispatch_fn, _rawDispatchPending, _dispatchRawListeners, dispatchRawListeners_fn, _freshListeners;
|
|
430
506
|
var TwistyPropParent = class {
|
|
@@ -551,8 +627,9 @@ var SimpleTwistyPropSource = class extends TwistyPropSource {
|
|
|
551
627
|
var NO_VALUE = Symbol("no value");
|
|
552
628
|
var _parents, _cachedLastSuccessfulCalculation, _cachedLatestGenerationCalculation, _getParents, getParents_fn, _cacheDerive, cacheDerive_fn;
|
|
553
629
|
var TwistyPropDerived = class extends TwistyPropParent {
|
|
554
|
-
constructor(parents) {
|
|
630
|
+
constructor(parents, userVisibleErrorTracker) {
|
|
555
631
|
super();
|
|
632
|
+
this.userVisibleErrorTracker = userVisibleErrorTracker;
|
|
556
633
|
__privateAdd(this, _getParents);
|
|
557
634
|
__privateAdd(this, _cacheDerive);
|
|
558
635
|
__privateAdd(this, _parents, void 0);
|
|
@@ -573,6 +650,7 @@ var TwistyPropDerived = class extends TwistyPropParent {
|
|
|
573
650
|
output: __privateMethod(this, _cacheDerive, cacheDerive_fn).call(this, __privateMethod(this, _getParents, getParents_fn).call(this), generation, __privateGet(this, _cachedLastSuccessfulCalculation))
|
|
574
651
|
};
|
|
575
652
|
__privateSet(this, _cachedLatestGenerationCalculation, latestGenerationCalculation);
|
|
653
|
+
this.userVisibleErrorTracker?.reset();
|
|
576
654
|
return latestGenerationCalculation.output;
|
|
577
655
|
}
|
|
578
656
|
};
|
|
@@ -623,7 +701,6 @@ var FreshListenerManager = class {
|
|
|
623
701
|
let disconnected = false;
|
|
624
702
|
const wrappedListener = (value) => {
|
|
625
703
|
if (disconnected) {
|
|
626
|
-
console.warn("Should be disconnected!");
|
|
627
704
|
return;
|
|
628
705
|
}
|
|
629
706
|
listener(value);
|
|
@@ -638,10 +715,10 @@ var FreshListenerManager = class {
|
|
|
638
715
|
let disconnected = false;
|
|
639
716
|
const wrappedListener = async (_) => {
|
|
640
717
|
if (disconnected) {
|
|
641
|
-
console.warn("Should be disconnected!");
|
|
642
718
|
return;
|
|
643
719
|
}
|
|
644
|
-
const
|
|
720
|
+
const promises = props.map((prop) => prop.get());
|
|
721
|
+
const values = await Promise.all(promises);
|
|
645
722
|
listener(values);
|
|
646
723
|
};
|
|
647
724
|
for (const prop of props) {
|
|
@@ -731,7 +808,7 @@ var Twisty2DPuzzle = class extends ManagedCustomElement {
|
|
|
731
808
|
__privateSet(this, _cachedPosition, position);
|
|
732
809
|
}
|
|
733
810
|
} catch (e) {
|
|
734
|
-
console.warn("Bad position. Pre-emptively disconnecting:", this.puzzleLoader?.id, e);
|
|
811
|
+
console.warn("Bad position (this doesn't necessarily mean something is wrong). Pre-emptively disconnecting:", this.puzzleLoader?.id, e);
|
|
735
812
|
this.disconnect();
|
|
736
813
|
}
|
|
737
814
|
}
|
|
@@ -866,7 +943,6 @@ var Twisty3DPuzzleWrapper = class {
|
|
|
866
943
|
(await this.twisty3DPuzzle()).onPositionChange(position);
|
|
867
944
|
this.scheduleRender();
|
|
868
945
|
} catch (e) {
|
|
869
|
-
console.warn("Bad position. Pre-emptively disconnecting:", this.puzzleLoader.id, e);
|
|
870
946
|
this.disconnect();
|
|
871
947
|
}
|
|
872
948
|
});
|
|
@@ -943,6 +1019,32 @@ var Twisty3DPuzzleWrapper = class {
|
|
|
943
1019
|
_freshListenerManager4 = new WeakMap();
|
|
944
1020
|
_cachedTwisty3DPuzzle = new WeakMap();
|
|
945
1021
|
|
|
1022
|
+
// src/cubing/twisty/views/3D/RendererPool.ts
|
|
1023
|
+
var renderers = [];
|
|
1024
|
+
async function renderPooled(width, height, canvas, scene, camera) {
|
|
1025
|
+
if (width === 0 || height === 0) {
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
if (renderers.length === 0) {
|
|
1029
|
+
renderers.push(newRenderer());
|
|
1030
|
+
}
|
|
1031
|
+
const renderer = await renderers[0];
|
|
1032
|
+
renderer.setSize(width, height);
|
|
1033
|
+
renderer.render(scene, camera);
|
|
1034
|
+
const context = canvas.getContext("2d");
|
|
1035
|
+
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
1036
|
+
context.drawImage(renderer.domElement, 0, 0);
|
|
1037
|
+
}
|
|
1038
|
+
async function newRenderer() {
|
|
1039
|
+
const rendererConstructor = (await THREEJS).WebGLRenderer;
|
|
1040
|
+
const renderer = new rendererConstructor({
|
|
1041
|
+
antialias: true,
|
|
1042
|
+
alpha: true
|
|
1043
|
+
});
|
|
1044
|
+
renderer.setPixelRatio(pixelRatio());
|
|
1045
|
+
return renderer;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
946
1048
|
// src/cubing/twisty/views/3D/TwistyOrbitControlsV2.ts
|
|
947
1049
|
import { Spherical } from "three";
|
|
948
1050
|
var INERTIA_DEFAULT = true;
|
|
@@ -1114,7 +1216,27 @@ async function setCameraFromOrbitCoordinates(camera, orbitCoordinates, backView
|
|
|
1114
1216
|
camera.position.setFromSpherical(spherical);
|
|
1115
1217
|
camera.lookAt(0, 0, 0);
|
|
1116
1218
|
}
|
|
1117
|
-
var
|
|
1219
|
+
var shareAllNewRenderers = null;
|
|
1220
|
+
function experimentalForceNewRendererSharing(share) {
|
|
1221
|
+
shareAllNewRenderers = share;
|
|
1222
|
+
}
|
|
1223
|
+
var dedicatedRenderersSoFar = 0;
|
|
1224
|
+
var DEFAULT_MAX_DEDICATED_RENDERERS = 2;
|
|
1225
|
+
function shareRenderer() {
|
|
1226
|
+
if (shareAllNewRenderers !== null) {
|
|
1227
|
+
if (!shareAllNewRenderers) {
|
|
1228
|
+
dedicatedRenderersSoFar++;
|
|
1229
|
+
}
|
|
1230
|
+
return shareAllNewRenderers;
|
|
1231
|
+
}
|
|
1232
|
+
if (dedicatedRenderersSoFar < DEFAULT_MAX_DEDICATED_RENDERERS) {
|
|
1233
|
+
dedicatedRenderersSoFar++;
|
|
1234
|
+
return false;
|
|
1235
|
+
} else {
|
|
1236
|
+
return true;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
var _onResizeStaleDropper, _width, _height, _onResize, onResize_fn, _cachedRenderer, _cachedCanvas, _cachedCamera, _cachedOrbitControls, _disconnectionFunctions2, _scheduler;
|
|
1118
1240
|
var Twisty3DVantage = class extends ManagedCustomElement {
|
|
1119
1241
|
constructor(model, scene, options) {
|
|
1120
1242
|
super();
|
|
@@ -1123,7 +1245,10 @@ var Twisty3DVantage = class extends ManagedCustomElement {
|
|
|
1123
1245
|
__privateAdd(this, _onResize);
|
|
1124
1246
|
this.scene = null;
|
|
1125
1247
|
this.stats = null;
|
|
1248
|
+
this.rendererIsShared = shareRenderer();
|
|
1126
1249
|
__privateAdd(this, _onResizeStaleDropper, new StaleDropper());
|
|
1250
|
+
__privateAdd(this, _width, 0);
|
|
1251
|
+
__privateAdd(this, _height, 0);
|
|
1127
1252
|
__privateAdd(this, _cachedRenderer, null);
|
|
1128
1253
|
__privateAdd(this, _cachedCanvas, null);
|
|
1129
1254
|
__privateAdd(this, _cachedCamera, null);
|
|
@@ -1132,7 +1257,7 @@ var Twisty3DVantage = class extends ManagedCustomElement {
|
|
|
1132
1257
|
__privateAdd(this, _scheduler, new RenderScheduler(this.render.bind(this)));
|
|
1133
1258
|
this.scene = scene ?? null;
|
|
1134
1259
|
if (SHOW_STATS) {
|
|
1135
|
-
this.stats = Stats();
|
|
1260
|
+
this.stats = new Stats();
|
|
1136
1261
|
this.stats.dom.style.position = "absolute";
|
|
1137
1262
|
this.contentWrapper.appendChild(this.stats.dom);
|
|
1138
1263
|
}
|
|
@@ -1147,19 +1272,18 @@ var Twisty3DVantage = class extends ManagedCustomElement {
|
|
|
1147
1272
|
this.scheduleRender();
|
|
1148
1273
|
}
|
|
1149
1274
|
async renderer() {
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
alpha: true
|
|
1155
|
-
});
|
|
1156
|
-
renderer.setPixelRatio(pixelRatio());
|
|
1157
|
-
return renderer;
|
|
1158
|
-
})());
|
|
1275
|
+
if (this.rendererIsShared) {
|
|
1276
|
+
throw new Error("renderer expected to be shared.");
|
|
1277
|
+
}
|
|
1278
|
+
return __privateGet(this, _cachedRenderer) ?? __privateSet(this, _cachedRenderer, newRenderer());
|
|
1159
1279
|
}
|
|
1160
1280
|
async canvas() {
|
|
1161
1281
|
return __privateGet(this, _cachedCanvas) ?? __privateSet(this, _cachedCanvas, (async () => {
|
|
1162
|
-
|
|
1282
|
+
if (this.rendererIsShared) {
|
|
1283
|
+
return this.addElement(document.createElement("canvas"));
|
|
1284
|
+
}
|
|
1285
|
+
const renderer = await this.renderer();
|
|
1286
|
+
return this.addElement(renderer.domElement);
|
|
1163
1287
|
})());
|
|
1164
1288
|
}
|
|
1165
1289
|
async camera() {
|
|
@@ -1200,12 +1324,16 @@ var Twisty3DVantage = class extends ManagedCustomElement {
|
|
|
1200
1324
|
throw new Error("Attempted to render without a scene");
|
|
1201
1325
|
}
|
|
1202
1326
|
this.stats?.begin();
|
|
1203
|
-
const [
|
|
1204
|
-
this.renderer(),
|
|
1327
|
+
const [scene, camera, canvas] = await Promise.all([
|
|
1205
1328
|
this.scene.scene(),
|
|
1206
|
-
this.camera()
|
|
1329
|
+
this.camera(),
|
|
1330
|
+
this.canvas()
|
|
1207
1331
|
]);
|
|
1208
|
-
|
|
1332
|
+
if (this.rendererIsShared) {
|
|
1333
|
+
renderPooled(__privateGet(this, _width), __privateGet(this, _height), canvas, scene, camera);
|
|
1334
|
+
} else {
|
|
1335
|
+
(await this.renderer()).render(scene, camera);
|
|
1336
|
+
}
|
|
1209
1337
|
this.stats?.end();
|
|
1210
1338
|
}
|
|
1211
1339
|
scheduleRender() {
|
|
@@ -1213,11 +1341,15 @@ var Twisty3DVantage = class extends ManagedCustomElement {
|
|
|
1213
1341
|
}
|
|
1214
1342
|
};
|
|
1215
1343
|
_onResizeStaleDropper = new WeakMap();
|
|
1344
|
+
_width = new WeakMap();
|
|
1345
|
+
_height = new WeakMap();
|
|
1216
1346
|
_onResize = new WeakSet();
|
|
1217
1347
|
onResize_fn = async function() {
|
|
1218
|
-
const
|
|
1348
|
+
const camera = await __privateGet(this, _onResizeStaleDropper).queue(this.camera());
|
|
1219
1349
|
const w = this.contentWrapper.clientWidth;
|
|
1220
1350
|
const h = this.contentWrapper.clientHeight;
|
|
1351
|
+
__privateSet(this, _width, w);
|
|
1352
|
+
__privateSet(this, _height, h);
|
|
1221
1353
|
const off = 0;
|
|
1222
1354
|
let yoff = 0;
|
|
1223
1355
|
let excess = 0;
|
|
@@ -1228,8 +1360,15 @@ onResize_fn = async function() {
|
|
|
1228
1360
|
camera.aspect = w / h;
|
|
1229
1361
|
camera.setViewOffset(w, h - excess, off, yoff, w, h);
|
|
1230
1362
|
camera.updateProjectionMatrix();
|
|
1231
|
-
|
|
1232
|
-
|
|
1363
|
+
if (this.rendererIsShared) {
|
|
1364
|
+
const canvas = await this.canvas();
|
|
1365
|
+
canvas.width = w * pixelRatio();
|
|
1366
|
+
canvas.height = h * pixelRatio();
|
|
1367
|
+
canvas.style.width = w.toString();
|
|
1368
|
+
canvas.style.height = w.toString();
|
|
1369
|
+
} else {
|
|
1370
|
+
(await this.renderer()).setSize(w, h, true);
|
|
1371
|
+
}
|
|
1233
1372
|
this.scheduleRender();
|
|
1234
1373
|
};
|
|
1235
1374
|
_cachedRenderer = new WeakMap();
|
|
@@ -1307,6 +1446,9 @@ var Twisty3DSceneWrapper = class extends ManagedCustomElement {
|
|
|
1307
1446
|
vantage.disconnect();
|
|
1308
1447
|
__privateGet(this, _currentTwisty3DPuzzleWrapper)?.disconnect();
|
|
1309
1448
|
}
|
|
1449
|
+
experimentalVantages() {
|
|
1450
|
+
return __privateGet(this, _vantages).values();
|
|
1451
|
+
}
|
|
1310
1452
|
scheduleRender() {
|
|
1311
1453
|
for (const vantage of __privateGet(this, _vantages)) {
|
|
1312
1454
|
vantage.scheduleRender();
|
|
@@ -1487,7 +1629,7 @@ function requestFullscreen(element) {
|
|
|
1487
1629
|
}
|
|
1488
1630
|
}
|
|
1489
1631
|
|
|
1490
|
-
// src/cubing/twisty/model/
|
|
1632
|
+
// src/cubing/twisty/model/props/viewer/ButtonAppearanceProp.ts
|
|
1491
1633
|
var buttonIcons = [
|
|
1492
1634
|
"skip-to-start",
|
|
1493
1635
|
"skip-to-end",
|
|
@@ -1849,7 +1991,7 @@ function downloadURL(url, name, extension = "png") {
|
|
|
1849
1991
|
a.click();
|
|
1850
1992
|
}
|
|
1851
1993
|
|
|
1852
|
-
// src/cubing/twisty/model/
|
|
1994
|
+
// src/cubing/twisty/model/props/puzzle/state/AlgProp.ts
|
|
1853
1995
|
var AlgIssues = class {
|
|
1854
1996
|
constructor(issues) {
|
|
1855
1997
|
this.warnings = Object.freeze(issues?.warnings ?? []);
|
|
@@ -1914,42 +2056,42 @@ var AlgProp = class extends TwistyPropSource {
|
|
|
1914
2056
|
}
|
|
1915
2057
|
};
|
|
1916
2058
|
|
|
1917
|
-
// src/cubing/twisty/model/
|
|
2059
|
+
// src/cubing/twisty/model/props/viewer/BackgroundProp.ts
|
|
1918
2060
|
var BackgroundProp = class extends SimpleTwistyPropSource {
|
|
1919
2061
|
getDefaultValue() {
|
|
1920
2062
|
return "auto";
|
|
1921
2063
|
}
|
|
1922
2064
|
};
|
|
1923
2065
|
|
|
1924
|
-
// src/cubing/twisty/model/
|
|
2066
|
+
// src/cubing/twisty/model/props/viewer/BackViewProp.ts
|
|
1925
2067
|
var BackViewProp = class extends SimpleTwistyPropSource {
|
|
1926
2068
|
getDefaultValue() {
|
|
1927
2069
|
return "auto";
|
|
1928
2070
|
}
|
|
1929
2071
|
};
|
|
1930
2072
|
|
|
1931
|
-
// src/cubing/twisty/model/
|
|
2073
|
+
// src/cubing/twisty/model/props/viewer/ControlPanelProp.ts
|
|
1932
2074
|
var ControlPanelProp = class extends SimpleTwistyPropSource {
|
|
1933
2075
|
getDefaultValue() {
|
|
1934
2076
|
return "auto";
|
|
1935
2077
|
}
|
|
1936
2078
|
};
|
|
1937
2079
|
|
|
1938
|
-
// src/cubing/twisty/model/
|
|
2080
|
+
// src/cubing/twisty/model/props/puzzle/display/HintFaceletProp.ts
|
|
1939
2081
|
var HintFaceletProp = class extends SimpleTwistyPropSource {
|
|
1940
2082
|
getDefaultValue() {
|
|
1941
2083
|
return "auto";
|
|
1942
2084
|
}
|
|
1943
2085
|
};
|
|
1944
2086
|
|
|
1945
|
-
// src/cubing/twisty/model/
|
|
2087
|
+
// src/cubing/twisty/model/props/puzzle/state/IndexerConstructorRequestProp.ts
|
|
1946
2088
|
var IndexerConstructorRequestProp = class extends SimpleTwistyPropSource {
|
|
1947
2089
|
getDefaultValue() {
|
|
1948
2090
|
return "auto";
|
|
1949
2091
|
}
|
|
1950
2092
|
};
|
|
1951
2093
|
|
|
1952
|
-
// src/cubing/twisty/model/
|
|
2094
|
+
// src/cubing/twisty/model/props/viewer/LatitudeLimit.ts
|
|
1953
2095
|
var DEFAULT_LATITUDE_LIMIT = 35;
|
|
1954
2096
|
var LatitudeLimitProp = class extends SimpleTwistyPropSource {
|
|
1955
2097
|
getDefaultValue() {
|
|
@@ -1957,7 +2099,7 @@ var LatitudeLimitProp = class extends SimpleTwistyPropSource {
|
|
|
1957
2099
|
}
|
|
1958
2100
|
};
|
|
1959
2101
|
|
|
1960
|
-
// src/cubing/twisty/model/
|
|
2102
|
+
// src/cubing/twisty/model/props/viewer/OrbitCoordinatesRequestProp.ts
|
|
1961
2103
|
function orbitCoordinatesEqual(c1, c2) {
|
|
1962
2104
|
return c1.latitude === c2.latitude && c1.longitude === c2.longitude && c1.distance === c2.distance;
|
|
1963
2105
|
}
|
|
@@ -1988,7 +2130,7 @@ var OrbitCoordinatesRequestProp = class extends TwistyPropSource {
|
|
|
1988
2130
|
}
|
|
1989
2131
|
};
|
|
1990
2132
|
|
|
1991
|
-
// src/cubing/twisty/model/
|
|
2133
|
+
// src/cubing/twisty/model/props/timeline/PlayingInfoProp.ts
|
|
1992
2134
|
var PlayingInfoProp = class extends TwistyPropSource {
|
|
1993
2135
|
async getDefaultValue() {
|
|
1994
2136
|
return {
|
|
@@ -2009,25 +2151,31 @@ var PlayingInfoProp = class extends TwistyPropSource {
|
|
|
2009
2151
|
}
|
|
2010
2152
|
};
|
|
2011
2153
|
|
|
2012
|
-
// src/cubing/twisty/model/
|
|
2154
|
+
// src/cubing/twisty/model/props/puzzle/structure/PuzzleDescriptionProp.ts
|
|
2013
2155
|
var PGPuzzleDescriptionStringProp = class extends SimpleTwistyPropSource {
|
|
2014
2156
|
getDefaultValue() {
|
|
2015
2157
|
return NO_VALUE;
|
|
2016
2158
|
}
|
|
2017
2159
|
};
|
|
2018
2160
|
|
|
2019
|
-
// src/cubing/twisty/model/
|
|
2161
|
+
// src/cubing/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.ts
|
|
2020
2162
|
var PuzzleIDRequestProp = class extends SimpleTwistyPropSource {
|
|
2021
2163
|
getDefaultValue() {
|
|
2022
2164
|
return NO_VALUE;
|
|
2023
2165
|
}
|
|
2024
2166
|
};
|
|
2025
2167
|
|
|
2026
|
-
// src/cubing/twisty/model/
|
|
2168
|
+
// src/cubing/twisty/model/props/puzzle/structure/PuzzleLoaderProp.ts
|
|
2027
2169
|
var PuzzleLoaderProp = class extends TwistyPropDerived {
|
|
2028
2170
|
derive(inputs) {
|
|
2029
2171
|
if (inputs.puzzleIDRequest && inputs.puzzleIDRequest !== NO_VALUE) {
|
|
2030
|
-
|
|
2172
|
+
const puzzleLoader = puzzles[inputs.puzzleIDRequest];
|
|
2173
|
+
if (!puzzleLoader) {
|
|
2174
|
+
this.userVisibleErrorTracker.set({
|
|
2175
|
+
errors: [`Invalid puzzle ID: ${inputs.puzzleIDRequest}`]
|
|
2176
|
+
});
|
|
2177
|
+
}
|
|
2178
|
+
return puzzleLoader;
|
|
2031
2179
|
}
|
|
2032
2180
|
if (inputs.puzzleDescriptionRequest && inputs.puzzleDescriptionRequest !== NO_VALUE) {
|
|
2033
2181
|
return customPGPuzzleLoader(inputs.puzzleDescriptionRequest);
|
|
@@ -2036,21 +2184,21 @@ var PuzzleLoaderProp = class extends TwistyPropDerived {
|
|
|
2036
2184
|
}
|
|
2037
2185
|
};
|
|
2038
2186
|
|
|
2039
|
-
// src/cubing/twisty/model/
|
|
2187
|
+
// src/cubing/twisty/model/props/puzzle/state/SetupAnchorProp.ts
|
|
2040
2188
|
var SetupAnchorProp = class extends SimpleTwistyPropSource {
|
|
2041
2189
|
getDefaultValue() {
|
|
2042
2190
|
return "start";
|
|
2043
2191
|
}
|
|
2044
2192
|
};
|
|
2045
2193
|
|
|
2046
|
-
// src/cubing/twisty/model/
|
|
2194
|
+
// src/cubing/twisty/model/props/puzzle/display/StickeringProp.ts
|
|
2047
2195
|
var StickeringProp = class extends SimpleTwistyPropSource {
|
|
2048
2196
|
getDefaultValue() {
|
|
2049
2197
|
return "full";
|
|
2050
2198
|
}
|
|
2051
2199
|
};
|
|
2052
2200
|
|
|
2053
|
-
// src/cubing/twisty/model/
|
|
2201
|
+
// src/cubing/twisty/model/props/timeline/TempoScaleProp.ts
|
|
2054
2202
|
var TempoScaleProp = class extends TwistyPropSource {
|
|
2055
2203
|
getDefaultValue() {
|
|
2056
2204
|
return 1;
|
|
@@ -2060,7 +2208,7 @@ var TempoScaleProp = class extends TwistyPropSource {
|
|
|
2060
2208
|
}
|
|
2061
2209
|
};
|
|
2062
2210
|
|
|
2063
|
-
// src/cubing/twisty/model/
|
|
2211
|
+
// src/cubing/twisty/model/props/timeline/TimestampRequestProp.ts
|
|
2064
2212
|
var smartTimestamps = {
|
|
2065
2213
|
"start": true,
|
|
2066
2214
|
"end": true,
|
|
@@ -2088,7 +2236,7 @@ var TimestampRequestProp = class extends SimpleTwistyPropSource {
|
|
|
2088
2236
|
}
|
|
2089
2237
|
};
|
|
2090
2238
|
|
|
2091
|
-
// src/cubing/twisty/model/
|
|
2239
|
+
// src/cubing/twisty/model/props/general/URLProp.ts
|
|
2092
2240
|
var URLProp = class extends TwistyPropSource {
|
|
2093
2241
|
getDefaultValue() {
|
|
2094
2242
|
return null;
|
|
@@ -2101,21 +2249,21 @@ var URLProp = class extends TwistyPropSource {
|
|
|
2101
2249
|
}
|
|
2102
2250
|
};
|
|
2103
2251
|
|
|
2104
|
-
// src/cubing/twisty/model/
|
|
2252
|
+
// src/cubing/twisty/model/props/viewer/ViewerLinkProp.ts
|
|
2105
2253
|
var ViewerLinkProp = class extends SimpleTwistyPropSource {
|
|
2106
2254
|
getDefaultValue() {
|
|
2107
2255
|
return "auto";
|
|
2108
2256
|
}
|
|
2109
2257
|
};
|
|
2110
2258
|
|
|
2111
|
-
// src/cubing/twisty/model/
|
|
2259
|
+
// src/cubing/twisty/model/props/viewer/VisualizationProp.ts
|
|
2112
2260
|
var VisualizationFormatProp = class extends SimpleTwistyPropSource {
|
|
2113
2261
|
getDefaultValue() {
|
|
2114
2262
|
return "auto";
|
|
2115
2263
|
}
|
|
2116
2264
|
};
|
|
2117
2265
|
|
|
2118
|
-
// src/cubing/twisty/model/
|
|
2266
|
+
// src/cubing/twisty/model/props/viewer/OrbitCoordinatesProp.ts
|
|
2119
2267
|
var OrbitCoordinatesProp = class extends TwistyPropDerived {
|
|
2120
2268
|
canReuseValue(v1, v2) {
|
|
2121
2269
|
return orbitCoordinatesEqual(v1, v2);
|
|
@@ -2138,14 +2286,14 @@ var OrbitCoordinatesProp = class extends TwistyPropDerived {
|
|
|
2138
2286
|
}
|
|
2139
2287
|
};
|
|
2140
2288
|
|
|
2141
|
-
// src/cubing/twisty/model/
|
|
2289
|
+
// src/cubing/twisty/model/props/puzzle/structure/PuzzleIDProp.ts
|
|
2142
2290
|
var PuzzleIDProp = class extends TwistyPropDerived {
|
|
2143
2291
|
async derive(inputs) {
|
|
2144
2292
|
return inputs.puzzleLoader.id;
|
|
2145
2293
|
}
|
|
2146
2294
|
};
|
|
2147
2295
|
|
|
2148
|
-
// src/cubing/twisty/model/
|
|
2296
|
+
// src/cubing/twisty/model/props/puzzle/display/SpriteProp.ts
|
|
2149
2297
|
var cachedLoader = null;
|
|
2150
2298
|
async function loader() {
|
|
2151
2299
|
return cachedLoader ?? (cachedLoader = new (await THREEJS).TextureLoader());
|
|
@@ -2170,7 +2318,7 @@ var SpriteProp = class extends TwistyPropDerived {
|
|
|
2170
2318
|
}
|
|
2171
2319
|
};
|
|
2172
2320
|
|
|
2173
|
-
// src/cubing/twisty/model/
|
|
2321
|
+
// src/cubing/twisty/model/props/viewer/VisualizationStrategyProp.ts
|
|
2174
2322
|
var VisualizationStrategyProp = class extends TwistyPropDerived {
|
|
2175
2323
|
derive(inputs) {
|
|
2176
2324
|
switch (inputs.puzzleID) {
|
|
@@ -2957,7 +3105,7 @@ var TreeAlgIndexer = class {
|
|
|
2957
3105
|
}
|
|
2958
3106
|
};
|
|
2959
3107
|
|
|
2960
|
-
// src/cubing/twisty/model/
|
|
3108
|
+
// src/cubing/twisty/model/props/puzzle/state/IndexerConstructorProp.ts
|
|
2961
3109
|
var IndexerConstructorProp = class extends TwistyPropDerived {
|
|
2962
3110
|
derive(inputs) {
|
|
2963
3111
|
switch (inputs.indexerConstructorRequest) {
|
|
@@ -2979,7 +3127,7 @@ var IndexerConstructorProp = class extends TwistyPropDerived {
|
|
|
2979
3127
|
}
|
|
2980
3128
|
};
|
|
2981
3129
|
|
|
2982
|
-
// src/cubing/twisty/model/
|
|
3130
|
+
// src/cubing/twisty/model/props/puzzle/state/PuzzleAlgProp.ts
|
|
2983
3131
|
var PuzzleAlgProp = class extends TwistyPropDerived {
|
|
2984
3132
|
async derive(inputs) {
|
|
2985
3133
|
try {
|
|
@@ -3057,7 +3205,7 @@ var KPuzzleWrapper = class extends PuzzleWrapper {
|
|
|
3057
3205
|
}
|
|
3058
3206
|
};
|
|
3059
3207
|
|
|
3060
|
-
// src/cubing/twisty/model/
|
|
3208
|
+
// src/cubing/twisty/model/props/puzzle/state/AlgTransformationProp.ts
|
|
3061
3209
|
var AlgTransformationProp = class extends TwistyPropDerived {
|
|
3062
3210
|
derive(input) {
|
|
3063
3211
|
return this.applyAlg(input.def, input.alg.alg);
|
|
@@ -3069,7 +3217,7 @@ var AlgTransformationProp = class extends TwistyPropDerived {
|
|
|
3069
3217
|
}
|
|
3070
3218
|
};
|
|
3071
3219
|
|
|
3072
|
-
// src/cubing/twisty/model/
|
|
3220
|
+
// src/cubing/twisty/model/props/puzzle/state/IndexerProp.ts
|
|
3073
3221
|
var IndexerProp = class extends TwistyPropDerived {
|
|
3074
3222
|
derive(input) {
|
|
3075
3223
|
const kpuzzleWrapper = new KPuzzleWrapper(input.def);
|
|
@@ -3077,7 +3225,7 @@ var IndexerProp = class extends TwistyPropDerived {
|
|
|
3077
3225
|
}
|
|
3078
3226
|
};
|
|
3079
3227
|
|
|
3080
|
-
// src/cubing/twisty/model/
|
|
3228
|
+
// src/cubing/twisty/model/props/puzzle/state/AnchoredStartProp.ts
|
|
3081
3229
|
var AnchoredStartProp = class extends TwistyPropDerived {
|
|
3082
3230
|
derive(inputs) {
|
|
3083
3231
|
switch (inputs.setupAnchor) {
|
|
@@ -3094,7 +3242,7 @@ var AnchoredStartProp = class extends TwistyPropDerived {
|
|
|
3094
3242
|
}
|
|
3095
3243
|
};
|
|
3096
3244
|
|
|
3097
|
-
// src/cubing/twisty/model/
|
|
3245
|
+
// src/cubing/twisty/model/props/viewer/TimeRangeProp.ts
|
|
3098
3246
|
var TimeRangeProp = class extends TwistyPropDerived {
|
|
3099
3247
|
derive(inputs) {
|
|
3100
3248
|
return {
|
|
@@ -3104,7 +3252,7 @@ var TimeRangeProp = class extends TwistyPropDerived {
|
|
|
3104
3252
|
}
|
|
3105
3253
|
};
|
|
3106
3254
|
|
|
3107
|
-
// src/cubing/twisty/model/
|
|
3255
|
+
// src/cubing/twisty/model/props/timeline/DetailedTimelineInfoProp.ts
|
|
3108
3256
|
var _requestedTimestampToMilliseconds, requestedTimestampToMilliseconds_fn;
|
|
3109
3257
|
var DetailedTimelineInfoProp = class extends TwistyPropDerived {
|
|
3110
3258
|
constructor() {
|
|
@@ -3150,7 +3298,7 @@ requestedTimestampToMilliseconds_fn = function(inputs) {
|
|
|
3150
3298
|
}
|
|
3151
3299
|
};
|
|
3152
3300
|
|
|
3153
|
-
// src/cubing/twisty/model/
|
|
3301
|
+
// src/cubing/twisty/model/props/timeline/CoarseTimelineInfoProp.ts
|
|
3154
3302
|
var CoarseTimelineInfoProp = class extends TwistyPropDerived {
|
|
3155
3303
|
derive(inputs) {
|
|
3156
3304
|
return {
|
|
@@ -3164,11 +3312,23 @@ var CoarseTimelineInfoProp = class extends TwistyPropDerived {
|
|
|
3164
3312
|
}
|
|
3165
3313
|
};
|
|
3166
3314
|
|
|
3167
|
-
// src/cubing/twisty/model/
|
|
3315
|
+
// src/cubing/twisty/model/props/puzzle/state/CurrentLeavesProp.ts
|
|
3168
3316
|
var CurrentLeavesProp = class extends TwistyPropDerived {
|
|
3169
3317
|
derive(inputs) {
|
|
3318
|
+
function addCatchUpMove(currentMoveInfo) {
|
|
3319
|
+
if (inputs.detailedTimelineInfo.atEnd && inputs.catchUpMove.move !== null) {
|
|
3320
|
+
currentMoveInfo.currentMoves.push({
|
|
3321
|
+
move: inputs.catchUpMove.move,
|
|
3322
|
+
direction: Direction.Backwards,
|
|
3323
|
+
fraction: 1 - inputs.catchUpMove.amount,
|
|
3324
|
+
startTimestamp: -1,
|
|
3325
|
+
endTimestamp: -1
|
|
3326
|
+
});
|
|
3327
|
+
}
|
|
3328
|
+
return currentMoveInfo;
|
|
3329
|
+
}
|
|
3170
3330
|
if (inputs.indexer.currentMoveInfo) {
|
|
3171
|
-
return inputs.indexer.currentMoveInfo(inputs.detailedTimelineInfo.timestamp);
|
|
3331
|
+
return addCatchUpMove(inputs.indexer.currentMoveInfo(inputs.detailedTimelineInfo.timestamp));
|
|
3172
3332
|
} else {
|
|
3173
3333
|
const idx = inputs.indexer.timestampToIndex(inputs.detailedTimelineInfo.timestamp);
|
|
3174
3334
|
const currentMoveInfo = {
|
|
@@ -3183,7 +3343,7 @@ var CurrentLeavesProp = class extends TwistyPropDerived {
|
|
|
3183
3343
|
if (inputs.indexer.numAnimatedLeaves() > 0) {
|
|
3184
3344
|
const move = inputs.indexer.getAnimLeaf(idx)?.as(Move);
|
|
3185
3345
|
if (!move) {
|
|
3186
|
-
return currentMoveInfo;
|
|
3346
|
+
return addCatchUpMove(currentMoveInfo);
|
|
3187
3347
|
}
|
|
3188
3348
|
const start = inputs.indexer.indexToMoveStartTimestamp(idx);
|
|
3189
3349
|
const duration = inputs.indexer.moveDuration(idx);
|
|
@@ -3206,12 +3366,12 @@ var CurrentLeavesProp = class extends TwistyPropDerived {
|
|
|
3206
3366
|
currentMoveInfo.earliestEnd = Math.min(currentMoveInfo.earliestEnd, end);
|
|
3207
3367
|
}
|
|
3208
3368
|
}
|
|
3209
|
-
return currentMoveInfo;
|
|
3369
|
+
return addCatchUpMove(currentMoveInfo);
|
|
3210
3370
|
}
|
|
3211
3371
|
}
|
|
3212
3372
|
};
|
|
3213
3373
|
|
|
3214
|
-
// src/cubing/twisty/model/
|
|
3374
|
+
// src/cubing/twisty/model/props/puzzle/state/CurrentLeavesSimplified.ts
|
|
3215
3375
|
var CurrentLeavesSimplifiedProp = class extends TwistyPropDerived {
|
|
3216
3376
|
derive(inputs) {
|
|
3217
3377
|
return {
|
|
@@ -3225,7 +3385,7 @@ var CurrentLeavesSimplifiedProp = class extends TwistyPropDerived {
|
|
|
3225
3385
|
}
|
|
3226
3386
|
};
|
|
3227
3387
|
|
|
3228
|
-
// src/cubing/twisty/model/
|
|
3388
|
+
// src/cubing/twisty/model/props/puzzle/state/CurrentTransformationProp.ts
|
|
3229
3389
|
var CurrentTransformationProp = class extends TwistyPropDerived {
|
|
3230
3390
|
derive(inputs) {
|
|
3231
3391
|
let state = inputs.indexer.transformAtIndex(inputs.currentLeavesSimplified.stateIndex);
|
|
@@ -3241,7 +3401,7 @@ var CurrentTransformationProp = class extends TwistyPropDerived {
|
|
|
3241
3401
|
}
|
|
3242
3402
|
};
|
|
3243
3403
|
|
|
3244
|
-
// src/cubing/twisty/model/
|
|
3404
|
+
// src/cubing/twisty/model/props/puzzle/state/LegacyPositionProp.ts
|
|
3245
3405
|
var LegacyPositionProp = class extends TwistyPropDerived {
|
|
3246
3406
|
derive(inputs) {
|
|
3247
3407
|
return {
|
|
@@ -3251,20 +3411,46 @@ var LegacyPositionProp = class extends TwistyPropDerived {
|
|
|
3251
3411
|
}
|
|
3252
3412
|
};
|
|
3253
3413
|
|
|
3254
|
-
// src/cubing/twisty/model/
|
|
3414
|
+
// src/cubing/twisty/model/props/puzzle/structure/PuzzleDefProp.ts
|
|
3255
3415
|
var PuzzleDefProp = class extends TwistyPropDerived {
|
|
3256
3416
|
async derive(inputs) {
|
|
3257
3417
|
return inputs.puzzleLoader.def();
|
|
3258
3418
|
}
|
|
3259
3419
|
};
|
|
3260
3420
|
|
|
3421
|
+
// src/cubing/twisty/model/UserVisibleErrorTracker.ts
|
|
3422
|
+
var EMPTY_ERRORS = { errors: [] };
|
|
3423
|
+
var UserVisibleErrorTracker = class extends SimpleTwistyPropSource {
|
|
3424
|
+
getDefaultValue() {
|
|
3425
|
+
return EMPTY_ERRORS;
|
|
3426
|
+
}
|
|
3427
|
+
reset() {
|
|
3428
|
+
this.set(this.getDefaultValue());
|
|
3429
|
+
}
|
|
3430
|
+
canReuseValue(_v1, _v2) {
|
|
3431
|
+
return arrayEquals(_v1.errors, _v2.errors);
|
|
3432
|
+
}
|
|
3433
|
+
};
|
|
3434
|
+
|
|
3435
|
+
// src/cubing/twisty/model/props/puzzle/state/CatchUpMoveProp.ts
|
|
3436
|
+
var CatchUpMoveProp = class extends SimpleTwistyPropSource {
|
|
3437
|
+
getDefaultValue() {
|
|
3438
|
+
return { move: null, amount: 0 };
|
|
3439
|
+
}
|
|
3440
|
+
canReuseValue(v1, v2) {
|
|
3441
|
+
return v1.move === v2.move && v1.amount === v2.amount;
|
|
3442
|
+
}
|
|
3443
|
+
};
|
|
3444
|
+
|
|
3261
3445
|
// src/cubing/twisty/model/TwistyPlayerModel.ts
|
|
3262
3446
|
var TwistyPlayerModel = class {
|
|
3263
3447
|
constructor() {
|
|
3448
|
+
this.userVisibleErrorTracker = new UserVisibleErrorTracker();
|
|
3264
3449
|
this.algProp = new AlgProp();
|
|
3265
3450
|
this.backgroundProp = new BackgroundProp();
|
|
3266
3451
|
this.backViewProp = new BackViewProp();
|
|
3267
3452
|
this.controlPanelProp = new ControlPanelProp();
|
|
3453
|
+
this.catchUpMoveProp = new CatchUpMoveProp();
|
|
3268
3454
|
this.foundationStickerSpriteURL = new URLProp();
|
|
3269
3455
|
this.hintFaceletProp = new HintFaceletProp();
|
|
3270
3456
|
this.hintStickerSpriteURL = new URLProp();
|
|
@@ -3290,7 +3476,7 @@ var TwistyPlayerModel = class {
|
|
|
3290
3476
|
this.puzzleLoaderProp = new PuzzleLoaderProp({
|
|
3291
3477
|
puzzleIDRequest: this.puzzleIDRequestProp,
|
|
3292
3478
|
puzzleDescriptionRequest: this.puzzleDescriptionRequestProp
|
|
3293
|
-
});
|
|
3479
|
+
}, this.userVisibleErrorTracker);
|
|
3294
3480
|
this.puzzleDefProp = new PuzzleDefProp({ puzzleLoader: this.puzzleLoaderProp });
|
|
3295
3481
|
this.puzzleIDProp = new PuzzleIDProp({ puzzleLoader: this.puzzleLoaderProp });
|
|
3296
3482
|
this.puzzleAlgProp = new PuzzleAlgProp({
|
|
@@ -3346,7 +3532,8 @@ var TwistyPlayerModel = class {
|
|
|
3346
3532
|
});
|
|
3347
3533
|
this.currentLeavesProp = new CurrentLeavesProp({
|
|
3348
3534
|
indexer: this.indexerProp,
|
|
3349
|
-
detailedTimelineInfo: this.detailedTimelineInfoProp
|
|
3535
|
+
detailedTimelineInfo: this.detailedTimelineInfoProp,
|
|
3536
|
+
catchUpMove: this.catchUpMoveProp
|
|
3350
3537
|
});
|
|
3351
3538
|
this.buttonAppearanceProp = new ButtonAppearanceProp({
|
|
3352
3539
|
coarseTimelineInfo: this.coarseTimelineInfoProp,
|
|
@@ -3568,14 +3755,18 @@ var twistyPlayerAttributeMap = {
|
|
|
3568
3755
|
"experimental-hint-sprite": "experimentalHintSprite"
|
|
3569
3756
|
};
|
|
3570
3757
|
var configKeys = Object.fromEntries(Object.values(twistyPlayerAttributeMap).map((s) => [s, true]));
|
|
3571
|
-
var _controlsManager, _visualizationWrapperElem, _visualizationWrapper, _visualizationStrategy, _setVisualizationWrapper, setVisualizationWrapper_fn;
|
|
3758
|
+
var _controlsManager, _visualizationWrapperElem, _errorElem, _alreadyConnected, _visualizationWrapper, _visualizationStrategy, _setVisualizationWrapper, setVisualizationWrapper_fn;
|
|
3572
3759
|
var TwistyPlayer = class extends TwistyPlayerSettable {
|
|
3573
3760
|
constructor(config = {}) {
|
|
3574
3761
|
super();
|
|
3575
3762
|
__privateAdd(this, _setVisualizationWrapper);
|
|
3576
3763
|
this.controller = new TwistyPlayerController(this.experimentalModel, this);
|
|
3764
|
+
this.experimentalCanvasClickCallback = () => {
|
|
3765
|
+
};
|
|
3577
3766
|
__privateAdd(this, _controlsManager, new ClassListManager(this, "controls-", ["auto"].concat(Object.keys(controlsLocations))));
|
|
3578
3767
|
__privateAdd(this, _visualizationWrapperElem, document.createElement("div"));
|
|
3768
|
+
__privateAdd(this, _errorElem, document.createElement("div"));
|
|
3769
|
+
__privateAdd(this, _alreadyConnected, false);
|
|
3579
3770
|
__privateAdd(this, _visualizationWrapper, null);
|
|
3580
3771
|
__privateAdd(this, _visualizationStrategy, null);
|
|
3581
3772
|
for (const [propName, value] of Object.entries(config)) {
|
|
@@ -3587,8 +3778,21 @@ var TwistyPlayer = class extends TwistyPlayerSettable {
|
|
|
3587
3778
|
}
|
|
3588
3779
|
}
|
|
3589
3780
|
async connectedCallback() {
|
|
3781
|
+
if (__privateGet(this, _alreadyConnected)) {
|
|
3782
|
+
return;
|
|
3783
|
+
}
|
|
3784
|
+
__privateSet(this, _alreadyConnected, true);
|
|
3590
3785
|
this.addCSS(twistyPlayerCSS);
|
|
3591
3786
|
this.addElement(__privateGet(this, _visualizationWrapperElem)).classList.add("visualization-wrapper");
|
|
3787
|
+
this.addElement(__privateGet(this, _errorElem)).classList.add("error-elem");
|
|
3788
|
+
__privateGet(this, _errorElem).textContent = "Error";
|
|
3789
|
+
this.experimentalModel.userVisibleErrorTracker.addFreshListener((userVisibleError) => {
|
|
3790
|
+
const errorString = userVisibleError.errors[0] ?? null;
|
|
3791
|
+
this.contentWrapper.classList.toggle("error", !!errorString);
|
|
3792
|
+
if (errorString) {
|
|
3793
|
+
__privateGet(this, _errorElem).textContent = errorString;
|
|
3794
|
+
}
|
|
3795
|
+
});
|
|
3592
3796
|
const scrubber = new TwistyScrubberV2(this.experimentalModel);
|
|
3593
3797
|
this.contentWrapper.appendChild(scrubber);
|
|
3594
3798
|
this.buttons = new TwistyButtonsV2(this.experimentalModel, this.controller, this);
|
|
@@ -3607,6 +3811,26 @@ var TwistyPlayer = class extends TwistyPlayerSettable {
|
|
|
3607
3811
|
duration: 250
|
|
3608
3812
|
});
|
|
3609
3813
|
}
|
|
3814
|
+
async experimentalCurrentCanvases() {
|
|
3815
|
+
this.connectedCallback();
|
|
3816
|
+
const wrapper = __privateGet(this, _visualizationWrapper);
|
|
3817
|
+
const canvases = [];
|
|
3818
|
+
if (wrapper instanceof Twisty3DSceneWrapper) {
|
|
3819
|
+
const vantages = wrapper.experimentalVantages();
|
|
3820
|
+
for (const vantage of vantages) {
|
|
3821
|
+
canvases.push(await vantage.canvas());
|
|
3822
|
+
}
|
|
3823
|
+
}
|
|
3824
|
+
return canvases;
|
|
3825
|
+
}
|
|
3826
|
+
async experimentalPG3D() {
|
|
3827
|
+
this.connectedCallback();
|
|
3828
|
+
const wrapper = __privateGet(this, _visualizationWrapper);
|
|
3829
|
+
if (wrapper instanceof Twisty3DSceneWrapper) {
|
|
3830
|
+
wrapper;
|
|
3831
|
+
}
|
|
3832
|
+
return null;
|
|
3833
|
+
}
|
|
3610
3834
|
jumpToStart(options) {
|
|
3611
3835
|
this.controller.jumpToStart(options);
|
|
3612
3836
|
}
|
|
@@ -3622,11 +3846,19 @@ var TwistyPlayer = class extends TwistyPlayerSettable {
|
|
|
3622
3846
|
togglePlay(play) {
|
|
3623
3847
|
this.controller.togglePlay(play);
|
|
3624
3848
|
}
|
|
3625
|
-
experimentalAddMove(
|
|
3849
|
+
experimentalAddMove(flexibleMove, options = {}) {
|
|
3850
|
+
const move = typeof flexibleMove === "string" ? new Move(flexibleMove) : flexibleMove;
|
|
3626
3851
|
(async () => {
|
|
3627
3852
|
const alg = (await this.experimentalModel.algProp.get()).alg;
|
|
3628
|
-
|
|
3853
|
+
const newAlg = experimentalAppendMove(alg, move, {
|
|
3854
|
+
coalesce: options?.coalesce
|
|
3855
|
+
});
|
|
3856
|
+
this.experimentalModel.algProp.set(newAlg);
|
|
3629
3857
|
this.experimentalModel.timestampRequestProp.set("end");
|
|
3858
|
+
this.experimentalModel.catchUpMoveProp.set({
|
|
3859
|
+
move,
|
|
3860
|
+
amount: 0
|
|
3861
|
+
});
|
|
3630
3862
|
})();
|
|
3631
3863
|
}
|
|
3632
3864
|
static get observedAttributes() {
|
|
@@ -3656,6 +3888,8 @@ var TwistyPlayer = class extends TwistyPlayerSettable {
|
|
|
3656
3888
|
};
|
|
3657
3889
|
_controlsManager = new WeakMap();
|
|
3658
3890
|
_visualizationWrapperElem = new WeakMap();
|
|
3891
|
+
_errorElem = new WeakMap();
|
|
3892
|
+
_alreadyConnected = new WeakMap();
|
|
3659
3893
|
_visualizationWrapper = new WeakMap();
|
|
3660
3894
|
_visualizationStrategy = new WeakMap();
|
|
3661
3895
|
_setVisualizationWrapper = new WeakSet();
|
|
@@ -4293,6 +4527,7 @@ var TwistyAlgEditor = class extends ManagedCustomElement {
|
|
|
4293
4527
|
__privateGet(this, _carbonCopy).appendChild(__privateGet(this, _carbonCopyHighlight));
|
|
4294
4528
|
__privateGet(this, _carbonCopySuffix).classList.add("suffix");
|
|
4295
4529
|
__privateGet(this, _carbonCopy).appendChild(__privateGet(this, _carbonCopySuffix));
|
|
4530
|
+
__privateGet(this, _textarea).placeholder = "Alg";
|
|
4296
4531
|
__privateGet(this, _textarea).setAttribute("spellcheck", "false");
|
|
4297
4532
|
this.addCSS(twistyAlgEditorCSS);
|
|
4298
4533
|
__privateGet(this, _textarea).addEventListener("input", () => {
|
|
@@ -6313,7 +6548,7 @@ export {
|
|
|
6313
6548
|
TwistyAlgViewerV1,
|
|
6314
6549
|
TwistyPlayer,
|
|
6315
6550
|
TwistyPlayerV1,
|
|
6316
|
-
|
|
6551
|
+
experimentalForceNewRendererSharing,
|
|
6317
6552
|
experimentalShowRenderStats
|
|
6318
6553
|
};
|
|
6319
6554
|
//# sourceMappingURL=index.js.map
|