xenopomp-essentials 0.0.1-beta.6 → 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 +46 -1
- package/next/index.d.ts +46 -1
- package/next/index.mjs +11 -1
- package/package.json +1 -1
package/next/index.d.mts
CHANGED
|
@@ -25,4 +25,49 @@ import { FC } from 'react';
|
|
|
25
25
|
*/
|
|
26
26
|
declare const ReactScan: FC<unknown>;
|
|
27
27
|
|
|
28
|
-
|
|
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
CHANGED
|
@@ -25,4 +25,49 @@ import { FC } from 'react';
|
|
|
25
25
|
*/
|
|
26
26
|
declare const ReactScan: FC<unknown>;
|
|
27
27
|
|
|
28
|
-
|
|
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
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
import
|
|
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};
|