effect-motion 0.4.0 → 0.6.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.
- package/README.md +3 -3
- package/dist/Camera.d.ts +186 -49
- package/dist/Camera.js +343 -76
- package/dist/Color.d.ts +101 -1
- package/dist/Color.js +101 -1
- package/dist/EffectMotionError.d.ts +17 -0
- package/dist/EffectMotionError.js +17 -0
- package/dist/Entity.d.ts +684 -30
- package/dist/Entity.js +281 -27
- package/dist/Font.d.ts +108 -0
- package/dist/Font.js +95 -0
- package/dist/Image.d.ts +71 -0
- package/dist/Image.js +50 -0
- package/dist/Instance.d.ts +73 -11
- package/dist/Instance.js +44 -11
- package/dist/Motion.d.ts +328 -53
- package/dist/Motion.js +278 -46
- package/dist/Physics.d.ts +154 -20
- package/dist/Physics.js +92 -11
- package/dist/Projection.d.ts +36 -132
- package/dist/Projection.js +33 -292
- package/dist/Resource.d.ts +26 -0
- package/dist/Resource.js +41 -0
- package/dist/Runner.d.ts +714 -349
- package/dist/Runner.js +197 -150
- package/dist/Scene.d.ts +603 -175
- package/dist/Scene.js +596 -112
- package/dist/Timing.d.ts +170 -13
- package/dist/Timing.js +124 -6
- package/dist/Tree.d.ts +39 -0
- package/dist/Tree.js +127 -0
- package/dist/index.d.ts +54 -5
- package/dist/index.js +56 -5
- package/dist/particles/Particle.d.ts +2 -2
- package/dist/particles/ParticleField.d.ts +44 -42
- package/dist/particles/ParticleField.js +8 -9
- package/dist/particles/constructors.d.ts +5 -6
- package/dist/particles/constructors.js +8 -3
- package/dist/particles/legacy.d.ts +58 -0
- package/dist/particles/legacy.js +46 -0
- package/dist/particles/simulate.js +11 -3
- package/dist/particles/step.js +14 -10
- package/dist/types.d.ts +5 -0
- package/dist/types.js +1 -0
- package/package.json +58 -60
- package/dist/CameraHelpers.d.ts +0 -70
- package/dist/CameraHelpers.js +0 -239
- package/dist/CanvasExporter.d.ts +0 -12
- package/dist/CanvasExporter.js +0 -40
- package/dist/Fonts.d.ts +0 -41
- package/dist/Fonts.js +0 -27
- package/dist/Images.d.ts +0 -33
- package/dist/Images.js +0 -24
- package/dist/PngExporter.d.ts +0 -6
- package/dist/PngExporter.js +0 -85
- package/dist/Renderer.d.ts +0 -118
- package/dist/Renderer.js +0 -508
- package/dist/Shapes.d.ts +0 -11
- package/dist/Shapes.js +0 -11
- package/dist/demo.d.ts +0 -3
- package/dist/demo.js +0 -71
- package/dist/render/dof.d.ts +0 -27
- package/dist/render/dof.js +0 -37
- package/dist/render/paint.d.ts +0 -30
- package/dist/render/paint.js +0 -36
- package/dist/render/shapes.d.ts +0 -42
- package/dist/render/shapes.js +0 -310
- package/dist/shapes/Circle.d.ts +0 -32
- package/dist/shapes/Circle.js +0 -9
- package/dist/shapes/Ellipse.d.ts +0 -35
- package/dist/shapes/Ellipse.js +0 -10
- package/dist/shapes/Group.d.ts +0 -126
- package/dist/shapes/Group.js +0 -89
- package/dist/shapes/Hud.d.ts +0 -38
- package/dist/shapes/Hud.js +0 -35
- package/dist/shapes/Image.d.ts +0 -45
- package/dist/shapes/Image.js +0 -28
- package/dist/shapes/Line.d.ts +0 -47
- package/dist/shapes/Line.js +0 -35
- package/dist/shapes/Path.d.ts +0 -107
- package/dist/shapes/Path.js +0 -32
- package/dist/shapes/Rect.d.ts +0 -51
- package/dist/shapes/Rect.js +0 -22
- package/dist/shapes/Shape2D.d.ts +0 -49
- package/dist/shapes/Shape2D.js +0 -52
- package/dist/shapes/Shapes.d.ts +0 -11
- package/dist/shapes/Shapes.js +0 -11
- package/dist/shapes/Square.d.ts +0 -32
- package/dist/shapes/Square.js +0 -11
- package/dist/shapes/Text.d.ts +0 -51
- package/dist/shapes/Text.js +0 -24
package/dist/shapes/Square.d.ts
DELETED
|
@@ -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
|
-
}>;
|
package/dist/shapes/Square.js
DELETED
|
@@ -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
|
-
});
|
package/dist/shapes/Text.d.ts
DELETED
|
@@ -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
|
-
}>;
|
package/dist/shapes/Text.js
DELETED
|
@@ -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
|
-
});
|