react-av-timeline 1.2.2 → 1.2.4
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 +53 -50
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,9 +5,9 @@ function oe() {
|
|
|
5
5
|
if (q) return y;
|
|
6
6
|
q = 1;
|
|
7
7
|
var t = Symbol.for("react.transitional.element"), a = Symbol.for("react.fragment");
|
|
8
|
-
function
|
|
9
|
-
var
|
|
10
|
-
if (u !== void 0 && (
|
|
8
|
+
function s(l, c, u) {
|
|
9
|
+
var m = null;
|
|
10
|
+
if (u !== void 0 && (m = "" + u), c.key !== void 0 && (m = "" + c.key), "key" in c) {
|
|
11
11
|
u = {};
|
|
12
12
|
for (var f in c)
|
|
13
13
|
f !== "key" && (u[f] = c[f]);
|
|
@@ -15,16 +15,16 @@ function oe() {
|
|
|
15
15
|
return c = u.ref, {
|
|
16
16
|
$$typeof: t,
|
|
17
17
|
type: l,
|
|
18
|
-
key:
|
|
18
|
+
key: m,
|
|
19
19
|
ref: c !== void 0 ? c : null,
|
|
20
20
|
props: u
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
return y.Fragment = a, y.jsx =
|
|
23
|
+
return y.Fragment = a, y.jsx = s, y.jsxs = s, y;
|
|
24
24
|
}
|
|
25
25
|
var T = {};
|
|
26
26
|
var J;
|
|
27
|
-
function
|
|
27
|
+
function ie() {
|
|
28
28
|
return J || (J = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
29
|
function t(e) {
|
|
30
30
|
if (e == null) return null;
|
|
@@ -72,7 +72,7 @@ function se() {
|
|
|
72
72
|
function a(e) {
|
|
73
73
|
return "" + e;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function s(e) {
|
|
76
76
|
try {
|
|
77
77
|
a(e);
|
|
78
78
|
var r = !1;
|
|
@@ -107,7 +107,7 @@ function se() {
|
|
|
107
107
|
function u() {
|
|
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;
|
|
@@ -133,14 +133,14 @@ function se() {
|
|
|
133
133
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
134
|
}
|
|
135
135
|
function R(e, r, n, o, A, Y) {
|
|
136
|
-
var
|
|
136
|
+
var i = n.ref;
|
|
137
137
|
return e = {
|
|
138
138
|
$$typeof: h,
|
|
139
139
|
type: e,
|
|
140
140
|
key: r,
|
|
141
141
|
props: n,
|
|
142
142
|
_owner: o
|
|
143
|
-
}, (
|
|
143
|
+
}, (i !== void 0 ? i : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
144
|
enumerable: !1,
|
|
145
145
|
get: E
|
|
146
146
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
@@ -165,25 +165,25 @@ function se() {
|
|
|
165
165
|
value: Y
|
|
166
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
var
|
|
170
|
-
if (
|
|
168
|
+
function d(e, r, n, o, A, Y) {
|
|
169
|
+
var i = r.children;
|
|
170
|
+
if (i !== void 0)
|
|
171
171
|
if (o)
|
|
172
|
-
if (te(
|
|
173
|
-
for (o = 0; o <
|
|
174
|
-
v(
|
|
175
|
-
Object.freeze && Object.freeze(
|
|
172
|
+
if (te(i)) {
|
|
173
|
+
for (o = 0; o < i.length; o++)
|
|
174
|
+
v(i[o]);
|
|
175
|
+
Object.freeze && Object.freeze(i);
|
|
176
176
|
} else
|
|
177
177
|
console.error(
|
|
178
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
179
|
);
|
|
180
|
-
else v(
|
|
180
|
+
else v(i);
|
|
181
181
|
if (I.call(r, "key")) {
|
|
182
|
-
|
|
182
|
+
i = t(e);
|
|
183
183
|
var b = Object.keys(r).filter(function(ne) {
|
|
184
184
|
return ne !== "key";
|
|
185
185
|
});
|
|
186
|
-
o = 0 < b.length ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}", V[
|
|
186
|
+
o = 0 < b.length ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}", V[i + o] || (b = 0 < b.length ? "{" + b.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
188
188
|
let props = %s;
|
|
189
189
|
<%s {...props} />
|
|
@@ -191,22 +191,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
191
191
|
let props = %s;
|
|
192
192
|
<%s key={someKey} {...props} />`,
|
|
193
193
|
o,
|
|
194
|
-
|
|
194
|
+
i,
|
|
195
195
|
b,
|
|
196
|
-
|
|
197
|
-
), V[
|
|
196
|
+
i
|
|
197
|
+
), V[i + o] = !0);
|
|
198
198
|
}
|
|
199
|
-
if (
|
|
199
|
+
if (i = null, n !== void 0 && (s(n), i = "" + n), m(r) && (s(r.key), i = "" + r.key), "key" in r) {
|
|
200
200
|
n = {};
|
|
201
201
|
for (var D in r)
|
|
202
202
|
D !== "key" && (n[D] = r[D]);
|
|
203
203
|
} else n = r;
|
|
204
|
-
return
|
|
204
|
+
return i && f(
|
|
205
205
|
n,
|
|
206
206
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
207
207
|
), R(
|
|
208
208
|
e,
|
|
209
|
-
|
|
209
|
+
i,
|
|
210
210
|
n,
|
|
211
211
|
c(),
|
|
212
212
|
A,
|
|
@@ -233,7 +233,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
233
233
|
)(), U = C(l(u)), V = {};
|
|
234
234
|
T.Fragment = k, T.jsx = function(e, r, n) {
|
|
235
235
|
var o = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
236
|
-
return
|
|
236
|
+
return d(
|
|
237
237
|
e,
|
|
238
238
|
r,
|
|
239
239
|
n,
|
|
@@ -243,7 +243,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
243
243
|
);
|
|
244
244
|
}, T.jsxs = function(e, r, n) {
|
|
245
245
|
var o = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
246
|
-
return
|
|
246
|
+
return d(
|
|
247
247
|
e,
|
|
248
248
|
r,
|
|
249
249
|
n,
|
|
@@ -255,10 +255,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
255
255
|
})()), T;
|
|
256
256
|
}
|
|
257
257
|
var z;
|
|
258
|
-
function
|
|
259
|
-
return z || (z = 1, process.env.NODE_ENV === "production" ? g.exports = oe() : g.exports =
|
|
258
|
+
function se() {
|
|
259
|
+
return z || (z = 1, process.env.NODE_ENV === "production" ? g.exports = oe() : g.exports = ie()), g.exports;
|
|
260
260
|
}
|
|
261
|
-
var _ =
|
|
261
|
+
var _ = se();
|
|
262
262
|
const le = "_timeline_100yd_1", j = {
|
|
263
263
|
timeline: le,
|
|
264
264
|
"timeline-items": "_timeline-items_100yd_6",
|
|
@@ -266,26 +266,29 @@ 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), a = Math.floor(120 + Math.random() * 91),
|
|
270
|
-
return `rgb(${t},${a},${
|
|
269
|
+
var t = Math.floor(120 + Math.random() * 91), a = Math.floor(120 + Math.random() * 91), s = Math.floor(120 + Math.random() * 91);
|
|
270
|
+
return `rgb(${t},${a},${s})`;
|
|
271
271
|
}
|
|
272
272
|
function M(t, a) {
|
|
273
273
|
return a === t.length - 1 ? t[a] - t[a - 1] : t[a + 1] - t[a];
|
|
274
274
|
}
|
|
275
|
-
function ce(t, a,
|
|
276
|
-
return a +
|
|
275
|
+
function ce(t, a, s = 1) {
|
|
276
|
+
return a + s >= t.length ? t.at(-1) : t[a + s];
|
|
277
277
|
}
|
|
278
278
|
const ue = new Array(20).fill(0).map(G);
|
|
279
|
-
function _e({ items: t, currentTime: a, totalTime:
|
|
280
|
-
|
|
279
|
+
function _e({ items: t, currentTime: a, totalTime: s, scale: l = 1, indicator: c, itemStyle: u }) {
|
|
280
|
+
t = t.filter((f) => f.time >= 0), t[0].time !== 0 && t.unshift({
|
|
281
|
+
time: 0,
|
|
282
|
+
content: void 0
|
|
283
|
+
});
|
|
284
|
+
const m = t.map((f) => f.time);
|
|
281
285
|
return _.jsxs("div", { className: j.timeline, children: [_.jsx("div", { className: j["timeline-indicator"], ...c }), _.jsx("div", { className: j["timeline-items"], style: {
|
|
282
|
-
"--translate": `${l * 50 / l - a /
|
|
286
|
+
"--translate": `${l * 50 / l - a / s * l * 100}%`
|
|
283
287
|
}, children: t.map((f, E) => {
|
|
284
|
-
const
|
|
288
|
+
const d = M(m, E) / s * l * 100 + "%";
|
|
285
289
|
return _.jsx("span", { className: j["timeline-item"], style: {
|
|
286
290
|
"--bg": f.style?.background || ue[E % 20],
|
|
287
|
-
width:
|
|
288
|
-
left: m,
|
|
291
|
+
width: d,
|
|
289
292
|
...u
|
|
290
293
|
}, children: f.content });
|
|
291
294
|
}) })] });
|
|
@@ -296,22 +299,22 @@ const fe = "_timeline_212s7_1", O = {
|
|
|
296
299
|
"timeline-item": "_timeline-item_212s7_6",
|
|
297
300
|
"timeline-indicator": "_timeline-indicator_212s7_20"
|
|
298
301
|
}, me = new Array(20).fill(0).map(G);
|
|
299
|
-
function Ee({ items: t, currentTime: a, totalTime:
|
|
300
|
-
const R = t.map((
|
|
302
|
+
function Ee({ items: t, currentTime: a, totalTime: s, scale: l = 1, indicator: c, itemStyle: u, prev: m = 2, height: f, left: E = 10 }) {
|
|
303
|
+
const R = t.map((d) => d.time);
|
|
301
304
|
return _.jsxs("div", { className: O.timeline, style: { height: f }, children: [_.jsx("div", { className: O["timeline-indicator"], ...c, style: { left: `${E}%` } }), _.jsx("div", { className: O["timeline-items"], style: {
|
|
302
|
-
"--translate": `${l * E / l - a /
|
|
303
|
-
}, children: t.map((
|
|
304
|
-
const p = M(R, v) /
|
|
305
|
+
"--translate": `${l * E / l - a / s * l * 100}%`
|
|
306
|
+
}, children: t.map((d, v) => {
|
|
307
|
+
const p = M(R, v) / s * l * 100 + "%", h = t.slice(0, v).reduce((x, k, S) => {
|
|
305
308
|
const N = M(R, S);
|
|
306
|
-
return x + N /
|
|
309
|
+
return x + N / s * l * 100;
|
|
307
310
|
}, 0) + "%";
|
|
308
|
-
if (a <= ce(t, v,
|
|
311
|
+
if (a <= ce(t, v, m).time)
|
|
309
312
|
return _.jsx("div", { className: O["timeline-item"], style: {
|
|
310
|
-
"--bg":
|
|
313
|
+
"--bg": d.style?.background || me[v % 20],
|
|
311
314
|
width: p,
|
|
312
315
|
left: h,
|
|
313
316
|
...u
|
|
314
|
-
}, children:
|
|
317
|
+
}, children: d.content });
|
|
315
318
|
}) })] });
|
|
316
319
|
}
|
|
317
320
|
export {
|