sm-click-library-ui 0.0.622-dev.87 → 0.0.622-dev.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-W-o-nVSG.js → index-mfVqkdP1.js} +10942 -10896
- package/dist/sm-click-library-ui.es.js +1 -1
- package/dist/sm-click-library-ui.umd.js +20 -20
- package/dist/style.css +1 -1
- package/dist/{vue3-lottie.es-DCDdPj8i.js → vue3-lottie.es-y8pSyUGW.js} +1 -1
- package/dist/{web-eB_2ey6s.js → web-BGyBUFgx.js} +2 -2
- package/dist/{web-BnbAM2S_.js → web-DaH90QGJ.js} +2 -2
- package/package.json +1 -1
- package/src/test-utils/components/chat/audioPlayback.test.js +56 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, watchEffect, computed, watch, createElementBlock, openBlock, normalizeStyle } from "vue";
|
|
2
|
-
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from "./index-
|
|
2
|
+
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from "./index-mfVqkdP1.js";
|
|
3
3
|
var lottie = { exports: {} };
|
|
4
4
|
(function(module, exports) {
|
|
5
5
|
typeof navigator < "u" && function(t, e) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as P, b as x } from "./index-
|
|
2
|
-
import { E } from "./web-
|
|
1
|
+
import { W as P, b as x } from "./index-mfVqkdP1.js";
|
|
2
|
+
import { E } from "./web-DaH90QGJ.js";
|
|
3
3
|
function m(w) {
|
|
4
4
|
const e = w.split("/").filter((t) => t !== "."), r = [];
|
|
5
5
|
return e.forEach((t) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as le, C as ge, g as me, W as we } from "./index-
|
|
1
|
+
import { r as le, C as ge, g as me, W as we } from "./index-mfVqkdP1.js";
|
|
2
2
|
const F = {
|
|
3
3
|
RECORDING: "RECORDING",
|
|
4
4
|
PAUSED: "PAUSED",
|
|
@@ -58,7 +58,7 @@ var te;
|
|
|
58
58
|
n.UTF8 = "utf8", n.ASCII = "ascii", n.UTF16 = "utf16";
|
|
59
59
|
})(te || (te = {}));
|
|
60
60
|
const k = le("Filesystem", {
|
|
61
|
-
web: () => import("./web-
|
|
61
|
+
web: () => import("./web-BGyBUFgx.js").then((n) => new n.FilesystemWeb())
|
|
62
62
|
});
|
|
63
63
|
Ee();
|
|
64
64
|
const _e = le("BlobWriter");
|
package/package.json
CHANGED
|
@@ -9,12 +9,15 @@ const instances = [];
|
|
|
9
9
|
const seeks = [];
|
|
10
10
|
const peakState = vi.hoisted(() => ({ pending: null }));
|
|
11
11
|
vi.mock("~/utils/audioPeaks", () => ({
|
|
12
|
-
resolveAudioPeaks: () => peakState.pending || Promise.resolve(null)
|
|
12
|
+
resolveAudioPeaks: () => peakState.pending || Promise.resolve(null),
|
|
13
|
+
prioritizeAudioPeaks: () => {}
|
|
13
14
|
}));
|
|
14
15
|
// jsdom não calcula layout: o portão de viewport nunca intersectaria, e a onda é o objeto do teste.
|
|
16
|
+
const gateState = vi.hoisted(() => ({ immediate: true, pending: [] }));
|
|
15
17
|
vi.mock("~/utils/viewportGate", () => ({
|
|
16
18
|
onceInViewport: (el, callback) => {
|
|
17
|
-
callback();
|
|
19
|
+
if (gateState.immediate) callback();
|
|
20
|
+
else gateState.pending.push(callback);
|
|
18
21
|
return () => {};
|
|
19
22
|
}
|
|
20
23
|
}));
|
|
@@ -68,6 +71,8 @@ import { useAudioPlaybackStore } from "~/stores/audioPlaybackStore";
|
|
|
68
71
|
|
|
69
72
|
// jsdom não implementa play/pause de mídia.
|
|
70
73
|
beforeEach(() => {
|
|
74
|
+
gateState.immediate = true;
|
|
75
|
+
gateState.pending = [];
|
|
71
76
|
peakState.pending = null;
|
|
72
77
|
instances.length = 0;
|
|
73
78
|
seeks.length = 0;
|
|
@@ -247,3 +252,52 @@ describe("seek por gesto na onda", () => {
|
|
|
247
252
|
wrapper.unmount();
|
|
248
253
|
});
|
|
249
254
|
});
|
|
255
|
+
|
|
256
|
+
describe("custo da bolha de áudio parada", () => {
|
|
257
|
+
it("não anima o equalizador enquanto a bolha não chega perto da viewport", async () => {
|
|
258
|
+
gateState.immediate = false;
|
|
259
|
+
const wrapper = await mountAudio();
|
|
260
|
+
|
|
261
|
+
expect(instances).toHaveLength(0);
|
|
262
|
+
expect(wrapper.find(".loading-equalizer").classes()).toContain("is-idle");
|
|
263
|
+
|
|
264
|
+
gateState.pending.forEach((callback) => callback());
|
|
265
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
266
|
+
await flushPromises();
|
|
267
|
+
|
|
268
|
+
expect(instances).toHaveLength(1);
|
|
269
|
+
wrapper.unmount();
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it("emite o tempo só quando vira o segundo", async () => {
|
|
273
|
+
const wrapper = await mountAudio();
|
|
274
|
+
const ws = instances[0];
|
|
275
|
+
|
|
276
|
+
ws.media.currentTime = 0.3;
|
|
277
|
+
ws.emit("audioprocess");
|
|
278
|
+
expect(wrapper.emitted("currentTime")).toBeUndefined();
|
|
279
|
+
|
|
280
|
+
ws.media.currentTime = 0.9;
|
|
281
|
+
ws.emit("audioprocess");
|
|
282
|
+
expect(wrapper.emitted("currentTime")).toBeUndefined();
|
|
283
|
+
|
|
284
|
+
ws.media.currentTime = 1.05;
|
|
285
|
+
ws.emit("audioprocess");
|
|
286
|
+
expect(wrapper.emitted("currentTime")).toHaveLength(1);
|
|
287
|
+
|
|
288
|
+
wrapper.unmount();
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
describe("duração da onda", () => {
|
|
293
|
+
it("posiciona o cursor pela duração decodificada, não pela do elemento", async () => {
|
|
294
|
+
// O dublê responde 12 em `getDuration`, como o `media.duration` errado que alguns containers dão no WebView do Android.
|
|
295
|
+
peakState.pending = Promise.resolve({ peaks: [new Float32Array(8)], duration: 30 });
|
|
296
|
+
const wrapper = await mountAudio();
|
|
297
|
+
await flushPromises();
|
|
298
|
+
|
|
299
|
+
expect(instances[0].getDuration()).toBe(30);
|
|
300
|
+
expect(wrapper.emitted("duration").at(-1)).toEqual([30]);
|
|
301
|
+
wrapper.unmount();
|
|
302
|
+
});
|
|
303
|
+
});
|