laymur 0.13.8 → 0.14.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.
- package/dist/index.js +125 -47
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/miscellaneous/area/UIAreaPolygon.d.ts +1 -1
- package/dist/miscellaneous/asserts.d.ts +0 -1
- package/dist/miscellaneous/canvas.d.ts +22 -4
- package/dist/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +1 -1
- package/dist/miscellaneous/math.d.ts +5 -0
- package/dist/miscellaneous/webglCapabilities.d.ts +2 -0
- package/package.json +3 -3
- package/dist/miscellaneous/checkSRGBSupport.d.ts +0 -1
|
@@ -1,13 +1,31 @@
|
|
|
1
|
+
import { CanvasTexture } from "three";
|
|
1
2
|
/** Canvas type that works both in main thread and workers */
|
|
2
|
-
export type UICanvas = HTMLCanvasElement;
|
|
3
|
+
export type UICanvas = HTMLCanvasElement | OffscreenCanvas;
|
|
3
4
|
/** 2D rendering context type for UICanvas */
|
|
4
|
-
export type UICanvasRenderingContext2D = CanvasRenderingContext2D;
|
|
5
|
+
export type UICanvasRenderingContext2D = CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
|
|
5
6
|
/**
|
|
6
|
-
* Creates a canvas
|
|
7
|
-
* Uses OffscreenCanvas when available, falls back to HTMLCanvasElement otherwise.
|
|
7
|
+
* Creates a canvas using OffscreenCanvas if available, otherwise falls back to HTMLCanvasElement.
|
|
8
8
|
*
|
|
9
9
|
* @param width - Canvas width in pixels
|
|
10
10
|
* @param height - Canvas height in pixels
|
|
11
11
|
* @returns Canvas instance
|
|
12
12
|
*/
|
|
13
13
|
export declare function createCanvas(width: number, height: number): UICanvas;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the 2D rendering context for a UICanvas.
|
|
16
|
+
*
|
|
17
|
+
* @param canvas - Canvas instance
|
|
18
|
+
* @returns 2D rendering context or null
|
|
19
|
+
*/
|
|
20
|
+
export declare function getCanvas2DContext(canvas: UICanvas): UICanvasRenderingContext2D | null;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a CanvasTexture with maximum WebGL1/WebGL2 compatibility.
|
|
23
|
+
* - ClampToEdge wrapping (required for NPOT in WebGL1)
|
|
24
|
+
* - Linear filtering without mipmaps (NPOT-safe)
|
|
25
|
+
* - RGBA/UnsignedByte format (no extensions needed)
|
|
26
|
+
* - sRGB colorspace only if supported
|
|
27
|
+
*
|
|
28
|
+
* @param canvas - Source canvas
|
|
29
|
+
* @returns Configured CanvasTexture
|
|
30
|
+
*/
|
|
31
|
+
export declare function createCanvasTexture(canvas: UICanvas): CanvasTexture;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Vector2Like } from "three";
|
|
2
1
|
import { Vector2 } from "three";
|
|
3
2
|
import { UIProgressMaskFunction } from "./UIProgressMaskFunction";
|
|
3
|
+
import { type Vector2Like } from "../math";
|
|
4
4
|
/** Linear directional progress fill */
|
|
5
5
|
export declare class UIProgressMaskFunctionDirectional extends UIProgressMaskFunction {
|
|
6
6
|
/** Fill direction as normalized vector */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "laymur",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Constraint-based UI library for Three.js mobile advertisements",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rm -rf dist",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"type": "module",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"three": ">=0.
|
|
50
|
+
"three": ">=0.157.0 <0.180.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@babel/core": "^7.28.6",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@rollup/plugin-replace": "^6.0.3",
|
|
58
58
|
"@rollup/plugin-terser": "^0.4.4",
|
|
59
59
|
"@types/node": "^25.0.2",
|
|
60
|
-
"@types/three": "^0.
|
|
60
|
+
"@types/three": "^0.157.0",
|
|
61
61
|
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
|
62
62
|
"@typescript-eslint/parser": "^8.32.0",
|
|
63
63
|
"eslint": "^9.26.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SRGB_SUPPORTED: boolean;
|