uikit 3.19.3-dev.a3bfd535a → 3.19.4-dev.1a3d20074
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/css/uikit-core-rtl.css +1 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +1 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +1 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1 -1
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1 -1
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1 -1
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +1 -1
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +1 -1
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +1 -1
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +1 -1
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +1 -1
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +1 -1
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +1 -1
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +40 -4
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +40 -4
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/core/icon.js +8 -7
- package/src/js/core/video.js +55 -3
- package/tests/video.html +10 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "uikit",
|
|
3
3
|
"title": "UIkit",
|
|
4
4
|
"description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
|
|
5
|
-
"version": "3.19.
|
|
5
|
+
"version": "3.19.4-dev.1a3d20074",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/core/icon.js
CHANGED
|
@@ -122,14 +122,15 @@ export const Search = {
|
|
|
122
122
|
i18n: { toggle: 'Open Search', submit: 'Submit Search' },
|
|
123
123
|
|
|
124
124
|
beforeConnect() {
|
|
125
|
-
const isToggle =
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
const isToggle =
|
|
126
|
+
hasClass(this.$el, 'uk-search-toggle') || hasClass(this.$el, 'uk-navbar-toggle');
|
|
127
|
+
this.icon = isToggle
|
|
128
|
+
? 'search-toggle-icon'
|
|
128
129
|
: hasClass(this.$el, 'uk-search-icon') && closest(this.$el, '.uk-search-large')
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
? 'search-large'
|
|
131
|
+
: closest(this.$el, '.uk-search-navbar')
|
|
132
|
+
? 'search-navbar'
|
|
133
|
+
: this.$props.icon;
|
|
133
134
|
|
|
134
135
|
if (hasAttr(this.$el, 'aria-label')) {
|
|
135
136
|
return;
|
package/src/js/core/video.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
hasAttr,
|
|
3
|
+
includes,
|
|
4
|
+
isTag,
|
|
5
|
+
isTouch,
|
|
6
|
+
isVideo,
|
|
7
|
+
mute,
|
|
8
|
+
parent,
|
|
9
|
+
pause,
|
|
10
|
+
play,
|
|
11
|
+
pointerEnter,
|
|
12
|
+
pointerLeave,
|
|
13
|
+
} from 'uikit-util';
|
|
2
14
|
import { intersection } from '../api/observables';
|
|
3
15
|
|
|
4
16
|
export default {
|
|
@@ -14,7 +26,7 @@ export default {
|
|
|
14
26
|
autoplay: true,
|
|
15
27
|
},
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
beforeConnect() {
|
|
18
30
|
if (this.autoplay === 'inview' && !hasAttr(this.$el, 'preload')) {
|
|
19
31
|
this.$el.preload = 'none';
|
|
20
32
|
}
|
|
@@ -23,14 +35,50 @@ export default {
|
|
|
23
35
|
this.$el.allow = 'autoplay';
|
|
24
36
|
}
|
|
25
37
|
|
|
38
|
+
if (this.autoplay === 'hover') {
|
|
39
|
+
if (isTag(this.$el, 'video')) {
|
|
40
|
+
this.$el.tabindex = 0;
|
|
41
|
+
} else {
|
|
42
|
+
this.autoplay = true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
26
46
|
if (this.automute) {
|
|
27
47
|
mute(this.$el);
|
|
28
48
|
}
|
|
29
49
|
},
|
|
30
50
|
|
|
51
|
+
events: [
|
|
52
|
+
{
|
|
53
|
+
name: `${pointerEnter} focusin`,
|
|
54
|
+
filter() {
|
|
55
|
+
return includes(this.autoplay, 'hover');
|
|
56
|
+
},
|
|
57
|
+
handler(e) {
|
|
58
|
+
if (!isTouch(e) || !isPlaying(this.$el)) {
|
|
59
|
+
play(this.$el);
|
|
60
|
+
} else {
|
|
61
|
+
pause(this.$el);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
{
|
|
67
|
+
name: `${pointerLeave} focusout`,
|
|
68
|
+
filter() {
|
|
69
|
+
return includes(this.autoplay, 'hover');
|
|
70
|
+
},
|
|
71
|
+
handler(e) {
|
|
72
|
+
if (!isTouch(e)) {
|
|
73
|
+
pause(this.$el);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
|
|
31
79
|
observe: [
|
|
32
80
|
intersection({
|
|
33
|
-
filter: ({ $el, autoplay }) => autoplay && isVideo($el),
|
|
81
|
+
filter: ({ $el, autoplay }) => autoplay && autoplay !== 'hover' && isVideo($el),
|
|
34
82
|
handler([{ isIntersecting }]) {
|
|
35
83
|
if (!document.fullscreenElement) {
|
|
36
84
|
if (isIntersecting) {
|
|
@@ -45,3 +93,7 @@ export default {
|
|
|
45
93
|
}),
|
|
46
94
|
],
|
|
47
95
|
};
|
|
96
|
+
|
|
97
|
+
function isPlaying(videoEl) {
|
|
98
|
+
return !videoEl.paused && !videoEl.ended;
|
|
99
|
+
}
|
package/tests/video.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
<h1>Video</h1>
|
|
16
16
|
|
|
17
|
-
<div class="uk-grid uk-child-width-1-
|
|
17
|
+
<div class="uk-grid uk-child-width-1-3@s">
|
|
18
18
|
<div>
|
|
19
19
|
|
|
20
20
|
<h3>Autoplay</h3>
|
|
@@ -30,6 +30,14 @@
|
|
|
30
30
|
<button class="uk-button uk-button-default uk-margin-bottom" type="button" uk-toggle="target: +">Toggle Video</button>
|
|
31
31
|
<iframe src="https://www.youtube-nocookie.com/embed/c2pz2mlSfXA?autoplay=0&showinfo=0&rel=0&modestbranding=1&playsinline=1" width="1920" height="1080" allowfullscreen uk-responsive uk-video="automute: true; autoplay: inview"></iframe>
|
|
32
32
|
</div>
|
|
33
|
+
|
|
34
|
+
<div>
|
|
35
|
+
|
|
36
|
+
<h3>Autoplay Hover</h3>
|
|
37
|
+
|
|
38
|
+
<button class="uk-button uk-button-default uk-margin-bottom" type="button" uk-toggle="target: +">Toggle Video</button>
|
|
39
|
+
<video src="https://yootheme.com/site/images/media/yootheme-pro.mp4" width="1920" height="1080" playsinline uk-video="automute: true; autoplay: hover"></video>
|
|
40
|
+
</div>
|
|
33
41
|
</div>
|
|
34
42
|
|
|
35
43
|
<h2>JavaScript Options</h2>
|
|
@@ -48,7 +56,7 @@
|
|
|
48
56
|
<td><code>autoplay</code></td>
|
|
49
57
|
<td>Boolean, String</td>
|
|
50
58
|
<td>true</td>
|
|
51
|
-
<td>The video automatically plays/pauses when visible/hidden on the page. A value of `inview` will delay loading the video and play/pause the video as it enters/leaves the viewport.</td>
|
|
59
|
+
<td>The video automatically plays/pauses when visible/hidden on the page. A value of `inview` will delay loading the video and play/pause the video as it enters/leaves the viewport. A value of `hover` will play the video as it is being hovered.</td>
|
|
52
60
|
</tr>
|
|
53
61
|
<tr>
|
|
54
62
|
<td><code>automute</code></td>
|