@prismicio/react 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PrismicImage.cjs +1 -1
- package/dist/PrismicImage.cjs.map +1 -1
- package/dist/PrismicImage.js +1 -1
- package/dist/PrismicImage.js.map +1 -1
- package/dist/PrismicText.cjs +1 -1
- package/dist/PrismicText.cjs.map +1 -1
- package/dist/PrismicText.js +1 -1
- package/dist/PrismicText.js.map +1 -1
- package/dist/PrismicToolbar.cjs +1 -1
- package/dist/PrismicToolbar.cjs.map +1 -1
- package/dist/PrismicToolbar.js +1 -1
- package/dist/PrismicToolbar.js.map +1 -1
- package/dist/SliceZone.cjs +1 -1
- package/dist/SliceZone.cjs.map +1 -1
- package/dist/SliceZone.js +1 -1
- package/dist/SliceZone.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.cjs +2 -2
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.js +2 -2
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.cjs +2 -2
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.js +2 -2
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs +12 -3
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js +12 -3
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/asText.cjs +11 -2
- package/dist/_node_modules/@prismicio/client/dist/helpers/asText.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/asText.js +11 -2
- package/dist/_node_modules/@prismicio/client/dist/helpers/asText.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/isFilled.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/isFilled.js.map +1 -1
- package/dist/clientHooks.d.ts +18 -90
- package/dist/index.d.ts +0 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/react-server/PrismicLink.cjs +1 -1
- package/dist/react-server/PrismicLink.cjs.map +1 -1
- package/dist/react-server/PrismicLink.js +1 -1
- package/dist/react-server/PrismicLink.js.map +1 -1
- package/dist/react-server/PrismicRichText.cjs +1 -1
- package/dist/react-server/PrismicRichText.cjs.map +1 -1
- package/dist/react-server/PrismicRichText.js +1 -1
- package/dist/react-server/PrismicRichText.js.map +1 -1
- package/package.json +19 -7
- package/src/PrismicImage.tsx +4 -1
- package/src/PrismicText.tsx +4 -1
- package/src/PrismicToolbar.tsx +1 -1
- package/src/SliceZone.tsx +4 -1
- package/src/index.ts +0 -2
- package/src/react-server/PrismicLink.tsx +4 -1
- package/src/react-server/PrismicRichText.tsx +4 -1
- package/src/lib/processPolyfill.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismicio/react",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "React components and hooks to fetch and present Prismic content",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -19,12 +19,24 @@
|
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
21
|
"react-server": {
|
|
22
|
-
"
|
|
23
|
-
|
|
22
|
+
"require": {
|
|
23
|
+
"types": "./dist/react-server/index.d.ts",
|
|
24
|
+
"default": "./dist/react-server.cjs"
|
|
25
|
+
},
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/react-server/index.d.ts",
|
|
28
|
+
"default": "./dist/react-server.js"
|
|
29
|
+
}
|
|
24
30
|
},
|
|
25
31
|
"default": {
|
|
26
|
-
"
|
|
27
|
-
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.cjs"
|
|
35
|
+
},
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"default": "./dist/index.js"
|
|
39
|
+
}
|
|
28
40
|
}
|
|
29
41
|
},
|
|
30
42
|
"./package.json": "./package.json"
|
|
@@ -54,10 +66,10 @@
|
|
|
54
66
|
"test": "npm run lint && npm run types && npm run unit && npm run build && npm run size"
|
|
55
67
|
},
|
|
56
68
|
"dependencies": {
|
|
57
|
-
"@prismicio/richtext": "^2.1.
|
|
69
|
+
"@prismicio/richtext": "^2.1.5"
|
|
58
70
|
},
|
|
59
71
|
"devDependencies": {
|
|
60
|
-
"@prismicio/client": "^7.0.
|
|
72
|
+
"@prismicio/client": "^7.0.1",
|
|
61
73
|
"@prismicio/mock": "^0.2.0",
|
|
62
74
|
"@size-limit/preset-small-lib": "^8.2.4",
|
|
63
75
|
"@testing-library/react": "^14.0.0",
|
package/src/PrismicImage.tsx
CHANGED
|
@@ -116,7 +116,10 @@ export const PrismicImage = React.forwardRef(function PrismicImage(
|
|
|
116
116
|
...restProps
|
|
117
117
|
} = props;
|
|
118
118
|
|
|
119
|
-
if (
|
|
119
|
+
if (
|
|
120
|
+
typeof process !== "undefined" &&
|
|
121
|
+
process.env.NODE_ENV === "development"
|
|
122
|
+
) {
|
|
120
123
|
if (typeof alt === "string" && props.alt !== "") {
|
|
121
124
|
console.warn(
|
|
122
125
|
`[PrismicImage] The "alt" prop can only be used to declare an image as decorative by passing an empty string (alt="") but was provided a non-empty string. You can resolve this warning by removing the "alt" prop or changing it to alt="". For more details, see ${devMsg(
|
package/src/PrismicText.tsx
CHANGED
|
@@ -44,7 +44,10 @@ export type PrismicTextProps = {
|
|
|
44
44
|
* @see Learn about Rich Text fields {@link https://prismic.io/docs/core-concepts/rich-text-title}
|
|
45
45
|
*/
|
|
46
46
|
export const PrismicText = (props: PrismicTextProps): JSX.Element | null => {
|
|
47
|
-
if (
|
|
47
|
+
if (
|
|
48
|
+
typeof process !== "undefined" &&
|
|
49
|
+
process.env.NODE_ENV === "development"
|
|
50
|
+
) {
|
|
48
51
|
if ("className" in props) {
|
|
49
52
|
console.warn(
|
|
50
53
|
`[PrismicText] className cannot be passed to <PrismicText> since it renders plain text without a wrapping component. For more details, see ${devMsg(
|
package/src/PrismicToolbar.tsx
CHANGED
|
@@ -52,7 +52,7 @@ export const PrismicToolbar = ({
|
|
|
52
52
|
// environments.
|
|
53
53
|
//
|
|
54
54
|
// @see https://github.com/capricorn86/happy-dom/blob/02ae081e36f990c06171eda44f9d885fd9413d73/packages/happy-dom/src/nodes/html-script-element/HTMLScriptElement.ts#L191-L209
|
|
55
|
-
if (process.env.NODE_ENV === "test") {
|
|
55
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV === "test") {
|
|
56
56
|
// @ts-expect-error - `_evaluateScript` is a Happy DOM-specific property.
|
|
57
57
|
script._evaluateScript = false;
|
|
58
58
|
}
|
package/src/SliceZone.tsx
CHANGED
|
@@ -155,7 +155,10 @@ export type SliceZoneComponents<
|
|
|
155
155
|
export const TODOSliceComponent = <TSlice extends SliceLike, TContext>({
|
|
156
156
|
slice,
|
|
157
157
|
}: SliceComponentProps<TSlice, TContext>): JSX.Element | null => {
|
|
158
|
-
if (
|
|
158
|
+
if (
|
|
159
|
+
typeof process !== "undefined" &&
|
|
160
|
+
process.env.NODE_ENV === "development"
|
|
161
|
+
) {
|
|
159
162
|
const type = "slice_type" in slice ? slice.slice_type : slice.type;
|
|
160
163
|
|
|
161
164
|
console.warn(
|
package/src/index.ts
CHANGED
|
@@ -107,7 +107,10 @@ export const PrismicLink = React.forwardRef(function PrismicLink<
|
|
|
107
107
|
}: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,
|
|
108
108
|
ref: React.ForwardedRef<Element>,
|
|
109
109
|
): JSX.Element {
|
|
110
|
-
if (
|
|
110
|
+
if (
|
|
111
|
+
typeof process !== "undefined" &&
|
|
112
|
+
process.env.NODE_ENV === "development"
|
|
113
|
+
) {
|
|
111
114
|
if (field) {
|
|
112
115
|
if (!field.link_type) {
|
|
113
116
|
console.error(
|
|
@@ -226,7 +226,10 @@ export function PrismicRichText<
|
|
|
226
226
|
...restProps
|
|
227
227
|
}: PrismicRichTextProps<LinkResolverFunction>): JSX.Element | null {
|
|
228
228
|
return React.useMemo(() => {
|
|
229
|
-
if (
|
|
229
|
+
if (
|
|
230
|
+
typeof process !== "undefined" &&
|
|
231
|
+
process.env.NODE_ENV === "development"
|
|
232
|
+
) {
|
|
230
233
|
if ("className" in restProps) {
|
|
231
234
|
console.warn(
|
|
232
235
|
`[PrismicRichText] className cannot be passed to <PrismicRichText> since it renders an array without a wrapping component. For more details, see ${devMsg(
|