@phin-tech/dottie 0.0.0-stage → 0.2.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.
@@ -0,0 +1,36 @@
1
+ import { type Ease, type Element, type Follow, type Page, type Timeline, type Track } from "./model.ts";
2
+ import { Polyline, type Point, type Rect } from "./path.ts";
3
+ export declare function applyEase(ease: Ease, u: number): number;
4
+ /** The time inside the track's own keys that `t` plays (repeats folded back). */
5
+ export declare function localTime(track: Track, t: number): number;
6
+ /** Whether some property is tweening at `t`: between two keys that set it to different values, not held. */
7
+ export declare function isChanging(track: Track, t: number): boolean;
8
+ /** Whether the element is shown at `t`. */
9
+ export declare function isVisible(track: Track, t: number): boolean;
10
+ /** `e` posed at `t` (returns a copy). */
11
+ export declare function applyTrack(track: Track, e: Element, t: number): Element;
12
+ /** The path span placing the element at `t`, unless an x or y key after it has taken the element back. */
13
+ export declare function followSpan(track: Track, t: number): Follow | null;
14
+ /** The clean route of a connector, or the clean, rotated outline of any other element. */
15
+ export declare function tracing(e: Element, page: Page): Polyline;
16
+ /** `e` moved onto the path it is following at `t`, if any. `page` has every key applied. */
17
+ export declare function following(track: Track, e: Element, t: number, page: Page): Element;
18
+ /** The page as a still drawing at `t` seconds (DottieDocument.resolved(at:)). A page without a timeline is returned as is. */
19
+ export declare function resolved(page: Page, t: number): Page;
20
+ /** The moment a still picture of the page shows: its poster, else the end. */
21
+ export declare function posterTime(page: Page): number;
22
+ /** The page as a still picture (its poster frame when animated). */
23
+ export declare function still(page: Page): Page;
24
+ export declare function cameraRect(tl: Timeline, t: number): Rect | null;
25
+ /** What exports show at `t`: the camera's view widened (never cropped) to the first key's shape. */
26
+ export declare function cameraView(tl: Timeline, t: number): Rect | null;
27
+ /** `r` widened about its center to the width-to-height ratio `aspect`. */
28
+ export declare function fit(r: Rect, aspect: number): Rect;
29
+ export declare function frameCount(tl: Timeline): number;
30
+ /** The times exports and playback draw: every frame, plus the end when it falls between frames. */
31
+ export declare function frameTimes(tl: Timeline): number[];
32
+ /** The index of the last scene marker at or before `t`, or -1. */
33
+ export declare function sceneAt(tl: Timeline, t: number): number;
34
+ /** Elements that only exist in motion: hidden at the start and in the still (packets, mostly). */
35
+ export declare function transientElements(page: Page): Set<string>;
36
+ export type { Point };
package/package.json CHANGED
@@ -1,6 +1,75 @@
1
1
  {
2
2
  "name": "@phin-tech/dottie",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Render, play and compile Dottie (.dottie) drawings and animations in the browser",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/phin-tech/dottie.git",
10
+ "directory": "web"
11
+ },
12
+ "homepage": "https://github.com/phin-tech/dottie/tree/main/web#readme",
13
+ "main": "./dist/dottie.js",
14
+ "module": "./dist/dottie.js",
15
+ "types": "./dist/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/types/index.d.ts",
19
+ "default": "./dist/dottie.js"
20
+ },
21
+ "./player": {
22
+ "types": "./dist/types/player-entry.d.ts",
23
+ "default": "./dist/dottie-player.js"
24
+ },
25
+ "./compile": {
26
+ "types": "./dist/types/compile.d.ts",
27
+ "default": "./dist/compile.js"
28
+ }
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "README.md",
33
+ "LICENSE",
34
+ "PARITY.md"
35
+ ],
36
+ "sideEffects": [
37
+ "./dist/dottie-player.js",
38
+ "./dist/dottie-player.min.js"
39
+ ],
40
+ "scripts": {
41
+ "build": "node build.mjs",
42
+ "typecheck": "tsc -p .",
43
+ "test": "tsc -p . && node --test test/*.test.ts",
44
+ "visual": "node build.mjs && node test/visual/run.mjs",
45
+ "test:browser": "node build.mjs && node --test test/browser/*.test.mjs",
46
+ "prepublishOnly": "npm test && node build.mjs"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^24.19.2",
50
+ "@types/pngjs": "^6.0.5",
51
+ "esbuild": "^0.25.12",
52
+ "pixelmatch": "^7.2.0",
53
+ "playwright": "^1.64.1",
54
+ "pngjs": "^7.0.0",
55
+ "typescript": "^5.9.3"
56
+ },
57
+ "publishConfig": {
58
+ "access": "public"
59
+ },
60
+ "keywords": [
61
+ "dottie",
62
+ "diagram",
63
+ "sketch",
64
+ "animation",
65
+ "svg",
66
+ "web-component",
67
+ "rough"
68
+ ],
69
+ "engines": {
70
+ "node": ">=18"
71
+ },
72
+ "bin": {
73
+ "dottie-compile": "dist/dottie-compile.mjs"
74
+ }
75
+ }