@n3rdw1z4rd/core 0.18.1 → 0.18.3

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.d.mts CHANGED
@@ -380,6 +380,8 @@ declare class Input extends Emitter {
380
380
  getMouseButtonState(button: number): number;
381
381
  }
382
382
 
383
+ declare const log: (...args: any[]) => void;
384
+
383
385
  declare const PI: number;
384
386
  declare const TAU: number;
385
387
  declare const HALF_PI: number;
@@ -883,4 +885,4 @@ declare class WorkerInterface {
883
885
  terminate(): void;
884
886
  }
885
887
 
886
- export { AStar, type AStarFindPathParams, AddThreeComponent, type AltasParams, AsteroidMesh, type AsteroidOptions, type AtlasParams, AtlasTextureMaterial, type AtlasTextureMaterialParams, BuildDefaultPalette, BuildVoxelGeometry, type BuildVoxelGeometryParams, CameraRig, type CameraRigParams, type CanvasColor, CanvasRenderer, Clock, Color, type ColorPalette, type ColorSelectionOptions, type ColorSelectionResult, Colors, type CommonEventProps, CompileShader, type Component, type ComponentType, CreatePaletteController, CreateProgram, CreateProgramInfo, CreateStarfield, CreateSubTexture, CreateSystemStar, CreateThreeEntity, CreateWebGlContext, CubeSphereGeometry, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_MAP_2D_VALUE, DEFAULT_MAP_3D_VALUE, DEFAULT_PIXEL_SIZE, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE, DEG2RAD, type DebugLabel, DebugRenderer, Disposable, type DoorsParams, type DrawParams, E, ECS, EPSILON, Emitter, type Entity, EventQueue, type EyeDropper, type FractalParams, GenerateDoors, GenerateEntityId, GenerateRooms, type GenerateRoomsParams, GenerateWalls, GetProgramLocations, GetThreeComponent, GetUrlParams, HALF_PI, Input, type InputState, IsThreeEntity, type KeyValue, LN10, LN2, LOG10E, LOG2E, type Listener, LoadTexture, Map2D, type Map2DData, Map3D, Noise, ONE_SECOND, Observable, PI, type PaletteController, type PaletteControllerOnChange, ParticleRenderer, ParticleSystem2d, ParticleSystem3d, type PathsParams, type PointPair, PoissonDiskSampler, type ProgramInfo, type ProgramLocations, QUARTER_PI, RAD2DEG, type RGB, Random, type RectPair, Rectangle, RemoveThreeComponent, Renderer, type RendererParams, ResizeWebGlContext, Rng, type RoomsParams, SQRT1_2, SQRT2, ShaderType, Signal, SimplexNoise, SpatialPartition2d, SpatialPartition3d, type SpatialPartitionEntity2d, type SpatialPartitionEntity3d, type SpriteParams, type System, TAU, TILE_EMPTY, TILE_FLOOR, TILE_PATH, TextureAtlas, type TextureData, type ThreeComponent, type ThreeEntity, ThreeJsCameraRig, type ThreeJsCameraRigParams, ThreeJsPlayerController, type ThreeSystem, Tilemap, type UV, VOXEL_FACES, Vector, type Voxel, type VoxelData, type VoxelFace, VoxelFaces, VoxelGeometry, type VoxelMap, type VoxelMaterial, VoxelMesh, WebGlRenderer, WorkerInterface, type XY, type XYZ, buildColorPalette, clamp, degrees, distance2d, distance3d, fract, getRedYellowGreenGradientHex, hash32, hash32mix, inverseLerp, isNullOrUndefined, isPositiveString, k2xy, k2xyz, lerp, manhattanDistance, mod, nearlyEqual, normalizeRadians, radians, randomMatrix, rng, roundTo, saturate, smoothstep, squaredDistance, wrap, xy2k, xyz2k };
888
+ export { AStar, type AStarFindPathParams, AddThreeComponent, type AltasParams, AsteroidMesh, type AsteroidOptions, type AtlasParams, AtlasTextureMaterial, type AtlasTextureMaterialParams, BuildDefaultPalette, BuildVoxelGeometry, type BuildVoxelGeometryParams, CameraRig, type CameraRigParams, type CanvasColor, CanvasRenderer, Clock, Color, type ColorPalette, type ColorSelectionOptions, type ColorSelectionResult, Colors, type CommonEventProps, CompileShader, type Component, type ComponentType, CreatePaletteController, CreateProgram, CreateProgramInfo, CreateStarfield, CreateSubTexture, CreateSystemStar, CreateThreeEntity, CreateWebGlContext, CubeSphereGeometry, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_MAP_2D_VALUE, DEFAULT_MAP_3D_VALUE, DEFAULT_PIXEL_SIZE, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE, DEG2RAD, type DebugLabel, DebugRenderer, Disposable, type DoorsParams, type DrawParams, E, ECS, EPSILON, Emitter, type Entity, EventQueue, type EyeDropper, type FractalParams, GenerateDoors, GenerateEntityId, GenerateRooms, type GenerateRoomsParams, GenerateWalls, GetProgramLocations, GetThreeComponent, GetUrlParams, HALF_PI, Input, type InputState, IsThreeEntity, type KeyValue, LN10, LN2, LOG10E, LOG2E, type Listener, LoadTexture, Map2D, type Map2DData, Map3D, Noise, ONE_SECOND, Observable, PI, type PaletteController, type PaletteControllerOnChange, ParticleRenderer, ParticleSystem2d, ParticleSystem3d, type PathsParams, type PointPair, PoissonDiskSampler, type ProgramInfo, type ProgramLocations, QUARTER_PI, RAD2DEG, type RGB, Random, type RectPair, Rectangle, RemoveThreeComponent, Renderer, type RendererParams, ResizeWebGlContext, Rng, type RoomsParams, SQRT1_2, SQRT2, ShaderType, Signal, SimplexNoise, SpatialPartition2d, SpatialPartition3d, type SpatialPartitionEntity2d, type SpatialPartitionEntity3d, type SpriteParams, type System, TAU, TILE_EMPTY, TILE_FLOOR, TILE_PATH, TextureAtlas, type TextureData, type ThreeComponent, type ThreeEntity, ThreeJsCameraRig, type ThreeJsCameraRigParams, ThreeJsPlayerController, type ThreeSystem, Tilemap, type UV, VOXEL_FACES, Vector, type Voxel, type VoxelData, type VoxelFace, VoxelFaces, VoxelGeometry, type VoxelMap, type VoxelMaterial, VoxelMesh, WebGlRenderer, WorkerInterface, type XY, type XYZ, buildColorPalette, clamp, degrees, distance2d, distance3d, fract, getRedYellowGreenGradientHex, hash32, hash32mix, inverseLerp, isNullOrUndefined, isPositiveString, k2xy, k2xyz, lerp, log, manhattanDistance, mod, nearlyEqual, normalizeRadians, radians, randomMatrix, rng, roundTo, saturate, smoothstep, squaredDistance, wrap, xy2k, xyz2k };
package/dist/index.d.ts CHANGED
@@ -380,6 +380,8 @@ declare class Input extends Emitter {
380
380
  getMouseButtonState(button: number): number;
381
381
  }
382
382
 
383
+ declare const log: (...args: any[]) => void;
384
+
383
385
  declare const PI: number;
384
386
  declare const TAU: number;
385
387
  declare const HALF_PI: number;
@@ -883,4 +885,4 @@ declare class WorkerInterface {
883
885
  terminate(): void;
884
886
  }
885
887
 
886
- export { AStar, type AStarFindPathParams, AddThreeComponent, type AltasParams, AsteroidMesh, type AsteroidOptions, type AtlasParams, AtlasTextureMaterial, type AtlasTextureMaterialParams, BuildDefaultPalette, BuildVoxelGeometry, type BuildVoxelGeometryParams, CameraRig, type CameraRigParams, type CanvasColor, CanvasRenderer, Clock, Color, type ColorPalette, type ColorSelectionOptions, type ColorSelectionResult, Colors, type CommonEventProps, CompileShader, type Component, type ComponentType, CreatePaletteController, CreateProgram, CreateProgramInfo, CreateStarfield, CreateSubTexture, CreateSystemStar, CreateThreeEntity, CreateWebGlContext, CubeSphereGeometry, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_MAP_2D_VALUE, DEFAULT_MAP_3D_VALUE, DEFAULT_PIXEL_SIZE, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE, DEG2RAD, type DebugLabel, DebugRenderer, Disposable, type DoorsParams, type DrawParams, E, ECS, EPSILON, Emitter, type Entity, EventQueue, type EyeDropper, type FractalParams, GenerateDoors, GenerateEntityId, GenerateRooms, type GenerateRoomsParams, GenerateWalls, GetProgramLocations, GetThreeComponent, GetUrlParams, HALF_PI, Input, type InputState, IsThreeEntity, type KeyValue, LN10, LN2, LOG10E, LOG2E, type Listener, LoadTexture, Map2D, type Map2DData, Map3D, Noise, ONE_SECOND, Observable, PI, type PaletteController, type PaletteControllerOnChange, ParticleRenderer, ParticleSystem2d, ParticleSystem3d, type PathsParams, type PointPair, PoissonDiskSampler, type ProgramInfo, type ProgramLocations, QUARTER_PI, RAD2DEG, type RGB, Random, type RectPair, Rectangle, RemoveThreeComponent, Renderer, type RendererParams, ResizeWebGlContext, Rng, type RoomsParams, SQRT1_2, SQRT2, ShaderType, Signal, SimplexNoise, SpatialPartition2d, SpatialPartition3d, type SpatialPartitionEntity2d, type SpatialPartitionEntity3d, type SpriteParams, type System, TAU, TILE_EMPTY, TILE_FLOOR, TILE_PATH, TextureAtlas, type TextureData, type ThreeComponent, type ThreeEntity, ThreeJsCameraRig, type ThreeJsCameraRigParams, ThreeJsPlayerController, type ThreeSystem, Tilemap, type UV, VOXEL_FACES, Vector, type Voxel, type VoxelData, type VoxelFace, VoxelFaces, VoxelGeometry, type VoxelMap, type VoxelMaterial, VoxelMesh, WebGlRenderer, WorkerInterface, type XY, type XYZ, buildColorPalette, clamp, degrees, distance2d, distance3d, fract, getRedYellowGreenGradientHex, hash32, hash32mix, inverseLerp, isNullOrUndefined, isPositiveString, k2xy, k2xyz, lerp, manhattanDistance, mod, nearlyEqual, normalizeRadians, radians, randomMatrix, rng, roundTo, saturate, smoothstep, squaredDistance, wrap, xy2k, xyz2k };
888
+ export { AStar, type AStarFindPathParams, AddThreeComponent, type AltasParams, AsteroidMesh, type AsteroidOptions, type AtlasParams, AtlasTextureMaterial, type AtlasTextureMaterialParams, BuildDefaultPalette, BuildVoxelGeometry, type BuildVoxelGeometryParams, CameraRig, type CameraRigParams, type CanvasColor, CanvasRenderer, Clock, Color, type ColorPalette, type ColorSelectionOptions, type ColorSelectionResult, Colors, type CommonEventProps, CompileShader, type Component, type ComponentType, CreatePaletteController, CreateProgram, CreateProgramInfo, CreateStarfield, CreateSubTexture, CreateSystemStar, CreateThreeEntity, CreateWebGlContext, CubeSphereGeometry, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_MAP_2D_VALUE, DEFAULT_MAP_3D_VALUE, DEFAULT_PIXEL_SIZE, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE, DEG2RAD, type DebugLabel, DebugRenderer, Disposable, type DoorsParams, type DrawParams, E, ECS, EPSILON, Emitter, type Entity, EventQueue, type EyeDropper, type FractalParams, GenerateDoors, GenerateEntityId, GenerateRooms, type GenerateRoomsParams, GenerateWalls, GetProgramLocations, GetThreeComponent, GetUrlParams, HALF_PI, Input, type InputState, IsThreeEntity, type KeyValue, LN10, LN2, LOG10E, LOG2E, type Listener, LoadTexture, Map2D, type Map2DData, Map3D, Noise, ONE_SECOND, Observable, PI, type PaletteController, type PaletteControllerOnChange, ParticleRenderer, ParticleSystem2d, ParticleSystem3d, type PathsParams, type PointPair, PoissonDiskSampler, type ProgramInfo, type ProgramLocations, QUARTER_PI, RAD2DEG, type RGB, Random, type RectPair, Rectangle, RemoveThreeComponent, Renderer, type RendererParams, ResizeWebGlContext, Rng, type RoomsParams, SQRT1_2, SQRT2, ShaderType, Signal, SimplexNoise, SpatialPartition2d, SpatialPartition3d, type SpatialPartitionEntity2d, type SpatialPartitionEntity3d, type SpriteParams, type System, TAU, TILE_EMPTY, TILE_FLOOR, TILE_PATH, TextureAtlas, type TextureData, type ThreeComponent, type ThreeEntity, ThreeJsCameraRig, type ThreeJsCameraRigParams, ThreeJsPlayerController, type ThreeSystem, Tilemap, type UV, VOXEL_FACES, Vector, type Voxel, type VoxelData, type VoxelFace, VoxelFaces, VoxelGeometry, type VoxelMap, type VoxelMaterial, VoxelMesh, WebGlRenderer, WorkerInterface, type XY, type XYZ, buildColorPalette, clamp, degrees, distance2d, distance3d, fract, getRedYellowGreenGradientHex, hash32, hash32mix, inverseLerp, isNullOrUndefined, isPositiveString, k2xy, k2xyz, lerp, log, manhattanDistance, mod, nearlyEqual, normalizeRadians, radians, randomMatrix, rng, roundTo, saturate, smoothstep, squaredDistance, wrap, xy2k, xyz2k };
package/dist/index.js CHANGED
@@ -159,6 +159,7 @@ __export(index_exports, {
159
159
  k2xy: () => k2xy,
160
160
  k2xyz: () => k2xyz,
161
161
  lerp: () => lerp,
162
+ log: () => log,
162
163
  manhattanDistance: () => manhattanDistance,
163
164
  mod: () => mod,
164
165
  nearlyEqual: () => nearlyEqual,
@@ -610,7 +611,7 @@ function buildColorPalette(grayscaleSteps = 8, colorSteps = 4, ...colors2) {
610
611
  }
611
612
 
612
613
  // src/log.ts
613
- var log_default = console.debug.bind(
614
+ var log = console.debug.bind(
614
615
  console,
615
616
  "%c[dev]",
616
617
  "font-weight: bold; color: #888;"
@@ -659,7 +660,7 @@ var Color = class _Color {
659
660
  [this._r, this._g, this._b, this._a] = this._parse_hex_color_string(value);
660
661
  this._hex = value;
661
662
  } else {
662
- log_default(`Color: invalid color string: ${value}. Should be a hexadecimal color string (i.e.: '#ffffff' or '#ffffffff'). Keeping the current color.`);
663
+ log(`Color: invalid color string: ${value}. Should be a hexadecimal color string (i.e.: '#ffffff' or '#ffffffff'). Keeping the current color.`);
663
664
  }
664
665
  }
665
666
  get rgba() {
@@ -670,7 +671,7 @@ var Color = class _Color {
670
671
  if (r.startsWith("#")) {
671
672
  [r, g, b, a] = this._parse_hex_color_string(r);
672
673
  } else {
673
- log_default(`Color: invalid color string: ${r}. Should be a hexadecimal color string (i.e.: '#ffffff' or '#ffffffff'). Defaulting to opaque white.`);
674
+ log(`Color: invalid color string: ${r}. Should be a hexadecimal color string (i.e.: '#ffffff' or '#ffffffff'). Defaulting to opaque white.`);
674
675
  r = g = b = a = 255;
675
676
  }
676
677
  } else {
@@ -771,7 +772,7 @@ var Color = class _Color {
771
772
  const [r, g, b, a] = rgba.map(Number);
772
773
  return new _Color(r, g, b, a);
773
774
  } else {
774
- log_default(`Color: invalid CSS color name: ${name}. Defaulting to transparent.`);
775
+ log(`Color: invalid CSS color name: ${name}. Defaulting to transparent.`);
775
776
  return _Color.TRANSPARENT;
776
777
  }
777
778
  }
@@ -1475,7 +1476,7 @@ function GenerateRooms(params = {}) {
1475
1476
  _plot(map, rooms, TILE_FLOOR);
1476
1477
  const paths = _generatePaths(map, rooms, params.paths);
1477
1478
  _plot(map, paths, TILE_PATH);
1478
- log_default("GenerateRooms: done:", Date.now() - startTime, "ms");
1479
+ log("GenerateRooms: done:", Date.now() - startTime, "ms");
1479
1480
  return { map, rooms, paths };
1480
1481
  }
1481
1482
  function GenerateDoors(map, paths, params = {}) {
@@ -4041,6 +4042,7 @@ var WorkerInterface = class {
4041
4042
  k2xy,
4042
4043
  k2xyz,
4043
4044
  lerp,
4045
+ log,
4044
4046
  manhattanDistance,
4045
4047
  mod,
4046
4048
  nearlyEqual,
package/dist/index.mjs CHANGED
@@ -157,6 +157,7 @@ __export(index_exports, {
157
157
  k2xy: () => k2xy,
158
158
  k2xyz: () => k2xyz,
159
159
  lerp: () => lerp,
160
+ log: () => log,
160
161
  manhattanDistance: () => manhattanDistance,
161
162
  mod: () => mod,
162
163
  nearlyEqual: () => nearlyEqual,
@@ -607,7 +608,7 @@ function buildColorPalette(grayscaleSteps = 8, colorSteps = 4, ...colors2) {
607
608
  }
608
609
 
609
610
  // src/log.ts
610
- var log_default = console.debug.bind(
611
+ var log = console.debug.bind(
611
612
  console,
612
613
  "%c[dev]",
613
614
  "font-weight: bold; color: #888;"
@@ -656,7 +657,7 @@ var Color = class _Color {
656
657
  [this._r, this._g, this._b, this._a] = this._parse_hex_color_string(value);
657
658
  this._hex = value;
658
659
  } else {
659
- log_default(`Color: invalid color string: ${value}. Should be a hexadecimal color string (i.e.: '#ffffff' or '#ffffffff'). Keeping the current color.`);
660
+ log(`Color: invalid color string: ${value}. Should be a hexadecimal color string (i.e.: '#ffffff' or '#ffffffff'). Keeping the current color.`);
660
661
  }
661
662
  }
662
663
  get rgba() {
@@ -667,7 +668,7 @@ var Color = class _Color {
667
668
  if (r.startsWith("#")) {
668
669
  [r, g, b, a] = this._parse_hex_color_string(r);
669
670
  } else {
670
- log_default(`Color: invalid color string: ${r}. Should be a hexadecimal color string (i.e.: '#ffffff' or '#ffffffff'). Defaulting to opaque white.`);
671
+ log(`Color: invalid color string: ${r}. Should be a hexadecimal color string (i.e.: '#ffffff' or '#ffffffff'). Defaulting to opaque white.`);
671
672
  r = g = b = a = 255;
672
673
  }
673
674
  } else {
@@ -768,7 +769,7 @@ var Color = class _Color {
768
769
  const [r, g, b, a] = rgba.map(Number);
769
770
  return new _Color(r, g, b, a);
770
771
  } else {
771
- log_default(`Color: invalid CSS color name: ${name}. Defaulting to transparent.`);
772
+ log(`Color: invalid CSS color name: ${name}. Defaulting to transparent.`);
772
773
  return _Color.TRANSPARENT;
773
774
  }
774
775
  }
@@ -1472,7 +1473,7 @@ function GenerateRooms(params = {}) {
1472
1473
  _plot(map, rooms, TILE_FLOOR);
1473
1474
  const paths = _generatePaths(map, rooms, params.paths);
1474
1475
  _plot(map, paths, TILE_PATH);
1475
- log_default("GenerateRooms: done:", Date.now() - startTime, "ms");
1476
+ log("GenerateRooms: done:", Date.now() - startTime, "ms");
1476
1477
  return { map, rooms, paths };
1477
1478
  }
1478
1479
  function GenerateDoors(map, paths, params = {}) {
@@ -4037,6 +4038,7 @@ export {
4037
4038
  k2xy,
4038
4039
  k2xyz,
4039
4040
  lerp,
4041
+ log,
4040
4042
  manhattanDistance,
4041
4043
  mod,
4042
4044
  nearlyEqual,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n3rdw1z4rd/core",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "core library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "peerDependencies": {
49
49
  "simplex-noise": "^4.0.3",
50
- "three": "^0.186.0"
50
+ "three": "^0.186.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/three": "^0.186.0",