@remotion/player 2.6.11 → 2.6.14
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 +81 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +14 -3
- package/dist/Loading.d.ts +0 -4
- package/dist/Loading.d.ts.map +0 -1
- package/dist/Loading.js +0 -23
- package/dist/Loading.js.map +0 -1
- package/dist/PredefinedAudioTags.d.ts +0 -11
- package/dist/PredefinedAudioTags.d.ts.map +0 -1
- package/dist/PredefinedAudioTags.js +0 -98
- package/dist/PredefinedAudioTags.js.map +0 -1
- package/dist/event-target-polyfill.d.ts +0 -3
- package/dist/event-target-polyfill.d.ts.map +0 -1
- package/dist/event-target-polyfill.js +0 -114
- package/dist/event-target-polyfill.js.map +0 -1
- package/dist/events.d.ts +0 -1
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js +0 -2
- package/dist/events.js.map +0 -1
- package/dist/utils/adjusted-bounding-rect.d.ts +0 -11
- package/dist/utils/adjusted-bounding-rect.d.ts.map +0 -1
- package/dist/utils/adjusted-bounding-rect.js +0 -49
- package/dist/utils/adjusted-bounding-rect.js.map +0 -1
- package/dist/utils/use-throttle.d.ts +0 -2
- package/dist/utils/use-throttle.d.ts.map +0 -1
- package/dist/utils/use-throttle.js +0 -24
- package/dist/utils/use-throttle.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,8 +1,86 @@
|
|
|
1
1
|
### Remotion Player
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.org/package/@remotion/player)
|
|
4
4
|
[](https://npmcharts.com/compare/@remotion/player?minimal=true)
|
|
5
5
|
[](https://packagephobia.now.sh/result?p=@remotion/player)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
The `@remotion/player` package allows you to embed a video powered by Remotion in a React application.
|
|
8
|
+
|
|
9
|
+
## Installation and prerequisites
|
|
10
|
+
|
|
11
|
+
The dependencies that Remotion requires you to have pre-installed on your machine are Node.js and FFMPEG. You can take a look at this [guide](https://github.com/adaptlearning/adapt_authoring/wiki/Installing-FFmpeg) on how to get FFMPEG on your machine.
|
|
12
|
+
|
|
13
|
+
Install this package and Remotion with the package manager that you use for project:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm i remotion @remotion/player
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
yarn add remotion @remotion/player
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm i remotion @remotion/player
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
> Make sure all Remotion packages you install (`remotion`, `@remotion/player`, `@remotion/gif`...) [have the same version](https://remotion.dev/docs/version-mismatch).
|
|
28
|
+
|
|
29
|
+
## Getting started
|
|
30
|
+
|
|
31
|
+
Now that you have this package as a dependency in your React project, it is time to see some of the basic examples that you can spin up with this package.
|
|
32
|
+
|
|
33
|
+
The `@remotion/player` package can be imported as a React component from the library, which you can make use of in your components, either by nesting it in a custom component of yours or simply making it a standalone component.
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
// components/MyVideo.js
|
|
37
|
+
import React from 'react';
|
|
38
|
+
import {useCurrentFrame} from 'remotion';
|
|
39
|
+
|
|
40
|
+
const MyVideo = () => {
|
|
41
|
+
const frame = useCurrentFrame();
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div
|
|
45
|
+
style={{
|
|
46
|
+
flex: 1,
|
|
47
|
+
textAlign: 'center',
|
|
48
|
+
fontSize: '7em',
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
The current frame is {frame}.
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
import {Player} from '@remotion/player';
|
|
59
|
+
import {MyVideo} from '../components/MyVideo';
|
|
60
|
+
|
|
61
|
+
export const App = () => {
|
|
62
|
+
return (
|
|
63
|
+
<Player
|
|
64
|
+
component={MyVideo}
|
|
65
|
+
durationInFrames={120}
|
|
66
|
+
compositionWidth={1920}
|
|
67
|
+
compositionHeight={1080}
|
|
68
|
+
fps={30}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## API
|
|
75
|
+
|
|
76
|
+
The most important props accepted:
|
|
77
|
+
|
|
78
|
+
| Props | Function |
|
|
79
|
+
| ----------------- | ---------------------------------------- |
|
|
80
|
+
| component | A React component that renders the video |
|
|
81
|
+
| durationInFrames | The duration of the video in frames |
|
|
82
|
+
| compositionHeight | The height of the composition in pixels |
|
|
83
|
+
| compositionWidth | The width of the composition in pixels |
|
|
84
|
+
| fps | The frame rate of the video |
|
|
85
|
+
|
|
86
|
+
For a complete reference of the available props, refer to [@remotion/player API](https://www.remotion.dev/docs/player/api).
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAM5E,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AAC/C,YAAY,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAE9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS3B,CAAC;AAEF,YAAY,EAAC,gBAAgB,EAAE,UAAU,EAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAM5E,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AAC/C,YAAY,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAE9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS3B,CAAC;AAEF,YAAY,EAAC,gBAAgB,EAAE,UAAU,EAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/player",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.14",
|
|
4
4
|
"description": "Remotion Player",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"repository": {
|
|
15
15
|
"url": "https://github.com/remotion-dev/remotion"
|
|
16
16
|
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
19
|
+
},
|
|
17
20
|
"files": [
|
|
18
21
|
"dist",
|
|
19
22
|
"README.md"
|
|
@@ -25,7 +28,7 @@
|
|
|
25
28
|
],
|
|
26
29
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
27
30
|
"dependencies": {
|
|
28
|
-
"remotion": "2.6.
|
|
31
|
+
"remotion": "2.6.14"
|
|
29
32
|
},
|
|
30
33
|
"peerDependencies": {
|
|
31
34
|
"react": ">=16.8.0",
|
|
@@ -49,8 +52,16 @@
|
|
|
49
52
|
"typescript": "^4.5.5",
|
|
50
53
|
"webpack": "5.60.0"
|
|
51
54
|
},
|
|
55
|
+
"keywords": [
|
|
56
|
+
"remotion",
|
|
57
|
+
"ffmpeg",
|
|
58
|
+
"video",
|
|
59
|
+
"react",
|
|
60
|
+
"puppeteer",
|
|
61
|
+
"player"
|
|
62
|
+
],
|
|
52
63
|
"publishConfig": {
|
|
53
64
|
"access": "public"
|
|
54
65
|
},
|
|
55
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "32d6b9e13e0f7aa9a5b391b41ff82b90f97f378e"
|
|
56
67
|
}
|
package/dist/Loading.d.ts
DELETED
package/dist/Loading.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Loading.d.ts","sourceRoot":"","sources":["../src/Loading.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;CACb,CA+CA,CAAC"}
|
package/dist/Loading.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Loading = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const Loading = ({ size }) => {
|
|
6
|
-
const triangle = (opacity, triangleSize) => ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ xmlnsXlink: "http://www.w3.org/1999/xlink", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 400 400", style: {
|
|
7
|
-
opacity,
|
|
8
|
-
width: triangleSize,
|
|
9
|
-
height: triangleSize,
|
|
10
|
-
position: 'absolute',
|
|
11
|
-
transform: 'rotate(90deg)',
|
|
12
|
-
} }, { children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", Object.assign({ id: "gradient" }, { children: [(0, jsx_runtime_1.jsx)("stop", { stopColor: "#42e9f5", stopOpacity: "1", offset: "0" }, void 0), (0, jsx_runtime_1.jsx)("stop", { stopColor: "#4290f5", stopOpacity: "1", offset: "100%" }, void 0)] }), void 0) }, void 0), (0, jsx_runtime_1.jsx)("g", Object.assign({ stroke: 'url("#gradient")', strokeWidth: "100px", strokeLinejoin: "round" }, { children: (0, jsx_runtime_1.jsx)("path", { fill: 'url("#gradient")', d: "M 102 272 a 196 100 0 0 0 195 5 A 196 240 0 0 0 200 102.259 A 196 240 0 0 0 102 272 z", stroke: 'url("#gradient")', strokeWidth: "100px" }, void 0) }), void 0)] }), void 0));
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ style: {
|
|
14
|
-
display: 'flex',
|
|
15
|
-
justifyContent: 'center',
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
flex: 1,
|
|
18
|
-
height: '100%',
|
|
19
|
-
width: '100%',
|
|
20
|
-
} }, { children: [triangle(0.2, size), triangle(0.4, (size * 9) / 11), triangle(1, (size * 7) / 11)] }), void 0));
|
|
21
|
-
};
|
|
22
|
-
exports.Loading = Loading;
|
|
23
|
-
//# sourceMappingURL=Loading.js.map
|
package/dist/Loading.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Loading.js","sourceRoot":"","sources":["../src/Loading.tsx"],"names":[],"mappings":";;;;AAAO,MAAM,OAAO,GAEf,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE;IACf,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAE,YAAoB,EAAE,EAAE,CAAC,CAC3D,+CACC,UAAU,EAAC,8BAA8B,EACzC,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,aAAa,EACrB,KAAK,EAAE;YACN,OAAO;YACP,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,YAAY;YACpB,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,eAAe;SAC1B,iBAED,2CACC,0DAAgB,EAAE,EAAC,UAAU,iBAC5B,iCAAM,SAAS,EAAC,SAAS,EAAC,WAAW,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,WAAG,EACvD,iCAAM,SAAS,EAAC,SAAS,EAAC,WAAW,EAAC,GAAG,EAAC,MAAM,EAAC,MAAM,WAAG,aAC1C,WACX,EACP,4CAAG,MAAM,EAAC,kBAAkB,EAAC,WAAW,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,gBACtE,iCACC,IAAI,EAAC,kBAAkB,EACvB,CAAC,EAAC,uFAAuF,EACzF,MAAM,EAAC,kBAAkB,EACzB,WAAW,EAAC,OAAO,WAClB,YACC,aACC,CACN,CAAC;IAEF,OAAO,CACN,+CACC,KAAK,EAAE;YACN,OAAO,EAAE,MAAM;YACf,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,IAAI,EAAE,CAAC;YACP,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACb,iBAEA,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,EACnB,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAC9B,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,aACxB,CACN,CAAC;AACH,CAAC,CAAC;AAjDW,QAAA,OAAO,WAiDlB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RemotionAudioProps } from 'remotion';
|
|
3
|
-
declare type AudioElem = {
|
|
4
|
-
id: number;
|
|
5
|
-
props: RemotionAudioProps;
|
|
6
|
-
el: React.RefObject<HTMLAudioElement>;
|
|
7
|
-
};
|
|
8
|
-
export declare const SharedAudioContextProvider: React.FC;
|
|
9
|
-
export declare const useSharedAudio: (aud: RemotionAudioProps) => AudioElem;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=PredefinedAudioTags.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PredefinedAudioTags.d.ts","sourceRoot":"","sources":["../src/PredefinedAudioTags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE5C,aAAK,SAAS,GAAG;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,kBAAkB,CAAC;IAC1B,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;CACtC,CAAC;AAsBF,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,EA4F9C,CAAC;AAEF,eAAO,MAAM,cAAc,QAAS,kBAAkB,cAgBrD,CAAC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useSharedAudio = exports.SharedAudioContextProvider = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const SharedAudioContext = react_1.createContext({
|
|
7
|
-
registerAudio: () => {
|
|
8
|
-
throw new Error('sharedaudiocontext not mounted');
|
|
9
|
-
},
|
|
10
|
-
unregisterAudio: () => {
|
|
11
|
-
throw new Error('sharedaudiocontext not mounted');
|
|
12
|
-
},
|
|
13
|
-
updateAudio: () => {
|
|
14
|
-
throw new Error('sharedaudiocontext not mounted');
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
const numberOfAudios = 5;
|
|
18
|
-
const SharedAudioContextProvider = ({ children }) => {
|
|
19
|
-
const [, setAudios] = react_1.useState([]);
|
|
20
|
-
const refs = react_1.useMemo(() => {
|
|
21
|
-
return new Array(numberOfAudios).fill(true).map(() => {
|
|
22
|
-
return { id: Math.random(), ref: react_1.createRef() };
|
|
23
|
-
});
|
|
24
|
-
}, []);
|
|
25
|
-
const [takenAudios, setTakenAudios] = react_1.useState(() => new Array(numberOfAudios).fill(false));
|
|
26
|
-
const registerAudio = react_1.useCallback((aud) => {
|
|
27
|
-
const firstFreeAudio = takenAudios.findIndex((a) => a === false);
|
|
28
|
-
if (firstFreeAudio === -1) {
|
|
29
|
-
throw new Error('Trying to register more than XXX audio elements at the same time');
|
|
30
|
-
}
|
|
31
|
-
setTakenAudios((prevTaken) => {
|
|
32
|
-
const cloned = [...prevTaken];
|
|
33
|
-
cloned[firstFreeAudio] = true;
|
|
34
|
-
return cloned;
|
|
35
|
-
});
|
|
36
|
-
const { id, ref } = refs[firstFreeAudio];
|
|
37
|
-
const newElem = {
|
|
38
|
-
props: aud,
|
|
39
|
-
id,
|
|
40
|
-
el: ref,
|
|
41
|
-
};
|
|
42
|
-
setAudios((prevAudios) => [...prevAudios, newElem]);
|
|
43
|
-
return newElem;
|
|
44
|
-
}, [refs, takenAudios]);
|
|
45
|
-
const unregisterAudio = react_1.useCallback((id) => {
|
|
46
|
-
setTakenAudios((prevTaken) => {
|
|
47
|
-
const cloned = [...prevTaken];
|
|
48
|
-
const index = refs.findIndex((r) => r.id === id);
|
|
49
|
-
if (index === -1) {
|
|
50
|
-
throw new TypeError('unregister audio');
|
|
51
|
-
}
|
|
52
|
-
cloned[index] = false;
|
|
53
|
-
return cloned;
|
|
54
|
-
});
|
|
55
|
-
setAudios((prevAudios) => {
|
|
56
|
-
return prevAudios.filter((a) => a.id !== id);
|
|
57
|
-
});
|
|
58
|
-
}, [refs]);
|
|
59
|
-
const updateAudio = react_1.useCallback((id, aud) => {
|
|
60
|
-
setAudios((prevAudios) => {
|
|
61
|
-
return prevAudios.map((prevA) => {
|
|
62
|
-
if (prevA.id === id) {
|
|
63
|
-
return {
|
|
64
|
-
...prevA,
|
|
65
|
-
props: aud,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
return prevA;
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
}, []);
|
|
72
|
-
const value = react_1.useMemo(() => {
|
|
73
|
-
return {
|
|
74
|
-
registerAudio,
|
|
75
|
-
unregisterAudio,
|
|
76
|
-
updateAudio,
|
|
77
|
-
};
|
|
78
|
-
}, [registerAudio, unregisterAudio, updateAudio]);
|
|
79
|
-
return (jsx_runtime_1.jsxs(SharedAudioContext.Provider, Object.assign({ value: value }, { children: [refs.map(({ id, ref }) => {
|
|
80
|
-
return jsx_runtime_1.jsx("audio", { ref: ref }, id);
|
|
81
|
-
}), children] }), void 0));
|
|
82
|
-
};
|
|
83
|
-
exports.SharedAudioContextProvider = SharedAudioContextProvider;
|
|
84
|
-
const useSharedAudio = (aud) => {
|
|
85
|
-
const ctx = react_1.useContext(SharedAudioContext);
|
|
86
|
-
const [elem] = react_1.useState(() => ctx.registerAudio(aud));
|
|
87
|
-
react_1.useLayoutEffect(() => {
|
|
88
|
-
return () => {
|
|
89
|
-
ctx.unregisterAudio(elem.id);
|
|
90
|
-
};
|
|
91
|
-
}, [ctx, elem.id]);
|
|
92
|
-
react_1.useLayoutEffect(() => {
|
|
93
|
-
ctx.updateAudio(elem.id, aud);
|
|
94
|
-
}, [aud, ctx, elem.id]);
|
|
95
|
-
return elem;
|
|
96
|
-
};
|
|
97
|
-
exports.useSharedAudio = useSharedAudio;
|
|
98
|
-
//# sourceMappingURL=PredefinedAudioTags.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PredefinedAudioTags.js","sourceRoot":"","sources":["../src/PredefinedAudioTags.tsx"],"names":[],"mappings":";;;;AAAA,iCAQe;AAef,MAAM,kBAAkB,GAAG,qBAAa,CAAgB;IACvD,aAAa,EAAE,GAAG,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACnD,CAAC;IACD,eAAe,EAAE,GAAG,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACnD,CAAC;IACD,WAAW,EAAE,GAAG,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACnD,CAAC;CACD,C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,CAAC,CAAC;AAhBW,QAAA,cAAc,kBAgBzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-target-polyfill.d.ts","sourceRoot":"","sources":["../src/event-target-polyfill.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,IAAI,2BAGgC,CAAC;AAE3C,iBAAS,aAAa,CAAC,EAAE,KAAA,WASxB"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// https://raw.githubusercontent.com/benlesh/event-target-polyfill/master/index.js
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
const root = (typeof globalThis !== 'undefined' && globalThis) ||
|
|
5
|
-
(typeof self !== 'undefined' && self) ||
|
|
6
|
-
(typeof global !== 'undefined' && global);
|
|
7
|
-
function isConstructor(fn) {
|
|
8
|
-
try {
|
|
9
|
-
// eslint-disable-next-line
|
|
10
|
-
new fn();
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
if (typeof root.Event !== 'function' || !isConstructor(root.Event)) {
|
|
18
|
-
root.Event = (function () {
|
|
19
|
-
function Event(type, options) {
|
|
20
|
-
this.bubbles = Boolean(options) && Boolean(options.bubbles);
|
|
21
|
-
this.cancelable = Boolean(options) && Boolean(options.cancelable);
|
|
22
|
-
this.composed = Boolean(options) && Boolean(options.composed);
|
|
23
|
-
this.type = type;
|
|
24
|
-
}
|
|
25
|
-
return Event;
|
|
26
|
-
})();
|
|
27
|
-
}
|
|
28
|
-
if (typeof root.EventTarget === 'undefined' || !isConstructor(root.Event)) {
|
|
29
|
-
root.EventTarget = (function () {
|
|
30
|
-
function EventTarget() {
|
|
31
|
-
this.__listeners = new Map();
|
|
32
|
-
}
|
|
33
|
-
EventTarget.prototype = Object.create(Object.prototype);
|
|
34
|
-
EventTarget.prototype.addEventListener = function (type, listener, options) {
|
|
35
|
-
if (arguments.length < 2) {
|
|
36
|
-
throw new TypeError(`TypeError: Failed to execute 'addEventListener'
|
|
37
|
-
on 'EventTarget': 2 arguments required, but only $ {
|
|
38
|
-
arguments.length
|
|
39
|
-
}
|
|
40
|
-
present.`);
|
|
41
|
-
}
|
|
42
|
-
const { __listeners } = this;
|
|
43
|
-
const actualType = type.toString();
|
|
44
|
-
if (!__listeners.has(actualType)) {
|
|
45
|
-
__listeners.set(actualType, new Map());
|
|
46
|
-
}
|
|
47
|
-
const listenersForType = __listeners.get(actualType);
|
|
48
|
-
if (!listenersForType.has(listener)) {
|
|
49
|
-
// Any given listener is only registered once
|
|
50
|
-
listenersForType.set(listener, options);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
EventTarget.prototype.removeEventListener = function (type, listener) {
|
|
54
|
-
if (arguments.length < 2) {
|
|
55
|
-
throw new TypeError(`TypeError: Failed to execute 'addEventListener'
|
|
56
|
-
on 'EventTarget': 2 arguments required, but only $ {
|
|
57
|
-
arguments.length
|
|
58
|
-
}
|
|
59
|
-
present.`);
|
|
60
|
-
}
|
|
61
|
-
const { __listeners } = this;
|
|
62
|
-
const actualType = type.toString();
|
|
63
|
-
if (__listeners.has(actualType)) {
|
|
64
|
-
const listenersForType = __listeners.get(actualType);
|
|
65
|
-
if (listenersForType.has(listener)) {
|
|
66
|
-
listenersForType.delete(listener);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
EventTarget.prototype.dispatchEvent = function (event) {
|
|
71
|
-
if (!(event instanceof Event)) {
|
|
72
|
-
throw new TypeError(`Failed to execute 'dispatchEvent'
|
|
73
|
-
on 'EventTarget': parameter 1 is not of type 'Event'.`);
|
|
74
|
-
}
|
|
75
|
-
const { type } = event;
|
|
76
|
-
const { __listeners } = this;
|
|
77
|
-
const listenersForType = __listeners.get(type);
|
|
78
|
-
if (listenersForType) {
|
|
79
|
-
for (const [listener, options] of listenersForType.entries()) {
|
|
80
|
-
try {
|
|
81
|
-
if (typeof listener === 'function') {
|
|
82
|
-
// Listener functions must be executed with the EventTarget as the `this` context.
|
|
83
|
-
listener.call(this, event);
|
|
84
|
-
}
|
|
85
|
-
else if (listener && typeof listener.handleEvent === 'function') {
|
|
86
|
-
// Listener objects have their handleEvent method called, if they have one
|
|
87
|
-
listener.handleEvent(event);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
catch (err) {
|
|
91
|
-
// We need to report the error to the global error handling event,
|
|
92
|
-
// but we do not want to break the loop that is executing the events.
|
|
93
|
-
// Unfortunately, this is the best we can do, which isn't great, because the
|
|
94
|
-
// native EventTarget will actually do this synchronously before moving to the next
|
|
95
|
-
// event in the loop.
|
|
96
|
-
setTimeout(() => {
|
|
97
|
-
throw err;
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
if (options === null || options === void 0 ? void 0 : options.once) {
|
|
101
|
-
// If this was registered with { once: true }, we need
|
|
102
|
-
// to remove it now.
|
|
103
|
-
listenersForType.delete(listener);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
// Since there are no cancellable events on a base EventTarget,
|
|
108
|
-
// this should always return true.
|
|
109
|
-
return true;
|
|
110
|
-
};
|
|
111
|
-
return EventTarget;
|
|
112
|
-
})();
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=event-target-polyfill.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-target-polyfill.js","sourceRoot":"","sources":["../src/event-target-polyfill.ts"],"names":[],"mappings":";AAAA,kFAAkF;AAElF,cAAc;AACd,MAAM,IAAI,GACT,CAAC,OAAO,UAAU,KAAK,WAAW,IAAI,UAAU,CAAC;IACjD,CAAC,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC;IACrC,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,CAAC;AAE3C,SAAS,aAAa,CAAC,EAAE;IACxB,IAAI;QACH,2BAA2B;QAC3B,IAAI,EAAE,EAAE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GAAG,IAAI,CAAC;YAC3B,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC/C,IAAI,gBAAgB,EAAE;gBACrB,KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,gBAAgB,CAAC,OAAO,EAAE,EAAE;oBAC7D,IAAI;wBACH,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;4BACnC,kFAAkF;4BAClF,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;yBAC3B;6BAAM,IAAI,QAAQ,IAAI,OAAO,QAAQ,CAAC,WAAW,KAAK,UAAU,EAAE;4BAClE,0EAA0E;4BAC1E,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;yBAC5B;qBACD;oBAAC,OAAO,GAAG,EAAE;wBACb,kEAAkE;wBAClE,qEAAqE;wBACrE,4EAA4E;wBAC5E,mFAAmF;wBACnF,qBAAqB;wBACrB,UAAU,CAAC,GAAG,EAAE;4BACf,MAAM,GAAG,CAAC;wBACX,CAAC,CAAC,CAAC;qBACH;oBAED,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;wBAClB,sDAAsD;wBACtD,oBAAoB;wBACpB,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;qBAClC;iBACD;aACD;YAED,+DAA+D;YAC/D,kCAAkC;YAClC,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,WAAW,CAAC;IACpB,CAAC,CAAC,EAAE,CAAC;CACL"}
|
package/dist/events.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=events.d.ts.map
|
package/dist/events.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":""}
|
package/dist/events.js
DELETED
package/dist/events.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare function adjustedBoundingRect(el: HTMLElement): DOMRect | {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
top: number;
|
|
7
|
-
right: number;
|
|
8
|
-
bottom: number;
|
|
9
|
-
left: number;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=adjusted-bounding-rect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adjusted-bounding-rect.d.ts","sourceRoot":"","sources":["../../src/utils/adjusted-bounding-rect.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,WAAW;;;;;;;;;EA6CnD"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.adjustedBoundingRect = void 0;
|
|
4
|
-
function adjustedBoundingRect(el) {
|
|
5
|
-
const rect = el.getBoundingClientRect();
|
|
6
|
-
const style = getComputedStyle(el);
|
|
7
|
-
const tx = style.transform;
|
|
8
|
-
if (tx) {
|
|
9
|
-
let sx;
|
|
10
|
-
let sy;
|
|
11
|
-
let dx;
|
|
12
|
-
let dy;
|
|
13
|
-
if (tx.startsWith('matrix3d(')) {
|
|
14
|
-
var ta = tx.slice(9, -1).split(/, /);
|
|
15
|
-
sx = Number(ta[0]);
|
|
16
|
-
sy = Number(ta[5]);
|
|
17
|
-
dx = Number(ta[12]);
|
|
18
|
-
dy = Number(ta[13]);
|
|
19
|
-
}
|
|
20
|
-
else if (tx.startsWith('matrix(')) {
|
|
21
|
-
var ta = tx.slice(7, -1).split(/, /);
|
|
22
|
-
sx = Number(ta[0]);
|
|
23
|
-
sy = Number(ta[3]);
|
|
24
|
-
dx = Number(ta[4]);
|
|
25
|
-
dy = Number(ta[5]);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
return rect;
|
|
29
|
-
}
|
|
30
|
-
const to = style.transformOrigin;
|
|
31
|
-
const x = rect.x - dx - (1 - sx) * parseFloat(to);
|
|
32
|
-
const y = rect.y - dy - (1 - sy) * parseFloat(to.slice(to.indexOf(' ') + 1));
|
|
33
|
-
const w = sx ? rect.width / sx : el.offsetWidth;
|
|
34
|
-
const h = sy ? rect.height / sy : el.offsetHeight;
|
|
35
|
-
return {
|
|
36
|
-
x,
|
|
37
|
-
y,
|
|
38
|
-
width: w,
|
|
39
|
-
height: h,
|
|
40
|
-
top: y,
|
|
41
|
-
right: x + w,
|
|
42
|
-
bottom: y + h,
|
|
43
|
-
left: x,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
return rect;
|
|
47
|
-
}
|
|
48
|
-
exports.adjustedBoundingRect = adjustedBoundingRect;
|
|
49
|
-
//# sourceMappingURL=adjusted-bounding-rect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adjusted-bounding-rect.js","sourceRoot":"","sources":["../../src/utils/adjusted-bounding-rect.ts"],"names":[],"mappings":";;;AAAA,SAAgB,oBAAoB,CAAC,EAAe;IACnD,MAAM,IAAI,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC;IACxC,MAAM,KAAK,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACnC,MAAM,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC;IAE3B,IAAI,EAAE,EAAE;QACP,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;YAC/B,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,I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E,CAAC,WAAW,CAAC;QAChD,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC;QAClD,OAAO;YACN,CAAC;YACD,CAAC;YACD,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,CAAC,GAAG,CAAC;YACZ,MAAM,EAAE,CAAC,GAAG,CAAC;YACb,IAAI,EAAE,CAAC;SACP,CAAC;KACF;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AA7CD,oDA6CC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-throttle.d.ts","sourceRoot":"","sources":["../../src/utils/use-throttle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,uCAmBvB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useThrottle = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useThrottle = (value, interval = 250) => {
|
|
6
|
-
const [throttledValue, setThrottledValue] = react_1.useState(value);
|
|
7
|
-
const lastExecuted = react_1.useRef(Date.now());
|
|
8
|
-
react_1.useEffect(() => {
|
|
9
|
-
if (Date.now() >= lastExecuted.current + interval) {
|
|
10
|
-
lastExecuted.current = Date.now();
|
|
11
|
-
setThrottledValue(value);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
const timerId = setTimeout(() => {
|
|
15
|
-
lastExecuted.current = Date.now();
|
|
16
|
-
setThrottledValue(value);
|
|
17
|
-
}, interval);
|
|
18
|
-
return () => clearTimeout(timerId);
|
|
19
|
-
}
|
|
20
|
-
}, [value, interval]);
|
|
21
|
-
return throttledValue;
|
|
22
|
-
};
|
|
23
|
-
exports.useThrottle = useThrottle;
|
|
24
|
-
//# sourceMappingURL=use-throttle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-throttle.js","sourceRoot":"","sources":["../../src/utils/use-throttle.ts"],"names":[],"mappings":";;;AAAA,iCAAkD;AAE3C,MAAM,WAAW,GAAG,CAAI,KAAQ,EAAE,QAAQ,GAAG,GAAG,EAAK,EAAE;IAC7D,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,gBAAQ,CAAI,KAAK,CAAC,CAAC;IAC/D,MAAM,YAAY,GAAG,cAAM,CAAS,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAEhD,iBAAS,CAAC,GAAG,EAAE;QACd,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,YAAY,CAAC,OAAO,GAAG,QAAQ,EAAE;YAClD,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAClC,iBAAiB,CAAC,KAAK,CAAC,CAAC;SACzB;aAAM;YACN,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC/B,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBAClC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC1B,CAAC,EAAE,QAAQ,CAAC,CAAC;YAEb,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SACnC;IACF,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEtB,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AAnBW,QAAA,WAAW,eAmBtB"}
|