@prismicio/client 7.7.3 → 7.7.4

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 (304) hide show
  1. package/README.md +3 -3
  2. package/dist/buildQueryURL.cjs.map +1 -1
  3. package/dist/buildQueryURL.d.ts +1 -1
  4. package/dist/buildQueryURL.js.map +1 -1
  5. package/dist/cookie.cjs.map +1 -1
  6. package/dist/cookie.js.map +1 -1
  7. package/dist/createClient.cjs +31 -31
  8. package/dist/createClient.cjs.map +1 -1
  9. package/dist/createClient.d.ts +35 -35
  10. package/dist/createClient.js +31 -31
  11. package/dist/createClient.js.map +1 -1
  12. package/dist/errors/ForbiddenError.cjs.map +1 -1
  13. package/dist/errors/ForbiddenError.js.map +1 -1
  14. package/dist/errors/NotFoundError.cjs.map +1 -1
  15. package/dist/errors/NotFoundError.js.map +1 -1
  16. package/dist/errors/ParsingError.cjs.map +1 -1
  17. package/dist/errors/ParsingError.js.map +1 -1
  18. package/dist/errors/PreviewTokenExpired.cjs.map +1 -1
  19. package/dist/errors/PreviewTokenExpired.js.map +1 -1
  20. package/dist/errors/PrismicError.cjs.map +1 -1
  21. package/dist/errors/PrismicError.js.map +1 -1
  22. package/dist/errors/PrismicRichTextSerializerError.cjs.map +1 -1
  23. package/dist/errors/PrismicRichTextSerializerError.js.map +1 -1
  24. package/dist/errors/RefExpiredError.cjs.map +1 -1
  25. package/dist/errors/RefExpiredError.js.map +1 -1
  26. package/dist/errors/RefNotFoundError.cjs.map +1 -1
  27. package/dist/errors/RefNotFoundError.js.map +1 -1
  28. package/dist/errors/RepositoryNotFoundError.cjs.map +1 -1
  29. package/dist/errors/RepositoryNotFoundError.js.map +1 -1
  30. package/dist/filter.cjs.map +1 -1
  31. package/dist/filter.js.map +1 -1
  32. package/dist/getGraphQLEndpoint.cjs.map +1 -1
  33. package/dist/getGraphQLEndpoint.js.map +1 -1
  34. package/dist/getRepositoryEndpoint.cjs.map +1 -1
  35. package/dist/getRepositoryEndpoint.js.map +1 -1
  36. package/dist/getRepositoryName.cjs.map +1 -1
  37. package/dist/getRepositoryName.js.map +1 -1
  38. package/dist/getToolbarSrc.cjs.map +1 -1
  39. package/dist/getToolbarSrc.js.map +1 -1
  40. package/dist/helpers/asDate.cjs.map +1 -1
  41. package/dist/helpers/asDate.js.map +1 -1
  42. package/dist/helpers/asHTML.cjs.map +1 -1
  43. package/dist/helpers/asHTML.d.ts +2 -2
  44. package/dist/helpers/asHTML.js.map +1 -1
  45. package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
  46. package/dist/helpers/asImagePixelDensitySrcSet.d.ts +2 -2
  47. package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
  48. package/dist/helpers/asImageSrc.cjs.map +1 -1
  49. package/dist/helpers/asImageSrc.d.ts +2 -2
  50. package/dist/helpers/asImageSrc.js.map +1 -1
  51. package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
  52. package/dist/helpers/asImageWidthSrcSet.d.ts +2 -2
  53. package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
  54. package/dist/helpers/asLink.cjs.map +1 -1
  55. package/dist/helpers/asLink.d.ts +2 -4
  56. package/dist/helpers/asLink.js.map +1 -1
  57. package/dist/helpers/asLinkAttrs.cjs.map +1 -1
  58. package/dist/helpers/asLinkAttrs.d.ts +2 -2
  59. package/dist/helpers/asLinkAttrs.js.map +1 -1
  60. package/dist/helpers/asText.cjs.map +1 -1
  61. package/dist/helpers/asText.d.ts +1 -1
  62. package/dist/helpers/asText.js.map +1 -1
  63. package/dist/helpers/documentToLinkField.cjs.map +1 -1
  64. package/dist/helpers/documentToLinkField.js.map +1 -1
  65. package/dist/helpers/isFilled.cjs.map +1 -1
  66. package/dist/helpers/isFilled.js.map +1 -1
  67. package/dist/helpers/mapSliceZone.cjs.map +1 -1
  68. package/dist/helpers/mapSliceZone.d.ts +1 -1
  69. package/dist/helpers/mapSliceZone.js.map +1 -1
  70. package/dist/helpers/unstable_htmlAsRichText.cjs.map +1 -1
  71. package/dist/helpers/unstable_htmlAsRichText.d.ts +4 -4
  72. package/dist/helpers/unstable_htmlAsRichText.js.map +1 -1
  73. package/dist/helpers/unstable_markdownAsRichText.cjs.map +1 -1
  74. package/dist/helpers/unstable_markdownAsRichText.d.ts +2 -2
  75. package/dist/helpers/unstable_markdownAsRichText.js.map +1 -1
  76. package/dist/index.cjs.map +1 -1
  77. package/dist/index.js.map +1 -1
  78. package/dist/isRepositoryEndpoint.cjs.map +1 -1
  79. package/dist/isRepositoryEndpoint.js.map +1 -1
  80. package/dist/isRepositoryName.cjs.map +1 -1
  81. package/dist/isRepositoryName.js.map +1 -1
  82. package/dist/lib/RichTextFieldBuilder.cjs.map +1 -1
  83. package/dist/lib/RichTextFieldBuilder.d.ts +1 -1
  84. package/dist/lib/RichTextFieldBuilder.js.map +1 -1
  85. package/dist/lib/appendFilters.cjs.map +1 -1
  86. package/dist/lib/appendFilters.js.map +1 -1
  87. package/dist/lib/castArray.cjs.map +1 -1
  88. package/dist/lib/castArray.js.map +1 -1
  89. package/dist/lib/castThunk.cjs.map +1 -1
  90. package/dist/lib/castThunk.js.map +1 -1
  91. package/dist/lib/devMsg.cjs.map +1 -1
  92. package/dist/lib/devMsg.d.ts +1 -1
  93. package/dist/lib/devMsg.js.map +1 -1
  94. package/dist/lib/escapeHTML.cjs.map +1 -1
  95. package/dist/lib/escapeHTML.js.map +1 -1
  96. package/dist/lib/everyTagFilter.cjs.map +1 -1
  97. package/dist/lib/everyTagFilter.js.map +1 -1
  98. package/dist/lib/filterRichTextField.cjs.map +1 -1
  99. package/dist/lib/filterRichTextField.d.ts +3 -3
  100. package/dist/lib/filterRichTextField.js.map +1 -1
  101. package/dist/lib/findMasterRef.cjs.map +1 -1
  102. package/dist/lib/findMasterRef.d.ts +1 -1
  103. package/dist/lib/findMasterRef.js.map +1 -1
  104. package/dist/lib/findRef.cjs.map +1 -1
  105. package/dist/lib/findRef.d.ts +1 -1
  106. package/dist/lib/findRef.js.map +1 -1
  107. package/dist/lib/findRefByID.cjs.map +1 -1
  108. package/dist/lib/findRefByID.d.ts +1 -1
  109. package/dist/lib/findRefByID.js.map +1 -1
  110. package/dist/lib/findRefByLabel.cjs.map +1 -1
  111. package/dist/lib/findRefByLabel.d.ts +1 -1
  112. package/dist/lib/findRefByLabel.js.map +1 -1
  113. package/dist/lib/getPreviewCookie.cjs.map +1 -1
  114. package/dist/lib/getPreviewCookie.js.map +1 -1
  115. package/dist/lib/hastSerializerHelpers.cjs.map +1 -1
  116. package/dist/lib/hastSerializerHelpers.d.ts +3 -3
  117. package/dist/lib/hastSerializerHelpers.js.map +1 -1
  118. package/dist/lib/hastToRichText.cjs +1 -2
  119. package/dist/lib/hastToRichText.cjs.map +1 -1
  120. package/dist/lib/hastToRichText.d.ts +4 -4
  121. package/dist/lib/hastToRichText.js +1 -2
  122. package/dist/lib/hastToRichText.js.map +1 -1
  123. package/dist/lib/isInternalURL.cjs.map +1 -1
  124. package/dist/lib/isInternalURL.js.map +1 -1
  125. package/dist/lib/minifyGraphQLQuery.cjs.map +1 -1
  126. package/dist/lib/minifyGraphQLQuery.js.map +1 -1
  127. package/dist/lib/rehypeRichText.cjs.map +1 -1
  128. package/dist/lib/rehypeRichText.d.ts +5 -5
  129. package/dist/lib/rehypeRichText.js.map +1 -1
  130. package/dist/lib/serializerHelpers.cjs.map +1 -1
  131. package/dist/lib/serializerHelpers.d.ts +2 -2
  132. package/dist/lib/serializerHelpers.js.map +1 -1
  133. package/dist/lib/someTagsFilter.cjs.map +1 -1
  134. package/dist/lib/someTagsFilter.js.map +1 -1
  135. package/dist/lib/typeFilter.cjs.map +1 -1
  136. package/dist/lib/typeFilter.js.map +1 -1
  137. package/dist/package.json.cjs +1 -1
  138. package/dist/package.json.js +1 -1
  139. package/dist/richtext/asText.cjs.map +1 -1
  140. package/dist/richtext/asText.d.ts +1 -1
  141. package/dist/richtext/asText.js.map +1 -1
  142. package/dist/richtext/asTree.cjs.map +1 -1
  143. package/dist/richtext/asTree.d.ts +2 -2
  144. package/dist/richtext/asTree.js.map +1 -1
  145. package/dist/richtext/composeSerializers.cjs.map +1 -1
  146. package/dist/richtext/composeSerializers.d.ts +1 -1
  147. package/dist/richtext/composeSerializers.js.map +1 -1
  148. package/dist/richtext/serialize.cjs.map +1 -1
  149. package/dist/richtext/serialize.d.ts +1 -1
  150. package/dist/richtext/serialize.js.map +1 -1
  151. package/dist/richtext/types.cjs.map +1 -1
  152. package/dist/richtext/types.d.ts +1 -1
  153. package/dist/richtext/types.js.map +1 -1
  154. package/dist/richtext/wrapMapSerializer.cjs.map +1 -1
  155. package/dist/richtext/wrapMapSerializer.d.ts +1 -1
  156. package/dist/richtext/wrapMapSerializer.js.map +1 -1
  157. package/dist/types/api/query.d.ts +1 -1
  158. package/dist/types/api/release.d.ts +1 -1
  159. package/dist/types/api/repository.d.ts +1 -1
  160. package/dist/types/model/customType.d.ts +1 -1
  161. package/dist/types/model/link.cjs.map +1 -1
  162. package/dist/types/model/link.js.map +1 -1
  163. package/dist/types/model/slice.cjs.map +1 -1
  164. package/dist/types/model/slice.js.map +1 -1
  165. package/dist/types/model/sliceZone.cjs.map +1 -1
  166. package/dist/types/model/sliceZone.js.map +1 -1
  167. package/dist/types/model/title.d.ts +1 -1
  168. package/dist/types/model/types.cjs.map +1 -1
  169. package/dist/types/model/types.js.map +1 -1
  170. package/dist/types/value/document.d.ts +4 -4
  171. package/dist/types/value/embed.cjs.map +1 -1
  172. package/dist/types/value/embed.js.map +1 -1
  173. package/dist/types/value/link.cjs.map +1 -1
  174. package/dist/types/value/link.js.map +1 -1
  175. package/dist/types/value/richText.cjs.map +1 -1
  176. package/dist/types/value/richText.js.map +1 -1
  177. package/dist/types/webhook/apiUpdate.d.ts +1 -1
  178. package/dist/types/webhook/testTrigger.d.ts +1 -1
  179. package/dist/types/webhook/types.cjs.map +1 -1
  180. package/dist/types/webhook/types.d.ts +2 -2
  181. package/dist/types/webhook/types.js.map +1 -1
  182. package/package.json +1 -1
  183. package/src/buildQueryURL.ts +51 -51
  184. package/src/cookie.ts +1 -1
  185. package/src/createClient.ts +293 -293
  186. package/src/errors/ForbiddenError.ts +6 -6
  187. package/src/errors/NotFoundError.ts +1 -1
  188. package/src/errors/ParsingError.ts +8 -8
  189. package/src/errors/PreviewTokenExpired.ts +4 -4
  190. package/src/errors/PrismicError.ts +5 -5
  191. package/src/errors/PrismicRichTextSerializerError.ts +1 -1
  192. package/src/errors/RefExpiredError.ts +4 -4
  193. package/src/errors/RefNotFoundError.ts +4 -4
  194. package/src/errors/RepositoryNotFoundError.ts +1 -1
  195. package/src/filter.ts +22 -22
  196. package/src/getGraphQLEndpoint.ts +5 -5
  197. package/src/getRepositoryEndpoint.ts +5 -5
  198. package/src/getRepositoryName.ts +4 -4
  199. package/src/getToolbarSrc.ts +5 -5
  200. package/src/helpers/asDate.ts +7 -7
  201. package/src/helpers/asHTML.ts +54 -56
  202. package/src/helpers/asImagePixelDensitySrcSet.ts +14 -17
  203. package/src/helpers/asImageSrc.ts +9 -8
  204. package/src/helpers/asImageWidthSrcSet.ts +19 -22
  205. package/src/helpers/asLink.ts +26 -27
  206. package/src/helpers/asLinkAttrs.ts +30 -29
  207. package/src/helpers/asText.ts +15 -15
  208. package/src/helpers/documentToLinkField.ts +6 -6
  209. package/src/helpers/isFilled.ts +53 -53
  210. package/src/helpers/mapSliceZone.ts +34 -34
  211. package/src/helpers/unstable_htmlAsRichText.ts +23 -22
  212. package/src/helpers/unstable_markdownAsRichText.ts +14 -13
  213. package/src/index.ts +119 -119
  214. package/src/isRepositoryEndpoint.ts +4 -4
  215. package/src/isRepositoryName.ts +2 -2
  216. package/src/lib/RichTextFieldBuilder.ts +36 -41
  217. package/src/lib/appendFilters.ts +4 -4
  218. package/src/lib/castArray.ts +2 -2
  219. package/src/lib/castThunk.ts +2 -2
  220. package/src/lib/devMsg.ts +4 -4
  221. package/src/lib/escapeHTML.ts +24 -24
  222. package/src/lib/everyTagFilter.ts +4 -4
  223. package/src/lib/filterRichTextField.ts +31 -31
  224. package/src/lib/findMasterRef.ts +4 -4
  225. package/src/lib/findRef.ts +6 -6
  226. package/src/lib/findRefByID.ts +4 -4
  227. package/src/lib/findRefByLabel.ts +4 -4
  228. package/src/lib/getPreviewCookie.ts +11 -11
  229. package/src/lib/hastSerializerHelpers.ts +41 -37
  230. package/src/lib/hastToRichText.ts +74 -73
  231. package/src/lib/isInternalURL.ts +4 -4
  232. package/src/lib/minifyGraphQLQuery.ts +2 -2
  233. package/src/lib/rehypeRichText.ts +42 -41
  234. package/src/lib/serializerHelpers.ts +53 -54
  235. package/src/lib/someTagsFilter.ts +4 -4
  236. package/src/lib/typeFilter.ts +3 -3
  237. package/src/richtext/asText.ts +5 -5
  238. package/src/richtext/asTree.ts +53 -53
  239. package/src/richtext/composeSerializers.ts +6 -6
  240. package/src/richtext/index.ts +7 -7
  241. package/src/richtext/serialize.ts +11 -11
  242. package/src/richtext/types.ts +38 -38
  243. package/src/richtext/wrapMapSerializer.ts +6 -9
  244. package/src/types/api/query.ts +9 -9
  245. package/src/types/api/ref.ts +5 -5
  246. package/src/types/api/release.ts +2 -2
  247. package/src/types/api/repository.ts +24 -24
  248. package/src/types/api/tags.ts +1 -1
  249. package/src/types/model/boolean.ts +7 -7
  250. package/src/types/model/color.ts +5 -5
  251. package/src/types/model/contentRelationship.ts +9 -9
  252. package/src/types/model/customType.ts +9 -9
  253. package/src/types/model/date.ts +6 -6
  254. package/src/types/model/embed.ts +5 -5
  255. package/src/types/model/geoPoint.ts +4 -4
  256. package/src/types/model/group.ts +6 -6
  257. package/src/types/model/image.ts +9 -9
  258. package/src/types/model/integration.ts +6 -6
  259. package/src/types/model/keyText.ts +5 -5
  260. package/src/types/model/link.ts +8 -8
  261. package/src/types/model/linkToMedia.ts +7 -7
  262. package/src/types/model/number.ts +7 -7
  263. package/src/types/model/range.ts +8 -8
  264. package/src/types/model/richText.ts +16 -16
  265. package/src/types/model/select.ts +7 -7
  266. package/src/types/model/separator.ts +4 -4
  267. package/src/types/model/sharedSlice.ts +7 -7
  268. package/src/types/model/sharedSliceVariation.ts +9 -9
  269. package/src/types/model/slice.ts +12 -12
  270. package/src/types/model/sliceZone.ts +11 -11
  271. package/src/types/model/timestamp.ts +6 -6
  272. package/src/types/model/title.ts +2 -2
  273. package/src/types/model/types.ts +26 -26
  274. package/src/types/model/uid.ts +5 -5
  275. package/src/types/value/boolean.ts +1 -1
  276. package/src/types/value/color.ts +2 -2
  277. package/src/types/value/contentRelationship.ts +15 -15
  278. package/src/types/value/date.ts +2 -2
  279. package/src/types/value/document.ts +23 -23
  280. package/src/types/value/embed.ts +33 -33
  281. package/src/types/value/geoPoint.ts +4 -4
  282. package/src/types/value/group.ts +3 -3
  283. package/src/types/value/image.ts +21 -21
  284. package/src/types/value/integration.ts +2 -2
  285. package/src/types/value/keyText.ts +2 -2
  286. package/src/types/value/link.ts +12 -12
  287. package/src/types/value/linkToMedia.ts +11 -11
  288. package/src/types/value/number.ts +2 -2
  289. package/src/types/value/richText.ts +58 -58
  290. package/src/types/value/select.ts +2 -2
  291. package/src/types/value/sharedSlice.ts +5 -5
  292. package/src/types/value/sharedSliceVariation.ts +5 -5
  293. package/src/types/value/slice.ts +6 -6
  294. package/src/types/value/sliceZone.ts +4 -4
  295. package/src/types/value/timestamp.ts +3 -3
  296. package/src/types/value/title.ts +4 -4
  297. package/src/types/value/types.ts +22 -22
  298. package/src/types/webhook/apiUpdate.ts +18 -18
  299. package/src/types/webhook/testTrigger.ts +2 -2
  300. package/src/types/webhook/types.ts +8 -8
  301. package/dist/_node_modules/hast-util-whitespace/lib/index.cjs +0 -11
  302. package/dist/_node_modules/hast-util-whitespace/lib/index.cjs.map +0 -1
  303. package/dist/_node_modules/hast-util-whitespace/lib/index.js +0 -11
  304. package/dist/_node_modules/hast-util-whitespace/lib/index.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types"
2
2
 
3
- import type { FilledContentRelationshipField } from "./contentRelationship";
4
- import type { EmbedField } from "./embed";
5
- import type { FilledLinkToWebField } from "./link";
6
- import type { FilledLinkToMediaField } from "./linkToMedia";
3
+ import type { FilledContentRelationshipField } from "./contentRelationship"
4
+ import type { EmbedField } from "./embed"
5
+ import type { FilledLinkToWebField } from "./link"
6
+ import type { FilledLinkToMediaField } from "./linkToMedia"
7
7
 
8
8
  /**
9
9
  * Types enum for RichTextNodes
@@ -30,7 +30,7 @@ export const RichTextNodeType = {
30
30
  hyperlink: "hyperlink",
31
31
  label: "label",
32
32
  span: "span",
33
- } as const;
33
+ } as const
34
34
 
35
35
  /**
36
36
  * Types for RichTextNodes
@@ -38,7 +38,7 @@ export const RichTextNodeType = {
38
38
  * @see More details: {@link https://prismic.io/docs/rich-text-title}
39
39
  */
40
40
  export type RichTextNodeTypes =
41
- (typeof RichTextNodeType)[keyof typeof RichTextNodeType];
41
+ (typeof RichTextNodeType)[keyof typeof RichTextNodeType]
42
42
 
43
43
  // Text nodes
44
44
 
@@ -46,79 +46,79 @@ export type RichTextNodeTypes =
46
46
  * Base to be extended by other rich text nodes.
47
47
  */
48
48
  export interface RTTextNodeBase {
49
- text: string;
50
- spans: RTInlineNode[];
51
- direction?: "ltr" | "rtl";
49
+ text: string
50
+ spans: RTInlineNode[]
51
+ direction?: "ltr" | "rtl"
52
52
  }
53
53
 
54
54
  /**
55
55
  * Rich text `heading1` node
56
56
  */
57
57
  export interface RTHeading1Node extends RTTextNodeBase {
58
- type: typeof RichTextNodeType.heading1;
58
+ type: typeof RichTextNodeType.heading1
59
59
  }
60
60
 
61
61
  /**
62
62
  * Rich text `heading2` node
63
63
  */
64
64
  export interface RTHeading2Node extends RTTextNodeBase {
65
- type: typeof RichTextNodeType.heading2;
65
+ type: typeof RichTextNodeType.heading2
66
66
  }
67
67
 
68
68
  /**
69
69
  * Rich text `heading3` node
70
70
  */
71
71
  export interface RTHeading3Node extends RTTextNodeBase {
72
- type: typeof RichTextNodeType.heading3;
72
+ type: typeof RichTextNodeType.heading3
73
73
  }
74
74
 
75
75
  /**
76
76
  * Rich text `heading4` node
77
77
  */
78
78
  export interface RTHeading4Node extends RTTextNodeBase {
79
- type: typeof RichTextNodeType.heading4;
79
+ type: typeof RichTextNodeType.heading4
80
80
  }
81
81
 
82
82
  /**
83
83
  * Rich text `heading5` node
84
84
  */
85
85
  export interface RTHeading5Node extends RTTextNodeBase {
86
- type: typeof RichTextNodeType.heading5;
86
+ type: typeof RichTextNodeType.heading5
87
87
  }
88
88
 
89
89
  /**
90
90
  * Rich text `heading6` node
91
91
  */
92
92
  export interface RTHeading6Node extends RTTextNodeBase {
93
- type: typeof RichTextNodeType.heading6;
93
+ type: typeof RichTextNodeType.heading6
94
94
  }
95
95
 
96
96
  /**
97
97
  * Rich text `paragraph` node
98
98
  */
99
99
  export interface RTParagraphNode extends RTTextNodeBase {
100
- type: typeof RichTextNodeType.paragraph;
100
+ type: typeof RichTextNodeType.paragraph
101
101
  }
102
102
 
103
103
  /**
104
104
  * Rich text `preformatted` node
105
105
  */
106
106
  export interface RTPreformattedNode extends RTTextNodeBase {
107
- type: typeof RichTextNodeType.preformatted;
107
+ type: typeof RichTextNodeType.preformatted
108
108
  }
109
109
 
110
110
  /**
111
111
  * Rich text `list-item` node
112
112
  */
113
113
  export interface RTListItemNode extends RTTextNodeBase {
114
- type: typeof RichTextNodeType.listItem;
114
+ type: typeof RichTextNodeType.listItem
115
115
  }
116
116
 
117
117
  /**
118
118
  * Rich text `o-list-item` node for ordered lists
119
119
  */
120
120
  export interface RTOListItemNode extends RTTextNodeBase {
121
- type: typeof RichTextNodeType.oListItem;
121
+ type: typeof RichTextNodeType.oListItem
122
122
  }
123
123
 
124
124
  // Span nodes
@@ -127,31 +127,31 @@ export interface RTOListItemNode extends RTTextNodeBase {
127
127
  * @internal Span Node base to be extended for other Span nodes
128
128
  */
129
129
  export interface RTSpanNodeBase {
130
- start: number;
131
- end: number;
130
+ start: number
131
+ end: number
132
132
  }
133
133
  /**
134
134
  * Rich text `strong` node
135
135
  */
136
136
  export interface RTStrongNode extends RTSpanNodeBase {
137
- type: typeof RichTextNodeType.strong;
137
+ type: typeof RichTextNodeType.strong
138
138
  }
139
139
 
140
140
  /**
141
141
  * Rich text `embed` node
142
142
  */
143
143
  export interface RTEmNode extends RTSpanNodeBase {
144
- type: typeof RichTextNodeType.em;
144
+ type: typeof RichTextNodeType.em
145
145
  }
146
146
 
147
147
  /**
148
148
  * Rich text `label` node
149
149
  */
150
150
  export interface RTLabelNode extends RTSpanNodeBase {
151
- type: typeof RichTextNodeType.label;
151
+ type: typeof RichTextNodeType.label
152
152
  data: {
153
- label: string;
154
- };
153
+ label: string
154
+ }
155
155
  }
156
156
 
157
157
  // Media nodes
@@ -161,34 +161,34 @@ export interface RTLabelNode extends RTSpanNodeBase {
161
161
  * links and media fields
162
162
  */
163
163
  export type RTImageNode = {
164
- type: typeof RichTextNodeType.image;
165
- id: string;
166
- url: string;
167
- alt: string | null;
168
- copyright: string | null;
164
+ type: typeof RichTextNodeType.image
165
+ id: string
166
+ url: string
167
+ alt: string | null
168
+ copyright: string | null
169
169
  dimensions: {
170
- width: number;
171
- height: number;
172
- };
170
+ width: number
171
+ height: number
172
+ }
173
173
  edit: {
174
- x: number;
175
- y: number;
176
- zoom: number;
177
- background: string;
178
- };
174
+ x: number
175
+ y: number
176
+ zoom: number
177
+ background: string
178
+ }
179
179
  linkTo?:
180
180
  | FilledContentRelationshipField
181
181
  | FilledLinkToWebField
182
- | FilledLinkToMediaField;
183
- };
182
+ | FilledLinkToMediaField
183
+ }
184
184
 
185
185
  /**
186
186
  * Rich text `embed` node
187
187
  */
188
188
  export type RTEmbedNode = {
189
- type: typeof RichTextNodeType.embed;
190
- oembed: EmbedField;
191
- };
189
+ type: typeof RichTextNodeType.embed
190
+ oembed: EmbedField
191
+ }
192
192
 
193
193
  // Link nodes
194
194
 
@@ -198,11 +198,11 @@ export type RTEmbedNode = {
198
198
  * @see More details: {@link https://prismic.io/docs/rich-text-title#elements-and-styles}
199
199
  */
200
200
  export interface RTLinkNode extends RTSpanNodeBase {
201
- type: typeof RichTextNodeType.hyperlink;
201
+ type: typeof RichTextNodeType.hyperlink
202
202
  data:
203
203
  | FilledContentRelationshipField
204
204
  | FilledLinkToWebField
205
- | FilledLinkToMediaField;
205
+ | FilledLinkToMediaField
206
206
  }
207
207
 
208
208
  // Serialization related nodes
@@ -211,16 +211,16 @@ export interface RTLinkNode extends RTSpanNodeBase {
211
211
  * Rich text `list` node
212
212
  */
213
213
  export interface RTListNode {
214
- type: typeof RichTextNodeType.list;
215
- items: RTListItemNode[];
214
+ type: typeof RichTextNodeType.list
215
+ items: RTListItemNode[]
216
216
  }
217
217
 
218
218
  /**
219
219
  * Rich text o-lost node
220
220
  */
221
221
  export interface RTOListNode {
222
- type: typeof RichTextNodeType.oList;
223
- items: RTOListItemNode[];
222
+ type: typeof RichTextNodeType.oList
223
+ items: RTOListItemNode[]
224
224
  }
225
225
 
226
226
  // This one is confusing but it's actually the inner content of a block
@@ -228,7 +228,7 @@ export interface RTOListNode {
228
228
  * Rich text `span` node
229
229
  */
230
230
  export interface RTSpanNode extends RTTextNodeBase {
231
- type: typeof RichTextNodeType.span;
231
+ type: typeof RichTextNodeType.span
232
232
  }
233
233
 
234
234
  // Helpers
@@ -248,7 +248,7 @@ export type RTNode =
248
248
  | RTListItemNode
249
249
  | RTOListItemNode
250
250
  | RTImageNode
251
- | RTEmbedNode;
251
+ | RTEmbedNode
252
252
 
253
253
  /**
254
254
  * Rich text nodes with text
@@ -263,7 +263,7 @@ export type RTTextNode =
263
263
  | RTParagraphNode
264
264
  | RTPreformattedNode
265
265
  | RTListItemNode
266
- | RTOListItemNode;
266
+ | RTOListItemNode
267
267
 
268
268
  /**
269
269
  * Rich text block nodes
@@ -282,17 +282,17 @@ export type RTBlockNode =
282
282
  | RTListNode
283
283
  | RTOListNode
284
284
  | RTImageNode
285
- | RTEmbedNode;
285
+ | RTEmbedNode
286
286
 
287
287
  /**
288
288
  * Inline rich text nodes
289
289
  */
290
- export type RTInlineNode = RTStrongNode | RTEmNode | RTLabelNode | RTLinkNode;
290
+ export type RTInlineNode = RTStrongNode | RTEmNode | RTLabelNode | RTLinkNode
291
291
 
292
292
  /**
293
293
  * All rich text nodes
294
294
  */
295
- export type RTAnyNode = RTBlockNode | RTInlineNode | RTSpanNode;
295
+ export type RTAnyNode = RTBlockNode | RTInlineNode | RTSpanNode
296
296
 
297
297
  /**
298
298
  * A rich text field.
@@ -300,4 +300,4 @@ export type RTAnyNode = RTBlockNode | RTInlineNode | RTSpanNode;
300
300
  * @see Rich text field documentation: {@link https://prismic.io/docs/rich-text-title}
301
301
  */
302
302
  export type RichTextField<State extends FieldState = FieldState> =
303
- State extends "empty" ? [] : [RTNode, ...RTNode[]];
303
+ State extends "empty" ? [] : [RTNode, ...RTNode[]]
@@ -1,4 +1,4 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types"
2
2
 
3
3
  /**
4
4
  * A select field.
@@ -11,4 +11,4 @@ import type { FieldState } from "./types";
11
11
  export type SelectField<
12
12
  Enum extends string = string,
13
13
  State extends FieldState = FieldState,
14
- > = State extends "empty" ? null : Enum;
14
+ > = State extends "empty" ? null : Enum
@@ -1,4 +1,4 @@
1
- import type { SharedSliceVariation } from "./sharedSliceVariation";
1
+ import type { SharedSliceVariation } from "./sharedSliceVariation"
2
2
 
3
3
  /**
4
4
  * A shared Slice.
@@ -9,7 +9,7 @@ export type SharedSlice<
9
9
  SliceType = string,
10
10
  Variations extends SharedSliceVariation = SharedSliceVariation,
11
11
  > = {
12
- slice_type: SliceType;
13
- slice_label: null;
14
- id: string;
15
- } & Variations;
12
+ slice_type: SliceType
13
+ slice_label: null
14
+ id: string
15
+ } & Variations
@@ -1,4 +1,4 @@
1
- import type { AnyRegularField, AnySlicePrimaryField } from "./types";
1
+ import type { AnyRegularField, AnySlicePrimaryField } from "./types"
2
2
 
3
3
  /**
4
4
  * A shared Slice variation.
@@ -14,8 +14,8 @@ export interface SharedSliceVariation<
14
14
  AnyRegularField
15
15
  >,
16
16
  > {
17
- variation: Variation;
18
- version: string;
19
- primary: PrimaryFields;
20
- items: ItemsFields[];
17
+ variation: Variation
18
+ version: string
19
+ primary: PrimaryFields
20
+ items: ItemsFields[]
21
21
  }
@@ -1,4 +1,4 @@
1
- import type { AnyRegularField } from "./types";
1
+ import type { AnyRegularField } from "./types"
2
2
 
3
3
  /**
4
4
  * A Slice - sections of your webpages.
@@ -16,9 +16,9 @@ export interface Slice<
16
16
  AnyRegularField
17
17
  >,
18
18
  > {
19
- slice_type: SliceType;
20
- slice_label: string | null;
21
- id: string;
22
- primary: PrimaryFields;
23
- items: ItemsFields[];
19
+ slice_type: SliceType
20
+ slice_label: string | null
21
+ id: string
22
+ primary: PrimaryFields
23
+ items: ItemsFields[]
24
24
  }
@@ -1,7 +1,7 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types"
2
2
 
3
- import type { SharedSlice } from "./sharedSlice";
4
- import type { Slice } from "./slice";
3
+ import type { SharedSlice } from "./sharedSlice"
4
+ import type { Slice } from "./slice"
5
5
 
6
6
  /**
7
7
  * Prismic Slices are sections of your website. Prismic documents contain a
@@ -14,4 +14,4 @@ import type { Slice } from "./slice";
14
14
  export type SliceZone<
15
15
  Slices extends Slice | SharedSlice = Slice | SharedSlice,
16
16
  State extends FieldState = FieldState,
17
- > = State extends "empty" ? [] : [Slices, ...Slices[]];
17
+ > = State extends "empty" ? [] : [Slices, ...Slices[]]
@@ -1,6 +1,6 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types"
2
2
 
3
- import type { DateField } from "./date";
3
+ import type { DateField } from "./date"
4
4
 
5
5
  /**
6
6
  * A timestamp field.
@@ -10,4 +10,4 @@ import type { DateField } from "./date";
10
10
  export type TimestampField<State extends FieldState = FieldState> =
11
11
  State extends "empty"
12
12
  ? null
13
- : `${DateField<"filled">}T${number}:${number}:${number}+${number}`;
13
+ : `${DateField<"filled">}T${number}:${number}:${number}+${number}`
@@ -1,4 +1,4 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types"
2
2
 
3
3
  import type {
4
4
  RTHeading1Node,
@@ -7,7 +7,7 @@ import type {
7
7
  RTHeading4Node,
8
8
  RTHeading5Node,
9
9
  RTHeading6Node,
10
- } from "./richText";
10
+ } from "./richText"
11
11
 
12
12
  /**
13
13
  * A title field.
@@ -27,6 +27,6 @@ export type TitleField<State extends FieldState = FieldState> =
27
27
  | RTHeading6Node,
28
28
  "spans"
29
29
  > & {
30
- spans: [];
30
+ spans: []
31
31
  },
32
- ];
32
+ ]
@@ -1,30 +1,30 @@
1
- import type { BooleanField } from "./boolean";
2
- import type { ColorField } from "./color";
3
- import type { ContentRelationshipField } from "./contentRelationship";
4
- import type { DateField } from "./date";
5
- import type { EmbedField } from "./embed";
6
- import type { GeoPointField } from "./geoPoint";
7
- import type { GroupField } from "./group";
8
- import type { ImageField } from "./image";
9
- import type { IntegrationField } from "./integration";
10
- import type { KeyTextField } from "./keyText";
11
- import type { LinkField } from "./link";
12
- import type { LinkToMediaField } from "./linkToMedia";
13
- import type { NumberField } from "./number";
14
- import type { RichTextField } from "./richText";
15
- import type { SelectField } from "./select";
16
- import type { TimestampField } from "./timestamp";
17
- import type { TitleField } from "./title";
1
+ import type { BooleanField } from "./boolean"
2
+ import type { ColorField } from "./color"
3
+ import type { ContentRelationshipField } from "./contentRelationship"
4
+ import type { DateField } from "./date"
5
+ import type { EmbedField } from "./embed"
6
+ import type { GeoPointField } from "./geoPoint"
7
+ import type { GroupField } from "./group"
8
+ import type { ImageField } from "./image"
9
+ import type { IntegrationField } from "./integration"
10
+ import type { KeyTextField } from "./keyText"
11
+ import type { LinkField } from "./link"
12
+ import type { LinkToMediaField } from "./linkToMedia"
13
+ import type { NumberField } from "./number"
14
+ import type { RichTextField } from "./richText"
15
+ import type { SelectField } from "./select"
16
+ import type { TimestampField } from "./timestamp"
17
+ import type { TitleField } from "./title"
18
18
 
19
19
  /**
20
20
  * Empty state for object-shaped fields.
21
21
  */
22
- export type EmptyObjectField = Record<string, never>;
22
+ export type EmptyObjectField = Record<string, never>
23
23
 
24
24
  /**
25
25
  * Valid states for fields. Not all fields use this type (e.g. BooleanField).
26
26
  */
27
- export type FieldState = "empty" | "filled";
27
+ export type FieldState = "empty" | "filled"
28
28
 
29
29
  /**
30
30
  * Any regular field that can be nested in a group-like field.
@@ -45,12 +45,12 @@ export type AnyRegularField =
45
45
  | SelectField
46
46
  | BooleanField
47
47
  | GeoPointField
48
- | IntegrationField;
48
+ | IntegrationField
49
49
 
50
50
  /**
51
51
  * Any field that can be used in a slice's primary section.
52
52
  */
53
- export type AnySlicePrimaryField = GroupField | AnyRegularField;
53
+ export type AnySlicePrimaryField = GroupField | AnyRegularField
54
54
 
55
55
  /**
56
56
  * Useful to flatten the type output to improve type hints shown in editors. And
@@ -62,4 +62,4 @@ export type AnySlicePrimaryField = GroupField | AnyRegularField;
62
62
  *
63
63
  * @see https://github.com/sindresorhus/type-fest/blob/cbd7ec510bd136ac045bbc74e391ee686b8a9a2f/source/simplify.d.ts
64
64
  */
65
- export type Simplify<T> = { [P in keyof T]: T[P] };
65
+ export type Simplify<T> = { [P in keyof T]: T[P] }
@@ -1,4 +1,4 @@
1
- import { WebhookBodyBase, WebhookType } from "./types";
1
+ import type { WebhookBodyBase, WebhookType } from "./types"
2
2
 
3
3
  /**
4
4
  * Webhook payload sent when a Prismic repository content is updated.
@@ -6,22 +6,22 @@ import { WebhookBodyBase, WebhookType } from "./types";
6
6
  * @see More details: {@link https://prismic.io/docs/webhooks}
7
7
  */
8
8
  export interface WebhookBodyAPIUpdate extends WebhookBodyBase {
9
- type: typeof WebhookType.APIUpdate;
10
- masterRef?: string;
11
- releases: WebhookBodyAPIUpdateOperations<WebhookBodyAPIUpdateRelease>;
12
- masks: WebhookBodyAPIUpdateOperations<WebhookBodyAPIUpdateMask>;
13
- tags: WebhookBodyAPIUpdateOperations<WebhookBodyAPIUpdateTag>;
14
- documents: string[];
9
+ type: typeof WebhookType.APIUpdate
10
+ masterRef?: string
11
+ releases: WebhookBodyAPIUpdateOperations<WebhookBodyAPIUpdateRelease>
12
+ masks: WebhookBodyAPIUpdateOperations<WebhookBodyAPIUpdateMask>
13
+ tags: WebhookBodyAPIUpdateOperations<WebhookBodyAPIUpdateTag>
14
+ documents: string[]
15
15
  /**
16
16
  * @deprecated Experiments are no longer supported by Prismic.
17
17
  */
18
- experiments?: WebhookBodyAPIUpdateOperations<unknown>;
18
+ experiments?: WebhookBodyAPIUpdateOperations<unknown>
19
19
  }
20
20
 
21
21
  interface WebhookBodyAPIUpdateOperations<T> {
22
- update?: T[];
23
- addition?: T[];
24
- deletion?: T[];
22
+ update?: T[]
23
+ addition?: T[]
24
+ deletion?: T[]
25
25
  }
26
26
 
27
27
  /**
@@ -30,8 +30,8 @@ interface WebhookBodyAPIUpdateOperations<T> {
30
30
  * @see More details: {@link https://prismic.io/docs/custom-types}
31
31
  */
32
32
  interface WebhookBodyAPIUpdateMask {
33
- id: string;
34
- label: string;
33
+ id: string
34
+ label: string
35
35
  }
36
36
 
37
37
  /**
@@ -40,7 +40,7 @@ interface WebhookBodyAPIUpdateMask {
40
40
  * @see More details: {@link https://prismic.io/docs/guides/document-tags}
41
41
  */
42
42
  interface WebhookBodyAPIUpdateTag {
43
- id: string;
43
+ id: string
44
44
  }
45
45
 
46
46
  /**
@@ -49,8 +49,8 @@ interface WebhookBodyAPIUpdateTag {
49
49
  * @see More details: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
50
50
  */
51
51
  interface WebhookBodyAPIUpdateRelease {
52
- id: string;
53
- ref: string;
54
- label: string;
55
- documents: string[];
52
+ id: string
53
+ ref: string
54
+ label: string
55
+ documents: string[]
56
56
  }
@@ -1,4 +1,4 @@
1
- import { WebhookBodyBase, WebhookType } from "./types";
1
+ import type { WebhookBodyBase, WebhookType } from "./types"
2
2
 
3
3
  /**
4
4
  * Webhook payload sent when a test webhook action is triggered.
@@ -6,5 +6,5 @@ import { WebhookBodyBase, WebhookType } from "./types";
6
6
  * @see More details: {@link https://prismic.io/docs/webhooks}
7
7
  */
8
8
  export interface WebhookBodyTestTrigger extends WebhookBodyBase {
9
- type: typeof WebhookType.TestTrigger;
9
+ type: typeof WebhookType.TestTrigger
10
10
  }
@@ -1,7 +1,7 @@
1
- import { WebhookBodyAPIUpdate } from "./apiUpdate";
2
- import { WebhookBodyTestTrigger } from "./testTrigger";
1
+ import type { WebhookBodyAPIUpdate } from "./apiUpdate"
2
+ import type { WebhookBodyTestTrigger } from "./testTrigger"
3
3
 
4
- export type WebhookBody = WebhookBodyAPIUpdate | WebhookBodyTestTrigger;
4
+ export type WebhookBody = WebhookBodyAPIUpdate | WebhookBodyTestTrigger
5
5
 
6
6
  /**
7
7
  * Types of Prismic Webhooks.
@@ -11,11 +11,11 @@ export type WebhookBody = WebhookBodyAPIUpdate | WebhookBodyTestTrigger;
11
11
  export const WebhookType = {
12
12
  APIUpdate: "api-update",
13
13
  TestTrigger: "test-trigger",
14
- } as const;
14
+ } as const
15
15
 
16
16
  export interface WebhookBodyBase {
17
- type: (typeof WebhookType)[keyof typeof WebhookType];
18
- domain: string;
19
- apiUrl: string;
20
- secret: string | null;
17
+ type: (typeof WebhookType)[keyof typeof WebhookType]
18
+ domain: string
19
+ apiUrl: string
20
+ secret: string | null
21
21
  }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const re = /[ \t\n\f\r]/g;
4
- function whitespace(thing) {
5
- return typeof thing === "object" ? thing.type === "text" ? empty(thing.value) : false : empty(thing);
6
- }
7
- function empty(value) {
8
- return value.replace(re, "") === "";
9
- }
10
- exports.whitespace = whitespace;
11
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../node_modules/hast-util-whitespace/lib/index.js"],"sourcesContent":["/**\n * @typedef {import('hast').Nodes} Nodes\n */\n\n// HTML whitespace expression.\n// See <https://infra.spec.whatwg.org/#ascii-whitespace>.\nconst re = /[ \\t\\n\\f\\r]/g\n\n/**\n * Check if the given value is *inter-element whitespace*.\n *\n * @param {Nodes | string} thing\n * Thing to check (`Node` or `string`).\n * @returns {boolean}\n * Whether the `value` is inter-element whitespace (`boolean`): consisting of\n * zero or more of space, tab (`\\t`), line feed (`\\n`), carriage return\n * (`\\r`), or form feed (`\\f`); if a node is passed it must be a `Text` node,\n * whose `value` field is checked.\n */\nexport function whitespace(thing) {\n return typeof thing === 'object'\n ? thing.type === 'text'\n ? empty(thing.value)\n : false\n : empty(thing)\n}\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction empty(value) {\n return value.replace(re, '') === ''\n}\n"],"names":[],"mappings":";;AAMA,MAAM,KAAK;AAaJ,SAAS,WAAW,OAAO;AAChC,SAAO,OAAO,UAAU,WACpB,MAAM,SAAS,SACb,MAAM,MAAM,KAAK,IACjB,QACF,MAAM,KAAK;AACjB;AAMA,SAAS,MAAM,OAAO;AACpB,SAAO,MAAM,QAAQ,IAAI,EAAE,MAAM;AACnC;;","x_google_ignoreList":[0]}
@@ -1,11 +0,0 @@
1
- const re = /[ \t\n\f\r]/g;
2
- function whitespace(thing) {
3
- return typeof thing === "object" ? thing.type === "text" ? empty(thing.value) : false : empty(thing);
4
- }
5
- function empty(value) {
6
- return value.replace(re, "") === "";
7
- }
8
- export {
9
- whitespace
10
- };
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../node_modules/hast-util-whitespace/lib/index.js"],"sourcesContent":["/**\n * @typedef {import('hast').Nodes} Nodes\n */\n\n// HTML whitespace expression.\n// See <https://infra.spec.whatwg.org/#ascii-whitespace>.\nconst re = /[ \\t\\n\\f\\r]/g\n\n/**\n * Check if the given value is *inter-element whitespace*.\n *\n * @param {Nodes | string} thing\n * Thing to check (`Node` or `string`).\n * @returns {boolean}\n * Whether the `value` is inter-element whitespace (`boolean`): consisting of\n * zero or more of space, tab (`\\t`), line feed (`\\n`), carriage return\n * (`\\r`), or form feed (`\\f`); if a node is passed it must be a `Text` node,\n * whose `value` field is checked.\n */\nexport function whitespace(thing) {\n return typeof thing === 'object'\n ? thing.type === 'text'\n ? empty(thing.value)\n : false\n : empty(thing)\n}\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction empty(value) {\n return value.replace(re, '') === ''\n}\n"],"names":[],"mappings":"AAMA,MAAM,KAAK;AAaJ,SAAS,WAAW,OAAO;AAChC,SAAO,OAAO,UAAU,WACpB,MAAM,SAAS,SACb,MAAM,MAAM,KAAK,IACjB,QACF,MAAM,KAAK;AACjB;AAMA,SAAS,MAAM,OAAO;AACpB,SAAO,MAAM,QAAQ,IAAI,EAAE,MAAM;AACnC;","x_google_ignoreList":[0]}