@cocreate/position 1.10.0 → 1.10.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.10.1](https://github.com/CoCreate-app/CoCreate-position/compare/v1.10.0...v1.10.1) (2025-04-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update observer observe param to type and and attributeName to attributeFilter ([0f92890](https://github.com/CoCreate-app/CoCreate-position/commit/0f928908c52fda73d8210cde1a4cbb8126c2dd62))
7
+
1
8
  # [1.10.0](https://github.com/CoCreate-app/CoCreate-position/compare/v1.9.3...v1.10.0) (2024-11-04)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/position",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Make any element draggable and movable. Customizable via attributes, great for popups, alerts, multitasking and displaying multiple views.",
5
5
  "keywords": [
6
6
  "position",
package/src/index.js CHANGED
@@ -1,39 +1,38 @@
1
- import observer from '@cocreate/observer';
2
- import position from './position'
3
- import './index.css'
1
+ import observer from "@cocreate/observer";
2
+ import position from "./position";
3
+ import "./index.css";
4
4
 
5
5
  function init() {
6
- let elements = document.querySelectorAll('[moveable], [positionable]');
7
- initElements(elements)
6
+ let elements = document.querySelectorAll("[moveable], [positionable]");
7
+ initElements(elements);
8
8
  }
9
9
 
10
10
  function initElements(elements) {
11
- for (let element of elements)
12
- initElement(element)
11
+ for (let element of elements) initElement(element);
13
12
  }
14
13
 
15
14
  function initElement(element) {
16
- element.position = new position(element, element.parentElement);
15
+ element.position = new position(element, element.parentElement);
17
16
  }
18
17
 
19
18
  observer.init({
20
- name: "positionAddedNodes",
21
- observe: ['addedNodes'],
22
- selector: '[moveable], [positionable]',
23
- callback: mutation => {
24
- initElement(mutation.target);
25
- }
19
+ name: "positionAddedNodes",
20
+ types: ["addedNodes"],
21
+ selector: "[moveable], [positionable]",
22
+ callback: (mutation) => {
23
+ initElement(mutation.target);
24
+ }
26
25
  });
27
26
 
28
27
  observer.init({
29
- name: "positionAttributes",
30
- observe: ['attributes'],
31
- attributeName: ['moveable', 'positionable'],
32
- callback: mutation => {
33
- initElement(mutation.target);
34
- }
28
+ name: "positionAttributes",
29
+ types: ["attributes"],
30
+ attributeFilter: ["moveable", "positionable"],
31
+ callback: (mutation) => {
32
+ initElement(mutation.target);
33
+ }
35
34
  });
36
35
 
37
- init()
36
+ init();
38
37
 
39
- export default position;
38
+ export default position;