@tinacms/vercel-previews 0.0.0-c965b5f-20250426163441 → 0.0.0-ccab7a5-20251124054446
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 +17 -1
- package/dist/index.js +7 -20
- package/dist/index.mjs +7 -20
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const vercelEditInfo: <T extends object & {
|
|
2
|
+
_content_source?: {
|
|
3
|
+
queryId: string;
|
|
4
|
+
path: (number | string)[];
|
|
5
|
+
};
|
|
6
|
+
}>(obj: T, field?: keyof Omit<T, "__typename" | "_sys">, index?: number) => string;
|
|
7
|
+
export declare const useVisualEditing: <T extends object>({ data, query, variables, enabled, redirect, stringEncoding, }: {
|
|
8
|
+
data: T;
|
|
9
|
+
query: string;
|
|
10
|
+
variables: object;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
redirect: string;
|
|
13
|
+
stringEncoding: boolean | {
|
|
14
|
+
skipPaths: (path: string, value: string) => boolean;
|
|
15
|
+
};
|
|
16
|
+
}) => T;
|
|
17
|
+
export declare const hashFromQuery: (input: string) => string;
|
package/dist/index.js
CHANGED
|
@@ -18,29 +18,16 @@
|
|
|
18
18
|
return { edit };
|
|
19
19
|
}
|
|
20
20
|
const tinaField = (object, property, index) => {
|
|
21
|
-
|
|
22
|
-
if (!
|
|
21
|
+
const contentSource = object == null ? void 0 : object._content_source;
|
|
22
|
+
if (!contentSource) {
|
|
23
23
|
return "";
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(_a = object._content_source) == null ? void 0 : _a.queryId,
|
|
29
|
-
object._content_source.path.join(".")
|
|
30
|
-
].join("---");
|
|
31
|
-
}
|
|
32
|
-
if (typeof index === "number") {
|
|
33
|
-
return [
|
|
34
|
-
(_b = object._content_source) == null ? void 0 : _b.queryId,
|
|
35
|
-
[...object._content_source.path, property, index].join(".")
|
|
36
|
-
].join("---");
|
|
37
|
-
}
|
|
38
|
-
return [
|
|
39
|
-
(_c = object._content_source) == null ? void 0 : _c.queryId,
|
|
40
|
-
[...object._content_source.path, property].join(".")
|
|
41
|
-
].join("---");
|
|
25
|
+
const { queryId, path } = contentSource;
|
|
26
|
+
if (!property) {
|
|
27
|
+
return `${queryId}---${path.join(".")}`;
|
|
42
28
|
}
|
|
43
|
-
|
|
29
|
+
const fullPath = typeof index === "number" ? [...path, property, index] : [...path, property];
|
|
30
|
+
return `${queryId}---${fullPath.join(".")}`;
|
|
44
31
|
};
|
|
45
32
|
const vercelEditInfo = (obj, field, index) => {
|
|
46
33
|
const fieldName = tinaField(obj, field, index);
|
package/dist/index.mjs
CHANGED
|
@@ -16,29 +16,16 @@ function useEditState() {
|
|
|
16
16
|
return { edit };
|
|
17
17
|
}
|
|
18
18
|
const tinaField = (object, property, index) => {
|
|
19
|
-
|
|
20
|
-
if (!
|
|
19
|
+
const contentSource = object == null ? void 0 : object._content_source;
|
|
20
|
+
if (!contentSource) {
|
|
21
21
|
return "";
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
(_a = object._content_source) == null ? void 0 : _a.queryId,
|
|
27
|
-
object._content_source.path.join(".")
|
|
28
|
-
].join("---");
|
|
29
|
-
}
|
|
30
|
-
if (typeof index === "number") {
|
|
31
|
-
return [
|
|
32
|
-
(_b = object._content_source) == null ? void 0 : _b.queryId,
|
|
33
|
-
[...object._content_source.path, property, index].join(".")
|
|
34
|
-
].join("---");
|
|
35
|
-
}
|
|
36
|
-
return [
|
|
37
|
-
(_c = object._content_source) == null ? void 0 : _c.queryId,
|
|
38
|
-
[...object._content_source.path, property].join(".")
|
|
39
|
-
].join("---");
|
|
23
|
+
const { queryId, path } = contentSource;
|
|
24
|
+
if (!property) {
|
|
25
|
+
return `${queryId}---${path.join(".")}`;
|
|
40
26
|
}
|
|
41
|
-
|
|
27
|
+
const fullPath = typeof index === "number" ? [...path, property, index] : [...path, property];
|
|
28
|
+
return `${queryId}---${fullPath.join(".")}`;
|
|
42
29
|
};
|
|
43
30
|
const vercelEditInfo = (obj, field, index) => {
|
|
44
31
|
const fieldName = tinaField(obj, field, index);
|
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-ccab7a5-20251124054446",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"@types/react": "^18.3.18",
|
|
38
38
|
"react": "^18.3.1",
|
|
39
39
|
"typescript": "^5.7.3",
|
|
40
|
-
"@tinacms/scripts": "
|
|
40
|
+
"@tinacms/scripts": "0.0.0-ccab7a5-20251124054446"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@vercel/stega": "^0.0.5",
|
|
44
|
-
"tinacms": "0.0.0-
|
|
44
|
+
"tinacms": "0.0.0-ccab7a5-20251124054446"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": ">=16.14"
|