@mattebox/player-diagnostics 0.3.0 → 0.5.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/README.md +20 -13
- package/dist/cdn/mattebox-player-diagnostics.min.js +1 -124
- package/dist/charts.d.ts.map +1 -1
- package/dist/charts.js +356 -392
- package/dist/charts.js.map +1 -1
- package/dist/dom.d.ts +8 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +15 -0
- package/dist/dom.js.map +1 -0
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +619 -659
- package/dist/element.js.map +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/asyncToGenerator.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/objectSpread2.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/typeof.js +1 -1
- package/dist/es2015/charts.js +2 -1
- package/dist/es2015/dom.js +13 -0
- package/dist/es2015/element.js +4 -3
- package/dist/es2015/style.js +1 -133
- package/dist/es2015/support.js +2 -2
- package/dist/es2015/trace.js +1 -1
- package/dist/format.js +26 -31
- package/dist/format.js.map +1 -1
- package/dist/host.js +28 -30
- package/dist/host.js.map +1 -1
- package/dist/icon.js +43 -39
- package/dist/icon.js.map +1 -1
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/dist/report.js +129 -119
- package/dist/report.js.map +1 -1
- package/dist/sampler.js +187 -199
- package/dist/sampler.js.map +1 -1
- package/dist/style.d.ts +1 -9
- package/dist/style.d.ts.map +1 -1
- package/dist/style.js +4 -132
- package/dist/style.js.map +1 -1
- package/dist/support.js +304 -215
- package/dist/support.js.map +1 -1
- package/dist/trace.js +80 -81
- package/dist/trace.js.map +1 -1
- package/package.json +5 -5
package/dist/sampler.js
CHANGED
|
@@ -1,208 +1,196 @@
|
|
|
1
|
-
import { slimEntry } from
|
|
1
|
+
import { slimEntry } from "./trace.js";
|
|
2
|
+
//#region src/sampler.ts
|
|
2
3
|
/** Twenty minutes at two samples a second. */
|
|
3
4
|
const MAX_SAMPLES = 2400;
|
|
4
5
|
/** Trace entries kept, the engine's own default for a ring. */
|
|
5
6
|
const MAX_HISTORY = 500;
|
|
6
|
-
const RECOVERY = new Set([
|
|
7
|
+
const RECOVERY = /* @__PURE__ */ new Set([
|
|
8
|
+
"nudge",
|
|
9
|
+
"flush",
|
|
10
|
+
"skip",
|
|
11
|
+
"gap-jump"
|
|
12
|
+
]);
|
|
7
13
|
/** A rendition's name for a mark: its height, else its bitrate. */
|
|
8
14
|
function label(r) {
|
|
9
|
-
|
|
15
|
+
return r.height !== void 0 ? `${r.height}p` : `${Math.round(r.bitrate / 1e3)} kbps`;
|
|
10
16
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
get samples() {
|
|
188
|
-
return samples;
|
|
189
|
-
},
|
|
190
|
-
get marks() {
|
|
191
|
-
return marks;
|
|
192
|
-
},
|
|
193
|
-
get history() {
|
|
194
|
-
return history;
|
|
195
|
-
},
|
|
196
|
-
get counters() {
|
|
197
|
-
const current = stallStart === null ? 0 : (performance.now() - stallStart) / 1000;
|
|
198
|
-
return {
|
|
199
|
-
stalls,
|
|
200
|
-
stalledSeconds: stalledTotal + current,
|
|
201
|
-
switches,
|
|
202
|
-
decoded,
|
|
203
|
-
dropped,
|
|
204
|
-
};
|
|
205
|
-
},
|
|
206
|
-
};
|
|
17
|
+
function createSampler() {
|
|
18
|
+
let samples = [];
|
|
19
|
+
let marks = [];
|
|
20
|
+
let history = [];
|
|
21
|
+
/** Entries already taken, so the event and the ring never count one twice. */
|
|
22
|
+
let seen = /* @__PURE__ */ new WeakSet();
|
|
23
|
+
let off = null;
|
|
24
|
+
let last = null;
|
|
25
|
+
let lastT = 0;
|
|
26
|
+
let lastQuality = null;
|
|
27
|
+
let lastPlayingId = null;
|
|
28
|
+
let stallStart = null;
|
|
29
|
+
let stalls = 0;
|
|
30
|
+
let stalledTotal = 0;
|
|
31
|
+
let switches = 0;
|
|
32
|
+
let decoded = 0;
|
|
33
|
+
let dropped = 0;
|
|
34
|
+
function push(mark) {
|
|
35
|
+
marks.push(mark);
|
|
36
|
+
if (marks.length > MAX_SAMPLES * 2) marks.splice(0, marks.length - MAX_SAMPLES * 2);
|
|
37
|
+
}
|
|
38
|
+
/** The trace entries since the last read, oldest first. */
|
|
39
|
+
function fresh(engine) {
|
|
40
|
+
const trace = engine.stats.trace();
|
|
41
|
+
let from = 0;
|
|
42
|
+
if (last !== null) {
|
|
43
|
+
const at = trace.indexOf(last);
|
|
44
|
+
from = at >= 0 ? at + 1 : trace.findIndex((entry) => entry.t > lastT);
|
|
45
|
+
if (from < 0) from = trace.length;
|
|
46
|
+
}
|
|
47
|
+
const tail = trace[trace.length - 1];
|
|
48
|
+
if (tail !== void 0) {
|
|
49
|
+
last = tail;
|
|
50
|
+
lastT = tail.t;
|
|
51
|
+
}
|
|
52
|
+
return trace.slice(from);
|
|
53
|
+
}
|
|
54
|
+
/** One entry in: its marks for the charts, and its slimmed self for the history. */
|
|
55
|
+
function take(entry, video) {
|
|
56
|
+
if (seen.has(entry)) return;
|
|
57
|
+
seen.add(entry);
|
|
58
|
+
history.push(slimEntry(entry));
|
|
59
|
+
if (history.length > MAX_HISTORY) history.splice(0, history.length - MAX_HISTORY);
|
|
60
|
+
{
|
|
61
|
+
const msg = entry.msg;
|
|
62
|
+
if (msg.type === "SEGMENT_LOADED" && msg.trackId !== "manifest" && msg.size > 0) push({
|
|
63
|
+
t: entry.t,
|
|
64
|
+
kind: "segment",
|
|
65
|
+
value: msg.size * 8e3 / Math.max(msg.rtt, 1),
|
|
66
|
+
label: `${msg.trackId} #${msg.seq}`,
|
|
67
|
+
trackId: msg.trackId
|
|
68
|
+
});
|
|
69
|
+
else if (msg.type === "STALLED") push({
|
|
70
|
+
t: entry.t,
|
|
71
|
+
kind: "stall",
|
|
72
|
+
value: msg.at,
|
|
73
|
+
label: `stalled at ${msg.at.toFixed(1)}s`
|
|
74
|
+
});
|
|
75
|
+
else if (msg.type === "SEEKING") push({
|
|
76
|
+
t: entry.t,
|
|
77
|
+
kind: "seek",
|
|
78
|
+
value: msg.to,
|
|
79
|
+
label: `seek to ${msg.to.toFixed(1)}s`
|
|
80
|
+
});
|
|
81
|
+
for (const effect of entry.effects) {
|
|
82
|
+
if (effect.kind !== "emit") continue;
|
|
83
|
+
const name = effect.event.replace("recovery:", "");
|
|
84
|
+
if (RECOVERY.has(name)) push({
|
|
85
|
+
t: entry.t,
|
|
86
|
+
kind: name,
|
|
87
|
+
value: video.currentTime,
|
|
88
|
+
label: `recovery ${name}`
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function reset() {
|
|
94
|
+
samples = [];
|
|
95
|
+
marks = [];
|
|
96
|
+
history = [];
|
|
97
|
+
seen = /* @__PURE__ */ new WeakSet();
|
|
98
|
+
last = null;
|
|
99
|
+
lastT = 0;
|
|
100
|
+
lastQuality = null;
|
|
101
|
+
lastPlayingId = null;
|
|
102
|
+
stallStart = null;
|
|
103
|
+
stalls = 0;
|
|
104
|
+
stalledTotal = 0;
|
|
105
|
+
switches = 0;
|
|
106
|
+
decoded = 0;
|
|
107
|
+
dropped = 0;
|
|
108
|
+
}
|
|
109
|
+
function release() {
|
|
110
|
+
off?.();
|
|
111
|
+
off = null;
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
attach(video, engine) {
|
|
115
|
+
release();
|
|
116
|
+
reset();
|
|
117
|
+
if (engine === null) return;
|
|
118
|
+
off = engine.on("trace", (entry) => {
|
|
119
|
+
take(entry, video);
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
release,
|
|
123
|
+
poll(video, engine) {
|
|
124
|
+
const now = performance.now();
|
|
125
|
+
if (engine !== null) for (const entry of fresh(engine)) take(entry, video);
|
|
126
|
+
const state = engine?.stats.snapshot() ?? null;
|
|
127
|
+
const playing = engine?.quality.playing ?? null;
|
|
128
|
+
const quality = video.getVideoPlaybackQuality?.();
|
|
129
|
+
decoded = quality?.totalVideoFrames ?? 0;
|
|
130
|
+
dropped = quality?.droppedVideoFrames ?? 0;
|
|
131
|
+
const droppedDelta = lastQuality === null ? 0 : Math.max(0, dropped - lastQuality.dropped);
|
|
132
|
+
const decodedDelta = lastQuality === null ? 0 : Math.max(0, decoded - lastQuality.decoded);
|
|
133
|
+
lastQuality = {
|
|
134
|
+
dropped,
|
|
135
|
+
decoded
|
|
136
|
+
};
|
|
137
|
+
let ahead = 0;
|
|
138
|
+
for (let i = 0; i < video.buffered.length; i += 1) if (video.buffered.start(i) <= video.currentTime + .25 && video.buffered.end(i) > video.currentTime) ahead = video.buffered.end(i) - video.currentTime;
|
|
139
|
+
const stalled = !video.paused && !video.ended && !video.seeking && video.readyState < 3 && video.currentTime > 0;
|
|
140
|
+
if (stalled && stallStart === null) {
|
|
141
|
+
stallStart = now;
|
|
142
|
+
stalls += 1;
|
|
143
|
+
} else if (!stalled && stallStart !== null) {
|
|
144
|
+
stalledTotal += (now - stallStart) / 1e3;
|
|
145
|
+
stallStart = null;
|
|
146
|
+
}
|
|
147
|
+
if (playing !== null && lastPlayingId !== null && playing.id !== lastPlayingId) {
|
|
148
|
+
switches += 1;
|
|
149
|
+
push({
|
|
150
|
+
t: now,
|
|
151
|
+
kind: "switch",
|
|
152
|
+
value: playing.height ?? playing.bitrate,
|
|
153
|
+
label: `now ${label(playing)}`
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (playing !== null) lastPlayingId = playing.id;
|
|
157
|
+
samples.push({
|
|
158
|
+
t: now,
|
|
159
|
+
currentTime: video.currentTime,
|
|
160
|
+
slow: state?.stats.throughputEwma ?? 0,
|
|
161
|
+
fast: state?.stats.throughputFastEwma ?? 0,
|
|
162
|
+
ahead,
|
|
163
|
+
stalled,
|
|
164
|
+
dropped: droppedDelta,
|
|
165
|
+
decoded: decodedDelta,
|
|
166
|
+
playingId: playing?.id ?? null,
|
|
167
|
+
playingBitrate: playing?.bitrate ?? 0,
|
|
168
|
+
playingHeight: playing?.height ?? 0
|
|
169
|
+
});
|
|
170
|
+
if (samples.length > MAX_SAMPLES) samples.splice(0, samples.length - MAX_SAMPLES);
|
|
171
|
+
},
|
|
172
|
+
get samples() {
|
|
173
|
+
return samples;
|
|
174
|
+
},
|
|
175
|
+
get marks() {
|
|
176
|
+
return marks;
|
|
177
|
+
},
|
|
178
|
+
get history() {
|
|
179
|
+
return history;
|
|
180
|
+
},
|
|
181
|
+
get counters() {
|
|
182
|
+
const current = stallStart === null ? 0 : (performance.now() - stallStart) / 1e3;
|
|
183
|
+
return {
|
|
184
|
+
stalls,
|
|
185
|
+
stalledSeconds: stalledTotal + current,
|
|
186
|
+
switches,
|
|
187
|
+
decoded,
|
|
188
|
+
dropped
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
};
|
|
207
192
|
}
|
|
193
|
+
//#endregion
|
|
194
|
+
export { createSampler };
|
|
195
|
+
|
|
208
196
|
//# sourceMappingURL=sampler.js.map
|
package/dist/sampler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sampler.js","sourceRoot":"","sources":["../src/sampler.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA6DvC,8CAA8C;AAC9C,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,+DAA+D;AAC/D,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,MAAM,QAAQ,GAAwB,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAEtF,mEAAmE;AACnE,SAAS,KAAK,CAAC,CAAY;IACzB,OAAO,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,G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AC,CAAC;QACpF,CAAC;QAED,IAAI,OAAO;YACT,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,IAAI,KAAK;YACP,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,OAAO;YACT,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,IAAI,QAAQ;YACV,MAAM,OAAO,GAAG,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC;YAClF,OAAO;gBACL,MAAM;gBACN,cAAc,EAAE,YAAY,GAAG,OAAO;gBACtC,QAAQ;gBACR,OAAO;gBACP,OAAO;aACR,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"sampler.js","names":[],"sources":["../src/sampler.ts"],"sourcesContent":["/**\n * The sampler: what the charts, the counters and the report are drawn\n * from, taken every half second while the element is attached, so a stall\n * counted before the panel opened is still counted. It reads the way the\n * engine's playground reads: the kernel state through\n * `engine.stats.snapshot()`, the rendition playing through\n * `engine.quality.playing`, the trace for the segments, the stalls, the\n * seeks and what recovery did, and the video itself for the buffer ahead,\n * the frames and whether it is stalled. The engine emits no event for a\n * quality switch, so the switch is a poll's diff.\n *\n * The trace arrives as `trace` events where the engine emits them, one\n * entry at a time, and the sampler keeps its own history of them, slimmed\n * and bounded, which is what the report sends. An engine without the\n * event keeps a ring instead, and the sampler reads it through a cursor\n * that remembers the last entry seen by identity and, once the ring has\n * evicted it, by its clock. Both routes feed the same intake, and an\n * entry seen once is not taken twice.\n */\nimport type { Mattebox, Rendition, TraceEntry } from 'mattebox';\nimport { slimEntry } from './trace.js';\n\nexport interface Sample {\n /** performance.now() */\n readonly t: number;\n readonly currentTime: number;\n /** The slow and the fast throughput estimates, bits per second. */\n readonly slow: number;\n readonly fast: number;\n /** Seconds buffered ahead of the playhead. */\n readonly ahead: number;\n readonly stalled: boolean;\n /** Frames dropped and decoded since the last sample. */\n readonly dropped: number;\n readonly decoded: number;\n readonly playingId: string | null;\n readonly playingBitrate: number;\n readonly playingHeight: number;\n}\n\nexport type MarkKind =\n | 'segment'\n | 'stall'\n | 'seek'\n | 'nudge'\n | 'flush'\n | 'skip'\n | 'gap-jump'\n | 'switch';\n\nexport interface Mark {\n readonly t: number;\n readonly kind: MarkKind;\n readonly value: number;\n readonly label: string;\n readonly trackId?: string;\n}\n\nexport interface Counters {\n readonly stalls: number;\n /** Seconds spent stalled, the current stall included. */\n readonly stalledSeconds: number;\n readonly switches: number;\n /** The video's own totals for the session. */\n readonly decoded: number;\n readonly dropped: number;\n}\n\nexport interface Sampler {\n /** Forgets everything and follows a session's trace: a new session starts its counts at zero. */\n attach(video: HTMLVideoElement, engine: Mattebox | null): void;\n /** Lets go of the session's trace. */\n release(): void;\n poll(video: HTMLVideoElement, engine: Mattebox | null): void;\n readonly samples: readonly Sample[];\n readonly marks: readonly Mark[];\n readonly counters: Counters;\n /** The trace entries kept, slimmed and plain, oldest first. */\n readonly history: readonly unknown[];\n}\n\n/** Twenty minutes at two samples a second. */\nconst MAX_SAMPLES = 2400;\n/** Trace entries kept, the engine's own default for a ring. */\nconst MAX_HISTORY = 500;\n\nconst RECOVERY: ReadonlySet<string> = new Set(['nudge', 'flush', 'skip', 'gap-jump']);\n\n/** A rendition's name for a mark: its height, else its bitrate. */\nfunction label(r: Rendition): string {\n return r.height !== undefined ? `${r.height}p` : `${Math.round(r.bitrate / 1000)} kbps`;\n}\n\nexport function createSampler(): Sampler {\n let samples: Sample[] = [];\n let marks: Mark[] = [];\n let history: unknown[] = [];\n /** Entries already taken, so the event and the ring never count one twice. */\n let seen = new WeakSet<TraceEntry>();\n let off: (() => void) | null = null;\n let last: TraceEntry | null = null;\n let lastT = 0;\n let lastQuality: { dropped: number; decoded: number } | null = null;\n let lastPlayingId: string | null = null;\n let stallStart: number | null = null;\n let stalls = 0;\n let stalledTotal = 0;\n let switches = 0;\n let decoded = 0;\n let dropped = 0;\n\n function push(mark: Mark): void {\n marks.push(mark);\n if (marks.length > MAX_SAMPLES * 2) marks.splice(0, marks.length - MAX_SAMPLES * 2);\n }\n\n /** The trace entries since the last read, oldest first. */\n function fresh(engine: Mattebox): readonly TraceEntry[] {\n const trace = engine.stats.trace();\n let from = 0;\n if (last !== null) {\n const at = trace.indexOf(last);\n from = at >= 0 ? at + 1 : trace.findIndex((entry) => entry.t > lastT);\n if (from < 0) from = trace.length;\n }\n const tail = trace[trace.length - 1];\n if (tail !== undefined) {\n last = tail;\n lastT = tail.t;\n }\n return trace.slice(from);\n }\n\n /** One entry in: its marks for the charts, and its slimmed self for the history. */\n function take(entry: TraceEntry, video: HTMLVideoElement): void {\n if (seen.has(entry)) return;\n seen.add(entry);\n history.push(slimEntry(entry));\n if (history.length > MAX_HISTORY) history.splice(0, history.length - MAX_HISTORY);\n {\n const msg = entry.msg;\n if (msg.type === 'SEGMENT_LOADED' && msg.trackId !== 'manifest' && msg.size > 0) {\n push({\n t: entry.t,\n kind: 'segment',\n value: (msg.size * 8000) / Math.max(msg.rtt, 1),\n label: `${msg.trackId} #${msg.seq}`,\n trackId: msg.trackId,\n });\n } else if (msg.type === 'STALLED') {\n push({\n t: entry.t,\n kind: 'stall',\n value: msg.at,\n label: `stalled at ${msg.at.toFixed(1)}s`,\n });\n } else if (msg.type === 'SEEKING') {\n push({ t: entry.t, kind: 'seek', value: msg.to, label: `seek to ${msg.to.toFixed(1)}s` });\n }\n for (const effect of entry.effects) {\n if (effect.kind !== 'emit') continue;\n const name = effect.event.replace('recovery:', '');\n if (RECOVERY.has(name)) {\n push({\n t: entry.t,\n kind: name as MarkKind,\n value: video.currentTime,\n label: `recovery ${name}`,\n });\n }\n }\n }\n }\n\n function reset(): void {\n samples = [];\n marks = [];\n history = [];\n seen = new WeakSet();\n last = null;\n lastT = 0;\n lastQuality = null;\n lastPlayingId = null;\n stallStart = null;\n stalls = 0;\n stalledTotal = 0;\n switches = 0;\n decoded = 0;\n dropped = 0;\n }\n\n function release(): void {\n off?.();\n off = null;\n }\n\n return {\n attach(video, engine): void {\n release();\n reset();\n if (engine === null) return;\n off = engine.on('trace', (entry) => {\n take(entry as TraceEntry, video);\n });\n },\n\n release,\n\n poll(video, engine): void {\n const now = performance.now();\n // The ring, for an engine that keeps one and emits nothing.\n if (engine !== null) for (const entry of fresh(engine)) take(entry, video);\n const state = engine?.stats.snapshot() ?? null;\n const playing = engine?.quality.playing ?? null;\n\n const quality = video.getVideoPlaybackQuality?.();\n decoded = quality?.totalVideoFrames ?? 0;\n dropped = quality?.droppedVideoFrames ?? 0;\n const droppedDelta = lastQuality === null ? 0 : Math.max(0, dropped - lastQuality.dropped);\n const decodedDelta = lastQuality === null ? 0 : Math.max(0, decoded - lastQuality.decoded);\n lastQuality = { dropped, decoded };\n\n let ahead = 0;\n for (let i = 0; i < video.buffered.length; i += 1) {\n if (\n video.buffered.start(i) <= video.currentTime + 0.25 &&\n video.buffered.end(i) > video.currentTime\n ) {\n ahead = video.buffered.end(i) - video.currentTime;\n }\n }\n\n const stalled =\n !video.paused &&\n !video.ended &&\n !video.seeking &&\n video.readyState < 3 &&\n video.currentTime > 0;\n if (stalled && stallStart === null) {\n stallStart = now;\n stalls += 1;\n } else if (!stalled && stallStart !== null) {\n stalledTotal += (now - stallStart) / 1000;\n stallStart = null;\n }\n\n if (playing !== null && lastPlayingId !== null && playing.id !== lastPlayingId) {\n switches += 1;\n push({\n t: now,\n kind: 'switch',\n value: playing.height ?? playing.bitrate,\n label: `now ${label(playing)}`,\n });\n }\n if (playing !== null) lastPlayingId = playing.id;\n\n samples.push({\n t: now,\n currentTime: video.currentTime,\n slow: state?.stats.throughputEwma ?? 0,\n fast: state?.stats.throughputFastEwma ?? 0,\n ahead,\n stalled,\n dropped: droppedDelta,\n decoded: decodedDelta,\n playingId: playing?.id ?? null,\n playingBitrate: playing?.bitrate ?? 0,\n playingHeight: playing?.height ?? 0,\n });\n if (samples.length > MAX_SAMPLES) samples.splice(0, samples.length - MAX_SAMPLES);\n },\n\n get samples(): readonly Sample[] {\n return samples;\n },\n\n get marks(): readonly Mark[] {\n return marks;\n },\n\n get history(): readonly unknown[] {\n return history;\n },\n\n get counters(): Counters {\n const current = stallStart === null ? 0 : (performance.now() - stallStart) / 1000;\n return {\n stalls,\n stalledSeconds: stalledTotal + current,\n switches,\n decoded,\n dropped,\n };\n },\n };\n}\n"],"mappings":";;;AAkFA,MAAM,cAAc;;AAEpB,MAAM,cAAc;AAEpB,MAAM,2BAAgC,IAAI,IAAI;CAAC;CAAS;CAAS;CAAQ;AAAU,CAAC;;AAGpF,SAAS,MAAM,GAAsB;CACnC,OAAO,EAAE,WAAW,KAAA,IAAY,GAAG,EAAE,OAAO,KAAK,GAAG,KAAK,MAAM,EAAE,UAAU,GAAI,EAAE;AACnF;AAEA,SAAgB,gBAAyB;CACvC,IAAI,UAAoB,CAAC;CACzB,IAAI,QAAgB,CAAC;CACrB,IAAI,UAAqB,CAAC;;CAE1B,IAAI,uBAAO,IAAI,QAAoB;CACnC,IAAI,MAA2B;CAC/B,IAAI,OAA0B;CAC9B,IAAI,QAAQ;CACZ,IAAI,cAA2D;CAC/D,IAAI,gBAA+B;CACnC,IAAI,aAA4B;CAChC,IAAI,SAAS;CACb,IAAI,eAAe;CACnB,IAAI,WAAW;CACf,IAAI,UAAU;CACd,IAAI,UAAU;CAEd,SAAS,KAAK,MAAkB;EAC9B,MAAM,KAAK,IAAI;EACf,IAAI,MAAM,SAAS,cAAc,GAAG,MAAM,OAAO,GAAG,MAAM,SAAS,cAAc,CAAC;CACpF;;CAGA,SAAS,MAAM,QAAyC;EACtD,MAAM,QAAQ,OAAO,MAAM,MAAM;EACjC,IAAI,OAAO;EACX,IAAI,SAAS,MAAM;GACjB,MAAM,KAAK,MAAM,QAAQ,IAAI;GAC7B,OAAO,MAAM,IAAI,KAAK,IAAI,MAAM,WAAW,UAAU,MAAM,IAAI,KAAK;GACpE,IAAI,OAAO,GAAG,OAAO,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IAAI,CAAC,WAAW,eAAe,MAAM;IAC1C,iBAAiB,MAAM,cAAc;IACrC,aAAa;GACf;GAEA,IAAI,YAAY,QAAQ,kBAAkB,QAAQ,QAAQ,OAAO,eAAe;IAC9E,YAAY;IACZ,KAAK;KACH,GAAG;KACH,MAAM;KACN,OAAO,QAAQ,UAAU,QAAQ;KACjC,OAAO,OAAO,MAAM,OAAO;IAC7B,CAAC;GACH;GACA,IAAI,YAAY,MAAM,gBAAgB,QAAQ;GAE9C,QAAQ,KAAK;IACX,GAAG;IACH,aAAa,MAAM;IACnB,MAAM,OAAO,MAAM,kBAAkB;IACrC,MAAM,OAAO,MAAM,sBAAsB;IACzC;IACA;IACA,SAAS;IACT,SAAS;IACT,WAAW,SAAS,MAAM;IAC1B,gBAAgB,SAAS,WAAW;IACpC,eAAe,SAAS,UAAU;GACpC,CAAC;GACD,IAAI,QAAQ,SAAS,aAAa,QAAQ,OAAO,GAAG,QAAQ,SAAS,WAAW;EAClF;EAEA,IAAI,UAA6B;GAC/B,OAAO;EACT;EAEA,IAAI,QAAyB;GAC3B,OAAO;EACT;EAEA,IAAI,UAA8B;GAChC,OAAO;EACT;EAEA,IAAI,WAAqB;GACvB,MAAM,UAAU,eAAe,OAAO,KAAK,YAAY,IAAI,IAAI,cAAc;GAC7E,OAAO;IACL;IACA,gBAAgB,eAAe;IAC/B;IACA;IACA;GACF;EACF;CACF;AACF"}
|
package/dist/style.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* The element's stylesheet. The button is drawn the way the player's own
|
|
3
|
-
* buttons are, in a copy: the player's styles are internal, and a control
|
|
4
|
-
* of the page's own carries its own sheet. Tokens come through the
|
|
5
|
-
* `--mbx-*` custom properties the player sets, which inherit through light
|
|
6
|
-
* DOM; the chart colours have defaults here and a page overrides them the
|
|
7
|
-
* same way. Nothing carries `!important`, so a page's `::part()` rule wins.
|
|
8
|
-
*/
|
|
9
|
-
export declare const STYLE = "\n:host {\n display: inline-flex;\n position: relative;\n --mbx-chart-1: #5aa9e0;\n --mbx-chart-2: #6fbf8f;\n --mbx-chart-3: #d9a83f;\n --mbx-chart-4: #e05a6e;\n --mbx-chart-5: #a98fe0;\n}\n:host([hidden]) { display: none; }\n:host([inline]) { display: block; }\n[part~=\"button\"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n width: 40px;\n height: 40px;\n padding: 0;\n font: inherit;\n color: inherit;\n background: transparent;\n border: 0;\n border-radius: var(--mbx-radius);\n cursor: pointer;\n opacity: 0.9;\n}\n[part~=\"button\"]:hover { opacity: 1; }\n[part~=\"button\"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }\n[part~=\"icon\"], ::slotted(*) { width: 1.75em; height: 1.75em; fill: currentColor; }\n:host([inline]) [part~=\"button\"] { display: none; }\n[part~=\"panel\"] {\n position: absolute;\n right: 0;\n bottom: 100%;\n box-sizing: border-box;\n width: 560px;\n margin-bottom: 8px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n color: var(--mbx-text, #f2f3f5);\n background: rgba(16, 17, 20, 0.95);\n border-radius: var(--mbx-radius, 4px);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);\n font: 400 12px/1.5 var(--mbx-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);\n text-align: left;\n white-space: normal;\n}\n[part~=\"panel\"][hidden] { display: none; }\n:host([inline]) [part~=\"panel\"] {\n position: static;\n width: auto;\n max-height: none;\n margin: 0;\n box-shadow: none;\n border-radius: 0;\n}\n[part~=\"head\"] {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 6px 8px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.12);\n}\n[part~=\"tab\"], [part~=\"chart-tab\"] {\n font: inherit;\n color: var(--mbx-muted, #9aa0a6);\n background: transparent;\n border: 0;\n border-radius: var(--mbx-radius, 4px);\n padding: 3px 8px;\n cursor: pointer;\n}\n[part~=\"tab\"][aria-selected=\"true\"], [part~=\"chart-tab\"][aria-selected=\"true\"] {\n color: var(--mbx-text, #f2f3f5);\n background: rgba(255, 255, 255, 0.12);\n}\n[part~=\"copy\"], [part~=\"close\"], [part~=\"window\"] {\n font: inherit;\n color: inherit;\n background: transparent;\n border: 1px solid rgba(255, 255, 255, 0.25);\n border-radius: var(--mbx-radius, 4px);\n padding: 2px 8px;\n cursor: pointer;\n}\n[part~=\"copy\"] { margin-left: auto; }\n[part~=\"window\"] { margin-left: auto; }\n[part~=\"window\"] option { color: #000; }\n[part~=\"tab\"]:focus-visible, [part~=\"chart-tab\"]:focus-visible, [part~=\"copy\"]:focus-visible,\n[part~=\"close\"]:focus-visible, [part~=\"window\"]:focus-visible {\n outline: 2px solid var(--mbx-accent, #5b8cff);\n outline-offset: -2px;\n}\n[part~=\"body\"] { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 8px; }\n[part~=\"page\"][hidden] { display: none; }\n[part~=\"rows\"] { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }\n[part~=\"key\"] { color: var(--mbx-muted, #9aa0a6); white-space: nowrap; }\n[part~=\"value\"] { margin: 0; overflow-wrap: anywhere; }\n[part~=\"heading\"] {\n margin: 10px 0 4px;\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--mbx-muted, #9aa0a6);\n}\n[part~=\"heading\"]:first-child { margin-top: 0; }\n[part~=\"note\"] { margin: 0; color: var(--mbx-muted, #9aa0a6); }\n[part~=\"chart-tabs\"] { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 6px; }\n[part~=\"chart\"] { display: block; width: 100%; height: 160px; }\n[part~=\"legend\"] { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--mbx-muted, #9aa0a6); }\n[part~=\"swatch\"] { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: middle; }\n[part~=\"readout\"] { margin-top: 4px; }\n[part~=\"table\"] { width: 100%; border-collapse: collapse; margin-bottom: 4px; }\n[part~=\"cell\"] { padding: 2px 6px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; font-weight: 400; }\n[part~=\"label\"] { color: var(--mbx-muted, #9aa0a6); }\n[part~=\"ok\"] { color: var(--mbx-chart-2); }\n[part~=\"bad\"] { color: var(--mbx-chart-4); }\n[part~=\"na\"] { color: var(--mbx-muted, #9aa0a6); }\n[part~=\"ok\"], [part~=\"bad\"], [part~=\"na\"], [part~=\"maybe\"] { font-weight: 600; }\n";
|
|
1
|
+
export declare const STYLE: string;
|
|
10
2
|
//# sourceMappingURL=style.d.ts.map
|
package/dist/style.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,KAAK,QAAY,CAAC"}
|
package/dist/style.js
CHANGED
|
@@ -1,133 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* `--mbx-*` custom properties the player sets, which inherit through light
|
|
6
|
-
* DOM; the chart colours have defaults here and a page overrides them the
|
|
7
|
-
* same way. Nothing carries `!important`, so a page's `::part()` rule wins.
|
|
8
|
-
*/
|
|
9
|
-
export const STYLE = `
|
|
10
|
-
:host {
|
|
11
|
-
display: inline-flex;
|
|
12
|
-
position: relative;
|
|
13
|
-
--mbx-chart-1: #5aa9e0;
|
|
14
|
-
--mbx-chart-2: #6fbf8f;
|
|
15
|
-
--mbx-chart-3: #d9a83f;
|
|
16
|
-
--mbx-chart-4: #e05a6e;
|
|
17
|
-
--mbx-chart-5: #a98fe0;
|
|
18
|
-
}
|
|
19
|
-
:host([hidden]) { display: none; }
|
|
20
|
-
:host([inline]) { display: block; }
|
|
21
|
-
[part~="button"] {
|
|
22
|
-
display: inline-flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
flex: none;
|
|
26
|
-
width: 40px;
|
|
27
|
-
height: 40px;
|
|
28
|
-
padding: 0;
|
|
29
|
-
font: inherit;
|
|
30
|
-
color: inherit;
|
|
31
|
-
background: transparent;
|
|
32
|
-
border: 0;
|
|
33
|
-
border-radius: var(--mbx-radius);
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
opacity: 0.9;
|
|
36
|
-
}
|
|
37
|
-
[part~="button"]:hover { opacity: 1; }
|
|
38
|
-
[part~="button"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
|
|
39
|
-
[part~="icon"], ::slotted(*) { width: 1.75em; height: 1.75em; fill: currentColor; }
|
|
40
|
-
:host([inline]) [part~="button"] { display: none; }
|
|
41
|
-
[part~="panel"] {
|
|
42
|
-
position: absolute;
|
|
43
|
-
right: 0;
|
|
44
|
-
bottom: 100%;
|
|
45
|
-
box-sizing: border-box;
|
|
46
|
-
width: 560px;
|
|
47
|
-
margin-bottom: 8px;
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
color: var(--mbx-text, #f2f3f5);
|
|
52
|
-
background: rgba(16, 17, 20, 0.95);
|
|
53
|
-
border-radius: var(--mbx-radius, 4px);
|
|
54
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
|
|
55
|
-
font: 400 12px/1.5 var(--mbx-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
56
|
-
text-align: left;
|
|
57
|
-
white-space: normal;
|
|
58
|
-
}
|
|
59
|
-
[part~="panel"][hidden] { display: none; }
|
|
60
|
-
:host([inline]) [part~="panel"] {
|
|
61
|
-
position: static;
|
|
62
|
-
width: auto;
|
|
63
|
-
max-height: none;
|
|
64
|
-
margin: 0;
|
|
65
|
-
box-shadow: none;
|
|
66
|
-
border-radius: 0;
|
|
67
|
-
}
|
|
68
|
-
[part~="head"] {
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
gap: 4px;
|
|
72
|
-
padding: 6px 8px;
|
|
73
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
|
|
74
|
-
}
|
|
75
|
-
[part~="tab"], [part~="chart-tab"] {
|
|
76
|
-
font: inherit;
|
|
77
|
-
color: var(--mbx-muted, #9aa0a6);
|
|
78
|
-
background: transparent;
|
|
79
|
-
border: 0;
|
|
80
|
-
border-radius: var(--mbx-radius, 4px);
|
|
81
|
-
padding: 3px 8px;
|
|
82
|
-
cursor: pointer;
|
|
83
|
-
}
|
|
84
|
-
[part~="tab"][aria-selected="true"], [part~="chart-tab"][aria-selected="true"] {
|
|
85
|
-
color: var(--mbx-text, #f2f3f5);
|
|
86
|
-
background: rgba(255, 255, 255, 0.12);
|
|
87
|
-
}
|
|
88
|
-
[part~="copy"], [part~="close"], [part~="window"] {
|
|
89
|
-
font: inherit;
|
|
90
|
-
color: inherit;
|
|
91
|
-
background: transparent;
|
|
92
|
-
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
93
|
-
border-radius: var(--mbx-radius, 4px);
|
|
94
|
-
padding: 2px 8px;
|
|
95
|
-
cursor: pointer;
|
|
96
|
-
}
|
|
97
|
-
[part~="copy"] { margin-left: auto; }
|
|
98
|
-
[part~="window"] { margin-left: auto; }
|
|
99
|
-
[part~="window"] option { color: #000; }
|
|
100
|
-
[part~="tab"]:focus-visible, [part~="chart-tab"]:focus-visible, [part~="copy"]:focus-visible,
|
|
101
|
-
[part~="close"]:focus-visible, [part~="window"]:focus-visible {
|
|
102
|
-
outline: 2px solid var(--mbx-accent, #5b8cff);
|
|
103
|
-
outline-offset: -2px;
|
|
104
|
-
}
|
|
105
|
-
[part~="body"] { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 8px; }
|
|
106
|
-
[part~="page"][hidden] { display: none; }
|
|
107
|
-
[part~="rows"] { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }
|
|
108
|
-
[part~="key"] { color: var(--mbx-muted, #9aa0a6); white-space: nowrap; }
|
|
109
|
-
[part~="value"] { margin: 0; overflow-wrap: anywhere; }
|
|
110
|
-
[part~="heading"] {
|
|
111
|
-
margin: 10px 0 4px;
|
|
112
|
-
font-size: 11px;
|
|
113
|
-
font-weight: 600;
|
|
114
|
-
letter-spacing: 0.06em;
|
|
115
|
-
text-transform: uppercase;
|
|
116
|
-
color: var(--mbx-muted, #9aa0a6);
|
|
117
|
-
}
|
|
118
|
-
[part~="heading"]:first-child { margin-top: 0; }
|
|
119
|
-
[part~="note"] { margin: 0; color: var(--mbx-muted, #9aa0a6); }
|
|
120
|
-
[part~="chart-tabs"] { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 6px; }
|
|
121
|
-
[part~="chart"] { display: block; width: 100%; height: 160px; }
|
|
122
|
-
[part~="legend"] { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--mbx-muted, #9aa0a6); }
|
|
123
|
-
[part~="swatch"] { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: middle; }
|
|
124
|
-
[part~="readout"] { margin-top: 4px; }
|
|
125
|
-
[part~="table"] { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
|
|
126
|
-
[part~="cell"] { padding: 2px 6px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; font-weight: 400; }
|
|
127
|
-
[part~="label"] { color: var(--mbx-muted, #9aa0a6); }
|
|
128
|
-
[part~="ok"] { color: var(--mbx-chart-2); }
|
|
129
|
-
[part~="bad"] { color: var(--mbx-chart-4); }
|
|
130
|
-
[part~="na"] { color: var(--mbx-muted, #9aa0a6); }
|
|
131
|
-
[part~="ok"], [part~="bad"], [part~="na"], [part~="maybe"] { font-weight: 600; }
|
|
132
|
-
`;
|
|
1
|
+
const STYLE = ":host{--mbx-chart-1:#5aa9e0;--mbx-chart-2:#6fbf8f;--mbx-chart-3:#d9a83f;--mbx-chart-4:#e05a6e;--mbx-chart-5:#a98fe0;display:inline-flex;position:relative}:host([hidden]){display:none}:host([inline]){display:block}[part~=button]{width:40px;height:40px;font:inherit;color:inherit;border-radius:var(--mbx-radius);cursor:pointer;opacity:.9;background:0 0;border:0;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}[part~=button]:hover{opacity:1}[part~=button]:focus{outline:2px solid var(--mbx-accent);outline-offset:-2px}[part~=button]:focus:not(:focus-visible){outline:none}[part~=icon],::slotted(*){fill:currentColor;width:1.75em;height:1.75em}:host([inline]) [part~=button]{display:none}[part~=panel]{box-sizing:border-box;width:560px;color:var(--mbx-text,#f2f3f5);border-radius:var(--mbx-radius,4px);font:400 12px / 1.5 var(--mbx-mono,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);text-align:left;white-space:normal;background:#101114f2;flex-direction:column;margin-bottom:8px;display:flex;position:absolute;bottom:100%;right:0;overflow:hidden;box-shadow:0 4px 16px #00000080}[part~=panel][hidden]{display:none}:host([inline]) [part~=panel]{width:auto;max-height:none;box-shadow:none;border-radius:0;margin:0;position:static}[part~=head]{border-bottom:1px solid #ffffff1f;align-items:center;padding:6px;display:flex}[part~=tab],[part~=chart-tab]{font:inherit;color:var(--mbx-muted,#9aa0a6);border-radius:var(--mbx-radius,4px);cursor:pointer;background:0 0;border:0;padding:3px 8px}[part~=tab][aria-selected=true],[part~=chart-tab][aria-selected=true]{color:var(--mbx-text,#f2f3f5);background:#ffffff1f}[part~=copy],[part~=close],[part~=window]{font:inherit;color:inherit;border-radius:var(--mbx-radius,4px);cursor:pointer;background:0 0;border:1px solid #ffffff40;padding:2px 8px}[part~=head]>*{margin:0 2px}[part~=head]>[part~=copy],[part~=chart-tabs]>[part~=window]{margin-left:auto}[part~=window] option{color:#000}[part~=tab]:focus,[part~=chart-tab]:focus,[part~=copy]:focus,[part~=close]:focus,[part~=window]:focus{outline:2px solid var(--mbx-accent,#5b8cff);outline-offset:-2px}[part~=tab]:focus:not(:focus-visible){outline:none}[part~=chart-tab]:focus:not(:focus-visible){outline:none}[part~=copy]:focus:not(:focus-visible){outline:none}[part~=close]:focus:not(:focus-visible){outline:none}[part~=window]:focus:not(:focus-visible){outline:none}[part~=body]{overscroll-behavior:contain;min-height:0;padding:8px;overflow:auto}[part~=page][hidden]{display:none}[part~=rows]{grid-template-columns:max-content 1fr;gap:2px 12px;margin:0;display:grid}[part~=key]{color:var(--mbx-muted,#9aa0a6);white-space:nowrap}[part~=value]{overflow-wrap:anywhere;margin:0}[part~=heading]{letter-spacing:.06em;text-transform:uppercase;color:var(--mbx-muted,#9aa0a6);margin:10px 0 4px;font-size:11px;font-weight:600}[part~=heading]:first-child{margin-top:0}[part~=note]{color:var(--mbx-muted,#9aa0a6);margin:0}[part~=chart-tabs]{flex-wrap:wrap;align-items:center;margin:-2px -2px 4px;display:flex}[part~=chart-tabs]>*{margin:2px}[part~=chart]{width:100%;height:160px;display:block}[part~=legend]{color:var(--mbx-muted,#9aa0a6);flex-wrap:wrap;margin:3px -6px -1px;display:flex}[part~=legend]>*{margin:1px 6px}[part~=swatch]{vertical-align:middle;border-radius:2px;width:10px;height:10px;margin-right:4px;display:inline-block}[part~=readout]{margin-top:4px}[part~=table]{border-collapse:collapse;width:100%;margin-bottom:4px}[part~=cell]{text-align:left;white-space:nowrap;border-bottom:1px solid #ffffff14;padding:2px 6px;font-weight:400}[part~=label]{color:var(--mbx-muted,#9aa0a6)}[part~=ok]{color:var(--mbx-chart-2)}[part~=bad]{color:var(--mbx-chart-4)}[part~=na]{color:var(--mbx-muted,#9aa0a6)}[part~=ok],[part~=bad],[part~=na],[part~=maybe]{font-weight:600}";
|
|
2
|
+
//#endregion
|
|
3
|
+
export { STYLE };
|
|
4
|
+
|
|
133
5
|
//# sourceMappingURL=style.js.map
|
package/dist/style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../src/style.ts"],"sourcesContent":["/**\n * The element's stylesheet. The button is drawn the way the player's own\n * buttons are, in a copy: the player's styles are internal, and a control\n * of the page's own carries its own sheet. Tokens come through the\n * `--mbx-*` custom properties the player sets, which inherit through light\n * DOM; the chart colours have defaults here and a page overrides them the\n * same way. Nothing carries `!important`, so a page's `::part()` rule wins.\n */\nimport STYLE_CSS from './style.css?inline';\n\nexport const STYLE = STYLE_CSS;\n"],"mappings":"AAUA,MAAA,QAAA"}
|