kviewer 0.1.1 → 0.1.2
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/README.md +12 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -2
- package/dist/runtime/style.css +1 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -34,12 +34,24 @@ Add it to your `nuxt.config.ts`:
|
|
|
34
34
|
```ts
|
|
35
35
|
export default defineNuxtConfig({
|
|
36
36
|
modules: ['kviewer'],
|
|
37
|
+
css: ['~/assets/css/main.css'],
|
|
37
38
|
kviewer: {
|
|
38
39
|
prefix: 'K', // component prefix (default)
|
|
39
40
|
},
|
|
40
41
|
})
|
|
41
42
|
```
|
|
42
43
|
|
|
44
|
+
KViewer's UI is built on [Nuxt UI](https://ui.nuxt.com) + Tailwind CSS. Create the main stylesheet with three imports:
|
|
45
|
+
|
|
46
|
+
```css
|
|
47
|
+
/* assets/css/main.css */
|
|
48
|
+
@import 'tailwindcss';
|
|
49
|
+
@import '@nuxt/ui';
|
|
50
|
+
@import 'kviewer';
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`@nuxt/ui` is installed and registered automatically — you don't add it to `modules`, and there's no `@source` path to maintain. The `@import 'kviewer'` line registers KViewer's components as a Tailwind source.
|
|
54
|
+
|
|
43
55
|
## Basic Usage
|
|
44
56
|
|
|
45
57
|
```vue
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
|
-
import { defineNuxtModule, createResolver, addPlugin, addComponentsDir, addImports } from '@nuxt/kit';
|
|
3
|
+
import { defineNuxtModule, createResolver, hasNuxtModule, installModule, addPlugin, addComponentsDir, addImports } from '@nuxt/kit';
|
|
4
4
|
export { KVIEWER_EMBED_PROTOCOL_VERSION, KViewerEmbedClient, useKViewerEmbedBridge } from '../dist/runtime/public-types.js';
|
|
5
5
|
|
|
6
6
|
const module$1 = defineNuxtModule({
|
|
@@ -13,8 +13,11 @@ const module$1 = defineNuxtModule({
|
|
|
13
13
|
prefix: "K",
|
|
14
14
|
minRenderPixelRatio: 2
|
|
15
15
|
},
|
|
16
|
-
setup(options, nuxt) {
|
|
16
|
+
async setup(options, nuxt) {
|
|
17
17
|
const { resolve } = createResolver(import.meta.url);
|
|
18
|
+
if (!hasNuxtModule("@nuxt/ui")) {
|
|
19
|
+
await installModule("@nuxt/ui");
|
|
20
|
+
}
|
|
18
21
|
nuxt.options.runtimeConfig.public.kviewer = {
|
|
19
22
|
...nuxt.options.runtimeConfig.public.kviewer,
|
|
20
23
|
minRenderPixelRatio: options.minRenderPixelRatio ?? 2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@source "./components/**/*.vue";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kviewer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Kabema PDF Editor",
|
|
5
5
|
"repository": "kabema/kviewer",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/types.d.mts",
|
|
11
|
+
"style": "./dist/runtime/style.css",
|
|
11
12
|
"import": "./dist/module.mjs"
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
"main": "./dist/module.mjs",
|
|
16
|
+
"style": "./dist/runtime/style.css",
|
|
15
17
|
"typesVersions": {
|
|
16
18
|
"*": {
|
|
17
19
|
".": [
|
|
@@ -40,21 +42,21 @@
|
|
|
40
42
|
"test:e2e:ui": "playwright test --ui"
|
|
41
43
|
},
|
|
42
44
|
"dependencies": {
|
|
45
|
+
"@iconify-json/lucide": "^1.2.101",
|
|
43
46
|
"@nuxt/kit": "^4.4.2",
|
|
47
|
+
"@nuxt/ui": "^4.6.0",
|
|
44
48
|
"konva": "^10.2.3",
|
|
45
49
|
"pdf-lib": "^1.17.1",
|
|
46
50
|
"pdfjs-dist": "^5.6.205",
|
|
47
51
|
"tailwindcss": "^4.2.2"
|
|
48
52
|
},
|
|
49
53
|
"devDependencies": {
|
|
50
|
-
"@iconify-json/lucide": "^1.2.101",
|
|
51
54
|
"@nuxt/devtools": "^3.2.4",
|
|
52
55
|
"@nuxt/eslint": "1.15.2",
|
|
53
56
|
"@nuxt/eslint-config": "^1.15.2",
|
|
54
57
|
"@nuxt/module-builder": "^1.0.2",
|
|
55
58
|
"@nuxt/schema": "^4.4.2",
|
|
56
59
|
"@nuxt/test-utils": "^4.0.0",
|
|
57
|
-
"@nuxt/ui": "4.6.0",
|
|
58
60
|
"@playwright/test": "^1.59.1",
|
|
59
61
|
"@types/node": "latest",
|
|
60
62
|
"canvas": "^3.2.3",
|