@tinacms/vercel-previews 0.0.0-20230516165451 → 0.0.0-20230516175319
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.ts +2 -1
- package/dist/index.es.js +5 -1
- package/dist/index.js +5 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ export declare const vercelEditInfo: <T extends object & {
|
|
|
4
4
|
path: (number | string)[];
|
|
5
5
|
};
|
|
6
6
|
}>(obj: T, field?: Exclude<keyof T, "__typename" | "_sys">, index?: number) => string;
|
|
7
|
-
export declare const useVisualEditing: <T extends object>({ data, query, variables, redirect, stringEncoding, }: {
|
|
7
|
+
export declare const useVisualEditing: <T extends object>({ data, query, variables, enabled, redirect, stringEncoding, }: {
|
|
8
8
|
data: T;
|
|
9
9
|
query: string;
|
|
10
10
|
variables: object;
|
|
11
|
+
enabled: boolean;
|
|
11
12
|
redirect: string;
|
|
12
13
|
stringEncoding: boolean | {
|
|
13
14
|
skipPaths: (path: string, value: string) => boolean;
|
package/dist/index.es.js
CHANGED
|
@@ -45,6 +45,7 @@ const useVisualEditing = ({
|
|
|
45
45
|
data,
|
|
46
46
|
query,
|
|
47
47
|
variables,
|
|
48
|
+
enabled,
|
|
48
49
|
redirect,
|
|
49
50
|
stringEncoding
|
|
50
51
|
}) => {
|
|
@@ -107,7 +108,10 @@ const useVisualEditing = ({
|
|
|
107
108
|
}
|
|
108
109
|
return { ...transformedObj, _content_source: { queryId: id2, path } };
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
+
if (enabled) {
|
|
112
|
+
return appendMetadata(data, [], id);
|
|
113
|
+
}
|
|
114
|
+
return data;
|
|
111
115
|
};
|
|
112
116
|
function encodeEditInfo(path, value, id) {
|
|
113
117
|
const res = `${vercelStegaEncode({
|
package/dist/index.js
CHANGED
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
data,
|
|
52
52
|
query,
|
|
53
53
|
variables,
|
|
54
|
+
enabled,
|
|
54
55
|
redirect,
|
|
55
56
|
stringEncoding
|
|
56
57
|
}) => {
|
|
@@ -113,7 +114,10 @@
|
|
|
113
114
|
}
|
|
114
115
|
return { ...transformedObj, _content_source: { queryId: id2, path } };
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
+
if (enabled) {
|
|
118
|
+
return appendMetadata(data, [], id);
|
|
119
|
+
}
|
|
120
|
+
return data;
|
|
117
121
|
};
|
|
118
122
|
function encodeEditInfo(path, value, id) {
|
|
119
123
|
const res = `${stega.vercelStegaEncode({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/vercel-previews",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20230516175319",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@vercel/stega": "^0.0.4",
|
|
44
|
-
"tinacms": "0.0.0-
|
|
44
|
+
"tinacms": "0.0.0-20230516175319"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": ">=16.14"
|