@gjsify/dom-elements 0.3.13 → 0.3.15
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/lib/esm/_virtual/_rolldown/runtime.js +18 -0
- package/lib/esm/attr.js +37 -30
- package/lib/esm/character-data.js +61 -54
- package/lib/esm/comment.js +26 -19
- package/lib/esm/document-fragment.js +116 -109
- package/lib/esm/document.js +75 -81
- package/lib/esm/dom-matrix.js +158 -123
- package/lib/esm/dom-token-list.js +114 -108
- package/lib/esm/element.js +244 -246
- package/lib/esm/font-face.js +94 -89
- package/lib/esm/gst-time.js +17 -6
- package/lib/esm/html-canvas-element.js +82 -75
- package/lib/esm/html-element.js +424 -424
- package/lib/esm/html-image-element.js +226 -225
- package/lib/esm/html-media-element.js +117 -114
- package/lib/esm/html-video-element.js +110 -108
- package/lib/esm/image.js +27 -21
- package/lib/esm/index.js +13 -45
- package/lib/esm/intersection-observer.js +22 -18
- package/lib/esm/location-stub.js +25 -23
- package/lib/esm/match-media.js +18 -19
- package/lib/esm/mutation-observer.js +18 -13
- package/lib/esm/named-node-map.js +121 -121
- package/lib/esm/namespace-uri.js +9 -8
- package/lib/esm/node-list.js +39 -33
- package/lib/esm/node-type.js +13 -12
- package/lib/esm/node.js +241 -246
- package/lib/esm/property-symbol.js +36 -30
- package/lib/esm/register/canvas.js +11 -7
- package/lib/esm/register/document.js +19 -18
- package/lib/esm/register/font-face.js +10 -6
- package/lib/esm/register/helpers.js +14 -12
- package/lib/esm/register/image.js +4 -0
- package/lib/esm/register/location.js +4 -0
- package/lib/esm/register/match-media.js +4 -0
- package/lib/esm/register/navigator.js +4 -1
- package/lib/esm/register/observers.js +5 -1
- package/lib/esm/resize-observer.js +15 -12
- package/lib/esm/text.js +56 -49
- package/lib/esm/types/index.js +3 -3
- package/package.json +11 -11
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { Event } from "@gjsify/dom-events";
|
|
2
1
|
import { HTMLElement } from "./html-element.js";
|
|
2
|
+
import { Event } from "@gjsify/dom-events";
|
|
3
|
+
|
|
4
|
+
//#region src/html-media-element.ts
|
|
3
5
|
const HAVE_NOTHING = 0;
|
|
4
6
|
const HAVE_METADATA = 1;
|
|
5
7
|
const HAVE_CURRENT_DATA = 2;
|
|
@@ -9,117 +11,118 @@ const NETWORK_EMPTY = 0;
|
|
|
9
11
|
const NETWORK_IDLE = 1;
|
|
10
12
|
const NETWORK_LOADING = 2;
|
|
11
13
|
const NETWORK_NO_SOURCE = 3;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
NETWORK_LOADING,
|
|
124
|
-
NETWORK_NO_SOURCE
|
|
14
|
+
/**
|
|
15
|
+
* Base class for media elements (video, audio).
|
|
16
|
+
*
|
|
17
|
+
* Stores media state and dispatches DOM events. Pipeline construction is
|
|
18
|
+
* delegated to the bridge container via internal events.
|
|
19
|
+
*/
|
|
20
|
+
var HTMLMediaElement = class extends HTMLElement {
|
|
21
|
+
constructor(..._args) {
|
|
22
|
+
super(..._args);
|
|
23
|
+
this._src = "";
|
|
24
|
+
this._srcObject = null;
|
|
25
|
+
this.currentTime = 0;
|
|
26
|
+
this.duration = NaN;
|
|
27
|
+
this.paused = true;
|
|
28
|
+
this.ended = false;
|
|
29
|
+
this.volume = 1;
|
|
30
|
+
this.muted = false;
|
|
31
|
+
this.defaultMuted = false;
|
|
32
|
+
this.loop = false;
|
|
33
|
+
this.autoplay = false;
|
|
34
|
+
this.preload = "";
|
|
35
|
+
this.playbackRate = 1;
|
|
36
|
+
this.defaultPlaybackRate = 1;
|
|
37
|
+
this.readyState = 0;
|
|
38
|
+
this.networkState = 0;
|
|
39
|
+
}
|
|
40
|
+
get buffered() {
|
|
41
|
+
return {
|
|
42
|
+
length: 0,
|
|
43
|
+
start: () => 0,
|
|
44
|
+
end: () => 0
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
get seekable() {
|
|
48
|
+
return {
|
|
49
|
+
length: 0,
|
|
50
|
+
start: () => 0,
|
|
51
|
+
end: () => 0
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
get played() {
|
|
55
|
+
return {
|
|
56
|
+
length: 0,
|
|
57
|
+
start: () => 0,
|
|
58
|
+
end: () => 0
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
get src() {
|
|
62
|
+
return this._src;
|
|
63
|
+
}
|
|
64
|
+
set src(value) {
|
|
65
|
+
this._src = value;
|
|
66
|
+
this._srcObject = null;
|
|
67
|
+
this.dispatchEvent(new Event("srcchange"));
|
|
68
|
+
}
|
|
69
|
+
get srcObject() {
|
|
70
|
+
return this._srcObject;
|
|
71
|
+
}
|
|
72
|
+
set srcObject(stream) {
|
|
73
|
+
this._srcObject = stream;
|
|
74
|
+
this._src = "";
|
|
75
|
+
this.dispatchEvent(new Event("srcobjectchange"));
|
|
76
|
+
}
|
|
77
|
+
play() {
|
|
78
|
+
this.paused = false;
|
|
79
|
+
this.ended = false;
|
|
80
|
+
this.dispatchEvent(new Event("play"));
|
|
81
|
+
return Promise.resolve();
|
|
82
|
+
}
|
|
83
|
+
pause() {
|
|
84
|
+
this.paused = true;
|
|
85
|
+
this.dispatchEvent(new Event("pause"));
|
|
86
|
+
}
|
|
87
|
+
load() {
|
|
88
|
+
this.readyState = 0;
|
|
89
|
+
this.networkState = 2;
|
|
90
|
+
this.dispatchEvent(new Event("loadstart"));
|
|
91
|
+
}
|
|
92
|
+
canPlayType(_type) {
|
|
93
|
+
return "";
|
|
94
|
+
}
|
|
95
|
+
static {
|
|
96
|
+
this.HAVE_NOTHING = 0;
|
|
97
|
+
}
|
|
98
|
+
static {
|
|
99
|
+
this.HAVE_METADATA = 1;
|
|
100
|
+
}
|
|
101
|
+
static {
|
|
102
|
+
this.HAVE_CURRENT_DATA = 2;
|
|
103
|
+
}
|
|
104
|
+
static {
|
|
105
|
+
this.HAVE_FUTURE_DATA = 3;
|
|
106
|
+
}
|
|
107
|
+
static {
|
|
108
|
+
this.HAVE_ENOUGH_DATA = 4;
|
|
109
|
+
}
|
|
110
|
+
static {
|
|
111
|
+
this.NETWORK_EMPTY = 0;
|
|
112
|
+
}
|
|
113
|
+
static {
|
|
114
|
+
this.NETWORK_IDLE = 1;
|
|
115
|
+
}
|
|
116
|
+
static {
|
|
117
|
+
this.NETWORK_LOADING = 2;
|
|
118
|
+
}
|
|
119
|
+
static {
|
|
120
|
+
this.NETWORK_NO_SOURCE = 3;
|
|
121
|
+
}
|
|
122
|
+
get [Symbol.toStringTag]() {
|
|
123
|
+
return "HTMLMediaElement";
|
|
124
|
+
}
|
|
125
125
|
};
|
|
126
|
+
|
|
127
|
+
//#endregion
|
|
128
|
+
export { HAVE_CURRENT_DATA, HAVE_ENOUGH_DATA, HAVE_FUTURE_DATA, HAVE_METADATA, HAVE_NOTHING, HTMLMediaElement, NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO_SOURCE };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { localName, namespaceURI, tagName } from "./property-symbol.js";
|
|
2
|
+
import { NamespaceURI } from "./namespace-uri.js";
|
|
1
3
|
import { HTMLMediaElement } from "./html-media-element.js";
|
|
4
|
+
import { gstTimeToSeconds, secondsToGstTime } from "./gst-time.js";
|
|
2
5
|
import { Event } from "@gjsify/dom-events";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { secondsToGstTime, gstTimeToSeconds } from "./gst-time.js";
|
|
6
|
+
|
|
7
|
+
//#region src/html-video-element.ts
|
|
6
8
|
const GST_STATE_PLAYING = 4;
|
|
7
9
|
const GST_STATE_PAUSED = 3;
|
|
8
10
|
const GST_FORMAT_TIME = 3;
|
|
@@ -10,109 +12,109 @@ const GST_SEEK_FLAG_FLUSH = 1;
|
|
|
10
12
|
const GST_SEEK_FLAG_KEY_UNIT = 4;
|
|
11
13
|
const GST_SEEK_TYPE_SET = 1;
|
|
12
14
|
const GST_SEEK_TYPE_NONE = 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
export {
|
|
117
|
-
HTMLVideoElement
|
|
15
|
+
/**
|
|
16
|
+
* HTML Video Element.
|
|
17
|
+
*
|
|
18
|
+
* Dispatches 'srcobjectchange' when srcObject is set and 'srcchange' when src is set —
|
|
19
|
+
* bridge containers listen for these to wire up / tear down their pipelines.
|
|
20
|
+
*
|
|
21
|
+
* When a GStreamer pipeline is attached via `_pipeline`, play/pause/seek/volume
|
|
22
|
+
* delegate to it. Without a pipeline the element behaves as a pure DOM stub.
|
|
23
|
+
*/
|
|
24
|
+
var HTMLVideoElement = class extends HTMLMediaElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
this._pipeline = null;
|
|
28
|
+
this._videoWidth = 0;
|
|
29
|
+
this._videoHeight = 0;
|
|
30
|
+
this.poster = "";
|
|
31
|
+
this[tagName] = "VIDEO";
|
|
32
|
+
this[localName] = "video";
|
|
33
|
+
this[namespaceURI] = NamespaceURI.html;
|
|
34
|
+
const self = this;
|
|
35
|
+
Object.defineProperty(this, "paused", {
|
|
36
|
+
get() {
|
|
37
|
+
if (!self._pipeline) return true;
|
|
38
|
+
const [, state] = self._pipeline.get_state(0n);
|
|
39
|
+
return state !== GST_STATE_PLAYING;
|
|
40
|
+
},
|
|
41
|
+
configurable: true,
|
|
42
|
+
enumerable: true
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(this, "currentTime", {
|
|
45
|
+
get() {
|
|
46
|
+
if (!self._pipeline) return 0;
|
|
47
|
+
const [ok, pos] = self._pipeline.query_position(GST_FORMAT_TIME);
|
|
48
|
+
return ok ? gstTimeToSeconds(pos) : 0;
|
|
49
|
+
},
|
|
50
|
+
set(seconds) {
|
|
51
|
+
self._pipeline?.seek(1, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT, GST_SEEK_TYPE_SET, secondsToGstTime(seconds), GST_SEEK_TYPE_NONE, -1n);
|
|
52
|
+
},
|
|
53
|
+
configurable: true,
|
|
54
|
+
enumerable: true
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(this, "duration", {
|
|
57
|
+
get() {
|
|
58
|
+
if (!self._pipeline) return NaN;
|
|
59
|
+
const [ok, dur] = self._pipeline.query_duration(GST_FORMAT_TIME);
|
|
60
|
+
return ok && Number(dur) > 0 ? gstTimeToSeconds(dur) : NaN;
|
|
61
|
+
},
|
|
62
|
+
configurable: true,
|
|
63
|
+
enumerable: true
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(this, "volume", {
|
|
66
|
+
get() {
|
|
67
|
+
return self._playbin()?.volume ?? 1;
|
|
68
|
+
},
|
|
69
|
+
set(v) {
|
|
70
|
+
const pb = self._playbin();
|
|
71
|
+
if (pb) pb.volume = Math.max(0, Math.min(1, v));
|
|
72
|
+
},
|
|
73
|
+
configurable: true,
|
|
74
|
+
enumerable: true
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(this, "muted", {
|
|
77
|
+
get() {
|
|
78
|
+
return self._playbin()?.mute ?? false;
|
|
79
|
+
},
|
|
80
|
+
set(v) {
|
|
81
|
+
const pb = self._playbin();
|
|
82
|
+
if (pb) pb.mute = v;
|
|
83
|
+
},
|
|
84
|
+
configurable: true,
|
|
85
|
+
enumerable: true
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
async play() {
|
|
89
|
+
this._pipeline?.set_state(GST_STATE_PLAYING);
|
|
90
|
+
this.dispatchEvent(new Event("play"));
|
|
91
|
+
this.dispatchEvent(new Event("playing"));
|
|
92
|
+
}
|
|
93
|
+
pause() {
|
|
94
|
+
this._pipeline?.set_state(GST_STATE_PAUSED);
|
|
95
|
+
this.dispatchEvent(new Event("pause"));
|
|
96
|
+
}
|
|
97
|
+
/** Intrinsic width of the video (set by bridge when media metadata loads). */
|
|
98
|
+
get videoWidth() {
|
|
99
|
+
return this._videoWidth;
|
|
100
|
+
}
|
|
101
|
+
set videoWidth(value) {
|
|
102
|
+
this._videoWidth = value;
|
|
103
|
+
}
|
|
104
|
+
/** Intrinsic height of the video (set by bridge when media metadata loads). */
|
|
105
|
+
get videoHeight() {
|
|
106
|
+
return this._videoHeight;
|
|
107
|
+
}
|
|
108
|
+
set videoHeight(value) {
|
|
109
|
+
this._videoHeight = value;
|
|
110
|
+
}
|
|
111
|
+
get [Symbol.toStringTag]() {
|
|
112
|
+
return "HTMLVideoElement";
|
|
113
|
+
}
|
|
114
|
+
_playbin() {
|
|
115
|
+
return this._pipeline?.get_by_name("playbin") ?? null;
|
|
116
|
+
}
|
|
118
117
|
};
|
|
118
|
+
|
|
119
|
+
//#endregion
|
|
120
|
+
export { HTMLVideoElement };
|
package/lib/esm/image.js
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { HTMLImageElement } from "./html-image-element.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
|
|
3
|
+
//#region src/image.ts
|
|
4
|
+
/**
|
|
5
|
+
* Image as constructor.
|
|
6
|
+
*
|
|
7
|
+
* Reference:
|
|
8
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image.
|
|
9
|
+
*/
|
|
10
|
+
var Image = class extends HTMLImageElement {
|
|
11
|
+
/**
|
|
12
|
+
* Constructor.
|
|
13
|
+
*
|
|
14
|
+
* @param [width] Width.
|
|
15
|
+
* @param [height] Height.
|
|
16
|
+
*/
|
|
17
|
+
constructor(width = null, height = null) {
|
|
18
|
+
super();
|
|
19
|
+
if (width !== null) {
|
|
20
|
+
this.width = width;
|
|
21
|
+
}
|
|
22
|
+
if (height !== null) {
|
|
23
|
+
this.height = height;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
23
26
|
};
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { HTMLImageElement, Image, Image as default };
|
package/lib/esm/index.js
CHANGED
|
@@ -1,61 +1,29 @@
|
|
|
1
|
+
import { property_symbol_exports } from "./property-symbol.js";
|
|
1
2
|
import { Attr } from "./attr.js";
|
|
2
|
-
import {
|
|
3
|
+
import { NodeType } from "./node-type.js";
|
|
3
4
|
import { NodeList } from "./node-list.js";
|
|
4
5
|
import { Node } from "./node.js";
|
|
5
6
|
import { CharacterData } from "./character-data.js";
|
|
6
|
-
import { Text } from "./text.js";
|
|
7
7
|
import { Comment } from "./comment.js";
|
|
8
|
+
import { Text } from "./text.js";
|
|
8
9
|
import { DocumentFragment } from "./document-fragment.js";
|
|
9
|
-
import {
|
|
10
|
+
import { NamespaceURI } from "./namespace-uri.js";
|
|
11
|
+
import { NamedNodeMap } from "./named-node-map.js";
|
|
10
12
|
import { Element } from "./element.js";
|
|
11
|
-
import {
|
|
12
|
-
import { HTMLCanvasElement } from "./html-canvas-element.js";
|
|
13
|
+
import { CSSStyleDeclaration, HTMLElement } from "./html-element.js";
|
|
13
14
|
import { HTMLImageElement } from "./html-image-element.js";
|
|
14
15
|
import { HTMLMediaElement } from "./html-media-element.js";
|
|
15
16
|
import { HTMLVideoElement } from "./html-video-element.js";
|
|
16
|
-
import {
|
|
17
|
+
import { HTMLCanvasElement } from "./html-canvas-element.js";
|
|
17
18
|
import { Document, document } from "./document.js";
|
|
19
|
+
import { DOMMatrix, DOMMatrixReadOnly } from "./dom-matrix.js";
|
|
20
|
+
import { DOMTokenList } from "./dom-token-list.js";
|
|
21
|
+
import { FontFace, FontFaceSet } from "./font-face.js";
|
|
22
|
+
import { Image } from "./image.js";
|
|
18
23
|
import { MutationObserver } from "./mutation-observer.js";
|
|
19
24
|
import { ResizeObserver } from "./resize-observer.js";
|
|
20
25
|
import { IntersectionObserver } from "./intersection-observer.js";
|
|
21
|
-
import { NodeType } from "./node-type.js";
|
|
22
|
-
import { NamespaceURI } from "./namespace-uri.js";
|
|
23
|
-
import * as PropertySymbol from "./property-symbol.js";
|
|
24
|
-
import { FontFace, FontFaceSet } from "./font-face.js";
|
|
25
26
|
import { MediaQueryList, matchMedia } from "./match-media.js";
|
|
26
27
|
import { location } from "./location-stub.js";
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
Attr,
|
|
30
|
-
CSSStyleDeclaration,
|
|
31
|
-
CharacterData,
|
|
32
|
-
Comment,
|
|
33
|
-
DOMMatrix,
|
|
34
|
-
DOMMatrixReadOnly,
|
|
35
|
-
DOMTokenList,
|
|
36
|
-
Document,
|
|
37
|
-
DocumentFragment,
|
|
38
|
-
Element,
|
|
39
|
-
FontFace,
|
|
40
|
-
FontFaceSet,
|
|
41
|
-
HTMLCanvasElement,
|
|
42
|
-
HTMLElement,
|
|
43
|
-
HTMLImageElement,
|
|
44
|
-
HTMLMediaElement,
|
|
45
|
-
HTMLVideoElement,
|
|
46
|
-
Image,
|
|
47
|
-
IntersectionObserver,
|
|
48
|
-
MediaQueryList,
|
|
49
|
-
MutationObserver,
|
|
50
|
-
NamedNodeMap,
|
|
51
|
-
NamespaceURI,
|
|
52
|
-
Node,
|
|
53
|
-
NodeList,
|
|
54
|
-
NodeType,
|
|
55
|
-
PropertySymbol,
|
|
56
|
-
ResizeObserver,
|
|
57
|
-
Text,
|
|
58
|
-
document,
|
|
59
|
-
location,
|
|
60
|
-
matchMedia
|
|
61
|
-
};
|
|
28
|
+
|
|
29
|
+
export { Attr, CSSStyleDeclaration, CharacterData, Comment, DOMMatrix, DOMMatrixReadOnly, DOMTokenList, Document, DocumentFragment, Element, FontFace, FontFaceSet, HTMLCanvasElement, HTMLElement, HTMLImageElement, HTMLMediaElement, HTMLVideoElement, Image, IntersectionObserver, MediaQueryList, MutationObserver, NamedNodeMap, NamespaceURI, Node, NodeList, NodeType, property_symbol_exports as PropertySymbol, ResizeObserver, Text, document, location, matchMedia };
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
//#region src/intersection-observer.ts
|
|
2
|
+
/**
|
|
3
|
+
* IntersectionObserver stub.
|
|
4
|
+
* Many libraries check for IntersectionObserver existence; this prevents crashes.
|
|
5
|
+
*
|
|
6
|
+
* Reference: https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver
|
|
7
|
+
*/
|
|
8
|
+
var IntersectionObserver = class {
|
|
9
|
+
constructor(_callback, options) {
|
|
10
|
+
this.root = options?.root ?? null;
|
|
11
|
+
this.rootMargin = options?.rootMargin ?? "0px";
|
|
12
|
+
this.thresholds = Array.isArray(options?.threshold) ? options.threshold : [options?.threshold ?? 0];
|
|
13
|
+
}
|
|
14
|
+
observe(_target) {}
|
|
15
|
+
unobserve(_target) {}
|
|
16
|
+
disconnect() {}
|
|
17
|
+
takeRecords() {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
19
20
|
};
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { IntersectionObserver };
|