laymur 0.27.1 → 0.29.0

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.
Files changed (138) hide show
  1. package/README.md +99 -5
  2. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +14 -3
  3. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +40 -6
  4. package/dist/core/constraints/UICustomConstraint.js +2 -2
  5. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +3 -2
  6. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +3 -2
  7. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +3 -2
  8. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +3 -2
  9. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +6 -0
  10. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +8 -0
  11. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +3 -2
  12. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +3 -2
  13. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +3 -2
  14. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +3 -2
  15. package/dist/core/constraints/constraintAsserts.d.ts +41 -0
  16. package/dist/core/constraints/constraintAsserts.js +171 -0
  17. package/dist/core/elements/UICanvasElement/UICanvasElement.d.ts +54 -0
  18. package/dist/core/elements/UICanvasElement/UICanvasElement.js +70 -0
  19. package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +2 -0
  20. package/dist/core/elements/UIDummy/UIDummy.d.ts +8 -5
  21. package/dist/core/elements/UIDummy/UIDummy.js +24 -11
  22. package/dist/core/elements/UIElement/UIElement.Internal.d.ts +6 -5
  23. package/dist/core/elements/UIElement/UIElement.Internal.js +0 -4
  24. package/dist/core/elements/UIElement/UIElement.d.ts +12 -6
  25. package/dist/core/elements/UIElement/UIElement.js +14 -7
  26. package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +42 -2
  27. package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +2 -2
  28. package/dist/core/elements/UIGraphics/UIGraphics.d.ts +48 -34
  29. package/dist/core/elements/UIGraphics/UIGraphics.js +196 -93
  30. package/dist/core/elements/UIImage/UIImage.d.ts +11 -1
  31. package/dist/core/elements/UIImage/UIImage.js +14 -0
  32. package/dist/core/elements/UIScene/UIScene.Internal.d.ts +10 -1
  33. package/dist/core/elements/UIScene/UIScene.Internal.js +1 -0
  34. package/dist/core/elements/UIScene/UIScene.d.ts +11 -1
  35. package/dist/core/elements/UIScene/UIScene.js +29 -5
  36. package/dist/core/elements/UIText/UIText.Interfaces.d.ts +2 -2
  37. package/dist/core/elements/UIText/UIText.Internal.d.ts +14 -1
  38. package/dist/core/elements/UIText/UIText.Internal.js +12 -0
  39. package/dist/core/elements/UIText/UIText.Measuring.d.ts +9 -4
  40. package/dist/core/elements/UIText/UIText.Measuring.js +17 -6
  41. package/dist/core/elements/UIText/UIText.Rendering.d.ts +7 -16
  42. package/dist/core/elements/UIText/UIText.Rendering.js +212 -46
  43. package/dist/core/elements/UIText/UIText.d.ts +64 -29
  44. package/dist/core/elements/UIText/UIText.js +134 -149
  45. package/dist/core/index.d.ts +10 -4
  46. package/dist/core/index.js +5 -1
  47. package/dist/core/layers/UILayer/UILayer.d.ts +17 -3
  48. package/dist/core/layers/UILayer/UILayer.js +35 -4
  49. package/dist/core/layers/UIViewportLayer/UIViewportLayer.d.ts +2 -0
  50. package/dist/core/layers/UIViewportLayer/UIViewportLayer.js +4 -1
  51. package/dist/core/miscellaneous/UIBlendMode.d.ts +5 -0
  52. package/dist/core/miscellaneous/UIBlendMode.js +7 -0
  53. package/dist/core/miscellaneous/asserts.d.ts +0 -41
  54. package/dist/core/miscellaneous/asserts.js +0 -170
  55. package/dist/core/miscellaneous/canvas-surface/UICanvasSurface.d.ts +46 -0
  56. package/dist/core/miscellaneous/canvas-surface/UICanvasSurface.js +86 -0
  57. package/dist/core/miscellaneous/color/UIColor.d.ts +17 -0
  58. package/dist/core/miscellaneous/color/UIColor.js +22 -0
  59. package/dist/core/miscellaneous/color/canvasColor.d.ts +9 -0
  60. package/dist/core/miscellaneous/color/canvasColor.js +15 -0
  61. package/dist/core/miscellaneous/insets/UIInsets.d.ts +3 -0
  62. package/dist/core/miscellaneous/insets/UIInsets.js +15 -0
  63. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +10 -7
  64. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +11 -8
  65. package/dist/core/miscellaneous/paint/UIGradient.Internal.d.ts +37 -0
  66. package/dist/core/miscellaneous/paint/UIGradient.Internal.js +14 -0
  67. package/dist/core/miscellaneous/paint/UIGradient.d.ts +18 -0
  68. package/dist/core/miscellaneous/paint/UIGradient.js +35 -0
  69. package/dist/core/miscellaneous/paint/UILinearGradient.d.ts +14 -0
  70. package/dist/core/miscellaneous/paint/UILinearGradient.js +22 -0
  71. package/dist/core/miscellaneous/paint/UIPaint.Internal.d.ts +21 -0
  72. package/dist/core/miscellaneous/paint/UIPaint.Internal.js +1 -0
  73. package/dist/core/miscellaneous/paint/UIPaint.d.ts +17 -0
  74. package/dist/core/miscellaneous/paint/UIPaint.js +21 -0
  75. package/dist/core/miscellaneous/paint/UIRadialGradient.d.ts +18 -0
  76. package/dist/core/miscellaneous/paint/UIRadialGradient.js +33 -0
  77. package/dist/core/miscellaneous/shared.d.ts +14 -0
  78. package/dist/core/miscellaneous/shared.js +11 -0
  79. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +91 -30
  80. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +12 -8
  81. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +41 -63
  82. package/dist/core/miscellaneous/text-style/UITextStyle.js +165 -291
  83. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +2 -1
  84. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +12 -3
  85. package/dist/core/shaders/UIProgressMaskFunctionCircular.js +1 -2
  86. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +7 -3
  87. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +2 -1
  88. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +19 -10
  89. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +6 -2
  90. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +41 -9
  91. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +97 -35
  92. package/dist/particles/behaviorModules/UIBehaviorAlignToVelocity.d.ts +44 -0
  93. package/dist/particles/behaviorModules/UIBehaviorAlignToVelocity.js +75 -0
  94. package/dist/particles/behaviorModules/UIBehaviorBounce.d.ts +51 -0
  95. package/dist/particles/behaviorModules/UIBehaviorBounce.js +107 -0
  96. package/dist/particles/behaviorModules/UIBehaviorOrbit.d.ts +39 -0
  97. package/dist/particles/behaviorModules/UIBehaviorOrbit.js +73 -0
  98. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +7 -2
  99. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +9 -5
  100. package/dist/particles/behaviorModules/UIBehaviorSeek.d.ts +38 -0
  101. package/dist/particles/behaviorModules/UIBehaviorSeek.js +75 -0
  102. package/dist/particles/elements/UIEmitter.Internal.d.ts +48 -1
  103. package/dist/particles/elements/UIEmitter.Internal.js +26 -1
  104. package/dist/particles/elements/UIEmitter.Schedule.d.ts +31 -0
  105. package/dist/particles/elements/UIEmitter.Schedule.js +81 -0
  106. package/dist/particles/elements/UIEmitter.d.ts +79 -9
  107. package/dist/particles/elements/UIEmitter.js +241 -83
  108. package/dist/particles/index.d.ts +13 -1
  109. package/dist/particles/index.js +11 -1
  110. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +6 -0
  111. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +27 -0
  112. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +7 -1
  113. package/dist/particles/instancedParticle/UIInstancedParticle.js +12 -1
  114. package/dist/particles/miscellaneous/miscellaneous.d.ts +22 -0
  115. package/dist/particles/miscellaneous/miscellaneous.js +38 -0
  116. package/dist/particles/renderingModules/UIRenderingFlipbook.d.ts +41 -0
  117. package/dist/particles/renderingModules/UIRenderingFlipbook.js +70 -0
  118. package/dist/particles/renderingModules/UIRenderingModule.d.ts +2 -1
  119. package/dist/particles/renderingModules/UIRenderingModule.js +2 -1
  120. package/dist/particles/renderingModules/UIRenderingRandomColor.d.ts +19 -0
  121. package/dist/particles/renderingModules/UIRenderingRandomColor.js +28 -0
  122. package/dist/particles/renderingModules/UIRenderingShape.d.ts +31 -0
  123. package/dist/particles/renderingModules/UIRenderingShape.js +54 -0
  124. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +1 -1
  125. package/dist/particles/renderingModules/UIRenderingTexture.js +4 -28
  126. package/dist/particles/shaders/UIRenderingFlipbook.d.ts +5 -0
  127. package/dist/particles/shaders/UIRenderingFlipbook.js +19 -0
  128. package/dist/particles/shaders/UIRenderingRandomColor.d.ts +2 -0
  129. package/dist/particles/shaders/UIRenderingRandomColor.js +10 -0
  130. package/dist/particles/shaders/UIRenderingShape.d.ts +6 -0
  131. package/dist/particles/shaders/UIRenderingShape.js +15 -0
  132. package/dist/particles/shaders/UIRenderingTexture.d.ts +4 -2
  133. package/dist/particles/shaders/UIRenderingTexture.js +27 -2
  134. package/dist/particles/spawnModules/UISpawnCircle.d.ts +44 -0
  135. package/dist/particles/spawnModules/UISpawnCircle.js +81 -0
  136. package/dist/particles/spawnModules/UISpawnRadialVelocity.d.ts +37 -0
  137. package/dist/particles/spawnModules/UISpawnRadialVelocity.js +75 -0
  138. package/package.json +1 -1
@@ -1,26 +1,19 @@
1
- import type { UITextAlign, UITextStyleConfig } from "./UITextStyle.Internal.js";
2
- /** Text style configuration for UI text rendering */
1
+ import type { UIPaint, UIPaintConfig } from "../paint/UIPaint.Internal.js";
2
+ import type { UITextAlign, UITextFontStyle, UITextFontWeight, UITextPaintBox, UITextShadow, UITextShadowConfig, UITextStroke, UITextStrokeConfig, UITextStyleConfig } from "./UITextStyle.Internal.js";
3
+ /**
4
+ * Text style of a span or of a whole text. Properties left undefined are taken from the
5
+ * fallback style, the common style of the text for a span, then from the defaults. Lists of
6
+ * strokes and shadows are taken as a whole.
7
+ */
3
8
  export declare class UITextStyle {
4
- private colorInternal?;
5
- private alignInternal?;
6
- private fontFamilyInternal?;
7
- private fontSizeInternal?;
8
- private fontStyleInternal?;
9
- private fontWeightInternal?;
10
- private lineHeightInternal?;
11
- private enableShadowInternal?;
12
- private shadowOffsetXInternal?;
13
- private shadowOffsetYInternal?;
14
- private shadowBlurInternal?;
15
- private shadowColorInternal?;
16
- private enableStrokeInternal?;
17
- private strokeColorInternal?;
18
- private strokeThicknessInternal?;
9
+ private readonly values;
19
10
  private dirtyInternal;
20
11
  /** @param config Partial style configuration. Unspecified properties remain undefined. */
21
12
  constructor(config?: Partial<UITextStyleConfig>);
22
- /** Text color */
23
- get color(): string | undefined;
13
+ /** Color or gradient of the glyphs. A color is kept as a CSS string. */
14
+ get color(): UIPaint | undefined;
15
+ /** Box the gradients of the fill and of the strokes are laid over */
16
+ get paintBox(): UITextPaintBox | undefined;
24
17
  /** Text alignment */
25
18
  get align(): UITextAlign | undefined;
26
19
  /** Font family name */
@@ -28,57 +21,41 @@ export declare class UITextStyle {
28
21
  /** Font size in pixels */
29
22
  get fontSize(): number | undefined;
30
23
  /** Font style */
31
- get fontStyle(): "normal" | "italic" | "oblique" | undefined;
24
+ get fontStyle(): UITextFontStyle | undefined;
32
25
  /** Font weight */
33
- get fontWeight(): "normal" | "bold" | "bolder" | "lighter" | number | undefined;
34
- /** Line height in pixels */
26
+ get fontWeight(): UITextFontWeight | undefined;
27
+ /** Line height in pixels, the distance between baselines */
35
28
  get lineHeight(): number | undefined;
36
- /** Whether shadow is enabled */
37
- get enableShadow(): boolean | undefined;
38
- /** Shadow horizontal offset in pixels */
39
- get shadowOffsetX(): number | undefined;
40
- /** Shadow vertical offset in pixels */
41
- get shadowOffsetY(): number | undefined;
42
- /** Shadow blur radius in pixels */
43
- get shadowBlur(): number | undefined;
44
- /** Shadow color */
45
- get shadowColor(): string | undefined;
46
- /** Whether stroke is enabled */
47
- get enableStroke(): boolean | undefined;
48
- /** Stroke color */
49
- get strokeColor(): string | undefined;
50
- /** Stroke thickness in pixels */
51
- get strokeThickness(): number | undefined;
52
- set color(value: string | undefined);
29
+ /** Outlines from the innermost to the outermost */
30
+ get strokes(): readonly UITextStroke[] | undefined;
31
+ /** Shadows and glows, the first one on top */
32
+ get shadows(): readonly UITextShadow[] | undefined;
33
+ /** Color or gradient of the glyphs. A string is a `UIColor` name or a CSS color. */
34
+ set color(value: UIPaintConfig | undefined);
35
+ /** Box the gradients of the fill and of the strokes are laid over */
36
+ set paintBox(value: UITextPaintBox | undefined);
37
+ /** Text alignment */
53
38
  set align(value: UITextAlign | undefined);
39
+ /** Font family name */
54
40
  set fontFamily(value: string | undefined);
41
+ /** Font size in pixels */
55
42
  set fontSize(value: number | undefined);
56
- set fontStyle(value: "normal" | "italic" | "oblique" | undefined);
57
- set fontWeight(value: "normal" | "bold" | "bolder" | "lighter" | number | undefined);
43
+ /** Font style */
44
+ set fontStyle(value: UITextFontStyle | undefined);
45
+ /** Font weight */
46
+ set fontWeight(value: UITextFontWeight | undefined);
47
+ /** Line height in pixels, the distance between baselines */
58
48
  set lineHeight(value: number | undefined);
59
- set enableShadow(value: boolean | undefined);
60
- set shadowOffsetX(value: number | undefined);
61
- set shadowOffsetY(value: number | undefined);
62
- set shadowBlur(value: number | undefined);
63
- set shadowColor(value: string | undefined);
64
- set enableStroke(value: boolean | undefined);
65
- set strokeColor(value: string | undefined);
66
- set strokeThickness(value: number | undefined);
67
49
  /**
68
- * Resolves complete style from primary and fallback sources.
69
- * @param primary First style to check for each property
70
- * @param fallback Second style to check if primary is undefined
71
- * @returns Complete style configuration with all defaults applied
50
+ * Outlines from the innermost to the outermost. Each one lies outside the previous one. An
51
+ * empty list draws no outline, undefined takes the outlines of the fallback style.
72
52
  */
73
- static resolve(primary?: UITextStyle, fallback?: UITextStyle): UITextStyleConfig;
53
+ set strokes(value: readonly UITextStrokeConfig[] | undefined);
74
54
  /**
75
- * Calculates maximum padding required for stroke and shadow of a resolved style.
76
- * The stroke is centered on the glyph outline, so only half of it is outside.
77
- * The shadow is cast by the stroke as well as by the fill.
78
- * @param style Resolved style
79
- * @returns Padding in pixels needed on all sides
55
+ * Shadows and glows, the first one on top. An empty list draws no shadow, undefined takes the
56
+ * shadows of the fallback style.
80
57
  */
81
- static calculatePadding(style: UITextStyleConfig): number;
58
+ set shadows(value: readonly UITextShadowConfig[] | undefined);
82
59
  /** Sets all properties to default values */
83
60
  setDefaults(): void;
84
61
  /** Sets all properties to undefined */
@@ -86,11 +63,12 @@ export declare class UITextStyle {
86
63
  /** Copies from another style instance */
87
64
  copy(value: UITextStyle): void;
88
65
  /**
89
- * Calculates maximum padding required for stroke and shadow.
66
+ * Calculates the padding needed on every side for outlines and shadows.
90
67
  * Properties left undefined here are taken from `fallback`, then from defaults,
91
- * so a span style is measured with the stroke and shadow it is drawn with.
68
+ * so a span style is measured with the outlines and shadows it is drawn with.
92
69
  * @param fallback Style that supplies undefined properties (usually the common style)
93
- * @returns Padding in pixels needed on all sides
70
+ * @returns Padding in pixels
94
71
  */
95
72
  calculatePadding(fallback?: UITextStyle): number;
73
+ private setValue;
96
74
  }