@vaadin-component-factory/vcf-pdf-viewer 4.0.2 → 4.2.0

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.
@@ -1,144 +1,144 @@
1
- import {
2
- registerStyles,
3
- css,
4
- } from "@vaadin/vaadin-themable-mixin/register-styles.js";
5
-
6
- registerStyles(
7
- "vcf-pdf-viewer",
8
- css`
9
- :host {
10
- --pdf-viewer-background-color: var(--vaadin-background-color);
11
- --pdf-viewer-container-background-color: var(--vaadin-background-container);
12
- --pdf-viewer-border-color: var(--vaadin-border-color);
13
- --pdf-viewer-border-radius: var(--vaadin-radius-m);
14
- --pdf-viewer-box-shadow-color: var(--vaadin-focus-ring-color);
15
-
16
- --pdf-viewer-previous-page-button-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M4.5 15.75L12 8.25L19.5 15.75" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');
17
- --pdf-viewer-next-page-button-icon: var(--_vaadin-icon-chevron-down);
18
- --pdf-viewer-toggle-button-icon-closed: var(--_vaadin-icon-menu);
19
- --pdf-viewer-toggle-button-icon-open: var(--_vaadin-icon-menu);
20
-
21
- --vaadin-focus-ring-width: 2px;
22
- background-color: var(--pdf-viewer-background-color);
23
- border: 1px solid var(--pdf-viewer-border-color);
24
- border-radius: var(--pdf-viewer-border-radius);
25
- position: relative;
26
- }
27
-
28
- :host([data-application-theme="lumo"]) {
29
- --pdf-viewer-background-color: var(--lumo-base-color);
30
- --pdf-viewer-container-background-color: var(--lumo-contrast-5pct);
31
- --pdf-viewer-border-color: var(--lumo-contrast-10pct);
32
- --pdf-viewer-border-radius: var(--lumo-border-radius-m);
33
- --pdf-viewer-font-family: var(--lumo-font-family);
34
- --pdf-viewer-box-shadow-color: var(--lumo-primary-color-50pct);
35
-
36
- --pdf-viewer-icon-font-family: "lumo-icons";
37
- --pdf-viewer-previous-page-button-icon: var(--lumo-icons-angle-up);
38
- --pdf-viewer-next-page-button-icon: var(--lumo-icons-angle-down);
39
- --pdf-viewer-toggle-button-icon-closed: var(--lumo-icons-chevron-right);
40
- --pdf-viewer-toggle-button-icon-open: var(--lumo-icons-chevron-left);
41
- }
42
-
43
- [part~="viewer-container"] {
44
- background-color: var(--pdf-viewer-container-background-color);
45
- outline: none;
46
- }
47
-
48
- [part~="viewer-container"][focus-ring] {
49
- box-shadow: 0 0 0 var(--vaadin-focus-ring-width) var(--pdf-viewer-box-shadow-color);
50
- }
51
-
52
- [part~="toolbar"] {
53
- display: flex;
54
- flex-direction: row;
55
- align-items: center;
56
- border-bottom: 1px solid var(--pdf-viewer-border-color);
57
- padding-left: var(--vaadin-padding-xs);
58
- padding-right: var(--vaadin-padding-m);
59
- gap: var(--vaadin-gap-s);
60
- z-index: 2;
61
- }
62
-
63
- [part~="toolbar-pages"] {
64
- display: flex;
65
- flex-direction: row;
66
- flex: 1;
67
- align-items: center;
68
- justify-content: flex-end;
69
- }
70
-
71
- ::slotted(.toolbar-current-page) {
72
- width: 3.25em;
73
- }
74
-
75
- [part~="toolbar-page-separator"] {
76
- padding: 0 var(--vaadin-padding-xs);
77
- }
78
-
79
- [part~="toolbar-total-pages"] {
80
- padding-right: var(--vaadin-padding-m);
81
- }
82
-
83
- [part~="toolbar-title"] {
84
- line-height: 2.25rem;
85
- display: inline-block;
86
- color: var(--lumo-header-title-color, var(--vaadin-text-color));
87
- padding: var(--vaadin-padding-xs) 0;
88
- flex: 1;
89
- white-space: nowrap;
90
- overflow: hidden;
91
- text-overflow: ellipsis;
92
- }
93
-
94
- .page {
95
- padding: var(--vaadin-padding-m);
96
- padding-bottom: 0;
97
- }
98
-
99
- .page:last-child {
100
- padding-bottom: var(--vaadin-padding-m);
101
- }
102
-
103
- .textLayer {
104
- top: var(--vaadin-padding-m);
105
- right: var(--vaadin-padding-m);
106
- bottom: var(--vaadin-padding-m);
107
- left: var(--vaadin-padding-m);
108
- opacity: 0.2;
109
- }
110
-
111
- .textLayer ::-moz-selection {
112
- background: rgb(0, 0, 255);
113
- }
114
-
115
- .textLayer ::selection {
116
- background: rgb(0, 0, 255);
117
- }
118
-
119
- .textLayer .highlight {
120
- background-color: rgb(180, 0, 170);
121
- border-radius: 4px;
122
- }
123
-
124
- .textLayer .highlight.selected {
125
- background-color: rgb(0, 100, 0);
126
- }
127
-
128
- [part~="toolbar"].small-size [part~="toolbar-pages"] {
129
- flex: none;
130
- }
131
-
132
- [part~="toolbar"].small-size ::slotted(.toolbar-zoom) {
133
- position: absolute;
134
- bottom: var(--vaadin-padding-s);
135
- left: 50%;
136
- margin-left: -100px;
137
- background-color: white;
138
- box-shadow: var(--lumo-box-shadow-m);
139
- padding: var(--vaadin-padding-xs);
140
- z-index: 99;
141
- }
142
- `,
143
- { moduleId: "lumo-vcf-pdf-viewer" },
144
- );
1
+ import {
2
+ registerStyles,
3
+ css,
4
+ } from "@vaadin/vaadin-themable-mixin/register-styles.js";
5
+
6
+ registerStyles(
7
+ "vcf-pdf-viewer",
8
+ css`
9
+ :host {
10
+ --pdf-viewer-background-color: var(--vaadin-background-color);
11
+ --pdf-viewer-container-background-color: var(--vaadin-background-container);
12
+ --pdf-viewer-border-color: var(--vaadin-border-color);
13
+ --pdf-viewer-border-radius: var(--vaadin-radius-m);
14
+ --pdf-viewer-box-shadow-color: var(--vaadin-focus-ring-color);
15
+
16
+ --pdf-viewer-previous-page-button-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M4.5 15.75L12 8.25L19.5 15.75" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');
17
+ --pdf-viewer-next-page-button-icon: var(--_vaadin-icon-chevron-down);
18
+ --pdf-viewer-toggle-button-icon-closed: var(--_vaadin-icon-menu);
19
+ --pdf-viewer-toggle-button-icon-open: var(--_vaadin-icon-menu);
20
+
21
+ --vaadin-focus-ring-width: 2px;
22
+ background-color: var(--pdf-viewer-background-color);
23
+ border: 1px solid var(--pdf-viewer-border-color);
24
+ border-radius: var(--pdf-viewer-border-radius);
25
+ position: relative;
26
+ }
27
+
28
+ :host([data-application-theme="lumo"]) {
29
+ --pdf-viewer-background-color: var(--lumo-base-color);
30
+ --pdf-viewer-container-background-color: var(--lumo-contrast-5pct);
31
+ --pdf-viewer-border-color: var(--lumo-contrast-10pct);
32
+ --pdf-viewer-border-radius: var(--lumo-border-radius-m);
33
+ --pdf-viewer-font-family: var(--lumo-font-family);
34
+ --pdf-viewer-box-shadow-color: var(--lumo-primary-color-50pct);
35
+
36
+ --pdf-viewer-icon-font-family: "lumo-icons";
37
+ --pdf-viewer-previous-page-button-icon: var(--lumo-icons-angle-up);
38
+ --pdf-viewer-next-page-button-icon: var(--lumo-icons-angle-down);
39
+ --pdf-viewer-toggle-button-icon-closed: var(--lumo-icons-chevron-right);
40
+ --pdf-viewer-toggle-button-icon-open: var(--lumo-icons-chevron-left);
41
+ }
42
+
43
+ [part~="viewer-container"] {
44
+ background-color: var(--pdf-viewer-container-background-color);
45
+ outline: none;
46
+ }
47
+
48
+ [part~="viewer-container"][focus-ring] {
49
+ box-shadow: 0 0 0 var(--vaadin-focus-ring-width) var(--pdf-viewer-box-shadow-color);
50
+ }
51
+
52
+ [part~="toolbar"] {
53
+ display: flex;
54
+ flex-direction: row;
55
+ align-items: center;
56
+ border-bottom: 1px solid var(--pdf-viewer-border-color);
57
+ padding-left: var(--vaadin-padding-xs);
58
+ padding-right: var(--vaadin-padding-m);
59
+ gap: var(--vaadin-gap-s);
60
+ z-index: 2;
61
+ }
62
+
63
+ [part~="toolbar-pages"] {
64
+ display: flex;
65
+ flex-direction: row;
66
+ flex: 1;
67
+ align-items: center;
68
+ justify-content: flex-end;
69
+ }
70
+
71
+ ::slotted(.toolbar-current-page) {
72
+ width: 3.25em;
73
+ }
74
+
75
+ [part~="toolbar-page-separator"] {
76
+ padding: 0 var(--vaadin-padding-xs);
77
+ }
78
+
79
+ [part~="toolbar-total-pages"] {
80
+ padding-right: var(--vaadin-padding-m);
81
+ }
82
+
83
+ [part~="toolbar-title"] {
84
+ line-height: 2.25rem;
85
+ display: inline-block;
86
+ color: var(--lumo-header-title-color, var(--vaadin-text-color));
87
+ padding: var(--vaadin-padding-xs) 0;
88
+ flex: 1;
89
+ white-space: nowrap;
90
+ overflow: hidden;
91
+ text-overflow: ellipsis;
92
+ }
93
+
94
+ .page {
95
+ padding: var(--vaadin-padding-m);
96
+ padding-bottom: 0;
97
+ }
98
+
99
+ .page:last-child {
100
+ padding-bottom: var(--vaadin-padding-m);
101
+ }
102
+
103
+ .textLayer {
104
+ top: var(--vaadin-padding-m);
105
+ right: var(--vaadin-padding-m);
106
+ bottom: var(--vaadin-padding-m);
107
+ left: var(--vaadin-padding-m);
108
+ opacity: 0.2;
109
+ }
110
+
111
+ .textLayer ::-moz-selection {
112
+ background: rgb(0, 0, 255);
113
+ }
114
+
115
+ .textLayer ::selection {
116
+ background: rgb(0, 0, 255);
117
+ }
118
+
119
+ .textLayer .highlight {
120
+ background-color: rgb(180, 0, 170);
121
+ border-radius: 4px;
122
+ }
123
+
124
+ .textLayer .highlight.selected {
125
+ background-color: rgb(0, 100, 0);
126
+ }
127
+
128
+ [part~="toolbar"].small-size [part~="toolbar-pages"] {
129
+ flex: none;
130
+ }
131
+
132
+ [part~="toolbar"].small-size ::slotted(.toolbar-zoom) {
133
+ position: absolute;
134
+ bottom: var(--vaadin-padding-s);
135
+ left: 50%;
136
+ margin-left: -100px;
137
+ background-color: white;
138
+ box-shadow: var(--lumo-box-shadow-m);
139
+ padding: var(--vaadin-padding-xs);
140
+ z-index: 99;
141
+ }
142
+ `,
143
+ { moduleId: "lumo-vcf-pdf-viewer" },
144
+ );
@@ -1,39 +1,39 @@
1
- import {
2
- registerStyles,
3
- css,
4
- } from "@vaadin/vaadin-themable-mixin/register-styles.js";
5
-
6
- registerStyles(
7
- "vaadin-icon",
8
- css`
9
- :host::before {
10
- font-size: var(--vaadin-icon-size);
11
- font-family: var(--pdf-viewer-icon-font-family);
12
- line-height: 1;
13
- }
14
-
15
- :host(.previous-page-button-icon) svg,
16
- :host(.next-page-button-icon) svg,
17
- :host(.toggle-button-icon) svg,
18
- :host(.sidebarOpen.toggle-button-icon) svg {
19
- display: none;
20
- }
21
-
22
- :host(.previous-page-button-icon)::before {
23
- content: var(--pdf-viewer-previous-page-button-icon);
24
- }
25
-
26
- :host(.next-page-button-icon)::before {
27
- content: var(--pdf-viewer-next-page-button-icon);
28
- }
29
-
30
- :host(.toggle-button-icon)::before {
31
- content: var(--pdf-viewer-toggle-button-icon-closed);
32
- }
33
-
34
- :host(.sidebarOpen.toggle-button-icon)::before {
35
- content: var(--pdf-viewer-toggle-button-icon-open);
36
- }
37
- `,
38
- { moduleId: "base-vcf-pdf-viewer-toolbar-icons" },
39
- );
1
+ import {
2
+ registerStyles,
3
+ css,
4
+ } from "@vaadin/vaadin-themable-mixin/register-styles.js";
5
+
6
+ registerStyles(
7
+ "vaadin-icon",
8
+ css`
9
+ :host::before {
10
+ font-size: var(--vaadin-icon-size);
11
+ font-family: var(--pdf-viewer-icon-font-family);
12
+ line-height: 1;
13
+ }
14
+
15
+ :host(.previous-page-button-icon) svg,
16
+ :host(.next-page-button-icon) svg,
17
+ :host(.toggle-button-icon) svg,
18
+ :host(.sidebarOpen.toggle-button-icon) svg {
19
+ display: none;
20
+ }
21
+
22
+ :host(.previous-page-button-icon)::before {
23
+ content: var(--pdf-viewer-previous-page-button-icon);
24
+ }
25
+
26
+ :host(.next-page-button-icon)::before {
27
+ content: var(--pdf-viewer-next-page-button-icon);
28
+ }
29
+
30
+ :host(.toggle-button-icon)::before {
31
+ content: var(--pdf-viewer-toggle-button-icon-closed);
32
+ }
33
+
34
+ :host(.sidebarOpen.toggle-button-icon)::before {
35
+ content: var(--pdf-viewer-toggle-button-icon-open);
36
+ }
37
+ `,
38
+ { moduleId: "base-vcf-pdf-viewer-toolbar-icons" },
39
+ );
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The base theme is side-effect only: importing it registers the styles for
3
+ * `<vcf-pdf-viewer>` and the toolbar icons. Declared so that the subpath can
4
+ * be imported from TypeScript.
5
+ */
6
+ export {};
@@ -1,3 +1,3 @@
1
- import './vcf-pdf-viewer-styles.js';
2
- import './vcf-pdf-viewer-toolbar-icons-styles.js';
1
+ import './vcf-pdf-viewer-styles.js';
2
+ import './vcf-pdf-viewer-toolbar-icons-styles.js';
3
3
  import '../../src/vcf-pdf-viewer.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Type declarations for the package entry point. The runtime counterpart also
3
+ * imports the base theme for its side effect; that import is omitted here
4
+ * because the theme files are side-effect only and export nothing.
5
+ */
6
+ export * from './src/vcf-pdf-viewer.js';
package/vcf-pdf-viewer.js CHANGED
@@ -1,2 +1,2 @@
1
- import './theme/base/vcf-pdf-viewer.js';
2
- export * from './src/vcf-pdf-viewer.js';
1
+ import './theme/base/vcf-pdf-viewer.js';
2
+ export * from './src/vcf-pdf-viewer.js';