laymur 0.11.3 → 0.11.5
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/README.md +0 -1
- package/dist/constraints/{UIAspectConstraint.Internal.d.ts → UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIAspectConstraint.d.ts → UIAspectConstraint/UIAspectConstraint.d.ts} +2 -2
- package/dist/constraints/{UIHeightConstraint.Internal.d.ts → UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIHeightConstraint.d.ts → UIHeightConstraint/UIHeightConstraint.d.ts} +2 -2
- package/dist/constraints/{UIHorizontalDistanceConstraint.Internal.d.ts → UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIHorizontalDistanceConstraint.d.ts → UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts} +2 -2
- package/dist/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
- package/dist/constraints/{UIHorizontalProportionConstraint.Internal.d.ts → UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIHorizontalProportionConstraint.d.ts → UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts} +2 -2
- package/dist/constraints/{UIVerticalDistanceConstraint.Internal.d.ts → UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIVerticalDistanceConstraint.d.ts → UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts} +2 -2
- package/dist/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
- package/dist/constraints/{UIVerticalProportionConstraint.Internal.d.ts → UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIVerticalProportionConstraint.d.ts → UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts} +2 -2
- package/dist/constraints/{UIWidthConstraint.Internal.d.ts → UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIWidthConstraint.d.ts → UIWidthConstraint/UIWidthConstraint.d.ts} +2 -2
- package/dist/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +21 -2
- package/dist/constraints/builders/UIConstraint2DBuilder.d.ts +20 -9
- package/dist/constraints/builders/UICoverConstraintBuilder.d.ts +6 -6
- package/dist/constraints/builders/UIFitConstraintBuilder.d.ts +6 -6
- package/dist/elements/{UIAnchor.d.ts → UIAnchor/UIAnchor.d.ts} +3 -3
- package/dist/elements/{UIAnimatedImage.Internal.d.ts → UIAnimatedImage/UIAnimatedImage.Internal.d.ts} +2 -2
- package/dist/elements/{UIAnimatedImage.d.ts → UIAnimatedImage/UIAnimatedImage.d.ts} +6 -6
- package/dist/elements/UIElement/UIElement.Internal.d.ts +11 -0
- package/dist/elements/{UIElement.d.ts → UIElement/UIElement.d.ts} +9 -9
- package/dist/elements/{UIGraphics.Internal.d.ts → UIGraphics/UIGraphics.Internal.d.ts} +2 -2
- package/dist/elements/{UIGraphics.d.ts → UIGraphics/UIGraphics.d.ts} +3 -3
- package/dist/elements/{UIImage.Internal.d.ts → UIImage/UIImage.Internal.d.ts} +2 -2
- package/dist/elements/{UIImage.d.ts → UIImage/UIImage.d.ts} +6 -6
- package/dist/elements/{UIDummy.Internal.d.ts → UIInputDummy/UIInputDummy.Internal.d.ts} +5 -5
- package/dist/elements/{UIDummy.d.ts → UIInputDummy/UIInputDummy.d.ts} +11 -11
- package/dist/elements/{UINineSlice.Internal.d.ts → UINineSlice/UINineSlice.Internal.d.ts} +5 -5
- package/dist/elements/{UINineSlice.d.ts → UINineSlice/UINineSlice.d.ts} +9 -9
- package/dist/elements/{UIProgress.Internal.d.ts → UIProgress/UIProgress.Internal.d.ts} +3 -3
- package/dist/elements/{UIProgress.d.ts → UIProgress/UIProgress.d.ts} +10 -9
- package/dist/elements/{UIScene.Internal.d.ts → UIScene/UIScene.Internal.d.ts} +3 -3
- package/dist/elements/{UIScene.d.ts → UIScene/UIScene.d.ts} +3 -3
- package/dist/elements/UIText/UIText.Internal.d.ts +3 -3
- package/dist/elements/UIText/UIText.d.ts +3 -3
- package/dist/index.d.ts +19 -17
- package/dist/index.js +893 -295
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layers/UILayer.d.ts +1 -1
- package/dist/miscellaneous/asserts.d.ts +21 -54
- package/dist/miscellaneous/color/UIColor.d.ts +1 -0
- package/dist/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
- package/dist/miscellaneous/{padding/UIPadding.d.ts → insets/UIInsets.d.ts} +15 -15
- package/dist/miscellaneous/shared.d.ts +46 -0
- package/dist/miscellaneous/texture/UITextureView.d.ts +13 -9
- package/package.json +6 -3
- package/dist/elements/UIElement.Internal.d.ts +0 -11
- package/dist/miscellaneous/padding/UIPadding.Internal.d.ts +0 -11
- /package/dist/elements/{UIAnchor.Internal.d.ts → UIAnchor/UIAnchor.Internal.d.ts} +0 -0
package/dist/layers/UILayer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Eventail } from "eventail";
|
|
2
2
|
import type { WebGLRenderer } from "three";
|
|
3
|
-
import type { UIPlaneElement } from "../miscellaneous/
|
|
3
|
+
import type { UIPlaneElement } from "../miscellaneous/shared";
|
|
4
4
|
import { UIInputWrapper } from "../wrappers/UIInputWrapper";
|
|
5
5
|
import type { UILayerMode, UILayerOrientation } from "./UILayer.Internal";
|
|
6
6
|
/** Base layer for UI rendering and layout management */
|
|
@@ -1,59 +1,5 @@
|
|
|
1
1
|
import { UILayer } from "../layers/UILayer";
|
|
2
2
|
export declare const EPSILON = 0.000001;
|
|
3
|
-
/** Objects that belong to a UI layer */
|
|
4
|
-
export interface UILayerElement {
|
|
5
|
-
/** The UI layer containing this element */
|
|
6
|
-
readonly layer: UILayer;
|
|
7
|
-
}
|
|
8
|
-
/** UI elements with position in 2D space */
|
|
9
|
-
export interface UIPointElement {
|
|
10
|
-
/** Solver variable for x coordinate */
|
|
11
|
-
readonly xVariable: number;
|
|
12
|
-
/** Solver variable for y coordinate */
|
|
13
|
-
readonly yVariable: number;
|
|
14
|
-
/** X coordinate in world units */
|
|
15
|
-
readonly x: number;
|
|
16
|
-
/** Y coordinate in world units */
|
|
17
|
-
readonly y: number;
|
|
18
|
-
}
|
|
19
|
-
/** UI elements with position and dimensions */
|
|
20
|
-
export interface UIPlaneElement extends UIPointElement {
|
|
21
|
-
/** Solver variable for width */
|
|
22
|
-
readonly wVariable: number;
|
|
23
|
-
/** Solver variable for height */
|
|
24
|
-
readonly hVariable: number;
|
|
25
|
-
/** Width in world units */
|
|
26
|
-
readonly width: number;
|
|
27
|
-
/** Height in world units */
|
|
28
|
-
readonly height: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Checks if object implements UILayerElement.
|
|
32
|
-
* @param obj Object to check
|
|
33
|
-
* @returns True if object has valid layer property
|
|
34
|
-
*/
|
|
35
|
-
export declare function isUILayerElement(obj: unknown): obj is UILayerElement;
|
|
36
|
-
/**
|
|
37
|
-
* Checks if object implements UIPointElement.
|
|
38
|
-
* @param obj Object to check
|
|
39
|
-
* @returns True if object has valid position variables
|
|
40
|
-
*/
|
|
41
|
-
export declare function isUIPointElement(obj: unknown): obj is UIPointElement;
|
|
42
|
-
/**
|
|
43
|
-
* Checks if object implements UIPlaneElement.
|
|
44
|
-
* @param obj Object to check
|
|
45
|
-
* @returns True if object has valid dimension variables
|
|
46
|
-
*/
|
|
47
|
-
export declare function isUIPlaneElement(obj: unknown): obj is UIPlaneElement;
|
|
48
|
-
/**
|
|
49
|
-
* Validates constraint subjects are from same layer.
|
|
50
|
-
* @param a First constraint subject
|
|
51
|
-
* @param b Second constraint subject
|
|
52
|
-
* @param subject Constraint name for error messages
|
|
53
|
-
* @returns Common layer for both subjects
|
|
54
|
-
* @throws If subjects are invalid or from different layers
|
|
55
|
-
*/
|
|
56
|
-
export declare function assertValidConstraintSubjects(a: unknown, b: unknown, subject: string): UILayer;
|
|
57
3
|
/**
|
|
58
4
|
* Validates value is finite number within safe range.
|
|
59
5
|
* @param value Number to validate
|
|
@@ -75,3 +21,24 @@ export declare function assertValidPositiveNumber(value: number, subject: string
|
|
|
75
21
|
* @throws If value is invalid or negative
|
|
76
22
|
*/
|
|
77
23
|
export declare function assertValidNonNegativeNumber(value: number, subject: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Validates constraint arguments are from same layer.
|
|
26
|
+
* @param a First constraint subject
|
|
27
|
+
* @param b Second constraint subject
|
|
28
|
+
* @param subject Constraint name for error messages
|
|
29
|
+
* @returns Common layer for both subjects
|
|
30
|
+
* @throws If subjects are invalid or from different layers
|
|
31
|
+
*/
|
|
32
|
+
export declare function assertValidConstraintArguments(a: unknown, b: unknown, subject: string): UILayer;
|
|
33
|
+
/**
|
|
34
|
+
* Validates interpolation constraint subjects.
|
|
35
|
+
* @param subject Constraint name for error messages
|
|
36
|
+
* @param a First element
|
|
37
|
+
* @param b Second element
|
|
38
|
+
* @param c Element to interpolate
|
|
39
|
+
* @param anchorA Anchor on element A
|
|
40
|
+
* @param anchorB Anchor on element B
|
|
41
|
+
* @returns Common layer for all subjects
|
|
42
|
+
* @throws If subjects violate interpolation constraints
|
|
43
|
+
*/
|
|
44
|
+
export declare function assertValidInterpolationConstraintArguments(subject: string, a: unknown, b: unknown, c: unknown, anchorA: number, anchorB: number): UILayer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Insets configuration as number, per-side, or per-axis */
|
|
2
|
+
export type UIInsetsConfig = {
|
|
3
|
+
horizontal: number;
|
|
4
|
+
vertical: number;
|
|
5
|
+
} | {
|
|
6
|
+
left: number;
|
|
7
|
+
right: number;
|
|
8
|
+
top: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
} | number;
|
|
11
|
+
export declare const INSETS_DEFAULT_VALUE = 0;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { Vector4 } from "three";
|
|
2
|
-
import type {
|
|
3
|
-
/**
|
|
4
|
-
export declare class
|
|
2
|
+
import type { UIInsetsConfig } from "./UIInsets.Internal";
|
|
3
|
+
/** Insets values for four sides */
|
|
4
|
+
export declare class UIInsets {
|
|
5
5
|
private lInternal;
|
|
6
6
|
private rInternal;
|
|
7
7
|
private tInternal;
|
|
8
8
|
private bInternal;
|
|
9
9
|
private dirtyInternal;
|
|
10
10
|
/**
|
|
11
|
-
* Creates
|
|
11
|
+
* Creates UIInsets instance.
|
|
12
12
|
*
|
|
13
|
-
* @param config -
|
|
13
|
+
* @param config - Insets configuration
|
|
14
14
|
*/
|
|
15
|
-
constructor(config?:
|
|
16
|
-
/** Left
|
|
15
|
+
constructor(config?: UIInsetsConfig);
|
|
16
|
+
/** Left inset */
|
|
17
17
|
get left(): number;
|
|
18
|
-
/** Right
|
|
18
|
+
/** Right inset */
|
|
19
19
|
get right(): number;
|
|
20
|
-
/** Top
|
|
20
|
+
/** Top inset */
|
|
21
21
|
get top(): number;
|
|
22
|
-
/** Bottom
|
|
22
|
+
/** Bottom inset */
|
|
23
23
|
get bottom(): number;
|
|
24
|
-
/** Left
|
|
24
|
+
/** Left inset */
|
|
25
25
|
set left(value: number);
|
|
26
|
-
/** Right
|
|
26
|
+
/** Right inset */
|
|
27
27
|
set right(value: number);
|
|
28
|
-
/** Top
|
|
28
|
+
/** Top inset */
|
|
29
29
|
set top(value: number);
|
|
30
|
-
/** Bottom
|
|
30
|
+
/** Bottom inset */
|
|
31
31
|
set bottom(value: number);
|
|
32
32
|
/** Sets left and right to same value */
|
|
33
33
|
setHorizontal(value: number): void;
|
|
@@ -42,5 +42,5 @@ export declare class UIPadding {
|
|
|
42
42
|
/** Resets all sides to 0 */
|
|
43
43
|
reset(): void;
|
|
44
44
|
/** Copies from another instance */
|
|
45
|
-
copy(other:
|
|
45
|
+
copy(other: UIInsets): void;
|
|
46
46
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { UILayer } from "../layers/UILayer";
|
|
2
|
+
/** Objects that belong to a UI layer */
|
|
3
|
+
export interface UILayerElement {
|
|
4
|
+
/** The UI layer containing this element */
|
|
5
|
+
readonly layer: UILayer;
|
|
6
|
+
}
|
|
7
|
+
/** UI elements with position in 2D space */
|
|
8
|
+
export interface UIPointElement {
|
|
9
|
+
/** Solver variable for x coordinate */
|
|
10
|
+
readonly xVariable: number;
|
|
11
|
+
/** Solver variable for y coordinate */
|
|
12
|
+
readonly yVariable: number;
|
|
13
|
+
/** X coordinate in world units */
|
|
14
|
+
readonly x: number;
|
|
15
|
+
/** Y coordinate in world units */
|
|
16
|
+
readonly y: number;
|
|
17
|
+
}
|
|
18
|
+
/** UI elements with position and dimensions */
|
|
19
|
+
export interface UIPlaneElement extends UIPointElement {
|
|
20
|
+
/** Solver variable for width */
|
|
21
|
+
readonly wVariable: number;
|
|
22
|
+
/** Solver variable for height */
|
|
23
|
+
readonly hVariable: number;
|
|
24
|
+
/** Width in world units */
|
|
25
|
+
readonly width: number;
|
|
26
|
+
/** Height in world units */
|
|
27
|
+
readonly height: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Checks if object implements UILayerElement.
|
|
31
|
+
* @param obj Object to check
|
|
32
|
+
* @returns True if object has valid layer property
|
|
33
|
+
*/
|
|
34
|
+
export declare function isUILayerElement(obj: unknown): obj is UILayerElement;
|
|
35
|
+
/**
|
|
36
|
+
* Checks if object implements UIPointElement.
|
|
37
|
+
* @param obj Object to check
|
|
38
|
+
* @returns True if object has valid position variables
|
|
39
|
+
*/
|
|
40
|
+
export declare function isUIPointElement(obj: unknown): obj is UIPointElement;
|
|
41
|
+
/**
|
|
42
|
+
* Checks if object implements UIPlaneElement.
|
|
43
|
+
* @param obj Object to check
|
|
44
|
+
* @returns True if object has valid dimension variables
|
|
45
|
+
*/
|
|
46
|
+
export declare function isUIPlaneElement(obj: unknown): obj is UIPlaneElement;
|
|
@@ -4,19 +4,21 @@ import type { UITextureConfig, UITextureTrim } from "./UITextureView.Internal";
|
|
|
4
4
|
/** Wrapper for Three.js texture with atlas and trim support. Does not own the underlying texture; user must dispose it. */
|
|
5
5
|
export declare class UITextureView extends Eventail {
|
|
6
6
|
private textureInternal;
|
|
7
|
-
private
|
|
7
|
+
private sourceWidth;
|
|
8
|
+
private sourceHeight;
|
|
8
9
|
private frameX;
|
|
9
10
|
private frameY;
|
|
10
11
|
private frameWidth;
|
|
11
12
|
private frameHeight;
|
|
12
|
-
private
|
|
13
|
-
private
|
|
13
|
+
private rotatedInternal;
|
|
14
|
+
private scaleInternal;
|
|
14
15
|
private trimLeft;
|
|
15
16
|
private trimRight;
|
|
16
17
|
private trimTop;
|
|
17
18
|
private trimBottom;
|
|
18
|
-
private
|
|
19
|
-
private
|
|
19
|
+
private textureDirtyInternal;
|
|
20
|
+
private uvTransformDirtyInternal;
|
|
21
|
+
private trimDirtyInternal;
|
|
20
22
|
/** @param config Texture or atlas configuration */
|
|
21
23
|
constructor(config?: UITextureConfig);
|
|
22
24
|
/** Original width before trimming in world units */
|
|
@@ -35,8 +37,12 @@ export declare class UITextureView extends Eventail {
|
|
|
35
37
|
get scale(): number;
|
|
36
38
|
/** Transparent padding around visible content */
|
|
37
39
|
get trim(): Readonly<UITextureTrim>;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
get textureDirty(): boolean;
|
|
41
|
+
/** Whether UV transform inputs changed since last check */
|
|
42
|
+
get uvTransformDirty(): boolean;
|
|
43
|
+
/** Whether trim values changed since last check */
|
|
44
|
+
get trimDirty(): boolean;
|
|
45
|
+
setTextureDirtyFalse(): void;
|
|
40
46
|
/**
|
|
41
47
|
* Calculates UV transform matrix for shader sampling.
|
|
42
48
|
* @param result Matrix to store result in
|
|
@@ -54,8 +60,6 @@ export declare class UITextureView extends Eventail {
|
|
|
54
60
|
* @param config Texture or atlas configuration
|
|
55
61
|
*/
|
|
56
62
|
set(config: UITextureConfig): void;
|
|
57
|
-
/** Resets to default empty texture */
|
|
58
|
-
reset(): void;
|
|
59
63
|
private setFromTexture;
|
|
60
64
|
private setFromAtlasConfig;
|
|
61
65
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "laymur",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.5",
|
|
4
4
|
"description": "Constraint-based UI library for Three.js mobile advertisements",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rm -rf dist",
|
|
@@ -13,13 +13,16 @@
|
|
|
13
13
|
"types": "dist/index.d.ts",
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
|
-
"types": "./dist/index.d.ts",
|
|
17
16
|
"import": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
18
|
"development": "./dist/index.js",
|
|
19
19
|
"production": "./dist/index.min.js",
|
|
20
20
|
"default": "./dist/index.min.js"
|
|
21
21
|
},
|
|
22
|
-
"require":
|
|
22
|
+
"require": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.min.js"
|
|
25
|
+
}
|
|
23
26
|
},
|
|
24
27
|
"./package.json": "./package.json"
|
|
25
28
|
},
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { UIMicroConfig } from "../miscellaneous/micro/UIMicro.Internal";
|
|
2
|
-
import { UITransparencyMode } from "../miscellaneous/UITransparencyMode";
|
|
3
|
-
import type { UIDummyOptions } from "./UIDummy.Internal";
|
|
4
|
-
/** Configuration options for UIElement */
|
|
5
|
-
export interface UIElementOptions extends UIDummyOptions {
|
|
6
|
-
/** Transforms that don't affect constraints */
|
|
7
|
-
micro: UIMicroConfig;
|
|
8
|
-
/** Alpha blending mode */
|
|
9
|
-
transparencyMode: UITransparencyMode;
|
|
10
|
-
}
|
|
11
|
-
export declare const ELEMENT_DEFAULT_TRANSPARENCY_MODE = UITransparencyMode.BLEND;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** Padding configuration as number, per-side, or per-axis */
|
|
2
|
-
export type UIPaddingConfig = {
|
|
3
|
-
horizontal: number;
|
|
4
|
-
vertical: number;
|
|
5
|
-
} | {
|
|
6
|
-
left: number;
|
|
7
|
-
right: number;
|
|
8
|
-
top: number;
|
|
9
|
-
bottom: number;
|
|
10
|
-
} | number;
|
|
11
|
-
export declare const PADDING_DEFAULT_VALUE = 0;
|
|
File without changes
|