nodebb-plugin-pdf-secure 1.1.2 → 1.1.3

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 (2) hide show
  1. package/package.json +1 -1
  2. package/static/style.less +15 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-pdf-secure",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Secure PDF viewer plugin for NodeBB - prevents downloading, enables canvas-only rendering with Premium group support",
5
5
  "main": "library.js",
6
6
  "repository": {
package/static/style.less CHANGED
@@ -1,29 +1,19 @@
1
1
  /* PDF Secure Viewer — Inline Embed Styles for NodeBB */
2
2
 
3
- /* Hide NodeBB default file preview icons when PDF is embedded */
4
- [component="post/content"] {
5
-
6
- /* Hide large SVG file icons that NodeBB shows for uploaded files */
7
- >p>svg[viewBox],
8
- >svg[viewBox],
9
- >p>img[alt*=".pdf"],
10
- >img[alt*=".pdf"],
11
- .file-icon,
12
- .attachment-icon {
13
-
14
- &:has(+ .pdf-secure-embed),
15
- &:has(~ .pdf-secure-embed) {
16
- display: none !important;
17
- }
18
- }
3
+ /* AGGRESSIVE: Hide NodeBB's large file preview SVG icons */
4
+ [component="post/content"]>p>svg,
5
+ [component="post/content"]>svg,
6
+ [component="post/content"] svg[viewBox="0 0 24 24"]:not(.pdf-secure-embed svg) {
7
+ display: none !important;
19
8
  }
20
9
 
21
- /* Force hide any orphaned file icons near our embeds */
22
- .pdf-secure-embed~svg,
23
- .pdf-secure-embed~img[alt*=".pdf"],
24
- svg:has(+ .pdf-secure-embed),
25
- img[alt*=".pdf"]:has(+ .pdf-secure-embed) {
26
- display: none !important;
10
+ /* Hide any standalone large SVG that looks like a file icon */
11
+ [component="post/content"]>p:has(svg[viewBox]) {
12
+
13
+ /* If paragraph only contains an SVG, hide the whole paragraph */
14
+ &:not(:has(.pdf-secure-embed)):not(:has(a)):not(:has(span)):not(:has(img)) {
15
+ display: none !important;
16
+ }
27
17
  }
28
18
 
29
19
  /* Embedded PDF Container */
@@ -60,6 +50,8 @@ img[alt*=".pdf"]:has(+ .pdf-secure-embed) {
60
50
  height: 20px;
61
51
  fill: #e81224;
62
52
  flex-shrink: 0;
53
+ /* Make sure our header icon is visible */
54
+ display: inline-block !important;
63
55
  }
64
56
 
65
57
  .pdf-secure-embed-title span {
@@ -95,6 +87,7 @@ img[alt*=".pdf"]:has(+ .pdf-secure-embed) {
95
87
  width: 18px;
96
88
  height: 18px;
97
89
  fill: #fff;
90
+ display: inline-block !important;
98
91
  }
99
92
 
100
93
  /* Viewer Body */