@prismicio/react 2.7.4 → 2.9.0-alpha.0

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.
Files changed (52) hide show
  1. package/dist/PrismicImage.d.ts +90 -8
  2. package/dist/PrismicToolbar.cjs +0 -1
  3. package/dist/PrismicToolbar.cjs.map +1 -1
  4. package/dist/PrismicToolbar.js +0 -1
  5. package/dist/PrismicToolbar.js.map +1 -1
  6. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs +1 -4
  7. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs.map +1 -1
  8. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js +1 -4
  9. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js.map +1 -1
  10. package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.cjs +4 -3
  11. package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
  12. package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.js +2 -1
  13. package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
  14. package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.cjs +7 -6
  15. package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
  16. package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.js +3 -2
  17. package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.js.map +1 -1
  18. package/dist/_node_modules/@prismicio/client/dist/helpers/asText.cjs +2 -2
  19. package/dist/_node_modules/@prismicio/client/dist/helpers/asText.cjs.map +1 -1
  20. package/dist/_node_modules/@prismicio/client/dist/helpers/asText.js +1 -1
  21. package/dist/_node_modules/@prismicio/client/dist/helpers/asText.js.map +1 -1
  22. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs +1 -0
  23. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs.map +1 -1
  24. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js +1 -0
  25. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js.map +1 -1
  26. package/dist/_node_modules/@prismicio/client/dist/richtext/asText.cjs +13 -0
  27. package/dist/_node_modules/@prismicio/client/dist/richtext/asText.cjs.map +1 -0
  28. package/dist/_node_modules/@prismicio/client/dist/richtext/asText.js +13 -0
  29. package/dist/_node_modules/@prismicio/client/dist/richtext/asText.js.map +1 -0
  30. package/dist/_node_modules/imgix-url-builder/dist/buildPixelDensitySrcSet.cjs +10 -0
  31. package/dist/_node_modules/imgix-url-builder/dist/buildPixelDensitySrcSet.cjs.map +1 -0
  32. package/dist/_node_modules/imgix-url-builder/dist/buildPixelDensitySrcSet.js +10 -0
  33. package/dist/_node_modules/imgix-url-builder/dist/buildPixelDensitySrcSet.js.map +1 -0
  34. package/dist/_node_modules/imgix-url-builder/dist/{index.cjs → buildURL.cjs} +1 -13
  35. package/dist/_node_modules/imgix-url-builder/dist/buildURL.cjs.map +1 -0
  36. package/dist/_node_modules/imgix-url-builder/dist/{index.js → buildURL.js} +2 -14
  37. package/dist/_node_modules/imgix-url-builder/dist/buildURL.js.map +1 -0
  38. package/dist/_node_modules/imgix-url-builder/dist/buildWidthSrcSet.cjs +10 -0
  39. package/dist/_node_modules/imgix-url-builder/dist/buildWidthSrcSet.cjs.map +1 -0
  40. package/dist/_node_modules/imgix-url-builder/dist/buildWidthSrcSet.js +10 -0
  41. package/dist/_node_modules/imgix-url-builder/dist/buildWidthSrcSet.js.map +1 -0
  42. package/dist/package.json.cjs +1 -1
  43. package/dist/package.json.js +1 -1
  44. package/dist/react-server/PrismicLink.cjs +4 -4
  45. package/dist/react-server/PrismicLink.cjs.map +1 -1
  46. package/dist/react-server/PrismicLink.d.ts +6 -1
  47. package/dist/react-server/PrismicLink.js +4 -4
  48. package/dist/react-server/PrismicLink.js.map +1 -1
  49. package/package.json +8 -4
  50. package/src/react-server/PrismicLink.tsx +23 -7
  51. package/dist/_node_modules/imgix-url-builder/dist/index.cjs.map +0 -1
  52. package/dist/_node_modules/imgix-url-builder/dist/index.js.map +0 -1
@@ -94,6 +94,14 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
94
94
  imgixParams?: {
95
95
  ar?: `${number}:${number}` | null | undefined;
96
96
  auto?: ("true" | "enhance" | "format" | "redeye" | "compress")[] | null | undefined;
97
+ bgRemoveFallback?: boolean | null | undefined;
98
+ bgRemove?: boolean | null | undefined;
99
+ backgroundRemove?: boolean | null | undefined;
100
+ bgReplaceFallback?: boolean | null | undefined;
101
+ bgReplaceNegPrompt?: string | null | undefined;
102
+ backgroundReplaceNegativePrompt?: string | null | undefined;
103
+ bgReplace?: string | null | undefined;
104
+ backgroundReplace?: string | null | undefined;
97
105
  bg?: string | null | undefined;
98
106
  blendAlign?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
99
107
  blendalign?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
@@ -150,7 +158,7 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
150
158
  con?: number | null | undefined;
151
159
  cornerRadius?: number | [number, number, number, number] | null | undefined;
152
160
  crop?: ("faces" | "top" | "bottom" | "left" | "right" | "entropy" | "edges" | "focalpoint")[] | null | undefined;
153
- cs?: "srgb" | "adobergb1998" | "tinysrgb" | "strip" | null | undefined;
161
+ cs?: "origin" | "srgb" | "adobergb1998" | "tinysrgb" | "strip" | null | undefined;
154
162
  dl?: string | null | undefined;
155
163
  dpi?: number | null | undefined;
156
164
  dpr?: number | null | undefined;
@@ -163,7 +171,25 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
163
171
  faces?: 1 | null | undefined;
164
172
  fillColor?: string | null | undefined;
165
173
  fillcolor?: string | null | undefined;
166
- fill?: "blur" | "solid" | null | undefined;
174
+ fillGenFallback?: boolean | null | undefined;
175
+ fillGenerativeFallback?: boolean | null | undefined;
176
+ fillGenNegPrompt?: string | null | undefined;
177
+ fillGenerativeNegativePrompt?: string | null | undefined;
178
+ fillGenPos?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
179
+ fillGenerativePosition?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
180
+ fillGenPrompt?: string | null | undefined;
181
+ fillGenerativePrompt?: string | null | undefined;
182
+ fillGenSeed?: number | null | undefined;
183
+ fillGenerativeSeed?: number | null | undefined;
184
+ fillGradientCs?: "srgb" | "linear" | "oklab" | "hsl" | "lch" | null | undefined;
185
+ fillGradientLinearDirection?: ("top" | "bottom" | "left" | "right")[] | null | undefined;
186
+ fillGradientLinear?: [string, string] | null | undefined;
187
+ fillGradientRadialRadius?: [number, number] | null | undefined;
188
+ fillGradientRadialX?: number | null | undefined;
189
+ fillGradientRadialY?: number | null | undefined;
190
+ fillGradientRadial?: [string, string] | null | undefined;
191
+ fillGradientType?: "linear" | "radial" | null | undefined;
192
+ fill?: "blur" | "solid" | "gen" | "generative" | "gradient" | null | undefined;
167
193
  fit?: "crop" | "fill" | "clamp" | "clip" | "scale" | "max" | "facearea" | "fillmax" | "min" | null | undefined;
168
194
  f?: "crop" | "fill" | "clamp" | "clip" | "scale" | "max" | "facearea" | "fillmax" | "min" | null | undefined;
169
195
  flip?: "h" | "v" | "hv" | null | undefined;
@@ -172,7 +198,11 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
172
198
  fpX?: number | null | undefined;
173
199
  fpY?: number | null | undefined;
174
200
  fpZ?: number | null | undefined;
201
+ fps?: number | null | undefined;
202
+ frame?: number | import("imgix-url-builder/dist/types.generated").Range | null | undefined;
175
203
  gam?: number | null | undefined;
204
+ gifQ?: number | null | undefined;
205
+ gifq?: number | null | undefined;
176
206
  gridColors?: [string, string] | null | undefined;
177
207
  gridSize?: number | null | undefined;
178
208
  h?: number | null | undefined;
@@ -180,9 +210,13 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
180
210
  high?: number | null | undefined;
181
211
  htn?: number | null | undefined;
182
212
  hue?: number | null | undefined;
213
+ interval?: number | null | undefined;
183
214
  invert?: boolean | null | undefined;
184
215
  inv?: boolean | null | undefined;
185
216
  iptc?: "allow" | "block" | null | undefined;
217
+ jpgProgressive?: boolean | null | undefined;
218
+ jpegProgressive?: boolean | null | undefined;
219
+ loop?: number | null | undefined;
186
220
  lossless?: boolean | null | undefined;
187
221
  markAlign?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
188
222
  ma?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
@@ -250,11 +284,14 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
250
284
  px?: number | null | undefined;
251
285
  q?: number | null | undefined;
252
286
  rect?: [number | "left" | "right" | "center", number | "top" | "bottom" | "middle", number, number] | null | undefined;
287
+ reverse?: boolean | null | undefined;
253
288
  rot?: number | null | undefined;
254
289
  sat?: number | null | undefined;
255
290
  sepia?: number | null | undefined;
256
291
  shad?: number | null | undefined;
257
292
  sharp?: number | null | undefined;
293
+ skip?: number | null | undefined;
294
+ svgSanitize?: boolean | null | undefined;
258
295
  transparency?: "grid" | null | undefined;
259
296
  trimColor?: string | null | undefined;
260
297
  trimcolor?: string | null | undefined;
@@ -285,8 +322,6 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
285
322
  txtfont?: import("imgix-url-builder").Font | null | undefined;
286
323
  txtLead?: number | null | undefined;
287
324
  txtlead?: number | null | undefined;
288
- txtLig?: 0 | 1 | 2 | null | undefined;
289
- txtlig?: 0 | 1 | 2 | null | undefined;
290
325
  txtLineColor?: string | null | undefined;
291
326
  txtlinecolor?: string | null | undefined;
292
327
  txtLineClr?: string | null | undefined;
@@ -308,8 +343,14 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
308
343
  tt?: number | null | undefined;
309
344
  txtWidth?: number | null | undefined;
310
345
  txtwidth?: number | null | undefined;
346
+ txtX?: number | null | undefined;
347
+ txtx?: number | null | undefined;
348
+ txtY?: number | null | undefined;
349
+ txty?: number | null | undefined;
311
350
  txt?: string | null | undefined;
312
351
  t?: string | null | undefined;
352
+ upscaleFallback?: boolean | null | undefined;
353
+ upscale?: boolean | null | undefined;
313
354
  usm?: number | null | undefined;
314
355
  usmrad?: number | null | undefined;
315
356
  vib?: number | null | undefined;
@@ -362,6 +403,14 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
362
403
  imgixParams?: {
363
404
  ar?: `${number}:${number}` | null | undefined;
364
405
  auto?: ("true" | "enhance" | "format" | "redeye" | "compress")[] | null | undefined;
406
+ bgRemoveFallback?: boolean | null | undefined;
407
+ bgRemove?: boolean | null | undefined;
408
+ backgroundRemove?: boolean | null | undefined;
409
+ bgReplaceFallback?: boolean | null | undefined;
410
+ bgReplaceNegPrompt?: string | null | undefined;
411
+ backgroundReplaceNegativePrompt?: string | null | undefined;
412
+ bgReplace?: string | null | undefined;
413
+ backgroundReplace?: string | null | undefined;
365
414
  bg?: string | null | undefined;
366
415
  blendAlign?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
367
416
  blendalign?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
@@ -418,7 +467,7 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
418
467
  con?: number | null | undefined;
419
468
  cornerRadius?: number | [number, number, number, number] | null | undefined;
420
469
  crop?: ("faces" | "top" | "bottom" | "left" | "right" | "entropy" | "edges" | "focalpoint")[] | null | undefined;
421
- cs?: "srgb" | "adobergb1998" | "tinysrgb" | "strip" | null | undefined;
470
+ cs?: "origin" | "srgb" | "adobergb1998" | "tinysrgb" | "strip" | null | undefined;
422
471
  dl?: string | null | undefined;
423
472
  dpi?: number | null | undefined;
424
473
  dpr?: number | null | undefined;
@@ -431,7 +480,25 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
431
480
  faces?: 1 | null | undefined;
432
481
  fillColor?: string | null | undefined;
433
482
  fillcolor?: string | null | undefined;
434
- fill?: "blur" | "solid" | null | undefined;
483
+ fillGenFallback?: boolean | null | undefined;
484
+ fillGenerativeFallback?: boolean | null | undefined;
485
+ fillGenNegPrompt?: string | null | undefined;
486
+ fillGenerativeNegativePrompt?: string | null | undefined;
487
+ fillGenPos?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
488
+ fillGenerativePosition?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
489
+ fillGenPrompt?: string | null | undefined;
490
+ fillGenerativePrompt?: string | null | undefined;
491
+ fillGenSeed?: number | null | undefined;
492
+ fillGenerativeSeed?: number | null | undefined;
493
+ fillGradientCs?: "srgb" | "linear" | "oklab" | "hsl" | "lch" | null | undefined;
494
+ fillGradientLinearDirection?: ("top" | "bottom" | "left" | "right")[] | null | undefined;
495
+ fillGradientLinear?: [string, string] | null | undefined;
496
+ fillGradientRadialRadius?: [number, number] | null | undefined;
497
+ fillGradientRadialX?: number | null | undefined;
498
+ fillGradientRadialY?: number | null | undefined;
499
+ fillGradientRadial?: [string, string] | null | undefined;
500
+ fillGradientType?: "linear" | "radial" | null | undefined;
501
+ fill?: "blur" | "solid" | "gen" | "generative" | "gradient" | null | undefined;
435
502
  fit?: "crop" | "fill" | "clamp" | "clip" | "scale" | "max" | "facearea" | "fillmax" | "min" | null | undefined;
436
503
  f?: "crop" | "fill" | "clamp" | "clip" | "scale" | "max" | "facearea" | "fillmax" | "min" | null | undefined;
437
504
  flip?: "h" | "v" | "hv" | null | undefined;
@@ -440,7 +507,11 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
440
507
  fpX?: number | null | undefined;
441
508
  fpY?: number | null | undefined;
442
509
  fpZ?: number | null | undefined;
510
+ fps?: number | null | undefined;
511
+ frame?: number | import("imgix-url-builder/dist/types.generated").Range | null | undefined;
443
512
  gam?: number | null | undefined;
513
+ gifQ?: number | null | undefined;
514
+ gifq?: number | null | undefined;
444
515
  gridColors?: [string, string] | null | undefined;
445
516
  gridSize?: number | null | undefined;
446
517
  h?: number | null | undefined;
@@ -448,9 +519,13 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
448
519
  high?: number | null | undefined;
449
520
  htn?: number | null | undefined;
450
521
  hue?: number | null | undefined;
522
+ interval?: number | null | undefined;
451
523
  invert?: boolean | null | undefined;
452
524
  inv?: boolean | null | undefined;
453
525
  iptc?: "allow" | "block" | null | undefined;
526
+ jpgProgressive?: boolean | null | undefined;
527
+ jpegProgressive?: boolean | null | undefined;
528
+ loop?: number | null | undefined;
454
529
  lossless?: boolean | null | undefined;
455
530
  markAlign?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
456
531
  ma?: ("top" | "bottom" | "middle" | "left" | "right" | "center")[] | null | undefined;
@@ -518,11 +593,14 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
518
593
  px?: number | null | undefined;
519
594
  q?: number | null | undefined;
520
595
  rect?: [number | "left" | "right" | "center", number | "top" | "bottom" | "middle", number, number] | null | undefined;
596
+ reverse?: boolean | null | undefined;
521
597
  rot?: number | null | undefined;
522
598
  sat?: number | null | undefined;
523
599
  sepia?: number | null | undefined;
524
600
  shad?: number | null | undefined;
525
601
  sharp?: number | null | undefined;
602
+ skip?: number | null | undefined;
603
+ svgSanitize?: boolean | null | undefined;
526
604
  transparency?: "grid" | null | undefined;
527
605
  trimColor?: string | null | undefined;
528
606
  trimcolor?: string | null | undefined;
@@ -553,8 +631,6 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
553
631
  txtfont?: import("imgix-url-builder").Font | null | undefined;
554
632
  txtLead?: number | null | undefined;
555
633
  txtlead?: number | null | undefined;
556
- txtLig?: 0 | 1 | 2 | null | undefined;
557
- txtlig?: 0 | 1 | 2 | null | undefined;
558
634
  txtLineColor?: string | null | undefined;
559
635
  txtlinecolor?: string | null | undefined;
560
636
  txtLineClr?: string | null | undefined;
@@ -576,8 +652,14 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<Re
576
652
  tt?: number | null | undefined;
577
653
  txtWidth?: number | null | undefined;
578
654
  txtwidth?: number | null | undefined;
655
+ txtX?: number | null | undefined;
656
+ txtx?: number | null | undefined;
657
+ txtY?: number | null | undefined;
658
+ txty?: number | null | undefined;
579
659
  txt?: string | null | undefined;
580
660
  t?: string | null | undefined;
661
+ upscaleFallback?: boolean | null | undefined;
662
+ upscale?: boolean | null | undefined;
581
663
  usm?: number | null | undefined;
582
664
  usmrad?: number | null | undefined;
583
665
  vib?: number | null | undefined;
@@ -4,7 +4,6 @@
4
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
5
5
  const React = require("react");
6
6
  const getToolbarSrc = require('./_node_modules/@prismicio/client/dist/getToolbarSrc.cjs');
7
- require("@prismicio/richtext");
8
7
  function _interopNamespaceDefault(e) {
9
8
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
10
9
  if (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicToolbar.cjs","sources":["../../src/PrismicToolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { getToolbarSrc } from \"@prismicio/client\";\n\n/**\n * Props for `<PrismicToolbar>`.\n */\nexport type PrismicToolbarProps = {\n\t/**\n\t * The name of the Prismic repository. For example, `\"my-repo\"` if the\n\t * repository URL is `my-repo.prismic.io`.\n\t */\n\trepositoryName: string;\n\n\t/**\n\t * The type of toolbar needed for the repository. Defaults to `\"new\"`.\n\t *\n\t * @deprecated All repositories use the \"new\"-type toolbar. This option can be\n\t * removed.\n\t * @see To check which version you need, view the Prismic Toolbar documentation {@link https://prismic.io/docs/technologies/previews-and-the-prismic-toolbar-reactjs}\n\t */\n\ttype?: \"new\" | \"legacy\";\n};\n\n/**\n * React component that injects the Prismic Toolbar into the app. This component\n * can be placed anywhere in the React tree.\n */\nexport const PrismicToolbar = ({\n\trepositoryName,\n}: PrismicToolbarProps): null => {\n\tconst src = getToolbarSrc(repositoryName);\n\n\tReact.useEffect(() => {\n\t\tconst existingScript = document.querySelector(`script[src=\"${src}\"]`);\n\n\t\tif (!existingScript) {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.src = src;\n\t\t\tscript.defer = true;\n\n\t\t\t// Used to distinguish the toolbar element from other elements.\n\t\t\tscript.dataset.prismicToolbar = \"\";\n\t\t\tscript.dataset.repositoryName = repositoryName;\n\n\t\t\t// Disable Happy DOM `<script>` evaluation during\n\t\t\t// tests.\n\t\t\t//\n\t\t\t// This is a patch ONLY INCLUDED DURING TESTS. It will\n\t\t\t// be pruned during code minification in non-test\n\t\t\t// environments.\n\t\t\t//\n\t\t\t// @see https://github.com/capricorn86/happy-dom/blob/02ae081e36f990c06171eda44f9d885fd9413d73/packages/happy-dom/src/nodes/html-script-element/HTMLScriptElement.ts#L191-L209\n\t\t\tif (typeof process !== \"undefined\" && process.env.NODE_ENV === \"test\") {\n\t\t\t\t// @ts-expect-error - `_evaluateScript` is a Happy DOM-specific property.\n\t\t\t\tscript._evaluateScript = false;\n\t\t\t}\n\n\t\t\tdocument.body.appendChild(script);\n\t\t}\n\t}, [repositoryName, src]);\n\n\treturn null;\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA6BO;AAGA;AAENA;AACC;AAEA;AACO;AACN;AACA;AAGA;AACA;AAUA;AAEC;AAAyB;AAGjB;AAAuB;AAChC;AAGK;AACR;;"}
1
+ {"version":3,"file":"PrismicToolbar.cjs","sources":["../../src/PrismicToolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { getToolbarSrc } from \"@prismicio/client\";\n\n/**\n * Props for `<PrismicToolbar>`.\n */\nexport type PrismicToolbarProps = {\n\t/**\n\t * The name of the Prismic repository. For example, `\"my-repo\"` if the\n\t * repository URL is `my-repo.prismic.io`.\n\t */\n\trepositoryName: string;\n\n\t/**\n\t * The type of toolbar needed for the repository. Defaults to `\"new\"`.\n\t *\n\t * @deprecated All repositories use the \"new\"-type toolbar. This option can be\n\t * removed.\n\t * @see To check which version you need, view the Prismic Toolbar documentation {@link https://prismic.io/docs/technologies/previews-and-the-prismic-toolbar-reactjs}\n\t */\n\ttype?: \"new\" | \"legacy\";\n};\n\n/**\n * React component that injects the Prismic Toolbar into the app. This component\n * can be placed anywhere in the React tree.\n */\nexport const PrismicToolbar = ({\n\trepositoryName,\n}: PrismicToolbarProps): null => {\n\tconst src = getToolbarSrc(repositoryName);\n\n\tReact.useEffect(() => {\n\t\tconst existingScript = document.querySelector(`script[src=\"${src}\"]`);\n\n\t\tif (!existingScript) {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.src = src;\n\t\t\tscript.defer = true;\n\n\t\t\t// Used to distinguish the toolbar element from other elements.\n\t\t\tscript.dataset.prismicToolbar = \"\";\n\t\t\tscript.dataset.repositoryName = repositoryName;\n\n\t\t\t// Disable Happy DOM `<script>` evaluation during\n\t\t\t// tests.\n\t\t\t//\n\t\t\t// This is a patch ONLY INCLUDED DURING TESTS. It will\n\t\t\t// be pruned during code minification in non-test\n\t\t\t// environments.\n\t\t\t//\n\t\t\t// @see https://github.com/capricorn86/happy-dom/blob/02ae081e36f990c06171eda44f9d885fd9413d73/packages/happy-dom/src/nodes/html-script-element/HTMLScriptElement.ts#L191-L209\n\t\t\tif (typeof process !== \"undefined\" && process.env.NODE_ENV === \"test\") {\n\t\t\t\t// @ts-expect-error - `_evaluateScript` is a Happy DOM-specific property.\n\t\t\t\tscript._evaluateScript = false;\n\t\t\t}\n\n\t\t\tdocument.body.appendChild(script);\n\t\t}\n\t}, [repositoryName, src]);\n\n\treturn null;\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6BO;AAGA;AAENA;AACC;AAEA;AACO;AACN;AACA;AAGA;AACA;AAUA;AAEC;AAAyB;AAGjB;AAAuB;AAChC;AAGK;AACR;;"}
@@ -2,7 +2,6 @@
2
2
  'use client';
3
3
  import * as React from "react";
4
4
  import { getToolbarSrc } from './_node_modules/@prismicio/client/dist/getToolbarSrc.js';
5
- import "@prismicio/richtext";
6
5
  const PrismicToolbar = ({ repositoryName }) => {
7
6
  const src = getToolbarSrc(repositoryName);
8
7
  React.useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicToolbar.js","sources":["../../src/PrismicToolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { getToolbarSrc } from \"@prismicio/client\";\n\n/**\n * Props for `<PrismicToolbar>`.\n */\nexport type PrismicToolbarProps = {\n\t/**\n\t * The name of the Prismic repository. For example, `\"my-repo\"` if the\n\t * repository URL is `my-repo.prismic.io`.\n\t */\n\trepositoryName: string;\n\n\t/**\n\t * The type of toolbar needed for the repository. Defaults to `\"new\"`.\n\t *\n\t * @deprecated All repositories use the \"new\"-type toolbar. This option can be\n\t * removed.\n\t * @see To check which version you need, view the Prismic Toolbar documentation {@link https://prismic.io/docs/technologies/previews-and-the-prismic-toolbar-reactjs}\n\t */\n\ttype?: \"new\" | \"legacy\";\n};\n\n/**\n * React component that injects the Prismic Toolbar into the app. This component\n * can be placed anywhere in the React tree.\n */\nexport const PrismicToolbar = ({\n\trepositoryName,\n}: PrismicToolbarProps): null => {\n\tconst src = getToolbarSrc(repositoryName);\n\n\tReact.useEffect(() => {\n\t\tconst existingScript = document.querySelector(`script[src=\"${src}\"]`);\n\n\t\tif (!existingScript) {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.src = src;\n\t\t\tscript.defer = true;\n\n\t\t\t// Used to distinguish the toolbar element from other elements.\n\t\t\tscript.dataset.prismicToolbar = \"\";\n\t\t\tscript.dataset.repositoryName = repositoryName;\n\n\t\t\t// Disable Happy DOM `<script>` evaluation during\n\t\t\t// tests.\n\t\t\t//\n\t\t\t// This is a patch ONLY INCLUDED DURING TESTS. It will\n\t\t\t// be pruned during code minification in non-test\n\t\t\t// environments.\n\t\t\t//\n\t\t\t// @see https://github.com/capricorn86/happy-dom/blob/02ae081e36f990c06171eda44f9d885fd9413d73/packages/happy-dom/src/nodes/html-script-element/HTMLScriptElement.ts#L191-L209\n\t\t\tif (typeof process !== \"undefined\" && process.env.NODE_ENV === \"test\") {\n\t\t\t\t// @ts-expect-error - `_evaluateScript` is a Happy DOM-specific property.\n\t\t\t\tscript._evaluateScript = false;\n\t\t\t}\n\n\t\t\tdocument.body.appendChild(script);\n\t\t}\n\t}, [repositoryName, src]);\n\n\treturn null;\n};\n"],"names":[],"mappings":";;;;;AA6BO;AAGA;AAEN;AACC;AAEA;AACO;AACN;AACA;AAGA;AACA;AAUA;AAEC;AAAyB;AAGjB;AAAuB;AAChC;AAGK;AACR;;;;"}
1
+ {"version":3,"file":"PrismicToolbar.js","sources":["../../src/PrismicToolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { getToolbarSrc } from \"@prismicio/client\";\n\n/**\n * Props for `<PrismicToolbar>`.\n */\nexport type PrismicToolbarProps = {\n\t/**\n\t * The name of the Prismic repository. For example, `\"my-repo\"` if the\n\t * repository URL is `my-repo.prismic.io`.\n\t */\n\trepositoryName: string;\n\n\t/**\n\t * The type of toolbar needed for the repository. Defaults to `\"new\"`.\n\t *\n\t * @deprecated All repositories use the \"new\"-type toolbar. This option can be\n\t * removed.\n\t * @see To check which version you need, view the Prismic Toolbar documentation {@link https://prismic.io/docs/technologies/previews-and-the-prismic-toolbar-reactjs}\n\t */\n\ttype?: \"new\" | \"legacy\";\n};\n\n/**\n * React component that injects the Prismic Toolbar into the app. This component\n * can be placed anywhere in the React tree.\n */\nexport const PrismicToolbar = ({\n\trepositoryName,\n}: PrismicToolbarProps): null => {\n\tconst src = getToolbarSrc(repositoryName);\n\n\tReact.useEffect(() => {\n\t\tconst existingScript = document.querySelector(`script[src=\"${src}\"]`);\n\n\t\tif (!existingScript) {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.src = src;\n\t\t\tscript.defer = true;\n\n\t\t\t// Used to distinguish the toolbar element from other elements.\n\t\t\tscript.dataset.prismicToolbar = \"\";\n\t\t\tscript.dataset.repositoryName = repositoryName;\n\n\t\t\t// Disable Happy DOM `<script>` evaluation during\n\t\t\t// tests.\n\t\t\t//\n\t\t\t// This is a patch ONLY INCLUDED DURING TESTS. It will\n\t\t\t// be pruned during code minification in non-test\n\t\t\t// environments.\n\t\t\t//\n\t\t\t// @see https://github.com/capricorn86/happy-dom/blob/02ae081e36f990c06171eda44f9d885fd9413d73/packages/happy-dom/src/nodes/html-script-element/HTMLScriptElement.ts#L191-L209\n\t\t\tif (typeof process !== \"undefined\" && process.env.NODE_ENV === \"test\") {\n\t\t\t\t// @ts-expect-error - `_evaluateScript` is a Happy DOM-specific property.\n\t\t\t\tscript._evaluateScript = false;\n\t\t\t}\n\n\t\t\tdocument.body.appendChild(script);\n\t\t}\n\t}, [repositoryName, src]);\n\n\treturn null;\n};\n"],"names":[],"mappings":";;;;AA6BO;AAGA;AAEN;AACC;AAEA;AACO;AACN;AACA;AAGA;AACA;AAUA;AAEC;AAAyB;AAGjB;AAAuB;AAChC;AAGK;AACR;;;;"}
@@ -2,10 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  var __defProp = Object.defineProperty;
4
4
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
- var __publicField = (obj, key, value) => {
6
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
- return value;
8
- };
5
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9
6
  class PrismicError extends Error {
10
7
  constructor(message = "An invalid API response was returned", url, response) {
11
8
  super(message);
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicError.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/errors/PrismicError.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass PrismicError extends Error {\n constructor(message = \"An invalid API response was returned\", url, response) {\n super(message);\n __publicField(this, \"url\");\n __publicField(this, \"response\");\n this.url = url;\n this.response = response;\n }\n}\nexport {\n PrismicError\n};\n//# sourceMappingURL=PrismicError.js.map\n"],"names":[],"mappings":";;AAAA,IAAI,YAAY,OAAO;AACvB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK,EAAE,YAAY,MAAM,cAAc,MAAM,UAAU,MAAM,MAAO,CAAA,IAAI,IAAI,GAAG,IAAI;AAC1J,IAAI,gBAAgB,CAAC,KAAK,KAAK,UAAU;AACvC,kBAAgB,KAAK,OAAO,QAAQ,WAAW,MAAM,KAAK,KAAK,KAAK;AACpE,SAAO;AACT;AACA,MAAM,qBAAqB,MAAM;AAAA,EAC/B,YAAY,UAAU,wCAAwC,KAAK,UAAU;AAC3E,UAAM,OAAO;AACb,kBAAc,MAAM,KAAK;AACzB,kBAAc,MAAM,UAAU;AAC9B,SAAK,MAAM;AACX,SAAK,WAAW;AAAA,EACjB;AACH;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"PrismicError.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/errors/PrismicError.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nclass PrismicError extends Error {\n constructor(message = \"An invalid API response was returned\", url, response) {\n super(message);\n __publicField(this, \"url\");\n __publicField(this, \"response\");\n this.url = url;\n this.response = response;\n }\n}\nexport {\n PrismicError\n};\n//# sourceMappingURL=PrismicError.js.map\n"],"names":[],"mappings":";;AAAA,IAAI,YAAY,OAAO;AACvB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK,EAAE,YAAY,MAAM,cAAc,MAAM,UAAU,MAAM,MAAO,CAAA,IAAI,IAAI,GAAG,IAAI;AAC1J,IAAI,gBAAgB,CAAC,KAAK,KAAK,UAAU,gBAAgB,KAAK,OAAO,QAAQ,WAAW,MAAM,KAAK,KAAK,KAAK;AAC7G,MAAM,qBAAqB,MAAM;AAAA,EAC/B,YAAY,UAAU,wCAAwC,KAAK,UAAU;AAC3E,UAAM,OAAO;AACb,kBAAc,MAAM,KAAK;AACzB,kBAAc,MAAM,UAAU;AAC9B,SAAK,MAAM;AACX,SAAK,WAAW;AAAA,EACjB;AACH;;","x_google_ignoreList":[0]}
@@ -1,9 +1,6 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
4
  class PrismicError extends Error {
8
5
  constructor(message = "An invalid API response was returned", url, response) {
9
6
  super(message);
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicError.js","sources":["../../../../../../node_modules/@prismicio/client/dist/errors/PrismicError.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass PrismicError extends Error {\n constructor(message = \"An invalid API response was returned\", url, response) {\n super(message);\n __publicField(this, \"url\");\n __publicField(this, \"response\");\n this.url = url;\n this.response = response;\n }\n}\nexport {\n PrismicError\n};\n//# sourceMappingURL=PrismicError.js.map\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,OAAO;AACvB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK,EAAE,YAAY,MAAM,cAAc,MAAM,UAAU,MAAM,MAAO,CAAA,IAAI,IAAI,GAAG,IAAI;AAC1J,IAAI,gBAAgB,CAAC,KAAK,KAAK,UAAU;AACvC,kBAAgB,KAAK,OAAO,QAAQ,WAAW,MAAM,KAAK,KAAK,KAAK;AACpE,SAAO;AACT;AACA,MAAM,qBAAqB,MAAM;AAAA,EAC/B,YAAY,UAAU,wCAAwC,KAAK,UAAU;AAC3E,UAAM,OAAO;AACb,kBAAc,MAAM,KAAK;AACzB,kBAAc,MAAM,UAAU;AAC9B,SAAK,MAAM;AACX,SAAK,WAAW;AAAA,EACjB;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"PrismicError.js","sources":["../../../../../../node_modules/@prismicio/client/dist/errors/PrismicError.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nclass PrismicError extends Error {\n constructor(message = \"An invalid API response was returned\", url, response) {\n super(message);\n __publicField(this, \"url\");\n __publicField(this, \"response\");\n this.url = url;\n this.response = response;\n }\n}\nexport {\n PrismicError\n};\n//# sourceMappingURL=PrismicError.js.map\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,OAAO;AACvB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK,EAAE,YAAY,MAAM,cAAc,MAAM,UAAU,MAAM,MAAO,CAAA,IAAI,IAAI,GAAG,IAAI;AAC1J,IAAI,gBAAgB,CAAC,KAAK,KAAK,UAAU,gBAAgB,KAAK,OAAO,QAAQ,WAAW,MAAM,KAAK,KAAK,KAAK;AAC7G,MAAM,qBAAqB,MAAM;AAAA,EAC/B,YAAY,UAAU,wCAAwC,KAAK,UAAU;AAC3E,UAAM,OAAO;AACb,kBAAc,MAAM,KAAK;AACzB,kBAAc,MAAM,UAAU;AAC9B,SAAK,MAAM;AACX,SAAK,WAAW;AAAA,EACjB;AACH;","x_google_ignoreList":[0]}
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../imgix-url-builder/dist/index.cjs");
3
+ const buildURL = require("../../../../imgix-url-builder/dist/buildURL.cjs");
4
+ const buildPixelDensitySrcSet = require("../../../../imgix-url-builder/dist/buildPixelDensitySrcSet.cjs");
4
5
  const isFilled = require("./isFilled.cjs");
5
6
  const DEFAULT_PIXEL_DENSITIES = [1, 2, 3];
6
7
  const asImagePixelDensitySrcSet = (field, config = {}) => {
7
8
  if (field && isFilled.imageThumbnail(field)) {
8
9
  const { pixelDensities = DEFAULT_PIXEL_DENSITIES, ...imgixParams } = config;
9
10
  return {
10
- src: index.buildURL(field.url, imgixParams),
11
- srcset: index.buildPixelDensitySrcSet(field.url, {
11
+ src: buildURL.buildURL(field.url, imgixParams),
12
+ srcset: buildPixelDensitySrcSet.buildPixelDensitySrcSet(field.url, {
12
13
  ...imgixParams,
13
14
  pixelDensities
14
15
  })
@@ -1 +1 @@
1
- {"version":3,"file":"asImagePixelDensitySrcSet.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.js"],"sourcesContent":["import { buildURL, buildPixelDensitySrcSet } from \"imgix-url-builder\";\nimport { imageThumbnail } from \"./isFilled.js\";\nconst DEFAULT_PIXEL_DENSITIES = [1, 2, 3];\nconst asImagePixelDensitySrcSet = (field, config = {}) => {\n if (field && imageThumbnail(field)) {\n const { pixelDensities = DEFAULT_PIXEL_DENSITIES, ...imgixParams } = config;\n return {\n src: buildURL(field.url, imgixParams),\n srcset: buildPixelDensitySrcSet(field.url, {\n ...imgixParams,\n pixelDensities\n })\n };\n } else {\n return null;\n }\n};\nexport {\n asImagePixelDensitySrcSet\n};\n//# sourceMappingURL=asImagePixelDensitySrcSet.js.map\n"],"names":["imageThumbnail","buildURL","buildPixelDensitySrcSet"],"mappings":";;;;AAEA,MAAM,0BAA0B,CAAC,GAAG,GAAG,CAAC;AACnC,MAAC,4BAA4B,CAAC,OAAO,SAAS,OAAO;AACxD,MAAI,SAASA,wBAAe,KAAK,GAAG;AAClC,UAAM,EAAE,iBAAiB,yBAAyB,GAAG,YAAW,IAAK;AACrE,WAAO;AAAA,MACL,KAAKC,MAAQ,SAAC,MAAM,KAAK,WAAW;AAAA,MACpC,QAAQC,MAAAA,wBAAwB,MAAM,KAAK;AAAA,QACzC,GAAG;AAAA,QACH;AAAA,MACR,CAAO;AAAA,IACP;AAAA,EACA,OAAS;AACL,WAAO;AAAA,EACR;AACH;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"asImagePixelDensitySrcSet.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.js"],"sourcesContent":["import { buildURL, buildPixelDensitySrcSet } from \"imgix-url-builder\";\nimport { imageThumbnail } from \"./isFilled.js\";\nconst DEFAULT_PIXEL_DENSITIES = [1, 2, 3];\nconst asImagePixelDensitySrcSet = (field, config = {}) => {\n if (field && imageThumbnail(field)) {\n const { pixelDensities = DEFAULT_PIXEL_DENSITIES, ...imgixParams } = config;\n return {\n src: buildURL(field.url, imgixParams),\n srcset: buildPixelDensitySrcSet(field.url, {\n ...imgixParams,\n pixelDensities\n })\n };\n } else {\n return null;\n }\n};\nexport {\n asImagePixelDensitySrcSet\n};\n//# sourceMappingURL=asImagePixelDensitySrcSet.js.map\n"],"names":["imageThumbnail","buildURL","buildPixelDensitySrcSet"],"mappings":";;;;;AAEA,MAAM,0BAA0B,CAAC,GAAG,GAAG,CAAC;AACnC,MAAC,4BAA4B,CAAC,OAAO,SAAS,OAAO;AACxD,MAAI,SAASA,wBAAe,KAAK,GAAG;AAClC,UAAM,EAAE,iBAAiB,yBAAyB,GAAG,YAAW,IAAK;AACrE,WAAO;AAAA,MACL,KAAKC,SAAQ,SAAC,MAAM,KAAK,WAAW;AAAA,MACpC,QAAQC,wBAAAA,wBAAwB,MAAM,KAAK;AAAA,QACzC,GAAG;AAAA,QACH;AAAA,MACR,CAAO;AAAA,IACP;AAAA,EACA,OAAS;AACL,WAAO;AAAA,EACR;AACH;;","x_google_ignoreList":[0]}
@@ -1,4 +1,5 @@
1
- import { buildURL, buildPixelDensitySrcSet } from "../../../../imgix-url-builder/dist/index.js";
1
+ import { buildURL } from "../../../../imgix-url-builder/dist/buildURL.js";
2
+ import { buildPixelDensitySrcSet } from "../../../../imgix-url-builder/dist/buildPixelDensitySrcSet.js";
2
3
  import { imageThumbnail } from "./isFilled.js";
3
4
  const DEFAULT_PIXEL_DENSITIES = [1, 2, 3];
4
5
  const asImagePixelDensitySrcSet = (field, config = {}) => {
@@ -1 +1 @@
1
- {"version":3,"file":"asImagePixelDensitySrcSet.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.js"],"sourcesContent":["import { buildURL, buildPixelDensitySrcSet } from \"imgix-url-builder\";\nimport { imageThumbnail } from \"./isFilled.js\";\nconst DEFAULT_PIXEL_DENSITIES = [1, 2, 3];\nconst asImagePixelDensitySrcSet = (field, config = {}) => {\n if (field && imageThumbnail(field)) {\n const { pixelDensities = DEFAULT_PIXEL_DENSITIES, ...imgixParams } = config;\n return {\n src: buildURL(field.url, imgixParams),\n srcset: buildPixelDensitySrcSet(field.url, {\n ...imgixParams,\n pixelDensities\n })\n };\n } else {\n return null;\n }\n};\nexport {\n asImagePixelDensitySrcSet\n};\n//# sourceMappingURL=asImagePixelDensitySrcSet.js.map\n"],"names":[],"mappings":";;AAEA,MAAM,0BAA0B,CAAC,GAAG,GAAG,CAAC;AACnC,MAAC,4BAA4B,CAAC,OAAO,SAAS,OAAO;AACxD,MAAI,SAAS,eAAe,KAAK,GAAG;AAClC,UAAM,EAAE,iBAAiB,yBAAyB,GAAG,YAAW,IAAK;AACrE,WAAO;AAAA,MACL,KAAK,SAAS,MAAM,KAAK,WAAW;AAAA,MACpC,QAAQ,wBAAwB,MAAM,KAAK;AAAA,QACzC,GAAG;AAAA,QACH;AAAA,MACR,CAAO;AAAA,IACP;AAAA,EACA,OAAS;AACL,WAAO;AAAA,EACR;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"asImagePixelDensitySrcSet.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.js"],"sourcesContent":["import { buildURL, buildPixelDensitySrcSet } from \"imgix-url-builder\";\nimport { imageThumbnail } from \"./isFilled.js\";\nconst DEFAULT_PIXEL_DENSITIES = [1, 2, 3];\nconst asImagePixelDensitySrcSet = (field, config = {}) => {\n if (field && imageThumbnail(field)) {\n const { pixelDensities = DEFAULT_PIXEL_DENSITIES, ...imgixParams } = config;\n return {\n src: buildURL(field.url, imgixParams),\n srcset: buildPixelDensitySrcSet(field.url, {\n ...imgixParams,\n pixelDensities\n })\n };\n } else {\n return null;\n }\n};\nexport {\n asImagePixelDensitySrcSet\n};\n//# sourceMappingURL=asImagePixelDensitySrcSet.js.map\n"],"names":[],"mappings":";;;AAEA,MAAM,0BAA0B,CAAC,GAAG,GAAG,CAAC;AACnC,MAAC,4BAA4B,CAAC,OAAO,SAAS,OAAO;AACxD,MAAI,SAAS,eAAe,KAAK,GAAG;AAClC,UAAM,EAAE,iBAAiB,yBAAyB,GAAG,YAAW,IAAK;AACrE,WAAO;AAAA,MACL,KAAK,SAAS,MAAM,KAAK,WAAW;AAAA,MACpC,QAAQ,wBAAwB,MAAM,KAAK;AAAA,QACzC,GAAG;AAAA,QACH;AAAA,MACR,CAAO;AAAA,IACP;AAAA,EACA,OAAS;AACL,WAAO;AAAA,EACR;AACH;","x_google_ignoreList":[0]}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../imgix-url-builder/dist/index.cjs");
3
+ const buildURL = require("../../../../imgix-url-builder/dist/buildURL.cjs");
4
+ const buildWidthSrcSet = require("../../../../imgix-url-builder/dist/buildWidthSrcSet.cjs");
4
5
  const isFilled = require("./isFilled.cjs");
5
6
  const DEFAULT_WIDTHS = [640, 828, 1200, 2048, 3840];
6
7
  const asImageWidthSrcSet = (field, config = {}) => {
@@ -10,28 +11,28 @@ const asImageWidthSrcSet = (field, config = {}) => {
10
11
  // eslint-disable-next-line prefer-const
11
12
  ...imgixParams
12
13
  } = config;
13
- const { url, dimensions, alt: _alt, copyright: _copyright, ...responsiveViews } = field;
14
+ const { url, dimensions, id: _id, alt: _alt, copyright: _copyright, edit: _edit, ...responsiveViews } = field;
14
15
  const responsiveViewObjects = Object.values(responsiveViews);
15
16
  if (widths === "thumbnails" && responsiveViewObjects.length < 1) {
16
17
  widths = DEFAULT_WIDTHS;
17
18
  }
18
19
  return {
19
- src: index.buildURL(url, imgixParams),
20
+ src: buildURL.buildURL(url, imgixParams),
20
21
  srcset: (
21
22
  // By this point, we know `widths` can only be
22
23
  // `"thubmanils"` if the field has thumbnails.
23
24
  widths === "thumbnails" ? [
24
- index.buildWidthSrcSet(url, {
25
+ buildWidthSrcSet.buildWidthSrcSet(url, {
25
26
  ...imgixParams,
26
27
  widths: [dimensions.width]
27
28
  }),
28
29
  ...responsiveViewObjects.map((thumbnail) => {
29
- return index.buildWidthSrcSet(thumbnail.url, {
30
+ return buildWidthSrcSet.buildWidthSrcSet(thumbnail.url, {
30
31
  ...imgixParams,
31
32
  widths: [thumbnail.dimensions.width]
32
33
  });
33
34
  })
34
- ].join(", ") : index.buildWidthSrcSet(field.url, {
35
+ ].join(", ") : buildWidthSrcSet.buildWidthSrcSet(field.url, {
35
36
  ...imgixParams,
36
37
  widths
37
38
  })
@@ -1 +1 @@
1
- {"version":3,"file":"asImageWidthSrcSet.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.js"],"sourcesContent":["import { buildURL, buildWidthSrcSet } from \"imgix-url-builder\";\nimport { imageThumbnail } from \"./isFilled.js\";\nconst DEFAULT_WIDTHS = [640, 828, 1200, 2048, 3840];\nconst asImageWidthSrcSet = (field, config = {}) => {\n if (field && imageThumbnail(field)) {\n let {\n widths = DEFAULT_WIDTHS,\n // eslint-disable-next-line prefer-const\n ...imgixParams\n } = config;\n const { url, dimensions, alt: _alt, copyright: _copyright, ...responsiveViews } = field;\n const responsiveViewObjects = Object.values(responsiveViews);\n if (widths === \"thumbnails\" && responsiveViewObjects.length < 1) {\n widths = DEFAULT_WIDTHS;\n }\n return {\n src: buildURL(url, imgixParams),\n srcset: (\n // By this point, we know `widths` can only be\n // `\"thubmanils\"` if the field has thumbnails.\n widths === \"thumbnails\" ? [\n buildWidthSrcSet(url, {\n ...imgixParams,\n widths: [dimensions.width]\n }),\n ...responsiveViewObjects.map((thumbnail) => {\n return buildWidthSrcSet(thumbnail.url, {\n ...imgixParams,\n widths: [thumbnail.dimensions.width]\n });\n })\n ].join(\", \") : buildWidthSrcSet(field.url, {\n ...imgixParams,\n widths\n })\n )\n };\n } else {\n return null;\n }\n};\nexport {\n asImageWidthSrcSet\n};\n//# sourceMappingURL=asImageWidthSrcSet.js.map\n"],"names":["imageThumbnail","buildURL","buildWidthSrcSet"],"mappings":";;;;AAEA,MAAM,iBAAiB,CAAC,KAAK,KAAK,MAAM,MAAM,IAAI;AAC7C,MAAC,qBAAqB,CAAC,OAAO,SAAS,OAAO;AACjD,MAAI,SAASA,wBAAe,KAAK,GAAG;AAClC,QAAI;AAAA,MACF,SAAS;AAAA;AAAA,MAET,GAAG;AAAA,IACJ,IAAG;AACJ,UAAM,EAAE,KAAK,YAAY,KAAK,MAAM,WAAW,YAAY,GAAG,gBAAiB,IAAG;AAClF,UAAM,wBAAwB,OAAO,OAAO,eAAe;AAC3D,QAAI,WAAW,gBAAgB,sBAAsB,SAAS,GAAG;AAC/D,eAAS;AAAA,IACV;AACD,WAAO;AAAA,MACL,KAAKC,MAAAA,SAAS,KAAK,WAAW;AAAA,MAC9B;AAAA;AAAA;AAAA,QAGE,WAAW,eAAe;AAAA,UACxBC,MAAAA,iBAAiB,KAAK;AAAA,YACpB,GAAG;AAAA,YACH,QAAQ,CAAC,WAAW,KAAK;AAAA,UACrC,CAAW;AAAA,UACD,GAAG,sBAAsB,IAAI,CAAC,cAAc;AAC1C,mBAAOA,MAAgB,iBAAC,UAAU,KAAK;AAAA,cACrC,GAAG;AAAA,cACH,QAAQ,CAAC,UAAU,WAAW,KAAK;AAAA,YACjD,CAAa;AAAA,UACb,CAAW;AAAA,QACF,EAAC,KAAK,IAAI,IAAIA,MAAAA,iBAAiB,MAAM,KAAK;AAAA,UACzC,GAAG;AAAA,UACH;AAAA,QACV,CAAS;AAAA;AAAA,IAET;AAAA,EACA,OAAS;AACL,WAAO;AAAA,EACR;AACH;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"asImageWidthSrcSet.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.js"],"sourcesContent":["import { buildURL, buildWidthSrcSet } from \"imgix-url-builder\";\nimport { imageThumbnail } from \"./isFilled.js\";\nconst DEFAULT_WIDTHS = [640, 828, 1200, 2048, 3840];\nconst asImageWidthSrcSet = (field, config = {}) => {\n if (field && imageThumbnail(field)) {\n let {\n widths = DEFAULT_WIDTHS,\n // eslint-disable-next-line prefer-const\n ...imgixParams\n } = config;\n const { url, dimensions, id: _id, alt: _alt, copyright: _copyright, edit: _edit, ...responsiveViews } = field;\n const responsiveViewObjects = Object.values(responsiveViews);\n if (widths === \"thumbnails\" && responsiveViewObjects.length < 1) {\n widths = DEFAULT_WIDTHS;\n }\n return {\n src: buildURL(url, imgixParams),\n srcset: (\n // By this point, we know `widths` can only be\n // `\"thubmanils\"` if the field has thumbnails.\n widths === \"thumbnails\" ? [\n buildWidthSrcSet(url, {\n ...imgixParams,\n widths: [dimensions.width]\n }),\n ...responsiveViewObjects.map((thumbnail) => {\n return buildWidthSrcSet(thumbnail.url, {\n ...imgixParams,\n widths: [thumbnail.dimensions.width]\n });\n })\n ].join(\", \") : buildWidthSrcSet(field.url, {\n ...imgixParams,\n widths\n })\n )\n };\n } else {\n return null;\n }\n};\nexport {\n asImageWidthSrcSet\n};\n//# sourceMappingURL=asImageWidthSrcSet.js.map\n"],"names":["imageThumbnail","buildURL","buildWidthSrcSet"],"mappings":";;;;;AAEA,MAAM,iBAAiB,CAAC,KAAK,KAAK,MAAM,MAAM,IAAI;AAC7C,MAAC,qBAAqB,CAAC,OAAO,SAAS,OAAO;AACjD,MAAI,SAASA,wBAAe,KAAK,GAAG;AAClC,QAAI;AAAA,MACF,SAAS;AAAA;AAAA,MAET,GAAG;AAAA,IACJ,IAAG;AACJ,UAAM,EAAE,KAAK,YAAY,IAAI,KAAK,KAAK,MAAM,WAAW,YAAY,MAAM,OAAO,GAAG,gBAAe,IAAK;AACxG,UAAM,wBAAwB,OAAO,OAAO,eAAe;AAC3D,QAAI,WAAW,gBAAgB,sBAAsB,SAAS,GAAG;AAC/D,eAAS;AAAA,IACV;AACD,WAAO;AAAA,MACL,KAAKC,SAAAA,SAAS,KAAK,WAAW;AAAA,MAC9B;AAAA;AAAA;AAAA,QAGE,WAAW,eAAe;AAAA,UACxBC,iBAAAA,iBAAiB,KAAK;AAAA,YACpB,GAAG;AAAA,YACH,QAAQ,CAAC,WAAW,KAAK;AAAA,UACrC,CAAW;AAAA,UACD,GAAG,sBAAsB,IAAI,CAAC,cAAc;AAC1C,mBAAOA,iBAAgB,iBAAC,UAAU,KAAK;AAAA,cACrC,GAAG;AAAA,cACH,QAAQ,CAAC,UAAU,WAAW,KAAK;AAAA,YACjD,CAAa;AAAA,UACb,CAAW;AAAA,QACF,EAAC,KAAK,IAAI,IAAIA,iBAAAA,iBAAiB,MAAM,KAAK;AAAA,UACzC,GAAG;AAAA,UACH;AAAA,QACV,CAAS;AAAA;AAAA,IAET;AAAA,EACA,OAAS;AACL,WAAO;AAAA,EACR;AACH;;","x_google_ignoreList":[0]}
@@ -1,4 +1,5 @@
1
- import { buildURL, buildWidthSrcSet } from "../../../../imgix-url-builder/dist/index.js";
1
+ import { buildURL } from "../../../../imgix-url-builder/dist/buildURL.js";
2
+ import { buildWidthSrcSet } from "../../../../imgix-url-builder/dist/buildWidthSrcSet.js";
2
3
  import { imageThumbnail } from "./isFilled.js";
3
4
  const DEFAULT_WIDTHS = [640, 828, 1200, 2048, 3840];
4
5
  const asImageWidthSrcSet = (field, config = {}) => {
@@ -8,7 +9,7 @@ const asImageWidthSrcSet = (field, config = {}) => {
8
9
  // eslint-disable-next-line prefer-const
9
10
  ...imgixParams
10
11
  } = config;
11
- const { url, dimensions, alt: _alt, copyright: _copyright, ...responsiveViews } = field;
12
+ const { url, dimensions, id: _id, alt: _alt, copyright: _copyright, edit: _edit, ...responsiveViews } = field;
12
13
  const responsiveViewObjects = Object.values(responsiveViews);
13
14
  if (widths === "thumbnails" && responsiveViewObjects.length < 1) {
14
15
  widths = DEFAULT_WIDTHS;
@@ -1 +1 @@
1
- {"version":3,"file":"asImageWidthSrcSet.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.js"],"sourcesContent":["import { buildURL, buildWidthSrcSet } from \"imgix-url-builder\";\nimport { imageThumbnail } from \"./isFilled.js\";\nconst DEFAULT_WIDTHS = [640, 828, 1200, 2048, 3840];\nconst asImageWidthSrcSet = (field, config = {}) => {\n if (field && imageThumbnail(field)) {\n let {\n widths = DEFAULT_WIDTHS,\n // eslint-disable-next-line prefer-const\n ...imgixParams\n } = config;\n const { url, dimensions, alt: _alt, copyright: _copyright, ...responsiveViews } = field;\n const responsiveViewObjects = Object.values(responsiveViews);\n if (widths === \"thumbnails\" && responsiveViewObjects.length < 1) {\n widths = DEFAULT_WIDTHS;\n }\n return {\n src: buildURL(url, imgixParams),\n srcset: (\n // By this point, we know `widths` can only be\n // `\"thubmanils\"` if the field has thumbnails.\n widths === \"thumbnails\" ? [\n buildWidthSrcSet(url, {\n ...imgixParams,\n widths: [dimensions.width]\n }),\n ...responsiveViewObjects.map((thumbnail) => {\n return buildWidthSrcSet(thumbnail.url, {\n ...imgixParams,\n widths: [thumbnail.dimensions.width]\n });\n })\n ].join(\", \") : buildWidthSrcSet(field.url, {\n ...imgixParams,\n widths\n })\n )\n };\n } else {\n return null;\n }\n};\nexport {\n asImageWidthSrcSet\n};\n//# sourceMappingURL=asImageWidthSrcSet.js.map\n"],"names":[],"mappings":";;AAEA,MAAM,iBAAiB,CAAC,KAAK,KAAK,MAAM,MAAM,IAAI;AAC7C,MAAC,qBAAqB,CAAC,OAAO,SAAS,OAAO;AACjD,MAAI,SAAS,eAAe,KAAK,GAAG;AAClC,QAAI;AAAA,MACF,SAAS;AAAA;AAAA,MAET,GAAG;AAAA,IACJ,IAAG;AACJ,UAAM,EAAE,KAAK,YAAY,KAAK,MAAM,WAAW,YAAY,GAAG,gBAAiB,IAAG;AAClF,UAAM,wBAAwB,OAAO,OAAO,eAAe;AAC3D,QAAI,WAAW,gBAAgB,sBAAsB,SAAS,GAAG;AAC/D,eAAS;AAAA,IACV;AACD,WAAO;AAAA,MACL,KAAK,SAAS,KAAK,WAAW;AAAA,MAC9B;AAAA;AAAA;AAAA,QAGE,WAAW,eAAe;AAAA,UACxB,iBAAiB,KAAK;AAAA,YACpB,GAAG;AAAA,YACH,QAAQ,CAAC,WAAW,KAAK;AAAA,UACrC,CAAW;AAAA,UACD,GAAG,sBAAsB,IAAI,CAAC,cAAc;AAC1C,mBAAO,iBAAiB,UAAU,KAAK;AAAA,cACrC,GAAG;AAAA,cACH,QAAQ,CAAC,UAAU,WAAW,KAAK;AAAA,YACjD,CAAa;AAAA,UACb,CAAW;AAAA,QACF,EAAC,KAAK,IAAI,IAAI,iBAAiB,MAAM,KAAK;AAAA,UACzC,GAAG;AAAA,UACH;AAAA,QACV,CAAS;AAAA;AAAA,IAET;AAAA,EACA,OAAS;AACL,WAAO;AAAA,EACR;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"asImageWidthSrcSet.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.js"],"sourcesContent":["import { buildURL, buildWidthSrcSet } from \"imgix-url-builder\";\nimport { imageThumbnail } from \"./isFilled.js\";\nconst DEFAULT_WIDTHS = [640, 828, 1200, 2048, 3840];\nconst asImageWidthSrcSet = (field, config = {}) => {\n if (field && imageThumbnail(field)) {\n let {\n widths = DEFAULT_WIDTHS,\n // eslint-disable-next-line prefer-const\n ...imgixParams\n } = config;\n const { url, dimensions, id: _id, alt: _alt, copyright: _copyright, edit: _edit, ...responsiveViews } = field;\n const responsiveViewObjects = Object.values(responsiveViews);\n if (widths === \"thumbnails\" && responsiveViewObjects.length < 1) {\n widths = DEFAULT_WIDTHS;\n }\n return {\n src: buildURL(url, imgixParams),\n srcset: (\n // By this point, we know `widths` can only be\n // `\"thubmanils\"` if the field has thumbnails.\n widths === \"thumbnails\" ? [\n buildWidthSrcSet(url, {\n ...imgixParams,\n widths: [dimensions.width]\n }),\n ...responsiveViewObjects.map((thumbnail) => {\n return buildWidthSrcSet(thumbnail.url, {\n ...imgixParams,\n widths: [thumbnail.dimensions.width]\n });\n })\n ].join(\", \") : buildWidthSrcSet(field.url, {\n ...imgixParams,\n widths\n })\n )\n };\n } else {\n return null;\n }\n};\nexport {\n asImageWidthSrcSet\n};\n//# sourceMappingURL=asImageWidthSrcSet.js.map\n"],"names":[],"mappings":";;;AAEA,MAAM,iBAAiB,CAAC,KAAK,KAAK,MAAM,MAAM,IAAI;AAC7C,MAAC,qBAAqB,CAAC,OAAO,SAAS,OAAO;AACjD,MAAI,SAAS,eAAe,KAAK,GAAG;AAClC,QAAI;AAAA,MACF,SAAS;AAAA;AAAA,MAET,GAAG;AAAA,IACJ,IAAG;AACJ,UAAM,EAAE,KAAK,YAAY,IAAI,KAAK,KAAK,MAAM,WAAW,YAAY,MAAM,OAAO,GAAG,gBAAe,IAAK;AACxG,UAAM,wBAAwB,OAAO,OAAO,eAAe;AAC3D,QAAI,WAAW,gBAAgB,sBAAsB,SAAS,GAAG;AAC/D,eAAS;AAAA,IACV;AACD,WAAO;AAAA,MACL,KAAK,SAAS,KAAK,WAAW;AAAA,MAC9B;AAAA;AAAA;AAAA,QAGE,WAAW,eAAe;AAAA,UACxB,iBAAiB,KAAK;AAAA,YACpB,GAAG;AAAA,YACH,QAAQ,CAAC,WAAW,KAAK;AAAA,UACrC,CAAW;AAAA,UACD,GAAG,sBAAsB,IAAI,CAAC,cAAc;AAC1C,mBAAO,iBAAiB,UAAU,KAAK;AAAA,cACrC,GAAG;AAAA,cACH,QAAQ,CAAC,UAAU,WAAW,KAAK;AAAA,YACjD,CAAa;AAAA,UACb,CAAW;AAAA,QACF,EAAC,KAAK,IAAI,IAAI,iBAAiB,MAAM,KAAK;AAAA,UACzC,GAAG;AAAA,UACH;AAAA,QACV,CAAS;AAAA;AAAA,IAET;AAAA,EACA,OAAS;AACL,WAAO;AAAA,EACR;AACH;","x_google_ignoreList":[0]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const prismicR = require("@prismicio/richtext");
3
+ const asText$1 = require("../richtext/asText.cjs");
4
4
  const asText = (richTextField, ...configObjectOrTuple) => {
5
5
  if (richTextField) {
6
6
  const [configObjectOrSeparator] = configObjectOrTuple;
@@ -12,7 +12,7 @@ const asText = (richTextField, ...configObjectOrTuple) => {
12
12
  } else {
13
13
  config = { ...configObjectOrSeparator };
14
14
  }
15
- return prismicR.asText(richTextField, config.separator);
15
+ return asText$1.asText(richTextField, config.separator);
16
16
  } else {
17
17
  return null;
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"asText.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asText.js"],"sourcesContent":["import { asText as asText$1 } from \"@prismicio/richtext\";\nconst asText = (richTextField, ...configObjectOrTuple) => {\n if (richTextField) {\n const [configObjectOrSeparator] = configObjectOrTuple;\n let config;\n if (typeof configObjectOrSeparator === \"string\") {\n config = {\n separator: configObjectOrSeparator\n };\n } else {\n config = { ...configObjectOrSeparator };\n }\n return asText$1(richTextField, config.separator);\n } else {\n return null;\n }\n};\nexport {\n asText\n};\n//# sourceMappingURL=asText.js.map\n"],"names":["asText$1"],"mappings":";;;AACK,MAAC,SAAS,CAAC,kBAAkB,wBAAwB;AACxD,MAAI,eAAe;AACjB,UAAM,CAAC,uBAAuB,IAAI;AAClC,QAAI;AACJ,QAAI,OAAO,4BAA4B,UAAU;AAC/C,eAAS;AAAA,QACP,WAAW;AAAA,MACnB;AAAA,IACA,OAAW;AACL,eAAS,EAAE,GAAG;IACf;AACD,WAAOA,gBAAS,eAAe,OAAO,SAAS;AAAA,EACnD,OAAS;AACL,WAAO;AAAA,EACR;AACH;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"asText.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asText.js"],"sourcesContent":["import { asText as asText$1 } from \"../richtext/asText.js\";\nconst asText = (richTextField, ...configObjectOrTuple) => {\n if (richTextField) {\n const [configObjectOrSeparator] = configObjectOrTuple;\n let config;\n if (typeof configObjectOrSeparator === \"string\") {\n config = {\n separator: configObjectOrSeparator\n };\n } else {\n config = { ...configObjectOrSeparator };\n }\n return asText$1(richTextField, config.separator);\n } else {\n return null;\n }\n};\nexport {\n asText\n};\n//# sourceMappingURL=asText.js.map\n"],"names":["asText$1"],"mappings":";;;AACK,MAAC,SAAS,CAAC,kBAAkB,wBAAwB;AACxD,MAAI,eAAe;AACjB,UAAM,CAAC,uBAAuB,IAAI;AAClC,QAAI;AACJ,QAAI,OAAO,4BAA4B,UAAU;AAC/C,eAAS;AAAA,QACP,WAAW;AAAA,MACnB;AAAA,IACA,OAAW;AACL,eAAS,EAAE,GAAG;IACf;AACD,WAAOA,gBAAS,eAAe,OAAO,SAAS;AAAA,EACnD,OAAS;AACL,WAAO;AAAA,EACR;AACH;;","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
- import { asText as asText$1 } from "@prismicio/richtext";
1
+ import { asText as asText$1 } from "../richtext/asText.js";
2
2
  const asText = (richTextField, ...configObjectOrTuple) => {
3
3
  if (richTextField) {
4
4
  const [configObjectOrSeparator] = configObjectOrTuple;
@@ -1 +1 @@
1
- {"version":3,"file":"asText.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asText.js"],"sourcesContent":["import { asText as asText$1 } from \"@prismicio/richtext\";\nconst asText = (richTextField, ...configObjectOrTuple) => {\n if (richTextField) {\n const [configObjectOrSeparator] = configObjectOrTuple;\n let config;\n if (typeof configObjectOrSeparator === \"string\") {\n config = {\n separator: configObjectOrSeparator\n };\n } else {\n config = { ...configObjectOrSeparator };\n }\n return asText$1(richTextField, config.separator);\n } else {\n return null;\n }\n};\nexport {\n asText\n};\n//# sourceMappingURL=asText.js.map\n"],"names":[],"mappings":";AACK,MAAC,SAAS,CAAC,kBAAkB,wBAAwB;AACxD,MAAI,eAAe;AACjB,UAAM,CAAC,uBAAuB,IAAI;AAClC,QAAI;AACJ,QAAI,OAAO,4BAA4B,UAAU;AAC/C,eAAS;AAAA,QACP,WAAW;AAAA,MACnB;AAAA,IACA,OAAW;AACL,eAAS,EAAE,GAAG;IACf;AACD,WAAO,SAAS,eAAe,OAAO,SAAS;AAAA,EACnD,OAAS;AACL,WAAO;AAAA,EACR;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"asText.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asText.js"],"sourcesContent":["import { asText as asText$1 } from \"../richtext/asText.js\";\nconst asText = (richTextField, ...configObjectOrTuple) => {\n if (richTextField) {\n const [configObjectOrSeparator] = configObjectOrTuple;\n let config;\n if (typeof configObjectOrSeparator === \"string\") {\n config = {\n separator: configObjectOrSeparator\n };\n } else {\n config = { ...configObjectOrSeparator };\n }\n return asText$1(richTextField, config.separator);\n } else {\n return null;\n }\n};\nexport {\n asText\n};\n//# sourceMappingURL=asText.js.map\n"],"names":[],"mappings":";AACK,MAAC,SAAS,CAAC,kBAAkB,wBAAwB;AACxD,MAAI,eAAe;AACjB,UAAM,CAAC,uBAAuB,IAAI;AAClC,QAAI;AACJ,QAAI,OAAO,4BAA4B,UAAU;AAC/C,eAAS;AAAA,QACP,WAAW;AAAA,MACnB;AAAA,IACA,OAAW;AACL,eAAS,EAAE,GAAG;IACf;AACD,WAAO,SAAS,eAAe,OAAO,SAAS;AAAA,EACnD,OAAS;AACL,WAAO;AAAA,EACR;AACH;","x_google_ignoreList":[0]}
@@ -12,6 +12,7 @@ const documentToLinkField = (prismicDocument) => {
12
12
  lang: prismicDocument.lang,
13
13
  url: prismicDocument.url == null ? void 0 : prismicDocument.url,
14
14
  slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],
15
+ // Slug field is not available with GraphQL
15
16
  // The REST API does not include a `data` property if the data
16
17
  // object is empty.
17
18
  //
@@ -1 +1 @@
1
- {"version":3,"file":"documentToLinkField.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/documentToLinkField.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nconst documentToLinkField = (prismicDocument) => {\n var _a;\n return {\n link_type: LinkType.Document,\n id: prismicDocument.id,\n uid: prismicDocument.uid || void 0,\n type: prismicDocument.type,\n tags: prismicDocument.tags,\n lang: prismicDocument.lang,\n url: prismicDocument.url == null ? void 0 : prismicDocument.url,\n slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],\n // The REST API does not include a `data` property if the data\n // object is empty.\n //\n // A presence check for `prismicDocument.data` is done to\n // support partial documents. While `documentToLinkField` is\n // not typed to accept partial documents, passing a partial\n // document can happen in untyped projects.\n ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}\n };\n};\nexport {\n documentToLinkField\n};\n//# sourceMappingURL=documentToLinkField.js.map\n"],"names":["LinkType"],"mappings":";;;AACK,MAAC,sBAAsB,CAAC,oBAAoB;AAC/C,MAAI;AACJ,SAAO;AAAA,IACL,WAAWA,KAAQ,SAAC;AAAA,IACpB,IAAI,gBAAgB;AAAA,IACpB,KAAK,gBAAgB,OAAO;AAAA,IAC5B,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,KAAK,gBAAgB,OAAO,OAAO,SAAS,gBAAgB;AAAA,IAC5D,OAAO,KAAK,gBAAgB,UAAU,OAAO,SAAS,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQ1D,GAAG,gBAAgB,QAAQ,OAAO,KAAK,gBAAgB,IAAI,EAAE,SAAS,IAAI,EAAE,MAAM,gBAAgB,KAAM,IAAG,CAAE;AAAA,EACjH;AACA;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"documentToLinkField.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/documentToLinkField.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nconst documentToLinkField = (prismicDocument) => {\n var _a;\n return {\n link_type: LinkType.Document,\n id: prismicDocument.id,\n uid: prismicDocument.uid || void 0,\n type: prismicDocument.type,\n tags: prismicDocument.tags,\n lang: prismicDocument.lang,\n url: prismicDocument.url == null ? void 0 : prismicDocument.url,\n slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],\n // Slug field is not available with GraphQL\n // The REST API does not include a `data` property if the data\n // object is empty.\n //\n // A presence check for `prismicDocument.data` is done to\n // support partial documents. While `documentToLinkField` is\n // not typed to accept partial documents, passing a partial\n // document can happen in untyped projects.\n ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}\n };\n};\nexport {\n documentToLinkField\n};\n//# sourceMappingURL=documentToLinkField.js.map\n"],"names":["LinkType"],"mappings":";;;AACK,MAAC,sBAAsB,CAAC,oBAAoB;AAC/C,MAAI;AACJ,SAAO;AAAA,IACL,WAAWA,KAAQ,SAAC;AAAA,IACpB,IAAI,gBAAgB;AAAA,IACpB,KAAK,gBAAgB,OAAO;AAAA,IAC5B,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,KAAK,gBAAgB,OAAO,OAAO,SAAS,gBAAgB;AAAA,IAC5D,OAAO,KAAK,gBAAgB,UAAU,OAAO,SAAS,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAS1D,GAAG,gBAAgB,QAAQ,OAAO,KAAK,gBAAgB,IAAI,EAAE,SAAS,IAAI,EAAE,MAAM,gBAAgB,KAAM,IAAG,CAAE;AAAA,EACjH;AACA;;","x_google_ignoreList":[0]}
@@ -10,6 +10,7 @@ const documentToLinkField = (prismicDocument) => {
10
10
  lang: prismicDocument.lang,
11
11
  url: prismicDocument.url == null ? void 0 : prismicDocument.url,
12
12
  slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],
13
+ // Slug field is not available with GraphQL
13
14
  // The REST API does not include a `data` property if the data
14
15
  // object is empty.
15
16
  //
@@ -1 +1 @@
1
- {"version":3,"file":"documentToLinkField.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/documentToLinkField.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nconst documentToLinkField = (prismicDocument) => {\n var _a;\n return {\n link_type: LinkType.Document,\n id: prismicDocument.id,\n uid: prismicDocument.uid || void 0,\n type: prismicDocument.type,\n tags: prismicDocument.tags,\n lang: prismicDocument.lang,\n url: prismicDocument.url == null ? void 0 : prismicDocument.url,\n slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],\n // The REST API does not include a `data` property if the data\n // object is empty.\n //\n // A presence check for `prismicDocument.data` is done to\n // support partial documents. While `documentToLinkField` is\n // not typed to accept partial documents, passing a partial\n // document can happen in untyped projects.\n ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}\n };\n};\nexport {\n documentToLinkField\n};\n//# sourceMappingURL=documentToLinkField.js.map\n"],"names":[],"mappings":";AACK,MAAC,sBAAsB,CAAC,oBAAoB;AAC/C,MAAI;AACJ,SAAO;AAAA,IACL,WAAW,SAAS;AAAA,IACpB,IAAI,gBAAgB;AAAA,IACpB,KAAK,gBAAgB,OAAO;AAAA,IAC5B,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,KAAK,gBAAgB,OAAO,OAAO,SAAS,gBAAgB;AAAA,IAC5D,OAAO,KAAK,gBAAgB,UAAU,OAAO,SAAS,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQ1D,GAAG,gBAAgB,QAAQ,OAAO,KAAK,gBAAgB,IAAI,EAAE,SAAS,IAAI,EAAE,MAAM,gBAAgB,KAAM,IAAG,CAAE;AAAA,EACjH;AACA;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"documentToLinkField.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/documentToLinkField.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nconst documentToLinkField = (prismicDocument) => {\n var _a;\n return {\n link_type: LinkType.Document,\n id: prismicDocument.id,\n uid: prismicDocument.uid || void 0,\n type: prismicDocument.type,\n tags: prismicDocument.tags,\n lang: prismicDocument.lang,\n url: prismicDocument.url == null ? void 0 : prismicDocument.url,\n slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],\n // Slug field is not available with GraphQL\n // The REST API does not include a `data` property if the data\n // object is empty.\n //\n // A presence check for `prismicDocument.data` is done to\n // support partial documents. While `documentToLinkField` is\n // not typed to accept partial documents, passing a partial\n // document can happen in untyped projects.\n ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}\n };\n};\nexport {\n documentToLinkField\n};\n//# sourceMappingURL=documentToLinkField.js.map\n"],"names":[],"mappings":";AACK,MAAC,sBAAsB,CAAC,oBAAoB;AAC/C,MAAI;AACJ,SAAO;AAAA,IACL,WAAW,SAAS;AAAA,IACpB,IAAI,gBAAgB;AAAA,IACpB,KAAK,gBAAgB,OAAO;AAAA,IAC5B,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,KAAK,gBAAgB,OAAO,OAAO,SAAS,gBAAgB;AAAA,IAC5D,OAAO,KAAK,gBAAgB,UAAU,OAAO,SAAS,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAS1D,GAAG,gBAAgB,QAAQ,OAAO,KAAK,gBAAgB,IAAI,EAAE,SAAS,IAAI,EAAE,MAAM,gBAAgB,KAAM,IAAG,CAAE;AAAA,EACjH;AACA;","x_google_ignoreList":[0]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const asText = (richTextField, separator = " ") => {
4
+ let result = "";
5
+ for (let i = 0; i < richTextField.length; i++) {
6
+ if ("text" in richTextField[i]) {
7
+ result += (result ? separator : "") + richTextField[i].text;
8
+ }
9
+ }
10
+ return result;
11
+ };
12
+ exports.asText = asText;
13
+ //# sourceMappingURL=asText.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asText.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/richtext/asText.js"],"sourcesContent":["const asText = (richTextField, separator = \" \") => {\n let result = \"\";\n for (let i = 0; i < richTextField.length; i++) {\n if (\"text\" in richTextField[i]) {\n result += (result ? separator : \"\") + richTextField[i].text;\n }\n }\n return result;\n};\nexport {\n asText\n};\n//# sourceMappingURL=asText.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,SAAS,CAAC,eAAe,YAAY,QAAQ;AACjD,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,cAAc,QAAQ,KAAK;AAC7C,QAAI,UAAU,cAAc,CAAC,GAAG;AAC9B,iBAAW,SAAS,YAAY,MAAM,cAAc,CAAC,EAAE;AAAA,IACxD;AAAA,EACF;AACD,SAAO;AACT;;","x_google_ignoreList":[0]}
@@ -0,0 +1,13 @@
1
+ const asText = (richTextField, separator = " ") => {
2
+ let result = "";
3
+ for (let i = 0; i < richTextField.length; i++) {
4
+ if ("text" in richTextField[i]) {
5
+ result += (result ? separator : "") + richTextField[i].text;
6
+ }
7
+ }
8
+ return result;
9
+ };
10
+ export {
11
+ asText
12
+ };
13
+ //# sourceMappingURL=asText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asText.js","sources":["../../../../../../node_modules/@prismicio/client/dist/richtext/asText.js"],"sourcesContent":["const asText = (richTextField, separator = \" \") => {\n let result = \"\";\n for (let i = 0; i < richTextField.length; i++) {\n if (\"text\" in richTextField[i]) {\n result += (result ? separator : \"\") + richTextField[i].text;\n }\n }\n return result;\n};\nexport {\n asText\n};\n//# sourceMappingURL=asText.js.map\n"],"names":[],"mappings":"AAAK,MAAC,SAAS,CAAC,eAAe,YAAY,QAAQ;AACjD,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,cAAc,QAAQ,KAAK;AAC7C,QAAI,UAAU,cAAc,CAAC,GAAG;AAC9B,iBAAW,SAAS,YAAY,MAAM,cAAc,CAAC,EAAE;AAAA,IACxD;AAAA,EACF;AACD,SAAO;AACT;","x_google_ignoreList":[0]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const buildURL = require("./buildURL.cjs");
4
+ const buildPixelDensitySrcSet = (url, { pixelDensities, ...params }) => {
5
+ return pixelDensities.map((dpr) => {
6
+ return `${buildURL.buildURL(url, { ...params, dpr })} ${dpr}x`;
7
+ }).join(", ");
8
+ };
9
+ exports.buildPixelDensitySrcSet = buildPixelDensitySrcSet;
10
+ //# sourceMappingURL=buildPixelDensitySrcSet.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildPixelDensitySrcSet.cjs","sources":["../../../../node_modules/imgix-url-builder/dist/buildPixelDensitySrcSet.js"],"sourcesContent":["import { buildURL } from \"./buildURL.js\";\nconst buildPixelDensitySrcSet = (url, { pixelDensities, ...params }) => {\n return pixelDensities.map((dpr) => {\n return `${buildURL(url, { ...params, dpr })} ${dpr}x`;\n }).join(\", \");\n};\nexport {\n buildPixelDensitySrcSet\n};\n//# sourceMappingURL=buildPixelDensitySrcSet.js.map\n"],"names":["buildURL"],"mappings":";;;AACK,MAAC,0BAA0B,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAM,MAAO;AACtE,SAAO,eAAe,IAAI,CAAC,QAAQ;AACjC,WAAO,GAAGA,SAAAA,SAAS,KAAK,EAAE,GAAG,QAAQ,IAAG,CAAE,KAAK;AAAA,EACnD,CAAG,EAAE,KAAK,IAAI;AACd;;","x_google_ignoreList":[0]}
@@ -0,0 +1,10 @@
1
+ import { buildURL } from "./buildURL.js";
2
+ const buildPixelDensitySrcSet = (url, { pixelDensities, ...params }) => {
3
+ return pixelDensities.map((dpr) => {
4
+ return `${buildURL(url, { ...params, dpr })} ${dpr}x`;
5
+ }).join(", ");
6
+ };
7
+ export {
8
+ buildPixelDensitySrcSet
9
+ };
10
+ //# sourceMappingURL=buildPixelDensitySrcSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildPixelDensitySrcSet.js","sources":["../../../../node_modules/imgix-url-builder/dist/buildPixelDensitySrcSet.js"],"sourcesContent":["import { buildURL } from \"./buildURL.js\";\nconst buildPixelDensitySrcSet = (url, { pixelDensities, ...params }) => {\n return pixelDensities.map((dpr) => {\n return `${buildURL(url, { ...params, dpr })} ${dpr}x`;\n }).join(\", \");\n};\nexport {\n buildPixelDensitySrcSet\n};\n//# sourceMappingURL=buildPixelDensitySrcSet.js.map\n"],"names":[],"mappings":";AACK,MAAC,0BAA0B,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAM,MAAO;AACtE,SAAO,eAAe,IAAI,CAAC,QAAQ;AACjC,WAAO,GAAG,SAAS,KAAK,EAAE,GAAG,QAAQ,IAAG,CAAE,KAAK;AAAA,EACnD,CAAG,EAAE,KAAK,IAAI;AACd;","x_google_ignoreList":[0]}
@@ -25,17 +25,5 @@ const buildURL = (url, params) => {
25
25
  }
26
26
  return instance.toString();
27
27
  };
28
- const buildPixelDensitySrcSet = (url, { pixelDensities, ...params }) => {
29
- return pixelDensities.map((dpr) => {
30
- return `${buildURL(url, { ...params, dpr })} ${dpr}x`;
31
- }).join(", ");
32
- };
33
- const buildWidthSrcSet = (url, { widths, ...params }) => {
34
- return widths.map((width) => {
35
- return `${buildURL(url, { ...params, w: void 0, width })} ${width}w`;
36
- }).join(", ");
37
- };
38
- exports.buildPixelDensitySrcSet = buildPixelDensitySrcSet;
39
28
  exports.buildURL = buildURL;
40
- exports.buildWidthSrcSet = buildWidthSrcSet;
41
- //# sourceMappingURL=index.cjs.map
29
+ //# sourceMappingURL=buildURL.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildURL.cjs","sources":["../../../../node_modules/imgix-url-builder/dist/buildURL.js"],"sourcesContent":["const camelCaseToParamCase = (input) => {\n return input.replace(/[A-Z]/g, (match) => {\n return `-${match.toLowerCase()}`;\n });\n};\nconst buildURL = (url, params) => {\n const instance = new URL(url);\n for (const camelCasedParamKey in params) {\n const paramKey = camelCaseToParamCase(camelCasedParamKey);\n const paramValue = params[camelCasedParamKey];\n if (paramValue === void 0) {\n instance.searchParams.delete(paramKey);\n } else if (Array.isArray(paramValue)) {\n instance.searchParams.set(paramKey, paramValue.join(\",\"));\n } else {\n instance.searchParams.set(paramKey, `${paramValue}`);\n }\n }\n const s = instance.searchParams.get(\"s\");\n if (s) {\n instance.searchParams.delete(\"s\");\n instance.searchParams.append(\"s\", s);\n }\n return instance.toString();\n};\nexport {\n buildURL\n};\n//# sourceMappingURL=buildURL.js.map\n"],"names":[],"mappings":";;AAAA,MAAM,uBAAuB,CAAC,UAAU;AACtC,SAAO,MAAM,QAAQ,UAAU,CAAC,UAAU;AACxC,WAAO,IAAI,MAAM,YAAW;AAAA,EAChC,CAAG;AACH;AACK,MAAC,WAAW,CAAC,KAAK,WAAW;AAChC,QAAM,WAAW,IAAI,IAAI,GAAG;AAC5B,aAAW,sBAAsB,QAAQ;AACvC,UAAM,WAAW,qBAAqB,kBAAkB;AACxD,UAAM,aAAa,OAAO,kBAAkB;AAC5C,QAAI,eAAe,QAAQ;AACzB,eAAS,aAAa,OAAO,QAAQ;AAAA,IACtC,WAAU,MAAM,QAAQ,UAAU,GAAG;AACpC,eAAS,aAAa,IAAI,UAAU,WAAW,KAAK,GAAG,CAAC;AAAA,IAC9D,OAAW;AACL,eAAS,aAAa,IAAI,UAAU,GAAG,YAAY;AAAA,IACpD;AAAA,EACF;AACD,QAAM,IAAI,SAAS,aAAa,IAAI,GAAG;AACvC,MAAI,GAAG;AACL,aAAS,aAAa,OAAO,GAAG;AAChC,aAAS,aAAa,OAAO,KAAK,CAAC;AAAA,EACpC;AACD,SAAO,SAAS;AAClB;;","x_google_ignoreList":[0]}
@@ -23,19 +23,7 @@ const buildURL = (url, params) => {
23
23
  }
24
24
  return instance.toString();
25
25
  };
26
- const buildPixelDensitySrcSet = (url, { pixelDensities, ...params }) => {
27
- return pixelDensities.map((dpr) => {
28
- return `${buildURL(url, { ...params, dpr })} ${dpr}x`;
29
- }).join(", ");
30
- };
31
- const buildWidthSrcSet = (url, { widths, ...params }) => {
32
- return widths.map((width) => {
33
- return `${buildURL(url, { ...params, w: void 0, width })} ${width}w`;
34
- }).join(", ");
35
- };
36
26
  export {
37
- buildPixelDensitySrcSet,
38
- buildURL,
39
- buildWidthSrcSet
27
+ buildURL
40
28
  };
41
- //# sourceMappingURL=index.js.map
29
+ //# sourceMappingURL=buildURL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildURL.js","sources":["../../../../node_modules/imgix-url-builder/dist/buildURL.js"],"sourcesContent":["const camelCaseToParamCase = (input) => {\n return input.replace(/[A-Z]/g, (match) => {\n return `-${match.toLowerCase()}`;\n });\n};\nconst buildURL = (url, params) => {\n const instance = new URL(url);\n for (const camelCasedParamKey in params) {\n const paramKey = camelCaseToParamCase(camelCasedParamKey);\n const paramValue = params[camelCasedParamKey];\n if (paramValue === void 0) {\n instance.searchParams.delete(paramKey);\n } else if (Array.isArray(paramValue)) {\n instance.searchParams.set(paramKey, paramValue.join(\",\"));\n } else {\n instance.searchParams.set(paramKey, `${paramValue}`);\n }\n }\n const s = instance.searchParams.get(\"s\");\n if (s) {\n instance.searchParams.delete(\"s\");\n instance.searchParams.append(\"s\", s);\n }\n return instance.toString();\n};\nexport {\n buildURL\n};\n//# sourceMappingURL=buildURL.js.map\n"],"names":[],"mappings":"AAAA,MAAM,uBAAuB,CAAC,UAAU;AACtC,SAAO,MAAM,QAAQ,UAAU,CAAC,UAAU;AACxC,WAAO,IAAI,MAAM,YAAW;AAAA,EAChC,CAAG;AACH;AACK,MAAC,WAAW,CAAC,KAAK,WAAW;AAChC,QAAM,WAAW,IAAI,IAAI,GAAG;AAC5B,aAAW,sBAAsB,QAAQ;AACvC,UAAM,WAAW,qBAAqB,kBAAkB;AACxD,UAAM,aAAa,OAAO,kBAAkB;AAC5C,QAAI,eAAe,QAAQ;AACzB,eAAS,aAAa,OAAO,QAAQ;AAAA,IACtC,WAAU,MAAM,QAAQ,UAAU,GAAG;AACpC,eAAS,aAAa,IAAI,UAAU,WAAW,KAAK,GAAG,CAAC;AAAA,IAC9D,OAAW;AACL,eAAS,aAAa,IAAI,UAAU,GAAG,YAAY;AAAA,IACpD;AAAA,EACF;AACD,QAAM,IAAI,SAAS,aAAa,IAAI,GAAG;AACvC,MAAI,GAAG;AACL,aAAS,aAAa,OAAO,GAAG;AAChC,aAAS,aAAa,OAAO,KAAK,CAAC;AAAA,EACpC;AACD,SAAO,SAAS;AAClB;","x_google_ignoreList":[0]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const buildURL = require("./buildURL.cjs");
4
+ const buildWidthSrcSet = (url, { widths, ...params }) => {
5
+ return widths.map((width) => {
6
+ return `${buildURL.buildURL(url, { ...params, w: void 0, width })} ${width}w`;
7
+ }).join(", ");
8
+ };
9
+ exports.buildWidthSrcSet = buildWidthSrcSet;
10
+ //# sourceMappingURL=buildWidthSrcSet.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildWidthSrcSet.cjs","sources":["../../../../node_modules/imgix-url-builder/dist/buildWidthSrcSet.js"],"sourcesContent":["import { buildURL } from \"./buildURL.js\";\nconst buildWidthSrcSet = (url, { widths, ...params }) => {\n return widths.map((width) => {\n return `${buildURL(url, { ...params, w: void 0, width })} ${width}w`;\n }).join(\", \");\n};\nexport {\n buildWidthSrcSet\n};\n//# sourceMappingURL=buildWidthSrcSet.js.map\n"],"names":["buildURL"],"mappings":";;;AACK,MAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAM,MAAO;AACvD,SAAO,OAAO,IAAI,CAAC,UAAU;AAC3B,WAAO,GAAGA,SAAQ,SAAC,KAAK,EAAE,GAAG,QAAQ,GAAG,QAAQ,MAAK,CAAE,KAAK;AAAA,EAChE,CAAG,EAAE,KAAK,IAAI;AACd;;","x_google_ignoreList":[0]}
@@ -0,0 +1,10 @@
1
+ import { buildURL } from "./buildURL.js";
2
+ const buildWidthSrcSet = (url, { widths, ...params }) => {
3
+ return widths.map((width) => {
4
+ return `${buildURL(url, { ...params, w: void 0, width })} ${width}w`;
5
+ }).join(", ");
6
+ };
7
+ export {
8
+ buildWidthSrcSet
9
+ };
10
+ //# sourceMappingURL=buildWidthSrcSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildWidthSrcSet.js","sources":["../../../../node_modules/imgix-url-builder/dist/buildWidthSrcSet.js"],"sourcesContent":["import { buildURL } from \"./buildURL.js\";\nconst buildWidthSrcSet = (url, { widths, ...params }) => {\n return widths.map((width) => {\n return `${buildURL(url, { ...params, w: void 0, width })} ${width}w`;\n }).join(\", \");\n};\nexport {\n buildWidthSrcSet\n};\n//# sourceMappingURL=buildWidthSrcSet.js.map\n"],"names":[],"mappings":";AACK,MAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAM,MAAO;AACvD,SAAO,OAAO,IAAI,CAAC,UAAU;AAC3B,WAAO,GAAG,SAAS,KAAK,EAAE,GAAG,QAAQ,GAAG,QAAQ,MAAK,CAAE,KAAK;AAAA,EAChE,CAAG,EAAE,KAAK,IAAI;AACd;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "2.7.4";
3
+ const version = "2.9.0-alpha.0";
4
4
  exports.version = version;
5
5
  //# sourceMappingURL=package.json.cjs.map
@@ -1,4 +1,4 @@
1
- const version = "2.7.4";
1
+ const version = "2.9.0-alpha.0";
2
2
  export {
3
3
  version
4
4
  };
@@ -3,7 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const asLinkAttrs = require('./../_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.cjs');
6
- require("@prismicio/richtext");
7
6
  const devMsg = require("../lib/devMsg.cjs");
8
7
  const isInternalURL = require("../lib/isInternalURL.cjs");
9
8
  function _interopNamespaceDefault(e) {
@@ -24,14 +23,15 @@ function _interopNamespaceDefault(e) {
24
23
  }
25
24
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
26
25
  const defaultComponent = "a";
27
- const PrismicLink = React__namespace.forwardRef(function PrismicLink2({ field, document: doc, linkResolver, internalComponent, externalComponent, ...restProps }, ref) {
26
+ const PrismicLink = React__namespace.forwardRef(function PrismicLink2(props, ref) {
27
+ const { field, document: doc, linkResolver, internalComponent, externalComponent, children, ...restProps } = props;
28
28
  if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
29
29
  if (field) {
30
30
  if (!field.link_type) {
31
31
  console.error(`[PrismicLink] This "field" prop value caused an error to be thrown.
32
32
  `, field);
33
33
  throw new Error(`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg.devMsg("missing-link-properties")}`);
34
- } else if (Object.keys(field).length > 1 && !("url" in field || "uid" in field || "id" in field)) {
34
+ } else if (("text" in field ? Object.keys(field).length > 2 : Object.keys(field).length > 1) && !("url" in field || "uid" in field || "id" in field)) {
35
35
  console.warn(`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg.devMsg("missing-link-properties")}`, field);
36
36
  }
37
37
  } else if (doc) {
@@ -52,7 +52,7 @@ const PrismicLink = React__namespace.forwardRef(function PrismicLink2({ field, d
52
52
  const InternalComponent = internalComponent || defaultComponent;
53
53
  const ExternalComponent = externalComponent || defaultComponent;
54
54
  const Component = href && isInternalURL.isInternalURL(href) ? InternalComponent : ExternalComponent;
55
- return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, ...attrs, ...restProps, href, rel });
55
+ return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, ...attrs, ...restProps, href, rel, children: "children" in props ? children : field == null ? void 0 : field.text });
56
56
  });
57
57
  exports.PrismicLink = PrismicLink;
58
58
  exports.defaultComponent = defaultComponent;
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicLink.cjs","sources":["../../../src/react-server/PrismicLink.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {\n\tLinkField,\n\tLinkResolverFunction,\n\tPrismicDocument,\n\tasLinkAttrs,\n\tAsLinkAttrsConfig,\n} from \"@prismicio/client\";\n\nimport { devMsg } from \"../lib/devMsg\";\nimport { isInternalURL } from \"../lib/isInternalURL\";\n\n/**\n * The default component rendered for internal and external links.\n */\nexport const defaultComponent = \"a\";\n\n/**\n * Props provided to a component when rendered with `<PrismicLink>`.\n */\nexport interface LinkProps {\n\t/**\n\t * The URL to link.\n\t */\n\thref: string;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: React.HTMLAttributeAnchorTarget;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n}\n\nexport type PrismicLinkProps<\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n> = Omit<InternalComponentProps & ExternalComponentProps, \"rel\" | \"href\"> & {\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"];\n\n\t/**\n\t * The Link Resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * The component rendered for internal URLs. Defaults to `<a>`.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t */\n\tinternalComponent?: React.ElementType<InternalComponentProps>;\n\n\t/**\n\t * The component rendered for external URLs. Defaults to `<a>`.\n\t */\n\texternalComponent?: React.ComponentType<ExternalComponentProps>;\n} & (\n\t\t| {\n\t\t\t\tdocument: PrismicDocument | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tfield?: never;\n\t\t }\n\t\t| {\n\t\t\t\tfield: LinkField | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tdocument?: never;\n\t\t }\n\t\t| {\n\t\t\t\thref: LinkProps[\"href\"];\n\t\t\t\tfield?: LinkField | null | undefined;\n\t\t\t\tdocument?: never;\n\t\t }\n\t);\n\nexport const PrismicLink = React.forwardRef(function PrismicLink<\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n>(\n\t{\n\t\tfield,\n\t\tdocument: doc,\n\t\tlinkResolver,\n\t\tinternalComponent,\n\t\texternalComponent,\n\t\t...restProps\n\t}: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,\n\tref: React.ForwardedRef<Element>,\n): JSX.Element {\n\tif (\n\t\ttypeof process !== \"undefined\" &&\n\t\tprocess.env.NODE_ENV === \"development\"\n\t) {\n\t\tif (field) {\n\t\t\tif (!field.link_type) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`[PrismicLink] This \"field\" prop value caused an error to be thrown.\\n`,\n\t\t\t\t\tfield,\n\t\t\t\t);\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tObject.keys(field).length > 1 &&\n\t\t\t\t!(\"url\" in field || \"uid\" in field || \"id\" in field)\n\t\t\t) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tfield,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (doc) {\n\t\t\tif (!(\"url\" in doc || \"id\" in doc)) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided document is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tdoc,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = asLinkAttrs(field ?? doc, {\n\t\tlinkResolver,\n\t\trel: typeof restProps.rel === \"function\" ? restProps.rel : undefined,\n\t});\n\n\tlet rel: string | undefined = computedRel;\n\tif (\"rel\" in restProps && typeof restProps.rel !== \"function\") {\n\t\trel = restProps.rel;\n\t}\n\n\tconst href = (\"href\" in restProps ? restProps.href : computedHref) || \"\";\n\n\tconst InternalComponent = (internalComponent ||\n\t\tdefaultComponent) as React.ComponentType<LinkProps>;\n\tconst ExternalComponent = (externalComponent ||\n\t\tdefaultComponent) as React.ComponentType<LinkProps>;\n\tconst Component =\n\t\thref && isInternalURL(href) ? InternalComponent : ExternalComponent;\n\n\treturn (\n\t\t<Component ref={ref} {...attrs} {...restProps} href={href} rel={rel} />\n\t);\n}) as <\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n>(\n\tprops: PrismicLinkProps<InternalComponentProps, ExternalComponentProps> & {\n\t\tref?: React.ForwardedRef<Element>;\n\t},\n) => JSX.Element;\n"],"names":["React","PrismicLink","devMsg","asLinkAttrs","isInternalURL","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,mBAAmB;AAgFzB,MAAM,cAAcA,iBAAM,WAAW,SAASC,aAIpD,EACC,OACA,UAAU,KACV,cACA,mBACA,mBACA,GAAG,UAAA,GAEJ,KAAgC;AAEhC,MACC,OAAO,YAAY,eACnB,QAAQ,IAAI,aAAa,eACxB;AACD,QAAI,OAAO;AACN,UAAA,CAAC,MAAM,WAAW;AACrB,gBAAQ,MACP;AAAA,GACA,KAAK;AAEN,cAAM,IAAI,MACT,8IAA8IC,OAAA,OAC7I,yBAAyB,GACvB;AAAA,MAGJ,WAAA,OAAO,KAAK,KAAK,EAAE,SAAS,KAC5B,EAAE,SAAS,SAAS,SAAS,SAAS,QAAQ,QAC7C;AACD,gBAAQ,KACP,uJAAuJA,OAAAA,OACtJ,yBAAyB,KAE1B,KAAK;AAAA,MAEN;AAAA,eACS,KAAK;AACf,UAAI,EAAE,SAAS,OAAO,QAAQ,MAAM;AACnC,gBAAQ,KACP,0JAA0JA,OAAAA,OACzJ,yBAAyB,KAE1B,GAAG;AAAA,MAEJ;AAAA,IACD;AAAA,EACD;AAEK,QAAA,EACL,MAAM,cACN,KAAK,aACL,GAAG,UACAC,YAAAA,YAAY,SAAS,KAAK;AAAA,IAC7B;AAAA,IACA,KAAK,OAAO,UAAU,QAAQ,aAAa,UAAU,MAAM;AAAA,EAAA,CAC3D;AAED,MAAI,MAA0B;AAC9B,MAAI,SAAS,aAAa,OAAO,UAAU,QAAQ,YAAY;AAC9D,UAAM,UAAU;AAAA,EAChB;AAED,QAAM,QAAQ,UAAU,YAAY,UAAU,OAAO,iBAAiB;AAEtE,QAAM,oBAAqB,qBAC1B;AACD,QAAM,oBAAqB,qBAC1B;AACD,QAAM,YACL,QAAQC,cAAAA,cAAc,IAAI,IAAI,oBAAoB;AAGlD,SAAAC,2BAAA,IAAC,aAAU,KAAc,GAAA,OAAO,GAAI,WAAW,MAAY,IAAS,CAAA;AAEtE,CAAC;;;"}
1
+ {"version":3,"file":"PrismicLink.cjs","sources":["../../../src/react-server/PrismicLink.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {\n\tLinkField,\n\tLinkResolverFunction,\n\tPrismicDocument,\n\tasLinkAttrs,\n\tAsLinkAttrsConfig,\n} from \"@prismicio/client\";\n\nimport { devMsg } from \"../lib/devMsg\";\nimport { isInternalURL } from \"../lib/isInternalURL\";\n\n/**\n * The default component rendered for internal and external links.\n */\nexport const defaultComponent = \"a\";\n\n/**\n * Props provided to a component when rendered with `<PrismicLink>`.\n */\nexport interface LinkProps {\n\t/**\n\t * The URL to link.\n\t */\n\thref: string;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: React.HTMLAttributeAnchorTarget;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n}\n\nexport type PrismicLinkProps<\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n> = Omit<\n\tInternalComponentProps & ExternalComponentProps,\n\t\"rel\" | \"href\" | \"children\"\n> & {\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"];\n\n\t/**\n\t * The Link Resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * The component rendered for internal URLs. Defaults to `<a>`.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t */\n\tinternalComponent?: React.ElementType<InternalComponentProps>;\n\n\t/**\n\t * The component rendered for external URLs. Defaults to `<a>`.\n\t */\n\texternalComponent?: React.ComponentType<ExternalComponentProps>;\n\n\t/**\n\t * The children to render for the link. If no children are provided, the\n\t * link's `text` property will be used.\n\t */\n\tchildren?: React.ReactNode;\n} & (\n\t\t| {\n\t\t\t\tdocument: PrismicDocument | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tfield?: never;\n\t\t }\n\t\t| {\n\t\t\t\tfield: LinkField | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tdocument?: never;\n\t\t }\n\t\t| {\n\t\t\t\thref: LinkProps[\"href\"];\n\t\t\t\tfield?: LinkField | null | undefined;\n\t\t\t\tdocument?: never;\n\t\t }\n\t);\n\nexport const PrismicLink = React.forwardRef(function PrismicLink<\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n>(\n\tprops: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,\n\tref: React.ForwardedRef<Element>,\n): JSX.Element {\n\tconst {\n\t\tfield,\n\t\tdocument: doc,\n\t\tlinkResolver,\n\t\tinternalComponent,\n\t\texternalComponent,\n\t\tchildren,\n\t\t...restProps\n\t} = props;\n\n\tif (\n\t\ttypeof process !== \"undefined\" &&\n\t\tprocess.env.NODE_ENV === \"development\"\n\t) {\n\t\tif (field) {\n\t\t\tif (!field.link_type) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`[PrismicLink] This \"field\" prop value caused an error to be thrown.\\n`,\n\t\t\t\t\tfield,\n\t\t\t\t);\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\t(\"text\" in field\n\t\t\t\t\t? Object.keys(field).length > 2\n\t\t\t\t\t: Object.keys(field).length > 1) &&\n\t\t\t\t!(\"url\" in field || \"uid\" in field || \"id\" in field)\n\t\t\t) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tfield,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (doc) {\n\t\t\tif (!(\"url\" in doc || \"id\" in doc)) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided document is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tdoc,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = asLinkAttrs(field ?? doc, {\n\t\tlinkResolver,\n\t\trel: typeof restProps.rel === \"function\" ? restProps.rel : undefined,\n\t});\n\n\tlet rel: string | undefined = computedRel;\n\tif (\"rel\" in restProps && typeof restProps.rel !== \"function\") {\n\t\trel = restProps.rel;\n\t}\n\n\tconst href = (\"href\" in restProps ? restProps.href : computedHref) || \"\";\n\n\tconst InternalComponent = (internalComponent ||\n\t\tdefaultComponent) as React.ComponentType<LinkProps>;\n\tconst ExternalComponent = (externalComponent ||\n\t\tdefaultComponent) as React.ComponentType<LinkProps>;\n\tconst Component =\n\t\thref && isInternalURL(href) ? InternalComponent : ExternalComponent;\n\n\treturn (\n\t\t<Component ref={ref} {...attrs} {...restProps} href={href} rel={rel}>\n\t\t\t{\"children\" in props ? children : field?.text}\n\t\t</Component>\n\t);\n}) as <\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n>(\n\tprops: PrismicLinkProps<InternalComponentProps, ExternalComponentProps> & {\n\t\tref?: React.ForwardedRef<Element>;\n\t},\n) => JSX.Element;\n"],"names":["React","PrismicLink","devMsg","asLinkAttrs","isInternalURL","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,mBAAmB;AAyFzB,MAAM,cAAcA,iBAAM,WAAW,SAASC,aAIpD,OACA,KAAgC;AAE1B,QAAA,EACL,OACA,UAAU,KACV,cACA,mBACA,mBACA,UACA,GAAG,UAAA,IACA;AAEJ,MACC,OAAO,YAAY,eACnB,QAAQ,IAAI,aAAa,eACxB;AACD,QAAI,OAAO;AACN,UAAA,CAAC,MAAM,WAAW;AACrB,gBAAQ,MACP;AAAA,GACA,KAAK;AAEN,cAAM,IAAI,MACT,8IAA8IC,OAAA,OAC7I,yBAAyB,GACvB;AAAA,MAAA,YAGH,UAAU,QACR,OAAO,KAAK,KAAK,EAAE,SAAS,IAC5B,OAAO,KAAK,KAAK,EAAE,SAAS,MAC/B,EAAE,SAAS,SAAS,SAAS,SAAS,QAAQ,QAC7C;AACD,gBAAQ,KACP,uJAAuJA,OAAAA,OACtJ,yBAAyB,KAE1B,KAAK;AAAA,MAEN;AAAA,eACS,KAAK;AACf,UAAI,EAAE,SAAS,OAAO,QAAQ,MAAM;AACnC,gBAAQ,KACP,0JAA0JA,OAAAA,OACzJ,yBAAyB,KAE1B,GAAG;AAAA,MAEJ;AAAA,IACD;AAAA,EACD;AAEK,QAAA,EACL,MAAM,cACN,KAAK,aACL,GAAG,UACAC,YAAAA,YAAY,SAAS,KAAK;AAAA,IAC7B;AAAA,IACA,KAAK,OAAO,UAAU,QAAQ,aAAa,UAAU,MAAM;AAAA,EAAA,CAC3D;AAED,MAAI,MAA0B;AAC9B,MAAI,SAAS,aAAa,OAAO,UAAU,QAAQ,YAAY;AAC9D,UAAM,UAAU;AAAA,EAChB;AAED,QAAM,QAAQ,UAAU,YAAY,UAAU,OAAO,iBAAiB;AAEtE,QAAM,oBAAqB,qBAC1B;AACD,QAAM,oBAAqB,qBAC1B;AACD,QAAM,YACL,QAAQC,cAAAA,cAAc,IAAI,IAAI,oBAAoB;AAEnD,SACEC,2BAAAA,IAAA,WAAA,EAAU,KAAc,GAAA,OAAW,GAAA,WAAW,MAAY,KACzD,UAAA,cAAc,QAAQ,WAAW,+BAAO,KAC1C,CAAA;AAEF,CAAC;;;"}
@@ -27,7 +27,7 @@ export interface LinkProps {
27
27
  */
28
28
  children?: React.ReactNode;
29
29
  }
30
- export type PrismicLinkProps<InternalComponentProps = React.ComponentProps<typeof defaultComponent>, ExternalComponentProps = React.ComponentProps<typeof defaultComponent>> = Omit<InternalComponentProps & ExternalComponentProps, "rel" | "href"> & {
30
+ export type PrismicLinkProps<InternalComponentProps = React.ComponentProps<typeof defaultComponent>, ExternalComponentProps = React.ComponentProps<typeof defaultComponent>> = Omit<InternalComponentProps & ExternalComponentProps, "rel" | "href" | "children"> & {
31
31
  /**
32
32
  * The `rel` attribute for the link. By default, `"noreferrer"` is provided if
33
33
  * the link's URL is external. This prop can be provided a function to use the
@@ -54,6 +54,11 @@ export type PrismicLinkProps<InternalComponentProps = React.ComponentProps<typeo
54
54
  * The component rendered for external URLs. Defaults to `<a>`.
55
55
  */
56
56
  externalComponent?: React.ComponentType<ExternalComponentProps>;
57
+ /**
58
+ * The children to render for the link. If no children are provided, the
59
+ * link's `text` property will be used.
60
+ */
61
+ children?: React.ReactNode;
57
62
  } & ({
58
63
  document: PrismicDocument | null | undefined;
59
64
  href?: never;
@@ -1,18 +1,18 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { asLinkAttrs } from './../_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.js';
4
- import "@prismicio/richtext";
5
4
  import { devMsg } from "../lib/devMsg.js";
6
5
  import { isInternalURL } from "../lib/isInternalURL.js";
7
6
  const defaultComponent = "a";
8
- const PrismicLink = React.forwardRef(function PrismicLink2({ field, document: doc, linkResolver, internalComponent, externalComponent, ...restProps }, ref) {
7
+ const PrismicLink = React.forwardRef(function PrismicLink2(props, ref) {
8
+ const { field, document: doc, linkResolver, internalComponent, externalComponent, children, ...restProps } = props;
9
9
  if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
10
10
  if (field) {
11
11
  if (!field.link_type) {
12
12
  console.error(`[PrismicLink] This "field" prop value caused an error to be thrown.
13
13
  `, field);
14
14
  throw new Error(`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg("missing-link-properties")}`);
15
- } else if (Object.keys(field).length > 1 && !("url" in field || "uid" in field || "id" in field)) {
15
+ } else if (("text" in field ? Object.keys(field).length > 2 : Object.keys(field).length > 1) && !("url" in field || "uid" in field || "id" in field)) {
16
16
  console.warn(`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg("missing-link-properties")}`, field);
17
17
  }
18
18
  } else if (doc) {
@@ -33,7 +33,7 @@ const PrismicLink = React.forwardRef(function PrismicLink2({ field, document: do
33
33
  const InternalComponent = internalComponent || defaultComponent;
34
34
  const ExternalComponent = externalComponent || defaultComponent;
35
35
  const Component = href && isInternalURL(href) ? InternalComponent : ExternalComponent;
36
- return /* @__PURE__ */ jsx(Component, { ref, ...attrs, ...restProps, href, rel });
36
+ return /* @__PURE__ */ jsx(Component, { ref, ...attrs, ...restProps, href, rel, children: "children" in props ? children : field == null ? void 0 : field.text });
37
37
  });
38
38
  export {
39
39
  PrismicLink,
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicLink.js","sources":["../../../src/react-server/PrismicLink.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {\n\tLinkField,\n\tLinkResolverFunction,\n\tPrismicDocument,\n\tasLinkAttrs,\n\tAsLinkAttrsConfig,\n} from \"@prismicio/client\";\n\nimport { devMsg } from \"../lib/devMsg\";\nimport { isInternalURL } from \"../lib/isInternalURL\";\n\n/**\n * The default component rendered for internal and external links.\n */\nexport const defaultComponent = \"a\";\n\n/**\n * Props provided to a component when rendered with `<PrismicLink>`.\n */\nexport interface LinkProps {\n\t/**\n\t * The URL to link.\n\t */\n\thref: string;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: React.HTMLAttributeAnchorTarget;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n}\n\nexport type PrismicLinkProps<\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n> = Omit<InternalComponentProps & ExternalComponentProps, \"rel\" | \"href\"> & {\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"];\n\n\t/**\n\t * The Link Resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * The component rendered for internal URLs. Defaults to `<a>`.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t */\n\tinternalComponent?: React.ElementType<InternalComponentProps>;\n\n\t/**\n\t * The component rendered for external URLs. Defaults to `<a>`.\n\t */\n\texternalComponent?: React.ComponentType<ExternalComponentProps>;\n} & (\n\t\t| {\n\t\t\t\tdocument: PrismicDocument | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tfield?: never;\n\t\t }\n\t\t| {\n\t\t\t\tfield: LinkField | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tdocument?: never;\n\t\t }\n\t\t| {\n\t\t\t\thref: LinkProps[\"href\"];\n\t\t\t\tfield?: LinkField | null | undefined;\n\t\t\t\tdocument?: never;\n\t\t }\n\t);\n\nexport const PrismicLink = React.forwardRef(function PrismicLink<\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n>(\n\t{\n\t\tfield,\n\t\tdocument: doc,\n\t\tlinkResolver,\n\t\tinternalComponent,\n\t\texternalComponent,\n\t\t...restProps\n\t}: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,\n\tref: React.ForwardedRef<Element>,\n): JSX.Element {\n\tif (\n\t\ttypeof process !== \"undefined\" &&\n\t\tprocess.env.NODE_ENV === \"development\"\n\t) {\n\t\tif (field) {\n\t\t\tif (!field.link_type) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`[PrismicLink] This \"field\" prop value caused an error to be thrown.\\n`,\n\t\t\t\t\tfield,\n\t\t\t\t);\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tObject.keys(field).length > 1 &&\n\t\t\t\t!(\"url\" in field || \"uid\" in field || \"id\" in field)\n\t\t\t) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tfield,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (doc) {\n\t\t\tif (!(\"url\" in doc || \"id\" in doc)) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided document is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tdoc,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = asLinkAttrs(field ?? doc, {\n\t\tlinkResolver,\n\t\trel: typeof restProps.rel === \"function\" ? restProps.rel : undefined,\n\t});\n\n\tlet rel: string | undefined = computedRel;\n\tif (\"rel\" in restProps && typeof restProps.rel !== \"function\") {\n\t\trel = restProps.rel;\n\t}\n\n\tconst href = (\"href\" in restProps ? restProps.href : computedHref) || \"\";\n\n\tconst InternalComponent = (internalComponent ||\n\t\tdefaultComponent) as React.ComponentType<LinkProps>;\n\tconst ExternalComponent = (externalComponent ||\n\t\tdefaultComponent) as React.ComponentType<LinkProps>;\n\tconst Component =\n\t\thref && isInternalURL(href) ? InternalComponent : ExternalComponent;\n\n\treturn (\n\t\t<Component ref={ref} {...attrs} {...restProps} href={href} rel={rel} />\n\t);\n}) as <\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n>(\n\tprops: PrismicLinkProps<InternalComponentProps, ExternalComponentProps> & {\n\t\tref?: React.ForwardedRef<Element>;\n\t},\n) => JSX.Element;\n"],"names":["PrismicLink"],"mappings":";;;;;;AAeO,MAAM,mBAAmB;AAgFzB,MAAM,cAAc,MAAM,WAAW,SAASA,aAIpD,EACC,OACA,UAAU,KACV,cACA,mBACA,mBACA,GAAG,UAAA,GAEJ,KAAgC;AAEhC,MACC,OAAO,YAAY,eACnB,QAAQ,IAAI,aAAa,eACxB;AACD,QAAI,OAAO;AACN,UAAA,CAAC,MAAM,WAAW;AACrB,gBAAQ,MACP;AAAA,GACA,KAAK;AAEN,cAAM,IAAI,MACT,8IAA8I,OAC7I,yBAAyB,GACvB;AAAA,MAGJ,WAAA,OAAO,KAAK,KAAK,EAAE,SAAS,KAC5B,EAAE,SAAS,SAAS,SAAS,SAAS,QAAQ,QAC7C;AACD,gBAAQ,KACP,uJAAuJ,OACtJ,yBAAyB,KAE1B,KAAK;AAAA,MAEN;AAAA,eACS,KAAK;AACf,UAAI,EAAE,SAAS,OAAO,QAAQ,MAAM;AACnC,gBAAQ,KACP,0JAA0J,OACzJ,yBAAyB,KAE1B,GAAG;AAAA,MAEJ;AAAA,IACD;AAAA,EACD;AAEK,QAAA,EACL,MAAM,cACN,KAAK,aACL,GAAG,UACA,YAAY,SAAS,KAAK;AAAA,IAC7B;AAAA,IACA,KAAK,OAAO,UAAU,QAAQ,aAAa,UAAU,MAAM;AAAA,EAAA,CAC3D;AAED,MAAI,MAA0B;AAC9B,MAAI,SAAS,aAAa,OAAO,UAAU,QAAQ,YAAY;AAC9D,UAAM,UAAU;AAAA,EAChB;AAED,QAAM,QAAQ,UAAU,YAAY,UAAU,OAAO,iBAAiB;AAEtE,QAAM,oBAAqB,qBAC1B;AACD,QAAM,oBAAqB,qBAC1B;AACD,QAAM,YACL,QAAQ,cAAc,IAAI,IAAI,oBAAoB;AAGlD,SAAA,oBAAC,aAAU,KAAc,GAAA,OAAO,GAAI,WAAW,MAAY,IAAS,CAAA;AAEtE,CAAC;"}
1
+ {"version":3,"file":"PrismicLink.js","sources":["../../../src/react-server/PrismicLink.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {\n\tLinkField,\n\tLinkResolverFunction,\n\tPrismicDocument,\n\tasLinkAttrs,\n\tAsLinkAttrsConfig,\n} from \"@prismicio/client\";\n\nimport { devMsg } from \"../lib/devMsg\";\nimport { isInternalURL } from \"../lib/isInternalURL\";\n\n/**\n * The default component rendered for internal and external links.\n */\nexport const defaultComponent = \"a\";\n\n/**\n * Props provided to a component when rendered with `<PrismicLink>`.\n */\nexport interface LinkProps {\n\t/**\n\t * The URL to link.\n\t */\n\thref: string;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: React.HTMLAttributeAnchorTarget;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n}\n\nexport type PrismicLinkProps<\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n> = Omit<\n\tInternalComponentProps & ExternalComponentProps,\n\t\"rel\" | \"href\" | \"children\"\n> & {\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"];\n\n\t/**\n\t * The Link Resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * The component rendered for internal URLs. Defaults to `<a>`.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t */\n\tinternalComponent?: React.ElementType<InternalComponentProps>;\n\n\t/**\n\t * The component rendered for external URLs. Defaults to `<a>`.\n\t */\n\texternalComponent?: React.ComponentType<ExternalComponentProps>;\n\n\t/**\n\t * The children to render for the link. If no children are provided, the\n\t * link's `text` property will be used.\n\t */\n\tchildren?: React.ReactNode;\n} & (\n\t\t| {\n\t\t\t\tdocument: PrismicDocument | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tfield?: never;\n\t\t }\n\t\t| {\n\t\t\t\tfield: LinkField | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tdocument?: never;\n\t\t }\n\t\t| {\n\t\t\t\thref: LinkProps[\"href\"];\n\t\t\t\tfield?: LinkField | null | undefined;\n\t\t\t\tdocument?: never;\n\t\t }\n\t);\n\nexport const PrismicLink = React.forwardRef(function PrismicLink<\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n>(\n\tprops: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,\n\tref: React.ForwardedRef<Element>,\n): JSX.Element {\n\tconst {\n\t\tfield,\n\t\tdocument: doc,\n\t\tlinkResolver,\n\t\tinternalComponent,\n\t\texternalComponent,\n\t\tchildren,\n\t\t...restProps\n\t} = props;\n\n\tif (\n\t\ttypeof process !== \"undefined\" &&\n\t\tprocess.env.NODE_ENV === \"development\"\n\t) {\n\t\tif (field) {\n\t\t\tif (!field.link_type) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`[PrismicLink] This \"field\" prop value caused an error to be thrown.\\n`,\n\t\t\t\t\tfield,\n\t\t\t\t);\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\t(\"text\" in field\n\t\t\t\t\t? Object.keys(field).length > 2\n\t\t\t\t\t: Object.keys(field).length > 1) &&\n\t\t\t\t!(\"url\" in field || \"uid\" in field || \"id\" in field)\n\t\t\t) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tfield,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (doc) {\n\t\t\tif (!(\"url\" in doc || \"id\" in doc)) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided document is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tdoc,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = asLinkAttrs(field ?? doc, {\n\t\tlinkResolver,\n\t\trel: typeof restProps.rel === \"function\" ? restProps.rel : undefined,\n\t});\n\n\tlet rel: string | undefined = computedRel;\n\tif (\"rel\" in restProps && typeof restProps.rel !== \"function\") {\n\t\trel = restProps.rel;\n\t}\n\n\tconst href = (\"href\" in restProps ? restProps.href : computedHref) || \"\";\n\n\tconst InternalComponent = (internalComponent ||\n\t\tdefaultComponent) as React.ComponentType<LinkProps>;\n\tconst ExternalComponent = (externalComponent ||\n\t\tdefaultComponent) as React.ComponentType<LinkProps>;\n\tconst Component =\n\t\thref && isInternalURL(href) ? InternalComponent : ExternalComponent;\n\n\treturn (\n\t\t<Component ref={ref} {...attrs} {...restProps} href={href} rel={rel}>\n\t\t\t{\"children\" in props ? children : field?.text}\n\t\t</Component>\n\t);\n}) as <\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n>(\n\tprops: PrismicLinkProps<InternalComponentProps, ExternalComponentProps> & {\n\t\tref?: React.ForwardedRef<Element>;\n\t},\n) => JSX.Element;\n"],"names":["PrismicLink"],"mappings":";;;;;AAeO,MAAM,mBAAmB;AAyFzB,MAAM,cAAc,MAAM,WAAW,SAASA,aAIpD,OACA,KAAgC;AAE1B,QAAA,EACL,OACA,UAAU,KACV,cACA,mBACA,mBACA,UACA,GAAG,UAAA,IACA;AAEJ,MACC,OAAO,YAAY,eACnB,QAAQ,IAAI,aAAa,eACxB;AACD,QAAI,OAAO;AACN,UAAA,CAAC,MAAM,WAAW;AACrB,gBAAQ,MACP;AAAA,GACA,KAAK;AAEN,cAAM,IAAI,MACT,8IAA8I,OAC7I,yBAAyB,GACvB;AAAA,MAAA,YAGH,UAAU,QACR,OAAO,KAAK,KAAK,EAAE,SAAS,IAC5B,OAAO,KAAK,KAAK,EAAE,SAAS,MAC/B,EAAE,SAAS,SAAS,SAAS,SAAS,QAAQ,QAC7C;AACD,gBAAQ,KACP,uJAAuJ,OACtJ,yBAAyB,KAE1B,KAAK;AAAA,MAEN;AAAA,eACS,KAAK;AACf,UAAI,EAAE,SAAS,OAAO,QAAQ,MAAM;AACnC,gBAAQ,KACP,0JAA0J,OACzJ,yBAAyB,KAE1B,GAAG;AAAA,MAEJ;AAAA,IACD;AAAA,EACD;AAEK,QAAA,EACL,MAAM,cACN,KAAK,aACL,GAAG,UACA,YAAY,SAAS,KAAK;AAAA,IAC7B;AAAA,IACA,KAAK,OAAO,UAAU,QAAQ,aAAa,UAAU,MAAM;AAAA,EAAA,CAC3D;AAED,MAAI,MAA0B;AAC9B,MAAI,SAAS,aAAa,OAAO,UAAU,QAAQ,YAAY;AAC9D,UAAM,UAAU;AAAA,EAChB;AAED,QAAM,QAAQ,UAAU,YAAY,UAAU,OAAO,iBAAiB;AAEtE,QAAM,oBAAqB,qBAC1B;AACD,QAAM,oBAAqB,qBAC1B;AACD,QAAM,YACL,QAAQ,cAAc,IAAI,IAAI,oBAAoB;AAEnD,SACE,oBAAA,WAAA,EAAU,KAAc,GAAA,OAAW,GAAA,WAAW,MAAY,KACzD,UAAA,cAAc,QAAQ,WAAW,+BAAO,KAC1C,CAAA;AAEF,CAAC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/react",
3
- "version": "2.7.4",
3
+ "version": "2.9.0-alpha.0",
4
4
  "description": "React components and hooks to fetch and present Prismic content",
5
5
  "keywords": [
6
6
  "typescript",
@@ -69,8 +69,8 @@
69
69
  "@prismicio/richtext": "^2.1.5"
70
70
  },
71
71
  "devDependencies": {
72
- "@prismicio/client": "^7.1.0",
73
- "@prismicio/mock": "^0.3.1",
72
+ "@prismicio/client": "7.9.0-alpha.3",
73
+ "@prismicio/mock": "0.3.8-alpha.2",
74
74
  "@size-limit/preset-small-lib": "^8.2.4",
75
75
  "@testing-library/react": "^14.0.0",
76
76
  "@types/node-fetch": "^3.0.3",
@@ -104,12 +104,16 @@
104
104
  },
105
105
  "peerDependencies": {
106
106
  "@prismicio/client": "^6 || ^7",
107
- "react": "^18"
107
+ "react": "^18 || ^19.0.0-rc.0"
108
108
  },
109
109
  "engines": {
110
110
  "node": ">=12.7.0"
111
111
  },
112
112
  "publishConfig": {
113
113
  "access": "public"
114
+ },
115
+ "overrides": {
116
+ "@prismicio/client": "7.9.0-alpha.3",
117
+ "@prismicio/mock": "0.3.8-alpha.2"
114
118
  }
115
119
  }
@@ -45,7 +45,10 @@ export interface LinkProps {
45
45
  export type PrismicLinkProps<
46
46
  InternalComponentProps = React.ComponentProps<typeof defaultComponent>,
47
47
  ExternalComponentProps = React.ComponentProps<typeof defaultComponent>,
48
- > = Omit<InternalComponentProps & ExternalComponentProps, "rel" | "href"> & {
48
+ > = Omit<
49
+ InternalComponentProps & ExternalComponentProps,
50
+ "rel" | "href" | "children"
51
+ > & {
49
52
  /**
50
53
  * The `rel` attribute for the link. By default, `"noreferrer"` is provided if
51
54
  * the link's URL is external. This prop can be provided a function to use the
@@ -75,6 +78,12 @@ export type PrismicLinkProps<
75
78
  * The component rendered for external URLs. Defaults to `<a>`.
76
79
  */
77
80
  externalComponent?: React.ComponentType<ExternalComponentProps>;
81
+
82
+ /**
83
+ * The children to render for the link. If no children are provided, the
84
+ * link's `text` property will be used.
85
+ */
86
+ children?: React.ReactNode;
78
87
  } & (
79
88
  | {
80
89
  document: PrismicDocument | null | undefined;
@@ -97,16 +106,19 @@ export const PrismicLink = React.forwardRef(function PrismicLink<
97
106
  InternalComponentProps = React.ComponentProps<typeof defaultComponent>,
98
107
  ExternalComponentProps = React.ComponentProps<typeof defaultComponent>,
99
108
  >(
100
- {
109
+ props: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,
110
+ ref: React.ForwardedRef<Element>,
111
+ ): JSX.Element {
112
+ const {
101
113
  field,
102
114
  document: doc,
103
115
  linkResolver,
104
116
  internalComponent,
105
117
  externalComponent,
118
+ children,
106
119
  ...restProps
107
- }: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,
108
- ref: React.ForwardedRef<Element>,
109
- ): JSX.Element {
120
+ } = props;
121
+
110
122
  if (
111
123
  typeof process !== "undefined" &&
112
124
  process.env.NODE_ENV === "development"
@@ -123,7 +135,9 @@ export const PrismicLink = React.forwardRef(function PrismicLink<
123
135
  )}`,
124
136
  );
125
137
  } else if (
126
- Object.keys(field).length > 1 &&
138
+ ("text" in field
139
+ ? Object.keys(field).length > 2
140
+ : Object.keys(field).length > 1) &&
127
141
  !("url" in field || "uid" in field || "id" in field)
128
142
  ) {
129
143
  console.warn(
@@ -169,7 +183,9 @@ export const PrismicLink = React.forwardRef(function PrismicLink<
169
183
  href && isInternalURL(href) ? InternalComponent : ExternalComponent;
170
184
 
171
185
  return (
172
- <Component ref={ref} {...attrs} {...restProps} href={href} rel={rel} />
186
+ <Component ref={ref} {...attrs} {...restProps} href={href} rel={rel}>
187
+ {"children" in props ? children : field?.text}
188
+ </Component>
173
189
  );
174
190
  }) as <
175
191
  InternalComponentProps = React.ComponentProps<typeof defaultComponent>,
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../node_modules/imgix-url-builder/dist/index.mjs"],"sourcesContent":["const camelCaseToParamCase = (input) => {\n return input.replace(/[A-Z]/g, (match) => {\n return `-${match.toLowerCase()}`;\n });\n};\nconst buildURL = (url, params) => {\n const instance = new URL(url);\n for (const camelCasedParamKey in params) {\n const paramKey = camelCaseToParamCase(camelCasedParamKey);\n const paramValue = params[camelCasedParamKey];\n if (paramValue === void 0) {\n instance.searchParams.delete(paramKey);\n } else if (Array.isArray(paramValue)) {\n instance.searchParams.set(paramKey, paramValue.join(\",\"));\n } else {\n instance.searchParams.set(paramKey, `${paramValue}`);\n }\n }\n const s = instance.searchParams.get(\"s\");\n if (s) {\n instance.searchParams.delete(\"s\");\n instance.searchParams.append(\"s\", s);\n }\n return instance.toString();\n};\n\nconst buildPixelDensitySrcSet = (url, { pixelDensities, ...params }) => {\n return pixelDensities.map((dpr) => {\n return `${buildURL(url, { ...params, dpr })} ${dpr}x`;\n }).join(\", \");\n};\n\nconst buildWidthSrcSet = (url, { widths, ...params }) => {\n return widths.map((width) => {\n return `${buildURL(url, { ...params, w: void 0, width })} ${width}w`;\n }).join(\", \");\n};\n\nclass Client {\n constructor(options) {\n this.baseURL = options.baseURL;\n }\n buildURLForPath(path, params = {}) {\n return buildURL(`${new URL(path, this.baseURL)}`, params);\n }\n buildWidthSrcSetForPath(path, params) {\n return buildWidthSrcSet(`${new URL(path, this.baseURL)}`, params);\n }\n buildPixelDensitySrcSetForPath(path, params) {\n return buildPixelDensitySrcSet(`${new URL(path, this.baseURL)}`, params);\n }\n}\n\nexport { Client, buildPixelDensitySrcSet, buildURL, buildWidthSrcSet };\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;AAAA,MAAM,uBAAuB,CAAC,UAAU;AACtC,SAAO,MAAM,QAAQ,UAAU,CAAC,UAAU;AACxC,WAAO,IAAI,MAAM,YAAW;AAAA,EAChC,CAAG;AACH;AACK,MAAC,WAAW,CAAC,KAAK,WAAW;AAChC,QAAM,WAAW,IAAI,IAAI,GAAG;AAC5B,aAAW,sBAAsB,QAAQ;AACvC,UAAM,WAAW,qBAAqB,kBAAkB;AACxD,UAAM,aAAa,OAAO,kBAAkB;AAC5C,QAAI,eAAe,QAAQ;AACzB,eAAS,aAAa,OAAO,QAAQ;AAAA,IACtC,WAAU,MAAM,QAAQ,UAAU,GAAG;AACpC,eAAS,aAAa,IAAI,UAAU,WAAW,KAAK,GAAG,CAAC;AAAA,IAC9D,OAAW;AACL,eAAS,aAAa,IAAI,UAAU,GAAG,YAAY;AAAA,IACpD;AAAA,EACF;AACD,QAAM,IAAI,SAAS,aAAa,IAAI,GAAG;AACvC,MAAI,GAAG;AACL,aAAS,aAAa,OAAO,GAAG;AAChC,aAAS,aAAa,OAAO,KAAK,CAAC;AAAA,EACpC;AACD,SAAO,SAAS;AAClB;AAEK,MAAC,0BAA0B,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAM,MAAO;AACtE,SAAO,eAAe,IAAI,CAAC,QAAQ;AACjC,WAAO,GAAG,SAAS,KAAK,EAAE,GAAG,QAAQ,IAAG,CAAE,KAAK;AAAA,EACnD,CAAG,EAAE,KAAK,IAAI;AACd;AAEK,MAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAM,MAAO;AACvD,SAAO,OAAO,IAAI,CAAC,UAAU;AAC3B,WAAO,GAAG,SAAS,KAAK,EAAE,GAAG,QAAQ,GAAG,QAAQ,MAAK,CAAE,KAAK;AAAA,EAChE,CAAG,EAAE,KAAK,IAAI;AACd;;;;","x_google_ignoreList":[0]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../node_modules/imgix-url-builder/dist/index.mjs"],"sourcesContent":["const camelCaseToParamCase = (input) => {\n return input.replace(/[A-Z]/g, (match) => {\n return `-${match.toLowerCase()}`;\n });\n};\nconst buildURL = (url, params) => {\n const instance = new URL(url);\n for (const camelCasedParamKey in params) {\n const paramKey = camelCaseToParamCase(camelCasedParamKey);\n const paramValue = params[camelCasedParamKey];\n if (paramValue === void 0) {\n instance.searchParams.delete(paramKey);\n } else if (Array.isArray(paramValue)) {\n instance.searchParams.set(paramKey, paramValue.join(\",\"));\n } else {\n instance.searchParams.set(paramKey, `${paramValue}`);\n }\n }\n const s = instance.searchParams.get(\"s\");\n if (s) {\n instance.searchParams.delete(\"s\");\n instance.searchParams.append(\"s\", s);\n }\n return instance.toString();\n};\n\nconst buildPixelDensitySrcSet = (url, { pixelDensities, ...params }) => {\n return pixelDensities.map((dpr) => {\n return `${buildURL(url, { ...params, dpr })} ${dpr}x`;\n }).join(\", \");\n};\n\nconst buildWidthSrcSet = (url, { widths, ...params }) => {\n return widths.map((width) => {\n return `${buildURL(url, { ...params, w: void 0, width })} ${width}w`;\n }).join(\", \");\n};\n\nclass Client {\n constructor(options) {\n this.baseURL = options.baseURL;\n }\n buildURLForPath(path, params = {}) {\n return buildURL(`${new URL(path, this.baseURL)}`, params);\n }\n buildWidthSrcSetForPath(path, params) {\n return buildWidthSrcSet(`${new URL(path, this.baseURL)}`, params);\n }\n buildPixelDensitySrcSetForPath(path, params) {\n return buildPixelDensitySrcSet(`${new URL(path, this.baseURL)}`, params);\n }\n}\n\nexport { Client, buildPixelDensitySrcSet, buildURL, buildWidthSrcSet };\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":"AAAA,MAAM,uBAAuB,CAAC,UAAU;AACtC,SAAO,MAAM,QAAQ,UAAU,CAAC,UAAU;AACxC,WAAO,IAAI,MAAM,YAAW;AAAA,EAChC,CAAG;AACH;AACK,MAAC,WAAW,CAAC,KAAK,WAAW;AAChC,QAAM,WAAW,IAAI,IAAI,GAAG;AAC5B,aAAW,sBAAsB,QAAQ;AACvC,UAAM,WAAW,qBAAqB,kBAAkB;AACxD,UAAM,aAAa,OAAO,kBAAkB;AAC5C,QAAI,eAAe,QAAQ;AACzB,eAAS,aAAa,OAAO,QAAQ;AAAA,IACtC,WAAU,MAAM,QAAQ,UAAU,GAAG;AACpC,eAAS,aAAa,IAAI,UAAU,WAAW,KAAK,GAAG,CAAC;AAAA,IAC9D,OAAW;AACL,eAAS,aAAa,IAAI,UAAU,GAAG,YAAY;AAAA,IACpD;AAAA,EACF;AACD,QAAM,IAAI,SAAS,aAAa,IAAI,GAAG;AACvC,MAAI,GAAG;AACL,aAAS,aAAa,OAAO,GAAG;AAChC,aAAS,aAAa,OAAO,KAAK,CAAC;AAAA,EACpC;AACD,SAAO,SAAS;AAClB;AAEK,MAAC,0BAA0B,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAM,MAAO;AACtE,SAAO,eAAe,IAAI,CAAC,QAAQ;AACjC,WAAO,GAAG,SAAS,KAAK,EAAE,GAAG,QAAQ,IAAG,CAAE,KAAK;AAAA,EACnD,CAAG,EAAE,KAAK,IAAI;AACd;AAEK,MAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAM,MAAO;AACvD,SAAO,OAAO,IAAI,CAAC,UAAU;AAC3B,WAAO,GAAG,SAAS,KAAK,EAAE,GAAG,QAAQ,GAAG,QAAQ,MAAK,CAAE,KAAK;AAAA,EAChE,CAAG,EAAE,KAAK,IAAI;AACd;","x_google_ignoreList":[0]}