laymur 0.14.1 → 0.14.2

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.
@@ -3,8 +3,17 @@ import { UITransparencyMode } from "../../UITransparencyMode";
3
3
  import type { GLProperty, UIProperty } from "../shared";
4
4
  export declare const INSTANCED_PLANE_GEOMETRY: InstancedBufferGeometry;
5
5
  export declare const CAPACITY_STEP = 4;
6
+ export declare const INITIAL_CAPACITY = 1;
6
7
  export declare function writePropertyToArray(value: UIProperty, array: Float32Array, offset: number): void;
7
- export declare function writeInstanceDefaults(visibilityArray: Float32Array, transformArray: Float32Array, index: number): void;
8
8
  export declare function buildEmptyInstancedBufferAttribute(value: UIProperty, capacity: number): InstancedBufferAttribute;
9
9
  export declare function buildMaterial(source: string, uniformProperties: Record<string, GLProperty>, varyingProperties: Record<string, GLProperty>, transparency: UITransparencyMode): ShaderMaterial;
10
10
  export declare function reconstructValue(referenceValue: UIProperty, array: Float32Array, offset: number): UIProperty;
11
+ /**
12
+ * Shift buffer region within the same array.
13
+ * Uses copyWithin for efficient memory moves with correct overlap handling.
14
+ */
15
+ export declare function shiftBufferRegion(array: Float32Array, itemSize: number, fromIndex: number, count: number, delta: number): void;
16
+ /**
17
+ * Copy data between two different buffers.
18
+ */
19
+ export declare function copyBetweenBuffers(src: Float32Array, srcOffset: number, dst: Float32Array, dstOffset: number, length: number): void;
@@ -1,12 +1,16 @@
1
+ import type { Matrix4 } from "three";
2
+ import type { UITransparencyMode } from "../../UITransparencyMode";
3
+ import type { GLProperty } from "../shared";
1
4
  import type { UIGenericInstancedPlane } from "../UIGenericInstancedPlane/UIGenericInstancedPlane";
2
- import type { UIGenericPlane } from "../UIGenericPlane/UIGenericPlane";
3
- export type PlaneDescriptor = SinglePlaneDescriptor | InstancedPlaneDescriptor;
4
- export interface SinglePlaneDescriptor {
5
- plane: UIGenericPlane;
5
+ export interface PlaneDescriptor {
6
+ mesh: UIGenericInstancedPlane;
7
+ instanceIndex: number;
6
8
  }
7
- export interface InstancedPlaneDescriptor {
8
- plane: UIGenericInstancedPlane;
9
- instanceHandler: number;
9
+ export interface PlaneState {
10
+ source: string;
11
+ properties: Record<string, GLProperty>;
12
+ transform: Matrix4;
13
+ visibility: boolean;
14
+ transparency: UITransparencyMode;
15
+ zIndex: number;
10
16
  }
11
- export declare function isSinglePlaneDescriptor(descriptor: PlaneDescriptor): descriptor is SinglePlaneDescriptor;
12
- export declare function isInstancedPlaneDescriptor(descriptor: PlaneDescriptor): descriptor is InstancedPlaneDescriptor;
@@ -30,4 +30,9 @@ export declare function arePropertiesPartiallyCompatible(full: Readonly<Record<s
30
30
  export declare function convertUIPropertiesToGLProperties(uiProperties: Record<string, UIProperty>): Record<string, GLProperty>;
31
31
  export declare function cloneProperty<T extends UIProperty>(property: T): T;
32
32
  export declare function cloneProperties(properties: Record<string, UIProperty>): Record<string, UIProperty>;
33
+ export declare function cloneGLProperties(properties: Record<string, GLProperty>): Record<string, GLProperty>;
34
+ /** Extracts zIndex from transform matrix (translation.z component) */
35
+ export declare function extractZIndex(transform: Matrix4): number;
36
+ /** Extracts zIndex from transform buffer at given instance index */
37
+ export declare function extractZIndexFromBuffer(buffer: Float32Array, instanceIndex: number): number;
33
38
  export declare function buildGenericPlaneFragmentShader(uniformDeclarations: string[], varyingDeclarations: string[], source: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "laymur",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "description": "Constraint-based UI library for Three.js mobile advertisements",
5
5
  "scripts": {
6
6
  "clean": "rm -rf dist",
@@ -50,9 +50,6 @@
50
50
  "three": ">=0.157.0 <0.180.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@babel/core": "^7.28.6",
54
- "@babel/preset-env": "^7.28.6",
55
- "@rollup/plugin-babel": "^6.1.0",
56
53
  "@rollup/plugin-node-resolve": "^16.0.1",
57
54
  "@rollup/plugin-replace": "^6.0.3",
58
55
  "@rollup/plugin-terser": "^0.4.4",
@@ -1,6 +0,0 @@
1
- import type { Matrix4 } from "three";
2
- import { PlaneGeometry, ShaderMaterial } from "three";
3
- import { UITransparencyMode } from "../../UITransparencyMode";
4
- import type { GLProperty } from "../shared";
5
- export declare const PLANE_GEOMETRY: PlaneGeometry;
6
- export declare function buildGenericPlaneMaterial(source: string, properties: Record<string, GLProperty>, transparency: UITransparencyMode, transform: Matrix4): ShaderMaterial;