Comparing version 0.0.1 to 0.1.0
{ | ||
"name": "vue-paint", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"private": false, | ||
@@ -11,6 +11,17 @@ "type": "module", | ||
"module": "./dist/vue-paint.js", | ||
"types": "./dist/main.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/vue-paint.js", | ||
"require": "./dist/vue-paint.umd.cjs" | ||
"import": { | ||
"types": "./dist/main.d.ts", | ||
"default": "./dist/vue-paint.js" | ||
}, | ||
"require": { | ||
"types": "./dist/main.d.ts", | ||
"default": "./dist/vue-paint.umd.cjs" | ||
} | ||
}, | ||
"./themes/*": { | ||
"import": "./dist/themes/*", | ||
"require": "./dist/themes/*" | ||
} | ||
@@ -22,3 +33,3 @@ }, | ||
"preview": "vite preview", | ||
"test:unit": "vitest", | ||
"test:unit": "vitest --typecheck", | ||
"build-only": "vite build", | ||
@@ -53,5 +64,6 @@ "build:demo": "vite build --config vite.demo-config.ts", | ||
"vite": "^5.2.8", | ||
"vite-plugin-dts": "^3.9.1", | ||
"vitest": "^1.4.0", | ||
"vue-tsc": "^2.0.11" | ||
} | ||
} | ||
} |
@@ -5,3 +5,49 @@ # vue-paint | ||
Demo: [https://github.com/robertrosman/vue-paint] | ||
## Getting started | ||
First install `vue-paint` with your favorite package manager, like this `npm i vue-paint`. Then you need to choose what tools you want to include, setup | ||
history and you're good to go. | ||
```vue | ||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import { VpEditor, useFreehand, useRectangle, downloadSvg, type ImageHistory } from 'vue-paint' | ||
// Add the tools you like to use, or call useAllTools to make use of all available tools | ||
const tools = [useFreehand(), useRectangle()] | ||
// The history can be manipulated programmatically, and used to persist the image | ||
const history = ref<ImageHistory<typeof tools>>([]) | ||
</script> | ||
<template> | ||
<vp-editor v-model:history="history" @save="downloadSvg" :tools></vp-editor> | ||
</template> | ||
``` | ||
## Key features | ||
### Tree shakable | ||
Only include the tools you need and leave the rest outside of your bundle. | ||
### Non-destructive | ||
Support for both undo and redo, even after result is exported. | ||
### Clean format | ||
The state is a simple javascript array of objects you can serialize to JSON, manipulate programmatically, store in your database or local storage. | ||
### Easily extendable | ||
Create your own tools if you want to extend the library. | ||
### Type safe | ||
Written in Typescript and fully typed. | ||
## Project Setup | ||
@@ -30,1 +76,5 @@ | ||
``` | ||
## Contribute | ||
Contributions are welcome! Fork and create a new Pull request. Try to follow the patterns in `src/composables/tools` when creating new tools. |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
78
1
3713
20
2
0
2