@sdxc/ui 2026.11.17 → 2026.11.22
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/README.md +139 -2
- package/dist/app/index.d.ts +1 -0
- package/dist/app/index.js +1 -0
- package/dist/app/mixins/command-palette.js +10 -2
- package/dist/app/mixins/log-viewer.js +17 -14
- package/dist/app/mixins/route-dialog.d.ts +17 -0
- package/dist/app/mixins/route-dialog.js +53 -0
- package/dist/app/optimistic-toggle.js +6 -0
- package/dist/app/route-dialog.d.ts +38 -0
- package/dist/app/route-dialog.js +49 -0
- package/dist/audio/equalizer.d.ts +24 -0
- package/dist/audio/equalizer.js +57 -0
- package/dist/audio/index.d.ts +16 -0
- package/dist/audio/index.js +16 -0
- package/dist/audio/media-tile.d.ts +38 -0
- package/dist/audio/media-tile.js +98 -0
- package/dist/audio/player-bar.d.ts +108 -0
- package/dist/audio/player-bar.js +338 -0
- package/dist/audio/queue-list.d.ts +56 -0
- package/dist/audio/queue-list.js +102 -0
- package/dist/audio/track-list.d.ts +91 -0
- package/dist/audio/track-list.js +226 -0
- package/dist/audio/utils/media-session.d.ts +44 -0
- package/dist/audio/utils/media-session.js +87 -0
- package/dist/audio/utils/play-queue.d.ts +98 -0
- package/dist/audio/utils/play-queue.js +149 -0
- package/dist/audio/utils/track-time.d.ts +28 -0
- package/dist/audio/utils/track-time.js +36 -0
- package/dist/chat/composer-format.d.ts +35 -0
- package/dist/chat/composer-format.js +84 -0
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/index.js +6 -0
- package/dist/chat/mention-menu.d.ts +43 -0
- package/dist/chat/mention-menu.js +70 -0
- package/dist/chat/message-group.d.ts +92 -0
- package/dist/chat/message-group.js +222 -0
- package/dist/chat/mixins/composer-format.d.ts +28 -0
- package/dist/chat/mixins/composer-format.js +80 -0
- package/dist/chat/mixins/composer-send.d.ts +2 -2
- package/dist/chat/mixins/composer-send.js +4 -2
- package/dist/chat/mixins/mention-menu.d.ts +41 -0
- package/dist/chat/mixins/mention-menu.js +213 -0
- package/dist/chat/mixins/reaction-sync.d.ts +47 -0
- package/dist/chat/mixins/reaction-sync.js +172 -0
- package/dist/chat/reaction-bar.d.ts +70 -0
- package/dist/chat/reaction-bar.js +108 -0
- package/dist/chat/typing-indicator.d.ts +42 -0
- package/dist/chat/typing-indicator.js +68 -0
- package/dist/chat/utils/composer-text.d.ts +38 -0
- package/dist/chat/utils/composer-text.js +86 -0
- package/dist/chat/utils/markdown-format.d.ts +30 -0
- package/dist/chat/utils/markdown-format.js +158 -0
- package/dist/chat/utils/mention-query.d.ts +55 -0
- package/dist/chat/utils/mention-query.js +60 -0
- package/dist/commerce/cart-drawer.d.ts +69 -0
- package/dist/commerce/cart-drawer.js +163 -0
- package/dist/commerce/cart-line.d.ts +32 -0
- package/dist/commerce/cart-line.js +43 -0
- package/dist/commerce/checkout-layout.d.ts +32 -0
- package/dist/commerce/checkout-layout.js +51 -0
- package/dist/commerce/facet-filters.d.ts +121 -0
- package/dist/commerce/facet-filters.js +318 -0
- package/dist/commerce/fulfilment-note.d.ts +28 -0
- package/dist/commerce/fulfilment-note.js +26 -0
- package/dist/commerce/index.d.ts +27 -0
- package/dist/commerce/index.js +27 -0
- package/dist/commerce/item-options-dialog.d.ts +67 -0
- package/dist/commerce/item-options-dialog.js +150 -0
- package/dist/commerce/menu-item-card.d.ts +37 -0
- package/dist/commerce/menu-item-card.js +96 -0
- package/dist/commerce/option-group.d.ts +62 -0
- package/dist/commerce/option-group.js +121 -0
- package/dist/commerce/order-summary.d.ts +42 -0
- package/dist/commerce/order-summary.js +76 -0
- package/dist/commerce/order-tracker.d.ts +80 -0
- package/dist/commerce/order-tracker.js +178 -0
- package/dist/commerce/price.d.ts +52 -0
- package/dist/commerce/price.js +108 -0
- package/dist/commerce/product-card.d.ts +53 -0
- package/dist/commerce/product-card.js +127 -0
- package/dist/commerce/product-gallery.d.ts +70 -0
- package/dist/commerce/product-gallery.js +186 -0
- package/dist/commerce/promo-code.d.ts +56 -0
- package/dist/commerce/promo-code.js +101 -0
- package/dist/commerce/quantity-stepper.d.ts +42 -0
- package/dist/commerce/quantity-stepper.js +53 -0
- package/dist/commerce/question-list.d.ts +53 -0
- package/dist/commerce/question-list.js +92 -0
- package/dist/commerce/shipping-estimate.d.ts +53 -0
- package/dist/commerce/shipping-estimate.js +39 -0
- package/dist/commerce/sort-select.d.ts +38 -0
- package/dist/commerce/sort-select.js +38 -0
- package/dist/commerce/variant-picker.d.ts +75 -0
- package/dist/commerce/variant-picker.js +135 -0
- package/dist/components/amount.d.ts +46 -0
- package/dist/components/amount.js +34 -0
- package/dist/components/autocomplete.d.ts +82 -0
- package/dist/components/autocomplete.js +114 -0
- package/dist/components/carousel.d.ts +31 -1
- package/dist/components/carousel.js +66 -3
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.js +11 -0
- package/dist/components/letterbox.d.ts +47 -0
- package/dist/components/letterbox.js +56 -0
- package/dist/components/lightbox.d.ts +88 -0
- package/dist/components/lightbox.js +224 -0
- package/dist/components/media-grid.d.ts +53 -0
- package/dist/components/media-grid.js +89 -0
- package/dist/components/range-months.d.ts +100 -0
- package/dist/components/range-months.js +274 -0
- package/dist/components/rating-input.d.ts +33 -0
- package/dist/components/rating-input.js +63 -0
- package/dist/components/rating.d.ts +38 -0
- package/dist/components/rating.js +66 -0
- package/dist/components/review-card.d.ts +39 -0
- package/dist/components/review-card.js +59 -0
- package/dist/components/section-bar.d.ts +57 -0
- package/dist/components/section-bar.js +140 -0
- package/dist/components/step-indicator.d.ts +46 -0
- package/dist/components/step-indicator.js +96 -0
- package/dist/finance/index.d.ts +10 -0
- package/dist/finance/index.js +10 -0
- package/dist/finance/ledger.d.ts +60 -0
- package/dist/finance/ledger.js +93 -0
- package/dist/finance/payment-card.d.ts +49 -0
- package/dist/finance/payment-card.js +115 -0
- package/dist/map/engine.d.ts +49 -0
- package/dist/map/engine.js +591 -0
- package/dist/map/index.d.ts +12 -0
- package/dist/map/index.js +12 -0
- package/dist/map/map-canvas.d.ts +101 -0
- package/dist/map/map-canvas.js +275 -0
- package/dist/map/map.d.ts +217 -0
- package/dist/map/map.js +598 -0
- package/dist/map/mixins/map-link.d.ts +30 -0
- package/dist/map/mixins/map-link.js +116 -0
- package/dist/map/utils/basemap.d.ts +88 -0
- package/dist/map/utils/basemap.js +84 -0
- package/dist/map/utils/cluster.d.ts +43 -0
- package/dist/map/utils/cluster.js +80 -0
- package/dist/map/utils/mercator.d.ts +66 -0
- package/dist/map/utils/mercator.js +92 -0
- package/dist/map/utils/stage.d.ts +24 -0
- package/dist/map/utils/stage.js +49 -0
- package/dist/mixins/autocomplete.d.ts +28 -0
- package/dist/mixins/autocomplete.js +283 -0
- package/dist/mixins/carousel-controls.d.ts +14 -3
- package/dist/mixins/carousel-controls.js +89 -30
- package/dist/mixins/index.d.ts +2 -0
- package/dist/mixins/index.js +2 -0
- package/dist/mixins/lightbox-controls.d.ts +34 -0
- package/dist/mixins/lightbox-controls.js +176 -0
- package/dist/schedule/agenda.d.ts +63 -0
- package/dist/schedule/agenda.js +221 -0
- package/dist/schedule/day-strip.d.ts +50 -0
- package/dist/schedule/day-strip.js +136 -0
- package/dist/schedule/free-busy.d.ts +96 -0
- package/dist/schedule/free-busy.js +285 -0
- package/dist/schedule/index.d.ts +15 -0
- package/dist/schedule/index.js +15 -0
- package/dist/schedule/mixins/day-strip-scroll.d.ts +16 -0
- package/dist/schedule/mixins/day-strip-scroll.js +40 -0
- package/dist/schedule/mixins/time-grid-drag.d.ts +24 -0
- package/dist/schedule/mixins/time-grid-drag.js +532 -0
- package/dist/schedule/month-view.d.ts +68 -0
- package/dist/schedule/month-view.js +301 -0
- package/dist/schedule/time-grid.d.ts +168 -0
- package/dist/schedule/time-grid.js +417 -0
- package/dist/schedule/utils/time-grid-layout.d.ts +50 -0
- package/dist/schedule/utils/time-grid-layout.js +93 -0
- package/dist/schedule/year-view.d.ts +46 -0
- package/dist/schedule/year-view.js +142 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.js +1 -0
- package/dist/styles/typewriter-text.d.ts +20 -0
- package/dist/styles/typewriter-text.js +23 -0
- package/dist/test/map.d.ts +18 -0
- package/dist/test/map.js +96 -0
- package/dist/test/reels.d.ts +30 -0
- package/dist/test/reels.js +41 -0
- package/dist/test/stories.d.ts +31 -0
- package/dist/test/stories.js +66 -0
- package/dist/travel/boarding-pass.d.ts +107 -0
- package/dist/travel/boarding-pass.js +293 -0
- package/dist/travel/car-offer.d.ts +70 -0
- package/dist/travel/car-offer.js +127 -0
- package/dist/travel/fare-calendar.d.ts +85 -0
- package/dist/travel/fare-calendar.js +233 -0
- package/dist/travel/fare-options.d.ts +84 -0
- package/dist/travel/fare-options.js +142 -0
- package/dist/travel/flight-itinerary.d.ts +84 -0
- package/dist/travel/flight-itinerary.js +112 -0
- package/dist/travel/flight-option.d.ts +58 -0
- package/dist/travel/flight-option.js +111 -0
- package/dist/travel/flight-segment.d.ts +105 -0
- package/dist/travel/flight-segment.js +174 -0
- package/dist/travel/index.d.ts +20 -0
- package/dist/travel/index.js +20 -0
- package/dist/travel/package-savings.d.ts +74 -0
- package/dist/travel/package-savings.js +128 -0
- package/dist/travel/price-breakdown.d.ts +66 -0
- package/dist/travel/price-breakdown.js +102 -0
- package/dist/travel/rating-breakdown.d.ts +81 -0
- package/dist/travel/rating-breakdown.js +132 -0
- package/dist/travel/seat-map.d.ts +108 -0
- package/dist/travel/seat-map.js +371 -0
- package/dist/travel/trip-timeline.d.ts +84 -0
- package/dist/travel/trip-timeline.js +212 -0
- package/dist/utils/gamepad-presses.d.ts +21 -0
- package/dist/utils/gamepad-presses.js +28 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/move-focus.d.ts +20 -0
- package/dist/utils/move-focus.js +28 -0
- package/dist/utils/range-months.d.ts +54 -0
- package/dist/utils/range-months.js +98 -0
- package/dist/utils/swipe-direction.d.ts +23 -0
- package/dist/utils/swipe-direction.js +27 -0
- package/dist/utils/typewriter.d.ts +49 -0
- package/dist/utils/typewriter.js +171 -0
- package/dist/video/index.d.ts +6 -2
- package/dist/video/index.js +6 -2
- package/dist/video/mixins/reel-feed-sync.d.ts +41 -0
- package/dist/video/mixins/reel-feed-sync.js +430 -0
- package/dist/video/mixins/story-viewer-sync.d.ts +31 -0
- package/dist/video/mixins/story-viewer-sync.js +391 -0
- package/dist/video/mixins/video-player-sync.js +138 -5
- package/dist/video/reel-feed.d.ts +95 -0
- package/dist/video/reel-feed.js +124 -0
- package/dist/video/story-ring.d.ts +32 -0
- package/dist/video/story-ring.js +42 -0
- package/dist/video/story-viewer.d.ts +85 -0
- package/dist/video/story-viewer.js +250 -0
- package/dist/video/video-card.d.ts +3 -1
- package/dist/video/video-card.js +15 -5
- package/dist/video/video-player.d.ts +33 -0
- package/dist/video/video-player.js +226 -20
- package/package.json +21 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: advancing when a segment's time runs out, pausing while a finger holds, closing on a
|
|
3
|
+
* downward swipe and moving between people without loading a page all need live input and
|
|
4
|
+
* timing that HTML cannot express.
|
|
5
|
+
* No-JS baseline: each tap zone is a link to the previous or next segment's own address, the
|
|
6
|
+
* progress bar fills once, and the close link leaves.
|
|
7
|
+
*
|
|
8
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
9
|
+
* @copyright Sergio Xalambrí 2026
|
|
10
|
+
*/
|
|
11
|
+
import type { MixinFactory } from "remix/component";
|
|
12
|
+
/** Set on the group on screen, whose current segment's bar runs. */
|
|
13
|
+
export declare const STORY_ACTIVE = "data-story-active";
|
|
14
|
+
/** Set on the viewer while its story is paused, by a held finger, a key or the pause button. */
|
|
15
|
+
export declare const STORY_PAUSED = "data-story-paused";
|
|
16
|
+
/** Set on the viewer once its island runs. */
|
|
17
|
+
export declare const STORY_READY = "data-story-ready";
|
|
18
|
+
/** Dispatched, bubbling, from the viewer whenever another segment comes on screen. */
|
|
19
|
+
export declare const STORY_CHANGE_EVENT = "ui:story-change";
|
|
20
|
+
/** What {@link STORY_CHANGE_EVENT} carries. */
|
|
21
|
+
export interface StoryChangeDetail {
|
|
22
|
+
/** The address of the segment now on screen. */
|
|
23
|
+
href: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Runs the viewer it sits in: plays the open group's current segment and moves on when its bar
|
|
27
|
+
* fills, steps on taps and arrow keys, pauses for a hold, the space bar or the pause button,
|
|
28
|
+
* moves between groups by horizontal snap, and closes on a downward swipe or Escape. Typing in
|
|
29
|
+
* a field inside it, such as a reply, holds the story still until the field loses focus.
|
|
30
|
+
*/
|
|
31
|
+
export declare const storyViewerSync: MixinFactory<HTMLElement>;
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: advancing when a segment's time runs out, pausing while a finger holds, closing on a
|
|
3
|
+
* downward swipe and moving between people without loading a page all need live input and
|
|
4
|
+
* timing that HTML cannot express.
|
|
5
|
+
* No-JS baseline: each tap zone is a link to the previous or next segment's own address, the
|
|
6
|
+
* progress bar fills once, and the close link leaves.
|
|
7
|
+
*
|
|
8
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
9
|
+
* @copyright Sergio Xalambrí 2026
|
|
10
|
+
*/
|
|
11
|
+
import { createMixin } from "remix/component";
|
|
12
|
+
/** Set on the group on screen, whose current segment's bar runs. */
|
|
13
|
+
export const STORY_ACTIVE = "data-story-active";
|
|
14
|
+
/** Set on the viewer while its story is paused, by a held finger, a key or the pause button. */
|
|
15
|
+
export const STORY_PAUSED = "data-story-paused";
|
|
16
|
+
/** Set on the viewer once its island runs. */
|
|
17
|
+
export const STORY_READY = "data-story-ready";
|
|
18
|
+
/** Dispatched, bubbling, from the viewer whenever another segment comes on screen. */
|
|
19
|
+
export const STORY_CHANGE_EVENT = "ui:story-change";
|
|
20
|
+
/** How long a press must last to count as a hold that pauses rather than a tap. */
|
|
21
|
+
const HOLD_MS = 220;
|
|
22
|
+
/** How far a finger must pull the story down for the release to close it. */
|
|
23
|
+
const CLOSE_DISTANCE = 110;
|
|
24
|
+
/** How far a pointer may wander before a press stops counting as a tap. */
|
|
25
|
+
const SLOP = 10;
|
|
26
|
+
/**
|
|
27
|
+
* Runs the viewer it sits in: plays the open group's current segment and moves on when its bar
|
|
28
|
+
* fills, steps on taps and arrow keys, pauses for a hold, the space bar or the pause button,
|
|
29
|
+
* moves between groups by horizontal snap, and closes on a downward swipe or Escape. Typing in
|
|
30
|
+
* a field inside it, such as a reply, holds the story still until the field loses focus.
|
|
31
|
+
*/
|
|
32
|
+
export const storyViewerSync = createMixin((handle) => {
|
|
33
|
+
let controller;
|
|
34
|
+
handle.addEventListener("insert", (event) => {
|
|
35
|
+
controller?.abort();
|
|
36
|
+
let viewer = event.node.closest("[data-slot=story-viewer]");
|
|
37
|
+
let track = viewer?.querySelector("[data-slot=story-viewer-track]");
|
|
38
|
+
if (!viewer || !track)
|
|
39
|
+
return;
|
|
40
|
+
controller = new AbortController();
|
|
41
|
+
wireViewer(viewer, track, controller.signal);
|
|
42
|
+
});
|
|
43
|
+
handle.addEventListener("remove", () => {
|
|
44
|
+
controller?.abort();
|
|
45
|
+
controller = undefined;
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
/** The groups in viewer order. */
|
|
49
|
+
function groupsOf(track) {
|
|
50
|
+
return [...track.querySelectorAll(":scope > [data-slot=story-viewer-group]")];
|
|
51
|
+
}
|
|
52
|
+
/** A group's segments in order. */
|
|
53
|
+
function segmentsOf(group) {
|
|
54
|
+
return [...group.querySelectorAll("[data-slot=story-viewer-segment]")];
|
|
55
|
+
}
|
|
56
|
+
/** A group's progress bars, one per segment. */
|
|
57
|
+
function barsOf(group) {
|
|
58
|
+
return [...group.querySelectorAll("[data-slot=story-viewer-bar]")];
|
|
59
|
+
}
|
|
60
|
+
/** The index of a group's current segment. */
|
|
61
|
+
function currentOf(group) {
|
|
62
|
+
return Math.max(0, segmentsOf(group).findIndex((segment) => segment.hasAttribute("data-current")));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Wires one viewer until `signal` aborts.
|
|
66
|
+
*
|
|
67
|
+
* @param viewer The viewer's root.
|
|
68
|
+
* @param track The horizontal scroller holding one group per screen.
|
|
69
|
+
* @param signal Ends the wiring.
|
|
70
|
+
*/
|
|
71
|
+
function wireViewer(viewer, track, signal) {
|
|
72
|
+
let groups = groupsOf(track);
|
|
73
|
+
let active = Math.max(0, groups.findIndex((group) => group.hasAttribute(STORY_ACTIVE)));
|
|
74
|
+
let close = viewer.querySelector("[data-story-close]");
|
|
75
|
+
let pauseButton = viewer.querySelector("[data-story-pause]");
|
|
76
|
+
let manualPause = false;
|
|
77
|
+
let press = null;
|
|
78
|
+
let holdTimer;
|
|
79
|
+
let swallowClick = false;
|
|
80
|
+
let closing = false;
|
|
81
|
+
let fullScreen = getComputedStyle(viewer).position === "fixed";
|
|
82
|
+
/** Pauses or resumes the bar and any video, keeping the pause button's state in step. */
|
|
83
|
+
function setPaused(paused) {
|
|
84
|
+
viewer.toggleAttribute(STORY_PAUSED, paused);
|
|
85
|
+
pauseButton?.setAttribute("aria-pressed", paused ? "true" : "false");
|
|
86
|
+
syncVideos();
|
|
87
|
+
}
|
|
88
|
+
/** Plays the video of the segment on screen and pauses every other. */
|
|
89
|
+
function syncVideos() {
|
|
90
|
+
let paused = viewer.hasAttribute(STORY_PAUSED);
|
|
91
|
+
groups.forEach((group, index) => {
|
|
92
|
+
let current = currentOf(group);
|
|
93
|
+
segmentsOf(group).forEach((segment, position) => {
|
|
94
|
+
let video = segment.querySelector("video");
|
|
95
|
+
if (video === null)
|
|
96
|
+
return;
|
|
97
|
+
if (index === active && position === current && !paused) {
|
|
98
|
+
video.muted = true;
|
|
99
|
+
video.play().catch(() => undefined);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
video.pause();
|
|
103
|
+
if (position !== current)
|
|
104
|
+
video.currentTime = 0;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/** Shows segment `index` of `group`, filling the bars before it and restarting its own. */
|
|
110
|
+
function show(group, index) {
|
|
111
|
+
let segments = segmentsOf(group);
|
|
112
|
+
let bars = barsOf(group);
|
|
113
|
+
segments.forEach((segment, position) => {
|
|
114
|
+
segment.toggleAttribute("data-current", position === index);
|
|
115
|
+
});
|
|
116
|
+
bars.forEach((bar, position) => {
|
|
117
|
+
bar.toggleAttribute("data-done", position < index);
|
|
118
|
+
bar.removeAttribute("data-current");
|
|
119
|
+
});
|
|
120
|
+
let bar = bars[index];
|
|
121
|
+
if (bar !== undefined) {
|
|
122
|
+
void bar.offsetWidth;
|
|
123
|
+
bar.setAttribute("data-current", "");
|
|
124
|
+
}
|
|
125
|
+
syncZones(group);
|
|
126
|
+
syncVideos();
|
|
127
|
+
let href = segments[index]?.dataset.href;
|
|
128
|
+
if (href === undefined || groups[active] !== group)
|
|
129
|
+
return;
|
|
130
|
+
let url = new URL(href, location.href);
|
|
131
|
+
if (`${url.pathname}${url.search}` !== `${location.pathname}${location.search}`) {
|
|
132
|
+
history.replaceState(history.state, "", href);
|
|
133
|
+
}
|
|
134
|
+
viewer.dispatchEvent(new CustomEvent(STORY_CHANGE_EVENT, { bubbles: true, detail: { href } }));
|
|
135
|
+
}
|
|
136
|
+
/** Points a group's tap zones at the segments around its current one, for a middle-click or no script. */
|
|
137
|
+
function syncZones(group) {
|
|
138
|
+
let index = currentOf(group);
|
|
139
|
+
let position = groups.indexOf(group);
|
|
140
|
+
let segments = segmentsOf(group);
|
|
141
|
+
let previous = segments[index - 1]?.dataset.href ??
|
|
142
|
+
(groups[position - 1] && segmentsOf(groups[position - 1]).at(-1)?.dataset.href) ??
|
|
143
|
+
close?.getAttribute("href");
|
|
144
|
+
let next = segments[index + 1]?.dataset.href ??
|
|
145
|
+
(groups[position + 1] && segmentsOf(groups[position + 1])[0]?.dataset.href) ??
|
|
146
|
+
close?.getAttribute("href");
|
|
147
|
+
let zones = group.querySelectorAll("[data-story-zone]");
|
|
148
|
+
for (let zone of zones) {
|
|
149
|
+
let href = zone.dataset.storyZone === "next" ? next : previous;
|
|
150
|
+
if (href)
|
|
151
|
+
zone.setAttribute("href", href);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** Makes the group at `index` the one on screen and runs its current segment. */
|
|
155
|
+
function activate(index) {
|
|
156
|
+
active = index;
|
|
157
|
+
groups.forEach((group, position) => group.toggleAttribute(STORY_ACTIVE, position === index));
|
|
158
|
+
let group = groups[index];
|
|
159
|
+
if (group !== undefined)
|
|
160
|
+
show(group, currentOf(group));
|
|
161
|
+
}
|
|
162
|
+
/** Scrolls the track to the group at `index`, or closes past either end. */
|
|
163
|
+
function goToGroup(index, segment) {
|
|
164
|
+
let group = groups[index];
|
|
165
|
+
if (group === undefined) {
|
|
166
|
+
leave();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
let segments = segmentsOf(group);
|
|
170
|
+
if (segment === "first")
|
|
171
|
+
show(group, 0);
|
|
172
|
+
if (segment === "last")
|
|
173
|
+
show(group, segments.length - 1);
|
|
174
|
+
track.scrollTo({ left: group.offsetLeft, behavior: scrollBehavior() });
|
|
175
|
+
activate(index);
|
|
176
|
+
}
|
|
177
|
+
/** Moves one segment forward, into the next group after the last. */
|
|
178
|
+
function next() {
|
|
179
|
+
let group = groups[active];
|
|
180
|
+
if (group === undefined)
|
|
181
|
+
return;
|
|
182
|
+
let index = currentOf(group);
|
|
183
|
+
if (index < segmentsOf(group).length - 1)
|
|
184
|
+
show(group, index + 1);
|
|
185
|
+
else
|
|
186
|
+
goToGroup(active + 1, "first");
|
|
187
|
+
}
|
|
188
|
+
/** Moves one segment back, into the previous group before the first. */
|
|
189
|
+
function previous() {
|
|
190
|
+
let group = groups[active];
|
|
191
|
+
if (group === undefined)
|
|
192
|
+
return;
|
|
193
|
+
let index = currentOf(group);
|
|
194
|
+
if (index > 0)
|
|
195
|
+
show(group, index - 1);
|
|
196
|
+
else if (active > 0)
|
|
197
|
+
goToGroup(active - 1, "last");
|
|
198
|
+
else
|
|
199
|
+
show(group, 0);
|
|
200
|
+
}
|
|
201
|
+
/** Leaves the viewer through its close link, so the app's own navigation takes it. */
|
|
202
|
+
function leave() {
|
|
203
|
+
if (closing)
|
|
204
|
+
return;
|
|
205
|
+
closing = true;
|
|
206
|
+
close?.click();
|
|
207
|
+
}
|
|
208
|
+
/** Runs a tap zone's step in place, unless the press was a hold or a swipe. */
|
|
209
|
+
function onClick(event) {
|
|
210
|
+
let zone = event.target instanceof Element
|
|
211
|
+
? event.target.closest("[data-story-zone]")
|
|
212
|
+
: null;
|
|
213
|
+
if (zone === null || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey)
|
|
214
|
+
return;
|
|
215
|
+
event.preventDefault();
|
|
216
|
+
if (swallowClick) {
|
|
217
|
+
swallowClick = false;
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (zone.dataset.storyZone === "next")
|
|
221
|
+
next();
|
|
222
|
+
else
|
|
223
|
+
previous();
|
|
224
|
+
}
|
|
225
|
+
/** Starts timing a press for a hold, and tracking it for a swipe down. */
|
|
226
|
+
function onPointerDown(event) {
|
|
227
|
+
if (!event.isPrimary || event.button !== 0)
|
|
228
|
+
return;
|
|
229
|
+
let card = event.target instanceof Element
|
|
230
|
+
? event.target.closest("[data-slot=story-viewer-card]")
|
|
231
|
+
: null;
|
|
232
|
+
if (card === null || event.target.closest("[data-story-control]"))
|
|
233
|
+
return;
|
|
234
|
+
press = {
|
|
235
|
+
x: event.clientX,
|
|
236
|
+
y: event.clientY,
|
|
237
|
+
id: event.pointerId,
|
|
238
|
+
held: false,
|
|
239
|
+
dragging: false,
|
|
240
|
+
};
|
|
241
|
+
swallowClick = false;
|
|
242
|
+
clearTimeout(holdTimer);
|
|
243
|
+
holdTimer = setTimeout(() => {
|
|
244
|
+
if (press === null || press.dragging)
|
|
245
|
+
return;
|
|
246
|
+
press.held = true;
|
|
247
|
+
setPaused(true);
|
|
248
|
+
}, HOLD_MS);
|
|
249
|
+
}
|
|
250
|
+
/** Follows a downward drag with the card, so the visitor sees the story letting go. */
|
|
251
|
+
function onPointerMove(event) {
|
|
252
|
+
if (press === null || event.pointerId !== press.id)
|
|
253
|
+
return;
|
|
254
|
+
let dx = event.clientX - press.x;
|
|
255
|
+
let dy = event.clientY - press.y;
|
|
256
|
+
if (!press.dragging && dy > SLOP && dy > Math.abs(dx)) {
|
|
257
|
+
press.dragging = true;
|
|
258
|
+
clearTimeout(holdTimer);
|
|
259
|
+
viewer.setAttribute("data-story-dragging", "");
|
|
260
|
+
setPaused(true);
|
|
261
|
+
}
|
|
262
|
+
if (!press.dragging)
|
|
263
|
+
return;
|
|
264
|
+
let pull = Math.max(0, dy);
|
|
265
|
+
viewer.style.setProperty("--ui-story-pull", `${pull}px`);
|
|
266
|
+
viewer.style.setProperty("--ui-story-fade", String(Math.max(0.35, 1 - pull / 600)));
|
|
267
|
+
}
|
|
268
|
+
/** Ends a press: a long enough pull closes, a hold resumes, and either swallows the tap. */
|
|
269
|
+
function onPointerUp(event) {
|
|
270
|
+
if (press === null || event.pointerId !== press.id)
|
|
271
|
+
return;
|
|
272
|
+
clearTimeout(holdTimer);
|
|
273
|
+
let { dragging, held, y } = press;
|
|
274
|
+
press = null;
|
|
275
|
+
if (dragging) {
|
|
276
|
+
swallowClick = true;
|
|
277
|
+
viewer.removeAttribute("data-story-dragging");
|
|
278
|
+
if (event.type === "pointerup" && event.clientY - y >= CLOSE_DISTANCE) {
|
|
279
|
+
leave();
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
viewer.style.removeProperty("--ui-story-pull");
|
|
283
|
+
viewer.style.removeProperty("--ui-story-fade");
|
|
284
|
+
setPaused(manualPause);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
if (held) {
|
|
288
|
+
swallowClick = true;
|
|
289
|
+
setPaused(manualPause);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Steps, pauses and closes from the keyboard, unless the visitor is typing a reply; a viewer
|
|
294
|
+
* shown inside a box on a longer page answers only keys pressed inside it.
|
|
295
|
+
*/
|
|
296
|
+
function onKey(event) {
|
|
297
|
+
if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey)
|
|
298
|
+
return;
|
|
299
|
+
let typing = event.target instanceof Element &&
|
|
300
|
+
event.target.closest("input, textarea, select, [contenteditable]");
|
|
301
|
+
if (typing || !(fullScreen || (event.target instanceof Node && viewer.contains(event.target))))
|
|
302
|
+
return;
|
|
303
|
+
let rtl = getComputedStyle(viewer).direction === "rtl";
|
|
304
|
+
if (event.key === "Escape")
|
|
305
|
+
leave();
|
|
306
|
+
else if (event.key === (rtl ? "ArrowLeft" : "ArrowRight"))
|
|
307
|
+
next();
|
|
308
|
+
else if (event.key === (rtl ? "ArrowRight" : "ArrowLeft"))
|
|
309
|
+
previous();
|
|
310
|
+
else if (event.key === " " || event.key === "k") {
|
|
311
|
+
if (event.target instanceof HTMLButtonElement || event.target instanceof HTMLAnchorElement) {
|
|
312
|
+
if (event.key === " ")
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
manualPause = !viewer.hasAttribute(STORY_PAUSED);
|
|
316
|
+
setPaused(manualPause);
|
|
317
|
+
}
|
|
318
|
+
else
|
|
319
|
+
return;
|
|
320
|
+
event.preventDefault();
|
|
321
|
+
}
|
|
322
|
+
/** Moves on once the bar of the segment on screen fills. */
|
|
323
|
+
function onAnimationEnd(event) {
|
|
324
|
+
let bar = event.target instanceof HTMLElement
|
|
325
|
+
? event.target.closest("[data-slot=story-viewer-bar]")
|
|
326
|
+
: null;
|
|
327
|
+
if (bar === null || !bar.hasAttribute("data-current"))
|
|
328
|
+
return;
|
|
329
|
+
let group = bar.closest("[data-slot=story-viewer-group]");
|
|
330
|
+
if (group === null || groups.indexOf(group) !== active)
|
|
331
|
+
return;
|
|
332
|
+
next();
|
|
333
|
+
}
|
|
334
|
+
let observer = new IntersectionObserver((entries) => {
|
|
335
|
+
for (let entry of entries) {
|
|
336
|
+
if (!entry.isIntersecting || entry.intersectionRatio < 0.6)
|
|
337
|
+
continue;
|
|
338
|
+
let index = groups.indexOf(entry.target);
|
|
339
|
+
if (index !== -1 && index !== active)
|
|
340
|
+
activate(index);
|
|
341
|
+
}
|
|
342
|
+
}, { root: track, threshold: [0.6] });
|
|
343
|
+
let start = groups[active];
|
|
344
|
+
if (start !== undefined && Math.abs(track.scrollLeft - start.offsetLeft) > 1) {
|
|
345
|
+
track.scrollTo({ left: start.offsetLeft, behavior: "instant" });
|
|
346
|
+
}
|
|
347
|
+
for (let group of groups)
|
|
348
|
+
syncZones(group);
|
|
349
|
+
syncVideos();
|
|
350
|
+
for (let group of groups)
|
|
351
|
+
observer.observe(group);
|
|
352
|
+
viewer.setAttribute(STORY_READY, "");
|
|
353
|
+
if (fullScreen && !viewer.contains(document.activeElement))
|
|
354
|
+
viewer.focus({ preventScroll: true });
|
|
355
|
+
viewer.addEventListener("click", onClick, { signal });
|
|
356
|
+
viewer.addEventListener("pointerdown", onPointerDown, { signal });
|
|
357
|
+
viewer.addEventListener("pointermove", onPointerMove, { signal });
|
|
358
|
+
viewer.addEventListener("pointerup", onPointerUp, { signal });
|
|
359
|
+
viewer.addEventListener("pointercancel", onPointerUp, { signal });
|
|
360
|
+
viewer.addEventListener("animationend", onAnimationEnd, { signal });
|
|
361
|
+
viewer.addEventListener("contextmenu", (event) => press?.held && event.preventDefault(), {
|
|
362
|
+
signal,
|
|
363
|
+
});
|
|
364
|
+
viewer.addEventListener("focusin", (event) => {
|
|
365
|
+
if (event.target instanceof Element && event.target.matches("input, textarea"))
|
|
366
|
+
setPaused(true);
|
|
367
|
+
}, { signal });
|
|
368
|
+
viewer.addEventListener("focusout", (event) => {
|
|
369
|
+
if (event.target instanceof Element && event.target.matches("input, textarea"))
|
|
370
|
+
setPaused(manualPause);
|
|
371
|
+
}, { signal });
|
|
372
|
+
pauseButton?.addEventListener("click", () => {
|
|
373
|
+
manualPause = !viewer.hasAttribute(STORY_PAUSED);
|
|
374
|
+
setPaused(manualPause);
|
|
375
|
+
}, { signal });
|
|
376
|
+
document.addEventListener("keydown", onKey, { signal });
|
|
377
|
+
document.addEventListener("visibilitychange", () => setPaused(document.hidden || manualPause), {
|
|
378
|
+
signal,
|
|
379
|
+
});
|
|
380
|
+
signal.addEventListener("abort", () => {
|
|
381
|
+
observer.disconnect();
|
|
382
|
+
clearTimeout(holdTimer);
|
|
383
|
+
viewer.removeAttribute(STORY_READY);
|
|
384
|
+
for (let video of viewer.querySelectorAll("video"))
|
|
385
|
+
video.pause();
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
/** Smooth moves, or instant ones for a visitor who asked for reduced motion. */
|
|
389
|
+
function scrollBehavior() {
|
|
390
|
+
return matchMedia("(prefers-reduced-motion: reduce)").matches ? "instant" : "smooth";
|
|
391
|
+
}
|
|
@@ -10,6 +10,10 @@ import { createMixin } from "remix/component";
|
|
|
10
10
|
import { installMediaSync, markPlaying } from "../../mixins/media-sync.js";
|
|
11
11
|
import { installMenuKeys } from "../../mixins/menu-keys.js";
|
|
12
12
|
import { formatVideoTime, playedShare } from "../utils/timeline.js";
|
|
13
|
+
/** How long the pointer rests on a playing stage before its bar and overlay fade. */
|
|
14
|
+
const IDLE_MS = 2500;
|
|
15
|
+
/** How far the arrow keys move a stage's video, in seconds. */
|
|
16
|
+
const SKIP_SECONDS = 10;
|
|
13
17
|
/** Items the top level of a settings menu walks: its rows, and none inside a submenu. */
|
|
14
18
|
const MENU_ITEMS = '[data-video-item]:not([data-slot="video-player-submenu-panel"] *)';
|
|
15
19
|
/** The playing-order lists a video player marks: its chapter links and transcript lines. */
|
|
@@ -104,15 +108,85 @@ class VideoControls {
|
|
|
104
108
|
root.addEventListener("change", (event) => this.onChange(event), { signal });
|
|
105
109
|
root.addEventListener("input", (event) => this.onInput(event), { signal });
|
|
106
110
|
root.addEventListener("keydown", (event) => this.onKeydown(event), { signal });
|
|
107
|
-
for (let type of [
|
|
111
|
+
for (let type of [
|
|
112
|
+
"play",
|
|
113
|
+
"pause",
|
|
114
|
+
"ended",
|
|
115
|
+
"timeupdate",
|
|
116
|
+
"durationchange",
|
|
117
|
+
"ratechange",
|
|
118
|
+
"volumechange",
|
|
119
|
+
]) {
|
|
108
120
|
video.addEventListener(type, () => this.render(), { signal });
|
|
109
121
|
}
|
|
122
|
+
if (root.dataset.layout === "stage")
|
|
123
|
+
this.installStage();
|
|
110
124
|
document.addEventListener("fullscreenchange", () => this.render(), { signal });
|
|
111
125
|
for (let menu of this.all('[data-slot="video-player-settings"]'))
|
|
112
126
|
this.installMenu(menu);
|
|
113
127
|
this.showCaptions(this.checkedCaptions());
|
|
114
128
|
this.render();
|
|
115
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* A stage's extras: the bar and overlay fade after the pointer rests a moment while the video
|
|
132
|
+
* plays and come back on any movement, press or key, and the page's keys drive the player
|
|
133
|
+
* (Space or K plays and pauses, the arrows skip ten seconds, F is full screen, M mutes).
|
|
134
|
+
*/
|
|
135
|
+
installStage() {
|
|
136
|
+
let { root, signal, video } = this;
|
|
137
|
+
let timer;
|
|
138
|
+
let wake = () => {
|
|
139
|
+
root.removeAttribute("data-idle");
|
|
140
|
+
clearTimeout(timer);
|
|
141
|
+
timer = setTimeout(() => {
|
|
142
|
+
let menuOpen = root.querySelector(":popover-open") !== null;
|
|
143
|
+
if (!video.paused && !menuOpen)
|
|
144
|
+
root.setAttribute("data-idle", "");
|
|
145
|
+
}, IDLE_MS);
|
|
146
|
+
};
|
|
147
|
+
for (let type of ["pointermove", "pointerdown", "focusin", "keydown"]) {
|
|
148
|
+
root.addEventListener(type, wake, { signal, passive: true });
|
|
149
|
+
}
|
|
150
|
+
video.addEventListener("play", wake, { signal });
|
|
151
|
+
video.addEventListener("pause", () => root.removeAttribute("data-idle"), { signal });
|
|
152
|
+
signal.addEventListener("abort", () => {
|
|
153
|
+
clearTimeout(timer);
|
|
154
|
+
root.removeAttribute("data-idle");
|
|
155
|
+
});
|
|
156
|
+
document.addEventListener("keydown", (event) => this.onStageKey(event), { signal });
|
|
157
|
+
}
|
|
158
|
+
/** Plays the page's keys on a stage, leaving every field, menu and modified key alone. */
|
|
159
|
+
onStageKey(event) {
|
|
160
|
+
if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey)
|
|
161
|
+
return;
|
|
162
|
+
let target = event.target instanceof Element ? event.target : null;
|
|
163
|
+
if (target?.closest("input, textarea, select, [contenteditable], [role='menu'], dialog")) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
let key = event.key.toLowerCase();
|
|
167
|
+
let onButton = target?.closest("button, a") !== null && target?.closest("button, a") !== undefined;
|
|
168
|
+
if ((key === " " && !onButton) || key === "k")
|
|
169
|
+
this.togglePlay();
|
|
170
|
+
else if (key === "arrowleft")
|
|
171
|
+
this.skip(-SKIP_SECONDS);
|
|
172
|
+
else if (key === "arrowright")
|
|
173
|
+
this.skip(SKIP_SECONDS);
|
|
174
|
+
else if (key === "f")
|
|
175
|
+
void this.toggleFullscreen();
|
|
176
|
+
else if (key === "m")
|
|
177
|
+
this.video.muted = !this.video.muted;
|
|
178
|
+
else
|
|
179
|
+
return;
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
}
|
|
182
|
+
/** Moves the video by `seconds`, held within its length. */
|
|
183
|
+
skip(seconds) {
|
|
184
|
+
let { video } = this;
|
|
185
|
+
let length = lengthOf(video, this.root.querySelector('[data-slot="video-player-progress"]'));
|
|
186
|
+
video.currentTime = Math.min(Math.max(0, video.currentTime + seconds), length);
|
|
187
|
+
syncVideo(this.root, video.currentTime);
|
|
188
|
+
this.render();
|
|
189
|
+
}
|
|
116
190
|
/** Runs the menu keyboard on each panel, and opens the menu on its top level. */
|
|
117
191
|
installMenu(menu) {
|
|
118
192
|
let { signal } = this;
|
|
@@ -153,6 +227,13 @@ class VideoControls {
|
|
|
153
227
|
input.setAttribute("aria-valuetext", `${formatVideoTime(video.currentTime)} / ${formatVideoTime(length)}`);
|
|
154
228
|
input.style.setProperty("--ui-video-player-progress", `${length > 0 ? (video.currentTime / length) * 100 : 0}%`);
|
|
155
229
|
}
|
|
230
|
+
root.toggleAttribute("data-muted", video.muted);
|
|
231
|
+
for (let button of this.all('[data-video-action="mute"]')) {
|
|
232
|
+
button.setAttribute("aria-pressed", String(video.muted));
|
|
233
|
+
let label = video.muted ? button.dataset.labelUnmute : button.dataset.labelMute;
|
|
234
|
+
if (label)
|
|
235
|
+
button.setAttribute("aria-label", label);
|
|
236
|
+
}
|
|
156
237
|
let screen = root.querySelector('[data-slot="video-player-screen"]');
|
|
157
238
|
let fullscreen = screen !== null && document.fullscreenElement === screen;
|
|
158
239
|
for (let button of this.all('[data-video-action="fullscreen"]')) {
|
|
@@ -191,6 +272,12 @@ class VideoControls {
|
|
|
191
272
|
case "fullscreen":
|
|
192
273
|
void this.toggleFullscreen();
|
|
193
274
|
return;
|
|
275
|
+
case "skip":
|
|
276
|
+
this.skip(Number(button.dataset.seconds ?? "0"));
|
|
277
|
+
return;
|
|
278
|
+
case "mute":
|
|
279
|
+
this.video.muted = !this.video.muted;
|
|
280
|
+
return;
|
|
194
281
|
case "open":
|
|
195
282
|
this.openPanel(button);
|
|
196
283
|
return;
|
|
@@ -374,6 +461,25 @@ class VideoControls {
|
|
|
374
461
|
}
|
|
375
462
|
}
|
|
376
463
|
}
|
|
464
|
+
/** The addresses a video's sources name, in order, which change when it is given a new file. */
|
|
465
|
+
function sourcesOf(video) {
|
|
466
|
+
return [...video.querySelectorAll("source")]
|
|
467
|
+
.map((source) => source.getAttribute("src"))
|
|
468
|
+
.join("|");
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Whether a player was redrawn under its wiring, as a frame reload that reuses the elements
|
|
472
|
+
* does: its video replaced or given new sources, or the native controls back over a hidden bar.
|
|
473
|
+
*/
|
|
474
|
+
function needsRewire(root, wired) {
|
|
475
|
+
let video = root.querySelector("video");
|
|
476
|
+
if (!video)
|
|
477
|
+
return false;
|
|
478
|
+
if (wired?.video !== video || wired.sources !== sourcesOf(video))
|
|
479
|
+
return true;
|
|
480
|
+
let bar = root.querySelector('[data-slot="video-player-controls"]');
|
|
481
|
+
return bar !== null && bar.hidden && video.hasAttribute("controls");
|
|
482
|
+
}
|
|
377
483
|
/**
|
|
378
484
|
* Wires one player until `signal` aborts: time links seek in place, the marks follow the
|
|
379
485
|
* video, and a control bar, when the player has one, replaces the native controls.
|
|
@@ -397,17 +503,44 @@ function wirePlayer(root, video, signal) {
|
|
|
397
503
|
*/
|
|
398
504
|
export const videoPlayerSync = createMixin((handle) => {
|
|
399
505
|
let controller;
|
|
506
|
+
let observer;
|
|
400
507
|
handle.addEventListener("insert", (event) => {
|
|
401
508
|
controller?.abort();
|
|
509
|
+
observer?.disconnect();
|
|
402
510
|
let root = event.node.closest('[data-slot="video-player"]');
|
|
403
|
-
|
|
404
|
-
if (!root || !video)
|
|
511
|
+
if (!root)
|
|
405
512
|
return;
|
|
406
|
-
|
|
407
|
-
|
|
513
|
+
let player = root;
|
|
514
|
+
let wired;
|
|
515
|
+
/** Wires the player's current video, reloading it when its sources changed under it. */
|
|
516
|
+
function wire() {
|
|
517
|
+
controller?.abort();
|
|
518
|
+
let video = player.querySelector("video");
|
|
519
|
+
if (!video)
|
|
520
|
+
return;
|
|
521
|
+
let sources = sourcesOf(video);
|
|
522
|
+
if (wired?.video === video && wired.sources !== sources)
|
|
523
|
+
video.load();
|
|
524
|
+
wired = { video, sources };
|
|
525
|
+
controller = new AbortController();
|
|
526
|
+
wirePlayer(player, video, controller.signal);
|
|
527
|
+
}
|
|
528
|
+
wire();
|
|
529
|
+
observer = new MutationObserver(() => {
|
|
530
|
+
if (needsRewire(player, wired))
|
|
531
|
+
wire();
|
|
532
|
+
});
|
|
533
|
+
observer.observe(player, {
|
|
534
|
+
subtree: true,
|
|
535
|
+
childList: true,
|
|
536
|
+
attributes: true,
|
|
537
|
+
attributeFilter: ["controls", "hidden", "src"],
|
|
538
|
+
});
|
|
408
539
|
});
|
|
409
540
|
handle.addEventListener("remove", () => {
|
|
410
541
|
controller?.abort();
|
|
411
542
|
controller = undefined;
|
|
543
|
+
observer?.disconnect();
|
|
544
|
+
observer = undefined;
|
|
412
545
|
});
|
|
413
546
|
});
|