@supermousejs/dot 2.3.1 → 2.4.1
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 +1 -1
- package/dist/index.mjs +22 -17
- package/dist/index.umd.js +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,31 +1,36 @@
|
|
|
1
|
-
import { normalize as a, definePlugin as
|
|
2
|
-
const
|
|
3
|
-
const d = "#750c7e", l = t.hideOnShape ?? !0, n = a(t.size, 8), i = a(t.color, d),
|
|
4
|
-
return
|
|
1
|
+
import { normalize as a, definePlugin as u, dom as c, Layers as z } from "@supermousejs/utils";
|
|
2
|
+
const y = (t = {}) => {
|
|
3
|
+
const d = "#750c7e", l = t.hideOnShape ?? !0, n = a(t.size, 8), i = a(t.color, d), g = a(t.opacity, 1);
|
|
4
|
+
return u(
|
|
5
5
|
{
|
|
6
6
|
name: "dot",
|
|
7
7
|
selector: "[data-supermouse-color]",
|
|
8
8
|
create: (e) => {
|
|
9
|
-
const
|
|
10
|
-
return
|
|
11
|
-
zIndex: t.zIndex ||
|
|
9
|
+
const o = n(e.state), r = i(e.state), s = c.createCircle(o, r);
|
|
10
|
+
return c.css(s, {
|
|
11
|
+
zIndex: t.zIndex || z.CURSOR,
|
|
12
12
|
mixBlendMode: t.mixBlendMode || "difference",
|
|
13
13
|
transition: "background-color 0.2s ease, opacity 0.2s ease"
|
|
14
|
-
}),
|
|
14
|
+
}), s;
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
update: (e, o) => {
|
|
17
|
+
const r = n(e.state);
|
|
18
|
+
c.css(o, {
|
|
19
|
+
width: `${r}px`,
|
|
20
|
+
height: `${r}px`,
|
|
21
|
+
backgroundColor: e.state.interaction.color || i(e.state)
|
|
22
|
+
});
|
|
23
|
+
let s = g(e.state);
|
|
24
|
+
l && e.state.shape && (s = 0), c.css(o, {
|
|
25
|
+
opacity: String(s)
|
|
26
|
+
});
|
|
27
|
+
const { x: f, y: m } = e.state.target;
|
|
28
|
+
c.setTransform(o, f, m);
|
|
24
29
|
}
|
|
25
30
|
},
|
|
26
31
|
t
|
|
27
32
|
);
|
|
28
33
|
};
|
|
29
34
|
export {
|
|
30
|
-
|
|
35
|
+
y as Dot
|
|
31
36
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@supermousejs/utils")):typeof define=="function"&&define.amd?define(["exports","@supermousejs/utils"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.SupermouseDot={},o.SupermouseUtils))})(this,(function(o,e){"use strict";const a=(
|
|
1
|
+
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@supermousejs/utils")):typeof define=="function"&&define.amd?define(["exports","@supermousejs/utils"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.SupermouseDot={},o.SupermouseUtils))})(this,(function(o,e){"use strict";const a=(s={})=>{const f="#750c7e",m=s.hideOnShape??!0,d=e.normalize(s.size,8),i=e.normalize(s.color,f),u=e.normalize(s.opacity,1);return e.definePlugin({name:"dot",selector:"[data-supermouse-color]",create:t=>{const n=d(t.state),c=i(t.state),r=e.dom.createCircle(n,c);return e.dom.css(r,{zIndex:s.zIndex||e.Layers.CURSOR,mixBlendMode:s.mixBlendMode||"difference",transition:"background-color 0.2s ease, opacity 0.2s ease"}),r},update:(t,n)=>{const c=d(t.state);e.dom.css(n,{width:`${c}px`,height:`${c}px`,backgroundColor:t.state.interaction.color||i(t.state)});let r=u(t.state);m&&t.state.shape&&(r=0),e.dom.css(n,{opacity:String(r)});const{x:l,y:g}=t.state.target;e.dom.setTransform(n,l,g)}},s)};o.Dot=a,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supermousejs/dot",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"main": "dist/index.umd.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
|
+
"description": "A minimalist precision point that follows your movements perfectly",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
7
8
|
"files": [
|
|
8
9
|
"dist",
|
|
@@ -12,18 +13,18 @@
|
|
|
12
13
|
"url": "https://github.com/Whitestar14/supermouse-js",
|
|
13
14
|
"license": "MIT",
|
|
14
15
|
"dependencies": {
|
|
15
|
-
"@supermousejs/utils": "2.
|
|
16
|
+
"@supermousejs/utils": "2.4.1"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
|
-
"@supermousejs/core": "2.
|
|
19
|
+
"@supermousejs/core": "2.4.1"
|
|
19
20
|
},
|
|
20
21
|
"peerDependencies": {
|
|
21
|
-
"@supermousejs/core": "2.
|
|
22
|
+
"@supermousejs/core": "2.4.1"
|
|
22
23
|
},
|
|
23
24
|
"repository": {
|
|
24
25
|
"type": "git",
|
|
25
26
|
"url": "git+https://github.com/Whitestar14/supermouse-js.git",
|
|
26
|
-
"directory": "packages/
|
|
27
|
+
"directory": "packages/dot"
|
|
27
28
|
},
|
|
28
29
|
"bugs": {
|
|
29
30
|
"url": "https://github.com/Whitestar14/supermouse-js/issues"
|