@monstermann/signals-modal 0.4.5 → 0.5.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,7 +1,6 @@
1
1
  import { Rect } from "@monstermann/geometry";
2
2
 
3
3
  //#region src/anchor/getAnchorMeasurement.d.ts
4
-
5
4
  /**
6
5
  * # getAnchorMeasurement
7
6
  *
@@ -1,7 +1,6 @@
1
1
  import { Signal } from "@monstermann/signals";
2
2
 
3
3
  //#region src/anchor/withAnchorElement.d.ts
4
-
5
4
  /**
6
5
  * # withAnchorElement
7
6
  *
@@ -3,7 +3,6 @@ import { Memo, Reactive } from "@monstermann/signals";
3
3
  import { Rect } from "@monstermann/geometry";
4
4
 
5
5
  //#region src/anchor/withAnchorMeasurement.d.ts
6
-
7
6
  /**
8
7
  * # withAnchorMeasurement
9
8
  *
@@ -3,7 +3,6 @@ import { Memo, Reactive } from "@monstermann/signals";
3
3
  import { Rect } from "@monstermann/geometry";
4
4
 
5
5
  //#region src/anchor/withMouseAnchor.d.ts
6
-
7
6
  /**
8
7
  * # withMouseAnchor
9
8
  *
@@ -1,7 +1,6 @@
1
1
  import { Rect } from "@monstermann/geometry";
2
2
 
3
3
  //#region src/floating/getFloatingMeasurement.d.ts
4
-
5
4
  /**
6
5
  * # getFloatingMeasurement
7
6
  *
@@ -1,7 +1,6 @@
1
1
  import { Signal } from "@monstermann/signals";
2
2
 
3
3
  //#region src/floating/withFloatingElement.d.ts
4
-
5
4
  /**
6
5
  * # withFloatingElement
7
6
  *
@@ -3,7 +3,6 @@ import { Memo, Reactive } from "@monstermann/signals";
3
3
  import { Rect } from "@monstermann/geometry";
4
4
 
5
5
  //#region src/floating/withFloatingMeasurement.d.ts
6
-
7
6
  /**
8
7
  * # withFloatingMeasurement
9
8
  *
@@ -82,11 +82,11 @@ function withFloatingMeasurement(options) {
82
82
  top: 0,
83
83
  width: bounds.width
84
84
  });
85
- return observeDimensions(element, (bounds$1) => $rect({
86
- height: bounds$1.height,
85
+ return observeDimensions(element, (bounds) => $rect({
86
+ height: bounds.height,
87
87
  left: 0,
88
88
  top: 0,
89
- width: bounds$1.width
89
+ width: bounds.width
90
90
  }));
91
91
  }, INTERNAL, meta2));
92
92
  $floatingMeasurements((map) => map.set(modal.key, $rect));
@@ -1,7 +1,6 @@
1
1
  import { Memo } from "@monstermann/signals";
2
2
 
3
3
  //#region src/groups/withModalGroups.d.ts
4
-
5
4
  /**
6
5
  * # withModalGroups
7
6
  *
@@ -12,9 +12,9 @@ function observeDimensions(element, onResize) {
12
12
  observers.set(element, callbacks);
13
13
  ro.observe(element);
14
14
  return () => {
15
- const callbacks$1 = observers.get(element);
16
- callbacks$1?.delete(onResize);
17
- if (callbacks$1 && callbacks$1.size > 0) return;
15
+ const callbacks = observers.get(element);
16
+ callbacks?.delete(onResize);
17
+ if (callbacks && callbacks.size > 0) return;
18
18
  ro.unobserve(element);
19
19
  };
20
20
  }
@@ -1,7 +1,6 @@
1
1
  import { ModalPlacement } from "./withPlacement.mjs";
2
2
 
3
3
  //#region src/position/getModalPlacement.d.ts
4
-
5
4
  /**
6
5
  * # getModalPlacement
7
6
  *
@@ -1,7 +1,6 @@
1
1
  import { ModalPosition } from "./withPosition.mjs";
2
2
 
3
3
  //#region src/position/getModalPosition.d.ts
4
-
5
4
  /**
6
5
  * # getModalPosition
7
6
  *
@@ -3,7 +3,6 @@ import { Memo, Reactive } from "@monstermann/signals";
3
3
  import { Rect } from "@monstermann/geometry";
4
4
 
5
5
  //#region src/position/withBoundary.d.ts
6
-
7
6
  /**
8
7
  * # withBoundary
9
8
  *
@@ -2,7 +2,6 @@ import { ModalStatus } from "../status/types.mjs";
2
2
  import { Reactive } from "@monstermann/signals";
3
3
 
4
4
  //#region src/scroll/withCloseOnScroll.d.ts
5
-
6
5
  /**
7
6
  * # withCloseOnScroll
8
7
  *
@@ -53,9 +53,9 @@ function withCloseOnScroll(options) {
53
53
  if (!element) return;
54
54
  if (status === "closing" || status === "closed") return;
55
55
  const overflowElements = getScrollableAncestors(element);
56
- for (const element$1 of overflowElements) element$1.addEventListener("scroll", onScroll, { passive: true });
56
+ for (const element of overflowElements) element.addEventListener("scroll", onScroll, { passive: true });
57
57
  return () => {
58
- for (const element$1 of overflowElements) element$1.removeEventListener("scroll", onScroll);
58
+ for (const element of overflowElements) element.removeEventListener("scroll", onScroll);
59
59
  };
60
60
  }, INTERNAL, meta));
61
61
  }
@@ -1,7 +1,6 @@
1
1
  import { ModalStatus } from "./types.mjs";
2
2
 
3
3
  //#region src/status/getModalStatus.d.ts
4
-
5
4
  /**
6
5
  * # getModalStatus
7
6
  *
@@ -1,7 +1,6 @@
1
1
  import * as _monstermann_signals0 from "@monstermann/signals";
2
2
 
3
3
  //#region src/status/onModalClosed.d.ts
4
-
5
4
  /**
6
5
  * # onModalClosed
7
6
  *
@@ -1,7 +1,6 @@
1
- import * as _monstermann_signals2 from "@monstermann/signals";
1
+ import * as _monstermann_signals0 from "@monstermann/signals";
2
2
 
3
3
  //#region src/status/onModalClosing.d.ts
4
-
5
4
  /**
6
5
  * # onModalClosing
7
6
  *
@@ -32,6 +31,6 @@ import * as _monstermann_signals2 from "@monstermann/signals";
32
31
  * ```
33
32
  *
34
33
  */
35
- declare const onModalClosing: _monstermann_signals2.Emitter<string>;
34
+ declare const onModalClosing: _monstermann_signals0.Emitter<string>;
36
35
  //#endregion
37
36
  export { onModalClosing };
@@ -1,7 +1,6 @@
1
- import * as _monstermann_signals1 from "@monstermann/signals";
1
+ import * as _monstermann_signals0 from "@monstermann/signals";
2
2
 
3
3
  //#region src/status/onModalOpened.d.ts
4
-
5
4
  /**
6
5
  * # onModalOpened
7
6
  *
@@ -32,6 +31,6 @@ import * as _monstermann_signals1 from "@monstermann/signals";
32
31
  * ```
33
32
  *
34
33
  */
35
- declare const onModalOpened: _monstermann_signals1.Emitter<string>;
34
+ declare const onModalOpened: _monstermann_signals0.Emitter<string>;
36
35
  //#endregion
37
36
  export { onModalOpened };
@@ -1,7 +1,6 @@
1
- import * as _monstermann_signals3 from "@monstermann/signals";
1
+ import * as _monstermann_signals0 from "@monstermann/signals";
2
2
 
3
3
  //#region src/status/onModalOpening.d.ts
4
-
5
4
  /**
6
5
  * # onModalOpening
7
6
  *
@@ -32,6 +31,6 @@ import * as _monstermann_signals3 from "@monstermann/signals";
32
31
  * ```
33
32
  *
34
33
  */
35
- declare const onModalOpening: _monstermann_signals3.Emitter<string>;
34
+ declare const onModalOpening: _monstermann_signals0.Emitter<string>;
36
35
  //#endregion
37
36
  export { onModalOpening };
@@ -1,7 +1,6 @@
1
1
  import { ModalStatus } from "./types.mjs";
2
2
 
3
3
  //#region src/status/setModalStatus.d.ts
4
-
5
4
  /**
6
5
  * # setModalStatus
7
6
  *
@@ -2,7 +2,6 @@ import { ModalStatus } from "./types.mjs";
2
2
  import { Memo, Signal } from "@monstermann/signals";
3
3
 
4
4
  //#region src/status/withModalStatus.d.ts
5
-
6
5
  /**
7
6
  * # withModalStatus
8
7
  *
@@ -74,11 +74,11 @@ function withModalStatus(status = "closed") {
74
74
  keys.delete(modal.key);
75
75
  return keys;
76
76
  }));
77
- modal.onDispose(watch($status, (status$1) => {
78
- if (status$1 === "closed") onModalClosed(modal.key);
79
- else if (status$1 === "closing") onModalClosing(modal.key);
80
- else if (status$1 === "opening") onModalOpening(modal.key);
81
- else if (status$1 === "opened") onModalOpened(modal.key);
77
+ modal.onDispose(watch($status, (status) => {
78
+ if (status === "closed") onModalClosed(modal.key);
79
+ else if (status === "closing") onModalClosing(modal.key);
80
+ else if (status === "opening") onModalOpening(modal.key);
81
+ else if (status === "opened") onModalOpened(modal.key);
82
82
  }, INTERNAL, meta1));
83
83
  return {
84
84
  $isOpen: memo(() => isModalOpen(modal.key), void 0, meta2),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@monstermann/signals-modal",
3
3
  "type": "module",
4
- "version": "0.4.5",
4
+ "version": "0.5.0",
5
5
  "description": "Composable modal management.",
6
6
  "author": "Michael Ostermann <michaelostermann@me.com>",
7
7
  "license": "MIT",
@@ -33,12 +33,12 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@monstermann/dfdl": "^0.1.0",
36
- "@monstermann/geometry": "^0.3.0",
37
- "@monstermann/signals": "^0.2.2",
36
+ "@monstermann/geometry": "^0.4.0",
37
+ "@monstermann/signals": "^0.3.0",
38
38
  "@monstermann/signals-web": "^0.2.4"
39
39
  },
40
40
  "devDependencies": {
41
- "@monstermann/unplugin-geometry": "^0.3.0",
42
- "@monstermann/unplugin-signals": "^0.2.2"
41
+ "@monstermann/unplugin-geometry": "^0.4.0",
42
+ "@monstermann/unplugin-signals": "^0.3.0"
43
43
  }
44
44
  }