@ptcwebops/ptcw-design 6.4.4 → 6.4.5
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/cjs/blog-detail-content_2.cjs.entry.js +1 -1
- package/dist/cjs/blog-detail-layout.cjs.entry.js +1 -1
- package/dist/cjs/blogs-search-section.cjs.entry.js +1 -1
- package/dist/cjs/homepage-jumbotron.cjs.entry.js +1 -1
- package/dist/cjs/homepage-toggled-content.cjs.entry.js +1 -1
- package/dist/cjs/innovator-toggle-container.cjs.entry.js +39 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/most-popular-news.cjs.entry.js +1 -1
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/ptc-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/ptc-background-video.cjs.entry.js +99 -28
- package/dist/cjs/ptc-button_5.cjs.entry.js +597 -0
- package/dist/cjs/ptc-card_2.cjs.entry.js +1 -1
- package/dist/cjs/ptc-collapse-list.cjs.entry.js +1 -1
- package/dist/cjs/ptc-form-checkbox_2.cjs.entry.js +1 -1
- package/dist/cjs/ptc-homepage-image-feature.cjs.entry.js +1 -1
- package/dist/cjs/ptc-homepage-video-background.cjs.entry.js +1 -1
- package/dist/cjs/ptc-icon-card.cjs.entry.js +1 -1
- package/dist/cjs/ptc-jumbotron.cjs.entry.js +1 -1
- package/dist/cjs/ptc-link.cjs.entry.js +1 -1
- package/dist/cjs/ptc-media-card.cjs.entry.js +74 -6
- package/dist/cjs/ptc-multi-select_2.cjs.entry.js +1 -1
- package/dist/cjs/ptc-pricing-packaging-table.cjs.entry.js +1 -1
- package/dist/cjs/ptc-pricing-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ptc-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ptc-social-icons-footer.cjs.entry.js +1 -1
- package/dist/cjs/ptc-subnav-v2.cjs.entry.js +430 -0
- package/dist/cjs/ptc-text-copy-with-background.cjs.entry.js +1 -1
- package/dist/cjs/ptcw-design.cjs.js +1 -1
- package/dist/cjs/{utils-b63aef52.js → utils-0ff09a53.js} +13 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/innovator-toggle-container/innovator-toggle-container.js +39 -3
- package/dist/collection/components/ptc-background-video/ptc-background-video.css +21 -0
- package/dist/collection/components/ptc-background-video/ptc-background-video.js +110 -43
- package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.css +5 -0
- package/dist/collection/components/ptc-media-card/ptc-media-card.js +78 -7
- package/dist/collection/components/ptc-preloader-section/ptc-preloader-section.css +16 -0
- package/dist/collection/components/ptc-seo-title/ptc-seo-title.js +3 -3
- package/dist/collection/components/ptc-skeleton/ptc-skeleton.css +6 -0
- package/dist/collection/components/ptc-subnav-v2/ptc-subnav-v2.css +394 -0
- package/dist/collection/components/ptc-subnav-v2/ptc-subnav-v2.js +483 -0
- package/dist/collection/components/ptc-text-copy-with-background/ptc-text-copy-with-background.css +19 -0
- package/dist/collection/stories/organisms/ptc/Subnav New/preview.stories.js +360 -0
- package/dist/collection/utils/utils.js +11 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +654 -42
- package/dist/esm/blog-detail-content_2.entry.js +1 -1
- package/dist/esm/blog-detail-layout.entry.js +1 -1
- package/dist/esm/blogs-search-section.entry.js +1 -1
- package/dist/esm/homepage-jumbotron.entry.js +1 -1
- package/dist/esm/homepage-toggled-content.entry.js +1 -1
- package/dist/esm/innovator-toggle-container.entry.js +39 -3
- package/dist/esm/{interfaces-4caedd26.js → interfaces-7c0243be.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/most-popular-news.entry.js +1 -1
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/ptc-accordion-item.entry.js +1 -1
- package/dist/esm/ptc-background-video.entry.js +99 -28
- package/dist/esm/ptc-button_5.entry.js +589 -0
- package/dist/esm/ptc-card_2.entry.js +1 -1
- package/dist/esm/ptc-collapse-list.entry.js +1 -1
- package/dist/esm/ptc-form-checkbox_2.entry.js +1 -1
- package/dist/esm/ptc-homepage-image-feature.entry.js +1 -1
- package/dist/esm/ptc-homepage-video-background.entry.js +1 -1
- package/dist/esm/ptc-icon-card.entry.js +1 -1
- package/dist/esm/ptc-img.entry.js +1 -1
- package/dist/esm/ptc-jumbotron.entry.js +1 -1
- package/dist/esm/ptc-link.entry.js +1 -1
- package/dist/esm/ptc-media-card.entry.js +74 -6
- package/dist/esm/ptc-multi-select_2.entry.js +1 -1
- package/dist/esm/ptc-pricing-packaging-table.entry.js +1 -1
- package/dist/esm/ptc-pricing-tabs.entry.js +1 -1
- package/dist/esm/ptc-skeleton.entry.js +1 -1
- package/dist/esm/ptc-social-icons-footer.entry.js +1 -1
- package/dist/esm/ptc-subnav-v2.entry.js +426 -0
- package/dist/esm/ptc-text-copy-with-background.entry.js +1 -1
- package/dist/esm/ptcw-design.js +1 -1
- package/dist/esm/{utils-2f12c081.js → utils-a64ba942.js} +12 -1
- package/dist/ptcw-design/{p-9dbcfcee.entry.js → p-01497d7a.entry.js} +1 -1
- package/dist/ptcw-design/p-043be054.entry.js +1 -0
- package/dist/ptcw-design/{p-257267e3.entry.js → p-0df868d2.entry.js} +1 -1
- package/dist/ptcw-design/{p-fe8392c4.entry.js → p-1489b374.entry.js} +1 -1
- package/dist/ptcw-design/p-1c569057.entry.js +1 -0
- package/dist/ptcw-design/p-22cf00e7.js +1 -0
- package/dist/ptcw-design/p-28113014.entry.js +1 -0
- package/dist/ptcw-design/{p-d0fb9bfb.entry.js → p-2f21b69b.entry.js} +1 -1
- package/dist/ptcw-design/{p-45b1f3fc.entry.js → p-456c5cbb.entry.js} +1 -1
- package/dist/ptcw-design/{p-c3022c48.entry.js → p-54b589a6.entry.js} +1 -1
- package/dist/ptcw-design/{p-9b0df204.entry.js → p-5877f093.entry.js} +1 -1
- package/dist/ptcw-design/{p-78370e3d.entry.js → p-5a8e7557.entry.js} +1 -1
- package/dist/ptcw-design/{p-3ed4a7ed.entry.js → p-5ca42138.entry.js} +1 -1
- package/dist/ptcw-design/{p-901c31b3.entry.js → p-5cf5b9f8.entry.js} +1 -1
- package/dist/ptcw-design/{p-4fff8cc8.entry.js → p-6a1d9c7d.entry.js} +1 -1
- package/dist/ptcw-design/{p-a5fc048f.entry.js → p-82f766d2.entry.js} +1 -1
- package/dist/ptcw-design/{p-76dab076.entry.js → p-8aca7181.entry.js} +1 -1
- package/dist/ptcw-design/{p-52e17d34.entry.js → p-92ad78c5.entry.js} +1 -1
- package/dist/ptcw-design/p-9c8b739c.entry.js +1 -0
- package/dist/ptcw-design/{p-4098e953.entry.js → p-9f4ad29d.entry.js} +1 -1
- package/dist/ptcw-design/p-a8bfef4d.entry.js +1 -0
- package/dist/ptcw-design/{p-abadbe5b.entry.js → p-bd9d995b.entry.js} +1 -1
- package/dist/ptcw-design/{p-8c121480.entry.js → p-c160bda4.entry.js} +1 -1
- package/dist/ptcw-design/p-c555a45c.entry.js +1 -0
- package/dist/ptcw-design/{p-96163196.entry.js → p-d0ebcace.entry.js} +1 -1
- package/dist/ptcw-design/{p-81e5fa38.entry.js → p-d2998707.entry.js} +1 -1
- package/dist/ptcw-design/{p-19a407ff.entry.js → p-de650865.entry.js} +1 -1
- package/dist/ptcw-design/{p-54f5a5be.entry.js → p-e23bc4a1.entry.js} +1 -1
- package/dist/ptcw-design/{p-711bcdad.js → p-ee1183b2.js} +1 -1
- package/dist/ptcw-design/{p-9f01419b.entry.js → p-f2675bb0.entry.js} +1 -1
- package/dist/ptcw-design/ptcw-design.css +1 -1
- package/dist/ptcw-design/ptcw-design.esm.js +1 -1
- package/dist/types/components/innovator-toggle-container/innovator-toggle-container.d.ts +3 -0
- package/dist/types/components/ptc-background-video/ptc-background-video.d.ts +31 -47
- package/dist/types/components/ptc-media-card/ptc-media-card.d.ts +8 -2
- package/dist/types/components/ptc-subnav-v2/ptc-subnav-v2.d.ts +55 -0
- package/dist/types/components.d.ts +105 -88
- package/dist/types/utils/utils.d.ts +2 -0
- package/package.json +98 -98
- package/readme.md +19 -19
- package/dist/cjs/ptc-button.cjs.entry.js +0 -117
- package/dist/cjs/ptc-para.cjs.entry.js +0 -139
- package/dist/cjs/ptc-picture.cjs.entry.js +0 -168
- package/dist/cjs/ptc-spacer.cjs.entry.js +0 -38
- package/dist/cjs/ptc-title.cjs.entry.js +0 -161
- package/dist/esm/ptc-button.entry.js +0 -113
- package/dist/esm/ptc-para.entry.js +0 -135
- package/dist/esm/ptc-picture.entry.js +0 -164
- package/dist/esm/ptc-spacer.entry.js +0 -34
- package/dist/esm/ptc-title.entry.js +0 -157
- package/dist/ptcw-design/p-0c69ea52.entry.js +0 -1
- package/dist/ptcw-design/p-24776ca2.entry.js +0 -1
- package/dist/ptcw-design/p-605b13a2.entry.js +0 -1
- package/dist/ptcw-design/p-80122e26.js +0 -1
- package/dist/ptcw-design/p-8cea8943.entry.js +0 -1
- package/dist/ptcw-design/p-a8872ce3.entry.js +0 -1
- package/dist/ptcw-design/p-c6431ebc.entry.js +0 -1
- package/dist/ptcw-design/p-d51438de.entry.js +0 -1
- package/dist/ptcw-design/p-d875f96d.entry.js +0 -1
- package/dist/ptcw-design/p-e4eb925f.entry.js +0 -1
|
@@ -1,11 +1,37 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-c83db688.js';
|
|
2
|
-
import { n as nextUserInteractionEvent } from './utils-
|
|
2
|
+
import { i as isReducedMotion, n as nextUserInteractionEvent, o as onReducedMotionChange } from './utils-a64ba942.js';
|
|
3
3
|
|
|
4
|
-
const ptcBackgroundVideoCss = "h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}:host{display:block;position:relative}:host video{position:absolute;top:0px;left:0px;right:0;width:100%;height:100%;overflow:hidden;pointer-events:none;z-index:-100;object-fit:cover}:host .video-overlay{z-index:1;display:block;position:absolute;width:100%;height:100%;top:0;left:0;opacity:0.8;background-image:linear-gradient(270deg, rgba(30, 38, 38, 0) 26%, #1e2626)}:host .video-overlay.dark{background-color:rgba(0, 0, 0, 0.6)}:host(.legacy){display:block;position:absolute;top:0px;left:0px;right:0;width:100%;height:100%;overflow:hidden;pointer-events:none;z-index:-100}:host(.legacy) video{object-fit:cover;position:absolute;top:0px;left:0px;right:0;width:100%;height:100%;overflow:hidden}:host .iframe-wrapper{position:absolute;top:0px;left:0px;right:0;width:100%;height:100%;overflow:hidden;pointer-events:none;z-index:-100}:host .iframe-wrapper .background-video-embed{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:100%;height:100%}:host .iframe-wrapper .player .vp-video-wrapper .vp-telecine-cover video{object-fit:cover}:host .play-button{position:absolute;top:1.5rem;right:1.5rem;width:34px;height:34px;z-index:99}@media (min-width: 768px){:host .play-button.top-right{top:2rem;right:2rem}}:host .play-button.top-left{right:unset;top:1.5rem;left:1.5rem}@media (min-width: 768px){:host .play-button.top-left{bottom:3.75rem;left:2rem}}@media (min-width: 768px){:host .play-button.bottom-left{top:unset;right:unset;bottom:3.75rem;left:2rem}}@media (min-width: 768px){:host .play-button.bottom-right{top:unset;bottom:3.75rem;right:2rem}}:host .play-button.allbp-bottom-right{top:unset;bottom:4.75rem;right:2rem}:host .play-button button{display:inline-block;padding:5px;position:relative;top:-5px;left:-5px;cursor:pointer}@media only screen and (min-width: 768px){:host .play-button button{top:auto;left:auto}}@media only screen and (min-width: 992px){:host .play-button button{padding:0}}:host .play-button button.bg-svg-play,:host .play-button button.bg-svg-pause{background-repeat:no-repeat;background-size:18px 18px;background-position:center;background-color:var(--color-white);width:34px;height:34px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.24);border-radius:4px;border:2px solid var(--color-gray-10)}:host .play-button button.bg-svg-play:hover,:host .play-button button.bg-svg-pause:hover{background-color:var(--color-gray-02)}:host .play-button button.bg-svg-play:active,:host .play-button button.bg-svg-pause:active{transition:none;background-color:var(--color-gray-03)}:host .play-button button.bg-svg-play.active:hover,:host .play-button button.bg-svg-pause.active:hover{background-color:var(--color-gray-05)}:host .play-button button.bg-svg-play.active:active,:host .play-button button.bg-svg-pause.active:active{transition:none;background-color:var(--color-gray-03)}:host .play-button button.bg-svg-play:focus,:host .play-button button.bg-svg-pause:focus{border-radius:var(--ptc-border-radius-standard);border:2px solid white;outline:5px solid var(--keyboard-nav-outline)}:host .play-button button.bg-svg-play{background-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 18\" id=\"play\"><path d=\"M11.9625 9L0.0374756 0V18L11.9625 9Z\"></path></svg>')}:host .play-button button.bg-svg-pause{background-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14 18\" id=\"pause\"><path id=\"rect28\" d=\"M 0,0 H 4 V 18 H 0 Z\"></path><path id=\"rect30\" d=\"m 10,0 h 4 v 18 h -4 z\"></path></svg>')}";
|
|
4
|
+
const ptcBackgroundVideoCss = "h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}:host{display:block;position:relative}:host video{position:absolute;top:0px;left:0px;right:0;width:100%;height:100%;overflow:hidden;pointer-events:none;z-index:-100;object-fit:cover}:host .video-overlay{z-index:1;display:block;position:absolute;width:100%;height:100%;top:0;left:0;opacity:0.8;background-image:linear-gradient(270deg, rgba(30, 38, 38, 0) 26%, #1e2626)}:host .video-overlay.dark{background-color:rgba(0, 0, 0, 0.6)}:host(.legacy){display:block;position:absolute;top:0px;left:0px;right:0;width:100%;height:100%;overflow:hidden;pointer-events:none;z-index:-100}:host(.legacy) video{object-fit:cover;position:absolute;top:0px;left:0px;right:0;width:100%;height:100%;overflow:hidden}:host .iframe-wrapper{position:absolute;top:0px;left:0px;right:0;width:100%;height:100%;overflow:hidden;pointer-events:none;z-index:-100}:host .iframe-wrapper .background-video-embed{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:100%;height:100%}:host .iframe-wrapper .player .vp-video-wrapper .vp-telecine-cover video{object-fit:cover}:host .play-button{position:absolute;top:1.5rem;right:1.5rem;width:34px;height:34px;z-index:99}@media (min-width: 768px){:host .play-button.top-right{top:2rem;right:2rem}}:host .play-button.top-left{right:unset;top:1.5rem;left:1.5rem}@media (min-width: 768px){:host .play-button.top-left{bottom:3.75rem;left:2rem}}@media (min-width: 768px){:host .play-button.bottom-left{top:unset;right:unset;bottom:3.75rem;left:2rem}}@media (min-width: 768px){:host .play-button.bottom-right{top:unset;bottom:3.75rem;right:2rem}}:host .play-button.allbp-bottom-right{top:unset;bottom:4.75rem;right:2rem}:host .play-button button{display:inline-block;padding:5px;position:relative;top:-5px;left:-5px;cursor:pointer}@media only screen and (min-width: 768px){:host .play-button button{top:auto;left:auto}}@media only screen and (min-width: 992px){:host .play-button button{padding:0}}:host .play-button button.bg-svg-play,:host .play-button button.bg-svg-pause{background-repeat:no-repeat;background-size:18px 18px;background-position:center;background-color:var(--color-white);width:34px;height:34px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.24);border-radius:4px;border:2px solid var(--color-gray-10)}:host .play-button button.bg-svg-play:hover,:host .play-button button.bg-svg-pause:hover{background-color:var(--color-gray-02)}:host .play-button button.bg-svg-play:active,:host .play-button button.bg-svg-pause:active{transition:none;background-color:var(--color-gray-03)}:host .play-button button.bg-svg-play.active:hover,:host .play-button button.bg-svg-pause.active:hover{background-color:var(--color-gray-05)}:host .play-button button.bg-svg-play.active:active,:host .play-button button.bg-svg-pause.active:active{transition:none;background-color:var(--color-gray-03)}:host .play-button button.bg-svg-play:focus,:host .play-button button.bg-svg-pause:focus{border-radius:var(--ptc-border-radius-standard);border:2px solid white;outline:5px solid var(--keyboard-nav-outline)}:host .play-button button.bg-svg-play{background-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 18\" id=\"play\"><path d=\"M11.9625 9L0.0374756 0V18L11.9625 9Z\"></path></svg>')}:host .play-button button.bg-svg-pause{background-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14 18\" id=\"pause\"><path id=\"rect28\" d=\"M 0,0 H 4 V 18 H 0 Z\"></path><path id=\"rect30\" d=\"m 10,0 h 4 v 18 h -4 z\"></path></svg>')}:host{display:block;position:relative}:host .media{position:absolute;inset:0;overflow:hidden}:host .background-video,:host .bg-fallback{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}:host .bg-fallback{display:block}";
|
|
5
5
|
|
|
6
6
|
const PtcBackgroundVideo = class {
|
|
7
7
|
constructor(hostRef) {
|
|
8
8
|
registerInstance(this, hostRef);
|
|
9
|
+
/** Ensure the first frame is painted and paused. */
|
|
10
|
+
this.showFirstFrame = (v) => {
|
|
11
|
+
v.preload = "auto";
|
|
12
|
+
v.removeAttribute("autoplay");
|
|
13
|
+
v.loop = false;
|
|
14
|
+
const paint = () => {
|
|
15
|
+
try {
|
|
16
|
+
//v.currentTime = 0;
|
|
17
|
+
// If a browser still paints black, try this tiny nudge:
|
|
18
|
+
v.currentTime = 0.1;
|
|
19
|
+
}
|
|
20
|
+
catch (_a) { }
|
|
21
|
+
v.pause();
|
|
22
|
+
};
|
|
23
|
+
if (v.readyState >= 2 /* HAVE_CURRENT_DATA, have enough data */) {
|
|
24
|
+
paint();
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const onLoaded = () => {
|
|
28
|
+
v.removeEventListener("loadeddata", onLoaded);
|
|
29
|
+
paint();
|
|
30
|
+
};
|
|
31
|
+
v.addEventListener("loadeddata", onLoaded, { once: true });
|
|
32
|
+
v.load();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
9
35
|
this.videoSrc = undefined;
|
|
10
36
|
this.posterSrc = undefined;
|
|
11
37
|
this.overlay = true;
|
|
@@ -14,60 +40,105 @@ const PtcBackgroundVideo = class {
|
|
|
14
40
|
this.pauseButtonTitle = undefined;
|
|
15
41
|
this.buttonLocation = "bottom-right";
|
|
16
42
|
this.buttonTabIndex = 0;
|
|
17
|
-
this.paused = undefined;
|
|
18
43
|
this.trackerId = undefined;
|
|
19
44
|
this.defer = undefined;
|
|
20
45
|
this.type = "default";
|
|
21
46
|
this.isIframe = false;
|
|
47
|
+
this.paused = undefined;
|
|
22
48
|
this.loadedTrue = false;
|
|
49
|
+
this.reducedMotion = false;
|
|
50
|
+
}
|
|
51
|
+
componentWillLoad() {
|
|
52
|
+
this.paused = false;
|
|
53
|
+
this.reducedMotion = isReducedMotion();
|
|
23
54
|
}
|
|
24
55
|
componentDidLoad() {
|
|
56
|
+
const afterMount = () => {
|
|
57
|
+
this.loadedTrue = true;
|
|
58
|
+
this.syncPlaybackWithPreference();
|
|
59
|
+
};
|
|
25
60
|
if (this.defer) {
|
|
26
|
-
nextUserInteractionEvent(this).then(
|
|
27
|
-
this.loadedTrue = true;
|
|
28
|
-
});
|
|
61
|
+
nextUserInteractionEvent(this).then(afterMount);
|
|
29
62
|
}
|
|
30
63
|
else {
|
|
31
|
-
|
|
64
|
+
afterMount();
|
|
32
65
|
}
|
|
66
|
+
this.offMotionListener = onReducedMotionChange((reduced) => {
|
|
67
|
+
this.reducedMotion = reduced;
|
|
68
|
+
// Wait a tick for render to reflect state, then sync playback.
|
|
69
|
+
setTimeout(() => this.syncPlaybackWithPreference(), 0);
|
|
70
|
+
});
|
|
33
71
|
}
|
|
34
|
-
|
|
35
|
-
|
|
72
|
+
disconnectedCallback() {
|
|
73
|
+
var _a;
|
|
74
|
+
(_a = this.offMotionListener) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
75
|
+
}
|
|
76
|
+
syncPlaybackWithPreference() {
|
|
77
|
+
if (this.isIframe) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const v = this.videoEl;
|
|
81
|
+
if (!v)
|
|
82
|
+
return;
|
|
83
|
+
if (this.reducedMotion) {
|
|
84
|
+
// Animations OFF, freeze first frame
|
|
85
|
+
this.showFirstFrame(v);
|
|
86
|
+
this.paused = true; //sync icon state
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
// Animations ON, autoplay unless user paused
|
|
90
|
+
v.preload = "auto";
|
|
91
|
+
v.loop = true;
|
|
92
|
+
if (!this.paused) {
|
|
93
|
+
v.setAttribute("autoplay", "");
|
|
94
|
+
v.play().catch(() => { });
|
|
95
|
+
this.paused = false; //sync icon state
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
v.pause();
|
|
99
|
+
this.paused = true; //sync icon state
|
|
100
|
+
}
|
|
101
|
+
}
|
|
36
102
|
}
|
|
103
|
+
// ------------ Render ------------
|
|
37
104
|
render() {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
|
|
105
|
+
const canMountMedia = this.loadedTrue;
|
|
106
|
+
const videoNode = !this.isIframe && canMountMedia && (h("video", { class: "background-video", src: this.videoSrc, muted: true, playsinline: true, autoplay: !this.reducedMotion && !this.paused, loop: !this.reducedMotion, preload: "auto", "aria-hidden": "true", tabindex: "-1", ref: (el) => (this.videoEl = el) }));
|
|
107
|
+
const iframeNode = this.isIframe && canMountMedia && (h("div", { class: "iframe-wrapper" }, h("iframe", { id: "jumbotron-iframe", src: this.videoSrc, frameborder: 0, allow: "autoplay", allowFullScreen: true, class: "background-video-embed", "aria-hidden": "true", tabindex: "-1" })));
|
|
108
|
+
return (h(Host, { class: this.type }, h("div", { class: "media" }, videoNode, iframeNode), !!this.videoSrc && this.playButtonTitle && (h("div", { class: `play-button ${this.buttonLocation}` }, this.paused && (h("ptc-tooltip", { class: "play-btn", mode: "wrapper", description: this.playButtonTitle, position: this.buttonLocation === "allbp-bottom-right"
|
|
41
109
|
? "side-left"
|
|
42
110
|
: "bottom-right", styles: ".wrapper-content.sc-ptc-tooltip .tooltip.sc-ptc-tooltip{min-width:unset!important; white-space: nowrap}" }, h("div", { id: this.trackerId, class: "tracker-div mf-listen" }, h("button", { class: "bg-svg-play", type: "button", tabindex: this.buttonTabIndex, onClick: (e) => this.toggleVideoPlay(e), "aria-label": "Video Play button" })))), !this.paused && !!this.pauseButtonTitle && (h("ptc-tooltip", { class: "pause-btn", mode: "wrapper", description: this.pauseButtonTitle, position: this.buttonLocation === "allbp-bottom-right"
|
|
43
111
|
? "side-left"
|
|
44
|
-
: "bottom-right", styles: ".wrapper-content.sc-ptc-tooltip .tooltip.sc-ptc-tooltip{min-width:unset!important; white-space: nowrap}" }, h("div", { id: this.trackerId, class: "tracker-div mf-listen" }, h("button", { class: "bg-svg-pause", tabindex: this.buttonTabIndex, type: "button", onClick: (e) => this.toggleVideoPlay(e), "aria-label": "Video Pause button" })))))), this.overlay ?
|
|
112
|
+
: "bottom-right", styles: ".wrapper-content.sc-ptc-tooltip .tooltip.sc-ptc-tooltip{min-width:unset!important; white-space: nowrap}" }, h("div", { id: this.trackerId, class: "tracker-div mf-listen" }, h("button", { class: "bg-svg-pause", tabindex: this.buttonTabIndex, type: "button", onClick: (e) => this.toggleVideoPlay(e), "aria-label": "Video Pause button" })))))), this.overlay ? h("div", { class: `video-overlay ${this.overlayType}` }) : "", this.type === "default" ? h("slot", null) : ""));
|
|
45
113
|
}
|
|
46
114
|
toggleVideoPlay(e) {
|
|
47
115
|
e.preventDefault();
|
|
48
116
|
this.paused = !this.paused;
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
117
|
+
const v = this.videoEl;
|
|
118
|
+
if (!v)
|
|
119
|
+
return;
|
|
120
|
+
if (this.paused) {
|
|
121
|
+
v.pause();
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
v.loop = true;
|
|
125
|
+
if (!this.reducedMotion)
|
|
126
|
+
v.setAttribute("autoplay", "");
|
|
127
|
+
v.play().catch((z) => console.error(z));
|
|
57
128
|
}
|
|
58
129
|
}
|
|
59
130
|
async pauseVideo() {
|
|
131
|
+
var _a;
|
|
60
132
|
this.paused = true;
|
|
61
|
-
|
|
62
|
-
if (video) {
|
|
63
|
-
video.pause();
|
|
64
|
-
}
|
|
133
|
+
(_a = this.videoEl) === null || _a === void 0 ? void 0 : _a.pause();
|
|
65
134
|
}
|
|
66
135
|
async playVideo() {
|
|
67
136
|
this.paused = false;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
137
|
+
if (this.videoEl) {
|
|
138
|
+
this.videoEl.loop = true;
|
|
139
|
+
if (!this.reducedMotion)
|
|
140
|
+
this.videoEl.setAttribute("autoplay", "");
|
|
141
|
+
this.videoEl.play().catch((z) => console.error(z));
|
|
71
142
|
}
|
|
72
143
|
}
|
|
73
144
|
get el() { return getElement(this); }
|