diff --git a/esbuild.config.mjs b/esbuild.config.mjs index 14dce49..934ebe5 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -1,6 +1,6 @@ import esbuild from "esbuild"; import process from "process"; -import builtins from "builtin-modules"; +import { builtinModules as builtins } from "module"; const banner = `/* diff --git a/manifest.json b/manifest.json index b4a21f4..b93bc38 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "mediaviewer", "name": "Media Viewer", - "version": "2.1.2", + "version": "2.1.3", "minAppVersion": "1.8.7", "description": "View and manage media files within your notes.", "author": "Devon22", diff --git a/package-lock.json b/package-lock.json index 5d35df0..a6aa7f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,17 @@ { "name": "mediaviewer", - "version": "2.1.2", + "version": "2.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mediaviewer", - "version": "2.1.2", + "version": "2.1.3", "license": "MIT", "devDependencies": { "@types/node": "^16.11.6", "@typescript-eslint/eslint-plugin": "^8.59.3", "@typescript-eslint/parser": "^8.59.3", - "builtin-modules": "3.3.0", "esbuild": "0.17.3", "eslint": "^10.3.0", "eslint-plugin-obsidianmd": "^0.3.0", @@ -1452,19 +1451,6 @@ "concat-map": "0.0.1" } }, - "node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/call-bind": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", diff --git a/package.json b/package.json index 01954fb..71765bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mediaviewer", - "version": "2.1.2", + "version": "2.1.3", "description": "View and manage media files within your notes.", "main": "main.js", "scripts": { @@ -15,7 +15,6 @@ "@types/node": "^16.11.6", "@typescript-eslint/eslint-plugin": "^8.59.3", "@typescript-eslint/parser": "^8.59.3", - "builtin-modules": "3.3.0", "esbuild": "0.17.3", "eslint": "^10.3.0", "eslint-plugin-obsidianmd": "^0.3.0", diff --git a/styles.css b/styles.css index ea0dc46..6c39762 100644 --- a/styles.css +++ b/styles.css @@ -1,19 +1,19 @@ -.mv-media-viewer-modal { - padding: 0; - background: rgba(0, 0, 0, 0.5); - width: 100vw !important; - height: 100vh !important; - max-width: 100vw !important; - max-height: 100vh !important; - position: fixed !important; - top: 0 !important; - left: 0 !important; - margin: 0 !important; - border-radius: 0 !important; - display: flex !important; - align-items: center !important; - justify-content: center !important; - overflow: auto !important; +.modal.mv-media-viewer-modal { + padding: 0; + background: rgba(0, 0, 0, 0.5); + width: 100vw; + height: 100vh; + max-width: 100vw; + max-height: 100vh; + position: fixed; + top: 0; + left: 0; + margin: 0; + border-radius: 0; + display: flex; + align-items: center; + justify-content: center; + overflow: auto; } .mv-media-viewer-content { @@ -55,16 +55,16 @@ background: rgba(255, 255, 255, 0.5); } -.mv-gallery-close-button { - position: fixed; - top: 15px; - right: 15px; - width: 40px; - height: 40px; - background: rgba(0, 0, 0, 0.5) !important; - border: none; - border-radius: 50%; - color: white !important; +.mv-media-viewer-modal button.mv-gallery-close-button { + position: fixed; + top: 15px; + right: 15px; + width: 40px; + height: 40px; + background: rgba(0, 0, 0, 0.5); + border: none; + border-radius: 50%; + color: white; font-size: 24px; cursor: pointer; display: flex; @@ -74,9 +74,9 @@ transition: background-color 0.3s; } -.mv-gallery-close-button:hover { - background: rgba(255, 0, 0, 0.7) !important; -} +.mv-media-viewer-modal button.mv-gallery-close-button:hover { + background: rgba(255, 0, 0, 0.7); +} .mv-media-thumbnail-container { aspect-ratio: 1; @@ -304,16 +304,16 @@ z-index: 1002; } -.mv-media-close-button { - position: fixed; - top: 15px; - right: 15px; - width: 40px; - height: 40px; - background: rgba(0, 0, 0, 0.5) !important; - border: none; - border-radius: 50%; - color: white !important; +.mv-media-viewer-modal button.mv-media-close-button { + position: fixed; + top: 15px; + right: 15px; + width: 40px; + height: 40px; + background: rgba(0, 0, 0, 0.5); + border: none; + border-radius: 50%; + color: white; font-size: 24px; cursor: pointer; display: flex; @@ -323,9 +323,9 @@ transition: background-color 0.3s; } -.mv-media-close-button:hover { - background: rgba(255, 0, 0, 0.7) !important; -} +.mv-media-viewer-modal button.mv-media-close-button:hover { + background: rgba(255, 0, 0, 0.7); +} .is-mobile:not(.is-tablet) .mv-media-close-button { top: calc(var(--safe-area-inset-top) + 15px); @@ -350,9 +350,9 @@ } /* 隱藏行動裝置上 Obsidian 預設的 modal 關閉按鈕 */ -.is-mobile .mv-media-viewer-modal .modal-close-button { - display: none !important; -} +.is-mobile .modal.mv-media-viewer-modal button.modal-close-button { + display: none; +} .mv-info-item { display: inline-block; @@ -398,14 +398,15 @@ margin: 1em 0; } -.mvgb-media-gallery-grid { - position: relative; - display: grid; - gap: 15px; - padding: 15px; - background-color: var(--background-primary); - border-radius: 8px; -} +.mvgb-media-gallery-grid { + position: relative; + display: grid; + grid-template-columns: repeat(auto-fill, minmax(var(--mv-gallery-thumbnail-width, 150px), 1fr)); + gap: 15px; + padding: 15px; + background: var(--background-secondary); + border-radius: 8px; +} .mvgb-gallery-controls { display: flex; @@ -414,11 +415,13 @@ margin-top: 5px; } -.mvgb-pagination { - display: flex; - align-items: center; - gap: 10px; -} +.mvgb-pagination { + display: flex; + align-items: center; + gap: 10px; + margin: 10px 0; + float: right; +} .mvgb-gallery-control-button { background-color: var(--interactive-accent); @@ -512,15 +515,6 @@ text-decoration: underline; } -.mvgb-media-gallery-grid { - position: relative; - display: grid; - grid-template-columns: repeat(auto-fill, minmax(var(--mv-gallery-thumbnail-width, 150px), 1fr)); - gap: 15px; - padding: 15px; - background: var(--background-secondary); -} - .mvgb-media-gallery-grid.has-container-title { border-radius: 0 8px 8px 8px; } @@ -692,9 +686,9 @@ max-height: 2.8em; } -.mvgb-invalid-link { - color: var(--text-error) !important; -} +.mvgb-note-title.mvgb-invalid-link { + color: var(--text-error); +} .mvgb-note-icon svg { width: 40px; @@ -707,10 +701,10 @@ } /* 移除連結上的圖示 */ -.mvgb-note-icon.external-link { - background-image: none !important; - padding-inline-end: 0; -} +.mvgb-note-icon.mvgb-note-icon.external-link { + background-image: none; + padding-inline-end: 0; +} .mvgb-note-thumbnail:hover .mvgb-note-title { color: var(--text-accent); @@ -729,17 +723,9 @@ background: var(--background-modifier-hover); } -.mvgb-pagination { - display: flex; - align-items: center; - gap: 10px; - margin: 10px 0; - float: right; -} - -.mvgb-pagination button { - padding: 4px 8px; - border: 1px solid var(--interactive-accent); +.mvgb-pagination button { + padding: 4px 8px; + border: 1px solid var(--interactive-accent); border-radius: 4px; background-color: var(--background-primary); color: var(--text-normal);