etro 0.8.0 → 0.8.3
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/.github/workflows/nodejs.yml +3 -1
- package/.github/workflows/shipjs-trigger.yml +29 -0
- package/CHANGELOG.md +36 -13
- package/CODE_OF_CONDUCT.md +5 -5
- package/CONTRIBUTING.md +22 -72
- package/README.md +2 -2
- package/dist/effect/base.d.ts +14 -1
- package/dist/etro-cjs.js +189 -230
- package/dist/etro-iife.js +189 -230
- package/dist/layer/base.d.ts +13 -0
- package/eslint.conf.js +2 -1
- package/eslint.test-conf.js +1 -0
- package/examples/application/readme-screenshot.html +4 -8
- package/examples/application/video-player.html +3 -4
- package/examples/introduction/effects.html +23 -4
- package/karma.conf.js +4 -2
- package/package.json +8 -4
- package/scripts/gen-effect-samples.html +0 -3
- package/ship.config.js +80 -0
- package/src/effect/base.ts +29 -10
- package/src/effect/gaussian-blur.ts +10 -10
- package/src/effect/pixelate.ts +1 -2
- package/src/effect/shader.ts +18 -22
- package/src/effect/stack.ts +8 -4
- package/src/effect/transform.ts +13 -14
- package/src/event.ts +8 -14
- package/src/layer/audio-source.ts +16 -14
- package/src/layer/audio.ts +1 -2
- package/src/layer/base.ts +26 -7
- package/src/layer/visual.ts +11 -6
- package/src/movie.ts +70 -64
- package/src/util.ts +50 -57
- package/docs/effect.js.html +0 -1215
- package/docs/event.js.html +0 -145
- package/docs/index.html +0 -81
- package/docs/index.js.html +0 -92
- package/docs/layer.js.html +0 -888
- package/docs/module-effect-GaussianBlurComponent.html +0 -345
- package/docs/module-effect.Brightness.html +0 -339
- package/docs/module-effect.Channels.html +0 -319
- package/docs/module-effect.ChromaKey.html +0 -611
- package/docs/module-effect.Contrast.html +0 -339
- package/docs/module-effect.EllipticalMask.html +0 -200
- package/docs/module-effect.GaussianBlur.html +0 -202
- package/docs/module-effect.GaussianBlurHorizontal.html +0 -242
- package/docs/module-effect.GaussianBlurVertical.html +0 -242
- package/docs/module-effect.Pixelate.html +0 -330
- package/docs/module-effect.Shader.html +0 -1227
- package/docs/module-effect.Stack.html +0 -406
- package/docs/module-effect.Transform.Matrix.html +0 -193
- package/docs/module-effect.Transform.html +0 -1174
- package/docs/module-effect.html +0 -148
- package/docs/module-event.html +0 -473
- package/docs/module-index.html +0 -186
- package/docs/module-layer-Media.html +0 -1116
- package/docs/module-layer-MediaMixin.html +0 -164
- package/docs/module-layer.Audio.html +0 -1188
- package/docs/module-layer.Base.html +0 -629
- package/docs/module-layer.Image.html +0 -1421
- package/docs/module-layer.Text.html +0 -1731
- package/docs/module-layer.Video.html +0 -1938
- package/docs/module-layer.Visual.html +0 -1698
- package/docs/module-layer.html +0 -137
- package/docs/module-movie.html +0 -3118
- package/docs/module-util.Color.html +0 -702
- package/docs/module-util.Font.html +0 -395
- package/docs/module-util.html +0 -845
- package/docs/movie.js.html +0 -689
- package/docs/scripts/collapse.js +0 -20
- package/docs/scripts/linenumber.js +0 -25
- package/docs/scripts/nav.js +0 -12
- package/docs/scripts/polyfill.js +0 -4
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/docs/scripts/prettify/lang-css.js +0 -2
- package/docs/scripts/prettify/prettify.js +0 -28
- package/docs/scripts/search.js +0 -83
- package/docs/styles/jsdoc.css +0 -671
- package/docs/styles/prettify.css +0 -79
- package/docs/util.js.html +0 -503
- package/spec/assets/effect/gaussian-blur-horizontal.png +0 -0
- package/spec/assets/effect/gaussian-blur-vertical.png +0 -0
- package/spec/assets/effect/grayscale.png +0 -0
- package/spec/assets/effect/original.png +0 -0
- package/spec/assets/effect/pixelate.png +0 -0
- package/spec/assets/effect/transform/multiply.png +0 -0
- package/spec/assets/effect/transform/rotate.png +0 -0
- package/spec/assets/effect/transform/scale-fraction.png +0 -0
- package/spec/assets/effect/transform/scale.png +0 -0
- package/spec/assets/effect/transform/translate-fraction.png +0 -0
- package/spec/assets/effect/transform/translate.png +0 -0
- package/spec/assets/layer/audio.wav +0 -0
- package/spec/assets/layer/image.jpg +0 -0
- package/spec/effect.spec.js +0 -421
- package/spec/event.spec.js +0 -39
- package/spec/layer.spec.js +0 -307
- package/spec/movie.spec.js +0 -346
- package/spec/util.spec.js +0 -294
|
@@ -4,7 +4,6 @@ on: [push]
|
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
6
|
build:
|
|
7
|
-
|
|
8
7
|
runs-on: ubuntu-latest
|
|
9
8
|
|
|
10
9
|
strategy:
|
|
@@ -17,6 +16,9 @@ jobs:
|
|
|
17
16
|
uses: actions/setup-node@v1
|
|
18
17
|
with:
|
|
19
18
|
node-version: ${{ matrix.node-version }}
|
|
19
|
+
- name: Update npm
|
|
20
|
+
run: |
|
|
21
|
+
npm i -g npm@^7.x
|
|
20
22
|
- name: npm install, lint, build, and test
|
|
21
23
|
run: |
|
|
22
24
|
npm ci
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Ship js trigger
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
types:
|
|
5
|
+
- closed
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
name: Release
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v2
|
|
13
|
+
with:
|
|
14
|
+
fetch-depth: 0
|
|
15
|
+
ref: master
|
|
16
|
+
- uses: actions/setup-node@v1
|
|
17
|
+
with:
|
|
18
|
+
registry-url: "https://registry.npmjs.org"
|
|
19
|
+
- run: |
|
|
20
|
+
if [ -f "yarn.lock" ]; then
|
|
21
|
+
yarn install
|
|
22
|
+
else
|
|
23
|
+
npm install
|
|
24
|
+
fi
|
|
25
|
+
- run: npx shipjs trigger
|
|
26
|
+
env:
|
|
27
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
28
|
+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
29
|
+
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
6
|
+
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [0.8.3] - 2022-01-18
|
|
9
|
+
### Fixed
|
|
10
|
+
- Recording not respecting the `type` option.
|
|
11
|
+
- Effects throwing 'empty canvas' errors when the target's width or height is 0.
|
|
12
|
+
|
|
13
|
+
## [0.8.2] - 2021-07-08
|
|
14
|
+
### Fixed
|
|
15
|
+
- `GaussianBlur` effect throwing a `TypeError` when applied to a movie or layer (the problem persisted).
|
|
16
|
+
- Ignore layers and effects removed with `delete`.
|
|
17
|
+
|
|
18
|
+
## [0.8.1] - 2021-04-20
|
|
19
|
+
### Fixed
|
|
20
|
+
- `sourceStartTime` getting ignored on `'movie.seek'`.
|
|
21
|
+
- Calling methods like `unshift` on `Movie#layers` and `Movie#effects`.
|
|
22
|
+
- `GaussianBlur` effect throwing a `TypeError` when applied to a movie or layer.
|
|
23
|
+
- Issues with audio and video layers re-attaching to a movie.
|
|
24
|
+
|
|
3
25
|
## [0.8.0] - 2021-04-11
|
|
4
26
|
### Added
|
|
5
27
|
- Type declarations.
|
|
@@ -136,12 +158,12 @@
|
|
|
136
158
|
- Null or undefined layer dimensions default to the width or height of the movie.
|
|
137
159
|
- Movie "end" event is now called "ended".
|
|
138
160
|
|
|
139
|
-
### Fixed
|
|
140
|
-
- Bug with layer options
|
|
141
|
-
|
|
142
161
|
### Removed
|
|
143
162
|
- Volume, speed and muted properties. These will most likely be added as separate audio effects in the future.
|
|
144
163
|
|
|
164
|
+
### Fixed
|
|
165
|
+
- Bug with layer options
|
|
166
|
+
|
|
145
167
|
## [0.2.0] - 2018-10-14
|
|
146
168
|
### Added
|
|
147
169
|
- Keyframes
|
|
@@ -151,7 +173,7 @@
|
|
|
151
173
|
- Elliptical mask effect.
|
|
152
174
|
- Many small improvements.
|
|
153
175
|
|
|
154
|
-
##
|
|
176
|
+
## 0.1.0 - 2018-10-06
|
|
155
177
|
### Added
|
|
156
178
|
- Movies
|
|
157
179
|
- Timeline
|
|
@@ -171,12 +193,13 @@
|
|
|
171
193
|
- Gaussian blur
|
|
172
194
|
- Transform
|
|
173
195
|
|
|
174
|
-
[
|
|
175
|
-
[0.8.
|
|
176
|
-
[0.
|
|
177
|
-
[0.
|
|
178
|
-
[0.
|
|
179
|
-
[0.
|
|
180
|
-
[0.
|
|
181
|
-
[0.
|
|
182
|
-
[0.
|
|
196
|
+
[0.8.3]: https://github.com/etro-js/etro/compare/v0.8.2...v0.8.3
|
|
197
|
+
[0.8.2]: https://github.com/etro-js/etro/compare/v0.8.1...v0.8.2
|
|
198
|
+
[0.8.1]: https://github.com/etro-js/etro/compare/v0.8.0...v0.8.1
|
|
199
|
+
[0.8.0]: https://github.com/etro-js/etro/compare/v0.7.0...v0.8.0
|
|
200
|
+
[0.7.0]: https://github.com/etro-js/etro/compare/v0.6.0...v0.7.0
|
|
201
|
+
[0.6.0]: https://github.com/etro-js/etro/compare/v0.5.0...v0.6.0
|
|
202
|
+
[0.5.0]: https://github.com/etro-js/etro/compare/v0.4.0...v0.5.0
|
|
203
|
+
[0.4.0]: https://github.com/etro-js/etro/compare/v0.3.0...v0.4.0
|
|
204
|
+
[0.3.0]: https://github.com/etro-js/etro/compare/v0.2.0...v0.3.0
|
|
205
|
+
[0.2.0]: https://github.com/etro-js/etro/compare/v0.1.0...v0.2.0
|
package/CODE_OF_CONDUCT.md
CHANGED
|
@@ -55,11 +55,11 @@ further defined and clarified by project maintainers.
|
|
|
55
55
|
## Enforcement
|
|
56
56
|
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
-
reported by contacting me at **\@etro-js**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
reported by contacting me at **\@etro-js** on Twitter. All complaints will be
|
|
59
|
+
reviewed and investigated and will result in a response that is deemed necessary
|
|
60
|
+
and appropriate to the circumstances. The project team is obligated to maintain
|
|
61
|
+
confidentiality with regard to the reporter of an incident. Further details of
|
|
62
|
+
specific enforcement policies may be posted separately.
|
|
63
63
|
|
|
64
64
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
65
|
faith may face temporary or permanent repercussions as determined by other
|
package/CONTRIBUTING.md
CHANGED
|
@@ -10,7 +10,7 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
10
10
|
|
|
11
11
|
#### Step 0: Dependencies
|
|
12
12
|
|
|
13
|
-
- You will need Git, Node, NPM and Chrome (for headless unit testing) installed
|
|
13
|
+
- You will need Git, Node, NPM (at least 7.x) and Chrome (for headless unit testing) installed
|
|
14
14
|
|
|
15
15
|
#### Step 1: Fork
|
|
16
16
|
|
|
@@ -22,35 +22,13 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
22
22
|
npm install
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
#### Step 2: Branch
|
|
26
|
-
|
|
27
|
-
- To help organize your work, create a branch for your topic. Avoid working directly off the `master` branch
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
git checkout -b topic-branch
|
|
31
|
-
```
|
|
32
|
-
|
|
33
25
|
## Making your changes
|
|
34
26
|
|
|
35
|
-
#### Step
|
|
36
|
-
|
|
37
|
-
- If you are writing code, please follow the style guide [StandardJS](https://standardjs.com/rules.html)
|
|
38
|
-
|
|
39
|
-
- To download the example assets run
|
|
27
|
+
#### Step 2: Code
|
|
40
28
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- Then, start the development server with
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
npm start
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Now you can see your changes by running some [examples](examples).
|
|
52
|
-
|
|
53
|
-
- When you're ready to submit a piece of work, first run
|
|
29
|
+
- Make some changes.
|
|
30
|
+
- If you are writing code, the linter uses [StandardJS](https://standardjs.com/rules.html) for style conventions.
|
|
31
|
+
- When you're ready to submit a piece of code, first run
|
|
54
32
|
|
|
55
33
|
```
|
|
56
34
|
npm run lint
|
|
@@ -61,13 +39,12 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
61
39
|
to lint the code, generate the [dist](dist) files and run unit tests on them. It may be helpful to put these commands in a pre-commit hook.
|
|
62
40
|
|
|
63
41
|
- Commit your changes
|
|
64
|
-
- Please avoid squashing all your commits into one; we try to keep
|
|
42
|
+
- Please avoid squashing all your commits into one; we try to keep atomic commits.
|
|
65
43
|
- Please follow these commit message guidelines:
|
|
66
|
-
- Optionally,
|
|
67
|
-
- Then, write a concise summary of your changes. If you feel you need to, bullet the main idea of your changes in the description and/or explain why you made the changes.
|
|
44
|
+
- Optionally, prefix each commit message with [an appropriate emoji](https://gitmoji.dev)
|
|
68
45
|
- Write in the imperative tense
|
|
69
|
-
-
|
|
70
|
-
-
|
|
46
|
+
- Wrap lines after 72 characters (for Vim add `filetype indent plugin on` to ~/.vimrc, it's enabled by default in Atom).
|
|
47
|
+
- Example:
|
|
71
48
|
|
|
72
49
|
```
|
|
73
50
|
:emoji: One-liner
|
|
@@ -86,55 +63,32 @@ Thank you for considering contributing to Etro! There are many ways you can cont
|
|
|
86
63
|
git rebase upstream/master
|
|
87
64
|
```
|
|
88
65
|
|
|
89
|
-
- Push
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
git push origin topic-branch
|
|
93
|
-
```
|
|
66
|
+
- Push to your fork
|
|
94
67
|
|
|
95
68
|
#### Step 4: Pull request
|
|
96
69
|
|
|
97
|
-
- Open a pull request from your
|
|
70
|
+
- Open a pull request from your the branch in your fork to the main repository
|
|
98
71
|
- In the PR title, include **fixes ###** for bugs and **resolves ###** for feature requests
|
|
99
72
|
- If you changed any core functionality, make sure you explain your motives for those changes
|
|
100
73
|
|
|
101
74
|
#### Step 5: Feedback
|
|
102
75
|
|
|
103
|
-
- A large part of the submission process is receiving feedback on how you can improve you pull request. If you need change your pull request,
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
git add path/to/changes
|
|
107
|
-
git commit
|
|
108
|
-
git push origin topic-branch
|
|
109
|
-
```
|
|
76
|
+
- A large part of the submission process is receiving feedback on how you can improve you pull request. If you need to change your pull request, feel free to push more commits.
|
|
110
77
|
|
|
111
78
|
## Code overview
|
|
112
79
|
|
|
113
|
-
|
|
80
|
+
### Etro Overview
|
|
114
81
|
|
|
115
|
-
|
|
82
|
+
If you are new to the core elements of etro, you should probably read [the overview guide](https://etrojs.dev/docs/overview).
|
|
116
83
|
|
|
117
|
-
|
|
84
|
+
### API Structure
|
|
118
85
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
| [**index.js**](src/index.js) | the entry module |
|
|
126
|
-
| [**layer.js**](src/layer.js) | all layer classes |
|
|
127
|
-
| [**movie.js**](src/movie.js) | the `Movie` class |
|
|
128
|
-
| [**util.js**](src/util.js) | general utility |
|
|
129
|
-
|
|
130
|
-
Note that most of the above files will (hopefully soon) be broken down into multiple files each.
|
|
131
|
-
|
|
132
|
-
### Etro Objects
|
|
133
|
-
|
|
134
|
-
The base etro objects are the following:
|
|
135
|
-
* `Movie` - the movie (or entire user project)
|
|
136
|
-
* `layer.Base` - the root type of layer
|
|
137
|
-
* `effect.Base` - the root type of visual effect
|
|
86
|
+
* `etro.Movie` - the movie
|
|
87
|
+
* `etro.layer.*` - all layers
|
|
88
|
+
* `etro.effect.*` - all (visual) effects
|
|
89
|
+
- `etro.event.publish` - emit an event
|
|
90
|
+
- `etro.event.subscribe` - add an event listener
|
|
91
|
+
- `etro.*` - other utility classes and methods (see **src/util.ts**)
|
|
138
92
|
|
|
139
93
|
### Etro concepts
|
|
140
94
|
|
|
@@ -151,9 +105,5 @@ That will notify all listeners of `movie` for event types `'movie'`, `'movie.typ
|
|
|
151
105
|
```js
|
|
152
106
|
event.subscribe(movie, 'movie.type', event => {
|
|
153
107
|
console.log(event.target, event.type, event.additionalData) // should print the movie, 'movie.type.of.event', 'foo'
|
|
154
|
-
}
|
|
108
|
+
})
|
|
155
109
|
```
|
|
156
|
-
|
|
157
|
-
#### Values vs. Properties
|
|
158
|
-
|
|
159
|
-
In Etro objects, almost any property can be a [keyframe](https://github.com/etro-js/etro/wiki/Keyframes), [function](https://github.com/etro-js/etro/wiki/Functions), or just a constant value. To access the current value of the property at a given time, use `util.val(property, element, time)`; where `property` is the keyframe set, function or constant value, `element` is the object to which `property` belongs, and `time` is the current time relative to the element.
|
package/README.md
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
> Check out [this guide](https://etrojs.dev/docs/migrating-v0-8-0)
|
|
8
8
|
> for migrating.
|
|
9
9
|
|
|
10
|
-
Etro is a
|
|
10
|
+
Etro is a typescript framework for programmatically editing videos. Similar
|
|
11
11
|
to GUI-based video-editing software, it lets you layer media and other
|
|
12
12
|
content on a timeline. Audio, image, video and other tracks are supported,
|
|
13
|
-
along with powerful video
|
|
13
|
+
along with powerful video effects for existing tracks. Being very flexible
|
|
14
14
|
and extendable, you can choose to only use the core components or define your
|
|
15
15
|
own.
|
|
16
16
|
|
package/dist/effect/base.d.ts
CHANGED
|
@@ -17,7 +17,20 @@ export declare class Base implements BaseObject {
|
|
|
17
17
|
*/
|
|
18
18
|
private _occurrenceCount;
|
|
19
19
|
constructor();
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Attaches this effect to `target` if not already attached.
|
|
22
|
+
* @ignore
|
|
23
|
+
*/
|
|
24
|
+
tryAttach(target: Movie | Visual): void;
|
|
25
|
+
attach(movie: Movie | Visual): void;
|
|
26
|
+
/**
|
|
27
|
+
* Dettaches this effect from its target if the number of times `tryDetach`
|
|
28
|
+
* has been called (including this call) equals the number of times
|
|
29
|
+
* `tryAttach` has been called.
|
|
30
|
+
*
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
tryDetach(): void;
|
|
21
34
|
detach(): void;
|
|
22
35
|
/**
|
|
23
36
|
* Apply this effect to a target at the given time
|