@arc-ui/community-components 3.2.0 → 3.4.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/.turbo/turbo-build.log +133 -13
- package/CHANGELOG.md +31 -0
- package/lib/Accordion/Accordion.cjs +2 -3
- package/lib/Accordion/Accordion.mjs +2 -3
- package/lib/ActionTile/ActionTile.cjs +4 -5
- package/lib/ActionTile/ActionTile.mjs +10 -11
- package/lib/ActionTile/styles.css +1 -1
- package/lib/ArticleSidebar/ArticleSidebar.cjs +9 -10
- package/lib/ArticleSidebar/ArticleSidebar.mjs +46 -47
- package/lib/Author/Author.cjs +2 -3
- package/lib/Author/Author.mjs +2 -3
- package/lib/BannerWithTabs/BannerWithTabs.cjs +4 -5
- package/lib/BannerWithTabs/BannerWithTabs.mjs +8 -9
- package/lib/ContentInfoWidget/ContentInfoWidget.cjs +3 -2
- package/lib/ContentInfoWidget/ContentInfoWidget.mjs +8 -7
- package/lib/CopyLead/CopyLead.cjs +32 -23
- package/lib/CopyLead/CopyLead.mjs +60 -51
- package/lib/DownloadList/DownloadList.cjs +6 -8
- package/lib/DownloadList/DownloadList.mjs +11 -13
- package/lib/FAQs/FAQs.cjs +5 -6
- package/lib/FAQs/FAQs.mjs +22 -23
- package/lib/FeaturePost/FeaturePost.cjs +14 -15
- package/lib/FeaturePost/FeaturePost.mjs +54 -55
- package/lib/Highlights/Highlights.cjs +11 -12
- package/lib/Highlights/Highlights.mjs +24 -25
- package/lib/InlineLinkGroup/InlineLinkGroup.cjs +25 -0
- package/lib/InlineLinkGroup/InlineLinkGroup.mjs +23 -0
- package/lib/InlineLinkGroup/styles.css +1 -0
- package/lib/LinkTile/LinkTile.cjs +6 -6
- package/lib/LinkTile/LinkTile.mjs +7 -7
- package/lib/LinkTile/styles.css +1 -1
- package/lib/ProductNavigation/ProductNavigation.cjs +6 -7
- package/lib/ProductNavigation/ProductNavigation.mjs +18 -19
- package/lib/PromoListing/PromoListing.cjs +7 -8
- package/lib/PromoListing/PromoListing.mjs +17 -18
- package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.cjs +7 -8
- package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.mjs +9 -10
- package/lib/Quote/Quote.cjs +5 -6
- package/lib/Quote/Quote.mjs +9 -10
- package/lib/SectionHeading/SectionHeading.cjs +2 -3
- package/lib/SectionHeading/SectionHeading.mjs +2 -3
- package/lib/Statistics/Statistics.cjs +21 -19
- package/lib/Statistics/Statistics.mjs +35 -33
- package/lib/Statistics/styles.css +1 -1
- package/lib/Summary/Summary.cjs +4 -4
- package/lib/Summary/Summary.mjs +13 -13
- package/lib/ThumbnailSignpost/ThumbnailSignpost.cjs +2 -3
- package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +2 -3
- package/lib/VideoHeroCard/VideoHeroCard.cjs +76 -0
- package/lib/VideoHeroCard/VideoHeroCard.mjs +74 -0
- package/lib/VideoPortraitCard/VideoPortraitCard.cjs +22 -0
- package/lib/VideoPortraitCard/VideoPortraitCard.mjs +20 -0
- package/lib/_shared/cjs/{Accordion-DfNGOjTm.cjs → Accordion-QqDoB3pY.cjs} +8 -9
- package/lib/_shared/cjs/{Author-D4dKNQem.cjs → Author-aL8YXi7C.cjs} +4 -5
- package/lib/_shared/cjs/Preview-Dx1kCzJ1.cjs +102 -0
- package/lib/_shared/cjs/{SectionHeading-DeSFM0HV.cjs → SectionHeading-Dj-dJfv3.cjs} +4 -5
- package/lib/_shared/cjs/{ThumbnailSignpost-GkOiwt-Z.cjs → ThumbnailSignpost-SBnrGooA.cjs} +4 -5
- package/lib/_shared/cjs/VideoCardThumbnail-BqYgpk0u.cjs +440 -0
- package/lib/_shared/cjs/dash.all.min-BPXzla24.cjs +6 -0
- package/lib/_shared/cjs/{tslib.es6-BxB9I209.cjs → filter-attrs-C26zOt4_.cjs} +25 -0
- package/lib/_shared/cjs/hls-Ckhp5fVA.cjs +36628 -0
- package/lib/_shared/cjs/index-DjiIVIaV.cjs +96 -0
- package/lib/_shared/cjs/index-oGP6D6gL.cjs +14826 -0
- package/lib/_shared/cjs/{index.es-Dq8bYrbW.cjs → index.es-B0J3cvrY.cjs} +1 -1
- package/lib/_shared/cjs/mixin-BFwaXKGB.cjs +1027 -0
- package/lib/_shared/cjs/react-CEvhi3LL.cjs +737 -0
- package/lib/_shared/cjs/react-CqsEClV0.cjs +466 -0
- package/lib/_shared/cjs/react-DE6M3seI.cjs +496 -0
- package/lib/_shared/cjs/react-Dri2yjKm.cjs +554 -0
- package/lib/_shared/cjs/react-DxToimBj.cjs +4239 -0
- package/lib/_shared/cjs/react-JTfV8OSA.cjs +325 -0
- package/lib/_shared/cjs/react-caXJFZ8W.cjs +400 -0
- package/lib/_shared/cjs/react-fep2ei7j.cjs +727 -0
- package/lib/_shared/esm/{Accordion-cd1oYvBv.mjs → Accordion-DtU7jbCv.mjs} +16 -17
- package/lib/_shared/esm/Author-CJQFrQM9.mjs +27 -0
- package/lib/_shared/esm/Preview-CmbKOgEO.mjs +100 -0
- package/lib/_shared/esm/{SectionHeading-CpDLCndw.mjs → SectionHeading-BskdQ2Tt.mjs} +10 -11
- package/lib/_shared/esm/{ThumbnailSignpost-BeRiXbUp.mjs → ThumbnailSignpost-CBSdQiHw.mjs} +13 -14
- package/lib/_shared/esm/VideoCardThumbnail-VfOKmPCv.mjs +437 -0
- package/lib/_shared/esm/dash.all.min-CbWI_8dN.mjs +4 -0
- package/lib/_shared/esm/{tslib.es6-D6Wu-xwB.mjs → filter-attrs-D-1kWaCP.mjs} +25 -1
- package/lib/_shared/esm/hls-AFbJDS9D.mjs +36625 -0
- package/lib/_shared/esm/index-CrcIrdjn.mjs +14799 -0
- package/lib/_shared/esm/index-DYnuIO1L.mjs +94 -0
- package/lib/_shared/esm/{index.es-Bfdys5__.mjs → index.es-DraZ-qKh.mjs} +1 -1
- package/lib/_shared/esm/mixin-BGGG8VrM.mjs +1024 -0
- package/lib/_shared/esm/react-BGimq-TB.mjs +4237 -0
- package/lib/_shared/esm/react-BHT4t_eQ.mjs +494 -0
- package/lib/_shared/esm/react-BSd0sGcO.mjs +464 -0
- package/lib/_shared/esm/react-CSr43fZV.mjs +552 -0
- package/lib/_shared/esm/react-Ca6E7Fr-.mjs +398 -0
- package/lib/_shared/esm/react-DG070IvZ.mjs +725 -0
- package/lib/_shared/esm/react-DZyqy7W7.mjs +735 -0
- package/lib/_shared/esm/react-WW_9iHcl.mjs +323 -0
- package/lib/index.cjs +299 -181
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +77 -63
- package/lib/index.d.mts +77 -63
- package/lib/index.mjs +297 -181
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +1 -1
- package/package.json +15 -12
- package/rollup.config.js +1 -1
- package/src/components/ActionTile/ActionTile.module.css +56 -37
- package/src/components/ActionTile/ActionTile.tsx +1 -1
- package/src/components/ArticleSidebar/ArticleSidebar.tsx +4 -6
- package/src/components/Author/Author.tsx +0 -3
- package/src/components/BannerWithTabs/BannerWithTabs.tsx +4 -6
- package/src/components/ContentInfoWidget/ContentInfoWidget.tsx +3 -4
- package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +7 -6
- package/src/components/CopyLead/templates/Content/Content.tsx +5 -3
- package/src/components/CopyLead/templates/Media/Media.tsx +5 -6
- package/src/components/DownloadList/DownloadList.tsx +8 -8
- package/src/components/FeaturePost/FeaturePost.tsx +3 -7
- package/src/components/Highlights/Highlights.tsx +3 -2
- package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +3 -2
- package/src/components/Highlights/components/HighlightList/HighlightList.tsx +5 -2
- package/src/components/InlineLinkGroup/InlineLinkGroup.module.css +81 -0
- package/src/components/InlineLinkGroup/InlineLinkGroup.tsx +67 -0
- package/src/components/InlineLinkGroup/index.ts +5 -0
- package/src/components/LinkTile/LinkTile.module.css +62 -26
- package/src/components/LinkTile/LinkTile.tsx +8 -1
- package/src/components/PromoListing/PromoListing.tsx +3 -11
- package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.tsx +2 -0
- package/src/components/Quote/Quote.tsx +1 -7
- package/src/components/Statistics/Statistics.module.css +0 -10
- package/src/components/Statistics/Statistics.tsx +35 -32
- package/src/components/Summary/Summary.tsx +3 -1
- package/src/components/VideoHeroCard/VideoHeroCard.tsx +63 -0
- package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.module.css +32 -0
- package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.tsx +97 -0
- package/src/components/VideoHeroCard/components/VideoHeroCardContent/index.ts +4 -0
- package/src/components/VideoHeroCard/index.ts +1 -0
- package/src/components/VideoPortraitCard/VideoPortraitCard.tsx +54 -0
- package/src/components/VideoPortraitCard/index.ts +4 -0
- package/src/components/index.ts +3 -1
- package/src/internal/MultiLineText/MultiLineText.tsx +25 -0
- package/src/internal/MultiLineText/index.ts +1 -0
- package/src/internal/VideoCardPlayer/VideoCardPlayer.module.css +54 -0
- package/src/internal/VideoCardPlayer/VideoCardPlayer.tsx +62 -0
- package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.module.css +41 -0
- package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.tsx +28 -0
- package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/index.ts +1 -0
- package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.module.css +58 -0
- package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.tsx +38 -0
- package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/index.ts +1 -0
- package/src/internal/VideoCardPlayer/index.ts +2 -0
- package/src/internal/VideoCardPlayer/types/player-props.ts +6 -0
- package/versions.json +1 -1
- package/lib/HeroLink/HeroLink.cjs +0 -35
- package/lib/HeroLink/HeroLink.mjs +0 -33
- package/lib/HeroLink/styles.css +0 -1
- package/lib/_shared/cjs/filter-attrs-BizjMsy0.cjs +0 -27
- package/lib/_shared/esm/Author-HnYsFTPT.mjs +0 -28
- package/lib/_shared/esm/filter-attrs-DZ7RCEZm.mjs +0 -25
- package/src/components/HeroLink/HeroLink.module.css +0 -44
- package/src/components/HeroLink/HeroLink.tsx +0 -136
- package/src/components/HeroLink/index.ts +0 -2
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var mixin = require('./mixin-BFwaXKGB.cjs');
|
|
5
|
+
var hls = require('./hls-Ckhp5fVA.cjs');
|
|
6
|
+
|
|
7
|
+
const HlsVideoMixin = (superclass) => {
|
|
8
|
+
return class HlsVideo extends superclass {
|
|
9
|
+
static shadowRootOptions = { ...superclass.shadowRootOptions };
|
|
10
|
+
static getTemplateHTML = (attrs, props = {}) => {
|
|
11
|
+
const { src, ...rest } = attrs;
|
|
12
|
+
return `
|
|
13
|
+
<script type="application/json" id="config">
|
|
14
|
+
${JSON.stringify(props.config || {})}
|
|
15
|
+
</script>
|
|
16
|
+
${superclass.getTemplateHTML(rest)}
|
|
17
|
+
`;
|
|
18
|
+
};
|
|
19
|
+
#airplaySourceEl = null;
|
|
20
|
+
#config = null;
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.#upgradeProperty("config");
|
|
24
|
+
}
|
|
25
|
+
get config() {
|
|
26
|
+
return this.#config;
|
|
27
|
+
}
|
|
28
|
+
set config(value) {
|
|
29
|
+
this.#config = value;
|
|
30
|
+
}
|
|
31
|
+
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
32
|
+
if (attrName !== "src") {
|
|
33
|
+
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
34
|
+
}
|
|
35
|
+
if (attrName === "src" && oldValue != newValue) {
|
|
36
|
+
this.load();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
#destroy() {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
(_a = this.#airplaySourceEl) == null ? void 0 : _a.remove();
|
|
42
|
+
(_b = this.nativeEl) == null ? void 0 : _b.removeEventListener(
|
|
43
|
+
"webkitcurrentplaybacktargetiswirelesschanged",
|
|
44
|
+
this.#toggleHlsLoad
|
|
45
|
+
);
|
|
46
|
+
if (this.api) {
|
|
47
|
+
this.api.detachMedia();
|
|
48
|
+
this.api.destroy();
|
|
49
|
+
this.api = null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async load() {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
const isFirstLoad = !this.api;
|
|
55
|
+
this.#destroy();
|
|
56
|
+
if (!this.src) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (isFirstLoad && !this.#config) {
|
|
60
|
+
this.#config = JSON.parse(((_a = this.shadowRoot.getElementById("config")) == null ? void 0 : _a.textContent) || "{}");
|
|
61
|
+
}
|
|
62
|
+
if (hls.Hls.isSupported()) {
|
|
63
|
+
await Promise.resolve();
|
|
64
|
+
this.api = new hls.Hls({
|
|
65
|
+
// Mimic the media element with an Infinity duration for live streams.
|
|
66
|
+
liveDurationInfinity: true,
|
|
67
|
+
// Disable auto quality level/fragment loading.
|
|
68
|
+
autoStartLoad: false,
|
|
69
|
+
// Custom configuration for hls.js.
|
|
70
|
+
...this.config
|
|
71
|
+
});
|
|
72
|
+
this.api.loadSource(this.src);
|
|
73
|
+
this.api.attachMedia(this.nativeEl);
|
|
74
|
+
switch (this.nativeEl.preload) {
|
|
75
|
+
case "none": {
|
|
76
|
+
const loadSourceOnPlay = () => this.api.startLoad();
|
|
77
|
+
this.nativeEl.addEventListener("play", loadSourceOnPlay, {
|
|
78
|
+
once: true
|
|
79
|
+
});
|
|
80
|
+
this.api.on(hls.Hls.Events.DESTROYING, () => {
|
|
81
|
+
this.nativeEl.removeEventListener("play", loadSourceOnPlay);
|
|
82
|
+
});
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
case "metadata": {
|
|
86
|
+
const originalLength = this.api.config.maxBufferLength;
|
|
87
|
+
const originalSize = this.api.config.maxBufferSize;
|
|
88
|
+
this.api.config.maxBufferLength = 1;
|
|
89
|
+
this.api.config.maxBufferSize = 1;
|
|
90
|
+
const increaseBufferOnPlay = () => {
|
|
91
|
+
this.api.config.maxBufferLength = originalLength;
|
|
92
|
+
this.api.config.maxBufferSize = originalSize;
|
|
93
|
+
};
|
|
94
|
+
this.nativeEl.addEventListener("play", increaseBufferOnPlay, {
|
|
95
|
+
once: true
|
|
96
|
+
});
|
|
97
|
+
this.api.on(hls.Hls.Events.DESTROYING, () => {
|
|
98
|
+
this.nativeEl.removeEventListener("play", increaseBufferOnPlay);
|
|
99
|
+
});
|
|
100
|
+
this.api.startLoad();
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
default:
|
|
104
|
+
this.api.startLoad();
|
|
105
|
+
}
|
|
106
|
+
if (this.nativeEl.webkitCurrentPlaybackTargetIsWireless) {
|
|
107
|
+
this.api.stopLoad();
|
|
108
|
+
}
|
|
109
|
+
this.nativeEl.addEventListener(
|
|
110
|
+
"webkitcurrentplaybacktargetiswirelesschanged",
|
|
111
|
+
this.#toggleHlsLoad
|
|
112
|
+
);
|
|
113
|
+
this.#airplaySourceEl = document.createElement("source");
|
|
114
|
+
this.#airplaySourceEl.setAttribute("type", "application/x-mpegURL");
|
|
115
|
+
this.#airplaySourceEl.setAttribute("src", this.src);
|
|
116
|
+
this.nativeEl.disableRemotePlayback = false;
|
|
117
|
+
this.nativeEl.append(this.#airplaySourceEl);
|
|
118
|
+
const levelIdMap = /* @__PURE__ */ new WeakMap();
|
|
119
|
+
this.api.on(hls.Hls.Events.MANIFEST_PARSED, (event, data) => {
|
|
120
|
+
if (this.nativeEl.autoplay && this.nativeEl.paused) {
|
|
121
|
+
this.nativeEl.play().catch((err) => {
|
|
122
|
+
console.warn("Autoplay failed:", err);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
removeAllMediaTracks();
|
|
126
|
+
let videoTrack = this.videoTracks.getTrackById("main");
|
|
127
|
+
if (!videoTrack) {
|
|
128
|
+
videoTrack = this.addVideoTrack("main");
|
|
129
|
+
videoTrack.id = "main";
|
|
130
|
+
videoTrack.selected = true;
|
|
131
|
+
}
|
|
132
|
+
for (const [id, level] of data.levels.entries()) {
|
|
133
|
+
const videoRendition = videoTrack.addRendition(
|
|
134
|
+
level.url[0],
|
|
135
|
+
level.width,
|
|
136
|
+
level.height,
|
|
137
|
+
level.videoCodec,
|
|
138
|
+
level.bitrate
|
|
139
|
+
);
|
|
140
|
+
levelIdMap.set(level, `${id}`);
|
|
141
|
+
videoRendition.id = `${id}`;
|
|
142
|
+
}
|
|
143
|
+
for (let [id, a] of data.audioTracks.entries()) {
|
|
144
|
+
const kind = a.default ? "main" : "alternative";
|
|
145
|
+
const audioTrack = this.addAudioTrack(kind, a.name, a.lang);
|
|
146
|
+
audioTrack.id = `${id}`;
|
|
147
|
+
if (a.default) {
|
|
148
|
+
audioTrack.enabled = true;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
this.audioTracks.addEventListener("change", () => {
|
|
153
|
+
var _a2;
|
|
154
|
+
const audioTrackId = +((_a2 = [...this.audioTracks].find((t) => t.enabled)) == null ? void 0 : _a2.id);
|
|
155
|
+
const availableIds = this.api.audioTracks.map((t) => t.id);
|
|
156
|
+
if (audioTrackId != this.api.audioTrack && availableIds.includes(audioTrackId)) {
|
|
157
|
+
this.api.audioTrack = audioTrackId;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
this.api.on(hls.Hls.Events.LEVELS_UPDATED, (event, data) => {
|
|
161
|
+
const videoTrack = this.videoTracks[this.videoTracks.selectedIndex ?? 0];
|
|
162
|
+
if (!videoTrack) return;
|
|
163
|
+
const levelIds = data.levels.map((l) => levelIdMap.get(l));
|
|
164
|
+
for (const rendition of this.videoRenditions) {
|
|
165
|
+
if (rendition.id && !levelIds.includes(rendition.id)) {
|
|
166
|
+
videoTrack.removeRendition(rendition);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
let lastFailedLevel = null;
|
|
171
|
+
this.api.on(hls.Hls.Events.ERROR, (event, data) => {
|
|
172
|
+
if (data.type === hls.Hls.ErrorTypes.NETWORK_ERROR && data.details === hls.Hls.ErrorDetails.FRAG_LOAD_ERROR) {
|
|
173
|
+
lastFailedLevel = data.frag.level;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
this.api.on(hls.Hls.Events.LEVEL_SWITCHED, (event, data) => {
|
|
177
|
+
const newLevel = data.level;
|
|
178
|
+
if (lastFailedLevel !== null && newLevel < lastFailedLevel) {
|
|
179
|
+
console.warn(
|
|
180
|
+
`\u26A0\uFE0F hls.js downgraded quality from level ${lastFailedLevel} to ${newLevel} due to fragment load failure.`
|
|
181
|
+
);
|
|
182
|
+
this.videoRenditions.selectedIndex = newLevel;
|
|
183
|
+
lastFailedLevel = null;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
const switchRendition = (event) => {
|
|
187
|
+
const level = event.target.selectedIndex;
|
|
188
|
+
if (level != this.api.nextLevel) {
|
|
189
|
+
this.api.nextLevel = level;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
(_b = this.videoRenditions) == null ? void 0 : _b.addEventListener("change", switchRendition);
|
|
193
|
+
const removeAllMediaTracks = () => {
|
|
194
|
+
for (const videoTrack of this.videoTracks) {
|
|
195
|
+
this.removeVideoTrack(videoTrack);
|
|
196
|
+
}
|
|
197
|
+
for (const audioTrack of this.audioTracks) {
|
|
198
|
+
this.removeAudioTrack(audioTrack);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
this.api.once(hls.Hls.Events.DESTROYING, removeAllMediaTracks);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
await Promise.resolve();
|
|
205
|
+
if (this.nativeEl.canPlayType("application/vnd.apple.mpegurl")) {
|
|
206
|
+
this.nativeEl.src = this.src;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
#toggleHlsLoad = () => {
|
|
210
|
+
var _a, _b, _c;
|
|
211
|
+
if ((_a = this.nativeEl) == null ? void 0 : _a.webkitCurrentPlaybackTargetIsWireless) {
|
|
212
|
+
(_b = this.api) == null ? void 0 : _b.stopLoad();
|
|
213
|
+
} else {
|
|
214
|
+
(_c = this.api) == null ? void 0 : _c.startLoad();
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
// This is a pattern to update property values that are set before
|
|
218
|
+
// the custom element is upgraded.
|
|
219
|
+
// https://web.dev/custom-elements-best-practices/#make-properties-lazy
|
|
220
|
+
#upgradeProperty(prop) {
|
|
221
|
+
if (Object.prototype.hasOwnProperty.call(this, prop)) {
|
|
222
|
+
const value = this[prop];
|
|
223
|
+
delete this[prop];
|
|
224
|
+
this[prop] = value;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
const HlsVideoElement = HlsVideoMixin(mixin.MediaTracksMixin(mixin.CustomVideoElement));
|
|
230
|
+
if (globalThis.customElements && !globalThis.customElements.get("hls-video")) {
|
|
231
|
+
globalThis.customElements.define("hls-video", HlsVideoElement);
|
|
232
|
+
}
|
|
233
|
+
var hls_video_element_default = HlsVideoElement;
|
|
234
|
+
|
|
235
|
+
// ../../node_modules/ce-la-react/dist/ce-la-react.js
|
|
236
|
+
var reservedReactProps = /* @__PURE__ */ new Set([
|
|
237
|
+
"style",
|
|
238
|
+
"children",
|
|
239
|
+
"ref",
|
|
240
|
+
"key",
|
|
241
|
+
"suppressContentEditableWarning",
|
|
242
|
+
"suppressHydrationWarning",
|
|
243
|
+
"dangerouslySetInnerHTML"
|
|
244
|
+
]);
|
|
245
|
+
var reactPropToAttrNameMap = {
|
|
246
|
+
className: "class",
|
|
247
|
+
htmlFor: "for"
|
|
248
|
+
};
|
|
249
|
+
function defaultToAttributeName(propName) {
|
|
250
|
+
return propName.toLowerCase();
|
|
251
|
+
}
|
|
252
|
+
function defaultToAttributeValue(propValue) {
|
|
253
|
+
if (typeof propValue === "boolean") return propValue ? "" : void 0;
|
|
254
|
+
if (typeof propValue === "function") return void 0;
|
|
255
|
+
if (typeof propValue === "object" && propValue !== null) return void 0;
|
|
256
|
+
return propValue;
|
|
257
|
+
}
|
|
258
|
+
function createComponent({
|
|
259
|
+
react: React2,
|
|
260
|
+
tagName,
|
|
261
|
+
elementClass,
|
|
262
|
+
events,
|
|
263
|
+
displayName,
|
|
264
|
+
defaultProps,
|
|
265
|
+
toAttributeName = defaultToAttributeName,
|
|
266
|
+
toAttributeValue = defaultToAttributeValue
|
|
267
|
+
}) {
|
|
268
|
+
const IS_REACT_19_OR_NEWER = Number.parseInt(React2.version) >= 19;
|
|
269
|
+
const ReactComponent = React2.forwardRef((props, ref) => {
|
|
270
|
+
var _a, _b;
|
|
271
|
+
const elementRef = React2.useRef(null);
|
|
272
|
+
const prevElemPropsRef = React2.useRef(/* @__PURE__ */ new Map());
|
|
273
|
+
const eventProps = {};
|
|
274
|
+
const attrs = {};
|
|
275
|
+
const reactProps = {};
|
|
276
|
+
const elementProps = {};
|
|
277
|
+
for (const [k, v] of Object.entries(props)) {
|
|
278
|
+
if (reservedReactProps.has(k)) {
|
|
279
|
+
reactProps[k] = v;
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
const attrName = toAttributeName(reactPropToAttrNameMap[k] ?? k);
|
|
283
|
+
if (elementClass.prototype && k in elementClass.prototype && !(k in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) && !((_b = elementClass.observedAttributes) == null ? void 0 : _b.some((attr) => attr === attrName))) {
|
|
284
|
+
elementProps[k] = v;
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
if (k.startsWith("on")) {
|
|
288
|
+
eventProps[k] = v;
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
const attrValue = toAttributeValue(v);
|
|
292
|
+
if (attrName && attrValue != null) {
|
|
293
|
+
attrs[attrName] = String(attrValue);
|
|
294
|
+
if (!IS_REACT_19_OR_NEWER) {
|
|
295
|
+
reactProps[attrName] = attrValue;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
if (attrName && IS_REACT_19_OR_NEWER) {
|
|
299
|
+
const attrValueFromDefault = defaultToAttributeValue(v);
|
|
300
|
+
if (attrValue !== attrValueFromDefault) {
|
|
301
|
+
reactProps[attrName] = attrValue;
|
|
302
|
+
} else {
|
|
303
|
+
reactProps[attrName] = v;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (typeof window !== "undefined") {
|
|
308
|
+
for (const propName in eventProps) {
|
|
309
|
+
const callback = eventProps[propName];
|
|
310
|
+
const useCapture = propName.endsWith("Capture");
|
|
311
|
+
const eventName = ((events == null ? void 0 : events[propName]) ?? propName.slice(2).toLowerCase()).slice(
|
|
312
|
+
0,
|
|
313
|
+
useCapture ? -7 : void 0
|
|
314
|
+
);
|
|
315
|
+
React2.useLayoutEffect(() => {
|
|
316
|
+
const eventTarget = elementRef == null ? void 0 : elementRef.current;
|
|
317
|
+
if (!eventTarget || typeof callback !== "function") return;
|
|
318
|
+
eventTarget.addEventListener(eventName, callback, useCapture);
|
|
319
|
+
return () => {
|
|
320
|
+
eventTarget.removeEventListener(eventName, callback, useCapture);
|
|
321
|
+
};
|
|
322
|
+
}, [elementRef == null ? void 0 : elementRef.current, callback]);
|
|
323
|
+
}
|
|
324
|
+
React2.useLayoutEffect(() => {
|
|
325
|
+
if (elementRef.current === null) return;
|
|
326
|
+
const newElemProps = /* @__PURE__ */ new Map();
|
|
327
|
+
for (const key in elementProps) {
|
|
328
|
+
setProperty(elementRef.current, key, elementProps[key]);
|
|
329
|
+
prevElemPropsRef.current.delete(key);
|
|
330
|
+
newElemProps.set(key, elementProps[key]);
|
|
331
|
+
}
|
|
332
|
+
for (const [key, _value] of prevElemPropsRef.current) {
|
|
333
|
+
setProperty(elementRef.current, key, void 0);
|
|
334
|
+
}
|
|
335
|
+
prevElemPropsRef.current = newElemProps;
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
if (typeof window === "undefined" && (elementClass == null ? void 0 : elementClass.getTemplateHTML) && (elementClass == null ? void 0 : elementClass.shadowRootOptions)) {
|
|
339
|
+
const { mode, delegatesFocus } = elementClass.shadowRootOptions;
|
|
340
|
+
const templateShadowRoot = React2.createElement("template", {
|
|
341
|
+
shadowrootmode: mode,
|
|
342
|
+
shadowrootdelegatesfocus: delegatesFocus,
|
|
343
|
+
dangerouslySetInnerHTML: {
|
|
344
|
+
__html: elementClass.getTemplateHTML(attrs, props)
|
|
345
|
+
},
|
|
346
|
+
key: "ce-la-react-ssr-template-shadow-root"
|
|
347
|
+
});
|
|
348
|
+
reactProps.children = [templateShadowRoot, reactProps.children];
|
|
349
|
+
}
|
|
350
|
+
return React2.createElement(tagName, {
|
|
351
|
+
...defaultProps,
|
|
352
|
+
...reactProps,
|
|
353
|
+
ref: React2.useCallback(
|
|
354
|
+
(node) => {
|
|
355
|
+
elementRef.current = node;
|
|
356
|
+
if (typeof ref === "function") {
|
|
357
|
+
ref(node);
|
|
358
|
+
} else if (ref !== null) {
|
|
359
|
+
ref.current = node;
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
[ref]
|
|
363
|
+
)
|
|
364
|
+
}, reactProps.children);
|
|
365
|
+
});
|
|
366
|
+
ReactComponent.displayName = displayName ?? elementClass.name;
|
|
367
|
+
return ReactComponent;
|
|
368
|
+
}
|
|
369
|
+
function setProperty(node, name, value) {
|
|
370
|
+
var _a;
|
|
371
|
+
node[name] = value;
|
|
372
|
+
if (value == null && name in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) {
|
|
373
|
+
node.removeAttribute(name);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// dist/react.ts
|
|
378
|
+
var react_default = createComponent({
|
|
379
|
+
react: React,
|
|
380
|
+
tagName: "hls-video",
|
|
381
|
+
elementClass: hls_video_element_default,
|
|
382
|
+
toAttributeName(propName) {
|
|
383
|
+
if (propName === "muted") return "";
|
|
384
|
+
if (propName === "defaultMuted") return "muted";
|
|
385
|
+
return defaultToAttributeName(propName);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
/*! Bundled license information:
|
|
389
|
+
|
|
390
|
+
ce-la-react/dist/ce-la-react.js:
|
|
391
|
+
(**
|
|
392
|
+
* @license
|
|
393
|
+
* Copyright 2018 Google LLC
|
|
394
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
395
|
+
*
|
|
396
|
+
* Modified version of `@lit/react` for vanilla custom elements with support for SSR.
|
|
397
|
+
*)
|
|
398
|
+
*/
|
|
399
|
+
|
|
400
|
+
exports.default = react_default;
|