Skip to content

Commit ba6c643

Browse files
committed
Release v2.1.1
1 parent 54414e4 commit ba6c643

File tree

5 files changed

+30
-54
lines changed

5 files changed

+30
-54
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
9+
## [2.1.1] - 2025-05-08
810
### Fixed
911
- Return value for `closeby`
1012

dist/index.cjs

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,25 @@ function dialog_default(Alpine) {
4646
}
4747
}
4848
function escapeDialog(event) {
49-
if (event.key !== "Escape")
50-
return;
49+
if (event.key !== "Escape") return;
5150
event.preventDefault();
52-
if (closeby !== "any" && closeby !== "closerequest")
53-
return;
51+
if (closeby !== "any" && closeby !== "closerequest") return;
5452
evaluate();
5553
}
5654
function backdropDialog(event) {
57-
if (event.target !== el || closeby !== "any")
58-
return;
55+
if (event.target !== el || closeby !== "any") return;
5956
const rect = el.getBoundingClientRect();
6057
const isInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
61-
if (isInDialog)
62-
return;
58+
if (isInDialog) return;
6359
evaluate();
6460
}
6561
el._x_doShow = () => {
66-
if (el.hasAttribute("open"))
67-
return;
62+
if (el.hasAttribute("open")) return;
6863
el.showModal();
6964
scrollLock(lockPageScroll);
7065
};
7166
el._x_doHide = () => {
72-
if (!el.hasAttribute("open"))
73-
return;
67+
if (!el.hasAttribute("open")) return;
7468
el.close();
7569
scrollLock(false);
7670
};
@@ -83,25 +77,21 @@ function dialog_default(Alpine) {
8377
}
8478
}
8579
function modifierValue(modifiers, key, fallback) {
86-
if (modifiers.indexOf(key) === -1)
87-
return fallback;
80+
if (modifiers.indexOf(key) === -1) return fallback;
8881
const rawValue = modifiers[modifiers.indexOf(key) + 1];
89-
if (!rawValue)
90-
return fallback;
82+
if (!rawValue) return fallback;
9183
if (key === "closeby") {
9284
const allowedValues = ["auto", "none", "closerequest", "any"];
9385
const options = allowedValues.join(", ");
9486
if (!allowedValues.includes(rawValue)) {
9587
console.warn(
9688
`"${rawValue}" is not one of the allowed values for closeby: ${options}`
9789
);
90+
return fallback;
9891
}
99-
return fallback;
10092
}
10193
return rawValue;
10294
}
10395

10496
// src/module.js
10597
var module_default = dialog_default;
106-
// Annotate the CommonJS export names for ESM import in node:
107-
0 && (module.exports = {});

dist/index.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,25 @@
2222
}
2323
}
2424
function escapeDialog(event) {
25-
if (event.key !== "Escape")
26-
return;
25+
if (event.key !== "Escape") return;
2726
event.preventDefault();
28-
if (closeby !== "any" && closeby !== "closerequest")
29-
return;
27+
if (closeby !== "any" && closeby !== "closerequest") return;
3028
evaluate();
3129
}
3230
function backdropDialog(event) {
33-
if (event.target !== el || closeby !== "any")
34-
return;
31+
if (event.target !== el || closeby !== "any") return;
3532
const rect = el.getBoundingClientRect();
3633
const isInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
37-
if (isInDialog)
38-
return;
34+
if (isInDialog) return;
3935
evaluate();
4036
}
4137
el._x_doShow = () => {
42-
if (el.hasAttribute("open"))
43-
return;
38+
if (el.hasAttribute("open")) return;
4439
el.showModal();
4540
scrollLock(lockPageScroll);
4641
};
4742
el._x_doHide = () => {
48-
if (!el.hasAttribute("open"))
49-
return;
43+
if (!el.hasAttribute("open")) return;
5044
el.close();
5145
scrollLock(false);
5246
};
@@ -59,20 +53,18 @@
5953
}
6054
}
6155
function modifierValue(modifiers, key, fallback) {
62-
if (modifiers.indexOf(key) === -1)
63-
return fallback;
56+
if (modifiers.indexOf(key) === -1) return fallback;
6457
const rawValue = modifiers[modifiers.indexOf(key) + 1];
65-
if (!rawValue)
66-
return fallback;
58+
if (!rawValue) return fallback;
6759
if (key === "closeby") {
6860
const allowedValues = ["auto", "none", "closerequest", "any"];
6961
const options = allowedValues.join(", ");
7062
if (!allowedValues.includes(rawValue)) {
7163
console.warn(
7264
`"${rawValue}" is not one of the allowed values for closeby: ${options}`
7365
);
66+
return fallback;
7467
}
75-
return fallback;
7668
}
7769
return rawValue;
7870
}

dist/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.mjs

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,25 @@ function dialog_default(Alpine) {
2121
}
2222
}
2323
function escapeDialog(event) {
24-
if (event.key !== "Escape")
25-
return;
24+
if (event.key !== "Escape") return;
2625
event.preventDefault();
27-
if (closeby !== "any" && closeby !== "closerequest")
28-
return;
26+
if (closeby !== "any" && closeby !== "closerequest") return;
2927
evaluate();
3028
}
3129
function backdropDialog(event) {
32-
if (event.target !== el || closeby !== "any")
33-
return;
30+
if (event.target !== el || closeby !== "any") return;
3431
const rect = el.getBoundingClientRect();
3532
const isInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
36-
if (isInDialog)
37-
return;
33+
if (isInDialog) return;
3834
evaluate();
3935
}
4036
el._x_doShow = () => {
41-
if (el.hasAttribute("open"))
42-
return;
37+
if (el.hasAttribute("open")) return;
4338
el.showModal();
4439
scrollLock(lockPageScroll);
4540
};
4641
el._x_doHide = () => {
47-
if (!el.hasAttribute("open"))
48-
return;
42+
if (!el.hasAttribute("open")) return;
4943
el.close();
5044
scrollLock(false);
5145
};
@@ -58,20 +52,18 @@ function dialog_default(Alpine) {
5852
}
5953
}
6054
function modifierValue(modifiers, key, fallback) {
61-
if (modifiers.indexOf(key) === -1)
62-
return fallback;
55+
if (modifiers.indexOf(key) === -1) return fallback;
6356
const rawValue = modifiers[modifiers.indexOf(key) + 1];
64-
if (!rawValue)
65-
return fallback;
57+
if (!rawValue) return fallback;
6658
if (key === "closeby") {
6759
const allowedValues = ["auto", "none", "closerequest", "any"];
6860
const options = allowedValues.join(", ");
6961
if (!allowedValues.includes(rawValue)) {
7062
console.warn(
7163
`"${rawValue}" is not one of the allowed values for closeby: ${options}`
7264
);
65+
return fallback;
7366
}
74-
return fallback;
7567
}
7668
return rawValue;
7769
}

0 commit comments

Comments
 (0)