Skip to content

Commit 043fd01

Browse files
authored
Merge pull request #131 from TaTo30/monorepo
Monorepo
2 parents d1fea8b + 6026625 commit 043fd01

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+5777
-10834
lines changed

.eslintrc.cjs

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
process.env.ESLINT_TSCONFIG = 'tsconfig.json'
1+
/* eslint-env node */
2+
require("@rushstack/eslint-patch/modern-module-resolution")
23

34
module.exports = {
4-
extends: '@antfu',
5-
}
5+
extends: [
6+
'eslint:recommended',
7+
'plugin:vue/vue3-essential',
8+
'@vue/eslint-config-typescript'
9+
]
10+
}

.github/workflows/deploy-docs.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ jobs:
2222
node-version: 18
2323

2424
- name: Install packages
25-
working-directory: docs
2625
run: npm install
2726

2827
- name: Build VitePress site
29-
working-directory: docs
30-
run: npm run docs:build
28+
run: npm run build:docs
3129

3230
- name: Deploy to GitHub Pages
3331
uses: crazy-max/ghaction-github-pages@v4

.github/workflows/publish-package.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
run: npm run build
2828

2929
- name: Publish packages
30+
working-directory: packages/vue-pdf
3031
run: npm publish --access public
3132
env:
3233
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ node_modules
1111
.ghpages
1212
cache
1313
temp
14-
.vscode
1514
playground/pdf/*
1615
playground/samples/*
1716
cjs

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
<img width=250 src="./docs/public/logo.png" />
2+
<img width=250 src="./samples/logo.png" />
33
<h1>VuePDF</h1>
44
</div>
55

@@ -92,7 +92,7 @@ import { VuePDF, usePDF } from '@tato30/vue-pdf'
9292
import '@tato30/vue-pdf/style.css'
9393
9494
const { pdf } = usePDF({
95-
url: '/example_xfa.pdf',
95+
url: '/xfa.pdf',
9696
enableXfa: true,
9797
})
9898
</script>

docs/.vitepress/config.js

+100-93
Original file line numberDiff line numberDiff line change
@@ -1,218 +1,225 @@
1-
import { version } from '../package.json'
1+
import { resolve } from "node:path";
2+
import { version } from '../../packages/vue-pdf/package.json';
3+
24

35
export default {
46
vite: {
57
optimizeDeps: {
68
esbuildOptions: {
79
supported: {
8-
'top-level-await': true,
10+
"top-level-await": true,
911
},
1012
},
1113
},
1214
build: {
13-
target: 'esnext',
15+
target: 'esnext'
16+
},
17+
resolve: {
18+
alias: {
19+
"@tato30/vue-pdf": resolve(__dirname, "../../packages/vue-pdf/dist")
20+
},
1421
},
1522
},
16-
title: 'VuePDF',
17-
description: 'PDF component for Vue 3',
18-
base: '/vue-pdf/',
23+
title: "VuePDF",
24+
description: "PDF component for Vue 3",
25+
base: "/vue-pdf/",
1926
lastUpdated: true,
20-
head: [['link', { rel: 'icon', type: 'image/png', href: '/logo.png' }]],
27+
head: [["link", { rel: "icon", type: "image/png", href: "/logo.png" }]],
2128
themeConfig: {
22-
logo: '/logo.png',
29+
logo: "/logo.png",
2330
editLink: {
24-
pattern: 'https://github.com/TaTo30/vue-pdf/edit/master/docs/:path',
31+
pattern: "https://github.com/TaTo30/vue-pdf/edit/master/docs/:path",
2532
},
2633
socialLinks: [
2734
{
28-
icon: 'github',
29-
link: 'https://github.com/TaTo30/vue-pdf',
35+
icon: "github",
36+
link: "https://github.com/TaTo30/vue-pdf",
3037
},
3138
],
3239
search: {
33-
provider: 'local',
40+
provider: "local",
3441
},
3542
nav: [
3643
{
37-
text: 'Guide',
38-
link: '/guide/introduction.md',
44+
text: "Guide",
45+
link: "/guide/introduction.md",
3946
},
4047
{
41-
text: 'Examples',
48+
text: "Examples",
4249
items: [
4350
{
44-
text: 'Basic usages',
45-
link: '/examples/basic/one_page.md',
51+
text: "Basic usages",
52+
link: "/examples/basic/one_page.md",
4653
},
4754
{
48-
text: 'Advanced usages',
49-
link: '/examples/advanced/watermark.md',
55+
text: "Advanced usages",
56+
link: "/examples/advanced/watermark.md",
5057
},
5158
{
52-
text: 'Events',
53-
link: '/examples/loaded_events/loaded.md',
59+
text: "Events",
60+
link: "/examples/loaded_events/loaded.md",
5461
},
5562
],
5663
},
5764
{
5865
text: `v${version}`,
5966
items: [
6067
{
61-
text: 'Changelog',
62-
link: 'https://github.com/TaTo30/vue-pdf/releases',
68+
text: "Changelog",
69+
link: "https://github.com/TaTo30/vue-pdf/releases",
6370
},
6471
{
65-
text: 'Contributing',
66-
link: 'https://github.com/TaTo30/vue-pdf#contributing',
72+
text: "Contributing",
73+
link: "https://github.com/TaTo30/vue-pdf#contributing",
6774
},
6875
],
6976
},
7077
],
7178
sidebar: {
72-
'/guide/': {
73-
base: '/guide/',
79+
"/guide/": {
80+
base: "/guide/",
7481
items: [
7582
{
76-
text: 'Guide',
83+
text: "Guide",
7784
items: [
7885
{
79-
text: 'Introduction',
80-
link: 'introduction',
86+
text: "Introduction",
87+
link: "introduction",
8188
},
8289
{
83-
text: 'Composables',
84-
link: 'composables',
90+
text: "Composables",
91+
link: "composables",
8592
},
8693
],
8794
},
8895
{
89-
text: 'Reference',
96+
text: "Reference",
9097
items: [
9198
{
92-
text: 'Props',
93-
link: 'props',
99+
text: "Props",
100+
link: "props",
94101
},
95102
{
96-
text: 'Events',
97-
link: 'events',
103+
text: "Events",
104+
link: "events",
98105
},
99106
{
100-
text: 'Methods',
101-
link: 'methods',
107+
text: "Methods",
108+
link: "methods",
102109
},
103110
{
104-
text: 'Slots',
105-
link: 'slots',
111+
text: "Slots",
112+
link: "slots",
106113
},
107114
],
108115
},
109116
],
110117
},
111-
'/examples/': {
118+
"/examples/": {
112119
items: [
113120
{
114-
text: 'Basic usages',
115-
base: '/examples/basic/',
121+
text: "Basic usages",
122+
base: "/examples/basic/",
116123
items: [
117124
{
118-
text: 'One Page',
119-
link: 'one_page',
125+
text: "One Page",
126+
link: "one_page",
120127
},
121128
{
122-
text: 'All Pages',
123-
link: 'all_pages',
129+
text: "All Pages",
130+
link: "all_pages",
124131
},
125132
{
126-
text: 'Scale',
127-
link: 'scale',
133+
text: "Scale",
134+
link: "scale",
128135
},
129136
{
130-
text: 'Rotation',
131-
link: 'rotation',
137+
text: "Rotation",
138+
link: "rotation",
132139
},
133140
{
134-
text: 'Text Layer',
135-
link: 'text_layer',
141+
text: "Text Layer",
142+
link: "text_layer",
136143
},
137144
{
138-
text: 'Annotation Layer',
139-
link: 'annotation_layer',
145+
text: "Annotation Layer",
146+
link: "annotation_layer",
140147
},
141148
{
142-
text: 'XFA Layer',
143-
link: 'xfa_layer',
149+
text: "XFA Layer",
150+
link: "xfa_layer",
144151
},
145152
],
146153
},
147154
{
148-
text: 'Advanced usages',
149-
base: '/examples/advanced/',
155+
text: "Advanced usages",
156+
base: "/examples/advanced/",
150157
items: [
151158
{
152-
text: 'Watermark',
153-
link: 'watermark',
159+
text: "Watermark",
160+
link: "watermark",
154161
},
155162
{
156-
text: 'Fit Parent',
157-
link: 'fit_parent',
163+
text: "Fit Parent",
164+
link: "fit_parent",
158165
},
159166
{
160-
text: 'Highlight Text',
161-
link: 'highlight_text',
167+
text: "Highlight Text",
168+
link: "highlight_text",
162169
},
163170
{
164-
text: 'Annotation Filter',
165-
link: 'annotation_filter',
171+
text: "Annotation Filter",
172+
link: "annotation_filter",
166173
},
167174
{
168-
text: 'Multiple PDF',
169-
link: 'multiple_pdf',
175+
text: "Multiple PDF",
176+
link: "multiple_pdf",
170177
},
171178
{
172-
text: 'Table of Content',
173-
link: 'toc',
179+
text: "Table of Content",
180+
link: "toc",
174181
},
175182
],
176183
},
177184
{
178-
text: 'Events',
179-
base: '/examples/',
185+
text: "Events",
186+
base: "/examples/",
180187
items: [
181188
{
182-
text: 'Loaded Event',
183-
link: '/loaded_events/loaded',
189+
text: "Loaded Event",
190+
link: "/loaded_events/loaded",
184191
},
185192
{
186-
text: 'Text Loaded Event',
187-
link: '/loaded_events/text_loaded',
193+
text: "Text Loaded Event",
194+
link: "/loaded_events/text_loaded",
188195
},
189196
{
190-
text: 'Annotation Loaded Event',
191-
link: '/loaded_events/annotation_loaded',
197+
text: "Annotation Loaded Event",
198+
link: "/loaded_events/annotation_loaded",
192199
},
193200
{
194-
text: 'XFA Loaded Event',
195-
link: '/loaded_events/xfa_loaded',
201+
text: "XFA Loaded Event",
202+
link: "/loaded_events/xfa_loaded",
196203
},
197204
{
198-
text: 'Highlight Event',
199-
link: '/text_events/text_highlight',
205+
text: "Highlight Event",
206+
link: "/text_events/text_highlight",
200207
},
201208
{
202-
text: 'Annotation Events',
203-
base: '/examples/annotation_events/',
209+
text: "Annotation Events",
210+
base: "/examples/annotation_events/",
204211
items: [
205212
{
206-
text: 'Form fields',
207-
link: 'annotation_forms',
213+
text: "Form fields",
214+
link: "annotation_forms",
208215
},
209216
{
210-
text: 'Links',
211-
link: 'annotation_links',
217+
text: "Links",
218+
link: "annotation_links",
212219
},
213220
{
214-
text: 'Attachment',
215-
link: 'annotation_attachment',
221+
text: "Attachment",
222+
link: "annotation_attachment",
216223
},
217224
],
218225
},
@@ -222,4 +229,4 @@ export default {
222229
},
223230
},
224231
},
225-
}
232+
};

docs/components/AnnoAttachment.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { VuePDF, usePDF } from '@tato30/vue-pdf';
33
import { withBase } from 'vitepress/client';
44
import { ref } from 'vue';
55
6-
const { pdf } = usePDF(withBase('/example_041.pdf'))
6+
const { pdf } = usePDF(withBase('/41.pdf'))
77
const eventValue = ref({})
88
function onAnnotation(value) {
99
console.log(value)

0 commit comments

Comments
 (0)