@embedpdf/snippet 1.0.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/LICENSE +21 -0
- package/README.md +90 -0
- package/dist/components/annotation-menu.d.ts +9 -0
- package/dist/components/annotation-menu.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/common.d.ts +10 -0
- package/dist/components/annotation-sidebar/common.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/empty-state.d.ts +7 -0
- package/dist/components/annotation-sidebar/empty-state.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/free-text-sidebar.d.ts +5 -0
- package/dist/components/annotation-sidebar/free-text-sidebar.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/ink-sidebar.d.ts +5 -0
- package/dist/components/annotation-sidebar/ink-sidebar.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/line-sidebar.d.ts +5 -0
- package/dist/components/annotation-sidebar/line-sidebar.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/polygon-sidebar.d.ts +5 -0
- package/dist/components/annotation-sidebar/polygon-sidebar.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/registry.d.ts +19 -0
- package/dist/components/annotation-sidebar/registry.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/shape-sidebar.d.ts +5 -0
- package/dist/components/annotation-sidebar/shape-sidebar.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/stamp-sidebar.d.ts +5 -0
- package/dist/components/annotation-sidebar/stamp-sidebar.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/text-markup-sidebar.d.ts +5 -0
- package/dist/components/annotation-sidebar/text-markup-sidebar.d.ts.map +1 -0
- package/dist/components/annotation-sidebar/ui.d.ts +72 -0
- package/dist/components/annotation-sidebar/ui.d.ts.map +1 -0
- package/dist/components/annotation-sidebar.d.ts +6 -0
- package/dist/components/annotation-sidebar.d.ts.map +1 -0
- package/dist/components/app.d.ts +108 -0
- package/dist/components/app.d.ts.map +1 -0
- package/dist/components/capture.d.ts +3 -0
- package/dist/components/capture.d.ts.map +1 -0
- package/dist/components/command-button.d.ts +15 -0
- package/dist/components/command-button.d.ts.map +1 -0
- package/dist/components/comment-sidebar/annotation-card.d.ts +14 -0
- package/dist/components/comment-sidebar/annotation-card.d.ts.map +1 -0
- package/dist/components/comment-sidebar/annotation-icon.d.ts +9 -0
- package/dist/components/comment-sidebar/annotation-icon.d.ts.map +1 -0
- package/dist/components/comment-sidebar/annotation-input.d.ts +10 -0
- package/dist/components/comment-sidebar/annotation-input.d.ts.map +1 -0
- package/dist/components/comment-sidebar/comment.d.ts +12 -0
- package/dist/components/comment-sidebar/comment.d.ts.map +1 -0
- package/dist/components/comment-sidebar/config.d.ts +15 -0
- package/dist/components/comment-sidebar/config.d.ts.map +1 -0
- package/dist/components/comment-sidebar/edit-comment-form.d.ts +11 -0
- package/dist/components/comment-sidebar/edit-comment-form.d.ts.map +1 -0
- package/dist/components/comment-sidebar/empty-state.d.ts +7 -0
- package/dist/components/comment-sidebar/empty-state.d.ts.map +1 -0
- package/dist/components/comment-sidebar/menu-dropdown.d.ts +10 -0
- package/dist/components/comment-sidebar/menu-dropdown.d.ts.map +1 -0
- package/dist/components/comment-sidebar/truncated-text.d.ts +10 -0
- package/dist/components/comment-sidebar/truncated-text.d.ts.map +1 -0
- package/dist/components/comment-sidebar/user-avatar.d.ts +8 -0
- package/dist/components/comment-sidebar/user-avatar.d.ts.map +1 -0
- package/dist/components/comment-sidebar.d.ts +6 -0
- package/dist/components/comment-sidebar.d.ts.map +1 -0
- package/dist/components/custom-zoom-toolbar.d.ts +24 -0
- package/dist/components/custom-zoom-toolbar.d.ts.map +1 -0
- package/dist/components/document-password-prompt.d.ts +8 -0
- package/dist/components/document-password-prompt.d.ts.map +1 -0
- package/dist/components/empty-state.d.ts +3 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/hint-layer.d.ts +3 -0
- package/dist/components/hint-layer.d.ts.map +1 -0
- package/dist/components/icons/alert-triangle.d.ts +4 -0
- package/dist/components/icons/alert-triangle.d.ts.map +1 -0
- package/dist/components/icons/align-bottom.d.ts +4 -0
- package/dist/components/icons/align-bottom.d.ts.map +1 -0
- package/dist/components/icons/align-center.d.ts +4 -0
- package/dist/components/icons/align-center.d.ts.map +1 -0
- package/dist/components/icons/align-left.d.ts +4 -0
- package/dist/components/icons/align-left.d.ts.map +1 -0
- package/dist/components/icons/align-middle.d.ts +4 -0
- package/dist/components/icons/align-middle.d.ts.map +1 -0
- package/dist/components/icons/align-right.d.ts +4 -0
- package/dist/components/icons/align-right.d.ts.map +1 -0
- package/dist/components/icons/align-top.d.ts +4 -0
- package/dist/components/icons/align-top.d.ts.map +1 -0
- package/dist/components/icons/arrow-back-up.d.ts +4 -0
- package/dist/components/icons/arrow-back-up.d.ts.map +1 -0
- package/dist/components/icons/arrow-forward-up.d.ts +4 -0
- package/dist/components/icons/arrow-forward-up.d.ts.map +1 -0
- package/dist/components/icons/bold.d.ts +4 -0
- package/dist/components/icons/bold.d.ts.map +1 -0
- package/dist/components/icons/book.d.ts +4 -0
- package/dist/components/icons/book.d.ts.map +1 -0
- package/dist/components/icons/book2.d.ts +4 -0
- package/dist/components/icons/book2.d.ts.map +1 -0
- package/dist/components/icons/check.d.ts +4 -0
- package/dist/components/icons/check.d.ts.map +1 -0
- package/dist/components/icons/chevron-down.d.ts +4 -0
- package/dist/components/icons/chevron-down.d.ts.map +1 -0
- package/dist/components/icons/chevron-left.d.ts +4 -0
- package/dist/components/icons/chevron-left.d.ts.map +1 -0
- package/dist/components/icons/chevron-right.d.ts +4 -0
- package/dist/components/icons/chevron-right.d.ts.map +1 -0
- package/dist/components/icons/circle.d.ts +4 -0
- package/dist/components/icons/circle.d.ts.map +1 -0
- package/dist/components/icons/comment.d.ts +4 -0
- package/dist/components/icons/comment.d.ts.map +1 -0
- package/dist/components/icons/copy.d.ts +4 -0
- package/dist/components/icons/copy.d.ts.map +1 -0
- package/dist/components/icons/device-floppy.d.ts +4 -0
- package/dist/components/icons/device-floppy.d.ts.map +1 -0
- package/dist/components/icons/dots.d.ts +4 -0
- package/dist/components/icons/dots.d.ts.map +1 -0
- package/dist/components/icons/double-page.d.ts +4 -0
- package/dist/components/icons/double-page.d.ts.map +1 -0
- package/dist/components/icons/download.d.ts +4 -0
- package/dist/components/icons/download.d.ts.map +1 -0
- package/dist/components/icons/file-import.d.ts +4 -0
- package/dist/components/icons/file-import.d.ts.map +1 -0
- package/dist/components/icons/file.d.ts +4 -0
- package/dist/components/icons/file.d.ts.map +1 -0
- package/dist/components/icons/fit-to-page.d.ts +4 -0
- package/dist/components/icons/fit-to-page.d.ts.map +1 -0
- package/dist/components/icons/fit-to-width.d.ts +4 -0
- package/dist/components/icons/fit-to-width.d.ts.map +1 -0
- package/dist/components/icons/fullscreen-exit.d.ts +4 -0
- package/dist/components/icons/fullscreen-exit.d.ts.map +1 -0
- package/dist/components/icons/fullscreen.d.ts +4 -0
- package/dist/components/icons/fullscreen.d.ts.map +1 -0
- package/dist/components/icons/hand.d.ts +4 -0
- package/dist/components/icons/hand.d.ts.map +1 -0
- package/dist/components/icons/highlight.d.ts +4 -0
- package/dist/components/icons/highlight.d.ts.map +1 -0
- package/dist/components/icons/horizontal.d.ts +4 -0
- package/dist/components/icons/horizontal.d.ts.map +1 -0
- package/dist/components/icons/index.d.ts +6 -0
- package/dist/components/icons/index.d.ts.map +1 -0
- package/dist/components/icons/italic.d.ts +4 -0
- package/dist/components/icons/italic.d.ts.map +1 -0
- package/dist/components/icons/line-arrow.d.ts +4 -0
- package/dist/components/icons/line-arrow.d.ts.map +1 -0
- package/dist/components/icons/line.d.ts +4 -0
- package/dist/components/icons/line.d.ts.map +1 -0
- package/dist/components/icons/list-tree.d.ts +4 -0
- package/dist/components/icons/list-tree.d.ts.map +1 -0
- package/dist/components/icons/lock.d.ts +4 -0
- package/dist/components/icons/lock.d.ts.map +1 -0
- package/dist/components/icons/menu.d.ts +4 -0
- package/dist/components/icons/menu.d.ts.map +1 -0
- package/dist/components/icons/palette.d.ts +4 -0
- package/dist/components/icons/palette.d.ts.map +1 -0
- package/dist/components/icons/paperclip.d.ts +4 -0
- package/dist/components/icons/paperclip.d.ts.map +1 -0
- package/dist/components/icons/pencil-marker.d.ts +4 -0
- package/dist/components/icons/pencil-marker.d.ts.map +1 -0
- package/dist/components/icons/photo.d.ts +4 -0
- package/dist/components/icons/photo.d.ts.map +1 -0
- package/dist/components/icons/plus.d.ts +4 -0
- package/dist/components/icons/plus.d.ts.map +1 -0
- package/dist/components/icons/pointer.d.ts +4 -0
- package/dist/components/icons/pointer.d.ts.map +1 -0
- package/dist/components/icons/polygon.d.ts +4 -0
- package/dist/components/icons/polygon.d.ts.map +1 -0
- package/dist/components/icons/print.d.ts +4 -0
- package/dist/components/icons/print.d.ts.map +1 -0
- package/dist/components/icons/redact-area.d.ts +4 -0
- package/dist/components/icons/redact-area.d.ts.map +1 -0
- package/dist/components/icons/redact.d.ts +4 -0
- package/dist/components/icons/redact.d.ts.map +1 -0
- package/dist/components/icons/rotate-clockwise.d.ts +4 -0
- package/dist/components/icons/rotate-clockwise.d.ts.map +1 -0
- package/dist/components/icons/rotate-counter-clockwise.d.ts +4 -0
- package/dist/components/icons/rotate-counter-clockwise.d.ts.map +1 -0
- package/dist/components/icons/save.d.ts +4 -0
- package/dist/components/icons/save.d.ts.map +1 -0
- package/dist/components/icons/screenshot.d.ts +4 -0
- package/dist/components/icons/screenshot.d.ts.map +1 -0
- package/dist/components/icons/search.d.ts +4 -0
- package/dist/components/icons/search.d.ts.map +1 -0
- package/dist/components/icons/settings.d.ts +4 -0
- package/dist/components/icons/settings.d.ts.map +1 -0
- package/dist/components/icons/sidebar.d.ts +4 -0
- package/dist/components/icons/sidebar.d.ts.map +1 -0
- package/dist/components/icons/single-page.d.ts +4 -0
- package/dist/components/icons/single-page.d.ts.map +1 -0
- package/dist/components/icons/square.d.ts +4 -0
- package/dist/components/icons/square.d.ts.map +1 -0
- package/dist/components/icons/squares.d.ts +4 -0
- package/dist/components/icons/squares.d.ts.map +1 -0
- package/dist/components/icons/squiggly.d.ts +4 -0
- package/dist/components/icons/squiggly.d.ts.map +1 -0
- package/dist/components/icons/strikethrough.d.ts +4 -0
- package/dist/components/icons/strikethrough.d.ts.map +1 -0
- package/dist/components/icons/text.d.ts +4 -0
- package/dist/components/icons/text.d.ts.map +1 -0
- package/dist/components/icons/trash.d.ts +4 -0
- package/dist/components/icons/trash.d.ts.map +1 -0
- package/dist/components/icons/types.d.ts +11 -0
- package/dist/components/icons/types.d.ts.map +1 -0
- package/dist/components/icons/underline.d.ts +4 -0
- package/dist/components/icons/underline.d.ts.map +1 -0
- package/dist/components/icons/vertical.d.ts +4 -0
- package/dist/components/icons/vertical.d.ts.map +1 -0
- package/dist/components/icons/view-settings.d.ts +4 -0
- package/dist/components/icons/view-settings.d.ts.map +1 -0
- package/dist/components/icons/x.d.ts +4 -0
- package/dist/components/icons/x.d.ts.map +1 -0
- package/dist/components/icons/zigzag.d.ts +4 -0
- package/dist/components/icons/zigzag.d.ts.map +1 -0
- package/dist/components/icons/zoom-in-area.d.ts +4 -0
- package/dist/components/icons/zoom-in-area.d.ts.map +1 -0
- package/dist/components/icons/zoom-in.d.ts +4 -0
- package/dist/components/icons/zoom-in.d.ts.map +1 -0
- package/dist/components/icons/zoom-out.d.ts +4 -0
- package/dist/components/icons/zoom-out.d.ts.map +1 -0
- package/dist/components/locale-switcher.d.ts +8 -0
- package/dist/components/locale-switcher.d.ts.map +1 -0
- package/dist/components/mode-select-button.d.ts +8 -0
- package/dist/components/mode-select-button.d.ts.map +1 -0
- package/dist/components/outline-sidebar.d.ts +7 -0
- package/dist/components/outline-sidebar.d.ts.map +1 -0
- package/dist/components/page-controls.d.ts +7 -0
- package/dist/components/page-controls.d.ts.map +1 -0
- package/dist/components/print-modal.d.ts +10 -0
- package/dist/components/print-modal.d.ts.map +1 -0
- package/dist/components/redaction-menu.d.ts +10 -0
- package/dist/components/redaction-menu.d.ts.map +1 -0
- package/dist/components/search-sidebar.d.ts +8 -0
- package/dist/components/search-sidebar.d.ts.map +1 -0
- package/dist/components/tab-bar.d.ts +14 -0
- package/dist/components/tab-bar.d.ts.map +1 -0
- package/dist/components/thumbnails-sidebar.d.ts +8 -0
- package/dist/components/thumbnails-sidebar.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/checkbox.d.ts +9 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +22 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dropdown.d.ts +23 -0
- package/dist/components/ui/dropdown.d.ts.map +1 -0
- package/dist/components/ui/icon.d.ts +20 -0
- package/dist/components/ui/icon.d.ts.map +1 -0
- package/dist/components/ui/loading-indicator.d.ts +17 -0
- package/dist/components/ui/loading-indicator.d.ts.map +1 -0
- package/dist/components/ui/tab-button.d.ts +12 -0
- package/dist/components/ui/tab-button.d.ts.map +1 -0
- package/dist/components/ui/toggle-button.d.ts +15 -0
- package/dist/components/ui/toggle-button.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +14 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/utils.d.ts +2 -0
- package/dist/components/utils.d.ts.map +1 -0
- package/dist/config/commands.d.ts +4 -0
- package/dist/config/commands.d.ts.map +1 -0
- package/dist/config/icon-registry.d.ts +116 -0
- package/dist/config/icon-registry.d.ts.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/theme.d.ts +147 -0
- package/dist/config/theme.d.ts.map +1 -0
- package/dist/config/translations.d.ts +8 -0
- package/dist/config/translations.d.ts.map +1 -0
- package/dist/config/types.d.ts +32 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/ui-schema.d.ts +9 -0
- package/dist/config/ui-schema.d.ts.map +1 -0
- package/dist/demo-annotations.pdf +0 -0
- package/dist/demo.pdf +0 -0
- package/dist/direct-engine-ce9b01ae.js +1 -0
- package/dist/ebook.pdf +0 -0
- package/dist/embedpdf-9ae31302.js +3 -0
- package/dist/embedpdf.d.ts +45 -0
- package/dist/embedpdf.d.ts.map +1 -0
- package/dist/embedpdf.js +1 -0
- package/dist/hooks/use-click-outside.d.ts +3 -0
- package/dist/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/hooks/use-debounce.d.ts +2 -0
- package/dist/hooks/use-debounce.d.ts.map +1 -0
- package/dist/hooks/use-swipe-gesture.d.ts +5 -0
- package/dist/hooks/use-swipe-gesture.d.ts.map +1 -0
- package/dist/index.html +32 -0
- package/dist/pdfium.wasm +0 -0
- package/dist/ui/hooks/use-container-breakpoint.d.ts +10 -0
- package/dist/ui/hooks/use-container-breakpoint.d.ts.map +1 -0
- package/dist/ui/schema-menu.d.ts +9 -0
- package/dist/ui/schema-menu.d.ts.map +1 -0
- package/dist/ui/schema-modal.d.ts +17 -0
- package/dist/ui/schema-modal.d.ts.map +1 -0
- package/dist/ui/schema-overlay.d.ts +16 -0
- package/dist/ui/schema-overlay.d.ts.map +1 -0
- package/dist/ui/schema-selection-menu.d.ts +4 -0
- package/dist/ui/schema-selection-menu.d.ts.map +1 -0
- package/dist/ui/schema-sidebar.d.ts +9 -0
- package/dist/ui/schema-sidebar.d.ts.map +1 -0
- package/dist/ui/schema-toolbar.d.ts +13 -0
- package/dist/ui/schema-toolbar.d.ts.map +1 -0
- package/dist/web-components/container.d.ts +65 -0
- package/dist/web-components/container.d.ts.map +1 -0
- package/dist/worker-engine-892a0577.js +1 -0
- package/package.json +83 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 CloudPDF
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://www.embedpdf.com">
|
|
3
|
+
<img alt="EmbedPDF logo" src="https://www.embedpdf.com/logo-192.png" height="96">
|
|
4
|
+
</a>
|
|
5
|
+
|
|
6
|
+
<h1>EmbedPDF Snippet</h1>
|
|
7
|
+
<p>The easiest way to embed PDF files in your website with a complete, ready‑to‑use interface.</p>
|
|
8
|
+
|
|
9
|
+
<a href="https://www.embedpdf.com/docs/snippet/introduction"><img alt="Documentation" src="https://img.shields.io/badge/View%20Docs-0af?style=for-the-badge&labelColor=000000"></a>
|
|
10
|
+
<a href="https://snippet.embedpdf.com/"><img alt="Live Demo" src="https://img.shields.io/badge/Try%20Live%20Demo-ff1493.svg?style=for-the-badge&labelColor=000000"></a>
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 📚 Documentation
|
|
17
|
+
|
|
18
|
+
The full walkthrough, advanced examples, and API reference live in our docs site:
|
|
19
|
+
|
|
20
|
+
👉 **[https://www.embedpdf.com/docs/snippet/introduction](https://www.embedpdf.com/docs/snippet/introduction)**
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 🚀 Introduction
|
|
25
|
+
|
|
26
|
+
**EmbedPDF Snippet** is a _“batteries‑included”_ drop‑in that turns any `<div>` into a professional PDF reader. No build step, no framework lock‑in—just copy, paste, and you’re done.
|
|
27
|
+
|
|
28
|
+
### Why choose the Snippet?
|
|
29
|
+
|
|
30
|
+
- **Complete UI out‑of‑the‑box** – toolbar, thumbnails, search, zoom & more
|
|
31
|
+
- **Zero build tooling** – works in plain HTML pages or alongside any JS framework
|
|
32
|
+
- **30‑second setup** – a single `<script type="module">` is all you need
|
|
33
|
+
- **Fully configurable** – tweak behavior with a lightweight options object
|
|
34
|
+
- **Runs everywhere** – modern browsers, frameworks, static sites & CMSes
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## ⚡️ Quick Install
|
|
39
|
+
|
|
40
|
+
Add the CDN module and point it at a container:
|
|
41
|
+
|
|
42
|
+
```html filename="index.html" copy
|
|
43
|
+
<div id="pdf-viewer" style="height: 500px"></div>
|
|
44
|
+
<script async type="module">
|
|
45
|
+
import EmbedPDF from 'https://snippet.embedpdf.com/embedpdf.js';
|
|
46
|
+
|
|
47
|
+
EmbedPDF.init({
|
|
48
|
+
type: 'container', // mount strategy
|
|
49
|
+
target: document.getElementById('pdf-viewer'),
|
|
50
|
+
src: 'https://snippet.embedpdf.com/ebook.pdf', // your PDF URL
|
|
51
|
+
});
|
|
52
|
+
</script>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
That’s it—refresh and enjoy a full‑featured viewer.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 🛠 Basic Usage Pattern
|
|
60
|
+
|
|
61
|
+
1. **Container** – create a DOM element where the viewer will render.
|
|
62
|
+
2. **Import** – load `embedpdf.js` from the CDN with `type="module"`.
|
|
63
|
+
3. **Initialize** – call `EmbedPDF.init()` with your configuration.
|
|
64
|
+
|
|
65
|
+
### Minimal Example
|
|
66
|
+
|
|
67
|
+
```html filename="basic-example.html" copy
|
|
68
|
+
<!DOCTYPE html>
|
|
69
|
+
<html>
|
|
70
|
+
<head>
|
|
71
|
+
<title>My PDF Viewer</title>
|
|
72
|
+
</head>
|
|
73
|
+
<body>
|
|
74
|
+
<div id="pdf-viewer" style="height: 100vh"></div>
|
|
75
|
+
<script async type="module">
|
|
76
|
+
import EmbedPDF from 'https://snippet.embedpdf.com/embedpdf.js';
|
|
77
|
+
|
|
78
|
+
EmbedPDF.init({
|
|
79
|
+
type: 'container',
|
|
80
|
+
target: document.getElementById('pdf-viewer'),
|
|
81
|
+
src: 'https://snippet.embedpdf.com/ebook.pdf',
|
|
82
|
+
});
|
|
83
|
+
</script>
|
|
84
|
+
</body>
|
|
85
|
+
</html>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 📄 License
|
|
89
|
+
|
|
90
|
+
EmbedPDF Snippet is [MIT licensed](https://github.com/embedpdf/embed-pdf-viewer/blob/main/LICENSE). Commercial use is welcome—just keep the copyright headers intact.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { h, JSX } from 'preact';
|
|
2
|
+
import { TrackedAnnotation } from '@embedpdf/plugin-annotation';
|
|
3
|
+
type AnnotationMenuProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
4
|
+
trackedAnnotation: TrackedAnnotation;
|
|
5
|
+
style?: JSX.CSSProperties;
|
|
6
|
+
};
|
|
7
|
+
export declare const AnnotationMenu: ({ trackedAnnotation, ...props }: AnnotationMenuProps) => h.JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=annotation-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-menu.d.ts","sourceRoot":"","sources":["../../src/components/annotation-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE,KAAK,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,GAAG;IAC7E,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,KAAK,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,iCAAiC,mBAAmB,kBA2ClF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
2
|
+
import { AnnotationTool, TrackedAnnotation } from '@embedpdf/plugin-annotation';
|
|
3
|
+
export interface SidebarPropsBase<T extends PdfAnnotationObject = PdfAnnotationObject> {
|
|
4
|
+
documentId: string;
|
|
5
|
+
selected: TrackedAnnotation<T> | null;
|
|
6
|
+
activeTool: AnnotationTool<T> | null;
|
|
7
|
+
colorPresets: string[];
|
|
8
|
+
intent?: string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhF,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB;IACnF,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACtC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACrC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,GAAI,gBAAgB,eAAe,kBAWzD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { PdfFreeTextAnnoObject } from '@embedpdf/models';
|
|
3
|
+
import { SidebarPropsBase } from './common';
|
|
4
|
+
export declare const FreeTextSidebar: ({ documentId, selected, activeTool, colorPresets, }: SidebarPropsBase<PdfFreeTextAnnoObject>) => h.JSX.Element | null;
|
|
5
|
+
//# sourceMappingURL=free-text-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"free-text-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/free-text-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,EACL,qBAAqB,EAStB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAc5C,eAAO,MAAM,eAAe,GAAI,qDAK7B,gBAAgB,CAAC,qBAAqB,CAAC,yBAoRzC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { PdfInkAnnoObject } from '@embedpdf/models';
|
|
3
|
+
import { SidebarPropsBase } from './common';
|
|
4
|
+
export declare const InkSidebar: ({ documentId, selected, activeTool, colorPresets, }: SidebarPropsBase<PdfInkAnnoObject>) => h.JSX.Element | null;
|
|
5
|
+
//# sourceMappingURL=ink-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ink-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/ink-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C,eAAO,MAAM,UAAU,GAAI,qDAKxB,gBAAgB,CAAC,gBAAgB,CAAC,yBAqEpC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { PdfLineAnnoObject, PdfPolylineAnnoObject } from '@embedpdf/models';
|
|
3
|
+
import { SidebarPropsBase } from './common';
|
|
4
|
+
export declare const LineSidebar: ({ documentId, selected, activeTool, colorPresets, }: SidebarPropsBase<PdfLineAnnoObject | PdfPolylineAnnoObject>) => h.JSX.Element | null;
|
|
5
|
+
//# sourceMappingURL=line-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/line-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAGL,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAW5C,eAAO,MAAM,WAAW,GAAI,qDAKzB,gBAAgB,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,yBAkJ7D,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { PdfPolygonAnnoObject } from '@embedpdf/models';
|
|
3
|
+
import { SidebarPropsBase } from './common';
|
|
4
|
+
export declare const PolygonSidebar: ({ documentId, selected, activeTool, colorPresets, }: SidebarPropsBase<PdfPolygonAnnoObject>) => h.JSX.Element | null;
|
|
5
|
+
//# sourceMappingURL=polygon-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polygon-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/polygon-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAA4B,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,eAAO,MAAM,cAAc,GAAI,qDAK5B,gBAAgB,CAAC,oBAAoB,CAAC,yBA8GxC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @jsxImportSource preact */
|
|
2
|
+
import { h } from 'preact';
|
|
3
|
+
import { PdfAnnotationSubtype, PdfAnnotationObject } from '@embedpdf/models';
|
|
4
|
+
import { SidebarPropsBase } from './common';
|
|
5
|
+
type SidebarComponent<S extends PdfAnnotationSubtype> = (p: SidebarPropsBase<Extract<PdfAnnotationObject, {
|
|
6
|
+
type: S;
|
|
7
|
+
}>>) => h.JSX.Element | null;
|
|
8
|
+
interface SidebarEntry<S extends PdfAnnotationSubtype> {
|
|
9
|
+
component: SidebarComponent<S>;
|
|
10
|
+
title?: string | ((p: SidebarPropsBase<Extract<PdfAnnotationObject, {
|
|
11
|
+
type: S;
|
|
12
|
+
}>>) => string);
|
|
13
|
+
}
|
|
14
|
+
type SidebarRegistry = Partial<{
|
|
15
|
+
[K in PdfAnnotationSubtype]: SidebarEntry<K>;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const SidebarRegistry: SidebarRegistry;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/registry.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAS5C,KAAK,gBAAgB,CAAC,CAAC,SAAS,oBAAoB,IAAI,CACtD,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,mBAAmB,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC,KAC3D,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;AAE1B,UAAU,YAAY,CAAC,CAAC,SAAS,oBAAoB;IACnD,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,mBAAmB,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC;CAC/F;AAED,KAAK,eAAe,GAAG,OAAO,CAAC;KAC5B,CAAC,IAAI,oBAAoB,GAAG,YAAY,CAAC,CAAC,CAAC;CAC7C,CAAC,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,eAkB7B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { SidebarPropsBase } from './common';
|
|
3
|
+
import { PdfCircleAnnoObject, PdfSquareAnnoObject } from '@embedpdf/models';
|
|
4
|
+
export declare const ShapeSidebar: ({ documentId, selected, activeTool, colorPresets, }: SidebarPropsBase<PdfCircleAnnoObject | PdfSquareAnnoObject>) => h.JSX.Element | null;
|
|
5
|
+
//# sourceMappingURL=shape-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/shape-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5E,eAAO,MAAM,YAAY,GAAI,qDAK1B,gBAAgB,CAAC,mBAAmB,GAAG,mBAAmB,CAAC,yBAuG7D,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { PdfStampAnnoObject } from '@embedpdf/models';
|
|
3
|
+
import { SidebarPropsBase } from './common';
|
|
4
|
+
export declare const StampSidebar: ({ documentId }: SidebarPropsBase<PdfStampAnnoObject>) => h.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=stamp-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stamp-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/stamp-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,YAAY,GAAI,gBAAgB,gBAAgB,CAAC,kBAAkB,CAAC,kBAGhF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { PdfHighlightAnnoObject, PdfSquigglyAnnoObject, PdfStrikeOutAnnoObject, PdfUnderlineAnnoObject } from '@embedpdf/models';
|
|
3
|
+
import { SidebarPropsBase } from './common';
|
|
4
|
+
export declare const TextMarkupSidebar: ({ documentId, selected, activeTool, colorPresets, }: SidebarPropsBase<PdfHighlightAnnoObject | PdfUnderlineAnnoObject | PdfStrikeOutAnnoObject | PdfSquigglyAnnoObject>) => h.JSX.Element | null;
|
|
5
|
+
//# sourceMappingURL=text-markup-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-markup-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/text-markup-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAEL,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EAEvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAwB5C,eAAO,MAAM,iBAAiB,GAAI,qDAK/B,gBAAgB,CACjB,sBAAsB,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,qBAAqB,CACjG,yBA4FA,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { h, ComponentChildren } from 'preact';
|
|
2
|
+
import { PdfStandardFontFamily, PdfAnnotationBorderStyle, PdfAnnotationLineEnding } from '@embedpdf/models';
|
|
3
|
+
/**
|
|
4
|
+
* A hook to manage the state and behavior of a dropdown component.
|
|
5
|
+
* It handles:
|
|
6
|
+
* 1. Open/closed state.
|
|
7
|
+
* 2. Closing the dropdown when clicking outside of it.
|
|
8
|
+
* 3. Scrolling the selected item into view when the dropdown opens.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useDropdown: () => {
|
|
11
|
+
open: boolean;
|
|
12
|
+
setOpen: import("preact/hooks").Dispatch<import("preact/hooks").StateUpdater<boolean>>;
|
|
13
|
+
rootRef: import("preact").RefObject<HTMLDivElement>;
|
|
14
|
+
selectedItemRef: import("preact").RefObject<HTMLElement>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Section label for annotation property groups
|
|
18
|
+
*/
|
|
19
|
+
export declare const SectionLabel: ({ children, className, }: {
|
|
20
|
+
children: ComponentChildren;
|
|
21
|
+
className?: string;
|
|
22
|
+
}) => h.JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* Value display for showing current values (e.g., "50%", "5px")
|
|
25
|
+
*/
|
|
26
|
+
export declare const ValueDisplay: ({ children, className, }: {
|
|
27
|
+
children: ComponentChildren;
|
|
28
|
+
className?: string;
|
|
29
|
+
}) => h.JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* Section wrapper for consistent spacing
|
|
32
|
+
*/
|
|
33
|
+
export declare const Section: ({ children, className, }: {
|
|
34
|
+
children: ComponentChildren;
|
|
35
|
+
className?: string;
|
|
36
|
+
}) => h.JSX.Element;
|
|
37
|
+
export declare const Slider: ({ value, min, max, step, onChange, }: {
|
|
38
|
+
value: number;
|
|
39
|
+
min?: number;
|
|
40
|
+
max?: number;
|
|
41
|
+
step?: number;
|
|
42
|
+
onChange: (v: number) => void;
|
|
43
|
+
}) => h.JSX.Element;
|
|
44
|
+
export declare const ColorSwatch: ({ color, active, onSelect, }: {
|
|
45
|
+
color: string;
|
|
46
|
+
active: boolean;
|
|
47
|
+
onSelect: (c: string) => void;
|
|
48
|
+
}) => h.JSX.Element;
|
|
49
|
+
type StrokeItem = {
|
|
50
|
+
id: PdfAnnotationBorderStyle;
|
|
51
|
+
dash?: number[];
|
|
52
|
+
};
|
|
53
|
+
export declare const StrokeStyleSelect: (props: {
|
|
54
|
+
value: StrokeItem;
|
|
55
|
+
onChange: (s: StrokeItem) => void;
|
|
56
|
+
}) => h.JSX.Element;
|
|
57
|
+
export declare const LineEndingSelect: ({ position, ...props }: {
|
|
58
|
+
value: PdfAnnotationLineEnding;
|
|
59
|
+
onChange: (e: PdfAnnotationLineEnding) => void;
|
|
60
|
+
position: "start" | "end";
|
|
61
|
+
}) => h.JSX.Element;
|
|
62
|
+
export declare const FontFamilySelect: (props: {
|
|
63
|
+
value: PdfStandardFontFamily;
|
|
64
|
+
onChange: (fam: PdfStandardFontFamily) => void;
|
|
65
|
+
}) => h.JSX.Element;
|
|
66
|
+
export declare const FontSizeInputSelect: ({ value, onChange, options, }: {
|
|
67
|
+
value: number;
|
|
68
|
+
onChange: (size: number) => void;
|
|
69
|
+
options?: readonly number[];
|
|
70
|
+
}) => h.JSX.Element;
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/components/annotation-sidebar/ui.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,CAAC,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAGxD,OAAO,EAEL,qBAAqB,EAErB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAO1B;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;;;;CA4BvB,CAAC;AA4EF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,0BAG1B;IACD,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kBAEA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,0BAG1B;IACD,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kBAAyE,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,0BAGrB;IACD,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kBAA8D,CAAC;AAQhE,eAAO,MAAM,MAAM,GAAI,sCAMpB;IACD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B,kBAUA,CAAC;AAGF,eAAO,MAAM,WAAW,GAAI,8BAIzB;IACD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B,kBA0BA,CAAC;AAQF,KAAK,UAAU,GAAG;IAAE,EAAE,EAAE,wBAAwB,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AA4BpE,eAAO,MAAM,iBAAiB,GAAI,OAAO;IACvC,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACnC,kBAQA,CAAC;AAoEF,eAAO,MAAM,gBAAgB,GAAI,wBAG9B;IACD,KAAK,EAAE,uBAAuB,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,OAAO,GAAG,KAAK,CAAC;CAC3B,kBAaA,CAAC;AAGF,eAAO,MAAM,gBAAgB,GAAI,OAAO;IACtC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAChD,kBASA,CAAC;AAGF,eAAO,MAAM,mBAAmB,GAAI,+BAIjC;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,kBA2DA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-sidebar.d.ts","sourceRoot":"","sources":["../../src/components/annotation-sidebar.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAa3B,wBAAgB,iBAAiB,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,wBAmDvE"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { PluginRegistry } from '@embedpdf/core';
|
|
3
|
+
import { ViewportPluginConfig } from '@embedpdf/plugin-viewport/preact';
|
|
4
|
+
import { ScrollPluginConfig } from '@embedpdf/plugin-scroll/preact';
|
|
5
|
+
import { SpreadPluginConfig } from '@embedpdf/plugin-spread/preact';
|
|
6
|
+
import { UIPluginConfig } from '@embedpdf/plugin-ui/preact';
|
|
7
|
+
import { DocumentManagerPluginConfig } from '@embedpdf/plugin-document-manager/preact';
|
|
8
|
+
import { CommandsPluginConfig } from '@embedpdf/plugin-commands/preact';
|
|
9
|
+
import { I18nPluginConfig } from '@embedpdf/plugin-i18n/preact';
|
|
10
|
+
import { ZoomPluginConfig } from '@embedpdf/plugin-zoom/preact';
|
|
11
|
+
import { RenderPluginConfig } from '@embedpdf/plugin-render/preact';
|
|
12
|
+
import { RotatePluginConfig } from '@embedpdf/plugin-rotate/preact';
|
|
13
|
+
import { SearchPluginConfig } from '@embedpdf/plugin-search/preact';
|
|
14
|
+
import { SelectionPluginConfig } from '@embedpdf/plugin-selection/preact';
|
|
15
|
+
import { TilingPluginConfig } from '@embedpdf/plugin-tiling/preact';
|
|
16
|
+
import { ThumbnailPluginConfig } from '@embedpdf/plugin-thumbnail/preact';
|
|
17
|
+
import { AnnotationPluginConfig } from '@embedpdf/plugin-annotation/preact';
|
|
18
|
+
import { PrintPluginConfig } from '@embedpdf/plugin-print/preact';
|
|
19
|
+
import { FullscreenPluginConfig } from '@embedpdf/plugin-fullscreen/preact';
|
|
20
|
+
import { BookmarkPluginConfig } from '@embedpdf/plugin-bookmark/preact';
|
|
21
|
+
import { ExportPluginConfig } from '@embedpdf/plugin-export/preact';
|
|
22
|
+
import { InteractionManagerPluginConfig } from '@embedpdf/plugin-interaction-manager/preact';
|
|
23
|
+
import { PanPluginConfig } from '@embedpdf/plugin-pan/preact';
|
|
24
|
+
import { CapturePluginConfig } from '@embedpdf/plugin-capture/preact';
|
|
25
|
+
import { HistoryPluginConfig } from '@embedpdf/plugin-history/preact';
|
|
26
|
+
import { RedactionPluginConfig } from '@embedpdf/plugin-redaction/preact';
|
|
27
|
+
import { AttachmentPluginConfig } from '@embedpdf/plugin-attachment/preact';
|
|
28
|
+
import { ThemeConfig } from '@/config/theme';
|
|
29
|
+
import { IconsConfig } from '@/config/icon-registry';
|
|
30
|
+
import { TabBarVisibility } from '@/components/tab-bar';
|
|
31
|
+
export interface PDFViewerConfig {
|
|
32
|
+
/** URL or path to the PDF document. If not provided, viewer loads with no document. */
|
|
33
|
+
src?: string;
|
|
34
|
+
/** Use web worker for PDF processing. Default: true */
|
|
35
|
+
worker?: boolean;
|
|
36
|
+
/** Custom URL for the WASM file */
|
|
37
|
+
wasmUrl?: string;
|
|
38
|
+
/** Enable debug logging. Default: false */
|
|
39
|
+
log?: boolean;
|
|
40
|
+
/** Theme configuration */
|
|
41
|
+
theme?: ThemeConfig;
|
|
42
|
+
/** Custom icons */
|
|
43
|
+
icons?: IconsConfig;
|
|
44
|
+
/**
|
|
45
|
+
* Tab bar visibility for multi-document support
|
|
46
|
+
* - 'always': Always show the tab bar
|
|
47
|
+
* - 'multiple': Show only when more than 1 document is open (default)
|
|
48
|
+
* - 'never': Never show the tab bar
|
|
49
|
+
*/
|
|
50
|
+
tabBar?: TabBarVisibility;
|
|
51
|
+
/** Document manager options (initialDocuments) */
|
|
52
|
+
documentManager?: DocumentManagerPluginConfig;
|
|
53
|
+
/** Commands options (commands, disabledCategories) */
|
|
54
|
+
commands?: CommandsPluginConfig;
|
|
55
|
+
/** i18n options (defaultLocale, locales, paramResolvers) */
|
|
56
|
+
i18n?: I18nPluginConfig;
|
|
57
|
+
/** UI schema options (schema, disabledCategories) */
|
|
58
|
+
ui?: UIPluginConfig;
|
|
59
|
+
/** Viewport options (viewportGap, scrollEndDelay) */
|
|
60
|
+
viewport?: ViewportPluginConfig;
|
|
61
|
+
/** Scroll options (defaultStrategy, defaultPageGap, defaultBufferSize) */
|
|
62
|
+
scroll?: ScrollPluginConfig;
|
|
63
|
+
/** Zoom options (defaultZoomLevel, minZoom, maxZoom, zoomStep) */
|
|
64
|
+
zoom?: ZoomPluginConfig;
|
|
65
|
+
/** Spread/layout options (defaultSpreadMode) */
|
|
66
|
+
spread?: SpreadPluginConfig;
|
|
67
|
+
/** Rotation options (defaultRotation) */
|
|
68
|
+
rotation?: RotatePluginConfig;
|
|
69
|
+
/** Pan mode options (defaultMode: 'never' | 'mobile' | 'always') */
|
|
70
|
+
pan?: PanPluginConfig;
|
|
71
|
+
/** Render options (withForms, withAnnotations) */
|
|
72
|
+
render?: RenderPluginConfig;
|
|
73
|
+
/** Tiling options (tileSize, overlapPx, extraRings) */
|
|
74
|
+
tiling?: TilingPluginConfig;
|
|
75
|
+
/** Thumbnail options (width, gap, buffer, labelHeight, etc.) */
|
|
76
|
+
thumbnails?: ThumbnailPluginConfig;
|
|
77
|
+
/** Annotation options (tools, colorPresets, autoCommit, author, etc.) */
|
|
78
|
+
annotations?: AnnotationPluginConfig;
|
|
79
|
+
/** Search options (flags, showAllResults) */
|
|
80
|
+
search?: SearchPluginConfig;
|
|
81
|
+
/** Selection options (menuHeight) */
|
|
82
|
+
selection?: SelectionPluginConfig;
|
|
83
|
+
/** Bookmark options */
|
|
84
|
+
bookmarks?: BookmarkPluginConfig;
|
|
85
|
+
/** Attachment options */
|
|
86
|
+
attachments?: AttachmentPluginConfig;
|
|
87
|
+
/** Capture options (scale, imageType, withAnnotations) */
|
|
88
|
+
capture?: CapturePluginConfig;
|
|
89
|
+
/** Redaction options (drawBlackBoxes) */
|
|
90
|
+
redaction?: RedactionPluginConfig;
|
|
91
|
+
/** Print options */
|
|
92
|
+
print?: PrintPluginConfig;
|
|
93
|
+
/** Export options (defaultFileName) */
|
|
94
|
+
export?: ExportPluginConfig;
|
|
95
|
+
/** Fullscreen options (targetElement) */
|
|
96
|
+
fullscreen?: FullscreenPluginConfig;
|
|
97
|
+
/** History/undo options */
|
|
98
|
+
history?: HistoryPluginConfig;
|
|
99
|
+
/** Interaction manager options (exclusionRules) */
|
|
100
|
+
interactionManager?: InteractionManagerPluginConfig;
|
|
101
|
+
}
|
|
102
|
+
interface PDFViewerProps {
|
|
103
|
+
config: PDFViewerConfig;
|
|
104
|
+
onRegistryReady?: (registry: PluginRegistry) => void;
|
|
105
|
+
}
|
|
106
|
+
export declare function PDFViewer({ config, onRegistryReady }: PDFViewerProps): h.JSX.Element;
|
|
107
|
+
export {};
|
|
108
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/components/app.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/components/capture.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,QAAQ,CAAC;AAYrC,wBAAgB,OAAO,kBAuGtB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
type CommandButtonProps = {
|
|
3
|
+
commandId: string;
|
|
4
|
+
documentId: string;
|
|
5
|
+
variant?: 'icon' | 'text' | 'icon-text' | 'tab';
|
|
6
|
+
itemId?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A button that executes a command when clicked.
|
|
11
|
+
* Uses the useCommand hook to get the command state and execution function.
|
|
12
|
+
*/
|
|
13
|
+
export declare function CommandButton({ commandId, documentId, variant, itemId, className, }: CommandButtonProps): h.JSX.Element | null;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=command-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-button.d.ts","sourceRoot":"","sources":["../../src/components/command-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,QAAQ,CAAC;AAQrC,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,KAAK,CAAC;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,UAAU,EACV,OAAgB,EAChB,MAAM,EACN,SAAS,GACV,EAAE,kBAAkB,wBA4DpB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { SidebarAnnotationEntry, TrackedAnnotation } from '@embedpdf/plugin-annotation';
|
|
3
|
+
interface AnnotationCardProps {
|
|
4
|
+
entry: SidebarAnnotationEntry;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
onSelect: () => void;
|
|
7
|
+
onUpdate: (id: string, contents: string) => void;
|
|
8
|
+
onDelete: (annotation: TrackedAnnotation) => void;
|
|
9
|
+
onReply: (inReplyToId: string, contents: string) => void;
|
|
10
|
+
documentId: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const AnnotationCard: ({ entry, isSelected, onSelect, onUpdate, onDelete, onReply, documentId, }: AnnotationCardProps) => h.JSX.Element | null;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=annotation-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-card.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/annotation-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAUxF,UAAU,mBAAmB;IAC3B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,QAAQ,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,GAAI,2EAQ5B,mBAAmB,yBAkIrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { TrackedAnnotation } from '@embedpdf/plugin-annotation';
|
|
3
|
+
import { AnnotationConfig } from './config';
|
|
4
|
+
export declare const AnnotationIcon: ({ annotation, config, className, }: {
|
|
5
|
+
annotation: TrackedAnnotation;
|
|
6
|
+
config: AnnotationConfig;
|
|
7
|
+
className?: string;
|
|
8
|
+
}) => h.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=annotation-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-icon.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/annotation-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,cAAc,GAAI,oCAI5B;IACD,UAAU,EAAE,iBAAiB,CAAC;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kBAWA,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { h, RefObject } from 'preact';
|
|
2
|
+
interface AnnotationInputProps {
|
|
3
|
+
placeholder: string;
|
|
4
|
+
onSubmit: (text: string) => void;
|
|
5
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
6
|
+
isFocused?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const AnnotationInput: ({ placeholder, onSubmit, inputRef, isFocused, }: AnnotationInputProps) => h.JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=annotation-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-input.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/annotation-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGtC,UAAU,oBAAoB;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,GAAI,iDAK7B,oBAAoB,kBA2CtB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
3
|
+
interface CommentProps {
|
|
4
|
+
annotation: PdfAnnotationObject;
|
|
5
|
+
onSave: (text: string) => void;
|
|
6
|
+
onDelete: () => void;
|
|
7
|
+
isReply?: boolean;
|
|
8
|
+
documentId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const Comment: ({ annotation, onSave, onDelete, isReply, documentId, }: CommentProps) => h.JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/comment.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,UAAU,YAAY;IACpB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,OAAO,GAAI,wDAMrB,YAAY,kBAqEd,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
2
|
+
import { SidebarSubtype, TrackedAnnotation } from '@embedpdf/plugin-annotation';
|
|
3
|
+
export interface AnnotationConfig {
|
|
4
|
+
label: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
iconProps: (annotation: PdfAnnotationObject) => {
|
|
7
|
+
primaryColor?: string;
|
|
8
|
+
secondaryColor?: string;
|
|
9
|
+
size?: number;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare const annotationConfigs: Record<SidebarSubtype, AnnotationConfig>;
|
|
14
|
+
export declare const getAnnotationConfig: (annotation: TrackedAnnotation) => AnnotationConfig | null;
|
|
15
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA8C,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAEL,cAAc,EACd,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAGrC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK;QAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAwFtE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,YAAY,iBAAiB,KAAG,gBAAgB,GAAG,IAKtF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
interface EditCommentFormProps {
|
|
3
|
+
initialText: string;
|
|
4
|
+
onSave: (newText: string) => void;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
documentId: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const EditCommentForm: ({ initialText, onSave, onCancel, autoFocus, documentId, }: EditCommentFormProps) => h.JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=edit-comment-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-comment-form.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/edit-comment-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B,UAAU,oBAAoB;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,GAAI,2DAM7B,oBAAoB,kBAgDtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../../src/components/comment-sidebar/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAI3B,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,GAAI,gBAAgB,eAAe,kBAWzD,CAAC"}
|