@nuxtjs/prismic 4.1.0-pr.235.f2901c8 → 5.0.0-canary.130d8b9
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/LICENSE +1 -1
- package/dist/module.d.mts +9 -9
- package/dist/module.json +1 -1
- package/dist/module.mjs +10 -10
- package/dist/runtime/PrismicPreview.vue +4 -11
- package/dist/runtime/plugin.client.js +5 -8
- package/dist/runtime/plugin.js +7 -7
- package/dist/runtime/usePrismicPreview.js +2 -2
- package/package.json +5 -5
- package/src/module.ts +22 -23
- package/src/runtime/PrismicPreview.vue +4 -31
- package/src/runtime/plugin.client.ts +5 -9
- package/src/runtime/plugin.ts +8 -8
- package/src/runtime/usePrismicPreview.ts +2 -2
package/LICENSE
CHANGED
package/dist/module.d.mts
CHANGED
|
@@ -53,6 +53,13 @@ type PrismicModuleOptions = {
|
|
|
53
53
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client}
|
|
54
54
|
*/
|
|
55
55
|
client?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The path to a file exporting a default link resolver used to resolve links
|
|
58
|
+
* when route resolvers cannot be used.
|
|
59
|
+
*
|
|
60
|
+
* @see {@link https://prismic.io/docs/routes}
|
|
61
|
+
*/
|
|
62
|
+
linkResolver?: string;
|
|
56
63
|
/**
|
|
57
64
|
* Desired path of the preview page used by Prismic to enter preview session.
|
|
58
65
|
*
|
|
@@ -72,14 +79,7 @@ type PrismicModuleOptions = {
|
|
|
72
79
|
*/
|
|
73
80
|
toolbar?: boolean;
|
|
74
81
|
/** Options used by Prismic Vue components. */
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The path to a file exporting a default link resolver function used to
|
|
78
|
-
* resolve links.
|
|
79
|
-
*
|
|
80
|
-
* @see {@link https://prismic.io/docs/routes}
|
|
81
|
-
*/
|
|
82
|
-
linkResolver?: string;
|
|
82
|
+
components?: {
|
|
83
83
|
/**
|
|
84
84
|
* The path to a file exporting default components or shorthand definitions
|
|
85
85
|
* for rich text and table components.
|
|
@@ -87,7 +87,7 @@ type PrismicModuleOptions = {
|
|
|
87
87
|
* @see {@link https://prismic.io/docs/fields/rich-text}
|
|
88
88
|
* @see {@link https://prismic.io/docs/fields/table}
|
|
89
89
|
*/
|
|
90
|
-
|
|
90
|
+
richTextComponents?: string;
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
/**
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { addDependency } from 'nypm';
|
|
|
7
7
|
import { readPackage } from 'pkg-types';
|
|
8
8
|
|
|
9
9
|
const name = "@nuxtjs/prismic";
|
|
10
|
-
const version = "
|
|
10
|
+
const version = "5.0.0-canary.130d8b9";
|
|
11
11
|
|
|
12
12
|
const logger = useLogger("nuxt:prismic");
|
|
13
13
|
async function addPrismicClient() {
|
|
@@ -44,11 +44,11 @@ const module$1 = defineNuxtModule({
|
|
|
44
44
|
environment: "",
|
|
45
45
|
clientConfig: {},
|
|
46
46
|
client: "~/app/prismic/client",
|
|
47
|
+
linkResolver: "~/app/prismic/linkResolver",
|
|
47
48
|
preview: "/preview",
|
|
48
49
|
toolbar: true,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
defaultComponents: "~/app/prismic/defaultComponents"
|
|
50
|
+
components: {
|
|
51
|
+
richTextComponents: "~/app/prismic/richTextComponents "
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
}
|
|
@@ -56,12 +56,12 @@ const module$1 = defineNuxtModule({
|
|
|
56
56
|
endpoint: "",
|
|
57
57
|
environment: "",
|
|
58
58
|
client: "~/prismic/client",
|
|
59
|
+
linkResolver: "~/prismic/linkResolver",
|
|
59
60
|
clientConfig: {},
|
|
60
61
|
preview: "/preview",
|
|
61
62
|
toolbar: true,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
defaultComponents: "~/prismic/defaultComponents"
|
|
63
|
+
components: {
|
|
64
|
+
richTextComponents: "~/prismic/richTextComponents"
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
},
|
|
@@ -132,11 +132,11 @@ const module$1 = defineNuxtModule({
|
|
|
132
132
|
}
|
|
133
133
|
proxyUserFileWithUndefinedFallback(
|
|
134
134
|
"linkResolver",
|
|
135
|
-
moduleOptions.
|
|
135
|
+
moduleOptions.linkResolver
|
|
136
136
|
);
|
|
137
137
|
proxyUserFileWithUndefinedFallback(
|
|
138
|
-
"
|
|
139
|
-
moduleOptions.
|
|
138
|
+
"richTextComponents",
|
|
139
|
+
moduleOptions.components.richTextComponents
|
|
140
140
|
);
|
|
141
141
|
return true;
|
|
142
142
|
}
|
|
@@ -5,17 +5,10 @@ usePrismicPreview();
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
|
-
<section
|
|
9
|
-
<figure>
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
alt="Prismic"
|
|
13
|
-
/>
|
|
14
|
-
<figcaption>Loading preview...</figcaption>
|
|
8
|
+
<section style="position: fixed; inset: 0; display: flex; justify-content: center; align-items: center; background: #ffffff;">
|
|
9
|
+
<figure style="text-align: center;">
|
|
10
|
+
<svg style="height: 2rem;" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 109 28" class="dark:text-gray-ee h-6 w-auto text-black md:h-7"><path fill="#000000" fill-rule="evenodd" d="m27.629 14.573-2.064-2.06a.869.869 0 0 1-.256-.616V9.376c0-2.33-.242-3.175-.699-4.026a4.753 4.753 0 0 0-1.98-1.976c-.853-.455-1.7-.698-4.033-.698h-3.339a.175.175 0 0 1-.123-.297l2.063-2.06a.877.877 0 0 1 .62-.256h1.16c3.112 0 4.24.323 5.378.93a6.337 6.337 0 0 1 2.64 2.635c.608 1.135.932 2.262.932 5.368v5.454a.175.175 0 0 1-.3.123ZM13.389 27.64l2.064-2.06a.876.876 0 0 1 .62-.256h2.524c2.334 0 3.18-.243 4.034-.698a4.754 4.754 0 0 0 1.979-1.976c.456-.851.7-1.696.7-4.026v-3.332a.174.174 0 0 1 .298-.123l2.064 2.06a.87.87 0 0 1 .255.616v1.159c0 3.106-.323 4.233-.932 5.368a6.338 6.338 0 0 1-2.64 2.634c-1.137.608-2.266.931-5.378.931h-5.464a.174.174 0 0 1-.124-.297ZM2.363 15.487l-2.064-2.06A.175.175 0 0 0 0 13.55v5.454c0 3.106.324 4.232.933 5.368a6.337 6.337 0 0 0 2.639 2.634c1.138.608 2.266.931 5.378.931h1.16a.877.877 0 0 0 .62-.256l2.063-2.06a.174.174 0 0 0-.124-.297H9.331c-2.334 0-3.18-.243-4.034-.698a4.753 4.753 0 0 1-1.98-1.976c-.456-.852-.699-1.696-.699-4.026v-2.522a.869.869 0 0 0-.255-.615ZM14.539.36l-2.064 2.06a.876.876 0 0 1-.62.256H9.332c-2.334 0-3.18.243-4.034.698a4.753 4.753 0 0 0-1.98 1.976c-.456.851-.699 1.696-.699 4.026v3.332a.175.175 0 0 1-.299.123L.256 10.77A.87.87 0 0 1 0 10.155V8.996C0 5.89.324 4.763.933 3.628A6.338 6.338 0 0 1 3.572.994C4.71.386 5.838.063 8.95.063h5.465a.175.175 0 0 1 .124.297Zm5.915 7.188 2.814 2.685a.175.175 0 0 0 .296-.126V7.902a3.488 3.488 0 0 0-3.491-3.484h-6.62a.877.877 0 0 0-.618.255l-2.066 2.06a.174.174 0 0 0 .124.298H19.2c.218 0 .426.04.617.112.233.084.45.22.637.405ZM17.737 23.29l2.69-2.81c.187-.186.322-.403.407-.635.072-.191.112-.399.112-.616v-8.291a.175.175 0 0 1 .299-.123l2.064 2.062a.87.87 0 0 1 .255.615V20.1a3.488 3.488 0 0 1-3.49 3.485h-2.21a.175.175 0 0 1-.127-.295ZM7.474 20.451 4.66 17.767a.175.175 0 0 0-.296.125v2.206a3.488 3.488 0 0 0 3.491 3.484h6.62a.876.876 0 0 0 .618-.256l2.066-2.06a.174.174 0 0 0-.124-.297H8.728c-.218 0-.426-.04-.618-.112a1.74 1.74 0 0 1-.636-.406Zm2.717-15.739-2.69 2.81a1.735 1.735 0 0 0-.406.635c-.073.192-.113.4-.113.616v8.292a.174.174 0 0 1-.299.122l-2.063-2.06a.87.87 0 0 1-.255-.615v-6.61a3.488 3.488 0 0 1 3.491-3.484h2.21a.175.175 0 0 1 .126.294ZM36.622 8.54h-.676c-.562 0-1.018.454-1.018 1.014v14.32c0 .561.456 1.015 1.018 1.015h.625c.563 0 1.019-.454 1.019-1.014V18.28c0-.037.03-.066.066-.066.134.184.304.373.51.565.208.193.46.374.755.543.296.17.636.308 1.02.416a4.99 4.99 0 0 0 1.332.161 4.823 4.823 0 0 0 3.716-1.685 5.737 5.737 0 0 0 1.053-1.848c.252-.708.377-1.47.377-2.286a7.17 7.17 0 0 0-.354-2.286 5.333 5.333 0 0 0-1.043-1.848 4.927 4.927 0 0 0-1.664-1.235c-.65-.3-1.383-.45-2.196-.45-.755 0-1.457.153-2.108.461-.65.308-1.168.8-1.553 1.478a.044.044 0 0 1-.044-.044V9.37a.833.833 0 0 0-.835-.831Zm6.925 4.295c.14.4.21.816.21 1.247 0 .431-.07.847-.21 1.247a3.102 3.102 0 0 1-1.608 1.801 2.988 2.988 0 0 1-1.31.277 2.985 2.985 0 0 1-2.296-1.016 3.155 3.155 0 0 1-.621-1.062c-.14-.4-.21-.816-.21-1.247 0-.431.07-.847.21-1.247a3.101 3.101 0 0 1 1.608-1.801 2.985 2.985 0 0 1 1.31-.277 2.984 2.984 0 0 1 2.295 1.016c.274.308.481.662.622 1.062Zm7.471-4.295h-.762c-.563 0-1.019.454-1.019 1.014v9.056c0 .56.456 1.014 1.019 1.014h.625c.562 0 1.018-.454 1.018-1.014v-4.92c0-.155.033-.386.1-.694.067-.307.2-.615.4-.923.2-.308.487-.581.865-.82.377-.239.876-.358 1.497-.358.207 0 .418.02.632.058a.555.555 0 0 0 .654-.545v-1.52a.59.59 0 0 0-.476-.58 2.448 2.448 0 0 0-.477-.045c-.71 0-1.339.177-1.886.53-.547.355-.969.855-1.264 1.502a.044.044 0 0 1-.045-.045v-.833a.88.88 0 0 0-.88-.877Zm8.87 0h-.625c-.563 0-1.019.454-1.019 1.014v9.056c0 .56.456 1.014 1.019 1.014h.625c.562 0 1.018-.454 1.018-1.014V9.553c0-.56-.456-1.014-1.018-1.014Zm-1.544-4.93c-.318.33-.477.719-.477 1.165 0 .447.159.836.477 1.167.318.33.721.496 1.21.496.487 0 .898-.158 1.23-.473.333-.316.5-.712.5-1.19a1.57 1.57 0 0 0-.5-1.189c-.332-.315-.743-.473-1.23-.473-.489 0-.892.165-1.21.496Zm9.55 6.87c.422 0 .903.197 1.443.593.396.29.943.257 1.301-.079l.332-.31a1.012 1.012 0 0 0-.059-1.53c-.31-.248-.59-.418-.842-.51a6.1 6.1 0 0 0-2.108-.381c-.532 0-1.057.069-1.575.207a4.093 4.093 0 0 0-1.375.647c-.4.292-.721.666-.965 1.12-.245.454-.366.99-.366 1.605 0 .708.14 1.262.421 1.663.281.4.636.712 1.065.935a5.23 5.23 0 0 0 1.386.485c.496.1.958.208 1.387.323.429.116.784.266 1.065.45.28.185.421.47.421.855a.976.976 0 0 1-.166.566c-.11.161-.255.296-.433.404-.177.108-.37.185-.576.23-.207.047-.407.07-.6.07-.561 0-1.038-.127-1.43-.381a3.795 3.795 0 0 1-.42-.328 1.022 1.022 0 0 0-1.386.037l-.276.27a1.012 1.012 0 0 0 .093 1.53c.38.29.707.484.98.58.694.247 1.456.37 2.284.37a7.46 7.46 0 0 0 1.642-.184 4.618 4.618 0 0 0 1.475-.6 3.29 3.29 0 0 0 1.065-1.098c.274-.454.41-1.012.41-1.674 0-.724-.14-1.293-.42-1.709a3.077 3.077 0 0 0-1.066-.981 5.32 5.32 0 0 0-1.386-.531 82.131 82.131 0 0 1-1.387-.335 4.536 4.536 0 0 1-1.065-.393c-.28-.154-.421-.4-.421-.739 0-.415.17-.716.51-.9a2.16 2.16 0 0 1 1.043-.277Zm7.989-1.94h-.492c-.562 0-1.018.454-1.018 1.014v9.056c0 .56.456 1.014 1.018 1.014h.625c.563 0 1.019-.454 1.019-1.014v-5.036c0-.37.044-.724.133-1.062a2.52 2.52 0 0 1 .433-.901c.2-.262.45-.47.754-.623.303-.155.676-.231 1.12-.231.651 0 1.117.204 1.398.611.281.408.421.959.421 1.652v5.59c0 .56.457 1.014 1.02 1.014h.624c.563 0 1.019-.454 1.019-1.014v-4.99c0-.354.04-.704.122-1.05a2.71 2.71 0 0 1 .399-.924 2.09 2.09 0 0 1 .71-.647c.288-.162.64-.242 1.054-.242.399 0 .724.069.976.207a1.6 1.6 0 0 1 .599.566 2.4 2.4 0 0 1 .31.832c.06.315.09.642.09.981v5.267c0 .56.455 1.014 1.018 1.014h.625c.562 0 1.018-.454 1.018-1.014v-5.59c0-.662-.066-1.282-.2-1.86a4.265 4.265 0 0 0-.654-1.512 3.172 3.172 0 0 0-1.187-1.016c-.488-.246-1.087-.37-1.797-.37-.798 0-1.486.166-2.063.497-.577.331-1.057.85-1.442 1.559-.547-1.37-1.656-2.055-3.328-2.055-.887 0-1.593.204-2.118.611a4.342 4.342 0 0 0-1.187 1.398v-.718c0-.56-.456-1.014-1.019-1.014Zm19.922 0h-.625c-.562 0-1.018.454-1.018 1.014v9.056c0 .56.456 1.014 1.018 1.014h.625c.563 0 1.019-.454 1.019-1.014V9.553c0-.56-.456-1.014-1.019-1.014Zm-1.543-4.93c-.318.33-.477.719-.477 1.165 0 .447.159.836.477 1.167.318.33.72.496 1.209.496.488 0 .898-.158 1.23-.473.334-.316.5-.712.5-1.19a1.57 1.57 0 0 0-.5-1.189c-.332-.315-.742-.473-1.23-.473-.489 0-.891.165-1.21.496Zm12.257 7.447a2.9 2.9 0 0 1 .289.201 1.02 1.02 0 0 0 1.364-.097l.411-.429a1.012 1.012 0 0 0-.127-1.515c-.356-.264-.666-.448-.928-.55a5.591 5.591 0 0 0-2.052-.404c-.799 0-1.553.138-2.263.415-.71.277-1.323.67-1.841 1.178a5.588 5.588 0 0 0-1.231 1.836c-.303.716-.455 1.512-.455 2.39 0 .878.151 1.674.455 2.39a5.585 5.585 0 0 0 1.231 1.836c.518.508 1.131.9 1.841 1.178.71.277 1.464.415 2.263.415.237 0 .518-.027.843-.08a6.222 6.222 0 0 0 2.074-.75.964.964 0 0 0 .24-1.479l-.405-.453a1.022 1.022 0 0 0-1.365-.143c-.084.061-.161.11-.233.146a2.55 2.55 0 0 1-1.154.265c-.488 0-.924-.092-1.309-.277a3.11 3.11 0 0 1-1.608-1.801 3.724 3.724 0 0 1-.211-1.247c0-.431.07-.847.211-1.247a3.11 3.11 0 0 1 1.608-1.801 2.987 2.987 0 0 1 1.309-.277c.355 0 .703.1 1.043.3Z" clip-rule="evenodd"></path></svg>
|
|
11
|
+
<figcaption style="font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; font-size: 1rem; margin-top: .5rem;">Loading preview...</figcaption>
|
|
15
12
|
</figure>
|
|
16
13
|
</section>
|
|
17
14
|
</template>
|
|
18
|
-
|
|
19
|
-
<style scoped>
|
|
20
|
-
.prismic-preview{align-items:center;background:#fff;color:#666;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:1rem;height:100vh;justify-content:center;left:0;position:fixed;text-align:center;top:0;width:100%}img{margin-bottom:1.25rem}
|
|
21
|
-
</style>
|
|
@@ -4,14 +4,11 @@ export default defineNuxtPlugin({
|
|
|
4
4
|
name: "prismic:plugin:client",
|
|
5
5
|
parallel: true,
|
|
6
6
|
setup() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
refreshNuxtData();
|
|
13
|
-
});
|
|
14
|
-
}
|
|
7
|
+
if (useRuntimeConfig().public.prismic?.preview) {
|
|
8
|
+
window.addEventListener("prismicPreviewUpdate", (event) => {
|
|
9
|
+
event.preventDefault();
|
|
10
|
+
refreshNuxtData();
|
|
11
|
+
});
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
14
|
});
|
package/dist/runtime/plugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineNuxtPlugin } from "#app";
|
|
2
2
|
import NuxtLink from "#app/components/nuxt-link";
|
|
3
3
|
import _client from "#build/prismic/proxy/client";
|
|
4
|
-
import defaultComponents from "#build/prismic/proxy/defaultComponents";
|
|
5
4
|
import linkResolver from "#build/prismic/proxy/linkResolver";
|
|
5
|
+
import richTextComponents from "#build/prismic/proxy/richTextComponents";
|
|
6
6
|
import {
|
|
7
7
|
onNuxtReady,
|
|
8
8
|
refreshNuxtData,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
useRouter,
|
|
13
13
|
useRuntimeConfig
|
|
14
14
|
} from "#imports";
|
|
15
|
-
import { Client, createClient } from "@prismicio/client";
|
|
15
|
+
import { Client, cookie, createClient, getToolbarSrc } from "@prismicio/client";
|
|
16
16
|
import { createPrismic } from "@prismicio/vue";
|
|
17
17
|
export default defineNuxtPlugin({
|
|
18
18
|
name: "prismic:setup",
|
|
@@ -85,7 +85,7 @@ export default defineNuxtPlugin({
|
|
|
85
85
|
script: [
|
|
86
86
|
{
|
|
87
87
|
key: "prismic-preview",
|
|
88
|
-
src:
|
|
88
|
+
src: getToolbarSrc(client.repositoryName),
|
|
89
89
|
async: true,
|
|
90
90
|
defer: true,
|
|
91
91
|
crossorigin: "anonymous"
|
|
@@ -93,16 +93,16 @@ export default defineNuxtPlugin({
|
|
|
93
93
|
]
|
|
94
94
|
});
|
|
95
95
|
} else {
|
|
96
|
-
useCookie(
|
|
96
|
+
useCookie(cookie.preview).value = null;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
const prismicPlugin = createPrismic({
|
|
100
100
|
client,
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
linkResolver,
|
|
102
|
+
components: {
|
|
103
103
|
linkInternalComponent: NuxtLink,
|
|
104
104
|
linkExternalComponent: NuxtLink,
|
|
105
|
-
|
|
105
|
+
richTextComponents
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
nuxtApp.vueApp.use(prismicPlugin);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { usePrismic, useRouter } from "#imports";
|
|
2
2
|
import { onMounted } from "vue";
|
|
3
3
|
export const usePrismicPreview = (defaultURL = "/") => {
|
|
4
|
-
const { client,
|
|
4
|
+
const { client, linkResolver } = usePrismic();
|
|
5
5
|
const { push } = useRouter();
|
|
6
6
|
onMounted(async () => {
|
|
7
7
|
const redirectURL = await client.resolvePreviewURL({
|
|
8
|
-
linkResolver
|
|
8
|
+
linkResolver,
|
|
9
9
|
defaultURL
|
|
10
10
|
});
|
|
11
11
|
push(redirectURL);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/prismic",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-canary.130d8b9",
|
|
4
4
|
"description": "Easily connect your Nuxt application to your content hosted on Prismic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nuxt",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@nuxt/kit": "^4.2.2",
|
|
56
|
-
"@prismicio/vue": "
|
|
56
|
+
"@prismicio/vue": "^6.0.0",
|
|
57
57
|
"defu": "^6.1.4",
|
|
58
58
|
"nypm": "^0.6.2",
|
|
59
59
|
"pkg-types": "^2.3.0"
|
|
@@ -62,17 +62,17 @@
|
|
|
62
62
|
"@nuxt/module-builder": "^1.0.2",
|
|
63
63
|
"@nuxt/schema": "^4.2.2",
|
|
64
64
|
"@nuxt/test-utils": "^3.21.0",
|
|
65
|
-
"@prismicio/client": "^7.21.
|
|
65
|
+
"@prismicio/client": "^7.21.2",
|
|
66
66
|
"@trivago/prettier-plugin-sort-imports": "^6.0.0",
|
|
67
67
|
"@types/node": "^25.0.3",
|
|
68
68
|
"@vitest/coverage-v8": "^4.0.16",
|
|
69
69
|
"nuxt": "^4.2.2",
|
|
70
|
-
"oxlint": "1.
|
|
70
|
+
"oxlint": "1.37.0",
|
|
71
71
|
"prettier": "^3.7.4",
|
|
72
72
|
"prettier-plugin-jsdoc": "^1.8.0",
|
|
73
73
|
"typescript": "^5.9.3",
|
|
74
74
|
"vitest": "^4.0.16",
|
|
75
|
-
"vue-tsc": "^3.2.
|
|
75
|
+
"vue-tsc": "^3.2.2"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"@prismicio/client": "^7"
|
package/src/module.ts
CHANGED
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
} from "@nuxt/kit"
|
|
16
16
|
import type { ClientConfig } from "@prismicio/client"
|
|
17
17
|
import { defu } from "defu"
|
|
18
|
-
|
|
19
|
-
import { name, version } from '../package.json'
|
|
20
18
|
import { addDependency } from "nypm"
|
|
21
19
|
import { readPackage } from "pkg-types"
|
|
22
20
|
|
|
21
|
+
import { name, version } from "../package.json"
|
|
22
|
+
|
|
23
23
|
/**
|
|
24
24
|
* Prismic Nuxt module options.
|
|
25
25
|
*
|
|
@@ -76,6 +76,14 @@ export type PrismicModuleOptions = {
|
|
|
76
76
|
*/
|
|
77
77
|
client?: string
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* The path to a file exporting a default link resolver used to resolve links
|
|
81
|
+
* when route resolvers cannot be used.
|
|
82
|
+
*
|
|
83
|
+
* @see {@link https://prismic.io/docs/routes}
|
|
84
|
+
*/
|
|
85
|
+
linkResolver?: string
|
|
86
|
+
|
|
79
87
|
/**
|
|
80
88
|
* Desired path of the preview page used by Prismic to enter preview session.
|
|
81
89
|
*
|
|
@@ -97,15 +105,7 @@ export type PrismicModuleOptions = {
|
|
|
97
105
|
toolbar?: boolean
|
|
98
106
|
|
|
99
107
|
/** Options used by Prismic Vue components. */
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* The path to a file exporting a default link resolver function used to
|
|
103
|
-
* resolve links.
|
|
104
|
-
*
|
|
105
|
-
* @see {@link https://prismic.io/docs/routes}
|
|
106
|
-
*/
|
|
107
|
-
linkResolver?: string
|
|
108
|
-
|
|
108
|
+
components?: {
|
|
109
109
|
/**
|
|
110
110
|
* The path to a file exporting default components or shorthand definitions
|
|
111
111
|
* for rich text and table components.
|
|
@@ -113,7 +113,7 @@ export type PrismicModuleOptions = {
|
|
|
113
113
|
* @see {@link https://prismic.io/docs/fields/rich-text}
|
|
114
114
|
* @see {@link https://prismic.io/docs/fields/table}
|
|
115
115
|
*/
|
|
116
|
-
|
|
116
|
+
richTextComponents?: string
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -144,7 +144,6 @@ async function addPrismicClient() {
|
|
|
144
144
|
) {
|
|
145
145
|
await addDependency("@prismicio/client")
|
|
146
146
|
logger.info("Added `@prismicio/client` required peer dependency")
|
|
147
|
-
|
|
148
147
|
}
|
|
149
148
|
} catch {
|
|
150
149
|
// noop
|
|
@@ -167,7 +166,7 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
167
166
|
return addPrismicClient()
|
|
168
167
|
}
|
|
169
168
|
},
|
|
170
|
-
defaults: (nuxt) => {
|
|
169
|
+
defaults: (nuxt): Required<PrismicModuleOptions> => {
|
|
171
170
|
const nuxt3flavor =
|
|
172
171
|
getNuxtVersion(nuxt).startsWith("3") &&
|
|
173
172
|
!nuxt.options?.future?.compatibilityVersion
|
|
@@ -178,11 +177,11 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
178
177
|
environment: "",
|
|
179
178
|
clientConfig: {},
|
|
180
179
|
client: "~/app/prismic/client",
|
|
180
|
+
linkResolver: "~/app/prismic/linkResolver",
|
|
181
181
|
preview: "/preview",
|
|
182
182
|
toolbar: true,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
defaultComponents: "~/app/prismic/defaultComponents",
|
|
183
|
+
components: {
|
|
184
|
+
richTextComponents: "~/app/prismic/richTextComponents ",
|
|
186
185
|
},
|
|
187
186
|
}
|
|
188
187
|
}
|
|
@@ -191,12 +190,12 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
191
190
|
endpoint: "",
|
|
192
191
|
environment: "",
|
|
193
192
|
client: "~/prismic/client",
|
|
193
|
+
linkResolver: "~/prismic/linkResolver",
|
|
194
194
|
clientConfig: {},
|
|
195
195
|
preview: "/preview",
|
|
196
196
|
toolbar: true,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
defaultComponents: "~/prismic/defaultComponents",
|
|
197
|
+
components: {
|
|
198
|
+
richTextComponents: "~/prismic/richTextComponents",
|
|
200
199
|
},
|
|
201
200
|
}
|
|
202
201
|
},
|
|
@@ -289,11 +288,11 @@ export default defineNuxtModule<PrismicModuleOptions>({
|
|
|
289
288
|
}
|
|
290
289
|
proxyUserFileWithUndefinedFallback(
|
|
291
290
|
"linkResolver",
|
|
292
|
-
moduleOptions.
|
|
291
|
+
moduleOptions.linkResolver!,
|
|
293
292
|
)
|
|
294
293
|
proxyUserFileWithUndefinedFallback(
|
|
295
|
-
"
|
|
296
|
-
moduleOptions.
|
|
294
|
+
"richTextComponents",
|
|
295
|
+
moduleOptions.components!.richTextComponents!,
|
|
297
296
|
)
|
|
298
297
|
|
|
299
298
|
return true
|
|
@@ -6,37 +6,10 @@ usePrismicPreview()
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<template>
|
|
9
|
-
<section
|
|
10
|
-
<figure>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
alt="Prismic"
|
|
14
|
-
/>
|
|
15
|
-
<figcaption>Loading preview...</figcaption>
|
|
9
|
+
<section style="position: fixed; inset: 0; display: flex; justify-content: center; align-items: center; background: #ffffff;">
|
|
10
|
+
<figure style="text-align: center;">
|
|
11
|
+
<svg style="height: 2rem;" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 109 28" class="dark:text-gray-ee h-6 w-auto text-black md:h-7"><path fill="#000000" fill-rule="evenodd" d="m27.629 14.573-2.064-2.06a.869.869 0 0 1-.256-.616V9.376c0-2.33-.242-3.175-.699-4.026a4.753 4.753 0 0 0-1.98-1.976c-.853-.455-1.7-.698-4.033-.698h-3.339a.175.175 0 0 1-.123-.297l2.063-2.06a.877.877 0 0 1 .62-.256h1.16c3.112 0 4.24.323 5.378.93a6.337 6.337 0 0 1 2.64 2.635c.608 1.135.932 2.262.932 5.368v5.454a.175.175 0 0 1-.3.123ZM13.389 27.64l2.064-2.06a.876.876 0 0 1 .62-.256h2.524c2.334 0 3.18-.243 4.034-.698a4.754 4.754 0 0 0 1.979-1.976c.456-.851.7-1.696.7-4.026v-3.332a.174.174 0 0 1 .298-.123l2.064 2.06a.87.87 0 0 1 .255.616v1.159c0 3.106-.323 4.233-.932 5.368a6.338 6.338 0 0 1-2.64 2.634c-1.137.608-2.266.931-5.378.931h-5.464a.174.174 0 0 1-.124-.297ZM2.363 15.487l-2.064-2.06A.175.175 0 0 0 0 13.55v5.454c0 3.106.324 4.232.933 5.368a6.337 6.337 0 0 0 2.639 2.634c1.138.608 2.266.931 5.378.931h1.16a.877.877 0 0 0 .62-.256l2.063-2.06a.174.174 0 0 0-.124-.297H9.331c-2.334 0-3.18-.243-4.034-.698a4.753 4.753 0 0 1-1.98-1.976c-.456-.852-.699-1.696-.699-4.026v-2.522a.869.869 0 0 0-.255-.615ZM14.539.36l-2.064 2.06a.876.876 0 0 1-.62.256H9.332c-2.334 0-3.18.243-4.034.698a4.753 4.753 0 0 0-1.98 1.976c-.456.851-.699 1.696-.699 4.026v3.332a.175.175 0 0 1-.299.123L.256 10.77A.87.87 0 0 1 0 10.155V8.996C0 5.89.324 4.763.933 3.628A6.338 6.338 0 0 1 3.572.994C4.71.386 5.838.063 8.95.063h5.465a.175.175 0 0 1 .124.297Zm5.915 7.188 2.814 2.685a.175.175 0 0 0 .296-.126V7.902a3.488 3.488 0 0 0-3.491-3.484h-6.62a.877.877 0 0 0-.618.255l-2.066 2.06a.174.174 0 0 0 .124.298H19.2c.218 0 .426.04.617.112.233.084.45.22.637.405ZM17.737 23.29l2.69-2.81c.187-.186.322-.403.407-.635.072-.191.112-.399.112-.616v-8.291a.175.175 0 0 1 .299-.123l2.064 2.062a.87.87 0 0 1 .255.615V20.1a3.488 3.488 0 0 1-3.49 3.485h-2.21a.175.175 0 0 1-.127-.295ZM7.474 20.451 4.66 17.767a.175.175 0 0 0-.296.125v2.206a3.488 3.488 0 0 0 3.491 3.484h6.62a.876.876 0 0 0 .618-.256l2.066-2.06a.174.174 0 0 0-.124-.297H8.728c-.218 0-.426-.04-.618-.112a1.74 1.74 0 0 1-.636-.406Zm2.717-15.739-2.69 2.81a1.735 1.735 0 0 0-.406.635c-.073.192-.113.4-.113.616v8.292a.174.174 0 0 1-.299.122l-2.063-2.06a.87.87 0 0 1-.255-.615v-6.61a3.488 3.488 0 0 1 3.491-3.484h2.21a.175.175 0 0 1 .126.294ZM36.622 8.54h-.676c-.562 0-1.018.454-1.018 1.014v14.32c0 .561.456 1.015 1.018 1.015h.625c.563 0 1.019-.454 1.019-1.014V18.28c0-.037.03-.066.066-.066.134.184.304.373.51.565.208.193.46.374.755.543.296.17.636.308 1.02.416a4.99 4.99 0 0 0 1.332.161 4.823 4.823 0 0 0 3.716-1.685 5.737 5.737 0 0 0 1.053-1.848c.252-.708.377-1.47.377-2.286a7.17 7.17 0 0 0-.354-2.286 5.333 5.333 0 0 0-1.043-1.848 4.927 4.927 0 0 0-1.664-1.235c-.65-.3-1.383-.45-2.196-.45-.755 0-1.457.153-2.108.461-.65.308-1.168.8-1.553 1.478a.044.044 0 0 1-.044-.044V9.37a.833.833 0 0 0-.835-.831Zm6.925 4.295c.14.4.21.816.21 1.247 0 .431-.07.847-.21 1.247a3.102 3.102 0 0 1-1.608 1.801 2.988 2.988 0 0 1-1.31.277 2.985 2.985 0 0 1-2.296-1.016 3.155 3.155 0 0 1-.621-1.062c-.14-.4-.21-.816-.21-1.247 0-.431.07-.847.21-1.247a3.101 3.101 0 0 1 1.608-1.801 2.985 2.985 0 0 1 1.31-.277 2.984 2.984 0 0 1 2.295 1.016c.274.308.481.662.622 1.062Zm7.471-4.295h-.762c-.563 0-1.019.454-1.019 1.014v9.056c0 .56.456 1.014 1.019 1.014h.625c.562 0 1.018-.454 1.018-1.014v-4.92c0-.155.033-.386.1-.694.067-.307.2-.615.4-.923.2-.308.487-.581.865-.82.377-.239.876-.358 1.497-.358.207 0 .418.02.632.058a.555.555 0 0 0 .654-.545v-1.52a.59.59 0 0 0-.476-.58 2.448 2.448 0 0 0-.477-.045c-.71 0-1.339.177-1.886.53-.547.355-.969.855-1.264 1.502a.044.044 0 0 1-.045-.045v-.833a.88.88 0 0 0-.88-.877Zm8.87 0h-.625c-.563 0-1.019.454-1.019 1.014v9.056c0 .56.456 1.014 1.019 1.014h.625c.562 0 1.018-.454 1.018-1.014V9.553c0-.56-.456-1.014-1.018-1.014Zm-1.544-4.93c-.318.33-.477.719-.477 1.165 0 .447.159.836.477 1.167.318.33.721.496 1.21.496.487 0 .898-.158 1.23-.473.333-.316.5-.712.5-1.19a1.57 1.57 0 0 0-.5-1.189c-.332-.315-.743-.473-1.23-.473-.489 0-.892.165-1.21.496Zm9.55 6.87c.422 0 .903.197 1.443.593.396.29.943.257 1.301-.079l.332-.31a1.012 1.012 0 0 0-.059-1.53c-.31-.248-.59-.418-.842-.51a6.1 6.1 0 0 0-2.108-.381c-.532 0-1.057.069-1.575.207a4.093 4.093 0 0 0-1.375.647c-.4.292-.721.666-.965 1.12-.245.454-.366.99-.366 1.605 0 .708.14 1.262.421 1.663.281.4.636.712 1.065.935a5.23 5.23 0 0 0 1.386.485c.496.1.958.208 1.387.323.429.116.784.266 1.065.45.28.185.421.47.421.855a.976.976 0 0 1-.166.566c-.11.161-.255.296-.433.404-.177.108-.37.185-.576.23-.207.047-.407.07-.6.07-.561 0-1.038-.127-1.43-.381a3.795 3.795 0 0 1-.42-.328 1.022 1.022 0 0 0-1.386.037l-.276.27a1.012 1.012 0 0 0 .093 1.53c.38.29.707.484.98.58.694.247 1.456.37 2.284.37a7.46 7.46 0 0 0 1.642-.184 4.618 4.618 0 0 0 1.475-.6 3.29 3.29 0 0 0 1.065-1.098c.274-.454.41-1.012.41-1.674 0-.724-.14-1.293-.42-1.709a3.077 3.077 0 0 0-1.066-.981 5.32 5.32 0 0 0-1.386-.531 82.131 82.131 0 0 1-1.387-.335 4.536 4.536 0 0 1-1.065-.393c-.28-.154-.421-.4-.421-.739 0-.415.17-.716.51-.9a2.16 2.16 0 0 1 1.043-.277Zm7.989-1.94h-.492c-.562 0-1.018.454-1.018 1.014v9.056c0 .56.456 1.014 1.018 1.014h.625c.563 0 1.019-.454 1.019-1.014v-5.036c0-.37.044-.724.133-1.062a2.52 2.52 0 0 1 .433-.901c.2-.262.45-.47.754-.623.303-.155.676-.231 1.12-.231.651 0 1.117.204 1.398.611.281.408.421.959.421 1.652v5.59c0 .56.457 1.014 1.02 1.014h.624c.563 0 1.019-.454 1.019-1.014v-4.99c0-.354.04-.704.122-1.05a2.71 2.71 0 0 1 .399-.924 2.09 2.09 0 0 1 .71-.647c.288-.162.64-.242 1.054-.242.399 0 .724.069.976.207a1.6 1.6 0 0 1 .599.566 2.4 2.4 0 0 1 .31.832c.06.315.09.642.09.981v5.267c0 .56.455 1.014 1.018 1.014h.625c.562 0 1.018-.454 1.018-1.014v-5.59c0-.662-.066-1.282-.2-1.86a4.265 4.265 0 0 0-.654-1.512 3.172 3.172 0 0 0-1.187-1.016c-.488-.246-1.087-.37-1.797-.37-.798 0-1.486.166-2.063.497-.577.331-1.057.85-1.442 1.559-.547-1.37-1.656-2.055-3.328-2.055-.887 0-1.593.204-2.118.611a4.342 4.342 0 0 0-1.187 1.398v-.718c0-.56-.456-1.014-1.019-1.014Zm19.922 0h-.625c-.562 0-1.018.454-1.018 1.014v9.056c0 .56.456 1.014 1.018 1.014h.625c.563 0 1.019-.454 1.019-1.014V9.553c0-.56-.456-1.014-1.019-1.014Zm-1.543-4.93c-.318.33-.477.719-.477 1.165 0 .447.159.836.477 1.167.318.33.72.496 1.209.496.488 0 .898-.158 1.23-.473.334-.316.5-.712.5-1.19a1.57 1.57 0 0 0-.5-1.189c-.332-.315-.742-.473-1.23-.473-.489 0-.891.165-1.21.496Zm12.257 7.447a2.9 2.9 0 0 1 .289.201 1.02 1.02 0 0 0 1.364-.097l.411-.429a1.012 1.012 0 0 0-.127-1.515c-.356-.264-.666-.448-.928-.55a5.591 5.591 0 0 0-2.052-.404c-.799 0-1.553.138-2.263.415-.71.277-1.323.67-1.841 1.178a5.588 5.588 0 0 0-1.231 1.836c-.303.716-.455 1.512-.455 2.39 0 .878.151 1.674.455 2.39a5.585 5.585 0 0 0 1.231 1.836c.518.508 1.131.9 1.841 1.178.71.277 1.464.415 2.263.415.237 0 .518-.027.843-.08a6.222 6.222 0 0 0 2.074-.75.964.964 0 0 0 .24-1.479l-.405-.453a1.022 1.022 0 0 0-1.365-.143c-.084.061-.161.11-.233.146a2.55 2.55 0 0 1-1.154.265c-.488 0-.924-.092-1.309-.277a3.11 3.11 0 0 1-1.608-1.801 3.724 3.724 0 0 1-.211-1.247c0-.431.07-.847.211-1.247a3.11 3.11 0 0 1 1.608-1.801 2.987 2.987 0 0 1 1.309-.277c.355 0 .703.1 1.043.3Z" clip-rule="evenodd"></path></svg>
|
|
12
|
+
<figcaption style="font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; font-size: 1rem; margin-top: .5rem;">Loading preview...</figcaption>
|
|
16
13
|
</figure>
|
|
17
14
|
</section>
|
|
18
15
|
</template>
|
|
19
|
-
|
|
20
|
-
<style scoped>
|
|
21
|
-
.prismic-preview {
|
|
22
|
-
width: 100%;
|
|
23
|
-
height: 100vh;
|
|
24
|
-
position: fixed;
|
|
25
|
-
top: 0;
|
|
26
|
-
left: 0;
|
|
27
|
-
display: flex;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
align-items: center;
|
|
30
|
-
background: #ffffff;
|
|
31
|
-
color: #666666;
|
|
32
|
-
font-family:
|
|
33
|
-
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
|
|
34
|
-
Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
|
35
|
-
font-size: 1rem;
|
|
36
|
-
text-align: center;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
img {
|
|
40
|
-
margin-bottom: 1.25rem;
|
|
41
|
-
}
|
|
42
|
-
</style>
|
|
@@ -5,15 +5,11 @@ export default defineNuxtPlugin({
|
|
|
5
5
|
name: "prismic:plugin:client",
|
|
6
6
|
parallel: true,
|
|
7
7
|
setup() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
event.preventDefault()
|
|
14
|
-
refreshNuxtData()
|
|
15
|
-
})
|
|
16
|
-
}
|
|
8
|
+
if (useRuntimeConfig().public.prismic?.preview) {
|
|
9
|
+
window.addEventListener("prismicPreviewUpdate", (event) => {
|
|
10
|
+
event.preventDefault()
|
|
11
|
+
refreshNuxtData()
|
|
12
|
+
})
|
|
17
13
|
}
|
|
18
14
|
},
|
|
19
15
|
})
|
package/src/runtime/plugin.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { defineNuxtPlugin } from "#app"
|
|
|
2
2
|
import NuxtLink from "#app/components/nuxt-link"
|
|
3
3
|
import _client from "#build/prismic/proxy/client"
|
|
4
4
|
// @ts-expect-error - Proxy file
|
|
5
|
-
import defaultComponents from "#build/prismic/proxy/defaultComponents"
|
|
6
|
-
// @ts-expect-error - Proxy file
|
|
7
5
|
import linkResolver from "#build/prismic/proxy/linkResolver"
|
|
6
|
+
// @ts-expect-error - Proxy file
|
|
7
|
+
import richTextComponents from "#build/prismic/proxy/richTextComponents"
|
|
8
8
|
import {
|
|
9
9
|
onNuxtReady,
|
|
10
10
|
refreshNuxtData,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useRouter,
|
|
15
15
|
useRuntimeConfig,
|
|
16
16
|
} from "#imports"
|
|
17
|
-
import { Client, createClient } from "@prismicio/client"
|
|
17
|
+
import { Client, cookie, createClient, getToolbarSrc } from "@prismicio/client"
|
|
18
18
|
import { createPrismic } from "@prismicio/vue"
|
|
19
19
|
|
|
20
20
|
export default defineNuxtPlugin({
|
|
@@ -109,7 +109,7 @@ export default defineNuxtPlugin({
|
|
|
109
109
|
script: [
|
|
110
110
|
{
|
|
111
111
|
key: "prismic-preview",
|
|
112
|
-
src:
|
|
112
|
+
src: getToolbarSrc(client.repositoryName),
|
|
113
113
|
async: true,
|
|
114
114
|
defer: true,
|
|
115
115
|
crossorigin: "anonymous",
|
|
@@ -118,17 +118,17 @@ export default defineNuxtPlugin({
|
|
|
118
118
|
})
|
|
119
119
|
} else {
|
|
120
120
|
// TODO: We might want to let user disable this behavior because it might have unexpected side effects
|
|
121
|
-
useCookie(
|
|
121
|
+
useCookie(cookie.preview).value = null
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
const prismicPlugin = createPrismic({
|
|
126
126
|
client,
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
linkResolver,
|
|
128
|
+
components: {
|
|
129
129
|
linkInternalComponent: NuxtLink,
|
|
130
130
|
linkExternalComponent: NuxtLink,
|
|
131
|
-
|
|
131
|
+
richTextComponents,
|
|
132
132
|
},
|
|
133
133
|
})
|
|
134
134
|
|
|
@@ -4,11 +4,11 @@ import { onMounted } from "vue"
|
|
|
4
4
|
|
|
5
5
|
/** Resolves Prismic previews on the preview entry page (`/preview`) */
|
|
6
6
|
export const usePrismicPreview = (defaultURL = "/"): void => {
|
|
7
|
-
const { client,
|
|
7
|
+
const { client, linkResolver } = usePrismic()
|
|
8
8
|
const { push } = useRouter()
|
|
9
9
|
onMounted(async () => {
|
|
10
10
|
const redirectURL = await client.resolvePreviewURL({
|
|
11
|
-
linkResolver
|
|
11
|
+
linkResolver,
|
|
12
12
|
defaultURL,
|
|
13
13
|
})
|
|
14
14
|
|