laymur 0.16.0 → 0.17.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/README.md +84 -208
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
- package/dist/{constraints → core/constraints}/UIConstraint.d.ts +2 -2
- package/dist/core/constraints/UIConstraint.js +11 -0
- package/dist/core/constraints/UICustomConstraint.js +37 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
- package/dist/{elements → core/elements}/UIAnchor/UIAnchor.Internal.d.ts +3 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
- package/dist/{elements → core/elements}/UIAnchor/UIAnchor.d.ts +3 -3
- package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
- package/dist/{elements → core/elements}/UIDummy/UIDummy.d.ts +2 -2
- package/dist/core/elements/UIDummy/UIDummy.js +173 -0
- package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
- package/dist/{elements → core/elements}/UIElement/UIElement.d.ts +2 -2
- package/dist/core/elements/UIElement/UIElement.js +74 -0
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
- package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
- package/dist/core/elements/UIImage/UIImage.js +85 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
- package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
- package/dist/core/elements/UIProgress/UIProgress.js +165 -0
- package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
- package/dist/core/elements/UIScene/UIScene.js +157 -0
- package/dist/core/elements/UIText/UIText.Internal.js +12 -0
- package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
- package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
- package/dist/core/elements/UIText/UIText.js +265 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
- package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
- package/dist/core/layers/UILayer/UILayer.js +113 -0
- package/dist/core/miscellaneous/UIExpression.js +128 -0
- package/dist/core/miscellaneous/UIMode.js +30 -0
- package/dist/core/miscellaneous/UIOrientation.js +20 -0
- package/dist/core/miscellaneous/UIPriority.js +63 -0
- package/dist/core/miscellaneous/UIRelation.js +40 -0
- package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
- package/dist/core/miscellaneous/area/UIArea.js +5 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
- package/dist/core/miscellaneous/asserts.js +163 -0
- package/dist/core/miscellaneous/canvas.js +37 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
- package/dist/core/miscellaneous/color/UIColor.js +636 -0
- package/dist/core/miscellaneous/computeTransform.js +82 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
- package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
- package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
- package/dist/{miscellaneous → core/miscellaneous}/math.d.ts +2 -0
- package/dist/core/miscellaneous/math.js +11 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
- package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
- package/dist/core/miscellaneous/shared.js +37 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
- package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
- package/dist/core/miscellaneous/webglCapabilities.js +103 -0
- package/dist/core/shaders/UIImage.glsl.js +3 -0
- package/dist/core/shaders/UINineSlice.glsl.js +3 -0
- package/dist/core/shaders/UIProgress.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
- package/dist/{wrappers → core/wrappers}/UIInputWrapper/UIInputWrapper.Internal.d.ts +1 -1
- package/dist/{wrappers → core/wrappers}/UIInputWrapper/UIInputWrapper.d.ts +2 -2
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
- package/dist/{wrappers → core/wrappers}/UISceneWrapper/UISceneWrapper.Internal.d.ts +1 -1
- package/dist/{wrappers → core/wrappers}/UISceneWrapper/UISceneWrapper.d.ts +2 -2
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
- package/dist/{wrappers → core/wrappers}/UISolverWrapper/UISolverWrapper.Internal.d.ts +1 -1
- package/dist/{wrappers → core/wrappers}/UISolverWrapper/UISolverWrapper.d.ts +2 -2
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
- package/dist/index.js +51 -9246
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
- package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
- package/dist/particles/elements/UIEmitter.Internal.js +11 -0
- package/dist/particles/elements/UIEmitter.d.ts +68 -0
- package/dist/particles/elements/UIEmitter.js +203 -0
- package/dist/particles/index.d.ts +18 -0
- package/dist/particles/index.js +18 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
- package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
- package/dist/particles/miscellaneous/miscellaneous.js +67 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
- package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
- package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
- package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
- package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
- package/dist/particles/spawnModules/UISpawnModule.js +9 -0
- package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
- package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
- package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
- package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
- package/package.json +27 -36
- package/dist/index.js.map +0 -1
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- /package/dist/{constraints → core/constraints}/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIAspectConstraint/UIAspectConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UICustomConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHeightConstraint/UIHeightConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIWidthConstraint/UIWidthConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIConstraint2DBuilder.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIConstraint2DBuilder.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UICoverConstraintBuilder.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UICoverConstraintBuilder.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIFitConstraintBuilder.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIFitConstraintBuilder.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIAnimatedImage/UIAnimatedImage.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIDummy/UIDummy.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIElement/UIElement.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIGraphics/UIGraphics.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIGraphics/UIGraphics.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIImage/UIImage.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIImage/UIImage.d.ts +0 -0
- /package/dist/{elements → core/elements}/UINineSlice/UINineSlice.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UINineSlice/UINineSlice.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIProgress/UIProgress.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIProgress/UIProgress.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIScene/UIScene.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIScene/UIScene.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Interfaces.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Measuring.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Rendering.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.d.ts +0 -0
- /package/dist/{index.d.ts → core/index.d.ts} +0 -0
- /package/dist/{layers → core/layers}/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +0 -0
- /package/dist/{layers → core/layers}/UIFullscreenLayer/UIFullscreenLayer.d.ts +0 -0
- /package/dist/{layers → core/layers}/UILayer/UILayer.Internal.d.ts +0 -0
- /package/dist/{layers → core/layers}/UILayer/UILayer.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIExpression.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIMode.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIOrientation.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIPriority.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIRelation.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UITransparencyMode.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIArea.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaCircle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaPolygon.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaRectangle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaRoundedRectangle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/asserts.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/canvas.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/color/UIColor.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/color/UIColor.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/computeTransform.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/shared.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/insets/UIInsets.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/insets/UIInsets.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunction.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunctionCircular.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunctionDirectional.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/micro/UIMicro.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/micro/UIMicro.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicy.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCover.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCross.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCrossInverted.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFit.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFixedHeight.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFixedWidth.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyNone.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/shared.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-span/UITextSpan.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-span/UITextSpan.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-style/UITextStyle.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-style/UITextStyle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/texture/UITextureView.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/texture/UITextureView.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/webglCapabilities.d.ts +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { UILayer } from '../layers/UILayer/UILayer.js';
|
|
2
|
+
import { EPSILON } from './math.js';
|
|
3
|
+
import { isUILayerElement } from './shared.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Validates value is finite number within safe range.
|
|
7
|
+
* @param value Number to validate
|
|
8
|
+
* @param subject Value name for error messages
|
|
9
|
+
* @throws If value is not finite or exceeds safe range
|
|
10
|
+
*/
|
|
11
|
+
function assertValidNumber(value, subject) {
|
|
12
|
+
if (process.env.NODE_ENV !== "production") {
|
|
13
|
+
if (!Number.isFinite(value)) {
|
|
14
|
+
throw new Error(`${subject}: value must be a finite number`);
|
|
15
|
+
}
|
|
16
|
+
if (Math.abs(value) > Number.MAX_SAFE_INTEGER) {
|
|
17
|
+
throw new Error(`${subject}: value exceeds maximum safe integer range`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validates value is positive (>= EPSILON).
|
|
23
|
+
* @param value Number to validate
|
|
24
|
+
* @param subject Value name for error messages
|
|
25
|
+
* @throws If value is invalid or below EPSILON
|
|
26
|
+
*/
|
|
27
|
+
function assertValidPositiveNumber(value, subject) {
|
|
28
|
+
if (process.env.NODE_ENV !== "production") {
|
|
29
|
+
assertValidNumber(value, subject);
|
|
30
|
+
if (value < EPSILON) {
|
|
31
|
+
throw new Error(`${subject}: value must be greater than or equal to ${EPSILON}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Validates value is non-negative (>= 0).
|
|
37
|
+
* @param value Number to validate
|
|
38
|
+
* @param subject Value name for error messages
|
|
39
|
+
* @throws If value is invalid or negative
|
|
40
|
+
*/
|
|
41
|
+
function assertValidNonNegativeNumber(value, subject) {
|
|
42
|
+
if (process.env.NODE_ENV !== "production") {
|
|
43
|
+
assertValidNumber(value, subject);
|
|
44
|
+
if (value < 0) {
|
|
45
|
+
throw new Error(`${subject}: value must be greater than or equal to 0`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Validates constraint arguments are from same layer.
|
|
51
|
+
* @param a First constraint subject
|
|
52
|
+
* @param b Second constraint subject
|
|
53
|
+
* @param subject Constraint name for error messages
|
|
54
|
+
* @returns Common layer for both subjects
|
|
55
|
+
* @throws If subjects are invalid or from different layers
|
|
56
|
+
*/
|
|
57
|
+
function assertValidConstraintArguments(a, b, subject) {
|
|
58
|
+
if (process.env.NODE_ENV !== "production") {
|
|
59
|
+
if (a instanceof UILayer && b instanceof UILayer) {
|
|
60
|
+
throw new Error(`${subject}: layer cannot be snapped to another layer`);
|
|
61
|
+
}
|
|
62
|
+
let layerA;
|
|
63
|
+
let layerB;
|
|
64
|
+
if (a instanceof UILayer) {
|
|
65
|
+
layerA = a;
|
|
66
|
+
}
|
|
67
|
+
else if (isUILayerElement(a)) {
|
|
68
|
+
layerA = a.layer;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
throw new Error(`${subject}: A must be a UILayer or a UILayerElement`);
|
|
72
|
+
}
|
|
73
|
+
if (b instanceof UILayer) {
|
|
74
|
+
layerB = b;
|
|
75
|
+
}
|
|
76
|
+
else if (isUILayerElement(b)) {
|
|
77
|
+
layerB = b.layer;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw new Error(`${subject}: B must be a UILayer or a UILayerElement`);
|
|
81
|
+
}
|
|
82
|
+
if (layerA !== layerB) {
|
|
83
|
+
throw new Error(`${subject}: elements must be on the same layer`);
|
|
84
|
+
}
|
|
85
|
+
return layerA;
|
|
86
|
+
}
|
|
87
|
+
if (a instanceof UILayer) {
|
|
88
|
+
return a;
|
|
89
|
+
}
|
|
90
|
+
if (isUILayerElement(a)) {
|
|
91
|
+
return a.layer;
|
|
92
|
+
}
|
|
93
|
+
if (b instanceof UILayer) {
|
|
94
|
+
return b;
|
|
95
|
+
}
|
|
96
|
+
if (isUILayerElement(b)) {
|
|
97
|
+
return b.layer;
|
|
98
|
+
}
|
|
99
|
+
throw new Error(`${subject}: no valid subjects found`);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Validates interpolation constraint subjects.
|
|
103
|
+
* @param subject Constraint name for error messages
|
|
104
|
+
* @param a First element
|
|
105
|
+
* @param b Second element
|
|
106
|
+
* @param c Element to interpolate
|
|
107
|
+
* @param anchorA Anchor on element A
|
|
108
|
+
* @param anchorB Anchor on element B
|
|
109
|
+
* @returns Common layer for all subjects
|
|
110
|
+
* @throws If subjects violate interpolation constraints
|
|
111
|
+
*/
|
|
112
|
+
function assertValidInterpolationConstraintArguments(subject, a, b, c, anchorA, anchorB) {
|
|
113
|
+
if (process.env.NODE_ENV !== "production") {
|
|
114
|
+
if (c instanceof UILayer) {
|
|
115
|
+
throw new Error(`${subject}: C cannot be a layer`);
|
|
116
|
+
}
|
|
117
|
+
if (!isUILayerElement(c)) {
|
|
118
|
+
throw new Error(`${subject}: C must be a UILayerElement`);
|
|
119
|
+
}
|
|
120
|
+
let layerA;
|
|
121
|
+
let layerB;
|
|
122
|
+
if (a instanceof UILayer || isUILayerElement(a)) {
|
|
123
|
+
layerA = a instanceof UILayer ? a : a.layer;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
throw new Error(`${subject}: A must be UILayer or UILayerElement`);
|
|
127
|
+
}
|
|
128
|
+
if (b instanceof UILayer || isUILayerElement(b)) {
|
|
129
|
+
layerB = b instanceof UILayer ? b : b.layer;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
throw new Error(`${subject}: B must be UILayer or UILayerElement`);
|
|
133
|
+
}
|
|
134
|
+
const layerC = c.layer;
|
|
135
|
+
if (layerA !== layerB || layerA !== layerC) {
|
|
136
|
+
throw new Error(`${subject}: all elements must be on the same layer`);
|
|
137
|
+
}
|
|
138
|
+
if (c === a || c === b) {
|
|
139
|
+
throw new Error(`${subject}: C cannot be equal to A or B`);
|
|
140
|
+
}
|
|
141
|
+
if (a === b) {
|
|
142
|
+
if (Math.abs(anchorA - anchorB) <= EPSILON) {
|
|
143
|
+
throw new Error(`${subject}: when A and B are the same, anchorA and anchorB must differ by more than ${EPSILON}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return layerA;
|
|
147
|
+
}
|
|
148
|
+
if (isUILayerElement(a)) {
|
|
149
|
+
return a.layer;
|
|
150
|
+
}
|
|
151
|
+
if (isUILayerElement(b)) {
|
|
152
|
+
return b.layer;
|
|
153
|
+
}
|
|
154
|
+
if (a instanceof UILayer) {
|
|
155
|
+
return a;
|
|
156
|
+
}
|
|
157
|
+
if (b instanceof UILayer) {
|
|
158
|
+
return b;
|
|
159
|
+
}
|
|
160
|
+
throw new Error(`${subject}: no valid subjects found`);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export { assertValidConstraintArguments, assertValidInterpolationConstraintArguments, assertValidNonNegativeNumber, assertValidNumber, assertValidPositiveNumber };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CanvasTexture, UVMapping, ClampToEdgeWrapping, LinearFilter, RGBAFormat, UnsignedByteType, SRGBColorSpace, NoColorSpace } from 'three';
|
|
2
|
+
import { checkOffscreenCanvasSupport, checkSRGBSupport } from './webglCapabilities.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Creates a canvas using OffscreenCanvas if available, otherwise falls back to HTMLCanvasElement.
|
|
6
|
+
*
|
|
7
|
+
* @param width - Canvas width in pixels
|
|
8
|
+
* @param height - Canvas height in pixels
|
|
9
|
+
* @returns Canvas instance
|
|
10
|
+
*/
|
|
11
|
+
function createCanvas(width, height) {
|
|
12
|
+
if (checkOffscreenCanvasSupport()) {
|
|
13
|
+
return new OffscreenCanvas(width, height);
|
|
14
|
+
}
|
|
15
|
+
const canvasElement = document.createElement("canvas");
|
|
16
|
+
canvasElement.width = width;
|
|
17
|
+
canvasElement.height = height;
|
|
18
|
+
return canvasElement;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates a CanvasTexture with maximum WebGL1/WebGL2 compatibility.
|
|
22
|
+
* - ClampToEdge wrapping (required for NPOT in WebGL1)
|
|
23
|
+
* - Linear filtering without mipmaps (NPOT-safe)
|
|
24
|
+
* - RGBA/UnsignedByte format (no extensions needed)
|
|
25
|
+
* - sRGB colorspace only if supported
|
|
26
|
+
*
|
|
27
|
+
* @param canvas - Source canvas
|
|
28
|
+
* @returns Configured CanvasTexture
|
|
29
|
+
*/
|
|
30
|
+
function createCanvasTexture(canvas) {
|
|
31
|
+
const texture = new CanvasTexture(canvas, UVMapping, ClampToEdgeWrapping, ClampToEdgeWrapping, LinearFilter, LinearFilter, RGBAFormat, UnsignedByteType, 1);
|
|
32
|
+
texture.colorSpace = checkSRGBSupport() ? SRGBColorSpace : NoColorSpace;
|
|
33
|
+
texture.generateMipmaps = false;
|
|
34
|
+
return texture;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { createCanvas, createCanvasTexture };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const COLORS = {
|
|
2
|
+
black: 0x000000,
|
|
3
|
+
white: 0xffffff,
|
|
4
|
+
red: 0xff0000,
|
|
5
|
+
green: 0x008000,
|
|
6
|
+
blue: 0x0000ff,
|
|
7
|
+
yellow: 0xffff00,
|
|
8
|
+
cyan: 0x00ffff,
|
|
9
|
+
magenta: 0xff00ff,
|
|
10
|
+
gray: 0x808080,
|
|
11
|
+
grey: 0x808080,
|
|
12
|
+
silver: 0xc0c0c0,
|
|
13
|
+
maroon: 0x800000,
|
|
14
|
+
olive: 0x808000,
|
|
15
|
+
lime: 0x00ff00,
|
|
16
|
+
aqua: 0x00ffff,
|
|
17
|
+
teal: 0x008080,
|
|
18
|
+
navy: 0x000080,
|
|
19
|
+
fuchsia: 0xff00ff,
|
|
20
|
+
purple: 0x800080,
|
|
21
|
+
orange: 0xffa500,
|
|
22
|
+
pink: 0xffc0cb,
|
|
23
|
+
brown: 0xa52a2a,
|
|
24
|
+
gold: 0xffd700,
|
|
25
|
+
violet: 0xee82ee,
|
|
26
|
+
indigo: 0x4b0082,
|
|
27
|
+
coral: 0xff7f50,
|
|
28
|
+
salmon: 0xfa8072,
|
|
29
|
+
khaki: 0xf0e68c,
|
|
30
|
+
plum: 0xdda0dd,
|
|
31
|
+
orchid: 0xda70d6,
|
|
32
|
+
tan: 0xd2b48c,
|
|
33
|
+
beige: 0xf5f5dc,
|
|
34
|
+
mint: 0x98fb98,
|
|
35
|
+
lavender: 0xe6e6fa,
|
|
36
|
+
crimson: 0xdc143c,
|
|
37
|
+
azure: 0xf0ffff,
|
|
38
|
+
ivory: 0xfffff0,
|
|
39
|
+
snow: 0xfffafa,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { COLORS };
|