@vllnt/analytics 0.1.1-canary.704c02f → 0.1.1-canary.c0d1582
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 +13 -13
- package/src/analytics.ts +6 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vllnt/analytics",
|
|
3
|
-
"version": "0.1.1-canary.
|
|
3
|
+
"version": "0.1.1-canary.c0d1582",
|
|
4
4
|
"description": "Lightweight, privacy-first analytics with consent management and React integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,18 +42,18 @@
|
|
|
42
42
|
"react": "^18.0.0 || ^19.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"eslint": "^9.39.
|
|
46
|
-
"@testing-library/jest-dom": "^
|
|
47
|
-
"@testing-library/react": "^16.3.
|
|
48
|
-
"@types/node": "^
|
|
49
|
-
"@types/react": "^19.
|
|
50
|
-
"@vitest/coverage-v8": "^
|
|
51
|
-
"@vllnt/eslint-config": "^
|
|
52
|
-
"@vllnt/typescript": "^
|
|
53
|
-
"jsdom": "^
|
|
54
|
-
"react": "^19.
|
|
55
|
-
"typescript": "^
|
|
56
|
-
"vitest": "^
|
|
45
|
+
"eslint": "^9.39.5",
|
|
46
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
47
|
+
"@testing-library/react": "^16.3.3",
|
|
48
|
+
"@types/node": "^24.19.2",
|
|
49
|
+
"@types/react": "^19.3.0",
|
|
50
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
51
|
+
"@vllnt/eslint-config": "^2.0.0",
|
|
52
|
+
"@vllnt/typescript": "^2.0.0",
|
|
53
|
+
"jsdom": "^30.1.3",
|
|
54
|
+
"react": "^19.3.1",
|
|
55
|
+
"typescript": "^6.0.3",
|
|
56
|
+
"vitest": "^5.0.5"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"clean": "rm -rf node_modules",
|
package/src/analytics.ts
CHANGED
|
@@ -238,20 +238,14 @@ export function getAnalyticsState(): AnalyticsState | undefined {
|
|
|
238
238
|
export function trackTutorialStart(
|
|
239
239
|
properties: Omit<TutorialEventProperties, "section_id">,
|
|
240
240
|
): void {
|
|
241
|
-
track(
|
|
242
|
-
"tutorial_start" satisfies TutorialEventName,
|
|
243
|
-
properties as Record<string, unknown>,
|
|
244
|
-
);
|
|
241
|
+
track("tutorial_start" satisfies TutorialEventName, properties);
|
|
245
242
|
}
|
|
246
243
|
|
|
247
244
|
/**
|
|
248
245
|
* Track section view
|
|
249
246
|
*/
|
|
250
247
|
export function trackSectionView(properties: TutorialEventProperties): void {
|
|
251
|
-
track(
|
|
252
|
-
"tutorial_section_view" satisfies TutorialEventName,
|
|
253
|
-
properties as Record<string, unknown>,
|
|
254
|
-
);
|
|
248
|
+
track("tutorial_section_view" satisfies TutorialEventName, properties);
|
|
255
249
|
}
|
|
256
250
|
|
|
257
251
|
/**
|
|
@@ -260,10 +254,7 @@ export function trackSectionView(properties: TutorialEventProperties): void {
|
|
|
260
254
|
export function trackSectionComplete(
|
|
261
255
|
properties: TutorialEventProperties,
|
|
262
256
|
): void {
|
|
263
|
-
track(
|
|
264
|
-
"tutorial_section_complete" satisfies TutorialEventName,
|
|
265
|
-
properties as Record<string, unknown>,
|
|
266
|
-
);
|
|
257
|
+
track("tutorial_section_complete" satisfies TutorialEventName, properties);
|
|
267
258
|
}
|
|
268
259
|
|
|
269
260
|
/**
|
|
@@ -272,10 +263,7 @@ export function trackSectionComplete(
|
|
|
272
263
|
export function trackTutorialComplete(
|
|
273
264
|
properties: Omit<TutorialEventProperties, "section_id">,
|
|
274
265
|
): void {
|
|
275
|
-
track(
|
|
276
|
-
"tutorial_complete" satisfies TutorialEventName,
|
|
277
|
-
properties as Record<string, unknown>,
|
|
278
|
-
);
|
|
266
|
+
track("tutorial_complete" satisfies TutorialEventName, properties);
|
|
279
267
|
}
|
|
280
268
|
|
|
281
269
|
/**
|
|
@@ -286,10 +274,7 @@ export function trackTutorialNavigation(
|
|
|
286
274
|
navigation_type: "keyboard" | "next" | "prev" | "toc";
|
|
287
275
|
},
|
|
288
276
|
): void {
|
|
289
|
-
track(
|
|
290
|
-
"tutorial_navigation" satisfies TutorialEventName,
|
|
291
|
-
properties as Record<string, unknown>,
|
|
292
|
-
);
|
|
277
|
+
track("tutorial_navigation" satisfies TutorialEventName, properties);
|
|
293
278
|
}
|
|
294
279
|
|
|
295
280
|
/**
|
|
@@ -298,8 +283,5 @@ export function trackTutorialNavigation(
|
|
|
298
283
|
export function trackTimeSpent(
|
|
299
284
|
properties: TutorialEventProperties & { time_spent_seconds: number },
|
|
300
285
|
): void {
|
|
301
|
-
track(
|
|
302
|
-
"tutorial_time_spent" satisfies TutorialEventName,
|
|
303
|
-
properties as Record<string, unknown>,
|
|
304
|
-
);
|
|
286
|
+
track("tutorial_time_spent" satisfies TutorialEventName, properties);
|
|
305
287
|
}
|