@cyclonium/handles 0.0.105 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ export declare class HandleContext {
11
11
  get input(): HandleInputContext;
12
12
  get renderer(): HandleRenderer;
13
13
  destroy_internal(): void;
14
- forEach<T>(iterable: ReadonlyArray<T>, keyGenerator: (item: T) => string, callback: (item: T, index: number) => void): void;
14
+ forEach<T>(iterable: readonly T[], keyGenerator: (item: T) => string, callback: (item: T, index: number) => void): void;
15
15
  allocateSequentialKey(): HandleKey;
16
16
  pushScope(key: string): void;
17
17
  popScope(): void;
@@ -10,11 +10,11 @@ export declare class HandleInputContext {
10
10
  private _hostInput;
11
11
  constructor(_hostInput: HandleHostInput);
12
12
  get mousePosition(): Vec2;
13
- mouseButtonDown(button: HandleMouseButton): boolean;
14
- mouseRay(): geometry.Ray;
15
13
  get mouseAltKey(): boolean;
16
14
  get mouseCtrlKey(): boolean;
17
15
  get mouseShiftKey(): boolean;
16
+ mouseButtonDown(button: HandleMouseButton): boolean;
17
+ mouseRay(): geometry.Ray;
18
18
  startFrame_internal(_opts: HandleContext.FrameStartOptions): void;
19
19
  endFrame_internal(): void;
20
20
  captureMouse(): void;
@@ -13,12 +13,6 @@ export class HandleInputContext {
13
13
  get mousePosition() {
14
14
  return this._hostInput.mouse.position;
15
15
  }
16
- mouseButtonDown(button) {
17
- return (this._hostInput.mouse.buttons & (1 << button)) !== 0;
18
- }
19
- mouseRay() {
20
- return this._hostInput.mouse.mouseRay();
21
- }
22
16
  get mouseAltKey() {
23
17
  return this._hostInput.mouse.altKey;
24
18
  }
@@ -28,6 +22,12 @@ export class HandleInputContext {
28
22
  get mouseShiftKey() {
29
23
  return this._hostInput.mouse.shiftKey;
30
24
  }
25
+ mouseButtonDown(button) {
26
+ return (this._hostInput.mouse.buttons & (1 << button)) !== 0;
27
+ }
28
+ mouseRay() {
29
+ return this._hostInput.mouse.mouseRay();
30
+ }
31
31
  startFrame_internal(_opts) {
32
32
  this._hostInput.mouse.wantCapture = false;
33
33
  }
@@ -8,11 +8,13 @@ export class HandleRenderer {
8
8
  this._canvas.destroy();
9
9
  }
10
10
  startFrame() {
11
+ // Canvas3D does not require explicit per-frame initialization.
11
12
  }
12
13
  endFrame() {
13
14
  this._canvas.commit();
14
15
  }
15
16
  drawRect(_opts) {
17
+ // Rectangle rendering is reserved for the editor handle implementation.
16
18
  }
17
19
  drawLine2D(opts) {
18
20
  this._canvas.beginPath();
@@ -43,7 +43,7 @@ export class Bounds2DHandleProvider extends HandleProvider {
43
43
  draw(ctx, bounds, opts) {
44
44
  const essentials = this._cacheEssentials;
45
45
  const { centerPoint, leftTopPoint, rightTopPoint, leftBottomPoint, rightBottomPoint, topEdge, bottomEdge, leftEdge, rightEdge, } = essentials;
46
- const { lock = 0, } = opts || {};
46
+ const { lock = 0, } = opts ?? {};
47
47
  const rotationQuat = undefined;
48
48
  const baseRight = Vec3.UNIT_X;
49
49
  const baseUp = Vec3.UNIT_Y;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyclonium/handles",
3
- "version": "0.0.105",
3
+ "version": "1.0.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shrinktofit/cyclonium",
@@ -17,10 +17,10 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@cyclonium/core": "0.0.105"
20
+ "@cyclonium/core": "1.0.1"
21
21
  },
22
22
  "dependencies": {
23
- "@cyclonium/canvas-3d": "0.0.105"
23
+ "@cyclonium/canvas-3d": "1.0.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "typescript": "^6.0.2",