cubing 0.20.2 → 0.21.0-pre12
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 +6 -9
- package/dist/.DS_Store +0 -0
- package/dist/bin/puzzle-geometry-bin.js +1124 -1128
- package/dist/bin/puzzle-geometry-bin.js.map +3 -3
- package/dist/bundle-global/cubing.bundle-global.js +3978 -3587
- package/dist/esm/.DS_Store +0 -0
- package/dist/esm/{2x2x2.kpuzzle.json_-ZLJSYD5K.js → 2x2x2.kpuzzle.json-JOGUSQ4N.js} +3 -3
- package/dist/esm/{2x2x2.kpuzzle.json_-ZLJSYD5K.js.map → 2x2x2.kpuzzle.json-JOGUSQ4N.js.map} +1 -1
- package/dist/esm/{2x2x2.kpuzzle.svg-BNXPAM3A.js → 2x2x2.kpuzzle.svg-CQF2FTV7.js} +2 -2
- package/dist/esm/{2x2x2.kpuzzle.svg-BNXPAM3A.js.map → 2x2x2.kpuzzle.svg-CQF2FTV7.js.map} +0 -0
- package/dist/esm/3d-JZD3V366.js +39 -0
- package/dist/esm/3d-JZD3V366.js.map +7 -0
- package/dist/esm/{3x3x3-ll.kpuzzle.svg-EC42JHOH.js → 3x3x3-ll.kpuzzle.svg-53CBPG5O.js} +2 -2
- package/dist/esm/{3x3x3-ll.kpuzzle.svg-EC42JHOH.js.map → 3x3x3-ll.kpuzzle.svg-53CBPG5O.js.map} +0 -0
- package/dist/esm/{3x3x3.kpuzzle.svg-DUKG2WHC.js → 3x3x3.kpuzzle.svg-ERSSH66P.js} +2 -2
- package/dist/esm/{3x3x3.kpuzzle.svg-DUKG2WHC.js.map → 3x3x3.kpuzzle.svg-ERSSH66P.js.map} +0 -0
- package/dist/esm/alg/index.js +2 -2
- package/dist/esm/bluetooth/index.js +13 -11
- package/dist/esm/bluetooth/index.js.map +2 -2
- package/dist/esm/chunk-5DN4DAAX.js +2512 -0
- package/dist/esm/chunk-5DN4DAAX.js.map +7 -0
- package/dist/esm/{chunk-KKSDHNLH.js → chunk-7GADUDIG.js} +49 -71
- package/dist/esm/chunk-7GADUDIG.js.map +7 -0
- package/dist/esm/{chunk-YNB7QLBF.js → chunk-BU5PUJK3.js} +9 -10
- package/dist/esm/chunk-BU5PUJK3.js.map +7 -0
- package/dist/esm/chunk-CQS6JZ7G.js +762 -0
- package/dist/esm/chunk-CQS6JZ7G.js.map +7 -0
- package/dist/esm/{chunk-2GRKPQQL.js → chunk-RE7MIN5R.js} +2 -2
- package/dist/esm/{chunk-2GRKPQQL.js.map → chunk-RE7MIN5R.js.map} +0 -0
- package/dist/esm/{chunk-WJ7AVUI7.js → chunk-WO2AXYFE.js} +12 -1
- package/dist/esm/{chunk-WJ7AVUI7.js.map → chunk-WO2AXYFE.js.map} +0 -0
- package/dist/esm/{chunk-CWVB5RRW.js → chunk-YV3RT5PX.js} +625 -1282
- package/dist/esm/chunk-YV3RT5PX.js.map +7 -0
- package/dist/esm/{clock.kpuzzle.json_-PXORG6YF.js → clock.kpuzzle.json-EKWRMHJM.js} +3 -3
- package/dist/esm/{clock.kpuzzle.json_-PXORG6YF.js.map → clock.kpuzzle.json-EKWRMHJM.js.map} +1 -1
- package/dist/esm/{clock.kpuzzle.svg-E52B5OQV.js → clock.kpuzzle.svg-B7TMN3SY.js} +2 -2
- package/dist/esm/{clock.kpuzzle.svg-E52B5OQV.js.map → clock.kpuzzle.svg-B7TMN3SY.js.map} +0 -0
- package/dist/esm/esm-test-worker.js +2 -2
- package/dist/esm/esm-test-worker.js.map +1 -1
- package/dist/esm/kpuzzle/index.js +5 -3
- package/dist/esm/{node-SIGYKAZG.js → node-BSAQKO3G.js} +2 -2
- package/dist/esm/{node-SIGYKAZG.js.map → node-BSAQKO3G.js.map} +0 -0
- package/dist/esm/{node-BHGOVUN3.js → node-WEHVBEKP.js} +2 -2
- package/dist/esm/{node-BHGOVUN3.js.map → node-WEHVBEKP.js.map} +0 -0
- package/dist/esm/notation/index.js +3 -3
- package/dist/esm/protocol/index.js +3 -3
- package/dist/esm/puzzle-geometry/index.js +1085 -1179
- package/dist/esm/puzzle-geometry/index.js.map +3 -3
- package/dist/esm/puzzles/index.js +10 -4
- package/dist/esm/{pyraminx.kpuzzle.svg-QKUJX37T.js → pyraminx.kpuzzle.svg-QBBMZVDY.js} +2 -2
- package/dist/esm/{pyraminx.kpuzzle.svg-QKUJX37T.js.map → pyraminx.kpuzzle.svg-QBBMZVDY.js.map} +0 -0
- package/dist/esm/scramble/index.js +5 -4
- package/dist/esm/search/index.js +7 -4
- package/dist/esm/{sq1-hyperorbit.kpuzzle.json_-7KW5LSXC.js → sq1-hyperorbit.kpuzzle.json-N3FGCPML.js} +3 -3
- package/dist/esm/{sq1-hyperorbit.kpuzzle.json_-7KW5LSXC.js.map → sq1-hyperorbit.kpuzzle.json-N3FGCPML.js.map} +1 -1
- package/dist/esm/{sq1-hyperorbit.kpuzzle.svg-7Y7N37NN.js → sq1-hyperorbit.kpuzzle.svg-ID57EER7.js} +2 -2
- package/dist/esm/{sq1-hyperorbit.kpuzzle.svg-7Y7N37NN.js.map → sq1-hyperorbit.kpuzzle.svg-ID57EER7.js.map} +0 -0
- package/dist/esm/stream/index.js +3 -3
- package/dist/esm/stream/index.js.map +2 -2
- package/dist/esm/twisty/index.js +4442 -3214
- package/dist/esm/twisty/index.js.map +3 -3
- package/dist/esm/worker-inside-generated-string-KDZOUGJF.js +2831 -0
- package/dist/esm/worker-inside-generated-string-KDZOUGJF.js.map +7 -0
- package/dist/types/alg/Alg.d.ts +88 -0
- package/dist/types/alg/Alg.d.ts.map +1 -1
- package/dist/types/alg/Alg.spec.d.ts +2 -0
- package/dist/types/alg/Alg.spec.d.ts.map +1 -0
- package/dist/types/alg/common.d.ts.map +1 -1
- package/dist/types/alg/operation.spec.d.ts +2 -0
- package/dist/types/alg/operation.spec.d.ts.map +1 -0
- package/dist/types/alg/parse.spec.d.ts +2 -0
- package/dist/types/alg/parse.spec.d.ts.map +1 -0
- package/dist/types/alg/test/alg-comparison.d.ts.map +1 -1
- package/dist/types/alg/test/alg.spec.d.ts +2 -0
- package/dist/types/alg/test/alg.spec.d.ts.map +1 -0
- package/dist/types/alg/units/leaves/LineComment.spec.d.ts +2 -0
- package/dist/types/alg/units/leaves/LineComment.spec.d.ts.map +1 -0
- package/dist/types/alg/units/leaves/Move.spec.d.ts +2 -0
- package/dist/types/alg/units/leaves/Move.spec.d.ts.map +1 -0
- package/dist/types/alg/url.spec.d.ts +2 -0
- package/dist/types/alg/url.spec.d.ts.map +1 -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/bluetooth/smart-puzzle/giiker.spec.d.ts +5 -0
- package/dist/types/bluetooth/smart-puzzle/giiker.spec.d.ts.map +1 -0
- package/dist/types/kpuzzle/3x3x3/3x3x3.kpuzzle.json.d.ts +3 -0
- package/dist/types/kpuzzle/3x3x3/3x3x3.kpuzzle.json.d.ts.map +1 -0
- package/dist/types/kpuzzle/3x3x3/3x3x3.kpuzzle.json.spec.d.ts +2 -0
- package/dist/types/kpuzzle/3x3x3/3x3x3.kpuzzle.json.spec.d.ts.map +1 -0
- package/dist/types/kpuzzle/canon.spec.d.ts +2 -0
- package/dist/types/kpuzzle/canon.spec.d.ts.map +1 -0
- package/dist/types/kpuzzle/index.d.ts +1 -0
- package/dist/types/kpuzzle/index.d.ts.map +1 -1
- package/dist/types/kpuzzle/kpuzzle.spec.d.ts +2 -0
- package/dist/types/kpuzzle/kpuzzle.spec.d.ts.map +1 -0
- package/dist/types/kpuzzle/prunetable.spec.d.ts +2 -0
- package/dist/types/kpuzzle/prunetable.spec.d.ts.map +1 -0
- package/dist/types/kpuzzle/svg.d.ts.map +1 -1
- package/dist/types/kpuzzle/transformations.spec.d.ts +2 -0
- package/dist/types/kpuzzle/transformations.spec.d.ts.map +1 -0
- package/dist/types/protocol/binary/binary3x3x3.spec.d.ts +2 -0
- package/dist/types/protocol/binary/binary3x3x3.spec.d.ts.map +1 -0
- package/dist/types/protocol/binary/hex.spec.d.ts +2 -0
- package/dist/types/protocol/binary/hex.spec.d.ts.map +1 -0
- package/dist/types/protocol/binary/orbit-indexing.spec.d.ts +2 -0
- package/dist/types/protocol/binary/orbit-indexing.spec.d.ts.map +1 -0
- package/dist/types/puzzle-geometry/Options.d.ts +45 -1
- package/dist/types/puzzle-geometry/Options.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/PGPuzzles.spec.d.ts +2 -0
- package/dist/types/puzzle-geometry/PGPuzzles.spec.d.ts.map +1 -0
- package/dist/types/puzzle-geometry/PermOriSet.d.ts +39 -39
- package/dist/types/puzzle-geometry/PermOriSet.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts +118 -110
- package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/Quat.d.ts +0 -11
- package/dist/types/puzzle-geometry/Quat.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/Quat.spec.d.ts +2 -0
- package/dist/types/puzzle-geometry/Quat.spec.d.ts.map +1 -0
- package/dist/types/puzzle-geometry/SchreierSims.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/index.d.ts +2 -4
- package/dist/types/puzzle-geometry/index.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/interfaces.d.ts +1 -21
- package/dist/types/puzzle-geometry/interfaces.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/orientcenters.spec.d.ts +2 -0
- package/dist/types/puzzle-geometry/orientcenters.spec.d.ts.map +1 -0
- package/dist/types/puzzles/async/async-pg3d.d.ts.map +1 -1
- package/dist/types/puzzles/customPGPuzzleLoader.d.ts +12 -0
- package/dist/types/puzzles/customPGPuzzleLoader.d.ts.map +1 -0
- package/dist/types/puzzles/implementations/2x2x2/{2x2x2.kpuzzle.json_.d.ts → 2x2x2.kpuzzle.json.d.ts} +1 -1
- package/dist/types/puzzles/implementations/2x2x2/2x2x2.kpuzzle.json.d.ts.map +1 -0
- package/dist/types/puzzles/implementations/3x3x3/index.d.ts.map +1 -1
- package/dist/types/puzzles/implementations/clock/{clock.kpuzzle.json_.d.ts → clock.kpuzzle.json.d.ts} +1 -1
- package/dist/types/puzzles/implementations/clock/clock.kpuzzle.json.d.ts.map +1 -0
- 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/implementations/pyraminx/{pyraminx.kpuzzle.json_.d.ts → pyraminx.kpuzzle.json.d.ts} +1 -1
- package/dist/types/puzzles/implementations/pyraminx/pyraminx.kpuzzle.json.d.ts.map +1 -0
- package/dist/types/puzzles/implementations/square1/index.d.ts.map +1 -1
- package/dist/types/puzzles/implementations/square1/{sq1-hyperorbit.kpuzzle.json_.d.ts → sq1-hyperorbit.kpuzzle.json.d.ts} +1 -1
- package/dist/types/puzzles/implementations/square1/sq1-hyperorbit.kpuzzle.json.d.ts.map +1 -0
- package/dist/types/puzzles/index.d.ts +4 -2
- package/dist/types/puzzles/index.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/appearance.d.ts +9 -9
- package/dist/types/puzzles/stickerings/appearance.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/cube-stickerings.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/fto-stickerings.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/global-custom-stickering-hack.d.ts +3 -0
- package/dist/types/puzzles/stickerings/global-custom-stickering-hack.d.ts.map +1 -0
- package/dist/types/search/index.d.ts +1 -1
- package/dist/types/search/index.d.ts.map +1 -1
- package/dist/types/search/inside/api.d.ts +2 -1
- package/dist/types/search/inside/api.d.ts.map +1 -1
- package/dist/types/search/inside/api.spec.d.ts +2 -0
- package/dist/types/search/inside/api.spec.d.ts.map +1 -0
- package/dist/types/search/inside/solve/parseSGS.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/3x3x3/filter.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/3x3x3/index.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/megaminx.sgs.json.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/sgs-defs.spec.d.ts +2 -0
- package/dist/types/search/inside/solve/puzzles/sgs-defs.spec.d.ts.map +1 -0
- package/dist/types/search/inside/solve/puzzles/skewb.sgs.json.d.ts.map +1 -1
- package/dist/types/search/inside/solve/tremble.d.ts.map +1 -1
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/lib/mathlib.d.ts +4 -31
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/lib/mathlib.d.ts.map +1 -1
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/scramble/scramble_444.d.ts.map +1 -1
- package/dist/types/search/inside/solve/vendor/min2phase/gwt.d.ts +3 -0
- package/dist/types/search/inside/solve/vendor/min2phase/gwt.d.ts.map +1 -0
- package/dist/types/search/inside/solve/vendor/random-uint-below/get-random-values.d.ts.map +1 -1
- package/dist/types/search/inside/solve/vendor/random-uint-below/random-int.d.ts.map +1 -1
- package/dist/types/search/inside/solve/vendor/sq12phase/scramble_sq1.d.ts.map +1 -1
- package/dist/types/search/instantiator.d.ts.map +1 -1
- package/dist/types/search/outside.d.ts +4 -2
- package/dist/types/search/outside.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/stream/twizzle/TwizzleStream.d.ts +9 -8
- package/dist/types/stream/twizzle/TwizzleStream.d.ts.map +1 -1
- package/dist/types/stream/websocket-proxy.d.ts +1 -1
- package/dist/types/stream/websocket-proxy.d.ts.map +1 -1
- package/dist/types/twisty/controllers/TwistyAnimationController.d.ts +34 -0
- package/dist/types/twisty/controllers/TwistyAnimationController.d.ts.map +1 -0
- package/dist/types/twisty/controllers/TwistyPlayerController.d.ts +16 -0
- package/dist/types/twisty/controllers/TwistyPlayerController.d.ts.map +1 -0
- package/dist/types/twisty/heavy-code-imports/3d.d.ts +3 -0
- package/dist/types/twisty/heavy-code-imports/3d.d.ts.map +1 -0
- package/dist/types/twisty/heavy-code-imports/dynamic-entries/3d.d.ts +12 -0
- package/dist/types/twisty/heavy-code-imports/dynamic-entries/3d.d.ts.map +1 -0
- package/dist/types/twisty/index.d.ts +20 -15
- package/dist/types/twisty/index.d.ts.map +1 -1
- package/dist/types/twisty/model/PromiseFreshener.d.ts +14 -0
- package/dist/types/twisty/model/PromiseFreshener.d.ts.map +1 -0
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts +84 -0
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts.map +1 -0
- 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/helpers.d.ts +5 -0
- package/dist/types/twisty/model/helpers.d.ts.map +1 -0
- package/dist/types/twisty/model/props/TwistyProp.d.ts +60 -0
- package/dist/types/twisty/model/props/TwistyProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/TwistyProp.spec.d.ts +5 -0
- package/dist/types/twisty/model/props/TwistyProp.spec.d.ts.map +1 -0
- package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts +28 -0
- package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts.map +1 -0
- package/dist/types/twisty/model/props/general/URLProp.d.ts +6 -0
- package/dist/types/twisty/model/props/general/URLProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts +7 -0
- package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/display/SpriteProp.d.ts +10 -0
- 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/props/puzzle/state/AlgProp.d.ts +27 -0
- package/dist/types/twisty/model/props/puzzle/state/AlgProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/AlgTransformationProp.d.ts +14 -0
- package/dist/types/twisty/model/props/puzzle/state/AlgTransformationProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts +15 -0
- package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts +12 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts +17 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentTransformationProp.d.ts +15 -0
- 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/props/puzzle/state/IndexerConstructorRequestProp.d.ts +12 -0
- 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/props/puzzle/state/PuzzleAlgProp.d.ts +13 -0
- 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/props/timeline/CoarseTimelineInfoProp.d.ts +25 -0
- package/dist/types/twisty/model/props/timeline/CoarseTimelineInfoProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts +23 -0
- package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts +15 -0
- package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/timeline/TempoScaleProp.d.ts +6 -0
- package/dist/types/twisty/model/props/timeline/TempoScaleProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts +16 -0
- package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts +7 -0
- package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts +7 -0
- package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/ButtonAppearanceProp.d.ts +22 -0
- package/dist/types/twisty/model/props/viewer/ButtonAppearanceProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts +7 -0
- package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/LatitudeLimit.d.ts +6 -0
- package/dist/types/twisty/model/props/viewer/LatitudeLimit.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts +16 -0
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts +15 -0
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts +11 -0
- package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts +7 -0
- package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts +7 -0
- package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts +13 -0
- package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/RenderScheduler.d.ts +3 -0
- package/dist/types/twisty/old/animation/RenderScheduler.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/Timeline.d.ts +0 -0
- package/dist/types/twisty/old/animation/Timeline.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/cursor/AlgCursor.d.ts +4 -4
- package/dist/types/twisty/old/animation/cursor/AlgCursor.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/cursor/CursorTypes.d.ts +4 -4
- package/dist/types/twisty/old/animation/cursor/CursorTypes.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/easing.d.ts +0 -0
- package/dist/types/twisty/old/animation/easing.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/indexer/AlgDuration.d.ts +1 -1
- package/dist/types/twisty/old/animation/indexer/AlgDuration.d.ts.map +1 -0
- package/dist/types/twisty/old/animation/indexer/AlgIndexer.d.ts +36 -0
- package/dist/types/twisty/old/animation/indexer/AlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/indexer/SimpleAlgIndexer.d.ts +3 -3
- package/dist/types/twisty/old/animation/indexer/SimpleAlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts +6 -5
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts.map +1 -0
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts +22 -0
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts.map +1 -0
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/simul-moves.d.ts +26 -0
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/simul-moves.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/indexer/tree/AlgWalker.d.ts +2 -2
- package/dist/types/twisty/old/animation/indexer/tree/AlgWalker.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/indexer/tree/TreeAlgIndexer.d.ts +3 -3
- package/dist/types/twisty/old/animation/indexer/tree/TreeAlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/old/animation/indexer/tree/chunkAlgs.d.ts +3 -0
- package/dist/types/twisty/old/animation/indexer/tree/chunkAlgs.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/stream/timeline-move-calculation-draft.d.ts +1 -1
- package/dist/types/twisty/old/animation/stream/timeline-move-calculation-draft.d.ts.map +1 -0
- package/dist/types/twisty/{dom/TwistyAlgViewer.css_.d.ts → old/dom/TwistyAlgViewerV1.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.css.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.d.ts +52 -0
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.d.ts.map +1 -0
- package/dist/types/twisty/{dom/TwistyPlayer.css_.d.ts → old/dom/TwistyPlayer.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/TwistyPlayer.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/TwistyPlayer.d.ts +8 -8
- package/dist/types/twisty/old/dom/TwistyPlayer.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/TwistyPlayer.spec.d.ts +5 -0
- package/dist/types/twisty/old/dom/TwistyPlayer.spec.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/TwistyPlayerConfig.d.ts +10 -5
- package/dist/types/twisty/old/dom/TwistyPlayerConfig.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/controls/TwistyControlElement.d.ts +2 -0
- package/dist/types/twisty/old/dom/controls/TwistyControlElement.d.ts.map +1 -0
- package/dist/types/twisty/{dom/controls/TwistyScrubber.css_.d.ts → old/dom/controls/TwistyScrubber.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/controls/TwistyScrubber.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/controls/TwistyScrubber.d.ts +1 -1
- package/dist/types/twisty/old/dom/controls/TwistyScrubber.d.ts.map +1 -0
- package/dist/types/twisty/{dom/controls/buttons.css_.d.ts → old/dom/controls/buttons.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/controls/buttons.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/controls/buttons.d.ts +1 -1
- package/dist/types/twisty/old/dom/controls/buttons.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/controls/buttons.spec.d.ts +5 -0
- package/dist/types/twisty/old/dom/controls/buttons.spec.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/element/ClassListManager.d.ts +0 -0
- package/dist/types/twisty/old/dom/element/ClassListManager.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/element/ElementConfig.d.ts +1 -1
- package/dist/types/twisty/old/dom/element/ElementConfig.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/element/ManagedCustomElement.d.ts +0 -0
- package/dist/types/twisty/old/dom/element/ManagedCustomElement.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/element/node-custom-element-shims.d.ts +0 -0
- package/dist/types/twisty/old/dom/element/node-custom-element-shims.d.ts.map +1 -0
- package/dist/types/twisty/{dom/stream/TwistyStreamSource.css_.d.ts → old/dom/stream/TwistyStreamSource.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/stream/TwistyStreamSource.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/stream/TwistyStreamSource.d.ts +0 -0
- package/dist/types/twisty/old/dom/stream/TwistyStreamSource.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/viewers/Twisty2DSVG.d.ts +2 -2
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVG.d.ts.map +1 -0
- package/dist/types/twisty/{dom/viewers/Twisty2DSVGView.css_.d.ts → old/dom/viewers/Twisty2DSVGView.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVGView.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom/viewers/Twisty3DCanvas.css_.d.ts → old/dom/viewers/Twisty3DCanvas.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/viewers/Twisty3DCanvas.d.ts +1 -2
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/viewers/TwistyOrbitControls.d.ts +0 -0
- package/dist/types/twisty/old/dom/viewers/TwistyOrbitControls.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/viewers/TwistyViewerElement.d.ts +4 -0
- package/dist/types/twisty/old/dom/viewers/TwistyViewerElement.d.ts.map +1 -0
- package/dist/types/twisty/{dom/viewers/TwistyViewerWrapper.css_.d.ts → old/dom/viewers/TwistyViewerWrapper.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/viewers/TwistyViewerWrapper.d.ts +0 -0
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/viewers/canvas.d.ts +3 -0
- package/dist/types/twisty/old/dom/viewers/canvas.d.ts.map +1 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.d.ts +29 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.d.ts.map +1 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzleWrapper.d.ts +16 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzleWrapper.d.ts.map +1 -0
- package/dist/types/twisty/views/2D/Twisty2DSceneWrapper.d.ts +20 -0
- package/dist/types/twisty/views/2D/Twisty2DSceneWrapper.d.ts.map +1 -0
- 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/{3D → views/3D}/TAU.d.ts +0 -0
- package/dist/types/twisty/views/3D/TAU.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts +17 -0
- package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/Twisty3DRenderTarget.d.ts +0 -0
- package/dist/types/twisty/views/3D/Twisty3DRenderTarget.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/Twisty3DScene.d.ts +0 -0
- package/dist/types/twisty/views/3D/Twisty3DScene.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts +28 -0
- package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts +32 -0
- package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts +41 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.spec.d.ts +5 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.spec.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/puzzles/Cube3D.d.ts +11 -7
- package/dist/types/twisty/views/3D/puzzles/Cube3D.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/puzzles/KPuzzleWrapper.d.ts +2 -2
- package/dist/types/twisty/views/3D/puzzles/KPuzzleWrapper.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/puzzles/PG3D.d.ts +57 -0
- package/dist/types/twisty/views/3D/puzzles/PG3D.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/puzzles/Twisty3DPuzzle.d.ts +1 -1
- package/dist/types/twisty/views/3D/puzzles/Twisty3DPuzzle.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/puzzles/TwistyTestBox.d.ts +2 -2
- package/dist/types/twisty/views/3D/puzzles/TwistyTestBox.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/LeafTokens.d.ts +18 -0
- package/dist/types/twisty/views/TwistyAlgEditor/LeafTokens.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.d.ts +3 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts +40 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.spec.d.ts +5 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.spec.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/model.d.ts +61 -0
- package/dist/types/twisty/views/TwistyAlgEditor/model.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgViewer.css.d.ts +3 -0
- package/dist/types/twisty/views/TwistyAlgViewer.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → views}/TwistyAlgViewer.d.ts +6 -6
- package/dist/types/twisty/views/TwistyAlgViewer.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyPlayer.d.ts +97 -0
- package/dist/types/twisty/views/TwistyPlayer.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts +71 -0
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts.map +1 -0
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.d.ts +33 -0
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.d.ts.map +1 -0
- package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts +14 -0
- package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts.map +1 -0
- package/dist/types/twisty/views/control-panel/webkit-fullscreen.d.ts +15 -0
- package/dist/types/twisty/views/control-panel/webkit-fullscreen.d.ts.map +1 -0
- package/dist/types/twisty/views/document.d.ts +2 -0
- package/dist/types/twisty/views/document.d.ts.map +1 -0
- package/dist/types/twisty/views/screenshot.d.ts +12 -0
- package/dist/types/twisty/views/screenshot.d.ts.map +1 -0
- package/dist/types/vendor/p-lazy/p-lazy.d.ts +10 -0
- package/dist/types/vendor/p-lazy/p-lazy.d.ts.map +1 -0
- 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/alg/index.html +37 -23
- package/docs/cubing/index.html +56 -252
- package/docs/cubing/scramble/index.html +122 -0
- package/docs/cubing/twisty/index.html +329 -0
- package/docs/main.css +15 -3
- package/package.json +83 -57
- package/src/cubing/.DS_Store +0 -0
- package/src/cubing/alg/.DS_Store +0 -0
- package/src/cubing/alg/Alg.ts +89 -0
- package/src/cubing/alg/common.ts +4 -2
- package/src/cubing/alg/iteration.ts +1 -1
- package/src/cubing/alg/parse.ts +2 -0
- package/src/cubing/alg/test/alg-comparison.ts +1 -0
- package/src/cubing/alg/units/.DS_Store +0 -0
- package/src/cubing/alg/units/Unit.ts +0 -3
- package/src/cubing/alg/units/containers/Commutator.ts +1 -1
- package/src/cubing/alg/units/leaves/Move.ts +4 -4
- package/src/cubing/bluetooth/.DS_Store +0 -0
- package/src/cubing/bluetooth/connect/index.ts +1 -1
- package/src/cubing/bluetooth/smart-puzzle/Heykube.ts +1 -1
- package/src/cubing/bluetooth/smart-puzzle/bluetooth-puzzle.ts +1 -1
- package/src/cubing/bluetooth/smart-puzzle/gan.ts +5 -5
- package/src/cubing/bluetooth/smart-puzzle/giiker.ts +2 -2
- package/src/cubing/bluetooth/smart-puzzle/gocube.ts +5 -5
- package/src/cubing/bluetooth/smart-robot/GanRobot.ts +5 -5
- package/src/cubing/bluetooth/smart-timer/GanTimer.ts +2 -2
- package/src/cubing/kpuzzle/.DS_Store +0 -0
- package/src/cubing/kpuzzle/3x3x3/3x3x3.kpuzzle.json.spec.ts +40 -0
- package/src/cubing/{puzzles/implementations/3x3x3/3x3x3.kpuzzle.json_.ts → kpuzzle/3x3x3/3x3x3.kpuzzle.json.ts} +11 -6
- package/src/cubing/kpuzzle/canon.spec.ts +6 -11
- package/src/cubing/kpuzzle/canonicalize.ts +1 -1
- package/src/cubing/kpuzzle/definition_types.ts +0 -3
- package/src/cubing/kpuzzle/index.ts +1 -0
- package/src/cubing/kpuzzle/prunetable.spec.ts +2 -4
- package/src/cubing/kpuzzle/puzzle-orientation.ts +1 -1
- package/src/cubing/kpuzzle/svg.ts +4 -9
- package/src/cubing/kpuzzle/transformations.ts +1 -1
- package/src/cubing/protocol/binary/binary3x3x3.spec.ts +5 -2
- package/src/cubing/protocol/binary/hex.ts +4 -4
- package/src/cubing/protocol/binary/orbit-indexing.ts +2 -2
- package/src/cubing/protocol/binary/puzzle-orientation.ts +2 -2
- package/src/cubing/puzzle-geometry/Options.ts +151 -22
- package/src/cubing/puzzle-geometry/PGPuzzles.spec.ts +24 -28
- package/src/cubing/puzzle-geometry/PermOriSet.ts +99 -98
- package/src/cubing/puzzle-geometry/PlatonicGenerator.ts +1 -1
- package/src/cubing/puzzle-geometry/PuzzleGeometry.ts +836 -867
- package/src/cubing/puzzle-geometry/Quat.ts +1 -68
- package/src/cubing/puzzle-geometry/SchreierSims.ts +2 -13
- package/src/cubing/puzzle-geometry/index.ts +2 -11
- package/src/cubing/puzzle-geometry/interfaces.ts +1 -27
- package/src/cubing/puzzle-geometry/orientcenters.spec.ts +24 -30
- package/src/cubing/puzzles/.DS_Store +0 -0
- package/src/cubing/puzzles/PuzzleLoader.ts +1 -1
- package/src/cubing/puzzles/async/async-pg3d.ts +5 -8
- package/src/cubing/puzzles/customPGPuzzleLoader.ts +60 -0
- package/src/cubing/puzzles/implementations/.DS_Store +0 -0
- package/src/cubing/puzzles/implementations/2x2x2/{2x2x2.kpuzzle.json_.ts → 2x2x2.kpuzzle.json.ts} +0 -0
- package/src/cubing/puzzles/implementations/2x2x2/index.ts +1 -1
- package/src/cubing/puzzles/implementations/3x3x3/index.ts +2 -3
- package/src/cubing/puzzles/implementations/clock/{clock.kpuzzle.json_.ts → clock.kpuzzle.json.ts} +0 -0
- package/src/cubing/puzzles/implementations/clock/index.ts +1 -1
- package/src/cubing/puzzles/implementations/fto/index.ts +19 -11
- package/src/cubing/puzzles/implementations/pyraminx/{pyraminx.kpuzzle.json_.ts → pyraminx.kpuzzle.json.ts} +0 -0
- package/src/cubing/puzzles/implementations/square1/index.ts +1 -2
- package/src/cubing/puzzles/implementations/square1/{sq1-hyperorbit.kpuzzle.json_.ts → sq1-hyperorbit.kpuzzle.json.ts} +0 -0
- package/src/cubing/puzzles/index.ts +30 -20
- package/src/cubing/puzzles/stickerings/appearance.ts +10 -9
- package/src/cubing/puzzles/stickerings/cube-stickerings.ts +8 -0
- package/src/cubing/puzzles/stickerings/fto-stickerings.ts +9 -0
- package/src/cubing/puzzles/stickerings/global-custom-stickering-hack.ts +61 -0
- package/src/cubing/search/.DS_Store +0 -0
- package/src/cubing/search/.gitignore +1 -2
- package/src/cubing/search/esm-test-worker.js +1 -1
- package/src/cubing/search/index.ts +1 -0
- package/src/cubing/search/inside/api.spec.ts +1 -0
- package/src/cubing/search/inside/api.ts +6 -1
- package/src/cubing/search/inside/solve/parseSGS.ts +7 -11
- package/src/cubing/search/inside/solve/puzzles/2x2x2.ts +3 -3
- package/src/cubing/search/inside/solve/puzzles/3x3x3/filter.ts +0 -6
- package/src/cubing/search/inside/solve/puzzles/3x3x3/index.ts +0 -2
- package/src/cubing/search/inside/solve/puzzles/FTO.sgs +264 -0
- package/src/cubing/search/inside/solve/puzzles/megaminx.sgs.json.ts +4 -6
- package/src/cubing/search/inside/solve/puzzles/skewb.sgs.json.ts +4 -6
- package/src/cubing/search/inside/solve/tremble.ts +6 -9
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/lib/mathlib.ts +20 -822
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/scramble/scramble_444.ts +177 -252
- package/src/cubing/search/inside/solve/vendor/min2phase/gwt.js +62 -222
- package/src/cubing/search/inside/solve/vendor/random-uint-below/get-random-values.ts +4 -5
- package/src/cubing/search/inside/solve/vendor/random-uint-below/random-int.ts +9 -11
- package/src/cubing/search/inside/solve/vendor/sq12phase/scramble_sq1.js +13 -582
- package/src/cubing/search/instantiator.ts +11 -7
- package/src/cubing/search/outside.ts +8 -2
- package/src/cubing/search/worker-inside-generated-string.js +1 -1
- package/src/cubing/stream/.DS_Store +0 -0
- package/src/cubing/stream/process/ReorientedStream.ts +1 -1
- package/src/cubing/stream/twizzle/TwizzleStream.ts +11 -8
- package/src/cubing/stream/websocket-proxy.ts +1 -3
- package/src/cubing/twisty/.DS_Store +0 -0
- package/src/cubing/twisty/controllers/TwistyAnimationController.ts +248 -0
- package/src/cubing/twisty/controllers/TwistyPlayerController.ts +38 -0
- package/src/cubing/twisty/heavy-code-imports/3d.ts +18 -0
- package/src/cubing/twisty/heavy-code-imports/dynamic-entries/3d.ts +41 -0
- package/src/cubing/twisty/index.ts +24 -17
- package/src/cubing/twisty/model/.DS_Store +0 -0
- package/src/cubing/twisty/model/PromiseFreshener.ts +49 -0
- package/src/cubing/twisty/model/TwistyPlayerModel.ts +222 -0
- package/src/cubing/twisty/model/UserVisibleErrorTracker.ts +22 -0
- package/src/cubing/twisty/model/helpers.ts +47 -0
- package/src/cubing/{search/vendor → twisty/model/props}/.DS_Store +0 -0
- package/src/cubing/twisty/model/props/TwistyProp.spec.ts +38 -0
- package/src/cubing/twisty/model/props/TwistyProp.ts +366 -0
- package/src/cubing/twisty/model/props/TwistyPropDebugger.ts +370 -0
- package/src/cubing/twisty/model/props/general/URLProp.ts +14 -0
- package/src/cubing/{solve → twisty/model/props/puzzle}/.DS_Store +0 -0
- package/src/cubing/twisty/model/props/puzzle/display/HintFaceletProp.ts +10 -0
- package/src/cubing/twisty/model/props/puzzle/display/SpriteProp.ts +43 -0
- package/src/cubing/twisty/model/props/puzzle/display/StickeringProp.ts +8 -0
- package/src/cubing/twisty/model/props/puzzle/state/AlgProp.ts +91 -0
- package/src/cubing/twisty/model/props/puzzle/state/AlgTransformationProp.ts +28 -0
- package/src/cubing/twisty/model/props/puzzle/state/AnchoredStartProp.ts +44 -0
- package/src/cubing/twisty/model/props/puzzle/state/CurrentLeavesProp.ts +91 -0
- package/src/cubing/twisty/model/props/puzzle/state/CurrentLeavesSimplified.ts +48 -0
- package/src/cubing/twisty/model/props/puzzle/state/CurrentTransformationProp.ts +46 -0
- package/src/cubing/twisty/model/props/puzzle/state/IndexerConstructorProp.ts +46 -0
- package/src/cubing/twisty/model/props/puzzle/state/IndexerConstructorRequestProp.ts +15 -0
- package/src/cubing/twisty/model/props/puzzle/state/IndexerProp.ts +24 -0
- package/src/cubing/twisty/model/props/puzzle/state/LegacyPositionProp.ts +22 -0
- package/src/cubing/twisty/model/props/puzzle/state/PuzzleAlgProp.ts +28 -0
- package/src/cubing/twisty/model/props/puzzle/state/SetupAnchorProp.ts +8 -0
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleDefProp.ts +14 -0
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleDescriptionProp.ts +14 -0
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleIDProp.ts +12 -0
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.ts +17 -0
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleLoaderProp.ts +38 -0
- package/src/cubing/twisty/model/props/timeline/CoarseTimelineInfoProp.ts +45 -0
- package/src/cubing/twisty/model/props/timeline/DetailedTimelineInfoProp.ts +76 -0
- package/src/cubing/twisty/model/props/timeline/PlayingInfoProp.ts +51 -0
- package/src/cubing/twisty/model/props/timeline/TempoScaleProp.ts +13 -0
- package/src/cubing/twisty/model/props/timeline/TimestampRequestProp.ts +38 -0
- package/src/cubing/twisty/model/props/viewer/BackViewProp.ts +10 -0
- package/src/cubing/twisty/model/props/viewer/BackgroundProp.ts +10 -0
- package/src/cubing/twisty/model/props/viewer/ButtonAppearanceProp.ts +86 -0
- package/src/cubing/twisty/model/props/viewer/ControlPanelProp.ts +10 -0
- package/src/cubing/twisty/model/props/viewer/LatitudeLimit.ts +11 -0
- package/src/cubing/twisty/model/props/viewer/OrbitCoordinatesProp.ts +56 -0
- package/src/cubing/twisty/model/props/viewer/OrbitCoordinatesRequestProp.ts +69 -0
- package/src/cubing/twisty/model/props/viewer/TimeRangeProp.ts +15 -0
- package/src/cubing/twisty/model/props/viewer/ViewerLinkProp.ts +10 -0
- package/src/cubing/twisty/model/props/viewer/VisualizationProp.ts +10 -0
- package/src/cubing/twisty/model/props/viewer/VisualizationStrategyProp.ts +45 -0
- package/src/cubing/twisty/old/.DS_Store +0 -0
- package/src/cubing/twisty/old/animation/.DS_Store +0 -0
- package/src/cubing/twisty/{animation → old/animation}/RenderScheduler.ts +5 -0
- package/src/cubing/twisty/{animation → old/animation}/Timeline.ts +0 -0
- package/src/cubing/twisty/{animation → old/animation}/cursor/AlgCursor.ts +15 -8
- package/src/cubing/twisty/{animation → old/animation}/cursor/CursorTypes.ts +4 -4
- package/src/cubing/twisty/{animation → old/animation}/easing.ts +0 -0
- package/src/cubing/{search/inside → twisty/old/animation/indexer}/.DS_Store +0 -0
- package/src/cubing/twisty/{animation → old/animation}/indexer/AlgDuration.ts +1 -1
- package/src/cubing/twisty/old/animation/indexer/AlgIndexer.ts +86 -0
- package/src/cubing/twisty/{animation → old/animation}/indexer/SimpleAlgIndexer.ts +9 -6
- package/src/cubing/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.ts +181 -0
- package/src/cubing/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.ts +243 -0
- package/src/cubing/twisty/{animation → old/animation}/indexer/simultaneous-moves/simul-moves.ts +46 -34
- package/src/cubing/twisty/{animation → old/animation}/indexer/tree/AlgWalker.ts +6 -3
- package/src/cubing/twisty/{animation → old/animation}/indexer/tree/TreeAlgIndexer.ts +8 -5
- package/src/cubing/twisty/{animation → old/animation}/indexer/tree/chunkAlgs.ts +2 -2
- package/src/cubing/twisty/{animation → old/animation}/stream/timeline-move-calculation-draft.spec.ts.TODO +0 -0
- package/src/cubing/twisty/{animation → old/animation}/stream/timeline-move-calculation-draft.ts +2 -2
- package/src/cubing/twisty/old/dom/.DS_Store +0 -0
- package/src/cubing/twisty/{dom/TwistyAlgViewer.css_.ts → old/dom/TwistyAlgViewerV1.css.ts} +0 -0
- package/src/cubing/twisty/{dom/TwistyAlgViewer.ts → old/dom/TwistyAlgViewerV1.ts} +43 -36
- package/src/cubing/twisty/{dom/TwistyPlayer.css_.ts → old/dom/TwistyPlayer.css.ts} +28 -1
- package/src/cubing/twisty/{dom → old/dom}/TwistyPlayer.spec.ts +5 -6
- package/src/cubing/twisty/{dom → old/dom}/TwistyPlayer.ts +36 -43
- package/src/cubing/twisty/{dom → old/dom}/TwistyPlayerConfig.ts +27 -10
- package/src/cubing/twisty/{dom/controls/TwistyControlElement.ts.ts → old/dom/controls/TwistyControlElement.ts} +0 -0
- package/src/cubing/twisty/{dom/controls/TwistyScrubber.css_.ts → old/dom/controls/TwistyScrubber.css.ts} +0 -0
- package/src/cubing/twisty/{dom → old/dom}/controls/TwistyScrubber.ts +3 -3
- package/src/cubing/twisty/{dom/controls/buttons.css_.ts → old/dom/controls/buttons.css.ts} +14 -1
- package/src/cubing/twisty/{dom → old/dom}/controls/buttons.spec.ts +1 -1
- package/src/cubing/twisty/{dom → old/dom}/controls/buttons.ts +15 -15
- package/src/cubing/twisty/{dom → old/dom}/element/ClassListManager.ts +0 -0
- package/src/cubing/twisty/{dom → old/dom}/element/ElementConfig.ts +1 -1
- package/src/cubing/twisty/{dom → old/dom}/element/ManagedCustomElement.ts +0 -0
- package/src/cubing/twisty/{dom → old/dom}/element/node-custom-element-shims.ts +0 -0
- package/src/cubing/twisty/{dom/stream/TwistyStreamSource.css_.ts → old/dom/stream/TwistyStreamSource.css.ts} +0 -0
- package/src/cubing/twisty/{dom → old/dom}/stream/TwistyStreamSource.ts +8 -8
- package/src/cubing/twisty/{dom → old/dom}/viewers/Twisty2DSVG.ts +7 -9
- package/src/cubing/twisty/{dom/viewers/Twisty2DSVGView.css_.ts → old/dom/viewers/Twisty2DSVGView.css.ts} +0 -0
- package/src/cubing/twisty/{dom/viewers/Twisty3DCanvas.css_.ts → old/dom/viewers/Twisty3DCanvas.css.ts} +0 -0
- package/src/cubing/twisty/{dom → old/dom}/viewers/Twisty3DCanvas.ts +5 -12
- package/src/cubing/twisty/{dom → old/dom}/viewers/TwistyOrbitControls.ts +53 -20
- package/src/cubing/twisty/{dom → old/dom}/viewers/TwistyViewerElement.ts +1 -1
- package/src/cubing/twisty/{dom/viewers/TwistyViewerWrapper.css_.ts → old/dom/viewers/TwistyViewerWrapper.css.ts} +0 -0
- package/src/cubing/twisty/{dom → old/dom}/viewers/TwistyViewerWrapper.ts +1 -1
- package/src/cubing/twisty/old/dom/viewers/canvas.ts +9 -0
- package/src/cubing/twisty/views/.DS_Store +0 -0
- package/src/cubing/twisty/views/2D/Twisty2DPuzzle.ts +150 -0
- package/src/cubing/twisty/views/2D/Twisty2DPuzzleWrapper.ts +52 -0
- package/src/cubing/twisty/views/2D/Twisty2DSceneWrapper.ts +77 -0
- package/src/cubing/twisty/views/3D/RendererPool.ts +53 -0
- package/src/cubing/twisty/{3D → views/3D}/TAU.ts +0 -0
- package/src/cubing/twisty/views/3D/Twisty3DPuzzleWrapper.ts +168 -0
- package/src/cubing/twisty/{3D → views/3D}/Twisty3DRenderTarget.ts +0 -0
- package/src/cubing/twisty/{3D → views/3D}/Twisty3DScene.ts +0 -0
- package/src/cubing/twisty/views/3D/Twisty3DSceneWrapper.ts +144 -0
- package/src/cubing/twisty/views/3D/Twisty3DVantage.ts +244 -0
- package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.spec.ts +209 -0
- package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.ts +270 -0
- package/src/cubing/twisty/{3D → views/3D}/puzzles/Cube3D.ts +36 -15
- package/src/cubing/twisty/{3D → views/3D}/puzzles/KPuzzleWrapper.ts +4 -5
- package/src/cubing/twisty/views/3D/puzzles/PG3D.ts +988 -0
- package/src/cubing/twisty/views/3D/puzzles/Twisty3DPuzzle.ts +6 -0
- package/src/cubing/twisty/{3D → views/3D}/puzzles/TwistyTestBox.ts +2 -2
- package/src/cubing/twisty/views/TwistyAlgEditor/LeafTokens.ts +116 -0
- package/src/cubing/twisty/{dom/TwistyAlgEditor.css_.ts → views/TwistyAlgEditor/TwistyAlgEditor.css.ts} +3 -1
- package/src/cubing/twisty/{dom → views/TwistyAlgEditor}/TwistyAlgEditor.spec.ts +7 -6
- package/src/cubing/twisty/views/TwistyAlgEditor/TwistyAlgEditor.ts +360 -0
- package/src/cubing/twisty/views/TwistyAlgEditor/model.ts +179 -0
- package/src/cubing/twisty/views/TwistyAlgViewer.css.ts +25 -0
- package/src/cubing/twisty/views/TwistyAlgViewer.ts +502 -0
- package/src/cubing/twisty/views/TwistyPlayer.ts +327 -0
- package/src/cubing/twisty/views/TwistyPlayerSettable.ts +111 -0
- package/src/cubing/twisty/views/control-panel/TwistyButtonsV2.ts +159 -0
- package/src/cubing/twisty/views/control-panel/TwistyScrubberV2.ts +145 -0
- package/src/cubing/twisty/views/control-panel/webkit-fullscreen.ts +44 -0
- package/src/cubing/twisty/views/document.ts +4 -0
- package/src/cubing/twisty/views/screenshot.ts +90 -0
- package/src/cubing/vendor/.DS_Store +0 -0
- package/src/cubing/vendor/p-lazy/license +9 -0
- package/src/cubing/vendor/p-lazy/p-lazy.ts +52 -0
- package/src/cubing/vendor/p-lazy/readme.md +54 -0
- package/src/cubing/vendor/three/examples/jsm/libs/stats.modified.module.ts +179 -0
- package/dist/esm/chunk-CWVB5RRW.js.map +0 -7
- package/dist/esm/chunk-KKSDHNLH.js.map +0 -7
- package/dist/esm/chunk-YNB7QLBF.js.map +0 -7
- package/dist/esm/worker-inside-generated-string-LT4NV55Q.js +0 -2826
- package/dist/esm/worker-inside-generated-string-LT4NV55Q.js.map +0 -7
- package/dist/types/puzzles/implementations/2x2x2/2x2x2.kpuzzle.json_.d.ts.map +0 -1
- package/dist/types/puzzles/implementations/3x3x3/3x3x3.kpuzzle.json_.d.ts +0 -3
- package/dist/types/puzzles/implementations/3x3x3/3x3x3.kpuzzle.json_.d.ts.map +0 -1
- package/dist/types/puzzles/implementations/clock/clock.kpuzzle.json_.d.ts.map +0 -1
- package/dist/types/puzzles/implementations/pyraminx/pyraminx.kpuzzle.json_.d.ts.map +0 -1
- package/dist/types/puzzles/implementations/square1/sq1-hyperorbit.kpuzzle.json_.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/lgarron-additions-for-typescript/shim-lib.d.ts +0 -3
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/lgarron-additions-for-typescript/shim-lib.d.ts.map +0 -1
- package/dist/types/twisty/3D/TAU.d.ts.map +0 -1
- package/dist/types/twisty/3D/Twisty3DRenderTarget.d.ts.map +0 -1
- package/dist/types/twisty/3D/Twisty3DScene.d.ts.map +0 -1
- package/dist/types/twisty/3D/puzzles/Cube3D.d.ts.map +0 -1
- package/dist/types/twisty/3D/puzzles/KPuzzleWrapper.d.ts.map +0 -1
- package/dist/types/twisty/3D/puzzles/PG3D.d.ts +0 -51
- package/dist/types/twisty/3D/puzzles/PG3D.d.ts.map +0 -1
- package/dist/types/twisty/3D/puzzles/Twisty3DPuzzle.d.ts.map +0 -1
- package/dist/types/twisty/3D/puzzles/TwistyTestBox.d.ts.map +0 -1
- package/dist/types/twisty/animation/RenderScheduler.d.ts.map +0 -1
- package/dist/types/twisty/animation/Timeline.d.ts.map +0 -1
- package/dist/types/twisty/animation/cursor/AlgCursor.d.ts.map +0 -1
- package/dist/types/twisty/animation/cursor/CursorTypes.d.ts.map +0 -1
- package/dist/types/twisty/animation/easing.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/AlgDuration.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/AlgIndexer.d.ts +0 -15
- package/dist/types/twisty/animation/indexer/AlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/SimpleAlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/simultaneous-moves/simul-moves.d.ts +0 -25
- package/dist/types/twisty/animation/indexer/simultaneous-moves/simul-moves.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/tree/AlgWalker.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/tree/TreeAlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/tree/chunkAlgs.d.ts +0 -3
- package/dist/types/twisty/animation/indexer/tree/chunkAlgs.d.ts.map +0 -1
- package/dist/types/twisty/animation/stream/timeline-move-calculation-draft.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyAlgEditor.css_.d.ts +0 -3
- package/dist/types/twisty/dom/TwistyAlgEditor.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyAlgEditor.d.ts +0 -27
- package/dist/types/twisty/dom/TwistyAlgEditor.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyAlgEditorStartCharSearch.d.ts +0 -26
- package/dist/types/twisty/dom/TwistyAlgEditorStartCharSearch.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyAlgViewer.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyAlgViewer.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyPlayer.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyPlayer.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyPlayerConfig.d.ts.map +0 -1
- package/dist/types/twisty/dom/controls/TwistyControlElement.ts.d.ts +0 -2
- package/dist/types/twisty/dom/controls/TwistyControlElement.ts.d.ts.map +0 -1
- package/dist/types/twisty/dom/controls/TwistyScrubber.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/controls/TwistyScrubber.d.ts.map +0 -1
- package/dist/types/twisty/dom/controls/buttons.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/controls/buttons.d.ts.map +0 -1
- package/dist/types/twisty/dom/element/ClassListManager.d.ts.map +0 -1
- package/dist/types/twisty/dom/element/ElementConfig.d.ts.map +0 -1
- package/dist/types/twisty/dom/element/ManagedCustomElement.d.ts.map +0 -1
- package/dist/types/twisty/dom/element/node-custom-element-shims.d.ts.map +0 -1
- package/dist/types/twisty/dom/stream/TwistyStreamSource.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/stream/TwistyStreamSource.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/Twisty2DSVG.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/Twisty2DSVGView.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/Twisty3DCanvas.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/Twisty3DCanvas.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/TwistyOrbitControls.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/TwistyViewerElement.d.ts +0 -4
- package/dist/types/twisty/dom/viewers/TwistyViewerElement.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/TwistyViewerWrapper.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/TwistyViewerWrapper.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/canvas.d.ts +0 -2
- package/dist/types/twisty/dom/viewers/canvas.d.ts.map +0 -1
- package/dist/types/vendor/three/examples/jsm/libs/stats.module.d.ts +0 -2
- package/dist/types/vendor/three/examples/jsm/libs/stats.module.d.ts.map +0 -1
- package/dist/types/vendor/three/examples/jsm/libs/stats.module.wrapped.d.ts +0 -21
- package/dist/types/vendor/three/examples/jsm/libs/stats.module.wrapped.d.ts.map +0 -1
- package/src/cubing/protocol/.DS_Store +0 -0
- package/src/cubing/puzzle-geometry/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/puzzles/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/puzzles/3x3x3/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/.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/search/inside/solve/vendor/cstimer/src/js/lgarron-additions-for-typescript/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/lgarron-additions-for-typescript/shim-lib.ts +0 -13
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/lib/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/scramble/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/sgs/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/sgs/src/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/sgs/src/test/.DS_Store +0 -0
- package/src/cubing/search/vendor/comlink-everywhere/.DS_Store +0 -0
- package/src/cubing/twisty/3D/puzzles/PG3D.ts +0 -600
- package/src/cubing/twisty/3D/puzzles/Twisty3DPuzzle.ts +0 -9
- package/src/cubing/twisty/3D/puzzles/mkbhd.svg +0 -5
- package/src/cubing/twisty/animation/indexer/AlgIndexer.ts +0 -25
- package/src/cubing/twisty/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.ts +0 -168
- package/src/cubing/twisty/dom/TwistyAlgEditor.ts +0 -373
- package/src/cubing/twisty/dom/TwistyAlgEditorStartCharSearch.ts +0 -138
- package/src/cubing/twisty/dom/viewers/canvas.ts +0 -4
- package/src/cubing/twisty/views/3D/.DS_Store +0 -0
- package/src/cubing/vendor/three/.DS_Store +0 -0
- package/src/cubing/vendor/three/examples/jsm/libs/stats.module.ts +0 -2
- package/src/cubing/vendor/three/examples/jsm/libs/stats.module.wrapped.d.ts +0 -24
- package/src/cubing/vendor/three/examples/jsm/libs/stats.module.wrapped.js +0 -178
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import type { ExperimentalStickering } from "..";
|
|
2
|
+
import { Alg, Move } from "../../alg";
|
|
3
|
+
import type { PuzzleDescriptionString } from "../../puzzle-geometry/PGPuzzles";
|
|
4
|
+
import type { TwistyAnimationControllerDelegate } from "../controllers/TwistyAnimationController";
|
|
5
|
+
import { TwistyPlayerController } from "../controllers/TwistyPlayerController";
|
|
6
|
+
import type { BackgroundThemeWithAuto } from "../model/props/viewer/BackgroundProp";
|
|
7
|
+
import type { BackViewLayoutWithAuto } from "../model/props/viewer/BackViewProp";
|
|
8
|
+
import type { ControlPanelThemeWithAuto } from "../model/props/viewer/ControlPanelProp";
|
|
9
|
+
import type { HintFaceletStyleWithAuto } from "../model/props/puzzle/display/HintFaceletProp";
|
|
10
|
+
import type { ViewerLinkPageWithAuto } from "../model/props/viewer/ViewerLinkProp";
|
|
11
|
+
import type { VisualizationFormatWithAuto } from "../model/props/viewer/VisualizationProp";
|
|
12
|
+
import type { VisualizationStrategy } from "../model/props/viewer/VisualizationStrategyProp";
|
|
13
|
+
import { ClassListManager } from "../old/dom/element/ClassListManager";
|
|
14
|
+
import { customElementsShim } from "../old/dom/element/node-custom-element-shims";
|
|
15
|
+
import { twistyPlayerCSS } from "../old/dom/TwistyPlayer.css";
|
|
16
|
+
import {
|
|
17
|
+
controlsLocations,
|
|
18
|
+
PuzzleID,
|
|
19
|
+
SetupToLocation,
|
|
20
|
+
} from "../old/dom/TwistyPlayerConfig";
|
|
21
|
+
import { Twisty2DSceneWrapper } from "./2D/Twisty2DSceneWrapper";
|
|
22
|
+
import { Twisty3DSceneWrapper } from "./3D/Twisty3DSceneWrapper";
|
|
23
|
+
import { TwistyButtonsV2 } from "./control-panel/TwistyButtonsV2";
|
|
24
|
+
import { TwistyScrubberV2 } from "./control-panel/TwistyScrubberV2";
|
|
25
|
+
import { downloadURL, getDefaultFilename, screenshot } from "./screenshot";
|
|
26
|
+
import { TwistyPlayerSettable } from "./TwistyPlayerSettable";
|
|
27
|
+
|
|
28
|
+
// TODO: I couldn't figure out how to use use more specific types. Ideally, we'd
|
|
29
|
+
// enforce consistency with the model.
|
|
30
|
+
export const twistyPlayerAttributeMap = {
|
|
31
|
+
// TODO: We assume each of these can be set using a string or will be automatically converted by JS (e.g. numbers). Can we enforce
|
|
32
|
+
// that with types? Do we need to add a translation mechanism for things we
|
|
33
|
+
// don't want to leave settable as strings?
|
|
34
|
+
// TODO: Enum validation.
|
|
35
|
+
|
|
36
|
+
// Alg
|
|
37
|
+
"alg": "alg",
|
|
38
|
+
"experimental-setup-alg": "experimentalSetupAlg",
|
|
39
|
+
|
|
40
|
+
// String-based
|
|
41
|
+
"experimental-setup-anchor": "experimentalSetupAnchor",
|
|
42
|
+
"puzzle": "puzzle",
|
|
43
|
+
"experimental-puzzle-description": "experimentalPuzzleDescription",
|
|
44
|
+
"visualization": "visualization",
|
|
45
|
+
"hint-facelets": "hintFacelets",
|
|
46
|
+
"experimental-stickering": "experimentalStickering",
|
|
47
|
+
"background": "background",
|
|
48
|
+
"control-panel": "controlPanel",
|
|
49
|
+
"back-view": "backView",
|
|
50
|
+
// "indexer": "indexer",
|
|
51
|
+
"viewer-link": "viewerLink",
|
|
52
|
+
|
|
53
|
+
// Number-based
|
|
54
|
+
"camera-latitude": "cameraLatitude",
|
|
55
|
+
"camera-longitude": "cameraLongitude",
|
|
56
|
+
"camera-distance": "cameraDistance",
|
|
57
|
+
"camera-latitude-limit": "cameraLatitudeLimit",
|
|
58
|
+
"tempo-scale": "tempoScale",
|
|
59
|
+
|
|
60
|
+
// URL-based
|
|
61
|
+
"experimental-sprite": "experimentalSprite",
|
|
62
|
+
"experimental-hint-sprite": "experimentalHintSprite",
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type TwistyPlayerAttribute = keyof typeof twistyPlayerAttributeMap;
|
|
66
|
+
|
|
67
|
+
const configKeys: Record<TwistyPlayerAttribute, true> = Object.fromEntries(
|
|
68
|
+
Object.values(twistyPlayerAttributeMap).map((s) => [s, true]),
|
|
69
|
+
) as any;
|
|
70
|
+
|
|
71
|
+
// TODO: Find a way to share this def with `attributeMap`.
|
|
72
|
+
export interface TwistyPlayerConfig {
|
|
73
|
+
// Alg
|
|
74
|
+
alg?: Alg | string;
|
|
75
|
+
experimentalSetupAlg?: Alg | string;
|
|
76
|
+
|
|
77
|
+
// String-based
|
|
78
|
+
experimentalSetupAnchor?: SetupToLocation; // TODO: "auto"
|
|
79
|
+
puzzle?: PuzzleID;
|
|
80
|
+
experimentalPuzzleDescription?: PuzzleDescriptionString;
|
|
81
|
+
visualization?: VisualizationFormatWithAuto;
|
|
82
|
+
hintFacelets?: HintFaceletStyleWithAuto;
|
|
83
|
+
experimentalStickering?: ExperimentalStickering;
|
|
84
|
+
background?: BackViewLayoutWithAuto;
|
|
85
|
+
controlPanel?: ControlPanelThemeWithAuto;
|
|
86
|
+
backView?: BackViewLayoutWithAuto;
|
|
87
|
+
// "indexer"?: "indexer";
|
|
88
|
+
viewerLink?: ViewerLinkPageWithAuto;
|
|
89
|
+
|
|
90
|
+
// Number-based
|
|
91
|
+
cameraLatitude?: number;
|
|
92
|
+
cameraLongitude?: number;
|
|
93
|
+
cameraDistance?: number;
|
|
94
|
+
cameraLatitudeLimit?: number;
|
|
95
|
+
tempoScale?: number;
|
|
96
|
+
|
|
97
|
+
// URL-based
|
|
98
|
+
experimentalSprite?: string | null;
|
|
99
|
+
experimentalHintSprite?: string | null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* TwistyPlayer is the heart of `cubing.js`. It can be used to display a puzzle on a web page like this:
|
|
104
|
+
*
|
|
105
|
+
* <script src="path/to/cubing/twisty" type="module"></script>
|
|
106
|
+
* <twisty-player alg="R U R'"></twisty-player>
|
|
107
|
+
*
|
|
108
|
+
* You can also construct it directly in JavaScript:
|
|
109
|
+
*
|
|
110
|
+
* import { TwistyPlayer } from "cubing/twisty";
|
|
111
|
+
* const twistyPlayer = new TwistyPlayer({alg: "R U R'"});
|
|
112
|
+
* // Once the page has loaded, you can do this:
|
|
113
|
+
* document.body.appendChild(twistyPlayer);
|
|
114
|
+
*
|
|
115
|
+
* See {@link https://js.cubing.net/cubing/} for more examples.
|
|
116
|
+
*/
|
|
117
|
+
export class TwistyPlayer
|
|
118
|
+
extends TwistyPlayerSettable
|
|
119
|
+
implements TwistyAnimationControllerDelegate
|
|
120
|
+
{
|
|
121
|
+
controller: TwistyPlayerController = new TwistyPlayerController(
|
|
122
|
+
this.experimentalModel,
|
|
123
|
+
this,
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
buttons: TwistyButtonsV2;
|
|
127
|
+
|
|
128
|
+
constructor(config: TwistyPlayerConfig = {}) {
|
|
129
|
+
super();
|
|
130
|
+
|
|
131
|
+
// TODO: double-check that these are all getting set sync without causing extra work.
|
|
132
|
+
for (const [propName, value] of Object.entries(config)) {
|
|
133
|
+
if (!configKeys[propName as TwistyPlayerAttribute]) {
|
|
134
|
+
console.warn(`Invalid config passed to TwistyPlayer: ${propName}`);
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
(this as any)[propName] = value;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
#controlsManager: ClassListManager<ControlPanelThemeWithAuto> =
|
|
142
|
+
new ClassListManager<ControlPanelThemeWithAuto>(
|
|
143
|
+
this,
|
|
144
|
+
"controls-",
|
|
145
|
+
(["auto"] as ControlPanelThemeWithAuto[]).concat(
|
|
146
|
+
Object.keys(controlsLocations) as ControlPanelThemeWithAuto[],
|
|
147
|
+
),
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
#visualizationWrapperElem = document.createElement("div"); // TODO: Better pattern.
|
|
151
|
+
#errorElem = document.createElement("div"); // TODO: Better pattern.
|
|
152
|
+
async connectedCallback(): Promise<void> {
|
|
153
|
+
this.addCSS(twistyPlayerCSS);
|
|
154
|
+
|
|
155
|
+
this.addElement(this.#visualizationWrapperElem).classList.add(
|
|
156
|
+
"visualization-wrapper",
|
|
157
|
+
);
|
|
158
|
+
this.addElement(this.#errorElem).classList.add("error-elem");
|
|
159
|
+
this.#errorElem.textContent = "Error";
|
|
160
|
+
this.experimentalModel.userVisibleErrorTracker.addFreshListener(
|
|
161
|
+
(userVisibleError) => {
|
|
162
|
+
const errorString: string | null = userVisibleError.errors[0] ?? null;
|
|
163
|
+
this.contentWrapper.classList.toggle("error", !!errorString);
|
|
164
|
+
if (errorString) {
|
|
165
|
+
this.#errorElem.textContent = errorString;
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
const scrubber = new TwistyScrubberV2(this.experimentalModel);
|
|
171
|
+
this.contentWrapper.appendChild(scrubber);
|
|
172
|
+
|
|
173
|
+
this.buttons = new TwistyButtonsV2(
|
|
174
|
+
this.experimentalModel,
|
|
175
|
+
this.controller,
|
|
176
|
+
this,
|
|
177
|
+
);
|
|
178
|
+
this.contentWrapper.appendChild(this.buttons);
|
|
179
|
+
|
|
180
|
+
this.experimentalModel.backgroundProp.addFreshListener(
|
|
181
|
+
(backgroundTheme: BackgroundThemeWithAuto) => {
|
|
182
|
+
this.contentWrapper.classList.toggle(
|
|
183
|
+
"checkered",
|
|
184
|
+
backgroundTheme !== "none",
|
|
185
|
+
);
|
|
186
|
+
},
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
this.experimentalModel.controlPanelProp.addFreshListener(
|
|
190
|
+
(controlPanel: ControlPanelThemeWithAuto) => {
|
|
191
|
+
this.#controlsManager.setValue(controlPanel);
|
|
192
|
+
},
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
this.experimentalModel.visualizationStrategyProp.addFreshListener(
|
|
196
|
+
this.#setVisualizationWrapper.bind(this),
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
this.experimentalModel.puzzleIDProp.addFreshListener(this.flash.bind(this));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
flash() {
|
|
203
|
+
this.#visualizationWrapper?.animate([{ opacity: 0.25 }, { opacity: 1 }], {
|
|
204
|
+
duration: 250,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
#visualizationWrapper: Twisty2DSceneWrapper | Twisty3DSceneWrapper | null =
|
|
209
|
+
null;
|
|
210
|
+
|
|
211
|
+
#visualizationStrategy: VisualizationStrategy | null = null;
|
|
212
|
+
#setVisualizationWrapper(strategy: VisualizationStrategy): void {
|
|
213
|
+
if (strategy !== this.#visualizationStrategy) {
|
|
214
|
+
this.#visualizationWrapper?.remove();
|
|
215
|
+
this.#visualizationWrapper?.disconnect();
|
|
216
|
+
let newWrapper: Twisty2DSceneWrapper | Twisty3DSceneWrapper;
|
|
217
|
+
switch (strategy) {
|
|
218
|
+
case "2D":
|
|
219
|
+
case "experimental-2D-LL":
|
|
220
|
+
newWrapper = new Twisty2DSceneWrapper(
|
|
221
|
+
this.experimentalModel,
|
|
222
|
+
strategy,
|
|
223
|
+
);
|
|
224
|
+
break;
|
|
225
|
+
case "Cube3D":
|
|
226
|
+
case "PG3D":
|
|
227
|
+
// TODO: Properly wire this up so we can set PG3D for the cube.
|
|
228
|
+
newWrapper = new Twisty3DSceneWrapper(this.experimentalModel);
|
|
229
|
+
break;
|
|
230
|
+
default:
|
|
231
|
+
throw new Error("Invalid visualization");
|
|
232
|
+
}
|
|
233
|
+
this.#visualizationWrapperElem.appendChild(newWrapper);
|
|
234
|
+
this.#visualizationWrapper = newWrapper;
|
|
235
|
+
this.#visualizationStrategy = strategy;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
jumpToStart(options?: { flash: boolean }): void {
|
|
240
|
+
this.controller.jumpToStart(options);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
jumpToEnd(options?: { flash: boolean }): void {
|
|
244
|
+
this.controller.jumpToEnd(options);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
play(): void {
|
|
248
|
+
this.controller.togglePlay(true);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
pause(): void {
|
|
252
|
+
this.controller.togglePlay(false);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Inspiration:
|
|
256
|
+
// - https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute (`force` argument)
|
|
257
|
+
// - https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/toggle (`force` argument)
|
|
258
|
+
// We still provide `play()` and `pause()` individually for convenience, though.
|
|
259
|
+
togglePlay(play?: boolean): void {
|
|
260
|
+
this.controller.togglePlay(play);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// TODO: Animate the new move.
|
|
264
|
+
experimentalAddMove(move: Move): void {
|
|
265
|
+
(async () => {
|
|
266
|
+
const alg = (await this.experimentalModel.algProp.get()).alg;
|
|
267
|
+
this.experimentalModel.algProp.set(new Alg(alg.concat([move])));
|
|
268
|
+
this.experimentalModel.timestampRequestProp.set("end");
|
|
269
|
+
})();
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
static get observedAttributes(): string[] {
|
|
273
|
+
return Object.keys(twistyPlayerAttributeMap);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
attributeChangedCallback(
|
|
277
|
+
attributeName: string,
|
|
278
|
+
_oldValue: string,
|
|
279
|
+
newValue: string,
|
|
280
|
+
): void {
|
|
281
|
+
const setterName =
|
|
282
|
+
twistyPlayerAttributeMap[attributeName as TwistyPlayerAttribute];
|
|
283
|
+
if (!setterName) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
(this as any)[setterName] = newValue;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// TODO: Make this more ergonomic and flexible.
|
|
291
|
+
// TODO: dimensions.
|
|
292
|
+
async experimentalScreenshot(options?: {
|
|
293
|
+
width: number;
|
|
294
|
+
height: number;
|
|
295
|
+
}): Promise<string> {
|
|
296
|
+
return (await screenshot(this.experimentalModel, options)).dataURL;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// TODO: Make this more ergonomic and flexible.
|
|
300
|
+
// TODO: dimensions.
|
|
301
|
+
async experimentalDownloadScreenshot(filename?: string): Promise<void> {
|
|
302
|
+
if (
|
|
303
|
+
["2D", "experimental-2D-LL"].includes(
|
|
304
|
+
await this.experimentalModel.visualizationStrategyProp.get(),
|
|
305
|
+
)
|
|
306
|
+
) {
|
|
307
|
+
// TODO: This has lots of async issues. It should also go into the screenshot impl file.
|
|
308
|
+
const wrapper2D = this.#visualizationWrapper as Twisty2DSceneWrapper;
|
|
309
|
+
const twisty2DPuzzle = await wrapper2D
|
|
310
|
+
.currentTwisty2DPuzzleWrapper()!
|
|
311
|
+
.twisty2DPuzzle();
|
|
312
|
+
const str = new XMLSerializer().serializeToString(
|
|
313
|
+
twisty2DPuzzle.svg.element,
|
|
314
|
+
);
|
|
315
|
+
const url = URL.createObjectURL(new Blob([str]));
|
|
316
|
+
downloadURL(
|
|
317
|
+
url,
|
|
318
|
+
filename ?? (await getDefaultFilename(this.experimentalModel)),
|
|
319
|
+
"svg",
|
|
320
|
+
);
|
|
321
|
+
} else {
|
|
322
|
+
await (await screenshot(this.experimentalModel)).download(filename);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
customElementsShim.define("twisty-player", TwistyPlayer);
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { Alg } from "../../alg";
|
|
2
|
+
import type { PuzzleDescriptionString } from "../../puzzle-geometry/PGPuzzles";
|
|
3
|
+
import type { ExperimentalStickering } from "../../twisty";
|
|
4
|
+
import type { BackgroundThemeWithAuto } from "../model/props/viewer/BackgroundProp";
|
|
5
|
+
import type { BackViewLayoutWithAuto } from "../model/props/viewer/BackViewProp";
|
|
6
|
+
import type { ControlPanelThemeWithAuto } from "../model/props/viewer/ControlPanelProp";
|
|
7
|
+
import type { HintFaceletStyleWithAuto } from "../model/props/puzzle/display/HintFaceletProp";
|
|
8
|
+
import type { IndexerStrategyName } from "../model/props/puzzle/state/IndexerConstructorRequestProp";
|
|
9
|
+
import type { TimestampRequest } from "../model/props/timeline/TimestampRequestProp";
|
|
10
|
+
import type { ViewerLinkPageWithAuto } from "../model/props/viewer/ViewerLinkProp";
|
|
11
|
+
import type { VisualizationFormatWithAuto } from "../model/props/viewer/VisualizationProp";
|
|
12
|
+
import { TwistyPlayerModel } from "../model/TwistyPlayerModel";
|
|
13
|
+
import type { MillisecondTimestamp } from "../old/animation/cursor/CursorTypes";
|
|
14
|
+
import { ManagedCustomElement } from "../old/dom/element/ManagedCustomElement";
|
|
15
|
+
import type { PuzzleID, SetupToLocation } from "../old/dom/TwistyPlayerConfig";
|
|
16
|
+
|
|
17
|
+
function err(propName: string): Error {
|
|
18
|
+
return new Error(
|
|
19
|
+
`Cannot get \`.${propName}\` directly from a \`TwistyPlayer\`.`,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// prettier-ignore
|
|
24
|
+
export abstract class TwistyPlayerSettable extends ManagedCustomElement {
|
|
25
|
+
experimentalModel: TwistyPlayerModel = new TwistyPlayerModel();
|
|
26
|
+
|
|
27
|
+
set alg(newAlg: Alg | string) { this.experimentalModel.algProp.set(newAlg); }
|
|
28
|
+
get alg(): never { throw err("alg"); }
|
|
29
|
+
|
|
30
|
+
set experimentalSetupAlg(newSetup: Alg | string) { this.experimentalModel.setupProp.set(newSetup); }
|
|
31
|
+
get experimentalSetupAlg(): never { throw err("setup"); }
|
|
32
|
+
|
|
33
|
+
set experimentalSetupAnchor(anchor: SetupToLocation) { this.experimentalModel.setupAnchorProp.set(anchor); }
|
|
34
|
+
get experimentalSetupAnchor(): never { throw err("anchor"); }
|
|
35
|
+
|
|
36
|
+
set puzzle(puzzleID: PuzzleID) { this.experimentalModel.puzzleIDRequestProp.set(puzzleID); }
|
|
37
|
+
get puzzle(): never { throw err("puzzle"); }
|
|
38
|
+
|
|
39
|
+
set experimentalPuzzleDescription(puzzleDescription: PuzzleDescriptionString) { this.experimentalModel.puzzleDescriptionRequestProp.set(puzzleDescription); }
|
|
40
|
+
get experimentalPuzzleDescription(): never { throw err("experimentalPuzzleDescription"); }
|
|
41
|
+
|
|
42
|
+
set timestamp(timestamp: TimestampRequest) { this.experimentalModel.timestampRequestProp.set(timestamp); }
|
|
43
|
+
get timestamp(): never { throw err("timestamp"); }
|
|
44
|
+
|
|
45
|
+
set hintFacelets(hintFaceletStyle: HintFaceletStyleWithAuto) { this.experimentalModel.hintFaceletProp.set(hintFaceletStyle); }
|
|
46
|
+
get hintFacelets(): never { throw err("hintFacelets"); }
|
|
47
|
+
|
|
48
|
+
set experimentalStickering(stickering: ExperimentalStickering) { this.experimentalModel.stickeringProp.set(stickering); }
|
|
49
|
+
get experimentalStickering(): never { throw err("stickering"); }
|
|
50
|
+
|
|
51
|
+
set backView(backView: BackViewLayoutWithAuto) { this.experimentalModel.backViewProp.set(backView); }
|
|
52
|
+
get backView(): never { throw err("backView"); }
|
|
53
|
+
|
|
54
|
+
set background(backgroundTheme: BackgroundThemeWithAuto) { this.experimentalModel.backgroundProp.set(backgroundTheme); }
|
|
55
|
+
get background(): never { throw err("background"); }
|
|
56
|
+
|
|
57
|
+
set controlPanel(newControlPanel: ControlPanelThemeWithAuto) { this.experimentalModel.controlPanelProp.set(newControlPanel); }
|
|
58
|
+
get controlPanel(): never { throw new Error( "Cannot get `.controlPanel` directly from a `TwistyPlayer`."); }
|
|
59
|
+
|
|
60
|
+
set visualization(visualizationFormat: VisualizationFormatWithAuto) { this.experimentalModel.visualizationFormatProp.set(visualizationFormat); }
|
|
61
|
+
get visualization(): never { throw new Error( "Cannot get `.visualization` directly from a `TwistyPlayer`."); }
|
|
62
|
+
|
|
63
|
+
set viewerLink(viewerLinkPage: ViewerLinkPageWithAuto) { this.experimentalModel.viewerLinkProp.set(viewerLinkPage); }
|
|
64
|
+
get viewerLink(): never { throw err("viewerLink"); }
|
|
65
|
+
|
|
66
|
+
set cameraLatitude(latitude: number) { this.experimentalModel.orbitCoordinatesRequestProp.set({ latitude }); }
|
|
67
|
+
get cameraLatitude(): never { throw new Error( "Cannot get `.cameraLatitude` directly from a `TwistyPlayer`."); }
|
|
68
|
+
|
|
69
|
+
set cameraLongitude(longitude: number) { this.experimentalModel.orbitCoordinatesRequestProp.set({ longitude }); }
|
|
70
|
+
get cameraLongitude(): never { throw new Error( "Cannot get `.cameraLongitude` directly from a `TwistyPlayer`."); }
|
|
71
|
+
|
|
72
|
+
set cameraDistance(distance: number) { this.experimentalModel.orbitCoordinatesRequestProp.set({ distance }); }
|
|
73
|
+
get cameraDistance(): never { throw new Error( "Cannot get `.cameraDistance` directly from a `TwistyPlayer`."); }
|
|
74
|
+
|
|
75
|
+
set cameraLatitudeLimit(latitudeLimit: number) { this.experimentalModel.latitudeLimitProp.set(latitudeLimit); }
|
|
76
|
+
get cameraLatitudeLimit(): never { throw new Error( "Cannot get `.cameraLatitudeLimit` directly from a `TwistyPlayer`."); }
|
|
77
|
+
|
|
78
|
+
set indexer(indexer: IndexerStrategyName) { this.experimentalModel.indexerConstructorRequestProp.set(indexer); }
|
|
79
|
+
get indexer(): never { throw err("indexer"); }
|
|
80
|
+
|
|
81
|
+
set tempoScale(newTempoScale: number) { this.experimentalModel.tempoScaleProp.set(newTempoScale); }
|
|
82
|
+
get tempoScale(): never { throw err("tempoScale"); }
|
|
83
|
+
|
|
84
|
+
set experimentalSprite(url: string | URL) { this.experimentalModel.foundationStickerSpriteURL.set(url); }
|
|
85
|
+
get experimentalSprite(): never { throw err("experimentalSprite"); }
|
|
86
|
+
|
|
87
|
+
set experimentalHintSprite(url: string | URL) { this.experimentalModel.hintStickerSpriteURL.set(url); }
|
|
88
|
+
get experimentalHintSprite(): never { throw err("experimentalHintSprite"); }
|
|
89
|
+
|
|
90
|
+
experimentalGet = new ExperimentalGetters(this.experimentalModel)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
class ExperimentalGetters {
|
|
94
|
+
constructor(private model: TwistyPlayerModel) {}
|
|
95
|
+
|
|
96
|
+
async alg(): Promise<Alg> {
|
|
97
|
+
return (await this.model.algProp.get()).alg;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async setupAlg(): Promise<Alg> {
|
|
101
|
+
return (await this.model.setupProp.get()).alg;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
puzzleID(): Promise<PuzzleID> {
|
|
105
|
+
return this.model.puzzleIDProp.get();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async timestamp(): Promise<MillisecondTimestamp> {
|
|
109
|
+
return (await this.model.detailedTimelineInfoProp.get()).timestamp;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BoundaryType,
|
|
3
|
+
Direction,
|
|
4
|
+
} from "../../old/animation/cursor/CursorTypes";
|
|
5
|
+
import { buttonCSS, buttonGridCSS } from "../../old/dom/controls/buttons.css";
|
|
6
|
+
import { ClassListManager } from "../../old/dom/element/ClassListManager";
|
|
7
|
+
import { ManagedCustomElement } from "../../old/dom/element/ManagedCustomElement";
|
|
8
|
+
import { customElementsShim } from "../../old/dom/element/node-custom-element-shims";
|
|
9
|
+
import {
|
|
10
|
+
ButtonAppearances,
|
|
11
|
+
ButtonIcon,
|
|
12
|
+
buttonIcons,
|
|
13
|
+
} from "../../model/props/viewer/ButtonAppearanceProp";
|
|
14
|
+
import type { TwistyPlayerModel } from "../../model/TwistyPlayerModel";
|
|
15
|
+
import type { TwistyPlayerController } from "../../controllers/TwistyPlayerController";
|
|
16
|
+
import {
|
|
17
|
+
documentExitFullscreen,
|
|
18
|
+
documentFullscreenElement,
|
|
19
|
+
requestFullscreen,
|
|
20
|
+
} from "./webkit-fullscreen";
|
|
21
|
+
|
|
22
|
+
const buttonCommands = {
|
|
23
|
+
"fullscreen": true,
|
|
24
|
+
"jump-to-start": true,
|
|
25
|
+
"play-step-backwards": true,
|
|
26
|
+
"play-pause": true,
|
|
27
|
+
"play-step": true,
|
|
28
|
+
"jump-to-end": true,
|
|
29
|
+
"twizzle-link": true,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type ButtonCommand = keyof typeof buttonCommands;
|
|
33
|
+
|
|
34
|
+
export class TwistyButtonsV2 extends ManagedCustomElement {
|
|
35
|
+
buttons: Record<ButtonCommand, TwistyButtonV2> | null = null;
|
|
36
|
+
|
|
37
|
+
// TODO: Privacy
|
|
38
|
+
constructor(
|
|
39
|
+
public model?: TwistyPlayerModel,
|
|
40
|
+
public controller?: TwistyPlayerController,
|
|
41
|
+
private fullscreenElement?: HTMLElement,
|
|
42
|
+
) {
|
|
43
|
+
super();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
connectedCallback(): void {
|
|
47
|
+
this.addCSS(buttonGridCSS);
|
|
48
|
+
const buttons: Partial<Record<ButtonCommand, TwistyButtonV2>> = {};
|
|
49
|
+
for (const command in buttonCommands) {
|
|
50
|
+
const button = new TwistyButtonV2();
|
|
51
|
+
buttons[command as ButtonCommand] = button;
|
|
52
|
+
// Why does this still fire with the `disabled` attribute?
|
|
53
|
+
button.addEventListener("click", () =>
|
|
54
|
+
this.#onCommand(command as ButtonCommand),
|
|
55
|
+
);
|
|
56
|
+
this.addElement(button);
|
|
57
|
+
}
|
|
58
|
+
this.buttons = buttons as Record<ButtonCommand, TwistyButtonV2>;
|
|
59
|
+
|
|
60
|
+
this.model?.buttonAppearanceProp.addFreshListener(this.update.bind(this));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#onCommand(command: ButtonCommand) {
|
|
64
|
+
switch (command) {
|
|
65
|
+
case "fullscreen":
|
|
66
|
+
this.onFullscreenButton();
|
|
67
|
+
break;
|
|
68
|
+
case "jump-to-start":
|
|
69
|
+
this.controller?.jumpToStart({ flash: true });
|
|
70
|
+
break;
|
|
71
|
+
case "play-step-backwards":
|
|
72
|
+
this.controller?.animationController.play({
|
|
73
|
+
direction: Direction.Backwards,
|
|
74
|
+
untilBoundary: BoundaryType.Move,
|
|
75
|
+
});
|
|
76
|
+
break;
|
|
77
|
+
case "play-pause":
|
|
78
|
+
this.controller?.togglePlay();
|
|
79
|
+
break;
|
|
80
|
+
case "play-step":
|
|
81
|
+
this.controller?.animationController.play({
|
|
82
|
+
direction: Direction.Forwards,
|
|
83
|
+
untilBoundary: BoundaryType.Move,
|
|
84
|
+
});
|
|
85
|
+
break;
|
|
86
|
+
case "jump-to-end":
|
|
87
|
+
this.controller?.jumpToEnd({ flash: true });
|
|
88
|
+
break;
|
|
89
|
+
case "twizzle-link":
|
|
90
|
+
this.controller?.visitTwizzleLink();
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
throw new Error("Missing command");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// TODO: Should we have a prop, or a way to query if we're fullscreen?
|
|
98
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen
|
|
99
|
+
async onFullscreenButton(): Promise<void> {
|
|
100
|
+
if (!this.fullscreenElement) {
|
|
101
|
+
throw new Error("Attempted to go fullscreen without an element.");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (documentFullscreenElement() === this.fullscreenElement) {
|
|
105
|
+
documentExitFullscreen();
|
|
106
|
+
} else {
|
|
107
|
+
// TODO: Propagate button info to `ButtonAppearanceProp`.
|
|
108
|
+
this.buttons?.fullscreen.setIcon("exit-fullscreen");
|
|
109
|
+
|
|
110
|
+
requestFullscreen(this.fullscreenElement);
|
|
111
|
+
|
|
112
|
+
const onFullscreen = (): void => {
|
|
113
|
+
if (documentFullscreenElement() !== this.fullscreenElement) {
|
|
114
|
+
this.buttons?.fullscreen.setIcon("enter-fullscreen");
|
|
115
|
+
window.removeEventListener("fullscreenchange", onFullscreen);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
window.addEventListener("fullscreenchange", onFullscreen);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async update(buttonAppearances: ButtonAppearances): Promise<void> {
|
|
123
|
+
// TODO: Check that we have every command?
|
|
124
|
+
for (const command in buttonCommands) {
|
|
125
|
+
// TODO: Why doesn't `command` have the type `ButtonCommand`?
|
|
126
|
+
const button = this.buttons![command as ButtonCommand];
|
|
127
|
+
// TODO: track individual changes?
|
|
128
|
+
const info = buttonAppearances[command as ButtonCommand];
|
|
129
|
+
button.button.disabled = !info.enabled;
|
|
130
|
+
button.button.title = info.title;
|
|
131
|
+
button.setIcon(info.icon);
|
|
132
|
+
button.hidden = !!info.hidden;
|
|
133
|
+
// button.textContent = info.icon;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
customElementsShim.define("twisty-buttons-v2", TwistyButtonsV2);
|
|
139
|
+
|
|
140
|
+
class TwistyButtonV2 extends ManagedCustomElement {
|
|
141
|
+
button: HTMLButtonElement = document.createElement("button"); // TODO: async?
|
|
142
|
+
|
|
143
|
+
connectedCallback() {
|
|
144
|
+
this.addCSS(buttonCSS);
|
|
145
|
+
this.addElement(this.button);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
#iconManager: ClassListManager<ButtonIcon> = new ClassListManager(
|
|
149
|
+
this,
|
|
150
|
+
"svg-",
|
|
151
|
+
buttonIcons,
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
setIcon(iconName: ButtonIcon): void {
|
|
155
|
+
this.#iconManager.setValue(iconName);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
customElementsShim.define("twisty-button-v2", TwistyButtonV2);
|