@paroicms/tiny-modal 0.7.0 → 0.7.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.
@@ -23,16 +23,19 @@ export default function initializeTinyModal({ openButton, dialogContent, modalCl
23
23
  bodyEl.appendChild(contentEl instanceof HTMLTemplateElement ? contentEl.content.cloneNode(true) : contentEl);
24
24
  dialogEl.appendChild(bodyEl);
25
25
  document.body.appendChild(dialogEl);
26
+ // change the map to use the specific event union
26
27
  const eventListeners = new Map();
27
- function on(event, listener) {
28
- if (!eventListeners.has(event)) {
29
- eventListeners.set(event, []);
28
+ function on(eventName, listener) {
29
+ if (!eventListeners.has(eventName)) {
30
+ eventListeners.set(eventName, []);
30
31
  }
31
- eventListeners.get(event)?.push(listener);
32
+ eventListeners.get(eventName)?.push(listener);
32
33
  }
33
34
  function trigger(eventName) {
34
35
  if (eventListeners.has(eventName)) {
35
- eventListeners.get(eventName)?.forEach((listener) => listener());
36
+ eventListeners.get(eventName)?.forEach((listener) => {
37
+ listener();
38
+ });
36
39
  }
37
40
  }
38
41
  function open() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/tiny-modal",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Tiny modal library for creating modal dialogs",
5
5
  "author": "Paroi Team",
6
6
  "repository": {
@@ -25,8 +25,8 @@
25
25
  "typings": "dist/tiny-modal.d.ts",
26
26
  "devDependencies": {
27
27
  "rimraf": "~6.0.1",
28
- "sass": "~1.89.2",
29
- "typescript": "~5.9.2"
28
+ "sass": "~1.93.2",
29
+ "typescript": "~5.9.3"
30
30
  },
31
31
  "files": [
32
32
  "dist"