@elementor/mixpanel 3.33.0-126
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/index.d.mts +25 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +21 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +45 -0
- package/src/index.ts +1 -0
- package/src/use-mixpanel.ts +17 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const useMixpanel: () => {
|
|
2
|
+
dispatchEvent: ((name: string, data: unknown) => void) | undefined;
|
|
3
|
+
config: {
|
|
4
|
+
locations?: Record<string, string>;
|
|
5
|
+
secondaryLocations?: Record<string, string>;
|
|
6
|
+
names?: Record<string, Record<string, string>>;
|
|
7
|
+
triggers?: Record<string, string>;
|
|
8
|
+
elements?: Record<string, string>;
|
|
9
|
+
} | undefined;
|
|
10
|
+
};
|
|
11
|
+
declare const trackEvent: <T extends {
|
|
12
|
+
eventName: string;
|
|
13
|
+
} & Record<string, unknown>>(event: T) => void;
|
|
14
|
+
declare const getMixpanel: () => {
|
|
15
|
+
dispatchEvent?: (name: string, data: unknown) => void;
|
|
16
|
+
config?: {
|
|
17
|
+
locations?: Record<string, string>;
|
|
18
|
+
secondaryLocations?: Record<string, string>;
|
|
19
|
+
names?: Record<string, Record<string, string>>;
|
|
20
|
+
triggers?: Record<string, string>;
|
|
21
|
+
elements?: Record<string, string>;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { getMixpanel, trackEvent, useMixpanel };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const useMixpanel: () => {
|
|
2
|
+
dispatchEvent: ((name: string, data: unknown) => void) | undefined;
|
|
3
|
+
config: {
|
|
4
|
+
locations?: Record<string, string>;
|
|
5
|
+
secondaryLocations?: Record<string, string>;
|
|
6
|
+
names?: Record<string, Record<string, string>>;
|
|
7
|
+
triggers?: Record<string, string>;
|
|
8
|
+
elements?: Record<string, string>;
|
|
9
|
+
} | undefined;
|
|
10
|
+
};
|
|
11
|
+
declare const trackEvent: <T extends {
|
|
12
|
+
eventName: string;
|
|
13
|
+
} & Record<string, unknown>>(event: T) => void;
|
|
14
|
+
declare const getMixpanel: () => {
|
|
15
|
+
dispatchEvent?: (name: string, data: unknown) => void;
|
|
16
|
+
config?: {
|
|
17
|
+
locations?: Record<string, string>;
|
|
18
|
+
secondaryLocations?: Record<string, string>;
|
|
19
|
+
names?: Record<string, Record<string, string>>;
|
|
20
|
+
triggers?: Record<string, string>;
|
|
21
|
+
elements?: Record<string, string>;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { getMixpanel, trackEvent, useMixpanel };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
getMixpanel: () => getMixpanel,
|
|
24
|
+
trackEvent: () => trackEvent,
|
|
25
|
+
useMixpanel: () => useMixpanel
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
|
|
29
|
+
// src/use-mixpanel.ts
|
|
30
|
+
var useMixpanel = () => {
|
|
31
|
+
const { dispatchEvent, config } = getMixpanel();
|
|
32
|
+
return {
|
|
33
|
+
dispatchEvent,
|
|
34
|
+
config
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
var trackEvent = (event) => {
|
|
38
|
+
const { dispatchEvent } = getMixpanel();
|
|
39
|
+
dispatchEvent?.(event.eventName, event);
|
|
40
|
+
};
|
|
41
|
+
var getMixpanel = () => {
|
|
42
|
+
return window.elementorCommon?.eventsManager || {};
|
|
43
|
+
};
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
getMixpanel,
|
|
47
|
+
trackEvent,
|
|
48
|
+
useMixpanel
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/use-mixpanel.ts"],"sourcesContent":["export * from './use-mixpanel';\n","export const useMixpanel = () => {\n\tconst { dispatchEvent, config } = getMixpanel();\n\n\treturn {\n\t\tdispatchEvent,\n\t\tconfig,\n\t};\n};\n\nexport const trackEvent = < T extends { eventName: string } & Record< string, unknown > >( event: T ) => {\n\tconst { dispatchEvent } = getMixpanel();\n\tdispatchEvent?.( event.eventName, event );\n};\n\nexport const getMixpanel = () => {\n\treturn window.elementorCommon?.eventsManager || {};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,cAAc,MAAM;AAChC,QAAM,EAAE,eAAe,OAAO,IAAI,YAAY;AAE9C,SAAO;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEO,IAAM,aAAa,CAAiE,UAAc;AACxG,QAAM,EAAE,cAAc,IAAI,YAAY;AACtC,kBAAiB,MAAM,WAAW,KAAM;AACzC;AAEO,IAAM,cAAc,MAAM;AAChC,SAAO,OAAO,iBAAiB,iBAAiB,CAAC;AAClD;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/use-mixpanel.ts
|
|
2
|
+
var useMixpanel = () => {
|
|
3
|
+
const { dispatchEvent, config } = getMixpanel();
|
|
4
|
+
return {
|
|
5
|
+
dispatchEvent,
|
|
6
|
+
config
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
var trackEvent = (event) => {
|
|
10
|
+
const { dispatchEvent } = getMixpanel();
|
|
11
|
+
dispatchEvent?.(event.eventName, event);
|
|
12
|
+
};
|
|
13
|
+
var getMixpanel = () => {
|
|
14
|
+
return window.elementorCommon?.eventsManager || {};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
getMixpanel,
|
|
18
|
+
trackEvent,
|
|
19
|
+
useMixpanel
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/use-mixpanel.ts"],"sourcesContent":["export const useMixpanel = () => {\n\tconst { dispatchEvent, config } = getMixpanel();\n\n\treturn {\n\t\tdispatchEvent,\n\t\tconfig,\n\t};\n};\n\nexport const trackEvent = < T extends { eventName: string } & Record< string, unknown > >( event: T ) => {\n\tconst { dispatchEvent } = getMixpanel();\n\tdispatchEvent?.( event.eventName, event );\n};\n\nexport const getMixpanel = () => {\n\treturn window.elementorCommon?.eventsManager || {};\n};\n"],"mappings":";AAAO,IAAM,cAAc,MAAM;AAChC,QAAM,EAAE,eAAe,OAAO,IAAI,YAAY;AAE9C,SAAO;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEO,IAAM,aAAa,CAAiE,UAAc;AACxG,QAAM,EAAE,cAAc,IAAI,YAAY;AACtC,kBAAiB,MAAM,WAAW,KAAM;AACzC;AAEO,IAAM,cAAc,MAAM;AAChC,SAAO,OAAO,iBAAiB,iBAAiB,CAAC;AAClD;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elementor/mixpanel",
|
|
3
|
+
"description": "Elementor Mixpanel package",
|
|
4
|
+
"version": "3.33.0-126",
|
|
5
|
+
"private": false,
|
|
6
|
+
"author": "Elementor Team",
|
|
7
|
+
"homepage": "https://elementor.com/",
|
|
8
|
+
"license": "GPL-3.0-or-later",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "dist/index.mjs",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/elementor/elementor.git",
|
|
23
|
+
"directory": "packages/libs/mixpanel"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/elementor/elementor/issues"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"README.md",
|
|
33
|
+
"CHANGELOG.md",
|
|
34
|
+
"/dist",
|
|
35
|
+
"/src",
|
|
36
|
+
"!**/__tests__"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsup --config=../../tsup.build.ts",
|
|
40
|
+
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"tsup": "^8.3.5"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-mixpanel';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const useMixpanel = () => {
|
|
2
|
+
const { dispatchEvent, config } = getMixpanel();
|
|
3
|
+
|
|
4
|
+
return {
|
|
5
|
+
dispatchEvent,
|
|
6
|
+
config,
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const trackEvent = < T extends { eventName: string } & Record< string, unknown > >( event: T ) => {
|
|
11
|
+
const { dispatchEvent } = getMixpanel();
|
|
12
|
+
dispatchEvent?.( event.eventName, event );
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const getMixpanel = () => {
|
|
16
|
+
return window.elementorCommon?.eventsManager || {};
|
|
17
|
+
};
|