arcanumcube 0.1.2 → 0.1.4

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/dist/index.html CHANGED
@@ -9,10 +9,9 @@
9
9
  {
10
10
  "imports": {
11
11
  "arcanumcube": "./esm/arcanumcube.module.min.js",
12
- "three": "https://cdn.jsdelivr.net/npm/three@0.173.0/+esm",
13
- "three/examples/jsm/": "https://cdn.jsdelivr.net/npm/three@0.173.0/examples/jsm/",
14
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.173.0/examples/jsm/",
15
- "@tweenjs/tween.js": "https://cdn.jsdelivr.net/npm/@tweenjs/tween.js@25.0.0/+esm"
12
+ "three": "https://cdn.jsdelivr.net/npm/three@0.174.0/+esm",
13
+ "three/examples/jsm/": "https://cdn.jsdelivr.net/npm/three@0.174.0/examples/jsm/",
14
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.174.0/examples/jsm/"
16
15
  }
17
16
  }
18
17
  </script>
@@ -66,7 +65,7 @@
66
65
 
67
66
  renderer.setAnimationLoop((time) => {
68
67
  // animate twisting
69
- arccube.updateTweens();
68
+ arccube.update();
70
69
 
71
70
  // orbit control
72
71
  controls.update();
@@ -1,5 +1,6 @@
1
1
  import * as THREE from 'three';
2
2
  import * as ARCCUBE from './core.js';
3
+ export declare function loadDefaultLogoTexture(): THREE.Texture;
3
4
  export declare function GetSkinByName(name: string): Skin;
4
5
  export declare function GetSkinNameList(): string[];
5
6
  export type Skin = {
@@ -7,6 +7,7 @@ export type TwistOptions = {
7
7
  onStart?: (self: WebGLArcanumCube) => void;
8
8
  onTwisted?: (self: WebGLArcanumCube, twist: Twist, step: number, total: number) => void;
9
9
  onComplete?: (self: WebGLArcanumCube) => void;
10
+ onSolved?: (self: WebGLArcanumCube) => void;
10
11
  };
11
12
  type WebGLSticker = Sticker & {
12
13
  mesh?: THREE.Mesh;
@@ -52,7 +53,6 @@ export type WebGLArcanumCubeConfig = {
52
53
  envMap?: THREE.Texture;
53
54
  showSelectedCube: boolean;
54
55
  showTwistGroup: boolean;
55
- autoReset: boolean;
56
56
  enableCoreLight: boolean;
57
57
  coreLightColor: THREE.ColorRepresentation;
58
58
  coreLightIntensity: number;
@@ -61,7 +61,7 @@ export type WebGLArcanumCubeConfig = {
61
61
  twistOptions?: TwistOptions;
62
62
  };
63
63
  /** Arcanum Cube object for WebGL class */
64
- declare class WebGLArcanumCube extends ArcanumCube {
64
+ export declare class WebGLArcanumCube extends ArcanumCube {
65
65
  /** config */
66
66
  private _config;
67
67
  /** cube objects matrix */
@@ -82,16 +82,20 @@ declare class WebGLArcanumCube extends ArcanumCube {
82
82
  private _draggingTwist?;
83
83
  /** max degree to cancel the dragging */
84
84
  private _cancelDragDeg;
85
- /** tween group */
86
- private _tweens;
85
+ /** easing group */
86
+ private _easings;
87
87
  /** light at the center of cube */
88
88
  private _coreLights;
89
+ /** status of locking the twist */
90
+ private _lockTwist;
89
91
  constructor(options?: Partial<WebGLArcanumCubeConfig>);
90
92
  getGroup(): THREE.Group;
91
93
  getCubeObjectList(): THREE.Group[];
92
94
  init(): Promise<void>;
93
95
  private _init;
94
96
  setSkin(skin: Skin): Promise<void>;
97
+ lockTwist(flag: boolean): void;
98
+ isTwisting(): boolean;
95
99
  reset(duration?: number): void;
96
100
  selectedCube(): WebGLCube | undefined;
97
101
  selectedSticker(): WebGLSticker | undefined;
@@ -110,12 +114,11 @@ declare class WebGLArcanumCube extends ArcanumCube {
110
114
  dragTwistEnd(): void;
111
115
  scramble(steps?: number, duration?: number): void;
112
116
  undo(steps?: number, duration?: number): void;
113
- tweenTwist(twist: Twist | Twist[], reverse?: boolean, duration?: number, cancel?: boolean, options?: TwistOptions): void;
117
+ easingTwist(twist: Twist | Twist[], reverse?: boolean, duration?: number, cancel?: boolean, options?: TwistOptions): void;
114
118
  private _immediatelyTwist;
115
- private _tweenTwist;
116
- updateTweens(): void;
119
+ private _easingTwist;
120
+ update(): void;
117
121
  setCoreLightColor(color: THREE.ColorRepresentation): void;
118
122
  setCoreLightIntensity(intensity: number): void;
119
123
  }
120
- export * from './core.js';
121
- export { WebGLArcanumCube };
124
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcanumcube",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Arcanum Cube",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -9,18 +9,29 @@
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/mawxiwtz/arcanumcube.git"
11
11
  },
12
+ "keywords": [
13
+ "rubiks-cube",
14
+ "puzzle",
15
+ "three",
16
+ "webgl"
17
+ ],
12
18
  "files": [
13
19
  "dist",
14
20
  "LICENSE",
15
21
  "README.md"
16
22
  ],
17
- "main": "./dist/cjs/arcanumcube.cjs",
23
+ "main": "./dist/cjs/arcanumcube.js",
18
24
  "module": "./dist/esm/arcanumcube.module.js",
19
25
  "exports": {
20
26
  ".": {
21
27
  "types": "./dist/types/arcanumcube.d.ts",
22
28
  "import": "./dist/esm/arcanumcube.module.js",
23
- "require": "./dist/cjs/arcanumcube.cjs"
29
+ "require": "./dist/cjs/arcanumcube.js"
30
+ },
31
+ "./core": {
32
+ "types": "./dist/types/core.d.ts",
33
+ "import": "./dist/esm/core.module.js",
34
+ "require": "./dist/cjs/core.js"
24
35
  }
25
36
  },
26
37
  "scripts": {
@@ -40,7 +51,7 @@
40
51
  "@types/eslint": "^9.6.1",
41
52
  "@types/jest": "^29.5.14",
42
53
  "@types/node": "^22.13.0",
43
- "@types/three": "^0.173.0",
54
+ "@types/three": "^0.174.0",
44
55
  "@typescript-eslint/eslint-plugin": "^8.22.0",
45
56
  "@typescript-eslint/parser": "^8.22.0",
46
57
  "chalk": "^5.4.1",
@@ -50,7 +61,7 @@
50
61
  "fs-extra": "^11.3.0",
51
62
  "jest": "^29.7.0",
52
63
  "prettier": "^3.4.2",
53
- "three": "^0.173.0",
64
+ "three": "^0.174.0",
54
65
  "ts-jest": "^29.2.5",
55
66
  "typedoc": "^0.27.6",
56
67
  "typescript": "^5.7.3"