@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @supermousejs/dot
2
2
 
3
- A minimalist precision point that follows your movements perfectly.
3
+ A minimalist precision point that follows your movements perfectly
4
4
 
5
5
  ## Installation
6
6
 
package/dist/index.mjs CHANGED
@@ -1,31 +1,36 @@
1
- import { normalize as a, definePlugin as f, dom as o, Layers as m } from "@supermousejs/utils";
2
- const h = (t = {}) => {
3
- const d = "#750c7e", l = t.hideOnShape ?? !0, n = a(t.size, 8), i = a(t.color, d), y = a(t.opacity, 1);
4
- return f(
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 s = n(e.state), c = i(e.state), r = o.createCircle(s, c);
10
- return o.applyStyles(r, {
11
- zIndex: t.zIndex || m.CURSOR,
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
- }), r;
14
+ }), s;
15
15
  },
16
- styles: {},
17
- update: (e, s) => {
18
- const c = n(e.state);
19
- o.setStyle(s, "width", `${c}px`), o.setStyle(s, "height", `${c}px`), o.setStyle(s, "backgroundColor", e.state.interaction.color || i(e.state));
20
- let r = y(e.state);
21
- l && e.state.shape && (r = 0), o.setStyle(s, "opacity", String(r));
22
- const { x: S, y: g } = e.state.target;
23
- o.setTransform(s, S, g);
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
- h as Dot
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=(n={})=>{const m="#750c7e",f=n.hideOnShape??!0,c=e.normalize(n.size,8),i=e.normalize(n.color,m),u=e.normalize(n.opacity,1);return e.definePlugin({name:"dot",selector:"[data-supermouse-color]",create:t=>{const s=c(t.state),d=i(t.state),r=e.dom.createCircle(s,d);return e.dom.applyStyles(r,{zIndex:n.zIndex||e.Layers.CURSOR,mixBlendMode:n.mixBlendMode||"difference",transition:"background-color 0.2s ease, opacity 0.2s ease"}),r},styles:{},update:(t,s)=>{const d=c(t.state);e.dom.setStyle(s,"width",`${d}px`),e.dom.setStyle(s,"height",`${d}px`),e.dom.setStyle(s,"backgroundColor",t.state.interaction.color||i(t.state));let r=u(t.state);f&&t.state.shape&&(r=0),e.dom.setStyle(s,"opacity",String(r));const{x:y,y:l}=t.state.target;e.dom.setTransform(s,y,l)}},n)};o.Dot=a,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
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.1",
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.3.1"
16
+ "@supermousejs/utils": "2.4.1"
16
17
  },
17
18
  "devDependencies": {
18
- "@supermousejs/core": "2.3.0"
19
+ "@supermousejs/core": "2.4.1"
19
20
  },
20
21
  "peerDependencies": {
21
- "@supermousejs/core": "2.3.0"
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/core"
27
+ "directory": "packages/dot"
27
28
  },
28
29
  "bugs": {
29
30
  "url": "https://github.com/Whitestar14/supermouse-js/issues"