@paroicms/tiny-modal 0.7.2 → 0.7.4

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.
@@ -7,6 +7,7 @@
7
7
  margin: auto;
8
8
  max-height: 100dvh;
9
9
  max-width: 100dvw;
10
+ overflow: visible;
10
11
  padding: 0;
11
12
  position: fixed;
12
13
  }
@@ -90,15 +90,12 @@ function loadCssFromModuleUrl() {
90
90
  const moduleUrl = import.meta.url;
91
91
  if (!moduleUrl)
92
92
  throw new Error("import.meta.url not available");
93
- // Derive CSS URL from the module URL
94
- // e.g., https://esm.sh/@paroicms/tiny-modal@0.7.1 -> https://esm.sh/@paroicms/tiny-modal@0.7.1/dist/tiny-modal.css
95
- // or https://esm.sh/@paroicms/tiny-modal@0.7.1/dist/tiny-modal.js -> https://esm.sh/@paroicms/tiny-modal@0.7.1/dist/tiny-modal.css
96
- const cssUrl = moduleUrl.replace(/\/[^/]+\.m?js$/, () => {
97
- if (moduleUrl.includes("/dist/")) {
98
- return "/tiny-modal.css";
99
- }
100
- return "/dist/tiny-modal.css";
101
- });
93
+ // Derive CSS URL from the module URL by extracting the package root
94
+ // CDNs like esm.sh may transform JS paths (e.g., add /es2022/), but CSS stays in /dist/
95
+ // e.g., https://esm.sh/@paroicms/tiny-modal@0.7.3/es2022/tiny-modal.mjs
96
+ // -> https://esm.sh/@paroicms/tiny-modal@0.7.3/dist/tiny-modal.css
97
+ const packageRootUrl = moduleUrl.replace(/\/(?:es\d{4}|esnext|deno|denonext|node|dist)\/.*$/, "");
98
+ const cssUrl = `${packageRootUrl}/dist/tiny-modal.css`;
102
99
  // Check if CSS is already loaded
103
100
  if (document.querySelector(`link[href="${cssUrl}"]`)) {
104
101
  cssLoaded = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/tiny-modal",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "Tiny modal library for creating modal dialogs",
5
5
  "author": "Paroi Team",
6
6
  "repository": {
@@ -24,8 +24,8 @@
24
24
  "main": "dist/tiny-modal.js",
25
25
  "typings": "dist/tiny-modal.d.ts",
26
26
  "devDependencies": {
27
- "rimraf": "~6.0.1",
28
- "sass": "~1.93.2",
27
+ "rimraf": "~6.1.0",
28
+ "sass": "~1.94.0",
29
29
  "typescript": "~5.9.3"
30
30
  },
31
31
  "files": [