@vertexvis/doc-viewer-vue 0.24.4-canary.16

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 - Present Vertex Software, Inc.
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,92 @@
1
+ # Vue Bindings for Vertex Document Viewer SDK
2
+
3
+ ![npm](https://img.shields.io/npm/v/@vertexvis/doc-viewer-vue)
4
+ ![npm (scoped with tag)](https://img.shields.io/npm/v/@vertexvis/doc-viewer-vue/canary)
5
+
6
+ This project contains Vue bindings for Vertex's Document Viewer SDK. These bindings are
7
+ auto-generated from `@vertexvis/doc-viewer`.
8
+
9
+ ## Installation
10
+
11
+ Run `yarn add @vertexvis/doc-viewer-vue` or `npm install @vertexvis/doc-viewer-vue`
12
+ to add the project as an NPM dependency.
13
+
14
+ ## Usage
15
+
16
+ Prior to to use the component wrappers, we'll need to update the
17
+ `vite.config.ts` for the project to indicate that these wrappers are custom
18
+ elements. This will prevent warnings from Vue failing to resolve the custom
19
+ elements.
20
+
21
+ ```typescript
22
+ // vite.config.ts
23
+
24
+ export default defineConfig({
25
+ plugins: [
26
+ vue({
27
+ template: {
28
+ compilerOptions: {
29
+ isCustomElement: (tag) => tag.includes('vertex-')
30
+ }
31
+ }
32
+ }),
33
+ vueJsx()
34
+ ]
35
+ });
36
+ ```
37
+
38
+ Next, `@vertexvis/doc-viewer-vue` includes a Vue [Plugin][vue plugins],
39
+ `VertexDocumentViewerPlugin`, that needs to be added to the Vue App. It also
40
+ includes a global stylesheet with default styling. Consult your bundler's
41
+ documentation on how to bundle CSS with your project's bundler.
42
+
43
+ ```jsx
44
+ import '@vertexvis/doc-viewer/dist/doc-viewer/doc-viewer.css';
45
+
46
+ import { createApp } from 'vue';
47
+ import { VertexDocumentViewerPlugin } from '@vertexvis/doc-viewer-vue';
48
+ import App from './App.vue';
49
+
50
+ createApp(App).use(VertexDocumentViewerPlugin).mount('#app');
51
+ ```
52
+
53
+ Lastly, use the component wrappers in one of your Vue components.
54
+
55
+ ```tsx
56
+ <script setup lang="ts">
57
+ import { onMounted, ref } from 'vue';
58
+ import workerSrc from '@vertexvis/doc-viewer/assets/pdf.worker.min.mjs?url';
59
+
60
+ const viewer = ref<HTMLVertexDocumentViewerElement | null>(null);
61
+
62
+ onMounted(async () => {
63
+ if (viewer.value != null) {
64
+ // Configure the PDF.js worker source relative to your application's build
65
+ viewer.value.config = {
66
+ pdfJs: {
67
+ workerSrc
68
+ }
69
+ }
70
+ }
71
+ });
72
+ </script>
73
+
74
+ <template>
75
+ <vertex-document-viewer
76
+ id="document-viewer"
77
+ ref="viewer"
78
+ src="https://{{ DOCUMENT_URL }}"
79
+ >
80
+ </vertex-document-viewer>
81
+ </template>
82
+ ```
83
+
84
+ ## Documentation
85
+
86
+ See [@vertexvis/doc-viewer][component docs] for a full list of components and their
87
+ documentation.
88
+
89
+ [vue plugins]: https://vuejs.org/guide/reusability/plugins.html
90
+ [component docs]: https://github.com/Vertexvis/vertex-web-sdk/tree/master/packages/doc-viewer/src/components
91
+ [css variables]: https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties
92
+ [global styles]: https://github.com/Vertexvis/vertex-web-sdk/blob/master/packages/doc-viewer/src/css/global.css