Skip to content

Commit 771865f

Browse files
committed
v1 alpha
1 parent e522ae2 commit 771865f

File tree

287 files changed

+57927
-22993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

287 files changed

+57927
-22993
lines changed

.eslintrc.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"extends": [
3+
"plugin:@typescript-eslint/recommended",
4+
"prettier"
5+
],
6+
"parser": "@typescript-eslint/parser",
7+
"parserOptions": {
8+
"project": "tsconfig.json",
9+
"sourceType": "module"
10+
},
11+
"plugins": [
12+
"@typescript-eslint"
13+
],
14+
"rules": {
15+
"no-var": "error",
16+
"prefer-rest-params": "off",
17+
"prefer-spread": "off",
18+
19+
"@typescript-eslint/ban-ts-comment": "off",
20+
"@typescript-eslint/ban-types": "off",
21+
"@typescript-eslint/no-empty-function": "off",
22+
"@typescript-eslint/no-empty-interface": "off",
23+
"@typescript-eslint/no-explicit-any": "off",
24+
"@typescript-eslint/no-inferrable-types": "off",
25+
"@typescript-eslint/no-non-null-assertion": "off",
26+
"@typescript-eslint/no-unused-vars": "off",
27+
"@typescript-eslint/no-var-requires": "off",
28+
"@typescript-eslint/typedef": [
29+
"error",
30+
{
31+
"arrowParameter": true,
32+
"propertyDeclaration": true
33+
}
34+
]
35+
}
36+
}

.gitignore

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
1-
.settings/
2-
.project
3-
/node_modules
4-
.idea
1+
# misc
2+
.DS_Store
3+
*.pem
4+
5+
# dependencies
6+
node_modules
7+
.pnp
8+
.pnp.js
9+
10+
# debug
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
15+
# local env files
16+
.env*.local
17+
.env
18+
19+
# testing
20+
/coverage
21+
/.nyc_output
22+
23+
# production
24+
build
25+
docs/dist/*
26+
27+
# next.js
28+
.next/
29+
# out/
30+
31+
# vercel
32+
.vercel
33+
34+
# ide
35+
.idea/
36+
.vscode*/
37+
38+
# typescript
39+
*.tsbuildinfo
40+
next-env.d.ts

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/dist/
2+
/docs/api/

.prettierrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"printWidth": 100
3+
}

CHANGELOG.md

Lines changed: 130 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,173 @@
1+
#### v1.0 [work in progress]
2+
3+
- rewrite with typescript
4+
- change package type to module
5+
- all classes are exported under Stage namespace
6+
- Stage is not callable, and is not a class anymore
7+
- removed Stage.app(callback)
8+
- added Stage.mount() to create a new app
9+
- added await Stage.atlas({ }) to preload images
10+
- added Component class as the base class
11+
- removed Stage.internal namespace
12+
- removed cordova/fastcontext loader and build
13+
- removed script loader `preload(url)`
14+
- removed relative path resolver for texture images
15+
- removed Stage.config()
16+
- removed \_create, \_extend
17+
- renamed Image/image to Sprite/sprite, and sprite.image() to sprite.texture()
18+
- renamed Str/string to Monotype/monotype
19+
- renamed create()/layer()/box() to component()/maximize()/minimize()
20+
- renamed component.sequence() to component.align()
21+
- replaced Stage.Math with Stage.math with different function names
22+
- removed Matrix.reverse (use inverse)
23+
- renamed Mouse to Pointer and made it internal
24+
- added CanvasTexture
25+
- changed canvas() signature
26+
- dropped texture.draw(x, y) sub-signature
27+
- removed cutouts, sprites, factory fields from atlas definition
28+
- replaced Ease() with Ease.get()
29+
- scaleTo renamed to fit
30+
131
#### v0.8.2
2-
* `render.js` renamed to `loop.js`
3-
* `node.js` renamed to `tree.js`
4-
* cordova starts by mousemove
32+
33+
- `render.js` renamed to `loop.js`
34+
- `node.js` renamed to `tree.js`
35+
- cordova starts by mousemove
536

637
#### v0.8.1
7-
* `node.scaleTo()` shortcut pinning method added
8-
* `node.matrix(true)` returns relative matrix instead of absolute
38+
39+
- `node.scaleTo()` shortcut pinning method added
40+
- `node.matrix(true)` returns relative matrix instead of absolute
941

1042
#### v0.8.0
11-
* **default `.tween()` behavior changed from append to replace**
12-
* `.tween(duration, delay)` changed to `.tween(duration, delay, append = false)`
13-
* `tween.clear()` deprecated and no-op
14-
* `tween.end()` replaced by `tween.done()`
43+
44+
- **default `.tween()` behavior changed from append to replace**
45+
- `.tween(duration, delay)` changed to `.tween(duration, delay, append = false)`
46+
- `tween.clear()` deprecated and no-op
47+
- `tween.end()` replaced by `tween.done()`
1548

1649
#### v0.7.1
17-
* `tween.then()` replaced by `tween.end()`
18-
* `tween.remove/hide()` are added
50+
51+
- `tween.then()` replaced by `tween.end()`
52+
- `tween.remove/hide()` are added
1953

2054
#### v0.7.0
21-
* **images and script urls starting with `./` are resolved as relative**
55+
56+
- **images and script urls starting with `./` are resolved as relative**
2257

2358
#### v0.6.7
24-
* Stage.Math extends native Math
59+
60+
- Stage.Math extends native Math
2561

2662
#### v0.6.6
27-
* lookup atlas by name before textures
28-
* `node.width/height()` pinning shortcuts return value
29-
* preloadScript('url') removed
63+
64+
- lookup atlas by name before textures
65+
- `node.width/height()` pinning shortcuts return value
66+
- preloadScript('url') removed
3067

3168
#### v0.6.5
32-
* **.preload('url.js') added**
69+
70+
- **.preload('url.js') added**
3371

3472
#### v0.6.4
35-
* pinning shortcuts are added to nodes
36-
* entire atlas can be referenced
73+
74+
- pinning shortcuts are added to nodes
75+
- entire atlas can be referenced
3776

3877
#### v0.6.2
39-
* `atlas.image.url` renamed to `src`
40-
* pining shorthand methods added to node
41-
* tick-based `timeout(fn, delay)` method added to node
42-
* entire atlas can be used as texture
78+
79+
- `atlas.image.url` renamed to `src`
80+
- pining shorthand methods added to node
81+
- tick-based `timeout(fn, delay)` method added to node
82+
- entire atlas can be used as texture
4383

4484
#### v0.6.0
45-
* **Cut/CutJS renamed to Stage/Stage.js**
85+
86+
- **Cut/CutJS renamed to Stage/Stage.js**
4687

4788
#### v0.5.0
48-
* atlas spec changed
49-
* **.preload(fn) added**
50-
* node.insert/append/prepend() methods accept array
51-
* node.id() renamed to node.label()
52-
* Cut.addTexture() removed
53-
* image.cropY/cropY() removed
54-
* anim.gotoLabel() removed
55-
* Cut.Anim.FPS is not public anymore
56-
* drawing() replaced with .canvas()
57-
* **Texture renamed to Atlas, new Texture class replaced Cut.Out**
58-
* node._cutouts and Cut.cutout() replaced with node._textures and Cut.texture()
59-
* Cut.texture() returns selection object
60-
* image-loader spec changed
89+
90+
- atlas spec changed
91+
- **.preload(fn) added**
92+
- node.insert/append/prepend() methods accept array
93+
- node.id() renamed to node.label()
94+
- Cut.addTexture() removed
95+
- image.cropY/cropY() removed
96+
- anim.gotoLabel() removed
97+
- Cut.Anim.FPS is not public anymore
98+
- drawing() replaced with .canvas()
99+
- **Texture renamed to Atlas, new Texture class replaced Cut.Out**
100+
- node.\_cutouts and Cut.cutout() replaced with node.\_textures and Cut.texture()
101+
- Cut.texture() returns selection object
102+
- image-loader spec changed
61103

62104
#### v0.4.12
63-
* root.background method added
105+
106+
- root.background method added
64107

65108
#### v0.4.10
66-
* **game loop continues if any tick returns true, but only renders if touched**
109+
110+
- **game loop continues if any tick returns true, but only renders if touched**
67111

68112
#### v0.4.9
69-
* texture.ratio renamed to texture.ppu
113+
114+
- texture.ratio renamed to texture.ppu
70115

71116
#### v0.4.8
72-
* new drawing (experimental) and cutout (internal) api
117+
118+
- new drawing (experimental) and cutout (internal) api
73119

74120
#### v0.4.3
75-
* pin set/get is refactored
76-
* resize in/out replace with scale in-pad/out-crop
77-
* default viewbox mode is 'in-pad'
121+
122+
- pin set/get is refactored
123+
- resize in/out replace with scale in-pad/out-crop
124+
- default viewbox mode is 'in-pad'
78125

79126
#### v0.4.0
80-
* **CommonJS/Node.js files and project structure**
81-
* Source files moved to `lib` and platform files to `platform`
82-
* extension files moved to ext
83-
* `lib/main` set as npm `main`
84-
* texture name made optional in cutout selector: `"[texture:]cutout"`
85-
* FastContext support added to Cordova, FastCanvas loader removed
86-
87-
* `Cut.Out.select` replaced with `Cut.cutout`
88-
* `Cut.config` and `Cut.start(configs)` are added
89-
* `Cut.init` and `Loader.loadImage` replaced with `"app-loader"` and `"image-loader"` configs
90-
* `Loader` merged with `Root`
91-
* `Loader.start/pause/resume` replaced with `Cut.start/pause/resume`
92-
* `root._ratio` replaced with `root.viewport().ratio`
93-
* `_isCut` replaced with `Cut._ensure`
94-
* `Texture` reorganized
95-
* `root.resize()` renamed to `viewport()`
127+
128+
- **CommonJS/Node.js files and project structure**
129+
- Source files moved to `lib` and platform files to `platform`
130+
- extension files moved to ext
131+
- `lib/main` set as npm `main`
132+
- texture name made optional in cutout selector: `"[texture:]cutout"`
133+
- FastContext support added to Cordova, FastCanvas loader removed
134+
135+
- `Cut.Out.select` replaced with `Cut.cutout`
136+
- `Cut.config` and `Cut.start(configs)` are added
137+
- `Cut.init` and `Loader.loadImage` replaced with `"app-loader"` and `"image-loader"` configs
138+
- `Loader` merged with `Root`
139+
- `Loader.start/pause/resume` replaced with `Cut.start/pause/resume`
140+
- `root._ratio` replaced with `root.viewport().ratio`
141+
- `_isCut` replaced with `Cut._ensure`
142+
- `Texture` reorganized
143+
- `root.resize()` renamed to `viewport()`
96144

97145
#### v0.3.1
98-
* Remove `Mouse(..., captureAnyMove)` and use flag instead
99-
* Refactoring easing class and moving tween/ease to another file
146+
147+
- Remove `Mouse(..., captureAnyMove)` and use flag instead
148+
- Refactoring easing class and moving tween/ease to another file
100149

101150
#### v0.3.0
102-
* **Browserified**
103-
* Synthetic `Mouse` clicks instead of browser clicks
104-
* New `off` method to remove listeners
105-
* New `data` parameter for `visit` methods
106-
* `_listens` renamed to `_flag`
107-
* `_isFunc`, `_function`, `_options` and `_status` are removed
108-
* `_extend` signature changed
151+
152+
- **Browserified**
153+
- Synthetic `Mouse` clicks instead of browser clicks
154+
- New `off` method to remove listeners
155+
- New `data` parameter for `visit` methods
156+
- `_listens` renamed to `_flag`
157+
- `_isFunc`, `_function`, `_options` and `_status` are removed
158+
- `_extend` signature changed
109159

110160
#### v0.2.1
111-
* `setImage/Value/Frames/Font` deprecated and replaced by `image/value/frames`
161+
162+
- `setImage/Value/Frames/Font` deprecated and replaced by `image/value/frames`
112163

113164
#### v0.2.0
114-
* mouse event listener signature changed from `(rawEvent, {x, y})` to `({x, y, raw})`
115-
* `viewport` listener signature changed from `(width, height)` to `({width, height})`
116-
* `Cut.addTexture(...)` is replaced with `Cut(...)`
117-
* `spy(true)` is replaced with `attr('spy', true)`
118-
* tweening support for pinning XY-shorthands added
119-
* `drawing` signature changed from `([name], width, height, [ratio], callback, [def])` to `([name], width, height, [ratio], [callback])` and `(def, [callback])`
120-
* node.trigger() method added, calls .publish() and returns `this`
121-
* using deep listeners count instead of `spy` to optimized mouse event distribution
165+
166+
- mouse event listener signature changed from `(rawEvent, {x, y})` to `({x, y, raw})`
167+
- `viewport` listener signature changed from `(width, height)` to `({width, height})`
168+
- `Cut.addTexture(...)` is replaced with `Cut(...)`
169+
- `spy(true)` is replaced with `attr('spy', true)`
170+
- tweening support for pinning XY-shorthands added
171+
- `drawing` signature changed from `([name], width, height, [ratio], callback, [def])` to `([name], width, height, [ratio], [callback])` and `(def, [callback])`
172+
- node.trigger() method added, calls .publish() and returns `this`
173+
- using deep listeners count instead of `spy` to optimized mouse event distribution

LICENSE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
@copyright Copyright (c) 2020 Ali Shakiba http://shakiba.me/stage.js
2-
@license The MIT License (MIT)
1+
Stage.js <%= pkg.version %>
2+
3+
@copyright Copyright (c) Ali Shakiba
4+
@license The MIT License (MIT)
35

46
Permission is hereby granted, free of charge, to any person obtaining a copy
57
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)