@prismicio/react 2.6.0-alpha.0 → 2.6.0-alpha.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 +6 -5
- package/dist/PrismicImage.cjs.map +1 -1
- package/dist/PrismicImage.js +6 -4
- package/dist/PrismicImage.js.map +1 -1
- package/dist/PrismicText.cjs +4 -4
- package/dist/PrismicText.cjs.map +1 -1
- package/dist/PrismicText.js +4 -3
- package/dist/PrismicText.js.map +1 -1
- package/dist/PrismicToolbar.cjs +3 -2
- package/dist/PrismicToolbar.cjs.map +1 -1
- package/dist/PrismicToolbar.js +2 -1
- package/dist/PrismicToolbar.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs +19 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js +19 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/getToolbarSrc.cjs +13 -0
- package/dist/_node_modules/@prismicio/client/dist/getToolbarSrc.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/getToolbarSrc.js +13 -0
- package/dist/_node_modules/@prismicio/client/dist/getToolbarSrc.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.cjs +21 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.js +21 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.cjs +45 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.js +45 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asImageWidthSrcSet.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs +38 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js +38 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.cjs +28 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.js +28 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asText.cjs +12 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asText.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asText.js +12 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asText.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs +26 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js +26 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/isFilled.cjs +24 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/isFilled.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/isFilled.js +24 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/isFilled.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.cjs +7 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.js +7 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/isInternalURL.cjs +9 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/isInternalURL.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/isInternalURL.js +9 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/isInternalURL.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs +10 -0
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.js +10 -0
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.js.map +1 -0
- package/dist/_node_modules/imgix-url-builder/dist/index.cjs +41 -0
- package/dist/_node_modules/imgix-url-builder/dist/index.cjs.map +1 -0
- package/dist/_node_modules/imgix-url-builder/dist/index.js +41 -0
- package/dist/_node_modules/imgix-url-builder/dist/index.js.map +1 -0
- package/dist/clientHooks.d.ts +90 -0
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/react-server/PrismicLink.cjs +3 -2
- package/dist/react-server/PrismicLink.cjs.map +1 -1
- package/dist/react-server/PrismicLink.js +2 -1
- package/dist/react-server/PrismicLink.js.map +1 -1
- package/dist/react-server/PrismicRichText.cjs +2 -3
- package/dist/react-server/PrismicRichText.cjs.map +1 -1
- package/dist/react-server/PrismicRichText.js +2 -2
- package/dist/react-server/PrismicRichText.js.map +1 -1
- package/dist/react-server/unsupported.cjs +26 -26
- package/dist/react-server/unsupported.cjs.map +1 -1
- package/dist/react-server/unsupported.js +26 -26
- package/dist/react-server/unsupported.js.map +1 -1
- package/package.json +3 -3
- package/src/react-server/unsupported.ts +112 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unsupported.cjs","sources":["../../../src/react-server/unsupported.ts"],"sourcesContent":["// Exports in this file are unsupported in the react-server environment.\n// All environments should export the same functions to maintian API compatability.\n\nfunction
|
|
1
|
+
{"version":3,"file":"unsupported.cjs","sources":["../../../src/react-server/unsupported.ts"],"sourcesContent":["// Exports in this file are unsupported in the react-server environment.\n// All environments should export the same functions to maintian API compatability.\n\nfunction buildIncompatibleInServerComponentsErrorMessage(fnName: string) {\n\treturn `${fnName} is not supported in Server Components. Remove ${fnName} in Server Components or add the \"use client\" directive to the component using ${fnName}.`;\n}\n\nfunction buildIncompatibleQueryHookInServerComponentsErrorMessage(\n\tfnName: string,\n) {\n\treturn `${fnName} is not supported in Server Components. Replace ${fnName} in Server Components with direct use of \\`@prismicio/client\\` (recommended) or add the \"use client\" directive to the component using the hook.`;\n}\n\nexport function PrismicProvider(): JSX.Element {\n\tthrow new Error(\n\t\tbuildIncompatibleInServerComponentsErrorMessage(\"<PrismicProvider>\"),\n\t);\n}\n\nexport function usePrismicContext() {\n\tthrow new Error(\n\t\tbuildIncompatibleInServerComponentsErrorMessage(\"usePrismicContext()\"),\n\t);\n}\n\nexport function usePrismicClient() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicClient()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicPreviewResolver() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicPreviewResolver()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsDangerously() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsDangerously()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsByEveryTag() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsByEveryTag()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsByIDs() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsByIDs()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsBySomeTags() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsBySomeTags()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsByTag() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsByTag()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsByType() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsByType()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsByUIDs() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsByUIDs()\",\n\t\t),\n\t);\n}\n\nexport function useFirstPrismicDocument() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useFirstPrismicDocument()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentByID() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentByID()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentByUID() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentByUID()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocuments() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocuments()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsByEveryTag() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsByEveryTag()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsByIDs() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsByIDs()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsBySomeTags() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsBySomeTags()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsByTag() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsByTag()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsByType() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsByType()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsByUIDs() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsByUIDs()\",\n\t\t),\n\t);\n}\n\nexport function useSinglePrismicDocument() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useSinglePrismicDocument()\",\n\t\t),\n\t);\n}\n"],"names":[],"mappings":";;AAGA,SAAS,gDAAgD,QAAc;AAC/D,SAAA,GAAG,wDAAwD,wFAAwF;AAC3J;AAEA,SAAS,yDACR,QAAc;AAEd,SAAO,GAAG,yDAAyD;AACpE;SAEgB,kBAAe;AAC9B,QAAM,IAAI,MACT,gDAAgD,mBAAmB,CAAC;AAEtE;SAEgB,oBAAiB;AAChC,QAAM,IAAI,MACT,gDAAgD,qBAAqB,CAAC;AAExE;SAEgB,mBAAgB;AAC/B,QAAM,IAAI,MACT,yDACC,oBAAoB,CACpB;AAEH;SAEgB,4BAAyB;AACxC,QAAM,IAAI,MACT,yDACC,6BAA6B,CAC7B;AAEH;SAEgB,oCAAiC;AAChD,QAAM,IAAI,MACT,yDACC,qCAAqC,CACrC;AAEH;SAEgB,mCAAgC;AAC/C,QAAM,IAAI,MACT,yDACC,oCAAoC,CACpC;AAEH;SAEgB,8BAA2B;AAC1C,QAAM,IAAI,MACT,yDACC,+BAA+B,CAC/B;AAEH;SAEgB,mCAAgC;AAC/C,QAAM,IAAI,MACT,yDACC,oCAAoC,CACpC;AAEH;SAEgB,8BAA2B;AAC1C,QAAM,IAAI,MACT,yDACC,+BAA+B,CAC/B;AAEH;SAEgB,+BAA4B;AAC3C,QAAM,IAAI,MACT,yDACC,gCAAgC,CAChC;AAEH;SAEgB,+BAA4B;AAC3C,QAAM,IAAI,MACT,yDACC,gCAAgC,CAChC;AAEH;SAEgB,0BAAuB;AACtC,QAAM,IAAI,MACT,yDACC,2BAA2B,CAC3B;AAEH;SAEgB,yBAAsB;AACrC,QAAM,IAAI,MACT,yDACC,0BAA0B,CAC1B;AAEH;SAEgB,0BAAuB;AACtC,QAAM,IAAI,MACT,yDACC,2BAA2B,CAC3B;AAEH;SAEgB,sBAAmB;AAClC,QAAM,IAAI,MACT,yDACC,uBAAuB,CACvB;AAEH;SAEgB,gCAA6B;AAC5C,QAAM,IAAI,MACT,yDACC,iCAAiC,CACjC;AAEH;SAEgB,2BAAwB;AACvC,QAAM,IAAI,MACT,yDACC,4BAA4B,CAC5B;AAEH;SAEgB,gCAA6B;AAC5C,QAAM,IAAI,MACT,yDACC,iCAAiC,CACjC;AAEH;SAEgB,2BAAwB;AACvC,QAAM,IAAI,MACT,yDACC,4BAA4B,CAC5B;AAEH;SAEgB,4BAAyB;AACxC,QAAM,IAAI,MACT,yDACC,6BAA6B,CAC7B;AAEH;SAEgB,4BAAyB;AACxC,QAAM,IAAI,MACT,yDACC,6BAA6B,CAC7B;AAEH;SAEgB,2BAAwB;AACvC,QAAM,IAAI,MACT,yDACC,4BAA4B,CAC5B;AAEH;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
function
|
|
2
|
-
return `${fnName} is not supported in Server Components. Remove
|
|
1
|
+
function buildIncompatibleInServerComponentsErrorMessage(fnName) {
|
|
2
|
+
return `${fnName} is not supported in Server Components. Remove ${fnName} in Server Components or add the "use client" directive to the component using ${fnName}.`;
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return `${fnName} is not supported in Server Components. Replace
|
|
4
|
+
function buildIncompatibleQueryHookInServerComponentsErrorMessage(fnName) {
|
|
5
|
+
return `${fnName} is not supported in Server Components. Replace ${fnName} in Server Components with direct use of \`@prismicio/client\` (recommended) or add the "use client" directive to the component using the hook.`;
|
|
6
6
|
}
|
|
7
7
|
function PrismicProvider() {
|
|
8
|
-
throw new Error(
|
|
8
|
+
throw new Error(buildIncompatibleInServerComponentsErrorMessage("<PrismicProvider>"));
|
|
9
9
|
}
|
|
10
10
|
function usePrismicContext() {
|
|
11
|
-
throw new Error(
|
|
11
|
+
throw new Error(buildIncompatibleInServerComponentsErrorMessage("usePrismicContext()"));
|
|
12
12
|
}
|
|
13
13
|
function usePrismicClient() {
|
|
14
|
-
throw new Error(
|
|
14
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicClient()"));
|
|
15
15
|
}
|
|
16
16
|
function usePrismicPreviewResolver() {
|
|
17
|
-
throw new Error(
|
|
17
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicPreviewResolver()"));
|
|
18
18
|
}
|
|
19
19
|
function useAllPrismicDocumentsDangerously() {
|
|
20
|
-
throw new Error(
|
|
20
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("useAllPrismicDocumentsDangerously()"));
|
|
21
21
|
}
|
|
22
22
|
function useAllPrismicDocumentsByEveryTag() {
|
|
23
|
-
throw new Error(
|
|
23
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("useAllPrismicDocumentsByEveryTag()"));
|
|
24
24
|
}
|
|
25
25
|
function useAllPrismicDocumentsByIDs() {
|
|
26
|
-
throw new Error(
|
|
26
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("useAllPrismicDocumentsByIDs()"));
|
|
27
27
|
}
|
|
28
28
|
function useAllPrismicDocumentsBySomeTags() {
|
|
29
|
-
throw new Error(
|
|
29
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("useAllPrismicDocumentsBySomeTags()"));
|
|
30
30
|
}
|
|
31
31
|
function useAllPrismicDocumentsByTag() {
|
|
32
|
-
throw new Error(
|
|
32
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("useAllPrismicDocumentsByTag()"));
|
|
33
33
|
}
|
|
34
34
|
function useAllPrismicDocumentsByType() {
|
|
35
|
-
throw new Error(
|
|
35
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("useAllPrismicDocumentsByType()"));
|
|
36
36
|
}
|
|
37
37
|
function useAllPrismicDocumentsByUIDs() {
|
|
38
|
-
throw new Error(
|
|
38
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("useAllPrismicDocumentsByUIDs()"));
|
|
39
39
|
}
|
|
40
40
|
function useFirstPrismicDocument() {
|
|
41
|
-
throw new Error(
|
|
41
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("useFirstPrismicDocument()"));
|
|
42
42
|
}
|
|
43
43
|
function usePrismicDocumentByID() {
|
|
44
|
-
throw new Error(
|
|
44
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicDocumentByID()"));
|
|
45
45
|
}
|
|
46
46
|
function usePrismicDocumentByUID() {
|
|
47
|
-
throw new Error(
|
|
47
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicDocumentByUID()"));
|
|
48
48
|
}
|
|
49
49
|
function usePrismicDocuments() {
|
|
50
|
-
throw new Error(
|
|
50
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicDocuments()"));
|
|
51
51
|
}
|
|
52
52
|
function usePrismicDocumentsByEveryTag() {
|
|
53
|
-
throw new Error(
|
|
53
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicDocumentsByEveryTag()"));
|
|
54
54
|
}
|
|
55
55
|
function usePrismicDocumentsByIDs() {
|
|
56
|
-
throw new Error(
|
|
56
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicDocumentsByIDs()"));
|
|
57
57
|
}
|
|
58
58
|
function usePrismicDocumentsBySomeTags() {
|
|
59
|
-
throw new Error(
|
|
59
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicDocumentsBySomeTags()"));
|
|
60
60
|
}
|
|
61
61
|
function usePrismicDocumentsByTag() {
|
|
62
|
-
throw new Error(
|
|
62
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicDocumentsByTag()"));
|
|
63
63
|
}
|
|
64
64
|
function usePrismicDocumentsByType() {
|
|
65
|
-
throw new Error(
|
|
65
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicDocumentsByType()"));
|
|
66
66
|
}
|
|
67
67
|
function usePrismicDocumentsByUIDs() {
|
|
68
|
-
throw new Error(
|
|
68
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("usePrismicDocumentsByUIDs()"));
|
|
69
69
|
}
|
|
70
70
|
function useSinglePrismicDocument() {
|
|
71
|
-
throw new Error(
|
|
71
|
+
throw new Error(buildIncompatibleQueryHookInServerComponentsErrorMessage("useSinglePrismicDocument()"));
|
|
72
72
|
}
|
|
73
73
|
export {
|
|
74
74
|
PrismicProvider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unsupported.js","sources":["../../../src/react-server/unsupported.ts"],"sourcesContent":["// Exports in this file are unsupported in the react-server environment.\n// All environments should export the same functions to maintian API compatability.\n\nfunction
|
|
1
|
+
{"version":3,"file":"unsupported.js","sources":["../../../src/react-server/unsupported.ts"],"sourcesContent":["// Exports in this file are unsupported in the react-server environment.\n// All environments should export the same functions to maintian API compatability.\n\nfunction buildIncompatibleInServerComponentsErrorMessage(fnName: string) {\n\treturn `${fnName} is not supported in Server Components. Remove ${fnName} in Server Components or add the \"use client\" directive to the component using ${fnName}.`;\n}\n\nfunction buildIncompatibleQueryHookInServerComponentsErrorMessage(\n\tfnName: string,\n) {\n\treturn `${fnName} is not supported in Server Components. Replace ${fnName} in Server Components with direct use of \\`@prismicio/client\\` (recommended) or add the \"use client\" directive to the component using the hook.`;\n}\n\nexport function PrismicProvider(): JSX.Element {\n\tthrow new Error(\n\t\tbuildIncompatibleInServerComponentsErrorMessage(\"<PrismicProvider>\"),\n\t);\n}\n\nexport function usePrismicContext() {\n\tthrow new Error(\n\t\tbuildIncompatibleInServerComponentsErrorMessage(\"usePrismicContext()\"),\n\t);\n}\n\nexport function usePrismicClient() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicClient()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicPreviewResolver() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicPreviewResolver()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsDangerously() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsDangerously()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsByEveryTag() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsByEveryTag()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsByIDs() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsByIDs()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsBySomeTags() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsBySomeTags()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsByTag() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsByTag()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsByType() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsByType()\",\n\t\t),\n\t);\n}\n\nexport function useAllPrismicDocumentsByUIDs() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useAllPrismicDocumentsByUIDs()\",\n\t\t),\n\t);\n}\n\nexport function useFirstPrismicDocument() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useFirstPrismicDocument()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentByID() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentByID()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentByUID() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentByUID()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocuments() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocuments()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsByEveryTag() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsByEveryTag()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsByIDs() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsByIDs()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsBySomeTags() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsBySomeTags()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsByTag() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsByTag()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsByType() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsByType()\",\n\t\t),\n\t);\n}\n\nexport function usePrismicDocumentsByUIDs() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"usePrismicDocumentsByUIDs()\",\n\t\t),\n\t);\n}\n\nexport function useSinglePrismicDocument() {\n\tthrow new Error(\n\t\tbuildIncompatibleQueryHookInServerComponentsErrorMessage(\n\t\t\t\"useSinglePrismicDocument()\",\n\t\t),\n\t);\n}\n"],"names":[],"mappings":"AAGA,SAAS,gDAAgD,QAAc;AAC/D,SAAA,GAAG,wDAAwD,wFAAwF;AAC3J;AAEA,SAAS,yDACR,QAAc;AAEd,SAAO,GAAG,yDAAyD;AACpE;SAEgB,kBAAe;AAC9B,QAAM,IAAI,MACT,gDAAgD,mBAAmB,CAAC;AAEtE;SAEgB,oBAAiB;AAChC,QAAM,IAAI,MACT,gDAAgD,qBAAqB,CAAC;AAExE;SAEgB,mBAAgB;AAC/B,QAAM,IAAI,MACT,yDACC,oBAAoB,CACpB;AAEH;SAEgB,4BAAyB;AACxC,QAAM,IAAI,MACT,yDACC,6BAA6B,CAC7B;AAEH;SAEgB,oCAAiC;AAChD,QAAM,IAAI,MACT,yDACC,qCAAqC,CACrC;AAEH;SAEgB,mCAAgC;AAC/C,QAAM,IAAI,MACT,yDACC,oCAAoC,CACpC;AAEH;SAEgB,8BAA2B;AAC1C,QAAM,IAAI,MACT,yDACC,+BAA+B,CAC/B;AAEH;SAEgB,mCAAgC;AAC/C,QAAM,IAAI,MACT,yDACC,oCAAoC,CACpC;AAEH;SAEgB,8BAA2B;AAC1C,QAAM,IAAI,MACT,yDACC,+BAA+B,CAC/B;AAEH;SAEgB,+BAA4B;AAC3C,QAAM,IAAI,MACT,yDACC,gCAAgC,CAChC;AAEH;SAEgB,+BAA4B;AAC3C,QAAM,IAAI,MACT,yDACC,gCAAgC,CAChC;AAEH;SAEgB,0BAAuB;AACtC,QAAM,IAAI,MACT,yDACC,2BAA2B,CAC3B;AAEH;SAEgB,yBAAsB;AACrC,QAAM,IAAI,MACT,yDACC,0BAA0B,CAC1B;AAEH;SAEgB,0BAAuB;AACtC,QAAM,IAAI,MACT,yDACC,2BAA2B,CAC3B;AAEH;SAEgB,sBAAmB;AAClC,QAAM,IAAI,MACT,yDACC,uBAAuB,CACvB;AAEH;SAEgB,gCAA6B;AAC5C,QAAM,IAAI,MACT,yDACC,iCAAiC,CACjC;AAEH;SAEgB,2BAAwB;AACvC,QAAM,IAAI,MACT,yDACC,4BAA4B,CAC5B;AAEH;SAEgB,gCAA6B;AAC5C,QAAM,IAAI,MACT,yDACC,iCAAiC,CACjC;AAEH;SAEgB,2BAAwB;AACvC,QAAM,IAAI,MACT,yDACC,4BAA4B,CAC5B;AAEH;SAEgB,4BAAyB;AACxC,QAAM,IAAI,MACT,yDACC,6BAA6B,CAC7B;AAEH;SAEgB,4BAAyB;AACxC,QAAM,IAAI,MACT,yDACC,6BAA6B,CAC7B;AAEH;SAEgB,2BAAwB;AACvC,QAAM,IAAI,MACT,yDACC,4BAA4B,CAC5B;AAEH;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismicio/react",
|
|
3
|
-
"version": "2.6.0-alpha.
|
|
3
|
+
"version": "2.6.0-alpha.2",
|
|
4
4
|
"description": "React components and hooks to fetch and present Prismic content",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@prismicio/richtext": "^2.1.4"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@prismicio/client": "^7.0.0-alpha.
|
|
60
|
+
"@prismicio/client": "^7.0.0-alpha.3",
|
|
61
61
|
"@prismicio/mock": "^0.2.0",
|
|
62
62
|
"@size-limit/preset-small-lib": "^8.2.4",
|
|
63
63
|
"@testing-library/react": "^14.0.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"vitest": "^0.30.1"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
|
-
"@prismicio/client": "^7",
|
|
94
|
+
"@prismicio/client": "^6 || ^7",
|
|
95
95
|
"react": "^18"
|
|
96
96
|
},
|
|
97
97
|
"engines": {
|
|
@@ -1,98 +1,184 @@
|
|
|
1
1
|
// Exports in this file are unsupported in the react-server environment.
|
|
2
2
|
// All environments should export the same functions to maintian API compatability.
|
|
3
3
|
|
|
4
|
-
function
|
|
5
|
-
return `${fnName} is not supported in Server Components. Remove
|
|
4
|
+
function buildIncompatibleInServerComponentsErrorMessage(fnName: string) {
|
|
5
|
+
return `${fnName} is not supported in Server Components. Remove ${fnName} in Server Components or add the "use client" directive to the component using ${fnName}.`;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
function
|
|
9
|
-
|
|
8
|
+
function buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
9
|
+
fnName: string,
|
|
10
|
+
) {
|
|
11
|
+
return `${fnName} is not supported in Server Components. Replace ${fnName} in Server Components with direct use of \`@prismicio/client\` (recommended) or add the "use client" directive to the component using the hook.`;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export function PrismicProvider(): JSX.Element {
|
|
13
|
-
throw new Error(
|
|
15
|
+
throw new Error(
|
|
16
|
+
buildIncompatibleInServerComponentsErrorMessage("<PrismicProvider>"),
|
|
17
|
+
);
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
export function usePrismicContext() {
|
|
17
|
-
throw new Error(
|
|
21
|
+
throw new Error(
|
|
22
|
+
buildIncompatibleInServerComponentsErrorMessage("usePrismicContext()"),
|
|
23
|
+
);
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
export function usePrismicClient() {
|
|
21
|
-
throw new Error(
|
|
27
|
+
throw new Error(
|
|
28
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
29
|
+
"usePrismicClient()",
|
|
30
|
+
),
|
|
31
|
+
);
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
export function usePrismicPreviewResolver() {
|
|
25
|
-
throw new Error(
|
|
35
|
+
throw new Error(
|
|
36
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
37
|
+
"usePrismicPreviewResolver()",
|
|
38
|
+
),
|
|
39
|
+
);
|
|
26
40
|
}
|
|
27
41
|
|
|
28
42
|
export function useAllPrismicDocumentsDangerously() {
|
|
29
|
-
throw new Error(
|
|
43
|
+
throw new Error(
|
|
44
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
45
|
+
"useAllPrismicDocumentsDangerously()",
|
|
46
|
+
),
|
|
47
|
+
);
|
|
30
48
|
}
|
|
31
49
|
|
|
32
50
|
export function useAllPrismicDocumentsByEveryTag() {
|
|
33
|
-
throw new Error(
|
|
51
|
+
throw new Error(
|
|
52
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
53
|
+
"useAllPrismicDocumentsByEveryTag()",
|
|
54
|
+
),
|
|
55
|
+
);
|
|
34
56
|
}
|
|
35
57
|
|
|
36
58
|
export function useAllPrismicDocumentsByIDs() {
|
|
37
|
-
throw new Error(
|
|
59
|
+
throw new Error(
|
|
60
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
61
|
+
"useAllPrismicDocumentsByIDs()",
|
|
62
|
+
),
|
|
63
|
+
);
|
|
38
64
|
}
|
|
39
65
|
|
|
40
66
|
export function useAllPrismicDocumentsBySomeTags() {
|
|
41
|
-
throw new Error(
|
|
67
|
+
throw new Error(
|
|
68
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
69
|
+
"useAllPrismicDocumentsBySomeTags()",
|
|
70
|
+
),
|
|
71
|
+
);
|
|
42
72
|
}
|
|
43
73
|
|
|
44
74
|
export function useAllPrismicDocumentsByTag() {
|
|
45
|
-
throw new Error(
|
|
75
|
+
throw new Error(
|
|
76
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
77
|
+
"useAllPrismicDocumentsByTag()",
|
|
78
|
+
),
|
|
79
|
+
);
|
|
46
80
|
}
|
|
47
81
|
|
|
48
82
|
export function useAllPrismicDocumentsByType() {
|
|
49
|
-
throw new Error(
|
|
83
|
+
throw new Error(
|
|
84
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
85
|
+
"useAllPrismicDocumentsByType()",
|
|
86
|
+
),
|
|
87
|
+
);
|
|
50
88
|
}
|
|
51
89
|
|
|
52
90
|
export function useAllPrismicDocumentsByUIDs() {
|
|
53
|
-
throw new Error(
|
|
91
|
+
throw new Error(
|
|
92
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
93
|
+
"useAllPrismicDocumentsByUIDs()",
|
|
94
|
+
),
|
|
95
|
+
);
|
|
54
96
|
}
|
|
55
97
|
|
|
56
98
|
export function useFirstPrismicDocument() {
|
|
57
|
-
throw new Error(
|
|
99
|
+
throw new Error(
|
|
100
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
101
|
+
"useFirstPrismicDocument()",
|
|
102
|
+
),
|
|
103
|
+
);
|
|
58
104
|
}
|
|
59
105
|
|
|
60
106
|
export function usePrismicDocumentByID() {
|
|
61
|
-
throw new Error(
|
|
107
|
+
throw new Error(
|
|
108
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
109
|
+
"usePrismicDocumentByID()",
|
|
110
|
+
),
|
|
111
|
+
);
|
|
62
112
|
}
|
|
63
113
|
|
|
64
114
|
export function usePrismicDocumentByUID() {
|
|
65
|
-
throw new Error(
|
|
115
|
+
throw new Error(
|
|
116
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
117
|
+
"usePrismicDocumentByUID()",
|
|
118
|
+
),
|
|
119
|
+
);
|
|
66
120
|
}
|
|
67
121
|
|
|
68
122
|
export function usePrismicDocuments() {
|
|
69
|
-
throw new Error(
|
|
123
|
+
throw new Error(
|
|
124
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
125
|
+
"usePrismicDocuments()",
|
|
126
|
+
),
|
|
127
|
+
);
|
|
70
128
|
}
|
|
71
129
|
|
|
72
130
|
export function usePrismicDocumentsByEveryTag() {
|
|
73
|
-
throw new Error(
|
|
131
|
+
throw new Error(
|
|
132
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
133
|
+
"usePrismicDocumentsByEveryTag()",
|
|
134
|
+
),
|
|
135
|
+
);
|
|
74
136
|
}
|
|
75
137
|
|
|
76
138
|
export function usePrismicDocumentsByIDs() {
|
|
77
|
-
throw new Error(
|
|
139
|
+
throw new Error(
|
|
140
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
141
|
+
"usePrismicDocumentsByIDs()",
|
|
142
|
+
),
|
|
143
|
+
);
|
|
78
144
|
}
|
|
79
145
|
|
|
80
146
|
export function usePrismicDocumentsBySomeTags() {
|
|
81
|
-
throw new Error(
|
|
147
|
+
throw new Error(
|
|
148
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
149
|
+
"usePrismicDocumentsBySomeTags()",
|
|
150
|
+
),
|
|
151
|
+
);
|
|
82
152
|
}
|
|
83
153
|
|
|
84
154
|
export function usePrismicDocumentsByTag() {
|
|
85
|
-
throw new Error(
|
|
155
|
+
throw new Error(
|
|
156
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
157
|
+
"usePrismicDocumentsByTag()",
|
|
158
|
+
),
|
|
159
|
+
);
|
|
86
160
|
}
|
|
87
161
|
|
|
88
162
|
export function usePrismicDocumentsByType() {
|
|
89
|
-
throw new Error(
|
|
163
|
+
throw new Error(
|
|
164
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
165
|
+
"usePrismicDocumentsByType()",
|
|
166
|
+
),
|
|
167
|
+
);
|
|
90
168
|
}
|
|
91
169
|
|
|
92
170
|
export function usePrismicDocumentsByUIDs() {
|
|
93
|
-
throw new Error(
|
|
171
|
+
throw new Error(
|
|
172
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
173
|
+
"usePrismicDocumentsByUIDs()",
|
|
174
|
+
),
|
|
175
|
+
);
|
|
94
176
|
}
|
|
95
177
|
|
|
96
178
|
export function useSinglePrismicDocument() {
|
|
97
|
-
throw new Error(
|
|
179
|
+
throw new Error(
|
|
180
|
+
buildIncompatibleQueryHookInServerComponentsErrorMessage(
|
|
181
|
+
"useSinglePrismicDocument()",
|
|
182
|
+
),
|
|
183
|
+
);
|
|
98
184
|
}
|