@prismicio/client 7.22.3-pr.477.5e5ad22 → 7.22.3-pr.477.9eb2102

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.
@@ -35,7 +35,7 @@ const require_isRepositoryName = require("./isRepositoryName.cjs");
35
35
  * @returns The URL for the given Prismic repository's Prismic Toolbar script.
36
36
  */
37
37
  const getToolbarSrc = (repositoryName, config) => {
38
- if (require_isRepositoryName.isRepositoryName(repositoryName)) return `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${config?.version ? `&v=${config.version}` : ""}`;
38
+ if (require_isRepositoryName.isRepositoryName(repositoryName)) return `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${config?.version === 5 ? "&v=5" : ""}`;
39
39
  else throw new require_errors.PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
40
40
  };
41
41
  //#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 * @param config - `version: 5` opts in to Prismic Toolbar v5. Only use it with an integration that\n * stores the preview session in the `cookie.previewSession` cookie. Defaults to v4.\n * @returns The URL for the given Prismic repository's Prismic Toolbar script.\n */\nexport const getToolbarSrc = (repositoryName: string, config?: { version?: 4 | 5 }): string => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${config?.version ? `&v=${config.version}` : \"\"}`\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,iBAAiB,gBAAwB,WAAyC;CAC9F,IAAIA,yBAAAA,iBAAiB,cAAc,GAClC,OAAO,iDAAiD,iBAAiB,QAAQ,UAAU,MAAM,OAAO,YAAY;MAEpH,MAAM,IAAIC,eAAAA,aACT,iDAAiD,kBACjD,KAAA,GACA,KAAA,CACD;AAEF"}
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 * @param config - `version: 5` opts in to Prismic Toolbar v5. Only use it with an integration that\n * stores the preview session in the `cookie.previewSession` cookie. Defaults to v4.\n * @returns The URL for the given Prismic repository's Prismic Toolbar script.\n */\nexport const getToolbarSrc = (repositoryName: string, config?: { version?: 4 | 5 }): string => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${config?.version === 5 ? \"&v=5\" : \"\"}`\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,iBAAiB,gBAAwB,WAAyC;CAC9F,IAAIA,yBAAAA,iBAAiB,cAAc,GAClC,OAAO,iDAAiD,iBAAiB,QAAQ,YAAY,IAAI,SAAS;MAE1G,MAAM,IAAIC,eAAAA,aACT,iDAAiD,kBACjD,KAAA,GACA,KAAA,CACD;AAEF"}
@@ -35,7 +35,7 @@ import { isRepositoryName } from "./isRepositoryName.js";
35
35
  * @returns The URL for the given Prismic repository's Prismic Toolbar script.
36
36
  */
37
37
  const getToolbarSrc = (repositoryName, config) => {
38
- if (isRepositoryName(repositoryName)) return `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${config?.version ? `&v=${config.version}` : ""}`;
38
+ if (isRepositoryName(repositoryName)) return `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${config?.version === 5 ? "&v=5" : ""}`;
39
39
  else throw new PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
40
40
  };
41
41
  //#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 * @param config - `version: 5` opts in to Prismic Toolbar v5. Only use it with an integration that\n * stores the preview session in the `cookie.previewSession` cookie. Defaults to v4.\n * @returns The URL for the given Prismic repository's Prismic Toolbar script.\n */\nexport const getToolbarSrc = (repositoryName: string, config?: { version?: 4 | 5 }): string => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${config?.version ? `&v=${config.version}` : \"\"}`\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,iBAAiB,gBAAwB,WAAyC;CAC9F,IAAI,iBAAiB,cAAc,GAClC,OAAO,iDAAiD,iBAAiB,QAAQ,UAAU,MAAM,OAAO,YAAY;MAEpH,MAAM,IAAI,aACT,iDAAiD,kBACjD,KAAA,GACA,KAAA,CACD;AAEF"}
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 * @param config - `version: 5` opts in to Prismic Toolbar v5. Only use it with an integration that\n * stores the preview session in the `cookie.previewSession` cookie. Defaults to v4.\n * @returns The URL for the given Prismic repository's Prismic Toolbar script.\n */\nexport const getToolbarSrc = (repositoryName: string, config?: { version?: 4 | 5 }): string => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${config?.version === 5 ? \"&v=5\" : \"\"}`\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,iBAAiB,gBAAwB,WAAyC;CAC9F,IAAI,iBAAiB,cAAc,GAClC,OAAO,iDAAiD,iBAAiB,QAAQ,YAAY,IAAI,SAAS;MAE1G,MAAM,IAAI,aACT,iDAAiD,kBACjD,KAAA,GACA,KAAA,CACD;AAEF"}
package/dist/package.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region package.json
2
2
  var name = "@prismicio/client";
3
- var version = "7.22.3-pr.477.5e5ad22";
3
+ var version = "7.22.3-pr.477.9eb2102";
4
4
  //#endregion
5
5
  Object.defineProperty(exports, "name", {
6
6
  enumerable: true,
package/dist/package.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region package.json
2
2
  var name = "@prismicio/client";
3
- var version = "7.22.3-pr.477.5e5ad22";
3
+ var version = "7.22.3-pr.477.9eb2102";
4
4
  //#endregion
5
5
  export { name, version };
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/client",
3
- "version": "7.22.3-pr.477.5e5ad22",
3
+ "version": "7.22.3-pr.477.9eb2102",
4
4
  "description": "The official JavaScript + TypeScript client library for Prismic",
5
5
  "keywords": [
6
6
  "client",
@@ -36,7 +36,7 @@ import { isRepositoryName } from "./isRepositoryName"
36
36
  */
37
37
  export const getToolbarSrc = (repositoryName: string, config?: { version?: 4 | 5 }): string => {
38
38
  if (isRepositoryName(repositoryName)) {
39
- return `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${config?.version ? `&v=${config.version}` : ""}`
39
+ return `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${config?.version === 5 ? "&v=5" : ""}`
40
40
  } else {
41
41
  throw new PrismicError(
42
42
  `An invalid Prismic repository name was given: ${repositoryName}`,