@opendaw/lib-dom 0.0.29 → 0.0.30
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/dist/frames.d.ts +1 -1
- package/dist/frames.d.ts.map +1 -1
- package/dist/frames.js +11 -4
- package/package.json +4 -4
package/dist/frames.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { Exec, Terminable } from "@opendaw/lib-std";
|
|
2
2
|
export declare namespace AnimationFrame {
|
3
3
|
const add: (exec: Exec) => Terminable;
|
4
4
|
const once: (exec: Exec) => void;
|
5
|
-
const start: () => void;
|
5
|
+
const start: (owner?: WindowProxy) => void;
|
6
6
|
const terminate: () => void;
|
7
7
|
}
|
8
8
|
export declare const deferNextFrame: (exec: Exec) => DeferExec;
|
package/dist/frames.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../src/frames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,
|
1
|
+
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../src/frames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAiB,UAAU,EAAC,MAAM,kBAAkB,CAAA;AAEhE,yBAAiB,cAAc,CAAC;IAQrB,MAAM,GAAG,GAAI,MAAM,IAAI,KAAG,UAGhC,CAAA;IAEM,MAAM,IAAI,GAAI,MAAM,IAAI,KAAG,IAAgC,CAAA;IAE3D,MAAM,KAAK,GAAI,QAAO,WAAoB,KAAG,IAmBnD,CAAA;IAEM,MAAM,SAAS,QAAO,IAM5B,CAAA;CACJ;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,IAAI,KAAG,SAAgC,CAAA;AAE5E,qBAAa,SAAU,YAAW,UAAU;;gBAM5B,IAAI,EAAE,IAAI;IAEtB,QAAQ,CAAC,OAAO,QAAO,IAAI,CAI1B;IAED,QAAQ,CAAC,SAAS,QAAO,IAAI,CAI5B;IAED,MAAM,IAAI,IAAI;IACd,SAAS,IAAI,IAAI;CAOpB"}
|
package/dist/frames.js
CHANGED
@@ -4,14 +4,19 @@ export var AnimationFrame;
|
|
4
4
|
const recurring = new Set();
|
5
5
|
const queue = new Array();
|
6
6
|
let id = -1;
|
7
|
+
let driver = null;
|
7
8
|
AnimationFrame.add = (exec) => {
|
8
9
|
recurring.add(exec);
|
9
10
|
return { terminate: () => recurring.delete(exec) };
|
10
11
|
};
|
11
12
|
AnimationFrame.once = (exec) => { nonrecurring.add(exec); };
|
12
|
-
AnimationFrame.start = () => {
|
13
|
-
console.debug("AnimationFrame start");
|
13
|
+
AnimationFrame.start = (owner = window) => {
|
14
|
+
console.debug("AnimationFrame start", owner.name);
|
14
15
|
const exe = () => {
|
16
|
+
if (driver !== owner) {
|
17
|
+
driver = null;
|
18
|
+
return;
|
19
|
+
}
|
15
20
|
if (recurring.size > 0 || nonrecurring.size > 0) {
|
16
21
|
recurring.forEach((exec) => queue.push(exec));
|
17
22
|
nonrecurring.forEach((exec) => queue.push(exec));
|
@@ -19,9 +24,11 @@ export var AnimationFrame;
|
|
19
24
|
queue.forEach((exec) => exec());
|
20
25
|
queue.length = 0;
|
21
26
|
}
|
22
|
-
id = requestAnimationFrame(exe);
|
27
|
+
id = owner.requestAnimationFrame(exe);
|
23
28
|
};
|
24
|
-
id = requestAnimationFrame(exe);
|
29
|
+
id = owner.requestAnimationFrame(exe);
|
30
|
+
driver = owner;
|
31
|
+
exe();
|
25
32
|
};
|
26
33
|
AnimationFrame.terminate = () => {
|
27
34
|
console.debug("AnimationFrame terminate");
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@opendaw/lib-dom",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.30",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"types": "./dist/index.d.ts",
|
6
6
|
"license": "LGPL-3.0-or-later",
|
@@ -22,13 +22,13 @@
|
|
22
22
|
"test": "vitest run"
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@opendaw/lib-runtime": "^0.0.
|
26
|
-
"@opendaw/lib-std": "^0.0.
|
25
|
+
"@opendaw/lib-runtime": "^0.0.30",
|
26
|
+
"@opendaw/lib-std": "^0.0.30",
|
27
27
|
"@types/wicg-file-system-access": "^2023.10.6"
|
28
28
|
},
|
29
29
|
"devDependencies": {
|
30
30
|
"@opendaw/eslint-config": "^0.0.19",
|
31
31
|
"@opendaw/typescript-config": "^0.0.20"
|
32
32
|
},
|
33
|
-
"gitHead": "
|
33
|
+
"gitHead": "2fff74bbce57bd2c3c634b1cb735cccdaff2ab15"
|
34
34
|
}
|