@jctrans-materials/nuxt 1.0.41-beta.0 → 1.0.41-beta.3
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/dist/module.cjs +5 -1
- package/dist/module.d.cts +13 -3
- package/dist/module.d.mts +13 -3
- package/dist/module.d.ts +13 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -1
- package/dist/runtime/gio.client.d.ts +1 -1
- package/dist/runtime/gio.server.d.ts +1 -27
- package/dist/runtime/middleware/auth.d.ts +1 -1
- package/dist/runtime/plugin.client.d.ts +1 -17
- package/dist/runtime/plugin.client.js +12 -4
- package/dist/runtime/plugin.d.ts +1 -5
- package/dist/types.d.mts +1 -1
- package/package.json +11 -10
package/dist/module.cjs
CHANGED
package/dist/module.d.cts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as nuxt_schema from 'nuxt/schema';
|
|
2
2
|
import { SharedConfig } from '@jctrans-materials/comps-vue3';
|
|
3
3
|
|
|
4
|
+
interface TrackingPerformanceNetwork {
|
|
5
|
+
exclude?: string | RegExp | Array<string | RegExp>;
|
|
6
|
+
}
|
|
7
|
+
interface TrackingPerformanceOptions {
|
|
8
|
+
monitor?: boolean;
|
|
9
|
+
exception?: boolean;
|
|
10
|
+
network?: TrackingPerformanceNetwork | boolean;
|
|
11
|
+
}
|
|
4
12
|
interface TrackingInitOptions {
|
|
5
13
|
debug?: boolean;
|
|
6
14
|
serverUrl?: string;
|
|
@@ -9,6 +17,8 @@ interface TrackingInitOptions {
|
|
|
9
17
|
idMapping?: boolean;
|
|
10
18
|
hashtag?: boolean;
|
|
11
19
|
autoTrackPage?: boolean;
|
|
20
|
+
performance?: TrackingPerformanceOptions;
|
|
21
|
+
[key: string]: any;
|
|
12
22
|
}
|
|
13
23
|
interface TrackingOptions {
|
|
14
24
|
enabled?: boolean;
|
|
@@ -25,7 +35,7 @@ interface ModuleOptions {
|
|
|
25
35
|
sharedConfig?: Partial<SharedConfig>;
|
|
26
36
|
tracking?: TrackingOptions;
|
|
27
37
|
}
|
|
28
|
-
declare const _default:
|
|
38
|
+
declare const _default: nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
29
39
|
|
|
30
40
|
declare module "@nuxt/schema" {
|
|
31
41
|
interface PublicRuntimeConfig {
|
|
@@ -38,4 +48,4 @@ declare module "@nuxt/schema" {
|
|
|
38
48
|
}
|
|
39
49
|
|
|
40
50
|
export = _default;
|
|
41
|
-
export type { ModuleOptions, TrackingInitOptions, TrackingOptions };
|
|
51
|
+
export type { ModuleOptions, TrackingInitOptions, TrackingOptions, TrackingPerformanceNetwork, TrackingPerformanceOptions };
|
package/dist/module.d.mts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as nuxt_schema from 'nuxt/schema';
|
|
2
2
|
import { SharedConfig } from '@jctrans-materials/comps-vue3';
|
|
3
3
|
|
|
4
|
+
interface TrackingPerformanceNetwork {
|
|
5
|
+
exclude?: string | RegExp | Array<string | RegExp>;
|
|
6
|
+
}
|
|
7
|
+
interface TrackingPerformanceOptions {
|
|
8
|
+
monitor?: boolean;
|
|
9
|
+
exception?: boolean;
|
|
10
|
+
network?: TrackingPerformanceNetwork | boolean;
|
|
11
|
+
}
|
|
4
12
|
interface TrackingInitOptions {
|
|
5
13
|
debug?: boolean;
|
|
6
14
|
serverUrl?: string;
|
|
@@ -9,6 +17,8 @@ interface TrackingInitOptions {
|
|
|
9
17
|
idMapping?: boolean;
|
|
10
18
|
hashtag?: boolean;
|
|
11
19
|
autoTrackPage?: boolean;
|
|
20
|
+
performance?: TrackingPerformanceOptions;
|
|
21
|
+
[key: string]: any;
|
|
12
22
|
}
|
|
13
23
|
interface TrackingOptions {
|
|
14
24
|
enabled?: boolean;
|
|
@@ -25,7 +35,7 @@ interface ModuleOptions {
|
|
|
25
35
|
sharedConfig?: Partial<SharedConfig>;
|
|
26
36
|
tracking?: TrackingOptions;
|
|
27
37
|
}
|
|
28
|
-
declare const _default:
|
|
38
|
+
declare const _default: nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
29
39
|
|
|
30
40
|
declare module "@nuxt/schema" {
|
|
31
41
|
interface PublicRuntimeConfig {
|
|
@@ -38,4 +48,4 @@ declare module "@nuxt/schema" {
|
|
|
38
48
|
}
|
|
39
49
|
|
|
40
50
|
export { _default as default };
|
|
41
|
-
export type { ModuleOptions, TrackingInitOptions, TrackingOptions };
|
|
51
|
+
export type { ModuleOptions, TrackingInitOptions, TrackingOptions, TrackingPerformanceNetwork, TrackingPerformanceOptions };
|
package/dist/module.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as nuxt_schema from 'nuxt/schema';
|
|
2
2
|
import { SharedConfig } from '@jctrans-materials/comps-vue3';
|
|
3
3
|
|
|
4
|
+
interface TrackingPerformanceNetwork {
|
|
5
|
+
exclude?: string | RegExp | Array<string | RegExp>;
|
|
6
|
+
}
|
|
7
|
+
interface TrackingPerformanceOptions {
|
|
8
|
+
monitor?: boolean;
|
|
9
|
+
exception?: boolean;
|
|
10
|
+
network?: TrackingPerformanceNetwork | boolean;
|
|
11
|
+
}
|
|
4
12
|
interface TrackingInitOptions {
|
|
5
13
|
debug?: boolean;
|
|
6
14
|
serverUrl?: string;
|
|
@@ -9,6 +17,8 @@ interface TrackingInitOptions {
|
|
|
9
17
|
idMapping?: boolean;
|
|
10
18
|
hashtag?: boolean;
|
|
11
19
|
autoTrackPage?: boolean;
|
|
20
|
+
performance?: TrackingPerformanceOptions;
|
|
21
|
+
[key: string]: any;
|
|
12
22
|
}
|
|
13
23
|
interface TrackingOptions {
|
|
14
24
|
enabled?: boolean;
|
|
@@ -25,7 +35,7 @@ interface ModuleOptions {
|
|
|
25
35
|
sharedConfig?: Partial<SharedConfig>;
|
|
26
36
|
tracking?: TrackingOptions;
|
|
27
37
|
}
|
|
28
|
-
declare const _default:
|
|
38
|
+
declare const _default: nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
29
39
|
|
|
30
40
|
declare module "@nuxt/schema" {
|
|
31
41
|
interface PublicRuntimeConfig {
|
|
@@ -38,4 +48,4 @@ declare module "@nuxt/schema" {
|
|
|
38
48
|
}
|
|
39
49
|
|
|
40
50
|
export = _default;
|
|
41
|
-
export type { ModuleOptions, TrackingInitOptions, TrackingOptions };
|
|
51
|
+
export type { ModuleOptions, TrackingInitOptions, TrackingOptions, TrackingPerformanceNetwork, TrackingPerformanceOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
gio: {
|
|
3
|
-
init: () => void;
|
|
4
|
-
track: () => void;
|
|
5
|
-
isInitialized: () => boolean;
|
|
6
|
-
isBrowser: () => boolean;
|
|
7
|
-
setUserId: () => void;
|
|
8
|
-
clearUserId: () => void;
|
|
9
|
-
setGeneralProps: () => void;
|
|
10
|
-
setPageAttributes: () => void;
|
|
11
|
-
sendPage: () => void;
|
|
12
|
-
};
|
|
13
|
-
trackEvent: () => void;
|
|
14
|
-
}> & import("#app").ObjectPlugin<{
|
|
15
|
-
gio: {
|
|
16
|
-
init: () => void;
|
|
17
|
-
track: () => void;
|
|
18
|
-
isInitialized: () => boolean;
|
|
19
|
-
isBrowser: () => boolean;
|
|
20
|
-
setUserId: () => void;
|
|
21
|
-
clearUserId: () => void;
|
|
22
|
-
setGeneralProps: () => void;
|
|
23
|
-
setPageAttributes: () => void;
|
|
24
|
-
sendPage: () => void;
|
|
25
|
-
};
|
|
26
|
-
trackEvent: () => void;
|
|
27
|
-
}>;
|
|
1
|
+
declare const _default: any;
|
|
28
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: any;
|
|
2
2
|
export default _default;
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type GioPublicApi = {
|
|
3
|
-
isInitialized: () => boolean;
|
|
4
|
-
isBrowser: () => boolean;
|
|
5
|
-
init: (...args: any[]) => void;
|
|
6
|
-
track: (eventName: string, attrs?: TrackAttrs, callback?: () => void) => void;
|
|
7
|
-
setGeneralProps: (props: Record<string, any>) => void;
|
|
8
|
-
setPageAttributes: (props: Record<string, any>) => void;
|
|
9
|
-
sendPage: () => void;
|
|
10
|
-
};
|
|
11
|
-
declare const _default: import("#app").Plugin<{
|
|
12
|
-
gio: GioPublicApi;
|
|
13
|
-
trackEvent: (eventName: string, attrs?: TrackAttrs) => void;
|
|
14
|
-
}> & import("#app").ObjectPlugin<{
|
|
15
|
-
gio: GioPublicApi;
|
|
16
|
-
trackEvent: (eventName: string, attrs?: TrackAttrs) => void;
|
|
17
|
-
}>;
|
|
1
|
+
declare const _default: any;
|
|
18
2
|
export default _default;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { callOnce, defineNuxtPlugin, useRuntimeConfig, useRouter } from "#app";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getOrCreateClientId,
|
|
4
|
+
normalizeClickPageAttrs,
|
|
5
|
+
tracker
|
|
6
|
+
} from "@jctrans-materials/shared";
|
|
3
7
|
import { nextTick } from "vue";
|
|
4
8
|
const pickString = (...values) => {
|
|
5
9
|
for (const value of values) {
|
|
@@ -91,11 +95,15 @@ const bindTrackHandler = (element, binding, gio) => {
|
|
|
91
95
|
if (normalized.stop && "stopPropagation" in event) {
|
|
92
96
|
event.stopPropagation();
|
|
93
97
|
}
|
|
94
|
-
|
|
98
|
+
const normalizedAttrs = normalizeClickPageAttrs(
|
|
99
|
+
normalized.eventName,
|
|
100
|
+
normalized.attrs
|
|
101
|
+
);
|
|
102
|
+
gio.track(normalized.eventName, normalizedAttrs, () => {
|
|
95
103
|
normalized.callback?.({
|
|
96
104
|
event,
|
|
97
105
|
eventName: normalized.eventName,
|
|
98
|
-
attrs:
|
|
106
|
+
attrs: normalizedAttrs,
|
|
99
107
|
trigger: normalized.trigger
|
|
100
108
|
});
|
|
101
109
|
});
|
|
@@ -201,7 +209,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
201
209
|
const trackEvent = (eventName, attrs) => {
|
|
202
210
|
const normalizedEvent = pickString(eventName);
|
|
203
211
|
if (!normalizedEvent) return;
|
|
204
|
-
gio.track(normalizedEvent, attrs
|
|
212
|
+
gio.track(normalizedEvent, normalizeClickPageAttrs(normalizedEvent, attrs));
|
|
205
213
|
};
|
|
206
214
|
const directiveName = normalizeDirectiveName(
|
|
207
215
|
globalTracking.directiveName || runtimeTracking.directiveName
|
package/dist/runtime/plugin.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
initAuthSharedConfig: (newConfig: Partial<import("@jctrans-materials/shared").SharedConfig>) => void;
|
|
3
|
-
}> & import("#app").ObjectPlugin<{
|
|
4
|
-
initAuthSharedConfig: (newConfig: Partial<import("@jctrans-materials/shared").SharedConfig>) => void;
|
|
5
|
-
}>;
|
|
1
|
+
declare const _default: any;
|
|
6
2
|
export default _default;
|
package/dist/types.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default } from './module.mjs'
|
|
2
2
|
|
|
3
|
-
export { type ModuleOptions, type TrackingInitOptions, type TrackingOptions } from './module.mjs'
|
|
3
|
+
export { type ModuleOptions, type TrackingInitOptions, type TrackingOptions, type TrackingPerformanceNetwork, type TrackingPerformanceOptions } from './module.mjs'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jctrans-materials/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.41-beta.
|
|
4
|
+
"version": "1.0.41-beta.3",
|
|
5
5
|
"description": "Nuxt module for JCtrans UI components",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -17,27 +17,28 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
+
"@nuxt/kit": "^3.0.0",
|
|
20
21
|
"defu": "6.1.2",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
22
|
+
"nuxt": "^3.0.0",
|
|
23
|
+
"vue": "^3.5.26",
|
|
24
|
+
"vue-router": "^4.6.4",
|
|
25
|
+
"@jctrans-materials/comps-vue3": "1.0.41-beta.3",
|
|
26
|
+
"@jctrans-materials/shared": "1.0.41-beta.3"
|
|
23
27
|
},
|
|
24
28
|
"peerDependencies": {
|
|
25
29
|
"gio-webjs-sdk": "^4.0.0",
|
|
26
|
-
"nuxt": "
|
|
27
|
-
"
|
|
28
|
-
"@jctrans-materials/
|
|
29
|
-
"@jctrans-materials/shared": "1.0.41-beta.0"
|
|
30
|
+
"nuxt": "^3.0.0",
|
|
31
|
+
"@jctrans-materials/comps-vue3": "1.0.41-beta.3",
|
|
32
|
+
"@jctrans-materials/shared": "1.0.41-beta.3"
|
|
30
33
|
},
|
|
31
34
|
"devDependencies": {
|
|
32
35
|
"@nuxt/module-builder": "latest",
|
|
33
|
-
"nuxt": "3.20.2",
|
|
34
36
|
"unbuild": "^3.6.1"
|
|
35
37
|
},
|
|
36
38
|
"scripts": {
|
|
37
39
|
"build": "nuxt-module-build",
|
|
38
40
|
"dev": "nuxt dev",
|
|
39
41
|
"generate": "nuxt generate",
|
|
40
|
-
"preview": "nuxt preview"
|
|
41
|
-
"postinstall": "nuxt prepare"
|
|
42
|
+
"preview": "nuxt preview"
|
|
42
43
|
}
|
|
43
44
|
}
|