@supermousejs/states 2.4.4-beta.3 → 2.4.4-beta.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @supermousejs/states
2
2
 
3
+ ## 2.4.4-beta.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [d82c62d]
8
+ - @supermousejs/utils@2.4.4-beta.5
9
+ - @supermousejs/core@2.5.0-beta.5
10
+
11
+ ## 2.4.4-beta.4
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [cb9bf9a]
16
+ - @supermousejs/core@2.5.0-beta.4
17
+ - @supermousejs/utils@2.4.4-beta.4
18
+
3
19
  ## 2.4.4-beta.3
4
20
 
5
21
  ### Patch Changes
package/dist/index.mjs CHANGED
@@ -1,37 +1,37 @@
1
1
  import { definePlugin as g } from "@supermousejs/utils";
2
2
  const E = (e) => {
3
- const u = e.attribute ?? "data-supermouse-state", d = new Set(e.default), r = /* @__PURE__ */ new Set();
4
- Object.values(e.states).forEach((t) => t.forEach((a) => r.add(a))), e.default.forEach((t) => r.add(t));
5
- let f = "__UNINITIALIZED__";
3
+ const f = e.attribute ?? "data-supermouse-state", d = new Set(e.default), u = /* @__PURE__ */ new Set();
4
+ Object.values(e.states).forEach((t) => t.forEach((a) => u.add(a))), e.default.forEach((t) => u.add(t));
5
+ let r = "__UNINITIALIZED__";
6
6
  return g(
7
7
  {
8
8
  name: "states",
9
9
  priority: -999,
10
10
  install(t) {
11
- t.registerHoverTarget(`[${u}]`);
11
+ t.addHoverSelectors(`[${f}]`);
12
12
  },
13
13
  update(t) {
14
14
  const a = t.state.hoverTarget;
15
15
  let n = "default";
16
16
  if (a) {
17
- const s = a.closest(`[${u}]`);
17
+ const s = a.closest(`[${f}]`);
18
18
  if (s) {
19
- const l = s.getAttribute(u);
19
+ const l = s.getAttribute(f);
20
20
  l && e.states[l] && (n = l);
21
21
  }
22
22
  }
23
- if (n === f) return;
23
+ if (n === r) return;
24
24
  const o = n === "default" ? e.default : e.states[n];
25
- for (const s of r) {
25
+ for (const s of u) {
26
26
  const l = t.getPlugin(s);
27
27
  if (!l) continue;
28
- const i = o.includes(s), c = l.isEnabled !== !1;
29
- i && !c && t.enablePlugin(s), !i && c && t.disablePlugin(s);
28
+ const c = o.includes(s), i = l.isEnabled !== !1;
29
+ c && !i && t.enablePlugin(s), !c && i && t.disablePlugin(s);
30
30
  }
31
- f = n;
31
+ r = n;
32
32
  },
33
33
  destroy(t) {
34
- for (const a of r) {
34
+ for (const a of u) {
35
35
  const n = t.getPlugin(a);
36
36
  n && d.has(a) && n.isEnabled === !1 && t.enablePlugin(a);
37
37
  }
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(u,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("@supermousejs/utils")):typeof define=="function"&&define.amd?define(["exports","@supermousejs/utils"],l):(u=typeof globalThis<"u"?globalThis:u||self,l(u.SupermouseStates={},u.SupermouseUtils))})(this,(function(u,l){"use strict";const g=t=>{const r=t.attribute??"data-supermouse-state",m=new Set(t.default),f=new Set;Object.values(t.states).forEach(e=>e.forEach(s=>f.add(s))),t.default.forEach(e=>f.add(e));let d="__UNINITIALIZED__";return l.definePlugin({name:"states",priority:-999,install(e){e.registerHoverTarget(`[${r}]`)},update(e){const s=e.state.hoverTarget;let n="default";if(s){const a=s.closest(`[${r}]`);if(a){const i=a.getAttribute(r);i&&t.states[i]&&(n=i)}}if(n===d)return;const S=n==="default"?t.default:t.states[n];for(const a of f){const i=e.getPlugin(a);if(!i)continue;const o=S.includes(a),c=i.isEnabled!==!1;o&&!c&&e.enablePlugin(a),!o&&c&&e.disablePlugin(a)}d=n},destroy(e){for(const s of f){const n=e.getPlugin(s);n&&m.has(s)&&n.isEnabled===!1&&e.enablePlugin(s)}}},t)};u.States=g,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(u,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("@supermousejs/utils")):typeof define=="function"&&define.amd?define(["exports","@supermousejs/utils"],l):(u=typeof globalThis<"u"?globalThis:u||self,l(u.SupermouseStates={},u.SupermouseUtils))})(this,(function(u,l){"use strict";const g=t=>{const d=t.attribute??"data-supermouse-state",S=new Set(t.default),f=new Set;Object.values(t.states).forEach(e=>e.forEach(s=>f.add(s))),t.default.forEach(e=>f.add(e));let o="__UNINITIALIZED__";return l.definePlugin({name:"states",priority:-999,install(e){e.addHoverSelectors(`[${d}]`)},update(e){const s=e.state.hoverTarget;let n="default";if(s){const a=s.closest(`[${d}]`);if(a){const i=a.getAttribute(d);i&&t.states[i]&&(n=i)}}if(n===o)return;const m=n==="default"?t.default:t.states[n];for(const a of f){const i=e.getPlugin(a);if(!i)continue;const r=m.includes(a),c=i.isEnabled!==!1;r&&!c&&e.enablePlugin(a),!r&&c&&e.disablePlugin(a)}o=n},destroy(e){for(const s of f){const n=e.getPlugin(s);n&&S.has(s)&&n.isEnabled===!1&&e.enablePlugin(s)}}},t)};u.States=g,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supermousejs/states",
3
- "version": "2.4.4-beta.3",
3
+ "version": "2.4.4-beta.5",
4
4
  "main": "dist/index.umd.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -14,13 +14,13 @@
14
14
  "url": "https://github.com/Whitestar14/supermouse-js",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@supermousejs/utils": "2.4.4-beta.3"
17
+ "@supermousejs/utils": "2.4.4-beta.5"
18
18
  },
19
19
  "devDependencies": {
20
- "@supermousejs/core": "2.5.0-beta.3"
20
+ "@supermousejs/core": "2.5.0-beta.5"
21
21
  },
22
22
  "peerDependencies": {
23
- "@supermousejs/core": "2.5.0-beta.3"
23
+ "@supermousejs/core": "2.5.0-beta.5"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",