@monstermann/signals-modal 0.0.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.
Files changed (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -0
  3. package/dist/anchor/getAnchorElement.d.ts +4 -0
  4. package/dist/anchor/getAnchorElement.js +9 -0
  5. package/dist/anchor/getAnchorMeasurement.d.ts +6 -0
  6. package/dist/anchor/getAnchorMeasurement.js +10 -0
  7. package/dist/anchor/internals.js +19 -0
  8. package/dist/anchor/setAnchorElement.d.ts +4 -0
  9. package/dist/anchor/setAnchorElement.js +9 -0
  10. package/dist/anchor/withAnchorElement.d.ts +6 -0
  11. package/dist/anchor/withAnchorElement.js +32 -0
  12. package/dist/anchor/withAnchorMeasurement.d.ts +12 -0
  13. package/dist/anchor/withAnchorMeasurement.js +56 -0
  14. package/dist/anchor/withMouseAnchor.d.ts +11 -0
  15. package/dist/anchor/withMouseAnchor.js +57 -0
  16. package/dist/createModal.d.ts +14 -0
  17. package/dist/createModal.js +47 -0
  18. package/dist/floating/getFloatingElement.d.ts +4 -0
  19. package/dist/floating/getFloatingElement.js +9 -0
  20. package/dist/floating/getFloatingMeasurement.d.ts +6 -0
  21. package/dist/floating/getFloatingMeasurement.js +10 -0
  22. package/dist/floating/internals.js +19 -0
  23. package/dist/floating/setFloatingElement.d.ts +4 -0
  24. package/dist/floating/setFloatingElement.js +9 -0
  25. package/dist/floating/withFloatingElement.d.ts +6 -0
  26. package/dist/floating/withFloatingElement.js +32 -0
  27. package/dist/floating/withFloatingMeasurement.d.ts +12 -0
  28. package/dist/floating/withFloatingMeasurement.js +67 -0
  29. package/dist/groups/getDialogs.d.ts +4 -0
  30. package/dist/groups/getDialogs.js +10 -0
  31. package/dist/groups/getGroupsForModal.d.ts +4 -0
  32. package/dist/groups/getGroupsForModal.js +10 -0
  33. package/dist/groups/getModalsForGroup.d.ts +4 -0
  34. package/dist/groups/getModalsForGroup.js +10 -0
  35. package/dist/groups/getPopovers.d.ts +4 -0
  36. package/dist/groups/getPopovers.js +10 -0
  37. package/dist/groups/getTooltips.d.ts +4 -0
  38. package/dist/groups/getTooltips.js +10 -0
  39. package/dist/groups/internals.js +26 -0
  40. package/dist/groups/isDialog.d.ts +4 -0
  41. package/dist/groups/isDialog.js +10 -0
  42. package/dist/groups/isModalInGroup.d.ts +4 -0
  43. package/dist/groups/isModalInGroup.js +9 -0
  44. package/dist/groups/isPopover.d.ts +4 -0
  45. package/dist/groups/isPopover.js +10 -0
  46. package/dist/groups/isTooltip.d.ts +4 -0
  47. package/dist/groups/isTooltip.js +10 -0
  48. package/dist/groups/modalGroups.d.ts +8 -0
  49. package/dist/groups/modalGroups.js +9 -0
  50. package/dist/groups/withModalGroups.d.ts +6 -0
  51. package/dist/groups/withModalGroups.js +29 -0
  52. package/dist/index.d.ts +57 -0
  53. package/dist/index.js +57 -0
  54. package/dist/internals/findParentElement.js +9 -0
  55. package/dist/internals/observeDimensions.js +23 -0
  56. package/dist/internals/observePosition.js +44 -0
  57. package/dist/internals/roundByDPR.js +8 -0
  58. package/dist/position/getModalPosition.d.ts +6 -0
  59. package/dist/position/getModalPosition.js +9 -0
  60. package/dist/position/internals.js +32 -0
  61. package/dist/position/withBoundary.d.ts +11 -0
  62. package/dist/position/withBoundary.js +45 -0
  63. package/dist/position/withPlacement.d.ts +14 -0
  64. package/dist/position/withPlacement.js +75 -0
  65. package/dist/position/withPosition.d.ts +22 -0
  66. package/dist/position/withPosition.js +207 -0
  67. package/dist/status/closeAllModals.d.ts +4 -0
  68. package/dist/status/closeAllModals.js +16 -0
  69. package/dist/status/closeModal.d.ts +4 -0
  70. package/dist/status/closeModal.js +16 -0
  71. package/dist/status/getClosedModals.d.ts +4 -0
  72. package/dist/status/getClosedModals.js +12 -0
  73. package/dist/status/getClosingModals.d.ts +4 -0
  74. package/dist/status/getClosingModals.js +12 -0
  75. package/dist/status/getModalStatus.d.ts +6 -0
  76. package/dist/status/getModalStatus.js +9 -0
  77. package/dist/status/getOpenedModals.d.ts +4 -0
  78. package/dist/status/getOpenedModals.js +12 -0
  79. package/dist/status/getOpeningModals.d.ts +4 -0
  80. package/dist/status/getOpeningModals.js +12 -0
  81. package/dist/status/getVisibleModals.d.ts +4 -0
  82. package/dist/status/getVisibleModals.js +12 -0
  83. package/dist/status/internals.js +30 -0
  84. package/dist/status/isAnyModalClosed.d.ts +4 -0
  85. package/dist/status/isAnyModalClosed.js +9 -0
  86. package/dist/status/isAnyModalClosing.d.ts +4 -0
  87. package/dist/status/isAnyModalClosing.js +9 -0
  88. package/dist/status/isAnyModalOpened.d.ts +4 -0
  89. package/dist/status/isAnyModalOpened.js +9 -0
  90. package/dist/status/isAnyModalOpening.d.ts +4 -0
  91. package/dist/status/isAnyModalOpening.js +9 -0
  92. package/dist/status/isAnyModalVisible.d.ts +4 -0
  93. package/dist/status/isAnyModalVisible.js +9 -0
  94. package/dist/status/isModalClosed.d.ts +4 -0
  95. package/dist/status/isModalClosed.js +10 -0
  96. package/dist/status/isModalClosing.d.ts +4 -0
  97. package/dist/status/isModalClosing.js +9 -0
  98. package/dist/status/isModalOpened.d.ts +4 -0
  99. package/dist/status/isModalOpened.js +9 -0
  100. package/dist/status/isModalOpening.d.ts +4 -0
  101. package/dist/status/isModalOpening.js +9 -0
  102. package/dist/status/isModalVisible.d.ts +4 -0
  103. package/dist/status/isModalVisible.js +9 -0
  104. package/dist/status/onModalClosed.d.ts +6 -0
  105. package/dist/status/onModalClosed.js +12 -0
  106. package/dist/status/onModalClosing.d.ts +6 -0
  107. package/dist/status/onModalClosing.js +12 -0
  108. package/dist/status/onModalOpened.d.ts +6 -0
  109. package/dist/status/onModalOpened.js +12 -0
  110. package/dist/status/onModalOpening.d.ts +6 -0
  111. package/dist/status/onModalOpening.js +12 -0
  112. package/dist/status/openModal.d.ts +4 -0
  113. package/dist/status/openModal.js +16 -0
  114. package/dist/status/setModalStatus.d.ts +6 -0
  115. package/dist/status/setModalStatus.js +9 -0
  116. package/dist/status/types.d.ts +4 -0
  117. package/dist/status/withModalStatus.d.ts +7 -0
  118. package/dist/status/withModalStatus.js +38 -0
  119. package/dist/utils/closeLastModalOnClickOutside.d.ts +4 -0
  120. package/dist/utils/closeLastModalOnClickOutside.js +19 -0
  121. package/dist/utils/closeLastModalOnEsc.d.ts +4 -0
  122. package/dist/utils/closeLastModalOnEsc.js +17 -0
  123. package/dist/utils/syncModalGroupsToBody.d.ts +4 -0
  124. package/dist/utils/syncModalGroupsToBody.js +24 -0
  125. package/package.json +43 -0
@@ -0,0 +1,207 @@
1
+ import { set } from "../node_modules/@monstermann/map/dist/Map/set.js";
2
+ import { remove } from "../node_modules/@monstermann/map/dist/Map/remove.js";
3
+ import { currentModal } from "../createModal.js";
4
+ import { $positions, getBoundaryDown, getBoundaryLeft, getBoundaryRight, getBoundaryUp } from "./internals.js";
5
+ import { roundByDPR } from "../internals/roundByDPR.js";
6
+ import { INTERNAL, effect, memo } from "@monstermann/signals";
7
+ import { Rect, pipe } from "@monstermann/fn";
8
+
9
+ //#region src/position/withPosition.ts
10
+ const path = "@signals-modal/position/withPosition.ts";
11
+ const meta = {
12
+ path,
13
+ line: 296,
14
+ name: "withPosition.$position"
15
+ };
16
+ const meta1 = {
17
+ path,
18
+ line: 305,
19
+ name: "withPosition"
20
+ };
21
+ const positionResolvers = {
22
+ "down-center": function(o) {
23
+ const boundary = getBoundaryDown(o.boundary, o.anchor);
24
+ const floating = pipe(o.floating, Rect.alignCenterX(o.anchor), Rect.snapBelow(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
25
+ const originX = Rect.centerX(o.anchor) - Rect.left(floating);
26
+ return {
27
+ floatingX: Rect.left(floating),
28
+ floatingY: Rect.top(floating),
29
+ maxHeight: Rect.height(boundary),
30
+ maxWidth: Rect.width(boundary),
31
+ originX,
32
+ originY: 0
33
+ };
34
+ },
35
+ "down-left": function(o) {
36
+ const boundary = getBoundaryDown(o.boundary, o.anchor);
37
+ const floating = pipe(o.floating, Rect.alignRight(o.anchor), Rect.snapBelow(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
38
+ const originX = Rect.right(o.anchor) - Rect.left(floating);
39
+ return {
40
+ floatingX: Rect.left(floating),
41
+ floatingY: Rect.top(floating),
42
+ maxHeight: Rect.height(boundary),
43
+ maxWidth: Rect.width(boundary),
44
+ originX,
45
+ originY: 0
46
+ };
47
+ },
48
+ "down-right": function(o) {
49
+ const boundary = getBoundaryDown(o.boundary, o.anchor);
50
+ const floating = pipe(o.floating, Rect.alignLeft(o.anchor), Rect.snapBelow(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
51
+ return {
52
+ floatingX: Rect.left(floating),
53
+ floatingY: Rect.top(floating),
54
+ maxHeight: Rect.height(boundary),
55
+ maxWidth: Rect.width(boundary),
56
+ originX: 0,
57
+ originY: 0
58
+ };
59
+ },
60
+ "left-center": function(o) {
61
+ const boundary = getBoundaryLeft(o.boundary, o.anchor);
62
+ const floating = pipe(o.floating, Rect.alignCenterY(o.anchor), Rect.snapLeftOf(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
63
+ const originX = Rect.width(floating);
64
+ const originY = Rect.centerY(o.anchor) - Rect.top(floating);
65
+ return {
66
+ floatingX: Rect.left(floating),
67
+ floatingY: Rect.top(floating),
68
+ maxHeight: Rect.height(boundary),
69
+ maxWidth: Rect.width(boundary),
70
+ originX,
71
+ originY
72
+ };
73
+ },
74
+ "left-down": function(o) {
75
+ const boundary = getBoundaryLeft(o.boundary, o.anchor);
76
+ const floating = pipe(o.floating, Rect.alignTop(o.anchor), Rect.snapLeftOf(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
77
+ const originX = Rect.width(floating);
78
+ const originY = Rect.centerY(o.anchor) - Rect.top(floating);
79
+ return {
80
+ floatingX: Rect.left(floating),
81
+ floatingY: Rect.top(floating),
82
+ maxHeight: Rect.height(boundary),
83
+ maxWidth: Rect.width(boundary),
84
+ originX,
85
+ originY
86
+ };
87
+ },
88
+ "left-up": function(o) {
89
+ const boundary = getBoundaryLeft(o.boundary, o.anchor);
90
+ const floating = pipe(o.floating, Rect.alignBottom(o.anchor), Rect.snapLeftOf(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
91
+ const originX = Rect.width(floating);
92
+ const originY = Rect.centerY(o.anchor) - Rect.top(floating);
93
+ return {
94
+ floatingX: Rect.left(floating),
95
+ floatingY: Rect.top(floating),
96
+ maxHeight: Rect.height(boundary),
97
+ maxWidth: Rect.width(boundary),
98
+ originX,
99
+ originY
100
+ };
101
+ },
102
+ "right-center": function(o) {
103
+ const boundary = getBoundaryRight(o.boundary, o.anchor);
104
+ const floating = pipe(o.floating, Rect.alignCenterY(o.anchor), Rect.snapRightOf(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
105
+ const originX = 0;
106
+ const originY = Rect.centerY(o.anchor) - Rect.top(floating);
107
+ return {
108
+ floatingX: Rect.left(floating),
109
+ floatingY: Rect.top(floating),
110
+ maxHeight: Rect.height(boundary),
111
+ maxWidth: Rect.width(boundary),
112
+ originX,
113
+ originY
114
+ };
115
+ },
116
+ "right-down": function(o) {
117
+ const boundary = getBoundaryRight(o.boundary, o.anchor);
118
+ const floating = pipe(o.floating, Rect.alignTop(o.anchor), Rect.snapRightOf(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
119
+ const originX = 0;
120
+ const originY = Rect.centerY(o.anchor) - Rect.top(floating);
121
+ return {
122
+ floatingX: Rect.left(floating),
123
+ floatingY: Rect.top(floating),
124
+ maxHeight: Rect.height(boundary),
125
+ maxWidth: Rect.width(boundary),
126
+ originX,
127
+ originY
128
+ };
129
+ },
130
+ "right-up": function(o) {
131
+ const boundary = getBoundaryRight(o.boundary, o.anchor);
132
+ const floating = pipe(o.floating, Rect.alignBottom(o.anchor), Rect.snapRightOf(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
133
+ const originX = 0;
134
+ const originY = Rect.centerY(o.anchor) - Rect.top(floating);
135
+ return {
136
+ floatingX: Rect.left(floating),
137
+ floatingY: Rect.top(floating),
138
+ maxHeight: Rect.height(boundary),
139
+ maxWidth: Rect.width(boundary),
140
+ originX,
141
+ originY
142
+ };
143
+ },
144
+ "up-center": function(o) {
145
+ const boundary = getBoundaryUp(o.boundary, o.anchor);
146
+ const floating = pipe(o.floating, Rect.alignCenterX(o.anchor), Rect.snapAbove(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
147
+ const originX = Rect.centerX(o.anchor) - Rect.left(floating);
148
+ const originY = Rect.height(floating);
149
+ return {
150
+ floatingX: Rect.left(floating),
151
+ floatingY: Rect.top(floating),
152
+ maxHeight: Rect.height(boundary),
153
+ maxWidth: Rect.width(boundary),
154
+ originX,
155
+ originY
156
+ };
157
+ },
158
+ "up-left": function(o) {
159
+ const boundary = getBoundaryUp(o.boundary, o.anchor);
160
+ const floating = pipe(o.floating, Rect.alignRight(o.anchor), Rect.snapAbove(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
161
+ const originX = Rect.right(o.anchor) - Rect.left(floating);
162
+ const originY = Rect.height(floating);
163
+ return {
164
+ floatingX: Rect.left(floating),
165
+ floatingY: Rect.top(floating),
166
+ maxHeight: Rect.height(boundary),
167
+ maxWidth: Rect.width(boundary),
168
+ originX,
169
+ originY
170
+ };
171
+ },
172
+ "up-right": function(o) {
173
+ const boundary = getBoundaryUp(o.boundary, o.anchor);
174
+ const floating = pipe(o.floating, Rect.alignLeft(o.anchor), Rect.snapAbove(o.anchor), Rect.clamp(boundary), Rect.transform(roundByDPR), o.transform);
175
+ const originX = 0;
176
+ const originY = Rect.height(floating);
177
+ return {
178
+ floatingX: Rect.left(floating),
179
+ floatingY: Rect.top(floating),
180
+ maxHeight: Rect.height(boundary),
181
+ maxWidth: Rect.width(boundary),
182
+ originX,
183
+ originY
184
+ };
185
+ }
186
+ };
187
+ function withPosition(options) {
188
+ const modal = currentModal();
189
+ const $position = memo(() => {
190
+ return positionResolvers[options.$placement()]({
191
+ anchor: options.$anchorMeasurement(),
192
+ boundary: options.$boundary(),
193
+ floating: options.$floatingMeasurement(),
194
+ transform: options.transform ?? ((r) => r)
195
+ });
196
+ }, INTERNAL, meta);
197
+ modal.onDispose(effect(() => {
198
+ $positions((p) => set(p, modal.key, $position()));
199
+ }, INTERNAL, meta1));
200
+ modal.onDispose(() => {
201
+ $positions((p) => remove(p, modal.key));
202
+ });
203
+ return $position;
204
+ }
205
+
206
+ //#endregion
207
+ export { withPosition };
@@ -0,0 +1,4 @@
1
+ //#region src/status/closeAllModals.d.ts
2
+ declare function closeAllModals(): void;
3
+ //#endregion
4
+ export { closeAllModals };
@@ -0,0 +1,16 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+ import { untrack } from "@monstermann/signals";
3
+
4
+ //#region src/status/closeAllModals.ts
5
+ function closeAllModals() {
6
+ untrack(() => {
7
+ for (const $status of $keysToStatus().values()) {
8
+ if ($status() === "closed") continue;
9
+ if ($status() === "closing") continue;
10
+ $status("closing");
11
+ }
12
+ });
13
+ }
14
+
15
+ //#endregion
16
+ export { closeAllModals };
@@ -0,0 +1,4 @@
1
+ //#region src/status/closeModal.d.ts
2
+ declare function closeModal(key: string): void;
3
+ //#endregion
4
+ export { closeModal };
@@ -0,0 +1,16 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+ import { untrack } from "@monstermann/signals";
3
+
4
+ //#region src/status/closeModal.ts
5
+ function closeModal(key) {
6
+ untrack(() => {
7
+ const $status = $keysToStatus().get(key);
8
+ if (!$status) return;
9
+ if ($status() === "closing") return;
10
+ if ($status() === "closed") return;
11
+ $status("closing");
12
+ });
13
+ }
14
+
15
+ //#endregion
16
+ export { closeModal };
@@ -0,0 +1,4 @@
1
+ //#region src/status/getClosedModals.d.ts
2
+ declare function getClosedModals(): string[];
3
+ //#endregion
4
+ export { getClosedModals };
@@ -0,0 +1,12 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+
3
+ //#region src/status/getClosedModals.ts
4
+ function getClosedModals() {
5
+ const result = [];
6
+ const map = $keysToStatus();
7
+ for (const [key, $status] of map) if ($status() === "closed") result.push(key);
8
+ return result;
9
+ }
10
+
11
+ //#endregion
12
+ export { getClosedModals };
@@ -0,0 +1,4 @@
1
+ //#region src/status/getClosingModals.d.ts
2
+ declare function getClosingModals(): string[];
3
+ //#endregion
4
+ export { getClosingModals };
@@ -0,0 +1,12 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+
3
+ //#region src/status/getClosingModals.ts
4
+ function getClosingModals() {
5
+ const result = [];
6
+ const map = $keysToStatus();
7
+ for (const [key, $status] of map) if ($status() === "closing") result.push(key);
8
+ return result;
9
+ }
10
+
11
+ //#endregion
12
+ export { getClosingModals };
@@ -0,0 +1,6 @@
1
+ import { ModalStatus } from "./types.js";
2
+
3
+ //#region src/status/getModalStatus.d.ts
4
+ declare function getModalStatus(key: string): ModalStatus;
5
+ //#endregion
6
+ export { getModalStatus };
@@ -0,0 +1,9 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+
3
+ //#region src/status/getModalStatus.ts
4
+ function getModalStatus(key) {
5
+ return $keysToStatus().get(key)?.() ?? "closed";
6
+ }
7
+
8
+ //#endregion
9
+ export { getModalStatus };
@@ -0,0 +1,4 @@
1
+ //#region src/status/getOpenedModals.d.ts
2
+ declare function getOpenedModals(): string[];
3
+ //#endregion
4
+ export { getOpenedModals };
@@ -0,0 +1,12 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+
3
+ //#region src/status/getOpenedModals.ts
4
+ function getOpenedModals() {
5
+ const result = [];
6
+ const map = $keysToStatus();
7
+ for (const [key, $status] of map) if ($status() === "opened") result.push(key);
8
+ return result;
9
+ }
10
+
11
+ //#endregion
12
+ export { getOpenedModals };
@@ -0,0 +1,4 @@
1
+ //#region src/status/getOpeningModals.d.ts
2
+ declare function getOpeningModals(): string[];
3
+ //#endregion
4
+ export { getOpeningModals };
@@ -0,0 +1,12 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+
3
+ //#region src/status/getOpeningModals.ts
4
+ function getOpeningModals() {
5
+ const result = [];
6
+ const map = $keysToStatus();
7
+ for (const [key, $status] of map) if ($status() === "opening") result.push(key);
8
+ return result;
9
+ }
10
+
11
+ //#endregion
12
+ export { getOpeningModals };
@@ -0,0 +1,4 @@
1
+ //#region src/status/getVisibleModals.d.ts
2
+ declare function getVisibleModals(): string[];
3
+ //#endregion
4
+ export { getVisibleModals };
@@ -0,0 +1,12 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+
3
+ //#region src/status/getVisibleModals.ts
4
+ function getVisibleModals() {
5
+ const result = [];
6
+ const map = $keysToStatus();
7
+ for (const [key, $status] of map) if ($status() !== "closed") result.push(key);
8
+ return result;
9
+ }
10
+
11
+ //#endregion
12
+ export { getVisibleModals };
@@ -0,0 +1,30 @@
1
+ import { create } from "../node_modules/@monstermann/set/dist/Set/create.js";
2
+ import { remove } from "../node_modules/@monstermann/set/dist/Set/remove.js";
3
+ import { add } from "../node_modules/@monstermann/set/dist/Set/add.js";
4
+ import { onModalClosed } from "./onModalClosed.js";
5
+ import { onModalOpened } from "./onModalOpened.js";
6
+ import { onModalOpening } from "./onModalOpening.js";
7
+ import { onModalDisposed } from "../createModal.js";
8
+ import { INTERNAL, SILENT, signal } from "@monstermann/signals";
9
+
10
+ //#region src/status/internals.ts
11
+ const path = "@signals-modal/status/internals.ts";
12
+ const meta = {
13
+ path,
14
+ line: 12,
15
+ name: "$keysToStatus"
16
+ };
17
+ const meta1 = {
18
+ path,
19
+ line: 13,
20
+ name: "$openedModals"
21
+ };
22
+ const $keysToStatus = signal(/* @__PURE__ */ new Map(), SILENT, meta);
23
+ const $openedModals = signal(create(), INTERNAL, meta1);
24
+ onModalOpening((key) => $openedModals((m) => remove(m, key)));
25
+ onModalOpened((key) => $openedModals((m) => remove(m, key)));
26
+ onModalClosed((key) => $openedModals((m) => add(m, key)));
27
+ onModalDisposed((key) => $openedModals((m) => add(m, key)));
28
+
29
+ //#endregion
30
+ export { $keysToStatus, $openedModals };
@@ -0,0 +1,4 @@
1
+ //#region src/status/isAnyModalClosed.d.ts
2
+ declare function isAnyModalClosed(): boolean;
3
+ //#endregion
4
+ export { isAnyModalClosed };
@@ -0,0 +1,9 @@
1
+ import { getClosedModals } from "./getClosedModals.js";
2
+
3
+ //#region src/status/isAnyModalClosed.ts
4
+ function isAnyModalClosed() {
5
+ return getClosedModals().length > 0;
6
+ }
7
+
8
+ //#endregion
9
+ export { isAnyModalClosed };
@@ -0,0 +1,4 @@
1
+ //#region src/status/isAnyModalClosing.d.ts
2
+ declare function isAnyModalClosing(): boolean;
3
+ //#endregion
4
+ export { isAnyModalClosing };
@@ -0,0 +1,9 @@
1
+ import { getClosingModals } from "./getClosingModals.js";
2
+
3
+ //#region src/status/isAnyModalClosing.ts
4
+ function isAnyModalClosing() {
5
+ return getClosingModals().length > 0;
6
+ }
7
+
8
+ //#endregion
9
+ export { isAnyModalClosing };
@@ -0,0 +1,4 @@
1
+ //#region src/status/isAnyModalOpened.d.ts
2
+ declare function isAnyModalOpened(): boolean;
3
+ //#endregion
4
+ export { isAnyModalOpened };
@@ -0,0 +1,9 @@
1
+ import { getOpenedModals } from "./getOpenedModals.js";
2
+
3
+ //#region src/status/isAnyModalOpened.ts
4
+ function isAnyModalOpened() {
5
+ return getOpenedModals().length > 0;
6
+ }
7
+
8
+ //#endregion
9
+ export { isAnyModalOpened };
@@ -0,0 +1,4 @@
1
+ //#region src/status/isAnyModalOpening.d.ts
2
+ declare function isAnyModalOpening(): boolean;
3
+ //#endregion
4
+ export { isAnyModalOpening };
@@ -0,0 +1,9 @@
1
+ import { getOpeningModals } from "./getOpeningModals.js";
2
+
3
+ //#region src/status/isAnyModalOpening.ts
4
+ function isAnyModalOpening() {
5
+ return getOpeningModals().length > 0;
6
+ }
7
+
8
+ //#endregion
9
+ export { isAnyModalOpening };
@@ -0,0 +1,4 @@
1
+ //#region src/status/isAnyModalVisible.d.ts
2
+ declare function isAnyModalVisible(): boolean;
3
+ //#endregion
4
+ export { isAnyModalVisible };
@@ -0,0 +1,9 @@
1
+ import { getVisibleModals } from "./getVisibleModals.js";
2
+
3
+ //#region src/status/isAnyModalVisible.ts
4
+ function isAnyModalVisible() {
5
+ return getVisibleModals().length > 0;
6
+ }
7
+
8
+ //#endregion
9
+ export { isAnyModalVisible };
@@ -0,0 +1,4 @@
1
+ //#region src/status/isModalClosed.d.ts
2
+ declare function isModalClosed(key: string): boolean;
3
+ //#endregion
4
+ export { isModalClosed };
@@ -0,0 +1,10 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+
3
+ //#region src/status/isModalClosed.ts
4
+ function isModalClosed(key) {
5
+ const $status = $keysToStatus().get(key);
6
+ return $status === void 0 || $status() === "closed";
7
+ }
8
+
9
+ //#endregion
10
+ export { isModalClosed };
@@ -0,0 +1,4 @@
1
+ //#region src/status/isModalClosing.d.ts
2
+ declare function isModalClosing(key: string): boolean;
3
+ //#endregion
4
+ export { isModalClosing };
@@ -0,0 +1,9 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+
3
+ //#region src/status/isModalClosing.ts
4
+ function isModalClosing(key) {
5
+ return $keysToStatus().get(key)?.() === "closing";
6
+ }
7
+
8
+ //#endregion
9
+ export { isModalClosing };
@@ -0,0 +1,4 @@
1
+ //#region src/status/isModalOpened.d.ts
2
+ declare function isModalOpened(key: string): boolean;
3
+ //#endregion
4
+ export { isModalOpened };
@@ -0,0 +1,9 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+
3
+ //#region src/status/isModalOpened.ts
4
+ function isModalOpened(key) {
5
+ return $keysToStatus().get(key)?.() === "opened";
6
+ }
7
+
8
+ //#endregion
9
+ export { isModalOpened };
@@ -0,0 +1,4 @@
1
+ //#region src/status/isModalOpening.d.ts
2
+ declare function isModalOpening(key: string): boolean;
3
+ //#endregion
4
+ export { isModalOpening };
@@ -0,0 +1,9 @@
1
+ import { $keysToStatus } from "./internals.js";
2
+
3
+ //#region src/status/isModalOpening.ts
4
+ function isModalOpening(key) {
5
+ return $keysToStatus().get(key)?.() === "opening";
6
+ }
7
+
8
+ //#endregion
9
+ export { isModalOpening };
@@ -0,0 +1,4 @@
1
+ //#region src/status/isModalVisible.d.ts
2
+ declare function isModalVisible(key: string): boolean;
3
+ //#endregion
4
+ export { isModalVisible };
@@ -0,0 +1,9 @@
1
+ import { isModalClosed } from "./isModalClosed.js";
2
+
3
+ //#region src/status/isModalVisible.ts
4
+ function isModalVisible(key) {
5
+ return !isModalClosed(key);
6
+ }
7
+
8
+ //#endregion
9
+ export { isModalVisible };
@@ -0,0 +1,6 @@
1
+ import * as _monstermann_signals1 from "@monstermann/signals";
2
+
3
+ //#region src/status/onModalClosed.d.ts
4
+ declare const onModalClosed: _monstermann_signals1.Emitter<string>;
5
+ //#endregion
6
+ export { onModalClosed };
@@ -0,0 +1,12 @@
1
+ import { emitter } from "@monstermann/signals";
2
+
3
+ //#region src/status/onModalClosed.ts
4
+ const meta = {
5
+ path: "@signals-modal/status/onModalClosed.ts",
6
+ line: 3,
7
+ name: "onModalClosed"
8
+ };
9
+ const onModalClosed = emitter(void 0, meta);
10
+
11
+ //#endregion
12
+ export { onModalClosed };
@@ -0,0 +1,6 @@
1
+ import * as _monstermann_signals0 from "@monstermann/signals";
2
+
3
+ //#region src/status/onModalClosing.d.ts
4
+ declare const onModalClosing: _monstermann_signals0.Emitter<string>;
5
+ //#endregion
6
+ export { onModalClosing };
@@ -0,0 +1,12 @@
1
+ import { emitter } from "@monstermann/signals";
2
+
3
+ //#region src/status/onModalClosing.ts
4
+ const meta = {
5
+ path: "@signals-modal/status/onModalClosing.ts",
6
+ line: 3,
7
+ name: "onModalClosing"
8
+ };
9
+ const onModalClosing = emitter(void 0, meta);
10
+
11
+ //#endregion
12
+ export { onModalClosing };
@@ -0,0 +1,6 @@
1
+ import * as _monstermann_signals3 from "@monstermann/signals";
2
+
3
+ //#region src/status/onModalOpened.d.ts
4
+ declare const onModalOpened: _monstermann_signals3.Emitter<string>;
5
+ //#endregion
6
+ export { onModalOpened };
@@ -0,0 +1,12 @@
1
+ import { emitter } from "@monstermann/signals";
2
+
3
+ //#region src/status/onModalOpened.ts
4
+ const meta = {
5
+ path: "@signals-modal/status/onModalOpened.ts",
6
+ line: 3,
7
+ name: "onModalOpened"
8
+ };
9
+ const onModalOpened = emitter(void 0, meta);
10
+
11
+ //#endregion
12
+ export { onModalOpened };
@@ -0,0 +1,6 @@
1
+ import * as _monstermann_signals2 from "@monstermann/signals";
2
+
3
+ //#region src/status/onModalOpening.d.ts
4
+ declare const onModalOpening: _monstermann_signals2.Emitter<string>;
5
+ //#endregion
6
+ export { onModalOpening };
@@ -0,0 +1,12 @@
1
+ import { emitter } from "@monstermann/signals";
2
+
3
+ //#region src/status/onModalOpening.ts
4
+ const meta = {
5
+ path: "@signals-modal/status/onModalOpening.ts",
6
+ line: 3,
7
+ name: "onModalOpening"
8
+ };
9
+ const onModalOpening = emitter(void 0, meta);
10
+
11
+ //#endregion
12
+ export { onModalOpening };