1
1
import type { ExperimentalStickering } from "../../.." ;
2
- import type { Alg } from "../../../../alg" ;
3
- import type { MillisecondTimestamp } from "../../../animation/cursor/CursorTypes" ;
4
2
import { ClassListManager } from "../../element/ClassListManager" ;
5
- import { ManagedCustomElement } from "../../element/ManagedCustomElement" ;
6
3
import { customElementsShim } from "../../element/node-custom-element-shims" ;
7
4
import { twistyPlayerCSS } from "../../TwistyPlayer.css_" ;
8
5
import {
@@ -11,11 +8,7 @@ import {
11
8
SetupToLocation ,
12
9
} from "../../TwistyPlayerConfig" ;
13
10
import type { BackgroundThemeWithAuto } from "../props/depth-0/BackgroundProp" ;
14
- import type { BackViewLayoutWithAuto } from "../props/depth-0/BackViewProp" ;
15
11
import type { ControlPanelThemeWithAuto } from "../props/depth-0/ControlPanelProp" ;
16
- import type { HintFaceletStyleWithAuto } from "../props/depth-0/HintFaceletProp" ;
17
- import type { IndexerStrategyName } from "../props/depth-0/IndexerConstructorRequestProp" ;
18
- import type { ViewerLinkPageWithAuto } from "../props/depth-0/ViewerLinkProp" ;
19
12
import type { VisualizationFormatWithAuto } from "../props/depth-0/VisualizationProp" ;
20
13
import { TwistyPlayerModel } from "../props/TwistyPlayerModel" ;
21
14
import { Twisty2DSceneWrapper } from "./2D/Twisty2DSceneWrapper" ;
@@ -24,9 +17,10 @@ import { TwistyButtonsV2 } from "./control-panel/TwistyButtonsV2";
24
17
import { TwistyScrubberV2 } from "./control-panel/TwistyScrubberV2" ;
25
18
import type { TwistyAnimationControllerDelegate } from "./TwistyAnimationController" ;
26
19
import { TwistyPlayerController } from "./TwistyPlayerController" ;
20
+ import { TwistyPlayerSettable } from "./TwistyPlayerSettable" ;
27
21
28
22
export class TwistyPlayerV2
29
- extends ManagedCustomElement
23
+ extends TwistyPlayerSettable
30
24
implements TwistyAnimationControllerDelegate
31
25
{
32
26
model : TwistyPlayerModel = new TwistyPlayerModel ( ) ;
@@ -119,166 +113,6 @@ export class TwistyPlayerV2
119
113
}
120
114
}
121
115
122
- set alg ( newAlg : Alg | string ) {
123
- this . model . algProp . set ( newAlg ) ;
124
- }
125
-
126
- get alg ( ) : never {
127
- throw new Error ( "Cannot get `.alg` directly from a `TwistyPlayer`." ) ;
128
- }
129
-
130
- set setup ( newSetup : Alg | string ) {
131
- this . model . setupProp . set ( newSetup ) ;
132
- }
133
-
134
- get setup ( ) : never {
135
- throw new Error ( "Cannot get `.setup` directly from a `TwistyPlayer`." ) ;
136
- }
137
-
138
- set experimentalSetupAnchor ( anchor : SetupToLocation ) {
139
- this . model . setupAnchorProp . set ( anchor ) ;
140
- }
141
-
142
- get experimentalSetupAnchor ( ) : never {
143
- throw new Error ( "Cannot get `.anchor` directly from a `TwistyPlayer`." ) ;
144
- }
145
-
146
- set puzzle ( puzzleID : PuzzleID ) {
147
- this . model . puzzleProp . set ( puzzleID ) ;
148
- }
149
-
150
- get puzzle ( ) : never {
151
- throw new Error ( "Cannot get `.puzzle` directly from a `TwistyPlayer`." ) ;
152
- }
153
-
154
- set timestamp ( timestamp : MillisecondTimestamp ) {
155
- this . model . timestampRequestProp . set ( timestamp ) ;
156
- }
157
-
158
- get timestamp ( ) : never {
159
- throw new Error ( "Cannot get `.timestamp` directly from a `TwistyPlayer`." ) ;
160
- }
161
-
162
- set hintFacelets ( hintFaceletStyle : HintFaceletStyleWithAuto ) {
163
- this . model . hintFaceletProp . set ( hintFaceletStyle ) ;
164
- }
165
-
166
- get hintFacelets ( ) : never {
167
- throw new Error (
168
- "Cannot get `.hintFacelets` directly from a `TwistyPlayer`." ,
169
- ) ;
170
- }
171
-
172
- set experimentalStickering ( stickering : ExperimentalStickering ) {
173
- this . model . stickeringProp . set ( stickering ) ;
174
- }
175
-
176
- get experimentalStickering ( ) : never {
177
- throw new Error ( "Cannot get `.stickering` directly from a `TwistyPlayer`." ) ;
178
- }
179
-
180
- set backView ( backView : BackViewLayoutWithAuto ) {
181
- this . model . backViewProp . set ( backView ) ;
182
- }
183
-
184
- get backView ( ) : never {
185
- throw new Error ( "Cannot get `.backView` directly from a `TwistyPlayer`." ) ;
186
- }
187
-
188
- set background ( backgroundTheme : BackgroundThemeWithAuto ) {
189
- this . model . backgroundProp . set ( backgroundTheme ) ;
190
- }
191
-
192
- get background ( ) : never {
193
- throw new Error ( "Cannot get `.background` directly from a `TwistyPlayer`." ) ;
194
- }
195
-
196
- set controlPanel ( newControlPanel : ControlPanelThemeWithAuto ) {
197
- this . model . controlPanelProp . set ( newControlPanel ) ;
198
- }
199
-
200
- get controlPanel ( ) : never {
201
- throw new Error (
202
- "Cannot get `.controlPanel` directly from a `TwistyPlayer`." ,
203
- ) ;
204
- }
205
-
206
- set visualization ( visualizationFormat : VisualizationFormatWithAuto ) {
207
- this . model . visualizationFormatProp . set ( visualizationFormat ) ;
208
- }
209
-
210
- get visualization ( ) : never {
211
- throw new Error (
212
- "Cannot get `.visualization` directly from a `TwistyPlayer`." ,
213
- ) ;
214
- }
215
-
216
- set viewerLink ( viewerLinkPage : ViewerLinkPageWithAuto ) {
217
- this . model . viewerLinkProp . set ( viewerLinkPage ) ;
218
- }
219
-
220
- get viewerLink ( ) : never {
221
- throw new Error ( "Cannot get `.viewerLink` directly from a `TwistyPlayer`." ) ;
222
- }
223
-
224
- set cameraLatitude ( latitude : number ) {
225
- this . model . orbitCoordinatesRequestProp . set ( { latitude } ) ;
226
- }
227
-
228
- get cameraLatitude ( ) : never {
229
- throw new Error (
230
- "Cannot get `.cameraLatitude` directly from a `TwistyPlayer`." ,
231
- ) ;
232
- }
233
-
234
- set cameraLongitude ( longitude : number ) {
235
- this . model . orbitCoordinatesRequestProp . set ( { longitude } ) ;
236
- }
237
-
238
- get cameraLongitude ( ) : never {
239
- throw new Error (
240
- "Cannot get `.cameraLongitude` directly from a `TwistyPlayer`." ,
241
- ) ;
242
- }
243
-
244
- set cameraDistance ( distance : number ) {
245
- this . model . orbitCoordinatesRequestProp . set ( { distance } ) ;
246
- }
247
-
248
- get cameraDistance ( ) : never {
249
- throw new Error (
250
- "Cannot get `.cameraDistance` directly from a `TwistyPlayer`." ,
251
- ) ;
252
- }
253
-
254
- set cameraLatitudeLimit ( latitudeLimit : number ) {
255
- this . model . latitudeLimitProp . set ( latitudeLimit ) ;
256
- }
257
-
258
- get cameraLatitudeLimit ( ) : never {
259
- throw new Error (
260
- "Cannot get `.cameraLatitudeLimit` directly from a `TwistyPlayer`." ,
261
- ) ;
262
- }
263
-
264
- // TODO: this needs a much better name.
265
- set indexer ( indexer : IndexerStrategyName ) {
266
- this . model . indexerConstructorRequestProp . set ( indexer ) ;
267
- }
268
-
269
- get indexer ( ) : never {
270
- throw new Error ( "Cannot get `.indexer` directly from a `TwistyPlayer`." ) ;
271
- }
272
-
273
- // TODO: this needs a much better name.
274
- set tempoScale ( newTempoScale : number ) {
275
- this . model . tempoScaleProp . set ( newTempoScale ) ;
276
- }
277
-
278
- get tempoScale ( ) : never {
279
- throw new Error ( "Cannot get `.tempoScale` directly from a `TwistyPlayer`." ) ;
280
- }
281
-
282
116
jumpToStart ( options ?: { flash : boolean } ) : void {
283
117
this . controller . jumpToStart ( options ) ;
284
118
}
0 commit comments