effect-motion 0.4.0 → 0.5.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 (91) hide show
  1. package/README.md +2 -2
  2. package/dist/Camera.d.ts +186 -49
  3. package/dist/Camera.js +343 -76
  4. package/dist/Color.d.ts +101 -1
  5. package/dist/Color.js +101 -1
  6. package/dist/EffectMotionError.d.ts +17 -0
  7. package/dist/EffectMotionError.js +17 -0
  8. package/dist/Entity.d.ts +682 -38
  9. package/dist/Entity.js +271 -27
  10. package/dist/Font.d.ts +108 -0
  11. package/dist/Font.js +95 -0
  12. package/dist/Image.d.ts +71 -0
  13. package/dist/Image.js +50 -0
  14. package/dist/Instance.d.ts +73 -11
  15. package/dist/Instance.js +44 -11
  16. package/dist/Motion.d.ts +328 -53
  17. package/dist/Motion.js +278 -46
  18. package/dist/Physics.d.ts +154 -20
  19. package/dist/Physics.js +92 -11
  20. package/dist/Projection.d.ts +37 -132
  21. package/dist/Projection.js +33 -292
  22. package/dist/Resource.d.ts +26 -0
  23. package/dist/Resource.js +41 -0
  24. package/dist/Runner.d.ts +639 -350
  25. package/dist/Runner.js +197 -150
  26. package/dist/Scene.d.ts +603 -175
  27. package/dist/Scene.js +596 -112
  28. package/dist/Timing.d.ts +170 -13
  29. package/dist/Timing.js +124 -6
  30. package/dist/Tree.d.ts +39 -0
  31. package/dist/Tree.js +127 -0
  32. package/dist/index.d.ts +54 -5
  33. package/dist/index.js +56 -5
  34. package/dist/particles/Particle.d.ts +2 -2
  35. package/dist/particles/ParticleField.d.ts +8 -6
  36. package/dist/particles/ParticleField.js +8 -9
  37. package/dist/particles/constructors.d.ts +5 -6
  38. package/dist/particles/constructors.js +8 -3
  39. package/dist/particles/legacy.d.ts +58 -0
  40. package/dist/particles/legacy.js +46 -0
  41. package/dist/particles/simulate.js +11 -3
  42. package/dist/particles/step.js +14 -10
  43. package/dist/types.d.ts +5 -0
  44. package/dist/types.js +1 -0
  45. package/package.json +2 -4
  46. package/dist/CameraHelpers.d.ts +0 -70
  47. package/dist/CameraHelpers.js +0 -239
  48. package/dist/CanvasExporter.d.ts +0 -12
  49. package/dist/CanvasExporter.js +0 -40
  50. package/dist/Fonts.d.ts +0 -41
  51. package/dist/Fonts.js +0 -27
  52. package/dist/Images.d.ts +0 -33
  53. package/dist/Images.js +0 -24
  54. package/dist/PngExporter.d.ts +0 -6
  55. package/dist/PngExporter.js +0 -85
  56. package/dist/Renderer.d.ts +0 -118
  57. package/dist/Renderer.js +0 -508
  58. package/dist/Shapes.d.ts +0 -11
  59. package/dist/Shapes.js +0 -11
  60. package/dist/demo.d.ts +0 -3
  61. package/dist/demo.js +0 -71
  62. package/dist/render/dof.d.ts +0 -27
  63. package/dist/render/dof.js +0 -37
  64. package/dist/render/paint.d.ts +0 -30
  65. package/dist/render/paint.js +0 -36
  66. package/dist/render/shapes.d.ts +0 -42
  67. package/dist/render/shapes.js +0 -310
  68. package/dist/shapes/Circle.d.ts +0 -32
  69. package/dist/shapes/Circle.js +0 -9
  70. package/dist/shapes/Ellipse.d.ts +0 -35
  71. package/dist/shapes/Ellipse.js +0 -10
  72. package/dist/shapes/Group.d.ts +0 -126
  73. package/dist/shapes/Group.js +0 -89
  74. package/dist/shapes/Hud.d.ts +0 -38
  75. package/dist/shapes/Hud.js +0 -35
  76. package/dist/shapes/Image.d.ts +0 -45
  77. package/dist/shapes/Image.js +0 -28
  78. package/dist/shapes/Line.d.ts +0 -47
  79. package/dist/shapes/Line.js +0 -35
  80. package/dist/shapes/Path.d.ts +0 -107
  81. package/dist/shapes/Path.js +0 -32
  82. package/dist/shapes/Rect.d.ts +0 -51
  83. package/dist/shapes/Rect.js +0 -22
  84. package/dist/shapes/Shape2D.d.ts +0 -49
  85. package/dist/shapes/Shape2D.js +0 -52
  86. package/dist/shapes/Shapes.d.ts +0 -11
  87. package/dist/shapes/Shapes.js +0 -11
  88. package/dist/shapes/Square.d.ts +0 -32
  89. package/dist/shapes/Square.js +0 -11
  90. package/dist/shapes/Text.d.ts +0 -51
  91. package/dist/shapes/Text.js +0 -24
@@ -1,32 +0,0 @@
1
- import * as Entity from "../Entity.js";
2
- export declare const Square: Entity.Entity<"shapes/Square", import("effect/Schema").Struct<{
3
- x: import("effect/Schema").withConstructorDefault<import("effect/Schema").Number>;
4
- y: import("effect/Schema").withConstructorDefault<import("effect/Schema").Number>;
5
- z: import("effect/Schema").withConstructorDefault<import("effect/Schema").Number>;
6
- opacity: import("effect/Schema").withConstructorDefault<import("effect/Schema").Number>;
7
- fill: import("effect/Schema").withConstructorDefault<typeof import("../Color.js").Color>;
8
- stroke: import("effect/Schema").optionalKey<typeof import("../Color.js").Color>;
9
- strokeWidth: import("effect/Schema").optionalKey<import("effect/Schema").Number>;
10
- size: import("effect/Schema").withConstructorDefault<import("effect/Schema").Number>;
11
- }>, {
12
- readonly "~position": Entity.TraitLens<{
13
- readonly x: number;
14
- readonly y: number;
15
- readonly z: number;
16
- readonly opacity: number;
17
- readonly fill: import("../Color.js").Color;
18
- readonly stroke?: import("../Color.js").Color;
19
- readonly strokeWidth?: number;
20
- readonly size: number;
21
- }, Entity.Position>;
22
- readonly "~opacity": Entity.TraitLens<{
23
- readonly x: number;
24
- readonly y: number;
25
- readonly z: number;
26
- readonly opacity: number;
27
- readonly fill: import("../Color.js").Color;
28
- readonly stroke?: import("../Color.js").Color;
29
- readonly strokeWidth?: number;
30
- readonly size: number;
31
- }, number>;
32
- }>;
@@ -1,11 +0,0 @@
1
- import * as Entity from "../Entity.js";
2
- import * as Shape2D from "./Shape2D.js";
3
- // its own entity, not Rect sugar: the schema IS the width === height
4
- // constraint, which a Rect can't enforce through updates
5
- export const Square = Entity.make("shapes/Square", {
6
- ...Shape2D.filled,
7
- size: Shape2D.defaultedNumber(100),
8
- }, {
9
- "~position": Shape2D.positionLens(),
10
- "~opacity": Shape2D.opacityLens(),
11
- });
@@ -1,51 +0,0 @@
1
- import * as Schema from "effect/Schema";
2
- import * as Entity from "../Entity.js";
3
- /**
4
- * A plain-string text leaf. `text` is required. The engine cannot measure
5
- * text, so alignment is delegated to SVG via `textAnchor` / `baseline`.
6
- * Inline formatting and multi-run styling are expressed by composing
7
- * multiple `Text` instances (via `children`), not by an in-engine tree.
8
- */
9
- export declare const Text: Entity.Entity<"shapes/Text", Schema.Struct<{
10
- x: Schema.withConstructorDefault<Schema.Number>;
11
- y: Schema.withConstructorDefault<Schema.Number>;
12
- z: Schema.withConstructorDefault<Schema.Number>;
13
- opacity: Schema.withConstructorDefault<Schema.Number>;
14
- fill: Schema.withConstructorDefault<typeof import("../Color.js").Color>;
15
- stroke: Schema.optionalKey<typeof import("../Color.js").Color>;
16
- strokeWidth: Schema.optionalKey<Schema.Number>;
17
- text: Schema.String;
18
- fontSize: Schema.withConstructorDefault<Schema.Number>;
19
- fontFamily: Schema.withConstructorDefault<Schema.String>;
20
- textAnchor: Schema.optionalKey<Schema.Literals<readonly ["start", "middle", "end"]>>;
21
- baseline: Schema.optionalKey<Schema.Literals<readonly ["auto", "middle", "hanging"]>>;
22
- }>, {
23
- readonly "~position": Entity.TraitLens<{
24
- readonly x: number;
25
- readonly y: number;
26
- readonly z: number;
27
- readonly opacity: number;
28
- readonly fill: import("../Color.js").Color;
29
- readonly stroke?: import("../Color.js").Color;
30
- readonly strokeWidth?: number;
31
- readonly text: string;
32
- readonly fontSize: number;
33
- readonly fontFamily: string;
34
- readonly textAnchor?: "end" | "middle" | "start";
35
- readonly baseline?: "auto" | "hanging" | "middle";
36
- }, Entity.Position>;
37
- readonly "~opacity": Entity.TraitLens<{
38
- readonly x: number;
39
- readonly y: number;
40
- readonly z: number;
41
- readonly opacity: number;
42
- readonly fill: import("../Color.js").Color;
43
- readonly stroke?: import("../Color.js").Color;
44
- readonly strokeWidth?: number;
45
- readonly text: string;
46
- readonly fontSize: number;
47
- readonly fontFamily: string;
48
- readonly textAnchor?: "end" | "middle" | "start";
49
- readonly baseline?: "auto" | "hanging" | "middle";
50
- }, number>;
51
- }>;
@@ -1,24 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import * as Schema from "effect/Schema";
3
- import * as Entity from "../Entity.js";
4
- import * as Shape2D from "./Shape2D.js";
5
- /**
6
- * A plain-string text leaf. `text` is required. The engine cannot measure
7
- * text, so alignment is delegated to SVG via `textAnchor` / `baseline`.
8
- * Inline formatting and multi-run styling are expressed by composing
9
- * multiple `Text` instances (via `children`), not by an in-engine tree.
10
- */
11
- export const Text = Entity.make("shapes/Text", {
12
- ...Shape2D.filled,
13
- text: Schema.String,
14
- // numeric, therefore tweenable: tweenTo({ fontSize }) just works
15
- fontSize: Shape2D.defaultedNumber(16),
16
- // the generic family resolves to a sane system sans on every
17
- // platform — no bet on a named font existing
18
- fontFamily: Schema.String.pipe(Schema.withConstructorDefault(Effect.succeed("sans-serif"))),
19
- textAnchor: Schema.optionalKey(Schema.Literals(["start", "middle", "end"])),
20
- baseline: Schema.optionalKey(Schema.Literals(["auto", "middle", "hanging"])),
21
- }, {
22
- "~position": Shape2D.positionLens(),
23
- "~opacity": Shape2D.opacityLens(),
24
- });