@inizioevoke/astro-core 1.1.0 → 1.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.
- package/package.json +4 -4
- package/src/components/ISI/RightISI.astro +43 -0
- package/src/components/ISI/RightISI.css +31 -0
- package/src/components/ISI/RightISI.md +23 -0
- package/src/components/ISI/RightISI.ts +27 -0
- package/src/components/Modal/Modal.ts +83 -4
- package/src/components/Modal/index.ts +2 -0
- package/src/components/PdfViewer/PdfViewer.astro +52 -39
- package/src/components/PdfViewer/PdfViewer.css +92 -66
- package/src/components/PdfViewer/PdfViewer.ts +11 -19
- package/src/components/PdfViewer/pdf.min.mjs +4 -4
- package/src/components/PdfViewer/pdf.worker.min.mjs +4 -4
- package/src/components/ScrollContainer/ScrollContainer.astro +1 -1
- package/src/components/ScrollContainer/ScrollContainer.ts +7 -0
- package/src/components/ScrollContainer/index.ts +2 -0
- package/src/components/PdfViewer/pdf.mjs +0 -26465
- package/src/components/PdfViewer/pdf.mjs.map +0 -1
- package/src/components/PdfViewer/pdf.worker.mjs +0 -63057
- package/src/components/PdfViewer/pdf.worker.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inizioevoke/astro-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
"main": "./index.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
"./components": "./src/components/index.ts",
|
|
11
|
+
"./components/Modal": "./src/components/Modal/index.ts",
|
|
12
|
+
"./components/ScrollContainer": "./src/components/ScrollContainer/index.ts",
|
|
11
13
|
"./integrations": "./src/integrations/index.ts"
|
|
12
14
|
},
|
|
13
15
|
"files": [
|
|
@@ -23,9 +25,7 @@
|
|
|
23
25
|
"@astrojs/ts-plugin": "^1.10.7",
|
|
24
26
|
"@types/node": "^25.5.0",
|
|
25
27
|
"astro": "^6.0.5",
|
|
28
|
+
"pdfjs-dist": "^5.6.205",
|
|
26
29
|
"typescript": "^5.9.3"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"pdfjs-dist": "^5.5.207"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag } from 'astro/types';
|
|
3
|
+
import ScrollContainer, { type Props as ScrollContainerProps } from '../ScrollContainer/ScrollContainer.astro';
|
|
4
|
+
import './RightISI.css';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
tag?: HTMLTag;
|
|
8
|
+
scrollContainer?: ScrollContainerProps;
|
|
9
|
+
headerButton?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
tag: TagName = 'aside',
|
|
14
|
+
scrollContainer,
|
|
15
|
+
headerButton = false
|
|
16
|
+
} = Astro.props;
|
|
17
|
+
|
|
18
|
+
const renderHeaderButton = Astro.slots.has('header-button') || headerButton;
|
|
19
|
+
const renderHeader = Astro.slots.has('header') || renderHeaderButton;
|
|
20
|
+
---
|
|
21
|
+
<TagName class="evo-isi">
|
|
22
|
+
<div class="evo-isi-wrapper">
|
|
23
|
+
|
|
24
|
+
{renderHeader && <div class="evo-isi-header">
|
|
25
|
+
<slot name="header" />
|
|
26
|
+
{renderHeaderButton &&
|
|
27
|
+
<div class="evo-isi-header-button">
|
|
28
|
+
<slot name="header-button"><button>Expand</button></slot>
|
|
29
|
+
</div>}
|
|
30
|
+
</div>}
|
|
31
|
+
<div class="evo-isi-text">
|
|
32
|
+
<ScrollContainer {...scrollContainer}>
|
|
33
|
+
<slot />
|
|
34
|
+
</ScrollContainer>
|
|
35
|
+
</div>
|
|
36
|
+
{Astro.slots.has('footer') && <div class="evo-isi-footer">
|
|
37
|
+
<slot name="footer" />
|
|
38
|
+
</div>}
|
|
39
|
+
</div>
|
|
40
|
+
</TagName>
|
|
41
|
+
<script>
|
|
42
|
+
import './RightISI';
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--evo-isi-width: 25vw;
|
|
3
|
+
--evo-isi-width-expanded: 100vw;
|
|
4
|
+
--evo-isi-height: 100vh;
|
|
5
|
+
--evo-isi-header-height: 0px;
|
|
6
|
+
--evo-isi-footer-height: 0px;
|
|
7
|
+
}
|
|
8
|
+
.evo-isi {
|
|
9
|
+
position: fixed;
|
|
10
|
+
right: 0;
|
|
11
|
+
top: 0;
|
|
12
|
+
display: block;
|
|
13
|
+
width: var(--evo-isi-width);
|
|
14
|
+
height: var(--evo-isi-height);
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
z-index: 99;
|
|
17
|
+
background-color: #ffffff;
|
|
18
|
+
|
|
19
|
+
transform-origin: right top;
|
|
20
|
+
transition-property: width;
|
|
21
|
+
transition-duration: 500ms;
|
|
22
|
+
transition-timing-function: ease-in-out;
|
|
23
|
+
|
|
24
|
+
.evo-isi-wrapper {
|
|
25
|
+
.evo-isi-text {
|
|
26
|
+
.evo-scroll-container {
|
|
27
|
+
/* height: calc(var(--evo-isi-height) - var(--evo-isi-header-height) - var(--evo-isi-footer-height)) */
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# RightISI
|
|
2
|
+
|
|
3
|
+
```jsx
|
|
4
|
+
<RightISI
|
|
5
|
+
tag="aside" // optional
|
|
6
|
+
scrollContainer={{ // optional
|
|
7
|
+
/* ScrollContainer props */
|
|
8
|
+
}}
|
|
9
|
+
headerButton={true} // optional
|
|
10
|
+
>
|
|
11
|
+
<!-- optional -->
|
|
12
|
+
<div slot="header">Header Content</div>
|
|
13
|
+
|
|
14
|
+
<!-- optional -->
|
|
15
|
+
<Fragment slot="header-button"><button>My Button</button></Fragment>
|
|
16
|
+
|
|
17
|
+
<!-- ISI content -->
|
|
18
|
+
<h2>Important Safety Information</h2>
|
|
19
|
+
<p>Content</p>
|
|
20
|
+
|
|
21
|
+
<div slot="footer">Footer Content</div>
|
|
22
|
+
</RightISI>
|
|
23
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as ScrollContainer from '../ScrollContainer/ScrollContainer';
|
|
2
|
+
|
|
3
|
+
const isi = document.querySelector('.evo-isi') as HTMLElement;
|
|
4
|
+
const isiHeader = isi.querySelector<HTMLElement>('.evo-isi-header');
|
|
5
|
+
const isiFooter = isi.querySelector<HTMLElement>('.evo-isi-footer');
|
|
6
|
+
const isiText = isi.querySelector('.evo-isi-text') as HTMLElement;
|
|
7
|
+
|
|
8
|
+
export function resize() {
|
|
9
|
+
if (isi) {
|
|
10
|
+
const isiStyle = getComputedStyle(isi);
|
|
11
|
+
const isiHeight = parseInt(isiStyle.height);
|
|
12
|
+
const headerHeight = isiHeader ? parseInt(getComputedStyle(isiHeader).height) : 0;
|
|
13
|
+
const footerHeight = isiFooter ? parseInt(getComputedStyle(isiFooter).height) : 0;
|
|
14
|
+
|
|
15
|
+
const isiTextStyle = getComputedStyle(isiText);
|
|
16
|
+
const textPadTop = parseInt(isiTextStyle.paddingTop);
|
|
17
|
+
const textPadBot = parseInt(isiTextStyle.paddingBottom);
|
|
18
|
+
|
|
19
|
+
const scrollContainer = ScrollContainer.getScrollContainer(isi.querySelector('.evo-isi-text .evo-scroll-container') as HTMLElement);
|
|
20
|
+
if (scrollContainer) {
|
|
21
|
+
const height = isiHeight - headerHeight - footerHeight - textPadTop - textPadBot;
|
|
22
|
+
ScrollContainer.resize(scrollContainer, { height });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
addEventListener('load', resize, { passive: true });
|
|
27
|
+
window.addEventListener('resize', resize, { passive: true });
|
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
|
|
2
2
|
export type ModalAnimation = 'none' | 'fade';
|
|
3
|
+
export type ModalEventCallback = (modal: HTMLElement | HTMLElement[]) => void;
|
|
4
|
+
interface ModalEventCallbackItem {
|
|
5
|
+
once?: boolean;
|
|
6
|
+
callback: ModalEventCallback;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type ModalEventType = 'show' | 'hide';
|
|
10
|
+
type ModalEventTypeCallbacks = Record<ModalEventType, Set<ModalEventCallbackItem>>;
|
|
11
|
+
const callbacks = new Map<HTMLElement, ModalEventTypeCallbacks>();
|
|
3
12
|
|
|
4
13
|
interface ModalOptions {
|
|
5
|
-
animation?: ModalAnimation;
|
|
14
|
+
animation?: ModalAnimation;
|
|
6
15
|
}
|
|
7
|
-
|
|
16
|
+
interface ModalShowOptions extends ModalOptions {
|
|
17
|
+
on?: {
|
|
18
|
+
show?: ModalEventCallback,
|
|
19
|
+
hide?: ModalEventCallback
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function show(selector: string | HTMLElement, { animation = 'fade', on }: ModalShowOptions = {}) {
|
|
8
23
|
return new Promise<void>(async (resolve) => {
|
|
9
24
|
let modal = typeof selector == 'string' ? document.querySelector<HTMLElement>(/^[\.#]/.test(selector) ? selector : `#${selector}`) : selector;
|
|
10
25
|
if (modal) {
|
|
26
|
+
if (on?.hide) {
|
|
27
|
+
onEvent('hide', modal, { once: true, callback: on.hide });
|
|
28
|
+
}
|
|
11
29
|
await hide(null, { animation, hideOverlay: false });
|
|
12
30
|
__showOverlay(animation);
|
|
13
31
|
|
|
14
32
|
modal.classList.add('evo-modal-visible', `evo-modal-show-${animation}`);
|
|
15
|
-
setTimeout(
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
triggerEventCallbacks(modal, 'show');
|
|
35
|
+
if (on?.show) {
|
|
36
|
+
try {
|
|
37
|
+
on.show(modal);
|
|
38
|
+
} catch (err) {
|
|
39
|
+
console.log(err);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
resolve();
|
|
43
|
+
}, animation !== 'none' ? animationDuration : 0);
|
|
16
44
|
}
|
|
17
45
|
});
|
|
18
46
|
}
|
|
@@ -22,11 +50,17 @@ function __showOverlay(animation: ModalAnimation) {
|
|
|
22
50
|
overlay.classList.add('evo-modal-visible', `evo-modal-show-${animation}`);
|
|
23
51
|
}
|
|
24
52
|
}
|
|
53
|
+
export function onShow(selector: string | HTMLElement, callback: ModalEventCallback, { once }: { once?: boolean } = {}) {
|
|
54
|
+
onEvent('show', selector, { once, callback });
|
|
55
|
+
}
|
|
25
56
|
|
|
26
57
|
interface HideModalOptions extends ModalOptions {
|
|
27
58
|
hideOverlay?: boolean;
|
|
59
|
+
on?: {
|
|
60
|
+
hide?: ModalEventCallback
|
|
61
|
+
}
|
|
28
62
|
}
|
|
29
|
-
export function hide(selector?: string | HTMLElement | (string | HTMLElement)[] | null, { animation, hideOverlay = true }: HideModalOptions = {}) {
|
|
63
|
+
export function hide(selector?: string | HTMLElement | (string | HTMLElement)[] | null, { animation, hideOverlay = true, on }: HideModalOptions = {}) {
|
|
30
64
|
return new Promise<void>(async (resolve) => {
|
|
31
65
|
const modals: HTMLElement[] = (selector ? Array.isArray(selector) ? selector : [selector] : [...document.querySelectorAll<HTMLElement>('.evo-modal.evo-modal-visible')])
|
|
32
66
|
.map((m) => {
|
|
@@ -49,6 +83,13 @@ export function hide(selector?: string | HTMLElement | (string | HTMLElement)[]
|
|
|
49
83
|
hides.push(__hide(overlay, animation));
|
|
50
84
|
}
|
|
51
85
|
await Promise.all(hides);
|
|
86
|
+
if (on?.hide) {
|
|
87
|
+
try {
|
|
88
|
+
on.hide(modals);
|
|
89
|
+
} catch (err) {
|
|
90
|
+
console.log(err);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
52
93
|
resolve();
|
|
53
94
|
});
|
|
54
95
|
}
|
|
@@ -59,10 +100,14 @@ function __hide(modal: HTMLElement, animation: ModalAnimation) {
|
|
|
59
100
|
modal.classList.remove(showClass);
|
|
60
101
|
setTimeout(() => {
|
|
61
102
|
modal.classList.remove('evo-modal-visible', `evo-modal-hide-${animation}`);
|
|
103
|
+
triggerEventCallbacks(modal, 'hide');
|
|
62
104
|
resolve();
|
|
63
105
|
}, animation !== 'none' ? animationDuration : 0);
|
|
64
106
|
});
|
|
65
107
|
}
|
|
108
|
+
export function onHide(selector: string | HTMLElement, callback: ModalEventCallback, { once }: { once?: boolean } = {}) {
|
|
109
|
+
onEvent('hide', selector, { once, callback });
|
|
110
|
+
}
|
|
66
111
|
|
|
67
112
|
/**
|
|
68
113
|
* Moves the overlay element by appending it to an element
|
|
@@ -75,6 +120,40 @@ export function appendOverlay(selector: string | HTMLElement) {
|
|
|
75
120
|
}
|
|
76
121
|
}
|
|
77
122
|
|
|
123
|
+
function onEvent(type: ModalEventType, selector: string | HTMLElement, callbackItem: ModalEventCallbackItem) {
|
|
124
|
+
let modal = typeof selector == 'string' ? document.querySelector<HTMLElement>(/^[\.#]/.test(selector) ? selector : `#${selector}`) : selector;
|
|
125
|
+
if (modal) {
|
|
126
|
+
const modalCallbacks = callbacks.get(modal) ?? {} as ModalEventTypeCallbacks;
|
|
127
|
+
if (!modalCallbacks[type]) {
|
|
128
|
+
modalCallbacks[type] = new Set();
|
|
129
|
+
}
|
|
130
|
+
modalCallbacks[type].add(callbackItem);
|
|
131
|
+
callbacks.set(modal, modalCallbacks);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function triggerEventCallbacks(modal: HTMLElement, eventType: 'show' | 'hide') {
|
|
136
|
+
if (modal) {
|
|
137
|
+
const modalCallbacks = callbacks.get(modal);
|
|
138
|
+
if (modalCallbacks && modalCallbacks[eventType]) {
|
|
139
|
+
const items = [...modalCallbacks[eventType]];
|
|
140
|
+
const keep: ModalEventCallbackItem[] = [];
|
|
141
|
+
for (const item of items) {
|
|
142
|
+
try {
|
|
143
|
+
item.callback(modal);
|
|
144
|
+
} catch (err) {
|
|
145
|
+
console.log(err);
|
|
146
|
+
} finally {
|
|
147
|
+
if (!item.once) {
|
|
148
|
+
keep.push(item);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
callbacks.set(modal, {...modalCallbacks, [eventType]: new Set(keep)});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
78
157
|
const overlay: HTMLElement = document.querySelector<HTMLElement>('.evo-modal-overlay') ?? (() => {
|
|
79
158
|
// create the overlay
|
|
80
159
|
const div = document.createElement('div');
|
|
@@ -12,6 +12,10 @@ interface Props {
|
|
|
12
12
|
pages?: string;
|
|
13
13
|
bookmarks?: Record<string, number>;
|
|
14
14
|
bookmarkText?: string;
|
|
15
|
+
toolbar?: {
|
|
16
|
+
page?: boolean;
|
|
17
|
+
zoom?: boolean;
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
const {
|
|
17
21
|
id,
|
|
@@ -22,6 +26,7 @@ const {
|
|
|
22
26
|
page = 1,
|
|
23
27
|
bookmarks,
|
|
24
28
|
bookmarkText = 'Jump to',
|
|
29
|
+
toolbar,
|
|
25
30
|
...rest
|
|
26
31
|
} = Astro.props;
|
|
27
32
|
|
|
@@ -35,7 +40,6 @@ if (height) {
|
|
|
35
40
|
class:list={['evo-pdf-viewer', cssClass, theme ? `evo-pdf-viewer-theme-${theme}` : null]}
|
|
36
41
|
data-pdf={pdf}
|
|
37
42
|
data-page={page}
|
|
38
|
-
data-bookmarks={btoa(JSON.stringify(bookmarks ?? {}))}
|
|
39
43
|
{...attrs}
|
|
40
44
|
>
|
|
41
45
|
<div class="evo-pdf-viewer-toolbar">
|
|
@@ -43,48 +47,57 @@ if (height) {
|
|
|
43
47
|
<slot name="toolbar-start" />
|
|
44
48
|
</div>
|
|
45
49
|
<div class="evo-pdf-viewer-toolbar-controls">
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<select></select> of <span class="evo-pdf-viewer-nav-page-count">0</span>
|
|
50
|
+
<div class="evo-pdf-viewer-toolbar-arrows">
|
|
51
|
+
<button class="evo-pdf-viewer-toolbar-prev" title="Previous">
|
|
52
|
+
<slot name="toolbar-prev">
|
|
53
|
+
<svg class="evo-pdf-viewer-toolbar-icon" width="20px" height="20px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
54
|
+
<path d="M6 15L12 9L18 15" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
55
|
+
</svg>
|
|
56
|
+
</slot>
|
|
57
|
+
</button>
|
|
58
|
+
<button class="evo-pdf-viewer-toolbar-next" title="Next">
|
|
59
|
+
<slot name="toolbar-next">
|
|
60
|
+
<svg class="evo-pdf-viewer-toolbar-icon" width="20px" height="20px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
61
|
+
<path d="M6 9L12 15L18 9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
62
|
+
</svg>
|
|
63
|
+
</slot>
|
|
64
|
+
</button>
|
|
62
65
|
</div>
|
|
63
|
-
<
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
<div class:list={['evo-pdf-viewer-nav-page', toolbar?.page === false ? 'evo-hidden' : null]}>
|
|
67
|
+
<select><option value="1">1</option></select> of <span class="evo-pdf-viewer-nav-page-count">1</span>
|
|
68
|
+
</div>
|
|
69
|
+
{toolbar?.zoom !== false &&
|
|
70
|
+
<div class="evo-pdf-viewer-toolbar-zoom">
|
|
71
|
+
<button class="evo-pdf-viewer-toolbar-zoom-out" title="Zoom out">
|
|
72
|
+
<slot name="toolbar-zoom-out">
|
|
73
|
+
<svg class="evo-pdf-viewer-toolbar-icon" width="16px" height="16px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
74
|
+
<path d="M6 12L18 12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
75
|
+
</slot>
|
|
76
|
+
</button>
|
|
77
|
+
<button class="evo-pdf-viewer-toolbar-zoom-in" title="Zoom in">
|
|
78
|
+
<slot name="toolbar-zoom-in">
|
|
79
|
+
<svg class="evo-pdf-viewer-toolbar-icon" width="16px" height="16px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
80
|
+
<path d="M4 12H20M12 4V20" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
81
|
+
</svg>
|
|
82
|
+
</slot>
|
|
83
|
+
</button>
|
|
84
|
+
<button class="evo-pdf-viewer-toolbar-zoom-reset" title="Reset zoom">
|
|
85
|
+
<slot name="toolbar-zoom-reset">
|
|
86
|
+
<svg class="evo-pdf-viewer-toolbar-icon" width="16px" height="16px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
87
|
+
<path d="M3 3V8M3 8H8M3 8L6 5.29168C7.59227 3.86656 9.69494 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.71683 21 4.13247 18.008 3.22302 14" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
88
|
+
</svg>
|
|
89
|
+
</slot>
|
|
90
|
+
</button>
|
|
91
|
+
</div>}
|
|
92
|
+
{bookmarks && Object.keys(bookmarks).length > 0 &&
|
|
93
|
+
<div class="evo-pdf-viewer-toolbar-bookmarks">
|
|
84
94
|
<select>
|
|
85
95
|
<option value="" disabled selected hidden>{bookmarkText}</option>
|
|
96
|
+
{Object.entries(bookmarks).map((b) => (
|
|
97
|
+
<option value={b[1]}>{b[0]}</option>
|
|
98
|
+
))}
|
|
86
99
|
</select>
|
|
87
|
-
</div>
|
|
100
|
+
</div>}
|
|
88
101
|
</div>
|
|
89
102
|
<div class="evo-pdf-viewer-toolbar-end">
|
|
90
103
|
<slot name="toolbar-end" />
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
background-color: #f0f0f0;
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
|
|
12
|
+
.evo-hidden {
|
|
13
|
+
display: none !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
.evo-pdf-viewer-toolbar {
|
|
13
17
|
display: flex;
|
|
14
18
|
justify-content: var(--evo-pdf-viewer-toolbar-align);
|
|
@@ -23,77 +27,71 @@
|
|
|
23
27
|
align-items: center;
|
|
24
28
|
gap: 8px;
|
|
25
29
|
box-sizing: border-box;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
&.evo-pdf-viewer-toolbar-prev,
|
|
30
|
-
&.evo-pdf-viewer-toolbar-next,
|
|
31
|
-
&.evo-pdf-viewer-toolbar-zoom-out,
|
|
32
|
-
&.evo-pdf-viewer-toolbar-zoom-in,
|
|
33
|
-
&.evo-pdf-viewer-toolbar-zoom-reset {
|
|
34
|
-
all: unset;
|
|
30
|
+
|
|
31
|
+
.evo-pdf-viewer-toolbar-arrows,
|
|
32
|
+
.evo-pdf-viewer-toolbar-zoom {
|
|
35
33
|
display: flex;
|
|
36
34
|
justify-content: center;
|
|
37
35
|
align-items: center;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
gap: 8px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
button {
|
|
41
|
+
all: unset;
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
align-items: center;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
width: 30px;
|
|
47
|
+
height: 30px;
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
/* border: 1px solid #888888;
|
|
50
|
+
border-radius: 6px; */
|
|
51
|
+
&:hover {
|
|
52
|
+
background-color: rgba(0,0,0,0.1);
|
|
53
|
+
}
|
|
44
54
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
55
|
+
.evo-pdf-viewer-toolbar-icon {
|
|
56
|
+
path {
|
|
57
|
+
stroke: #000000;
|
|
49
58
|
}
|
|
50
59
|
}
|
|
51
60
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
|
|
62
|
+
select {
|
|
63
|
+
display: inline-block;
|
|
64
|
+
height: 24px;
|
|
65
|
+
padding: 0;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
color: #000000;
|
|
57
68
|
font-family: sans-serif;
|
|
58
69
|
font-size: 16px;
|
|
59
70
|
line-height: 24px;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
padding: 0;
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
color: #000000;
|
|
67
|
-
font-family: sans-serif;
|
|
68
|
-
font-size: 16px;
|
|
69
|
-
line-height: 24px;
|
|
70
|
-
text-align: center;
|
|
71
|
-
background-color: #ffffff;
|
|
72
|
-
border: 1px solid #888888;
|
|
73
|
-
border-radius: 6px;
|
|
74
|
-
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
background-color: rgba(255,255,255,0.5);
|
|
73
|
+
border: 1px solid rgba(0,0,0,0.1);
|
|
74
|
+
border-radius: 0;
|
|
75
75
|
}
|
|
76
|
+
.evo-pdf-viewer-nav-page,
|
|
77
|
+
.evo-pdf-viewer-toolbar-zoom,
|
|
76
78
|
.evo-pdf-viewer-toolbar-bookmarks {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
height: 30px;
|
|
80
|
+
margin: 0;
|
|
81
|
+
padding: 0 0 0 8px;
|
|
79
82
|
border-left: 1px solid black;
|
|
83
|
+
font-family: sans-serif;
|
|
84
|
+
font-size: 16px;
|
|
85
|
+
line-height: 30px;
|
|
86
|
+
}
|
|
87
|
+
.evo-pdf-viewer-nav-page,
|
|
88
|
+
.evo-pdf-viewer-toolbar-bookmarks {
|
|
89
|
+
padding: 0 8px 0 16px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.evo-pdf-viewer-toolbar-bookmarks {
|
|
80
93
|
select {
|
|
81
|
-
/*all: unset;*/
|
|
82
|
-
display: inline-block;
|
|
83
|
-
height: 24px;
|
|
84
|
-
padding: 0 0.25em;
|
|
85
|
-
cursor: pointer;
|
|
86
|
-
color: #000000;
|
|
87
|
-
font-family: sans-serif;
|
|
88
|
-
font-size: 16px;
|
|
89
|
-
line-height: 24px;
|
|
90
94
|
text-align: left;
|
|
91
|
-
background-color: #ffffff;
|
|
92
|
-
border: 1px solid #888888;
|
|
93
|
-
border-radius: 6px;
|
|
94
|
-
}
|
|
95
|
-
&.hidden {
|
|
96
|
-
display: none;
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
97
|
}
|
|
@@ -151,15 +149,35 @@
|
|
|
151
149
|
}
|
|
152
150
|
}
|
|
153
151
|
|
|
152
|
+
&.evo-pdf-viewer-theme-modern {
|
|
153
|
+
.evo-pdf-viewer-toolbar {
|
|
154
|
+
button {
|
|
155
|
+
background-color: transparent;
|
|
156
|
+
border: none;
|
|
157
|
+
border-radius: 0;
|
|
158
|
+
&:hover {
|
|
159
|
+
background-color: rgba(0,0,0,0.05);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
154
164
|
&.evo-pdf-viewer-theme-dark {
|
|
155
|
-
background-color: #
|
|
165
|
+
background-color: #555555;
|
|
156
166
|
.evo-pdf-viewer-toolbar {
|
|
157
|
-
|
|
158
167
|
button {
|
|
159
|
-
|
|
168
|
+
&:hover {
|
|
169
|
+
background-color: #333333;
|
|
170
|
+
}
|
|
171
|
+
.evo-pdf-viewer-toolbar-icon {
|
|
172
|
+
path {
|
|
173
|
+
stroke: #ffffff;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
160
176
|
}
|
|
161
177
|
select {
|
|
162
|
-
|
|
178
|
+
color: white;
|
|
179
|
+
border: 1px solid rgba(255,255,255,0.25);
|
|
180
|
+
background-color: #333333;
|
|
163
181
|
}
|
|
164
182
|
.evo-pdf-viewer-nav-page,
|
|
165
183
|
.evo-pdf-viewer-toolbar-bookmarks {
|
|
@@ -167,13 +185,20 @@
|
|
|
167
185
|
border-color: #cccccc;
|
|
168
186
|
}
|
|
169
187
|
}
|
|
188
|
+
.evo-pdf-viewer-container {
|
|
189
|
+
.evo-scroll-container {
|
|
190
|
+
--evo-scroll-container-track-color: #cccccc;
|
|
191
|
+
--evo-scroll-container-thumb-color: #333333;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
170
194
|
}
|
|
171
195
|
&.evo-pdf-viewer-theme-black {
|
|
172
196
|
background-color: #000000;
|
|
173
197
|
.evo-pdf-viewer-toolbar {
|
|
174
|
-
|
|
175
198
|
button {
|
|
176
|
-
|
|
199
|
+
&:hover {
|
|
200
|
+
background-color: #333333;
|
|
201
|
+
}
|
|
177
202
|
.evo-pdf-viewer-toolbar-icon {
|
|
178
203
|
path {
|
|
179
204
|
stroke: #ffffff;
|
|
@@ -181,19 +206,20 @@
|
|
|
181
206
|
}
|
|
182
207
|
}
|
|
183
208
|
select {
|
|
184
|
-
color:
|
|
185
|
-
|
|
209
|
+
color: white;
|
|
210
|
+
border: 1px solid rgba(255,255,255,0.15);
|
|
211
|
+
background-color: #333333;
|
|
186
212
|
}
|
|
187
213
|
.evo-pdf-viewer-nav-page,
|
|
188
214
|
.evo-pdf-viewer-toolbar-bookmarks {
|
|
189
215
|
color: #ffffff;
|
|
190
|
-
border-color: #
|
|
216
|
+
border-color: #cccccc;
|
|
191
217
|
}
|
|
192
218
|
}
|
|
193
219
|
.evo-pdf-viewer-container {
|
|
194
220
|
.evo-scroll-container {
|
|
195
221
|
--evo-scroll-container-track-color: #666666;
|
|
196
|
-
--evo-scroll-container-thumb-color: #
|
|
222
|
+
--evo-scroll-container-thumb-color: #cccccc;
|
|
197
223
|
}
|
|
198
224
|
}
|
|
199
225
|
}
|