cbvirtua 1.0.44 → 1.0.46

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cbvirtua",
3
- "version": "1.0.44",
3
+ "version": "1.0.46",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,3 +0,0 @@
1
- {
2
- "presets": ["@babel/preset-env"]
3
- }
@@ -1,10 +0,0 @@
1
- {
2
- "env": {
3
- "node": true
4
- },
5
- "extends": ["eslint:recommended", "plugin:vue/essential", "prettier"],
6
- "plugins": ["prettier"],
7
- "rules": {
8
- "prettier/prettier": "warn"
9
- }
10
- }
@@ -1,20 +0,0 @@
1
- name: Publish to npm
2
-
3
- on:
4
- release:
5
- types:
6
- - published
7
-
8
- jobs:
9
- publish:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - uses: actions/checkout@v2
13
- - uses: actions/setup-node@v2
14
- with:
15
- node-version: 14
16
- registry-url: https://registry.npmjs.org/
17
- - run: npm ci
18
- - run: npm publish
19
- env:
20
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- npx lint-staged
@@ -1,5 +0,0 @@
1
- {
2
- "*.{js,vue}": [
3
- "npm run lint"
4
- ]
5
- }
@@ -1,7 +0,0 @@
1
- {
2
- "arrowParens": "always",
3
- "semi": false,
4
- "singleQuote": true,
5
- "tabWidth": 2,
6
- "trailingComma": "es5"
7
- }
@@ -1,14 +0,0 @@
1
- # Contributing to vue-pdf-embed
2
-
3
- Thank you for considering to contribute to vue-pdf-embed!
4
-
5
- ## Bug reports and feature requests
6
-
7
- We use [GitHub issues](https://github.com/hrynko/vue-pdf-embed/issues) to report bugs and request new features. Please provide as much detail as possible when preparing the description, this will help other contributors to better understand the problem.
8
-
9
- ## Proposing features and submitting fixes
10
-
11
- All code changes happen through [pull requests](https://github.com/hrynko/vue-pdf-embed/pulls). We actively welcome your features and fixes. Please provide a detailed description of the changes made and link them to [issues](https://github.com/hrynko/vue-pdf-embed/issues), if any.
12
-
13
- ## License
14
- By contributing, you agree that your contribution will be licensed under the [MIT License](LICENSE).
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Aliaksei Hrynko
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.
@@ -1,156 +0,0 @@
1
- # 📄 vue-pdf-embed
2
-
3
- PDF embed component for Vue 2 and Vue 3
4
-
5
- [![Awesome](https://raw.githubusercontent.com/sindresorhus/awesome/main/media/mentioned-badge.svg)](https://github.com/vuejs/awesome-vue)
6
- [![npm](https://img.shields.io/npm/v/vue-pdf-embed)](https://npmjs.com/package/vue-pdf-embed)
7
- [![npm](https://img.shields.io/npm/dm/vue-pdf-embed)](https://npmjs.com/package/vue-pdf-embed)
8
- [![GitHub Repo stars](https://img.shields.io/github/stars/hrynko/vue-pdf-embed)](https://github.com/hrynko/vue-pdf-embed)
9
- [![npm](https://img.shields.io/npm/l/vue-pdf-embed)](https://github.com/hrynko/vue-pdf-embed/blob/main/LICENSE)
10
-
11
- ## Features
12
-
13
- - Controlled rendering of PDF documents in Vue apps
14
- - Handles password protected documents
15
- - Includes text layer (searchable and selectable documents)
16
- - Includes annotation layer (annotations and links)
17
- - No peer dependencies or additional configuration required
18
- - Can be used directly in the browser (see [Examples](#examples))
19
-
20
- ## Compatibility
21
-
22
- This package is compatible with both Vue 2 and Vue 3, but consists of two separate builds. The default exported build is for Vue 3, for Vue 2 import `dist/vue2-pdf-embed.js` (see [Usage](#usage)).
23
-
24
- ## Installation
25
-
26
- Depending on the environment, the package can be installed in one of the following ways:
27
-
28
- ```shell
29
- npm install vue-pdf-embed@1
30
- ```
31
-
32
- ```shell
33
- yarn add vue-pdf-embed@1
34
- ```
35
-
36
- ```html
37
- <script src="https://unpkg.com/vue-pdf-embed@1"></script>
38
- ```
39
-
40
- ## Usage
41
-
42
- ```vue
43
- <template>
44
- <div>
45
- <h1>File</h1>
46
- <vue-pdf-embed :source="source1" />
47
-
48
- <h1>Base64</h1>
49
- <vue-pdf-embed :source="source2" />
50
- </div>
51
- </template>
52
-
53
- <script>
54
- import VuePdfEmbed from 'vue-pdf-embed'
55
-
56
- // OR THE FOLLOWING IMPORT FOR VUE 2
57
- // import VuePdfEmbed from 'vue-pdf-embed/dist/vue2-pdf-embed'
58
-
59
- export default {
60
- components: {
61
- VuePdfEmbed,
62
- },
63
- data() {
64
- return {
65
- source1: '<PDF_URL>',
66
- source2: 'data:application/pdf;base64,<BASE64_ENCODED_PDF>',
67
- }
68
- },
69
- }
70
- </script>
71
- ```
72
-
73
- ### Props
74
-
75
- | Name | Type | Accepted values | Description |
76
- | ------------------ | ---------------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------- |
77
- | annotationLayer | `boolean` | `true` or `false` | whether the annotation layer should be enabled |
78
- | height | `number` <br> `string` | natural numbers | desired page height in pixels (ignored if the width property is specified) |
79
- | imageResourcesPath | `string` | URL or path with trailing slash | path for icons used in the annotation layer |
80
- | page | `number` | `1` to the last page number | number of the page to display (displays all pages if not specified) |
81
- | rotation | `number` <br> `string` | `0`, `90`, `180` or `270` (multiples of `90`) | desired page rotation angle in degrees |
82
- | scale | `number` | rational numbers | desired ratio of canvas size to document size |
83
- | source | `string` <br> `object` <br> `Uint8Array` | document URL or typed array pre-filled with data | source of the document to display |
84
- | textLayer | `boolean` | `true` or `false` | whether the text layer should be enabled |
85
- | width | `number` <br> `string` | natural numbers | desired page width in pixels |
86
-
87
- ### Events
88
-
89
- | Name | Value | Description |
90
- | --------------------- | ----------------------------- | ------------------------------------------ |
91
- | internal-link-clicked | destination page number | internal link was clicked |
92
- | loaded | PDF document proxy | finished loading the document |
93
- | loading-failed | error object | failed to load document |
94
- | password-requested | callback function, retry flag | password is needed to display the document |
95
- | progress | progress params object | tracking document loading progress |
96
- | rendered | – | finished rendering the document |
97
- | rendering-failed | error object | failed to render document |
98
-
99
- ### Slots
100
-
101
- | Name | Props | Description |
102
- | ----------- | -------------------- | ----------------------------------- |
103
- | after-page | `page` (page number) | content to be added after the page |
104
- | before-page | `page` (page number) | content to be added before the page |
105
-
106
- ### Public Methods
107
-
108
- | Name | Arguments | Description |
109
- | -------- | ---------------------------------------------------------------------------- | ------------------------------------ |
110
- | download | filename (`string`) | download document |
111
- | print | print resolution (`number`), filename (`string`), all pages flag (`boolean`) | print document via browser interface |
112
- | render | – | manually (re)render document |
113
-
114
- **Note:** Public methods can be accessed via a [template ref](https://vuejs.org/guide/essentials/template-refs.html).
115
-
116
- ### Static Methods
117
-
118
- Besides the component itself, the module also includes a `getDocument` function for manual loading of PDF documents, which can then be used as the `source` prop of the component. In most cases it is sufficient to specify the `source` prop with a URL or typed array, while the result of the `getDocument` function can be used in special cases, such as sharing the source between multiple component instances. This is an advanced topic, so it is recommended to check the source code of the component before using this function.
119
-
120
- ## Common Issues
121
-
122
- This is a client-side library, so it is important to keep this in mind when working with SSR (server-side rendering) frameworks such as Nuxt. Depending on the framework used, you may need to properly configure the library import or use a wrapper.
123
-
124
- The path to predefined CMaps should be specified to ensure correct rendering of documents containing non-Latin characters, as well as in case of CMap-related errors:
125
-
126
- ```vue
127
- <vue-pdf-embed
128
- :source="{
129
- cMapUrl: 'https://unpkg.com/pdfjs-dist/cmaps/',
130
- url: pdfSource,
131
- }"
132
- />
133
- ```
134
-
135
- The image resource path must be specified for annotations to display correctly:
136
-
137
- ```vue
138
- <vue-pdf-embed
139
- image-resources-path="https://unpkg.com/pdfjs-dist/web/images/"
140
- :source="pdfSource"
141
- />
142
- ```
143
-
144
- **Note:** The examples above use a CDN to load resources, however these resources can also be included in the build by installing the `pdfjs-dist` package as a dependency and further configuring the bundler.
145
-
146
- ## Examples
147
-
148
- [Basic Usage Demo (JSFiddle)](https://jsfiddle.net/hrynko/ct6p8r7k)
149
-
150
- [Advanced Usage Demo (JSFiddle)](https://jsfiddle.net/hrynko/we7p5uq4)
151
-
152
- [Advanced Usage Demo (StackBlitz)](https://stackblitz.com/fork/vue-pdf-embed)
153
-
154
- ## License
155
-
156
- MIT License. Please see [LICENSE file](LICENSE) for more information.
@@ -1,56 +0,0 @@
1
- <template>
2
- <div>
3
- <vue-pdf-embed
4
- :image-resources-path="annotationIconsPath"
5
- :source="pdfSource"
6
- />
7
- </div>
8
- </template>
9
-
10
- <script>
11
- import VuePdfEmbed from '../src/vue-pdf-embed.vue'
12
-
13
- export default {
14
- components: {
15
- VuePdfEmbed,
16
- },
17
- data() {
18
- return {
19
- annotationIconsPath: '/node_modules/pdfjs-dist/web/images/',
20
- pdfSource:
21
- 'data:application/pdf;base64,' +
22
- 'JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxv' +
23
- 'ZwogIC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFn' +
24
- 'ZXMKICAvTWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBb' +
25
- 'IDMgMCBSIF0KPj4KZW5kb2JqCgozIDAgb2JqCjw8CiAgL1R5cGUgL1BhZ2UKICAvUGFy' +
26
- 'ZW50IDIgMCBSCiAgL1Jlc291cmNlcyA8PAogICAgL0ZvbnQgPDwKICAgICAgL0YxIDQg' +
27
- 'MCBSIAogICAgPj4KICA+PgogIC9Db250ZW50cyA1IDAgUgo+PgplbmRvYmoKCjQgMCBv' +
28
- 'YmoKPDwKICAvVHlwZSAvRm9udAogIC9TdWJ0eXBlIC9UeXBlMQogIC9CYXNlRm9udCAv' +
29
- 'VGltZXMtUm9tYW4KPj4KZW5kb2JqCgo1IDAgb2JqICAlIHBhZ2UgY29udGVudAo8PAog' +
30
- 'IC9MZW5ndGggNDQKPj4Kc3RyZWFtCkJUCjcwIDUwIFRECi9GMSAxMiBUZgooSGVsbG8s' +
31
- 'IHdvcmxkISkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iagoKeHJlZgowIDYKMDAwMDAwMDAw' +
32
- 'MCA2NTUzNSBmIAowMDAwMDAwMDEwIDAwMDAwIG4gCjAwMDAwMDAwNzkgMDAwMDAgbiAK' +
33
- 'MDAwMDAwMDE3MyAwMDAwMCBuIAowMDAwMDAwMzAxIDAwMDAwIG4gCjAwMDAwMDAzODAg' +
34
- 'MDAwMDAgbiAKdHJhaWxlcgo8PAogIC9TaXplIDYKICAvUm9vdCAxIDAgUgo+PgpzdGFy' +
35
- 'dHhyZWYKNDkyCiUlRU9G',
36
- }
37
- },
38
- }
39
- </script>
40
-
41
- <style lang="scss">
42
- body {
43
- padding: 16px;
44
- background-color: #ccc;
45
- }
46
-
47
- .vue-pdf-embed {
48
- margin: auto;
49
- max-width: 480px;
50
-
51
- & > div {
52
- margin-bottom: 4px;
53
- box-shadow: 0 2px 8px 4px rgba(0, 0, 0, 0.1);
54
- }
55
- }
56
- </style>
@@ -1,11 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
6
- <title>vue-pdf-embed demo</title>
7
- </head>
8
- <body>
9
- <div id="app"></div>
10
- </body>
11
- </html>
@@ -1,8 +0,0 @@
1
- import Vue from 'vue'
2
-
3
- import App from './App.vue'
4
-
5
- new Vue({
6
- el: '#app',
7
- render: (h) => h(App),
8
- })
@@ -1,6 +0,0 @@
1
- {
2
- "transform": {
3
- "\\.js$": "babel-jest",
4
- "\\.vue$": "vue-jest"
5
- }
6
- }