react-av-timeline 1.2.2 → 1.2.3
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.js +68 -68
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,23 +4,23 @@ var q;
|
|
|
4
4
|
function oe() {
|
|
5
5
|
if (q) return y;
|
|
6
6
|
q = 1;
|
|
7
|
-
var t = Symbol.for("react.transitional.element"),
|
|
8
|
-
function i(l,
|
|
9
|
-
var
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
for (var f in
|
|
13
|
-
f !== "key" && (
|
|
14
|
-
} else
|
|
15
|
-
return
|
|
7
|
+
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
8
|
+
function i(l, u, c) {
|
|
9
|
+
var m = null;
|
|
10
|
+
if (c !== void 0 && (m = "" + c), u.key !== void 0 && (m = "" + u.key), "key" in u) {
|
|
11
|
+
c = {};
|
|
12
|
+
for (var f in u)
|
|
13
|
+
f !== "key" && (c[f] = u[f]);
|
|
14
|
+
} else c = u;
|
|
15
|
+
return u = c.ref, {
|
|
16
16
|
$$typeof: t,
|
|
17
17
|
type: l,
|
|
18
|
-
key:
|
|
19
|
-
ref:
|
|
20
|
-
props:
|
|
18
|
+
key: m,
|
|
19
|
+
ref: u !== void 0 ? u : null,
|
|
20
|
+
props: c
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
return y.Fragment =
|
|
23
|
+
return y.Fragment = n, y.jsx = i, y.jsxs = i, y;
|
|
24
24
|
}
|
|
25
25
|
var T = {};
|
|
26
26
|
var J;
|
|
@@ -69,24 +69,24 @@ function se() {
|
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function n(e) {
|
|
73
73
|
return "" + e;
|
|
74
74
|
}
|
|
75
75
|
function i(e) {
|
|
76
76
|
try {
|
|
77
|
-
|
|
77
|
+
n(e);
|
|
78
78
|
var r = !1;
|
|
79
79
|
} catch {
|
|
80
80
|
r = !0;
|
|
81
81
|
}
|
|
82
82
|
if (r) {
|
|
83
83
|
r = console;
|
|
84
|
-
var
|
|
85
|
-
return
|
|
84
|
+
var a = r.error, o = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
85
|
+
return a.call(
|
|
86
86
|
r,
|
|
87
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
88
|
o
|
|
89
|
-
),
|
|
89
|
+
), n(e);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
function l(e) {
|
|
@@ -100,14 +100,14 @@ function se() {
|
|
|
100
100
|
return "<...>";
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function u() {
|
|
104
104
|
var e = $.A;
|
|
105
105
|
return e === null ? null : e.getOwner();
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function c() {
|
|
108
108
|
return Error("react-stack-top-frame");
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function m(e) {
|
|
111
111
|
if (I.call(e, "key")) {
|
|
112
112
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
113
113
|
if (r && r.isReactWarning) return !1;
|
|
@@ -115,14 +115,14 @@ function se() {
|
|
|
115
115
|
return e.key !== void 0;
|
|
116
116
|
}
|
|
117
117
|
function f(e, r) {
|
|
118
|
-
function
|
|
118
|
+
function a() {
|
|
119
119
|
F || (F = !0, console.error(
|
|
120
120
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
121
121
|
r
|
|
122
122
|
));
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
get:
|
|
124
|
+
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
125
|
+
get: a,
|
|
126
126
|
configurable: !0
|
|
127
127
|
});
|
|
128
128
|
}
|
|
@@ -132,13 +132,13 @@ function se() {
|
|
|
132
132
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
133
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
134
|
}
|
|
135
|
-
function R(e, r,
|
|
136
|
-
var s =
|
|
135
|
+
function R(e, r, a, o, A, Y) {
|
|
136
|
+
var s = a.ref;
|
|
137
137
|
return e = {
|
|
138
138
|
$$typeof: h,
|
|
139
139
|
type: e,
|
|
140
140
|
key: r,
|
|
141
|
-
props:
|
|
141
|
+
props: a,
|
|
142
142
|
_owner: o
|
|
143
143
|
}, (s !== void 0 ? s : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
144
|
enumerable: !1,
|
|
@@ -165,7 +165,7 @@ function se() {
|
|
|
165
165
|
value: Y
|
|
166
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function d(e, r, a, o, A, Y) {
|
|
169
169
|
var s = r.children;
|
|
170
170
|
if (s !== void 0)
|
|
171
171
|
if (o)
|
|
@@ -196,19 +196,19 @@ React keys must be passed directly to JSX without using spread:
|
|
|
196
196
|
s
|
|
197
197
|
), V[s + o] = !0);
|
|
198
198
|
}
|
|
199
|
-
if (s = null,
|
|
200
|
-
|
|
199
|
+
if (s = null, a !== void 0 && (i(a), s = "" + a), m(r) && (i(r.key), s = "" + r.key), "key" in r) {
|
|
200
|
+
a = {};
|
|
201
201
|
for (var D in r)
|
|
202
|
-
D !== "key" && (
|
|
203
|
-
} else
|
|
202
|
+
D !== "key" && (a[D] = r[D]);
|
|
203
|
+
} else a = r;
|
|
204
204
|
return s && f(
|
|
205
|
-
|
|
205
|
+
a,
|
|
206
206
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
207
207
|
), R(
|
|
208
208
|
e,
|
|
209
209
|
s,
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
a,
|
|
211
|
+
u(),
|
|
212
212
|
A,
|
|
213
213
|
Y
|
|
214
214
|
);
|
|
@@ -229,24 +229,24 @@ React keys must be passed directly to JSX without using spread:
|
|
|
229
229
|
};
|
|
230
230
|
var F, L = {}, W = p.react_stack_bottom_frame.bind(
|
|
231
231
|
p,
|
|
232
|
-
|
|
233
|
-
)(), U = C(l(
|
|
234
|
-
T.Fragment = k, T.jsx = function(e, r,
|
|
232
|
+
c
|
|
233
|
+
)(), U = C(l(c)), V = {};
|
|
234
|
+
T.Fragment = k, T.jsx = function(e, r, a) {
|
|
235
235
|
var o = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
236
|
-
return
|
|
236
|
+
return d(
|
|
237
237
|
e,
|
|
238
238
|
r,
|
|
239
|
-
|
|
239
|
+
a,
|
|
240
240
|
!1,
|
|
241
241
|
o ? Error("react-stack-top-frame") : W,
|
|
242
242
|
o ? C(l(e)) : U
|
|
243
243
|
);
|
|
244
|
-
}, T.jsxs = function(e, r,
|
|
244
|
+
}, T.jsxs = function(e, r, a) {
|
|
245
245
|
var o = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
246
|
-
return
|
|
246
|
+
return d(
|
|
247
247
|
e,
|
|
248
248
|
r,
|
|
249
|
-
|
|
249
|
+
a,
|
|
250
250
|
!0,
|
|
251
251
|
o ? Error("react-stack-top-frame") : W,
|
|
252
252
|
o ? C(l(e)) : U
|
|
@@ -266,27 +266,27 @@ const le = "_timeline_100yd_1", j = {
|
|
|
266
266
|
"timeline-indicator": "_timeline-indicator_100yd_24"
|
|
267
267
|
};
|
|
268
268
|
function G() {
|
|
269
|
-
var t = Math.floor(120 + Math.random() * 91),
|
|
270
|
-
return `rgb(${t},${
|
|
269
|
+
var t = Math.floor(120 + Math.random() * 91), n = Math.floor(120 + Math.random() * 91), i = Math.floor(120 + Math.random() * 91);
|
|
270
|
+
return `rgb(${t},${n},${i})`;
|
|
271
271
|
}
|
|
272
|
-
function M(t,
|
|
273
|
-
return
|
|
272
|
+
function M(t, n) {
|
|
273
|
+
return n === 0 ? t[n + 1] : n === t.length - 1 ? t[n] - t[n - 1] : t[n + 1] - t[n];
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
return
|
|
275
|
+
function ue(t, n, i = 1) {
|
|
276
|
+
return n + i >= t.length ? t.at(-1) : t[n + i];
|
|
277
277
|
}
|
|
278
|
-
const
|
|
279
|
-
function _e({ items: t, currentTime:
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
278
|
+
const ce = new Array(20).fill(0).map(G);
|
|
279
|
+
function _e({ items: t, currentTime: n, totalTime: i, scale: l = 1, indicator: u, itemStyle: c }) {
|
|
280
|
+
t = t.filter((f) => f.time >= 0);
|
|
281
|
+
const m = t.map((f) => f.time);
|
|
282
|
+
return _.jsxs("div", { className: j.timeline, children: [_.jsx("div", { className: j["timeline-indicator"], ...u }), _.jsx("div", { className: j["timeline-items"], style: {
|
|
283
|
+
"--translate": `${l * 50 / l - (n - 1) / i * l * 100}%`
|
|
283
284
|
}, children: t.map((f, E) => {
|
|
284
|
-
const
|
|
285
|
+
const d = M(m, E) / i * l * 100 + "%";
|
|
285
286
|
return _.jsx("span", { className: j["timeline-item"], style: {
|
|
286
|
-
"--bg": f.style?.background ||
|
|
287
|
-
width:
|
|
288
|
-
|
|
289
|
-
...u
|
|
287
|
+
"--bg": f.style?.background || ce[E % 20],
|
|
288
|
+
width: d,
|
|
289
|
+
...c
|
|
290
290
|
}, children: f.content });
|
|
291
291
|
}) })] });
|
|
292
292
|
}
|
|
@@ -296,22 +296,22 @@ const fe = "_timeline_212s7_1", O = {
|
|
|
296
296
|
"timeline-item": "_timeline-item_212s7_6",
|
|
297
297
|
"timeline-indicator": "_timeline-indicator_212s7_20"
|
|
298
298
|
}, me = new Array(20).fill(0).map(G);
|
|
299
|
-
function Ee({ items: t, currentTime:
|
|
300
|
-
const R = t.map((
|
|
301
|
-
return _.jsxs("div", { className: O.timeline, style: { height: f }, children: [_.jsx("div", { className: O["timeline-indicator"], ...
|
|
302
|
-
"--translate": `${l * E / l -
|
|
303
|
-
}, children: t.map((
|
|
299
|
+
function Ee({ items: t, currentTime: n, totalTime: i, scale: l = 1, indicator: u, itemStyle: c, prev: m = 2, height: f, left: E = 10 }) {
|
|
300
|
+
const R = t.map((d) => d.time);
|
|
301
|
+
return _.jsxs("div", { className: O.timeline, style: { height: f }, children: [_.jsx("div", { className: O["timeline-indicator"], ...u, style: { left: `${E}%` } }), _.jsx("div", { className: O["timeline-items"], style: {
|
|
302
|
+
"--translate": `${l * E / l - n / i * l * 100}%`
|
|
303
|
+
}, children: t.map((d, v) => {
|
|
304
304
|
const p = M(R, v) / i * l * 100 + "%", h = t.slice(0, v).reduce((x, k, S) => {
|
|
305
305
|
const N = M(R, S);
|
|
306
306
|
return x + N / i * l * 100;
|
|
307
307
|
}, 0) + "%";
|
|
308
|
-
if (
|
|
308
|
+
if (n <= ue(t, v, m).time)
|
|
309
309
|
return _.jsx("div", { className: O["timeline-item"], style: {
|
|
310
|
-
"--bg":
|
|
310
|
+
"--bg": d.style?.background || me[v % 20],
|
|
311
311
|
width: p,
|
|
312
312
|
left: h,
|
|
313
|
-
...
|
|
314
|
-
}, children:
|
|
313
|
+
...c
|
|
314
|
+
}, children: d.content });
|
|
315
315
|
}) })] });
|
|
316
316
|
}
|
|
317
317
|
export {
|