@wool-so/vue 0.0.0-stage → 1.1.0
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 +21 -0
- package/README.md +62 -2
- package/dist/index.d.ts +57 -0
- package/dist/index.js +30 -0
- package/package.json +41 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Wool
|
|
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
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @wool-so/vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Wool analytics for Vue and Nuxt.
|
|
4
|
+
|
|
5
|
+
Cookieless, privacy-friendly analytics for your passion projects, from [Wool](https://wool.so).
|
|
6
|
+
It counts pageviews (including client-side route changes), time on page, referrers and campaigns,
|
|
7
|
+
outbound link clicks and file downloads, sets no cookies and stores nothing in the visitor's browser.
|
|
8
|
+
|
|
9
|
+
Your **tracking key** is on your project's setup screen in the Wool dashboard.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @wool-so/vue
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
As a component, in `App.vue` or a Nuxt layout:
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<script setup>
|
|
21
|
+
import { Analytics } from '@wool-so/vue'
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<RouterView />
|
|
26
|
+
<Analytics tracking-key="YOUR_TRACKING_KEY" />
|
|
27
|
+
</template>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or as a plugin, which also gives templates `$wool.track()`:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { wool } from '@wool-so/vue'
|
|
34
|
+
|
|
35
|
+
createApp(App).use(wool({ trackingKey: 'YOUR_TRACKING_KEY' })).mount('#app')
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Custom events
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { track } from '@wool-so/vue'
|
|
42
|
+
|
|
43
|
+
track('Signup')
|
|
44
|
+
track('Signup', { props: { plan: 'pro' } })
|
|
45
|
+
track('Purchase', { revenue: 29, currency: 'USD' })
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Up to 10 properties per event, with string, number or boolean values. Calls made before the script
|
|
49
|
+
has loaded are queued and sent once it has. A `callback` always runs, once, within a second, even if
|
|
50
|
+
an ad blocker stops the script, so it's safe to navigate from it. Without any code, clicks on an element with
|
|
51
|
+
`data-wool-event` send that event, with its `data-wool-prop-*` attributes as properties:
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<button data-wool-event="Signup" data-wool-prop-plan="pro">Get started</button>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Options
|
|
58
|
+
|
|
59
|
+
Components take the same options as `inject()`, as props: `trackingKey`, `local`, `manual`, `outboundLinks`, `fileDownloads`, `src`, `api` and `disabled`. Every option, and how it works, is in [@wool-so/web](https://www.npmjs.com/package/@wool-so/web).
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type App, type PropType } from 'vue';
|
|
2
|
+
import { pageview, track, type Options } from '@wool-so/web';
|
|
3
|
+
export { track, pageview, type EventOptions, type Options } from '@wool-so/web';
|
|
4
|
+
export declare const Analytics: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
trackingKey: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
src: StringConstructor;
|
|
10
|
+
api: StringConstructor;
|
|
11
|
+
local: BooleanConstructor;
|
|
12
|
+
manual: BooleanConstructor;
|
|
13
|
+
outboundLinks: {
|
|
14
|
+
type: PropType<boolean | undefined>;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
fileDownloads: {
|
|
18
|
+
type: PropType<boolean | undefined>;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
disabled: BooleanConstructor;
|
|
22
|
+
}>, () => null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
trackingKey: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
src: StringConstructor;
|
|
28
|
+
api: StringConstructor;
|
|
29
|
+
local: BooleanConstructor;
|
|
30
|
+
manual: BooleanConstructor;
|
|
31
|
+
outboundLinks: {
|
|
32
|
+
type: PropType<boolean | undefined>;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
fileDownloads: {
|
|
36
|
+
type: PropType<boolean | undefined>;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
39
|
+
disabled: BooleanConstructor;
|
|
40
|
+
}>> & Readonly<{}>, {
|
|
41
|
+
local: boolean;
|
|
42
|
+
manual: boolean;
|
|
43
|
+
outboundLinks: boolean | undefined;
|
|
44
|
+
fileDownloads: boolean | undefined;
|
|
45
|
+
disabled: boolean;
|
|
46
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
47
|
+
declare module 'vue' {
|
|
48
|
+
interface ComponentCustomProperties {
|
|
49
|
+
$wool: {
|
|
50
|
+
track: typeof track;
|
|
51
|
+
pageview: typeof pageview;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export declare function wool(options: Options): {
|
|
56
|
+
install(app: App): void;
|
|
57
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent, onMounted } from 'vue';
|
|
2
|
+
import { inject, pageview, track } from '@wool-so/web';
|
|
3
|
+
export { track, pageview } from '@wool-so/web';
|
|
4
|
+
// <Analytics tracking-key="…" /> once, in App.vue (or a Nuxt layout). It renders nothing.
|
|
5
|
+
export const Analytics = defineComponent({
|
|
6
|
+
name: 'WoolAnalytics',
|
|
7
|
+
props: {
|
|
8
|
+
trackingKey: { type: String, required: true },
|
|
9
|
+
src: String,
|
|
10
|
+
api: String,
|
|
11
|
+
local: Boolean,
|
|
12
|
+
manual: Boolean,
|
|
13
|
+
outboundLinks: { type: Boolean, default: undefined },
|
|
14
|
+
fileDownloads: { type: Boolean, default: undefined },
|
|
15
|
+
disabled: Boolean,
|
|
16
|
+
},
|
|
17
|
+
setup(props) {
|
|
18
|
+
onMounted(() => inject({ ...props }));
|
|
19
|
+
return () => null;
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
// Or as a plugin: app.use(wool({ trackingKey: '…' })).
|
|
23
|
+
export function wool(options) {
|
|
24
|
+
return {
|
|
25
|
+
install(app) {
|
|
26
|
+
app.config.globalProperties.$wool = { track, pageview };
|
|
27
|
+
inject(options);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wool-so/vue",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Vue component and plugin for Wool, cookieless analytics for passion projects.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"analytics",
|
|
7
|
+
"privacy",
|
|
8
|
+
"cookieless",
|
|
9
|
+
"vue",
|
|
10
|
+
"nuxt",
|
|
11
|
+
"wool"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"homepage": "https://wool.so",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@wool-so/web": "^1.1.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"vue": ">=3"
|
|
42
|
+
}
|
|
43
|
+
}
|