eddev 0.2.16 → 0.2.19
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.
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const EDConfigSchema: z.ZodObject<{
|
|
3
3
|
$schema: z.ZodOptional<z.ZodString>;
|
|
4
|
+
tracking: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
tagManagerID: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
tagManagerID?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
tagManagerID?: string | undefined;
|
|
10
|
+
}>>;
|
|
4
11
|
serverless: z.ZodOptional<z.ZodObject<{
|
|
5
12
|
enabled: z.ZodBoolean;
|
|
6
13
|
uploads: z.ZodEnum<["proxy", "remote"]>;
|
|
@@ -45,6 +52,9 @@ export declare const EDConfigSchema: z.ZodObject<{
|
|
|
45
52
|
devUI: z.ZodEnum<["disabled", "enabled"]>;
|
|
46
53
|
}, "strip", z.ZodTypeAny, {
|
|
47
54
|
$schema?: string | undefined;
|
|
55
|
+
tracking?: {
|
|
56
|
+
tagManagerID?: string | undefined;
|
|
57
|
+
} | undefined;
|
|
48
58
|
serverless?: {
|
|
49
59
|
themeAssets?: string[] | undefined;
|
|
50
60
|
apiOnly?: boolean | undefined;
|
|
@@ -63,6 +73,9 @@ export declare const EDConfigSchema: z.ZodObject<{
|
|
|
63
73
|
devUI: "disabled" | "enabled";
|
|
64
74
|
}, {
|
|
65
75
|
$schema?: string | undefined;
|
|
76
|
+
tracking?: {
|
|
77
|
+
tagManagerID?: string | undefined;
|
|
78
|
+
} | undefined;
|
|
66
79
|
serverless?: {
|
|
67
80
|
themeAssets?: string[] | undefined;
|
|
68
81
|
apiOnly?: boolean | undefined;
|
package/config/config-schema.js
CHANGED
|
@@ -4,6 +4,11 @@ exports.EDConfigSchema = void 0;
|
|
|
4
4
|
var zod_1 = require("zod");
|
|
5
5
|
exports.EDConfigSchema = zod_1.z.object({
|
|
6
6
|
$schema: zod_1.z.string().optional(),
|
|
7
|
+
tracking: zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
tagManagerID: zod_1.z.string().optional(),
|
|
10
|
+
})
|
|
11
|
+
.optional(),
|
|
7
12
|
serverless: zod_1.z
|
|
8
13
|
.object({
|
|
9
14
|
enabled: zod_1.z.boolean(),
|
package/config/get-config.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare function getEDConfig(dir?: string): import("zod").SafeParseReturnType<{
|
|
2
2
|
$schema?: string | undefined;
|
|
3
|
+
tracking?: {
|
|
4
|
+
tagManagerID?: string | undefined;
|
|
5
|
+
} | undefined;
|
|
3
6
|
serverless?: {
|
|
4
7
|
themeAssets?: string[] | undefined;
|
|
5
8
|
apiOnly?: boolean | undefined;
|
|
@@ -18,6 +21,9 @@ export declare function getEDConfig(dir?: string): import("zod").SafeParseReturn
|
|
|
18
21
|
devUI: "disabled" | "enabled";
|
|
19
22
|
}, {
|
|
20
23
|
$schema?: string | undefined;
|
|
24
|
+
tracking?: {
|
|
25
|
+
tagManagerID?: string | undefined;
|
|
26
|
+
} | undefined;
|
|
21
27
|
serverless?: {
|
|
22
28
|
themeAssets?: string[] | undefined;
|
|
23
29
|
apiOnly?: boolean | undefined;
|
|
@@ -37,6 +43,9 @@ export declare function getEDConfig(dir?: string): import("zod").SafeParseReturn
|
|
|
37
43
|
}>;
|
|
38
44
|
export declare function getEDConfigUnwrapped(dir?: string): {
|
|
39
45
|
$schema?: string | undefined;
|
|
46
|
+
tracking?: {
|
|
47
|
+
tagManagerID?: string | undefined;
|
|
48
|
+
} | undefined;
|
|
40
49
|
serverless?: {
|
|
41
50
|
themeAssets?: string[] | undefined;
|
|
42
51
|
apiOnly?: boolean | undefined;
|
package/config/parse-config.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare function parseConfig(config: any): import("zod").SafeParseReturnType<{
|
|
2
2
|
$schema?: string | undefined;
|
|
3
|
+
tracking?: {
|
|
4
|
+
tagManagerID?: string | undefined;
|
|
5
|
+
} | undefined;
|
|
3
6
|
serverless?: {
|
|
4
7
|
themeAssets?: string[] | undefined;
|
|
5
8
|
apiOnly?: boolean | undefined;
|
|
@@ -18,6 +21,9 @@ export declare function parseConfig(config: any): import("zod").SafeParseReturnT
|
|
|
18
21
|
devUI: "disabled" | "enabled";
|
|
19
22
|
}, {
|
|
20
23
|
$schema?: string | undefined;
|
|
24
|
+
tracking?: {
|
|
25
|
+
tagManagerID?: string | undefined;
|
|
26
|
+
} | undefined;
|
|
21
27
|
serverless?: {
|
|
22
28
|
themeAssets?: string[] | undefined;
|
|
23
29
|
apiOnly?: boolean | undefined;
|
package/hooks/queryUtils.js
CHANGED
|
@@ -189,7 +189,7 @@ function createUseMutation(init) {
|
|
|
189
189
|
case 0:
|
|
190
190
|
setSubmitting(true);
|
|
191
191
|
setSubmitted(false);
|
|
192
|
-
url = process.serverless ? "/api/mutation/".concat(init.name) : "/wp-json/ed/v1/mutation/".concat(init.name);
|
|
192
|
+
url = process.serverless ? "/api/rest/mutation/".concat(init.name) : "/wp-json/ed/v1/mutation/".concat(init.name);
|
|
193
193
|
_a.label = 1;
|
|
194
194
|
case 1:
|
|
195
195
|
_a.trys.push([1, 4, , 5]);
|
package/package.json
CHANGED
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import NextDocument, { Html, Head, Main, NextScript } from "next/document"
|
|
3
|
+
// @ts-ignore
|
|
3
4
|
import { getCssText } from "@theme"
|
|
5
|
+
import Script from "next/script"
|
|
6
|
+
import settings from "_utils/ed-config"
|
|
4
7
|
|
|
5
8
|
export default class Document extends NextDocument {
|
|
6
9
|
render() {
|
|
10
|
+
console.log("GTM", settings.tracking?.tagManagerID)
|
|
7
11
|
return (
|
|
8
12
|
<Html lang="en">
|
|
9
13
|
<Head>
|
|
10
14
|
<style id="stitches" dangerouslySetInnerHTML={{ __html: getCssText() }} />
|
|
15
|
+
{settings.tracking?.tagManagerID ? (
|
|
16
|
+
<script
|
|
17
|
+
dangerouslySetInnerHTML={{
|
|
18
|
+
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
19
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
20
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
21
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
22
|
+
})(window,document,'script','dataLayer',${JSON.stringify(settings.tracking.tagManagerID)});console.log('GTM');`,
|
|
23
|
+
}}
|
|
24
|
+
></script>
|
|
25
|
+
) : null}
|
|
11
26
|
</Head>
|
|
12
27
|
<body>
|
|
28
|
+
{settings.tracking?.tagManagerID ? (
|
|
29
|
+
<noscript
|
|
30
|
+
dangerouslySetInnerHTML={{
|
|
31
|
+
__html: `<iframe src="https://www.googletagmanager.com/ns.html?id=${settings.tracking.tagManagerID}"
|
|
32
|
+
height="0" width="0" style="display:none;visibility:hidden"></iframe>`,
|
|
33
|
+
}}
|
|
34
|
+
></noscript>
|
|
35
|
+
) : null}
|
|
13
36
|
<Main />
|
|
14
37
|
<NextScript />
|
|
15
38
|
</body>
|