xenopomp-essentials 0.0.1-beta.5 → 0.0.1-beta.7
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/next/index.d.mts +73 -0
- package/next/index.d.ts +73 -0
- package/next/index.mjs +11 -0
- package/package.json +3 -6
- package/dist/next.d.mts +0 -28
- package/dist/next.d.ts +0 -28
- package/dist/next.mjs +0 -1
- /package/{dist/index.d.mts → index.d.mts} +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.mjs → index.mjs} +0 -0
package/next/index.d.mts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Adds react-scan to your Next.js application.
|
|
5
|
+
* @constructor
|
|
6
|
+
* @since 0.0.1
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { ReactScan } from 'xenopomp-essentials/next';
|
|
10
|
+
*
|
|
11
|
+
* export default function RootLayout({
|
|
12
|
+
* children,
|
|
13
|
+
* }: {
|
|
14
|
+
* children: React.ReactNode
|
|
15
|
+
* }) {
|
|
16
|
+
* return (
|
|
17
|
+
* <html lang="en">
|
|
18
|
+
* <head>
|
|
19
|
+
* <ReactScan />
|
|
20
|
+
* </head>
|
|
21
|
+
* <body>{children}</body>
|
|
22
|
+
* </html>
|
|
23
|
+
* )
|
|
24
|
+
*}
|
|
25
|
+
*/
|
|
26
|
+
declare const ReactScan: FC<unknown>;
|
|
27
|
+
|
|
28
|
+
interface MetrikaProps {
|
|
29
|
+
/**
|
|
30
|
+
* ID of your Yandex.Metrika`s counter.
|
|
31
|
+
* Locate at dashboard.
|
|
32
|
+
*/
|
|
33
|
+
id: number;
|
|
34
|
+
clickMap?: boolean;
|
|
35
|
+
trackLinks?: boolean;
|
|
36
|
+
accurateTrackBounce?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This component allows you to use Yandex.Metrika
|
|
41
|
+
* in your Next.js projects.
|
|
42
|
+
*
|
|
43
|
+
* @param id
|
|
44
|
+
* @param clickMap
|
|
45
|
+
* @param trackLinks
|
|
46
|
+
* @param accurateTrackBounce
|
|
47
|
+
* @constructor
|
|
48
|
+
*
|
|
49
|
+
* @since 0.0.1
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* import { Metrika } from 'xenopomp-essentials/next';
|
|
53
|
+
*
|
|
54
|
+
* export default function RootLayout({
|
|
55
|
+
* children,
|
|
56
|
+
* }: {
|
|
57
|
+
* children: React.ReactNode
|
|
58
|
+
* }) {
|
|
59
|
+
* return (
|
|
60
|
+
* <html lang="en">
|
|
61
|
+
* <head>
|
|
62
|
+
* <Metrika id={123456789} />
|
|
63
|
+
* </head>
|
|
64
|
+
* <body>{children}</body>
|
|
65
|
+
* </html>
|
|
66
|
+
* )
|
|
67
|
+
* }
|
|
68
|
+
*
|
|
69
|
+
* @see https://metrika.yandex.ru
|
|
70
|
+
*/
|
|
71
|
+
declare const Metrika: FC<MetrikaProps>;
|
|
72
|
+
|
|
73
|
+
export { Metrika, ReactScan };
|
package/next/index.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Adds react-scan to your Next.js application.
|
|
5
|
+
* @constructor
|
|
6
|
+
* @since 0.0.1
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { ReactScan } from 'xenopomp-essentials/next';
|
|
10
|
+
*
|
|
11
|
+
* export default function RootLayout({
|
|
12
|
+
* children,
|
|
13
|
+
* }: {
|
|
14
|
+
* children: React.ReactNode
|
|
15
|
+
* }) {
|
|
16
|
+
* return (
|
|
17
|
+
* <html lang="en">
|
|
18
|
+
* <head>
|
|
19
|
+
* <ReactScan />
|
|
20
|
+
* </head>
|
|
21
|
+
* <body>{children}</body>
|
|
22
|
+
* </html>
|
|
23
|
+
* )
|
|
24
|
+
*}
|
|
25
|
+
*/
|
|
26
|
+
declare const ReactScan: FC<unknown>;
|
|
27
|
+
|
|
28
|
+
interface MetrikaProps {
|
|
29
|
+
/**
|
|
30
|
+
* ID of your Yandex.Metrika`s counter.
|
|
31
|
+
* Locate at dashboard.
|
|
32
|
+
*/
|
|
33
|
+
id: number;
|
|
34
|
+
clickMap?: boolean;
|
|
35
|
+
trackLinks?: boolean;
|
|
36
|
+
accurateTrackBounce?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This component allows you to use Yandex.Metrika
|
|
41
|
+
* in your Next.js projects.
|
|
42
|
+
*
|
|
43
|
+
* @param id
|
|
44
|
+
* @param clickMap
|
|
45
|
+
* @param trackLinks
|
|
46
|
+
* @param accurateTrackBounce
|
|
47
|
+
* @constructor
|
|
48
|
+
*
|
|
49
|
+
* @since 0.0.1
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* import { Metrika } from 'xenopomp-essentials/next';
|
|
53
|
+
*
|
|
54
|
+
* export default function RootLayout({
|
|
55
|
+
* children,
|
|
56
|
+
* }: {
|
|
57
|
+
* children: React.ReactNode
|
|
58
|
+
* }) {
|
|
59
|
+
* return (
|
|
60
|
+
* <html lang="en">
|
|
61
|
+
* <head>
|
|
62
|
+
* <Metrika id={123456789} />
|
|
63
|
+
* </head>
|
|
64
|
+
* <body>{children}</body>
|
|
65
|
+
* </html>
|
|
66
|
+
* )
|
|
67
|
+
* }
|
|
68
|
+
*
|
|
69
|
+
* @see https://metrika.yandex.ru
|
|
70
|
+
*/
|
|
71
|
+
declare const Metrika: FC<MetrikaProps>;
|
|
72
|
+
|
|
73
|
+
export { Metrika, ReactScan };
|
package/next/index.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import r from"next/script";const n=()=>React.createElement("script",{src:"https://unpkg.com/react-scan/dist/auto.global.js",async:!0}),i=({id:t,clickMap:e=!0,trackLinks:a=!0,accurateTrackBounce:c=!0})=>React.createElement(r,{id:"metrika-counter",strategy:"afterInteractive"},` (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
|
2
|
+
m[i].l=1*new Date();
|
|
3
|
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
|
4
|
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
|
|
5
|
+
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
|
|
6
|
+
|
|
7
|
+
ym(${t}, "init", {
|
|
8
|
+
clickmap:${e},
|
|
9
|
+
trackLinks:${a},
|
|
10
|
+
accurateTrackBounce:${c}
|
|
11
|
+
});`);export{i as Metrika,n as ReactScan};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xenopomp-essentials",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.7",
|
|
4
4
|
"author": "XenoPOMP <101574433+XenoPOMP@users.noreply.github.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -23,11 +23,8 @@
|
|
|
23
23
|
"coverage": "vitest run --coverage -c ./.config/vitest.config.ts",
|
|
24
24
|
"prepare": "husky"
|
|
25
25
|
},
|
|
26
|
-
"main": "./
|
|
27
|
-
"types": "./
|
|
28
|
-
"files": [
|
|
29
|
-
"dist"
|
|
30
|
-
],
|
|
26
|
+
"main": "./index.mjs",
|
|
27
|
+
"types": "./index.d.ts",
|
|
31
28
|
"peerDependencies": {
|
|
32
29
|
"@types/react": ">=19",
|
|
33
30
|
"next": ">=15",
|
package/dist/next.d.mts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Adds react-scan to your Next.js application.
|
|
5
|
-
* @constructor
|
|
6
|
-
* @since 0.0.1
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* import { ReactScan } from 'xenopomp-essentials/next';
|
|
10
|
-
*
|
|
11
|
-
* export default function RootLayout({
|
|
12
|
-
* children,
|
|
13
|
-
* }: {
|
|
14
|
-
* children: React.ReactNode
|
|
15
|
-
* }) {
|
|
16
|
-
* return (
|
|
17
|
-
* <html lang="en">
|
|
18
|
-
* <head>
|
|
19
|
-
* <ReactScan />
|
|
20
|
-
* </head>
|
|
21
|
-
* <body>{children}</body>
|
|
22
|
-
* </html>
|
|
23
|
-
* )
|
|
24
|
-
*}
|
|
25
|
-
*/
|
|
26
|
-
declare const ReactScan: FC<unknown>;
|
|
27
|
-
|
|
28
|
-
export { ReactScan };
|
package/dist/next.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Adds react-scan to your Next.js application.
|
|
5
|
-
* @constructor
|
|
6
|
-
* @since 0.0.1
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* import { ReactScan } from 'xenopomp-essentials/next';
|
|
10
|
-
*
|
|
11
|
-
* export default function RootLayout({
|
|
12
|
-
* children,
|
|
13
|
-
* }: {
|
|
14
|
-
* children: React.ReactNode
|
|
15
|
-
* }) {
|
|
16
|
-
* return (
|
|
17
|
-
* <html lang="en">
|
|
18
|
-
* <head>
|
|
19
|
-
* <ReactScan />
|
|
20
|
-
* </head>
|
|
21
|
-
* <body>{children}</body>
|
|
22
|
-
* </html>
|
|
23
|
-
* )
|
|
24
|
-
*}
|
|
25
|
-
*/
|
|
26
|
-
declare const ReactScan: FC<unknown>;
|
|
27
|
-
|
|
28
|
-
export { ReactScan };
|
package/dist/next.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"react";const c=()=>t.createElement("script",{src:"https://unpkg.com/react-scan/dist/auto.global.js",async:!0});export{c as ReactScan};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|