@prismicio/react 3.2.2-pr.241.0f293b1 → 3.2.2-pr.242.8d8084e
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.d.ts +60 -58
- package/dist/PrismicImage.d.ts.map +1 -0
- package/dist/PrismicImage.js +54 -47
- package/dist/PrismicImage.js.map +1 -1
- package/dist/PrismicLink.d.ts +63 -67
- package/dist/PrismicLink.d.ts.map +1 -0
- package/dist/PrismicLink.js +59 -40
- package/dist/PrismicLink.js.map +1 -1
- package/dist/PrismicRichText.d.ts +68 -66
- package/dist/PrismicRichText.d.ts.map +1 -0
- package/dist/PrismicRichText.js +125 -71
- package/dist/PrismicRichText.js.map +1 -1
- package/dist/PrismicTable.d.ts +53 -49
- package/dist/PrismicTable.d.ts.map +1 -0
- package/dist/PrismicTable.js +68 -21
- package/dist/PrismicTable.js.map +1 -1
- package/dist/PrismicText.d.ts +16 -11
- package/dist/PrismicText.d.ts.map +1 -0
- package/dist/PrismicText.js +30 -23
- package/dist/PrismicText.js.map +1 -1
- package/dist/PrismicToolbar.d.ts +12 -7
- package/dist/PrismicToolbar.d.ts.map +1 -0
- package/dist/PrismicToolbar.js +32 -19
- package/dist/PrismicToolbar.js.map +1 -1
- package/dist/SliceZone.d.ts +52 -47
- package/dist/SliceZone.d.ts.map +1 -0
- package/dist/SliceZone.js +54 -27
- package/dist/SliceZone.js.map +1 -1
- package/dist/index.d.ts +9 -15
- package/dist/index.js +4 -14
- package/dist/lib/devMsg.js +23 -6
- package/dist/lib/devMsg.js.map +1 -1
- package/dist/package.js +6 -0
- package/dist/package.js.map +1 -0
- package/package.json +19 -39
- package/src/PrismicImage.tsx +3 -3
- package/src/PrismicLink.tsx +5 -5
- package/src/PrismicRichText.tsx +11 -16
- package/src/PrismicTable.tsx +9 -9
- package/src/PrismicText.tsx +2 -2
- package/src/PrismicToolbar.tsx +1 -1
- package/src/SliceZone.tsx +2 -2
- package/src/index.ts +0 -1
- package/src/lib/devMsg.ts +1 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/devMsg.d.ts +0 -16
- package/dist/package.json.js +0 -5
- package/dist/package.json.js.map +0 -1
package/dist/lib/devMsg.js
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
import { version } from "../package.
|
|
1
|
+
import { version } from "../package.js";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/devMsg.ts
|
|
4
|
+
/**
|
|
5
|
+
* Returns a `prismic.dev/msg` URL for a given message slug.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* devMsg("missing-param");
|
|
11
|
+
* // => "https://prismic.dev/msg/react/v1.2.3/missing-param"
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param slug - Slug for the message. This corresponds to a Markdown file in
|
|
15
|
+
* the Git repository's `/messages` directory.
|
|
16
|
+
*
|
|
17
|
+
* @returns The `prismic.dev/msg` URL for the given slug.
|
|
18
|
+
*/
|
|
2
19
|
function devMsg(slug) {
|
|
3
|
-
|
|
20
|
+
return `https://prismic.dev/msg/react/v${version}/${slug}`;
|
|
4
21
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=devMsg.js.map
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { devMsg };
|
|
25
|
+
//# sourceMappingURL=devMsg.js.map
|
package/dist/lib/devMsg.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devMsg.js","sources":["../../src/lib/devMsg.ts"],"sourcesContent":["import { version } from \"../../package.json\";\n\n/**\n * Returns a `prismic.dev/msg` URL for a given message slug.\n *\n * @example\n *\n * ```ts\n * devMsg(\"missing-param\");\n * // => \"https://prismic.dev/msg/react/v1.2.3/missing-param\"\n * ```\n *\n * @param slug - Slug for the message. This corresponds to a Markdown file in\n * the Git repository's `/messages` directory.\n *\n * @returns The `prismic.dev/msg` URL for the given slug.\n */\nexport function devMsg(slug: string) {\n\treturn `https://prismic.dev/msg/react/v${version}/${slug}`;\n}\n"],"
|
|
1
|
+
{"version":3,"file":"devMsg.js","names":[],"sources":["../../src/lib/devMsg.ts"],"sourcesContent":["import { version } from \"../../package.json\";\n\n/**\n * Returns a `prismic.dev/msg` URL for a given message slug.\n *\n * @example\n *\n * ```ts\n * devMsg(\"missing-param\");\n * // => \"https://prismic.dev/msg/react/v1.2.3/missing-param\"\n * ```\n *\n * @param slug - Slug for the message. This corresponds to a Markdown file in\n * the Git repository's `/messages` directory.\n *\n * @returns The `prismic.dev/msg` URL for the given slug.\n */\nexport function devMsg(slug: string): string {\n\treturn `https://prismic.dev/msg/react/v${version}/${slug}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,SAAgB,OAAO,MAAsB;AAC5C,QAAO,kCAAkC,QAAQ,GAAG"}
|
package/dist/package.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismicio/react",
|
|
3
|
-
"version": "3.2.2-pr.
|
|
3
|
+
"version": "3.2.2-pr.242.8d8084e",
|
|
4
4
|
"description": "React components and hooks to fetch and present Prismic content",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -16,12 +16,10 @@
|
|
|
16
16
|
"sideEffects": false,
|
|
17
17
|
"type": "module",
|
|
18
18
|
"exports": {
|
|
19
|
-
".":
|
|
20
|
-
"types": "./dist/index.d.ts",
|
|
21
|
-
"default": "./dist/index.js"
|
|
22
|
-
},
|
|
19
|
+
".": "./dist/index.js",
|
|
23
20
|
"./package.json": "./package.json"
|
|
24
21
|
},
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
25
23
|
"typesVersions": {
|
|
26
24
|
"*": {
|
|
27
25
|
"*": [
|
|
@@ -38,59 +36,41 @@
|
|
|
38
36
|
"e2e-projects/*"
|
|
39
37
|
],
|
|
40
38
|
"scripts": {
|
|
41
|
-
"build": "
|
|
42
|
-
"dev": "
|
|
39
|
+
"build": "tsdown",
|
|
40
|
+
"dev": "tsdown --watch",
|
|
43
41
|
"e2e": "playwright test",
|
|
44
42
|
"e2e:ui": "npm run e2e -- --ui",
|
|
45
43
|
"format": "prettier --write .",
|
|
46
|
-
"lint": "
|
|
44
|
+
"lint": "oxlint --deny-warnings",
|
|
47
45
|
"prepare": "npm run build",
|
|
48
|
-
"
|
|
49
|
-
"release:alpha": "npm run build && npm run test && standard-version --prerelease alpha && git push --follow-tags && npm run build && npm publish --tag alpha",
|
|
50
|
-
"release:alpha:dry": "standard-version --prerelease alpha --dry-run",
|
|
51
|
-
"release:dry": "standard-version --dry-run",
|
|
52
|
-
"size": "size-limit",
|
|
53
|
-
"test": "npm run lint && npm run types && npm run build && npm run e2e && npm run size && npm run e2e",
|
|
46
|
+
"test": "npm run lint && npm run types && npm run build && npm run e2e",
|
|
54
47
|
"types": "tsc --noEmit"
|
|
55
48
|
},
|
|
56
49
|
"dependencies": {
|
|
57
50
|
"esm-env": "^1.2.2"
|
|
58
51
|
},
|
|
59
52
|
"devDependencies": {
|
|
60
|
-
"@
|
|
61
|
-
"@playwright/test": "^1.50.0",
|
|
53
|
+
"@playwright/test": "^1.57.0",
|
|
62
54
|
"@prismicio/client": "^7.17.0",
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
65
|
-
"@types/react": "^19.2.7",
|
|
55
|
+
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
56
|
+
"@types/react": "^19.2.8",
|
|
66
57
|
"@types/react-dom": "^19.2.3",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"eslint-plugin-react": "^7.37.4",
|
|
73
|
-
"eslint-plugin-react-hooks": "^5.1.0",
|
|
74
|
-
"eslint-plugin-tsdoc": "^0.4.0",
|
|
75
|
-
"playwright": "^1.50.0",
|
|
76
|
-
"prettier": "^3.4.2",
|
|
77
|
-
"prettier-plugin-jsdoc": "^1.3.2",
|
|
58
|
+
"dotenv": "^17.2.3",
|
|
59
|
+
"oxlint": "^1.39.0",
|
|
60
|
+
"playwright": "^1.57.0",
|
|
61
|
+
"prettier": "^3.7.4",
|
|
62
|
+
"prettier-plugin-jsdoc": "^1.8.0",
|
|
78
63
|
"react": "^19.2.1",
|
|
79
|
-
"react-dom": "^19.2.
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"size-limit": "^11.1.6",
|
|
83
|
-
"standard-version": "^9.5.0",
|
|
84
|
-
"typescript": "^5.7.3",
|
|
85
|
-
"typescript-eslint": "^8.22.0",
|
|
86
|
-
"vite": "^6.0.11"
|
|
64
|
+
"react-dom": "^19.2.3",
|
|
65
|
+
"tsdown": "^0.19.0",
|
|
66
|
+
"typescript": "^5.9.3"
|
|
87
67
|
},
|
|
88
68
|
"peerDependencies": {
|
|
89
69
|
"@prismicio/client": "^7",
|
|
90
70
|
"react": "^18 || ^19"
|
|
91
71
|
},
|
|
92
72
|
"engines": {
|
|
93
|
-
"node": ">=
|
|
73
|
+
"node": ">=20"
|
|
94
74
|
},
|
|
95
75
|
"publishConfig": {
|
|
96
76
|
"access": "public"
|
package/src/PrismicImage.tsx
CHANGED
package/src/PrismicLink.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ComponentProps,
|
|
3
|
-
ComponentType,
|
|
4
|
-
ForwardedRef,
|
|
5
|
-
HTMLAttributeAnchorTarget,
|
|
6
|
-
ReactNode,
|
|
2
|
+
type ComponentProps,
|
|
3
|
+
type ComponentType,
|
|
4
|
+
type ForwardedRef,
|
|
5
|
+
type HTMLAttributeAnchorTarget,
|
|
6
|
+
type ReactNode,
|
|
7
7
|
forwardRef,
|
|
8
8
|
} from "react";
|
|
9
9
|
import {
|
package/src/PrismicRichText.tsx
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cloneElement,
|
|
3
|
-
ComponentType,
|
|
4
|
-
FC,
|
|
3
|
+
type ComponentType,
|
|
4
|
+
type FC,
|
|
5
5
|
Fragment,
|
|
6
6
|
isValidElement,
|
|
7
|
-
ReactNode,
|
|
7
|
+
type ReactNode,
|
|
8
8
|
} from "react";
|
|
9
9
|
import {
|
|
10
10
|
isFilled,
|
|
11
|
-
LinkResolverFunction,
|
|
12
|
-
RichTextField,
|
|
13
|
-
RTAnyNode,
|
|
11
|
+
type LinkResolverFunction,
|
|
12
|
+
type RichTextField,
|
|
13
|
+
type RTAnyNode,
|
|
14
14
|
} from "@prismicio/client";
|
|
15
15
|
import {
|
|
16
16
|
composeSerializers,
|
|
17
17
|
serialize,
|
|
18
18
|
wrapMapSerializer,
|
|
19
|
-
RichTextFunctionSerializer,
|
|
20
|
-
RichTextMapSerializer,
|
|
19
|
+
type RichTextFunctionSerializer,
|
|
20
|
+
type RichTextMapSerializer,
|
|
21
21
|
} from "@prismicio/client/richtext";
|
|
22
22
|
import { DEV } from "esm-env";
|
|
23
23
|
|
|
24
24
|
import { devMsg } from "./lib/devMsg.js";
|
|
25
25
|
|
|
26
|
-
import { LinkProps, PrismicLink } from "./PrismicLink.js";
|
|
26
|
+
import { type LinkProps, PrismicLink } from "./PrismicLink.js";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* A function mapping rich text block types to React Components. It is used to
|
|
@@ -39,12 +39,7 @@ export type JSXFunctionSerializer = RichTextFunctionSerializer<ReactNode>;
|
|
|
39
39
|
*
|
|
40
40
|
* @see Templating rich text fields {@link https://prismic.io/docs/fields/rich-text}
|
|
41
41
|
*/
|
|
42
|
-
export type
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated Use `RichTextComponents` instead.
|
|
46
|
-
*/
|
|
47
|
-
export type JSXMapSerializer = RichTextComponents;
|
|
42
|
+
export type JSXMapSerializer = RichTextMapSerializer<ReactNode>;
|
|
48
43
|
|
|
49
44
|
/** Props for `<PrismicRichText>`. */
|
|
50
45
|
export type PrismicRichTextProps = {
|
|
@@ -89,7 +84,7 @@ export type PrismicRichTextProps = {
|
|
|
89
84
|
* };
|
|
90
85
|
* ```
|
|
91
86
|
*/
|
|
92
|
-
components?:
|
|
87
|
+
components?: JSXMapSerializer | JSXFunctionSerializer;
|
|
93
88
|
|
|
94
89
|
/**
|
|
95
90
|
* The React component rendered for links when the URL is internal.
|
package/src/PrismicTable.tsx
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ComponentType, FC, ReactNode } from "react";
|
|
1
|
+
import type { ComponentType, FC, ReactNode } from "react";
|
|
2
2
|
import {
|
|
3
3
|
isFilled,
|
|
4
|
-
TableField,
|
|
5
|
-
TableFieldHead,
|
|
6
|
-
TableFieldHeadRow,
|
|
7
|
-
TableFieldBody,
|
|
8
|
-
TableFieldBodyRow,
|
|
9
|
-
TableFieldHeaderCell,
|
|
10
|
-
TableFieldDataCell,
|
|
4
|
+
type TableField,
|
|
5
|
+
type TableFieldHead,
|
|
6
|
+
type TableFieldHeadRow,
|
|
7
|
+
type TableFieldBody,
|
|
8
|
+
type TableFieldBodyRow,
|
|
9
|
+
type TableFieldHeaderCell,
|
|
10
|
+
type TableFieldDataCell,
|
|
11
11
|
} from "@prismicio/client";
|
|
12
12
|
|
|
13
|
-
import { JSXMapSerializer, PrismicRichText } from "./PrismicRichText.js";
|
|
13
|
+
import { type JSXMapSerializer, PrismicRichText } from "./PrismicRichText.js";
|
|
14
14
|
|
|
15
15
|
type TableComponents = {
|
|
16
16
|
table?: ComponentType<{ table: TableField<"filled">; children: ReactNode }>;
|
package/src/PrismicText.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { asText, isFilled, RichTextField } from "@prismicio/client";
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import { asText, isFilled, type RichTextField } from "@prismicio/client";
|
|
3
3
|
import { DEV } from "esm-env";
|
|
4
4
|
|
|
5
5
|
import { devMsg } from "./lib/devMsg.js";
|
package/src/PrismicToolbar.tsx
CHANGED
package/src/SliceZone.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentType, FC } from "react";
|
|
1
|
+
import type { ComponentType, FC, ReactNode } from "react";
|
|
2
2
|
import type { Slice } from "@prismicio/client";
|
|
3
3
|
import { DEV } from "esm-env";
|
|
4
4
|
|
|
@@ -182,7 +182,7 @@ export const TODOSliceComponent = <TSlice extends SliceLike>({
|
|
|
182
182
|
slice,
|
|
183
183
|
}: {
|
|
184
184
|
slice: TSlice;
|
|
185
|
-
}) => {
|
|
185
|
+
}): ReactNode => {
|
|
186
186
|
if (!DEV) {
|
|
187
187
|
return null;
|
|
188
188
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,6 @@ export type { PrismicTextProps } from "./PrismicText.js";
|
|
|
10
10
|
export { PrismicRichText } from "./PrismicRichText.js";
|
|
11
11
|
export type {
|
|
12
12
|
PrismicRichTextProps,
|
|
13
|
-
RichTextComponents,
|
|
14
13
|
JSXMapSerializer,
|
|
15
14
|
JSXFunctionSerializer,
|
|
16
15
|
} from "./PrismicRichText.js";
|
package/src/lib/devMsg.ts
CHANGED
|
@@ -15,6 +15,6 @@ import { version } from "../../package.json";
|
|
|
15
15
|
*
|
|
16
16
|
* @returns The `prismic.dev/msg` URL for the given slug.
|
|
17
17
|
*/
|
|
18
|
-
export function devMsg(slug: string) {
|
|
18
|
+
export function devMsg(slug: string): string {
|
|
19
19
|
return `https://prismic.dev/msg/react/v${version}/${slug}`;
|
|
20
20
|
}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/lib/devMsg.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a `prismic.dev/msg` URL for a given message slug.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
*
|
|
6
|
-
* ```ts
|
|
7
|
-
* devMsg("missing-param");
|
|
8
|
-
* // => "https://prismic.dev/msg/react/v1.2.3/missing-param"
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* @param slug - Slug for the message. This corresponds to a Markdown file in
|
|
12
|
-
* the Git repository's `/messages` directory.
|
|
13
|
-
*
|
|
14
|
-
* @returns The `prismic.dev/msg` URL for the given slug.
|
|
15
|
-
*/
|
|
16
|
-
export declare function devMsg(slug: string): string;
|
package/dist/package.json.js
DELETED
package/dist/package.json.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|