@realsee/dnalogel 3.40.0-alpha.0 → 3.40.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.
@@ -1,106 +1,99 @@
1
1
  var R = Object.defineProperty;
2
- var H = Object.getOwnPropertySymbols;
3
- var w = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
4
- var S = (e, a, t) => a in e ? R(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, g = (e, a) => {
5
- for (var t in a || (a = {}))
6
- w.call(a, t) && S(e, t, a[t]);
7
- if (H)
8
- for (var t of H(a))
9
- x.call(a, t) && S(e, t, a[t]);
10
- return e;
2
+ var T = Object.getOwnPropertySymbols;
3
+ var L = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
4
+ var H = (a, t, r) => t in a ? R(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r, E = (a, t) => {
5
+ for (var r in t || (t = {}))
6
+ L.call(t, r) && H(a, r, t[r]);
7
+ if (T)
8
+ for (var r of T(t))
9
+ x.call(t, r) && H(a, r, t[r]);
10
+ return a;
11
11
  };
12
- var E = (e, a, t) => new Promise((r, s) => {
13
- var l = (y) => {
14
- try {
15
- v(t.next(y));
16
- } catch (i) {
17
- s(i);
18
- }
19
- }, c = (y) => {
20
- try {
21
- v(t.throw(y));
22
- } catch (i) {
23
- s(i);
24
- }
25
- }, v = (y) => y.done ? r(y.value) : Promise.resolve(y.value).then(l, c);
26
- v((t = t.apply(e, a)).next());
27
- });
28
12
  import D from "animejs";
29
- import { toArray as p } from "../util.js";
30
- const f = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map();
31
- function b(e) {
32
- p(e).forEach((t) => {
33
- var r, s;
34
- f.has(t) || (t instanceof HTMLElement ? f.set(t, {
35
- opacity: t.style.opacity === "" ? void 0 : t.style.opacity,
13
+ import { toArray as g } from "../util.js";
14
+ const f = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
15
+ function k(a) {
16
+ g(a).forEach((r) => {
17
+ var l, s;
18
+ f.has(r) || (r instanceof HTMLElement ? f.set(r, {
19
+ opacity: r.style.opacity === "" ? void 0 : r.style.opacity,
36
20
  visible: {
37
- display: t.style.display,
38
- visibility: t.style.visibility
21
+ display: r.style.display,
22
+ visibility: r.style.visibility
39
23
  }
40
- }) : t.isObject3D && f.set(t, {
41
- opacity: (r = t.material) == null ? void 0 : r.opacity,
42
- transparent: (s = t.material) == null ? void 0 : s.transparent,
43
- visible: t.visible
24
+ }) : r.isObject3D && f.set(r, {
25
+ opacity: (l = r.material) == null ? void 0 : l.opacity,
26
+ transparent: (s = r.material) == null ? void 0 : s.transparent,
27
+ visible: r.visible
44
28
  }));
45
29
  });
46
30
  }
47
- function k(e) {
48
- p(e).forEach((t) => {
49
- const r = f.get(t);
50
- r && (t instanceof HTMLElement && (t.style.opacity = r.opacity === void 0 ? "" : r.opacity, t.style.display = r.visible.display, t.style.visibility = r.visible.visibility), t.isObject3D && (t.visible = r.visible, t.material && (t.material.opacity = r.opacity, t.material.transparent = r.transparent)), f.delete(t));
31
+ function S(a) {
32
+ console.log("restoring object state"), g(a).forEach((r) => {
33
+ const l = f.get(r);
34
+ l && (r instanceof HTMLElement && (r.style.opacity = l.opacity === void 0 ? "" : l.opacity, r.style.display = l.visible.display, r.style.visibility = l.visible.visibility), r.isObject3D && (r.visible = l.visible, r.material && (r.material.opacity = l.opacity, r.material.transparent = l.transparent)), f.delete(r));
51
35
  });
52
36
  }
53
- function o(e, a) {
54
- return E(this, null, function* () {
55
- var v, y;
56
- const t = (v = a == null ? void 0 : a.traverseTHREEObject) != null ? v : !0;
57
- let r = p(e);
58
- const s = [];
59
- r.forEach((i) => {
60
- i instanceof HTMLElement ? s.push(i) : i.isObject3D && (t ? (s.push(i), i.traverse((u) => {
61
- u && s.push(u);
62
- })) : s.push(i));
63
- }), r = [...new Set(s)], b(r);
64
- const l = D(g({
65
- targets: r,
66
- duration: 300,
67
- easing: "linear",
68
- direction: "alternate",
69
- loop: 4,
70
- autoplay: !1,
71
- update: (i) => {
72
- var u;
73
- i.animatables.forEach((L) => {
74
- var M;
75
- const d = L.target;
76
- if (!f.has(d))
77
- return;
78
- const h = Number((M = f.get(d).opacity) != null ? M : 1) * (100 - i.progress) / 100;
79
- d instanceof HTMLElement ? d.style.opacity = String(h) : d.material && (d.material.opacity = h, d.material.transparent = !0);
80
- }), (u = a == null ? void 0 : a.updateRender) == null || u.call(a);
81
- }
82
- }, a)), c = T.get(e);
83
- c == null || c.pause(), c == null || c.seek(0), T.set(e, l), l.play(), yield l.finished, k(r), (y = a == null ? void 0 : a.updateRender) == null || y.call(a);
84
- });
37
+ function w(a, t) {
38
+ var p;
39
+ const r = (p = t == null ? void 0 : t.traverseTHREEObject) != null ? p : !0;
40
+ let l = g(a);
41
+ const s = [];
42
+ l.forEach((y) => {
43
+ y instanceof HTMLElement ? s.push(y) : y.isObject3D && (r ? (s.push(y), y.traverse((c) => {
44
+ c && s.push(c);
45
+ })) : s.push(y));
46
+ }), l = [...new Set(s)], k(l);
47
+ const e = D(E({
48
+ targets: l,
49
+ duration: 300,
50
+ easing: "linear",
51
+ direction: "alternate",
52
+ loop: 4,
53
+ autoplay: !1,
54
+ update: (y) => {
55
+ var c;
56
+ y.animatables.forEach((d) => {
57
+ var M;
58
+ const u = d.target;
59
+ if (!f.has(u))
60
+ return;
61
+ const h = Number((M = f.get(u).opacity) != null ? M : 1) * (100 - y.progress) / 100;
62
+ u instanceof HTMLElement ? u.style.opacity = String(h) : u.material && (u.material.opacity = h, u.material.transparent = !0);
63
+ }), (c = t == null ? void 0 : t.updateRender) == null || c.call(t);
64
+ }
65
+ }, t));
66
+ e.preComplete = () => {
67
+ e != null && e.completed || (e == null || e.pause(), S(l), setTimeout(() => {
68
+ var y;
69
+ return (y = t == null ? void 0 : t.updateRender) == null ? void 0 : y.call(t);
70
+ }));
71
+ };
72
+ const i = v.get(a);
73
+ return i == null || i.pause(), i == null || i.seek(0), v.set(a, e), e.play(), e.finished.then(() => {
74
+ var y;
75
+ S(l), setTimeout(() => {
76
+ v.get(a) === e && v.delete(a);
77
+ }, 1e3), (y = t == null ? void 0 : t.updateRender) == null || y.call(t);
78
+ }), e;
85
79
  }
86
- function C(e, a) {
87
- return E(this, null, function* () {
88
- return o(e, g({
89
- update: (t) => {
90
- var r;
91
- t.animatables.forEach((s) => {
92
- var i, u;
93
- const l = s.target;
94
- if (!f.has(l))
95
- return;
96
- const c = f.get(l), y = ((u = (i = c == null ? void 0 : c.opacity) != null ? i : a == null ? void 0 : a.maxOpacity) != null ? u : 1) * (t.progress / 100);
97
- l instanceof HTMLElement ? (l.style.opacity = String(y), l.style.visibility = "visible") : l.isObject3D && (p(e).includes(l) && (l.visible = !0), l.material && (l.material.opacity = y, l.material.transparent = !0));
98
- }), (r = a == null ? void 0 : a.updateRender) == null || r.call(a);
99
- }
100
- }, a));
101
- });
80
+ function q(a, t) {
81
+ return w(a, E({
82
+ update: (r) => {
83
+ var l;
84
+ r.animatables.forEach((s) => {
85
+ var c, d;
86
+ const e = s.target;
87
+ if (!f.has(e))
88
+ return;
89
+ const i = f.get(e), y = ((d = (c = i == null ? void 0 : i.opacity) != null ? c : t == null ? void 0 : t.maxOpacity) != null ? d : 1) * (r.progress / 100);
90
+ e instanceof HTMLElement ? (e.style.opacity = String(y), e.style.visibility = "visible") : e.isObject3D && (g(a).includes(e) && (e.visible = !0), e.material && (e.material.opacity = y, e.material.transparent = !0));
91
+ }), (l = t == null ? void 0 : t.updateRender) == null || l.call(t);
92
+ }
93
+ }, t));
102
94
  }
103
95
  export {
104
- o as blink,
105
- C as reblink
96
+ v as animeMap,
97
+ w as blink,
98
+ q as reblink
106
99
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.40.0-alpha.0",
3
+ "version": "3.40.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "build:dist": "NODE_ENV=production BUILD_MODULE=dist vite build -m production",
25
25
  "build:components": "NODE_ENV=production BUILD_MODULE=components vite build -m production",
26
26
  "docs": "typedoc --options ./typedoc.json",
27
- "prepublishOnly": "run-p build",
27
+ "prepublishOnly": "run-p build docs",
28
28
  "postpublish": "cnpm sync @realsee/dnalogel"
29
29
  },
30
30
  "files": [
@@ -1,25 +0,0 @@
1
- /**
2
- * @description 两条二维线段是否相交,不考虑端点重合的情况
3
- */
4
- export declare function lineIsIntersecting(line1: {
5
- x: number;
6
- y: number;
7
- }[], line2: {
8
- x: number;
9
- y: number;
10
- }[]): boolean;
11
- /**
12
- * @description 两条二维折线段的交点,不考虑端点重合的情况
13
- */
14
- export declare function findIntersectingOfLines(line1: {
15
- x: number;
16
- y: number;
17
- }[], line2: {
18
- x: number;
19
- y: number;
20
- }[]): {
21
- x: number;
22
- y: number;
23
- line1RelativeIndex: number;
24
- line2RelativeIndex: number;
25
- };
@@ -1,25 +0,0 @@
1
- /**
2
- * @description 两条二维线段是否相交,不考虑端点重合的情况
3
- */
4
- export declare function lineIsIntersecting(line1: {
5
- x: number;
6
- y: number;
7
- }[], line2: {
8
- x: number;
9
- y: number;
10
- }[]): boolean;
11
- /**
12
- * @description 两条二维折线段的交点,不考虑端点重合的情况
13
- */
14
- export declare function findIntersectingOfLines(line1: {
15
- x: number;
16
- y: number;
17
- }[], line2: {
18
- x: number;
19
- y: number;
20
- }[]): {
21
- x: number;
22
- y: number;
23
- line1RelativeIndex: number;
24
- line2RelativeIndex: number;
25
- };
@@ -1,25 +0,0 @@
1
- function u(x, e) {
2
- const t = x[0], r = x[1], y = e[0], n = e[1];
3
- var s = (n.x - y.x) * (t.y - y.y) - (n.y - y.y) * (t.x - y.x), c = (r.x - t.x) * (t.y - y.y) - (r.y - t.y) * (t.x - y.x), a = (n.y - y.y) * (r.x - t.x) - (n.x - y.x) * (r.y - t.y);
4
- if (a !== 0) {
5
- var f = s / a, o = c / a;
6
- if (0 <= f && f <= 1 && 0 <= o && o <= 1)
7
- return !0;
8
- }
9
- return !1;
10
- }
11
- function v(x, e) {
12
- for (let t = 0; t < x.length - 1; t++)
13
- for (let r = 0; r < e.length - 1; r++)
14
- if (u([x[t], x[t + 1]], [e[r], e[r + 1]]))
15
- return {
16
- x: (x[t].x + x[t + 1].x) / 2,
17
- y: (x[t].y + x[t + 1].y) / 2,
18
- line1RelativeIndex: t,
19
- line2RelativeIndex: r
20
- };
21
- }
22
- export {
23
- v as findIntersectingOfLines,
24
- u as lineIsIntersecting
25
- };