@prismicio/client 7.22.3-pr.477.9eb2102 → 7.22.3-pr.478.286df20
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/cookie.cjs +1 -7
- package/dist/cookie.cjs.map +1 -1
- package/dist/cookie.d.cts +1 -3
- package/dist/cookie.d.cts.map +1 -1
- package/dist/cookie.d.ts +1 -3
- package/dist/cookie.d.ts.map +1 -1
- package/dist/cookie.js +2 -7
- package/dist/cookie.js.map +1 -1
- package/dist/getToolbarSrc.cjs +2 -4
- package/dist/getToolbarSrc.cjs.map +1 -1
- package/dist/getToolbarSrc.d.cts +1 -5
- package/dist/getToolbarSrc.d.cts.map +1 -1
- package/dist/getToolbarSrc.d.ts +1 -5
- package/dist/getToolbarSrc.d.ts.map +1 -1
- package/dist/getToolbarSrc.js +2 -4
- package/dist/getToolbarSrc.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/package.json +1 -1
- package/src/cookie.ts +0 -3
- package/src/getToolbarSrc.ts +4 -4
package/dist/cookie.cjs
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
//#region src/cookie.ts
|
|
2
|
-
var cookie_exports = /* @__PURE__ */ require("./_virtual/_rolldown/runtime.cjs").__exportAll({
|
|
3
|
-
preview: () => preview,
|
|
4
|
-
previewSession: () => previewSession
|
|
5
|
-
});
|
|
2
|
+
var cookie_exports = /* @__PURE__ */ require("./_virtual/_rolldown/runtime.cjs").__exportAll({ preview: () => preview });
|
|
6
3
|
/** The well-known name of the cookie used to store a Prismic preview session's ref. */
|
|
7
4
|
const preview = "io.prismic.preview";
|
|
8
|
-
/** The well-known name of the cookie used to store a Prismic Toolbar v5 preview session's ID. */
|
|
9
|
-
const previewSession = "io.prismic.previewSession";
|
|
10
5
|
//#endregion
|
|
11
6
|
Object.defineProperty(exports, "cookie_exports", {
|
|
12
7
|
enumerable: true,
|
|
@@ -15,6 +10,5 @@ Object.defineProperty(exports, "cookie_exports", {
|
|
|
15
10
|
}
|
|
16
11
|
});
|
|
17
12
|
exports.preview = preview;
|
|
18
|
-
exports.previewSession = previewSession;
|
|
19
13
|
|
|
20
14
|
//# sourceMappingURL=cookie.cjs.map
|
package/dist/cookie.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.cjs","names":[],"sources":["../src/cookie.ts"],"sourcesContent":["/** The well-known name of the cookie used to store a Prismic preview session's ref. */\nexport const preview = \"io.prismic.preview\"\n
|
|
1
|
+
{"version":3,"file":"cookie.cjs","names":[],"sources":["../src/cookie.ts"],"sourcesContent":["/** The well-known name of the cookie used to store a Prismic preview session's ref. */\nexport const preview = \"io.prismic.preview\"\n"],"mappings":";;;AACA,MAAa,UAAU"}
|
package/dist/cookie.d.cts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
declare namespace cookie_d_exports {
|
|
2
|
-
export { preview
|
|
2
|
+
export { preview };
|
|
3
3
|
}
|
|
4
4
|
/** The well-known name of the cookie used to store a Prismic preview session's ref. */
|
|
5
5
|
export declare const preview = "io.prismic.preview";
|
|
6
|
-
/** The well-known name of the cookie used to store a Prismic Toolbar v5 preview session's ID. */
|
|
7
|
-
export declare const previewSession = "io.prismic.previewSession";
|
|
8
6
|
//#endregion
|
|
9
7
|
export { cookie_d_exports };
|
|
10
8
|
//# sourceMappingURL=cookie.d.cts.map
|
package/dist/cookie.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.d.cts","names":[],"sources":["../src/cookie.ts"],"mappings":";;;;qBACa
|
|
1
|
+
{"version":3,"file":"cookie.d.cts","names":[],"sources":["../src/cookie.ts"],"mappings":";;;;qBACa"}
|
package/dist/cookie.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
declare namespace cookie_d_exports {
|
|
2
|
-
export { preview
|
|
2
|
+
export { preview };
|
|
3
3
|
}
|
|
4
4
|
/** The well-known name of the cookie used to store a Prismic preview session's ref. */
|
|
5
5
|
export declare const preview = "io.prismic.preview";
|
|
6
|
-
/** The well-known name of the cookie used to store a Prismic Toolbar v5 preview session's ID. */
|
|
7
|
-
export declare const previewSession = "io.prismic.previewSession";
|
|
8
6
|
//#endregion
|
|
9
7
|
export { cookie_d_exports };
|
|
10
8
|
//# sourceMappingURL=cookie.d.ts.map
|
package/dist/cookie.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.d.ts","names":[],"sources":["../src/cookie.ts"],"mappings":";;;;qBACa
|
|
1
|
+
{"version":3,"file":"cookie.d.ts","names":[],"sources":["../src/cookie.ts"],"mappings":";;;;qBACa"}
|
package/dist/cookie.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
2
|
//#region src/cookie.ts
|
|
3
|
-
var cookie_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
-
preview: () => preview,
|
|
5
|
-
previewSession: () => previewSession
|
|
6
|
-
});
|
|
3
|
+
var cookie_exports = /* @__PURE__ */ __exportAll({ preview: () => preview });
|
|
7
4
|
/** The well-known name of the cookie used to store a Prismic preview session's ref. */
|
|
8
5
|
const preview = "io.prismic.preview";
|
|
9
|
-
/** The well-known name of the cookie used to store a Prismic Toolbar v5 preview session's ID. */
|
|
10
|
-
const previewSession = "io.prismic.previewSession";
|
|
11
6
|
//#endregion
|
|
12
|
-
export { cookie_exports, preview
|
|
7
|
+
export { cookie_exports, preview };
|
|
13
8
|
|
|
14
9
|
//# sourceMappingURL=cookie.js.map
|
package/dist/cookie.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.js","names":[],"sources":["../src/cookie.ts"],"sourcesContent":["/** The well-known name of the cookie used to store a Prismic preview session's ref. */\nexport const preview = \"io.prismic.preview\"\n
|
|
1
|
+
{"version":3,"file":"cookie.js","names":[],"sources":["../src/cookie.ts"],"sourcesContent":["/** The well-known name of the cookie used to store a Prismic preview session's ref. */\nexport const preview = \"io.prismic.preview\"\n"],"mappings":";;;;AACA,MAAa,UAAU"}
|
package/dist/getToolbarSrc.cjs
CHANGED
|
@@ -30,12 +30,10 @@ const require_isRepositoryName = require("./isRepositoryName.cjs");
|
|
|
30
30
|
*
|
|
31
31
|
* @param repositoryName - The name of the Prismic repository. For example, `"my-repo"` if the
|
|
32
32
|
* repository URL is `my-repo.prismic.io`.
|
|
33
|
-
* @param config - `version: 5` opts in to Prismic Toolbar v5. Only use it with an integration that
|
|
34
|
-
* stores the preview session in the `cookie.previewSession` cookie. Defaults to v4.
|
|
35
33
|
* @returns The URL for the given Prismic repository's Prismic Toolbar script.
|
|
36
34
|
*/
|
|
37
|
-
const getToolbarSrc = (repositoryName
|
|
38
|
-
if (require_isRepositoryName.isRepositoryName(repositoryName)) return `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}
|
|
35
|
+
const getToolbarSrc = (repositoryName) => {
|
|
36
|
+
if (require_isRepositoryName.isRepositoryName(repositoryName)) return `https://static.cdn.prismic.io/prismic.js?new=true&repo=${repositoryName}`;
|
|
39
37
|
else throw new require_errors.PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
|
|
40
38
|
};
|
|
41
39
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getToolbarSrc.cjs","names":["isRepositoryName","PrismicError"],"sources":["../src/getToolbarSrc.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the\n * script into your app.\n *\n * @example\n * \t```typescriptreact\n * \t// In Next.js apps, use `next/script` in your `app/layout.tsx` file.\n *\n * \timport Script from \"next/script\";\n * \timport * as prismic from \"@prismicio/client\";\n *\n * \texport default function RootLayout({\n * \tchildren,\n * \t}: {\n * \tchildren: React.ReactNode,\n * \t}) {\n * \tconst toolbarSrc = prismic.getToolbarSrc(\"my-repo\");\n *\n * \treturn (\n * \t<html lang=\"en\">\n * \t<body>{children}</body>\n * \t<Script src={toolbarSrc} />\n * \t</html>\n * \t);\n * \t}\n * \t```\n *\n * @param repositoryName - The name of the Prismic repository. For example, `\"my-repo\"` if the\n * repository URL is `my-repo.prismic.io`.\n * @
|
|
1
|
+
{"version":3,"file":"getToolbarSrc.cjs","names":["isRepositoryName","PrismicError"],"sources":["../src/getToolbarSrc.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the\n * script into your app.\n *\n * @example\n * \t```typescriptreact\n * \t// In Next.js apps, use `next/script` in your `app/layout.tsx` file.\n *\n * \timport Script from \"next/script\";\n * \timport * as prismic from \"@prismicio/client\";\n *\n * \texport default function RootLayout({\n * \tchildren,\n * \t}: {\n * \tchildren: React.ReactNode,\n * \t}) {\n * \tconst toolbarSrc = prismic.getToolbarSrc(\"my-repo\");\n *\n * \treturn (\n * \t<html lang=\"en\">\n * \t<body>{children}</body>\n * \t<Script src={toolbarSrc} />\n * \t</html>\n * \t);\n * \t}\n * \t```\n *\n * @param repositoryName - The name of the Prismic repository. For example, `\"my-repo\"` if the\n * repository URL is `my-repo.prismic.io`.\n * @returns The URL for the given Prismic repository's Prismic Toolbar script.\n */\nexport const getToolbarSrc = <TRepositoryName extends string>(\n\trepositoryName: TRepositoryName,\n): `https://static.cdn.prismic.io/prismic.js?new=true&repo=${TRepositoryName}` => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://static.cdn.prismic.io/prismic.js?new=true&repo=${repositoryName}` as const\n\t} else {\n\t\tthrow new PrismicError(\n\t\t\t`An invalid Prismic repository name was given: ${repositoryName}`,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,iBACZ,mBACiF;CACjF,IAAIA,yBAAAA,iBAAiB,cAAc,GAClC,OAAO,0DAA0D;MAEjE,MAAM,IAAIC,eAAAA,aACT,iDAAiD,kBACjD,KAAA,GACA,KAAA,CACD;AAEF"}
|
package/dist/getToolbarSrc.d.cts
CHANGED
|
@@ -28,12 +28,8 @@
|
|
|
28
28
|
*
|
|
29
29
|
* @param repositoryName - The name of the Prismic repository. For example, `"my-repo"` if the
|
|
30
30
|
* repository URL is `my-repo.prismic.io`.
|
|
31
|
-
* @param config - `version: 5` opts in to Prismic Toolbar v5. Only use it with an integration that
|
|
32
|
-
* stores the preview session in the `cookie.previewSession` cookie. Defaults to v4.
|
|
33
31
|
* @returns The URL for the given Prismic repository's Prismic Toolbar script.
|
|
34
32
|
*/
|
|
35
|
-
export declare const getToolbarSrc: (repositoryName:
|
|
36
|
-
version?: 4 | 5;
|
|
37
|
-
}) => string;
|
|
33
|
+
export declare const getToolbarSrc: <TRepositoryName extends string>(repositoryName: TRepositoryName) => `https://static.cdn.prismic.io/prismic.js?new=true&repo=${TRepositoryName}`;
|
|
38
34
|
//#endregion
|
|
39
35
|
//# sourceMappingURL=getToolbarSrc.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getToolbarSrc.d.cts","names":[],"sources":["../src/getToolbarSrc.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getToolbarSrc.d.cts","names":[],"sources":["../src/getToolbarSrc.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAkCa,gBAAiB,gCAA8B,gBAC3C,8EAC4C"}
|
package/dist/getToolbarSrc.d.ts
CHANGED
|
@@ -28,12 +28,8 @@
|
|
|
28
28
|
*
|
|
29
29
|
* @param repositoryName - The name of the Prismic repository. For example, `"my-repo"` if the
|
|
30
30
|
* repository URL is `my-repo.prismic.io`.
|
|
31
|
-
* @param config - `version: 5` opts in to Prismic Toolbar v5. Only use it with an integration that
|
|
32
|
-
* stores the preview session in the `cookie.previewSession` cookie. Defaults to v4.
|
|
33
31
|
* @returns The URL for the given Prismic repository's Prismic Toolbar script.
|
|
34
32
|
*/
|
|
35
|
-
export declare const getToolbarSrc: (repositoryName:
|
|
36
|
-
version?: 4 | 5;
|
|
37
|
-
}) => string;
|
|
33
|
+
export declare const getToolbarSrc: <TRepositoryName extends string>(repositoryName: TRepositoryName) => `https://static.cdn.prismic.io/prismic.js?new=true&repo=${TRepositoryName}`;
|
|
38
34
|
//#endregion
|
|
39
35
|
//# sourceMappingURL=getToolbarSrc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getToolbarSrc.d.ts","names":[],"sources":["../src/getToolbarSrc.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getToolbarSrc.d.ts","names":[],"sources":["../src/getToolbarSrc.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAkCa,gBAAiB,gCAA8B,gBAC3C,8EAC4C"}
|
package/dist/getToolbarSrc.js
CHANGED
|
@@ -30,12 +30,10 @@ import { isRepositoryName } from "./isRepositoryName.js";
|
|
|
30
30
|
*
|
|
31
31
|
* @param repositoryName - The name of the Prismic repository. For example, `"my-repo"` if the
|
|
32
32
|
* repository URL is `my-repo.prismic.io`.
|
|
33
|
-
* @param config - `version: 5` opts in to Prismic Toolbar v5. Only use it with an integration that
|
|
34
|
-
* stores the preview session in the `cookie.previewSession` cookie. Defaults to v4.
|
|
35
33
|
* @returns The URL for the given Prismic repository's Prismic Toolbar script.
|
|
36
34
|
*/
|
|
37
|
-
const getToolbarSrc = (repositoryName
|
|
38
|
-
if (isRepositoryName(repositoryName)) return `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}
|
|
35
|
+
const getToolbarSrc = (repositoryName) => {
|
|
36
|
+
if (isRepositoryName(repositoryName)) return `https://static.cdn.prismic.io/prismic.js?new=true&repo=${repositoryName}`;
|
|
39
37
|
else throw new PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
|
|
40
38
|
};
|
|
41
39
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getToolbarSrc.js","names":[],"sources":["../src/getToolbarSrc.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the\n * script into your app.\n *\n * @example\n * \t```typescriptreact\n * \t// In Next.js apps, use `next/script` in your `app/layout.tsx` file.\n *\n * \timport Script from \"next/script\";\n * \timport * as prismic from \"@prismicio/client\";\n *\n * \texport default function RootLayout({\n * \tchildren,\n * \t}: {\n * \tchildren: React.ReactNode,\n * \t}) {\n * \tconst toolbarSrc = prismic.getToolbarSrc(\"my-repo\");\n *\n * \treturn (\n * \t<html lang=\"en\">\n * \t<body>{children}</body>\n * \t<Script src={toolbarSrc} />\n * \t</html>\n * \t);\n * \t}\n * \t```\n *\n * @param repositoryName - The name of the Prismic repository. For example, `\"my-repo\"` if the\n * repository URL is `my-repo.prismic.io`.\n * @
|
|
1
|
+
{"version":3,"file":"getToolbarSrc.js","names":[],"sources":["../src/getToolbarSrc.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Returns the URL for a Prismic repository's Prismic Toolbar script. Use the URL to inject the\n * script into your app.\n *\n * @example\n * \t```typescriptreact\n * \t// In Next.js apps, use `next/script` in your `app/layout.tsx` file.\n *\n * \timport Script from \"next/script\";\n * \timport * as prismic from \"@prismicio/client\";\n *\n * \texport default function RootLayout({\n * \tchildren,\n * \t}: {\n * \tchildren: React.ReactNode,\n * \t}) {\n * \tconst toolbarSrc = prismic.getToolbarSrc(\"my-repo\");\n *\n * \treturn (\n * \t<html lang=\"en\">\n * \t<body>{children}</body>\n * \t<Script src={toolbarSrc} />\n * \t</html>\n * \t);\n * \t}\n * \t```\n *\n * @param repositoryName - The name of the Prismic repository. For example, `\"my-repo\"` if the\n * repository URL is `my-repo.prismic.io`.\n * @returns The URL for the given Prismic repository's Prismic Toolbar script.\n */\nexport const getToolbarSrc = <TRepositoryName extends string>(\n\trepositoryName: TRepositoryName,\n): `https://static.cdn.prismic.io/prismic.js?new=true&repo=${TRepositoryName}` => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://static.cdn.prismic.io/prismic.js?new=true&repo=${repositoryName}` as const\n\t} else {\n\t\tthrow new PrismicError(\n\t\t\t`An invalid Prismic repository name was given: ${repositoryName}`,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,iBACZ,mBACiF;CACjF,IAAI,iBAAiB,cAAc,GAClC,OAAO,0DAA0D;MAEjE,MAAM,IAAI,aACT,iDAAiD,kBACjD,KAAA,GACA,KAAA,CACD;AAEF"}
|
package/dist/package.cjs
CHANGED
package/dist/package.js
CHANGED
package/package.json
CHANGED
package/src/cookie.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
/** The well-known name of the cookie used to store a Prismic preview session's ref. */
|
|
2
2
|
export const preview = "io.prismic.preview"
|
|
3
|
-
|
|
4
|
-
/** The well-known name of the cookie used to store a Prismic Toolbar v5 preview session's ID. */
|
|
5
|
-
export const previewSession = "io.prismic.previewSession"
|
package/src/getToolbarSrc.ts
CHANGED
|
@@ -30,13 +30,13 @@ import { isRepositoryName } from "./isRepositoryName"
|
|
|
30
30
|
*
|
|
31
31
|
* @param repositoryName - The name of the Prismic repository. For example, `"my-repo"` if the
|
|
32
32
|
* repository URL is `my-repo.prismic.io`.
|
|
33
|
-
* @param config - `version: 5` opts in to Prismic Toolbar v5. Only use it with an integration that
|
|
34
|
-
* stores the preview session in the `cookie.previewSession` cookie. Defaults to v4.
|
|
35
33
|
* @returns The URL for the given Prismic repository's Prismic Toolbar script.
|
|
36
34
|
*/
|
|
37
|
-
export const getToolbarSrc =
|
|
35
|
+
export const getToolbarSrc = <TRepositoryName extends string>(
|
|
36
|
+
repositoryName: TRepositoryName,
|
|
37
|
+
): `https://static.cdn.prismic.io/prismic.js?new=true&repo=${TRepositoryName}` => {
|
|
38
38
|
if (isRepositoryName(repositoryName)) {
|
|
39
|
-
return `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}
|
|
39
|
+
return `https://static.cdn.prismic.io/prismic.js?new=true&repo=${repositoryName}` as const
|
|
40
40
|
} else {
|
|
41
41
|
throw new PrismicError(
|
|
42
42
|
`An invalid Prismic repository name was given: ${repositoryName}`,
|