drab 6.5.0 → 7.0.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.
- package/dist/announcer/index.d.ts +2 -0
- package/dist/base/index.d.ts +101 -1536
- package/dist/base/index.js +87 -76
- package/dist/contextmenu/index.d.ts +1045 -3
- package/dist/contextmenu/index.js +15 -15
- package/dist/define.d.ts +11 -1
- package/dist/define.js +11 -5
- package/dist/dialog/index.d.ts +1047 -6
- package/dist/dialog/index.js +22 -22
- package/dist/editor/index.d.ts +1047 -12
- package/dist/editor/index.js +36 -36
- package/dist/fullscreen/index.d.ts +1045 -7
- package/dist/fullscreen/index.js +8 -8
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/intersect/index.d.ts +1059 -16
- package/dist/intersect/index.js +26 -33
- package/dist/prefetch/index.d.ts +706 -25
- package/dist/prefetch/index.js +25 -44
- package/dist/share/index.d.ts +1413 -11
- package/dist/share/index.js +50 -18
- package/dist/tablesort/index.d.ts +1390 -5
- package/dist/tablesort/index.js +5 -5
- package/dist/tabs/index.d.ts +702 -4
- package/dist/tabs/index.js +3 -3
- package/dist/types/index.d.ts +29 -0
- package/dist/wakelock/index.d.ts +1390 -6
- package/dist/wakelock/index.js +16 -16
- package/package.json +14 -24
- package/dist/base/define.js +0 -3
- package/dist/copy/define.d.ts +0 -1
- package/dist/copy/define.js +0 -3
- package/dist/copy/index.d.ts +0 -30
- package/dist/copy/index.js +0 -39
- package/dist/youtube/define.d.ts +0 -1
- package/dist/youtube/define.js +0 -3
- package/dist/youtube/index.d.ts +0 -31
- package/dist/youtube/index.js +0 -56
- /package/dist/{base/define.d.ts → types/index.js} +0 -0
package/dist/fullscreen/index.js
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
import {
|
1
|
+
import { Content, Lifecycle, Trigger, } from "../base/index.js";
|
2
2
|
/**
|
3
3
|
* Toggles the `documentElement` or `content` element to fullscreen mode.
|
4
4
|
*
|
5
5
|
* Disables the `trigger` if fullscreen is not supported.
|
6
6
|
*/
|
7
|
-
export class Fullscreen extends
|
7
|
+
export class Fullscreen extends Lifecycle(Trigger(Content())) {
|
8
8
|
constructor() {
|
9
9
|
super();
|
10
10
|
}
|
11
11
|
/**
|
12
12
|
* @returns `true` if fullscreen is currently enabled.
|
13
13
|
*/
|
14
|
-
isFullscreen() {
|
14
|
+
#isFullscreen() {
|
15
15
|
return document.fullscreenElement !== null;
|
16
16
|
}
|
17
17
|
/**
|
18
18
|
* @returns `true` if fullscreen is supported.
|
19
19
|
*/
|
20
20
|
#fullscreenSupported() {
|
21
|
-
return
|
21
|
+
return "requestFullscreen" in document.documentElement;
|
22
22
|
}
|
23
23
|
/** Enables or disables fullscreen mode based on the current state. */
|
24
24
|
toggle() {
|
25
|
-
if (this
|
25
|
+
if (this.#isFullscreen()) {
|
26
26
|
document.exitFullscreen();
|
27
27
|
}
|
28
28
|
else {
|
29
29
|
try {
|
30
|
-
this.
|
30
|
+
this.content(HTMLElement).requestFullscreen();
|
31
31
|
}
|
32
32
|
catch {
|
33
33
|
document.documentElement.requestFullscreen();
|
@@ -35,8 +35,8 @@ export class Fullscreen extends Base {
|
|
35
35
|
}
|
36
36
|
}
|
37
37
|
mount() {
|
38
|
-
this.
|
39
|
-
for (const trigger of this.
|
38
|
+
this.listener(() => this.toggle());
|
39
|
+
for (const trigger of this.triggers()) {
|
40
40
|
if (!this.#fullscreenSupported() && "disabled" in trigger) {
|
41
41
|
trigger.disabled = true;
|
42
42
|
}
|
package/dist/index.d.ts
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
export * from "./announcer/index.js";
|
2
|
-
export { Base, type BaseAttributes } from "./base/index.js";
|
3
2
|
export * from "./contextmenu/index.js";
|
4
|
-
export * from "./copy/index.js";
|
5
3
|
export * from "./dialog/index.js";
|
6
4
|
export * from "./editor/index.js";
|
7
5
|
export * from "./fullscreen/index.js";
|
@@ -11,4 +9,3 @@ export * from "./share/index.js";
|
|
11
9
|
export * from "./tablesort/index.js";
|
12
10
|
export * from "./tabs/index.js";
|
13
11
|
export * from "./wakelock/index.js";
|
14
|
-
export * from "./youtube/index.js";
|
package/dist/index.js
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
export * from "./announcer/index.js";
|
2
|
-
export { Base } from "./base/index.js";
|
3
2
|
export * from "./contextmenu/index.js";
|
4
|
-
export * from "./copy/index.js";
|
5
3
|
export * from "./dialog/index.js";
|
6
4
|
export * from "./editor/index.js";
|
7
5
|
export * from "./fullscreen/index.js";
|
@@ -11,4 +9,3 @@ export * from "./share/index.js";
|
|
11
9
|
export * from "./tablesort/index.js";
|
12
10
|
export * from "./tabs/index.js";
|
13
11
|
export * from "./wakelock/index.js";
|
14
|
-
export * from "./youtube/index.js";
|