@opentui/three 0.4.5 → 0.5.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.
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ var __require = import.meta.require;
3
+
4
+ export { __require };
package/index.js CHANGED
@@ -1,4 +1,8 @@
1
1
  // @bun
2
+ import {
3
+ __require
4
+ } from "./chunk-2mx7fq49.js";
5
+
2
6
  // src/WGPURenderer.ts
3
7
  import { PerspectiveCamera, Color, NoToneMapping, LinearSRGBColorSpace } from "three";
4
8
  import { WebGPURenderer } from "three/webgpu";
@@ -8,7 +12,6 @@ import { CliRenderEvents, RGBA as RGBA2 } from "@opentui/core";
8
12
  // src/canvas.ts
9
13
  import { GPUCanvasContextMock } from "bun-webgpu";
10
14
  import { RGBA } from "@opentui/core";
11
- import { Jimp } from "jimp";
12
15
 
13
16
  // src/shaders/supersampling.wgsl
14
17
  var supersampling_default = `struct CellResult {
@@ -287,6 +290,7 @@ class CLICanvas {
287
290
  this.superSample = superSample;
288
291
  }
289
292
  async saveToFile(filePath) {
293
+ const { Jimp } = await import("jimp");
290
294
  const bytesPerPixel = 4;
291
295
  const unalignedBytesPerRow = this.width * bytesPerPixel;
292
296
  const alignedBytesPerRow = Math.ceil(unalignedBytesPerRow / 256) * 256;
@@ -941,13 +945,13 @@ class ThreeRenderable extends Renderable {
941
945
  // src/TextureUtils.ts
942
946
  import { readFile } from "fs/promises";
943
947
  import { Color as Color2, DataTexture, NearestFilter, ClampToEdgeWrapping, RGBAFormat, UnsignedByteType } from "three";
944
- import { Jimp as Jimp2 } from "jimp";
945
948
 
946
949
  class TextureUtils {
947
950
  static async loadTextureFromFile(path) {
948
951
  try {
952
+ const { Jimp } = await import("jimp");
949
953
  const buffer = await readFile(path);
950
- const image = await Jimp2.read(buffer);
954
+ const image = await Jimp.read(buffer);
951
955
  image.flip({ horizontal: false, vertical: true });
952
956
  const texture = new DataTexture(image.bitmap.data, image.bitmap.width, image.bitmap.height, RGBAFormat, UnsignedByteType);
953
957
  texture.needsUpdate = true;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
7
- "version": "0.4.5",
7
+ "version": "0.5.1",
8
8
  "description": "Three.js WebGPU renderer for OpenTUI",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -25,7 +25,7 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@opentui/core": "0.4.5",
28
+ "@opentui/core": "0.5.1",
29
29
  "jimp": "1.6.1",
30
30
  "three": "0.177.0"
31
31
  },
@@ -1,4 +1,6 @@
1
1
  // @bun
2
+ import"./chunk-2mx7fq49.js";
3
+
2
4
  // src/runtime-modules.ts
3
5
  import * as threeRuntime from "@opentui/three";
4
6
  var runtimeModules = {