@nuxtjs/prismic 4.0.1 → 4.1.0-pr.235.302ce94
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/README.md +18 -32
- package/dist/module.d.mts +48 -75
- package/dist/module.json +3 -3
- package/dist/module.mjs +193 -242
- package/dist/runtime/PrismicPreview.d.vue.ts +3 -0
- package/dist/runtime/PrismicPreview.vue +8 -14
- package/dist/runtime/PrismicPreview.vue.d.ts +3 -0
- package/dist/runtime/plugin.client.js +13 -7
- package/dist/runtime/plugin.js +89 -72
- package/dist/runtime/usePrismicPreview.d.ts +1 -5
- package/dist/runtime/usePrismicPreview.js +3 -3
- package/dist/types.d.mts +3 -1
- package/package.json +38 -45
- package/src/module.ts +352 -185
- package/src/runtime/PrismicPreview.vue +12 -16
- package/src/runtime/plugin.client.ts +16 -12
- package/src/runtime/plugin.ts +114 -103
- package/src/runtime/usePrismicPreview.ts +7 -11
- package/dist/client/200.html +0 -1
- package/dist/client/404.html +0 -1
- package/dist/client/_nuxt/BMD6bpEv.js +0 -1
- package/dist/client/_nuxt/BQB6UGbx.js +0 -25
- package/dist/client/_nuxt/CkG7IjgS.js +0 -1
- package/dist/client/_nuxt/DlAUqK2U.js +0 -1
- package/dist/client/_nuxt/H1okkFcd.js +0 -1
- package/dist/client/_nuxt/RYS3n4u0.js +0 -1
- package/dist/client/_nuxt/V_weDLQm.js +0 -1
- package/dist/client/_nuxt/builds/latest.json +0 -1
- package/dist/client/_nuxt/builds/meta/f4865457-86fc-49e4-8a56-18ed8a000da8.json +0 -1
- package/dist/client/_nuxt/entry.BC9BDAld.css +0 -1
- package/dist/client/_nuxt/error-404.smTsHvdw.css +0 -1
- package/dist/client/_nuxt/error-500.Bo-s0s94.css +0 -1
- package/dist/client/_nuxt/index.C4BggqQh.css +0 -1
- package/dist/client/index.html +0 -1
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -136
- package/dist/types.d.ts +0 -1
- package/src/devtools/index.ts +0 -127
- package/src/devtools/types.ts +0 -22
- package/src/lib/fileExists.ts +0 -15
- package/src/lib/index.ts +0 -2
- package/src/lib/logger.ts +0 -3
- package/src/types.ts +0 -137
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -12,26 +12,14 @@ Replace all on all files (README.md, CONTRIBUTING.md, bug_report.md, package.jso
|
|
|
12
12
|
|
|
13
13
|
[![npm version][npm-version-src]][npm-version-href]
|
|
14
14
|
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
15
|
-
[![Github Actions CI][github-actions-ci-src]][github-actions-ci-href]
|
|
16
|
-
[![Codecov][codecov-src]][codecov-href]
|
|
17
|
-
[![Conventional Commits][conventional-commits-src]][conventional-commits-href]
|
|
18
|
-
[![License][license-src]][license-href]
|
|
19
15
|
|
|
20
|
-
Easily connect your Nuxt
|
|
16
|
+
Easily connect your [Nuxt][nuxt] application to your content hosted on [Prismic][prismic].
|
|
21
17
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
- [📚 Prismic Documentation][prismic-docs]
|
|
18
|
+
- 🚀 Add Prismic to your Nuxt app in seconds.
|
|
19
|
+
- 🍡 Fetch and present Prismic content with components and composables.
|
|
20
|
+
- 🏀 [Try it now on the online playground][playground].
|
|
26
21
|
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
<!-- Highlight some of the features your module provide here -->
|
|
30
|
-
- 🚀 Add Prismic to your Nuxt app in seconds;
|
|
31
|
-
- 🎣 Access Prismic SDK through composition and options API;
|
|
32
|
-
- 🖼 Prismic previews supported.
|
|
33
|
-
|
|
34
|
-
## Quick Setup
|
|
22
|
+
## Install
|
|
35
23
|
|
|
36
24
|
Install the module to your Nuxt application with one command:
|
|
37
25
|
|
|
@@ -42,18 +30,22 @@ npx nuxi@latest module add prismic
|
|
|
42
30
|
Then, configure your Prismic API endpoint:
|
|
43
31
|
|
|
44
32
|
```javascript
|
|
45
|
-
import { defineNuxtConfig } from
|
|
33
|
+
import { defineNuxtConfig } from "nuxt"
|
|
46
34
|
|
|
47
35
|
export default defineNuxtConfig({
|
|
48
|
-
modules: [
|
|
36
|
+
modules: ["@nuxtjs/prismic"],
|
|
49
37
|
prismic: {
|
|
50
|
-
endpoint:
|
|
38
|
+
endpoint: "my-repository",
|
|
51
39
|
},
|
|
52
|
-
})
|
|
40
|
+
})
|
|
53
41
|
```
|
|
54
42
|
|
|
55
43
|
That's it! You can now use Prismic in your Nuxt app ✨
|
|
56
44
|
|
|
45
|
+
## Documentation
|
|
46
|
+
|
|
47
|
+
To discover what's new on this package check out [the changelog][changelog]. For full documentation, visit the [official Prismic documentation][prismic-docs].
|
|
48
|
+
|
|
57
49
|
## Contributing
|
|
58
50
|
|
|
59
51
|
Whether you're helping us fix bugs, improve the docs, or spread the word, we'd love to have you as part of the Prismic developer community!
|
|
@@ -66,6 +58,8 @@ Whether you're helping us fix bugs, improve the docs, or spread the word, we'd l
|
|
|
66
58
|
|
|
67
59
|
**Submitting code changes**: For small fixes, feel free to [open a pull request][repo-pull-requests] with a description of your changes. For large changes, please first [open an issue][repo-feature-request] so we can discuss if and how the changes should be implemented.
|
|
68
60
|
|
|
61
|
+
For more clarity on this project and its structure you can also check out the detailed [CONTRIBUTING.md][contributing] document.
|
|
62
|
+
|
|
69
63
|
## License
|
|
70
64
|
|
|
71
65
|
[MIT License](./LICENSE)
|
|
@@ -76,11 +70,11 @@ Whether you're helping us fix bugs, improve the docs, or spread the word, we'd l
|
|
|
76
70
|
|
|
77
71
|
<!-- Replace link with a more useful one if available -->
|
|
78
72
|
|
|
79
|
-
[
|
|
80
|
-
[nuxt-docs]: https://
|
|
81
|
-
[prismic-docs]: https://prismic.io/docs/technical-reference/prismicio-vue?version=v4
|
|
73
|
+
[prismic-docs]: https://prismic.io/docs/nuxt
|
|
74
|
+
[nuxt-docs]: https://nuxt.com
|
|
82
75
|
[changelog]: ./CHANGELOG.md
|
|
83
76
|
[contributing]: ./CONTRIBUTING.md
|
|
77
|
+
[playground]: https://stackblitz.com/github/nuxt-modules/prismic/tree/master/examples/minimal?file=pages%2Findex.vue
|
|
84
78
|
|
|
85
79
|
<!-- Replace link with a more useful one if available -->
|
|
86
80
|
|
|
@@ -95,11 +89,3 @@ Whether you're helping us fix bugs, improve the docs, or spread the word, we'd l
|
|
|
95
89
|
[npm-version-href]: https://npmjs.com/package/@nuxtjs/prismic
|
|
96
90
|
[npm-downloads-src]: https://img.shields.io/npm/dm/@nuxtjs/prismic.svg?style=flat&colorA=020420&colorB=00DC82
|
|
97
91
|
[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/prismic
|
|
98
|
-
[github-actions-ci-src]: https://img.shields.io/github/actions/workflow/status/nuxt-modules/prismic/ci.yml.svg?style=flat&colorA=020420&colorB=00DC82
|
|
99
|
-
[github-actions-ci-href]: https://github.com/nuxt-modules/prismic/actions?query=workflow%3Aci
|
|
100
|
-
[codecov-src]: https://img.shields.io/codecov/c/github/nuxt-modules/prismic.svg?style=flat&colorA=020420&colorB=00DC82
|
|
101
|
-
[codecov-href]: https://codecov.io/gh/nuxt-modules/prismic
|
|
102
|
-
[conventional-commits-src]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat&colorA=020420&colorB=00DC82
|
|
103
|
-
[conventional-commits-href]: https://conventionalcommits.org
|
|
104
|
-
[license-src]: https://img.shields.io/npm/l/@nuxtjs/prismic.svg?style=flat&colorA=020420&colorB=00DC82
|
|
105
|
-
[license-href]: https://npmjs.com/package/@nuxtjs/prismic
|
package/dist/module.d.mts
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { ClientConfig } from '@prismicio/client';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Prismic Nuxt module options.
|
|
6
6
|
*
|
|
7
|
-
* @see
|
|
8
|
-
* @see
|
|
7
|
+
* @see {@link https://prismic.io/docs/nuxt}
|
|
8
|
+
* @see {@link https://prismic.io/docs/technical-reference/nuxtjs-prismic}
|
|
9
9
|
*/
|
|
10
|
-
type PrismicModuleOptions =
|
|
10
|
+
type PrismicModuleOptions = {
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* instance used to fetch content from a Prismic repository
|
|
12
|
+
* The Prismic repository name or full Content API endpoint to init the
|
|
13
|
+
* module's client instance used to fetch content from a Prismic repository
|
|
14
|
+
* with.
|
|
14
15
|
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Said client will be used exposed through `this.$prismic.client` and
|
|
17
|
-
* `usePrismic().client`.
|
|
18
16
|
* @example
|
|
19
17
|
*
|
|
20
|
-
* ```
|
|
21
|
-
* //
|
|
22
|
-
* "my-repo"
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // With a repository name
|
|
20
|
+
* createClient("my-repo")
|
|
23
21
|
*
|
|
24
|
-
* //
|
|
25
|
-
* "https://my-repo.cdn.prismic.io/api/v2"
|
|
22
|
+
* // With a full Prismic Content API endpoint
|
|
23
|
+
* createClient("https://my-repo.cdn.prismic.io/api/v2")
|
|
26
24
|
* ```
|
|
27
25
|
*
|
|
28
|
-
* @see
|
|
26
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client}
|
|
29
27
|
*/
|
|
30
28
|
endpoint?: string;
|
|
31
29
|
/**
|
|
@@ -38,35 +36,25 @@ type PrismicModuleOptions = Omit<PrismicPluginOptions, 'endpoint' | 'client' | '
|
|
|
38
36
|
*/
|
|
39
37
|
environment?: string;
|
|
40
38
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
39
|
+
* Configuration options that determines how content will be queries from the
|
|
40
|
+
* Prismic repository.
|
|
43
41
|
*
|
|
44
|
-
* @
|
|
45
|
-
* Said client will be used exposed through `this.$prismic.client` and
|
|
46
|
-
* `usePrismic().client`.
|
|
47
|
-
* @see Prismic client documentation {@link https://prismic.io/docs/technical-reference/prismicio-client}
|
|
42
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client}
|
|
48
43
|
*/
|
|
49
|
-
|
|
44
|
+
clientConfig?: ClientConfig;
|
|
50
45
|
/**
|
|
51
|
-
* An optional path to a file exporting a
|
|
52
|
-
*
|
|
53
|
-
* parameter with `@prismicio/client`.
|
|
46
|
+
* An optional path to a file exporting a Prismic client instance used to
|
|
47
|
+
* fetch content from a Prismic repository to configure the module with.
|
|
54
48
|
*
|
|
55
|
-
* @
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* An optional path to a file exporting an HTML serializer to customize
|
|
60
|
-
* the way rich text fields are rendered.
|
|
61
|
-
*
|
|
62
|
-
* @deprecated Use `components.richTextComponents` instead.
|
|
49
|
+
* @remarks
|
|
50
|
+
* When provided, it takes precedence over the `endpoint` and `clientConfig`
|
|
51
|
+
* options.
|
|
63
52
|
*
|
|
64
|
-
* @see
|
|
53
|
+
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client}
|
|
65
54
|
*/
|
|
66
|
-
|
|
55
|
+
client?: string;
|
|
67
56
|
/**
|
|
68
|
-
* Desired path of the preview page used by Prismic to enter preview
|
|
69
|
-
* session.
|
|
57
|
+
* Desired path of the preview page used by Prismic to enter preview session.
|
|
70
58
|
*
|
|
71
59
|
* @remarks
|
|
72
60
|
* `false` can be used to disable the preview page.
|
|
@@ -83,54 +71,39 @@ type PrismicModuleOptions = Omit<PrismicPluginOptions, 'endpoint' | 'client' | '
|
|
|
83
71
|
* @defaultValue `true`
|
|
84
72
|
*/
|
|
85
73
|
toolbar?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
|
|
88
|
-
*
|
|
89
|
-
* @defaultValue `true`
|
|
90
|
-
*/
|
|
91
|
-
devtools?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Options used by Prismic Vue components.
|
|
94
|
-
*/
|
|
95
|
-
components?: Omit<Required<PrismicPluginOptions>['components'], 'richTextComponents' | 'linkRel' | 'sliceZoneDefaultComponent' | 'linkInternalComponent' | 'linkExternalComponent'> & {
|
|
96
|
-
/**
|
|
97
|
-
* An optional path to a file exporting the `rel` attribute to apply on links.
|
|
98
|
-
* It can export a function to use the link's metadata to determine the `rel` value.
|
|
99
|
-
*
|
|
100
|
-
* @defaultValue `"noreferrer"` for external links.
|
|
101
|
-
*/
|
|
102
|
-
linkRel?: string;
|
|
74
|
+
/** Options used by Prismic Vue components. */
|
|
75
|
+
componentsConfig?: {
|
|
103
76
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
77
|
+
* The path to a file exporting a default link resolver function used to
|
|
78
|
+
* resolve links.
|
|
106
79
|
*
|
|
107
|
-
* @see
|
|
80
|
+
* @see {@link https://prismic.io/docs/routes}
|
|
108
81
|
*/
|
|
109
|
-
|
|
82
|
+
linkResolver?: string;
|
|
110
83
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* @remarks
|
|
115
|
-
* Components will be rendered using the {@link SliceComponentProps} interface.
|
|
84
|
+
* The path to a file exporting default components or shorthand definitions
|
|
85
|
+
* for rich text and table components.
|
|
116
86
|
*
|
|
117
|
-
* @
|
|
87
|
+
* @see {@link https://prismic.io/docs/fields/rich-text}
|
|
88
|
+
* @see {@link https://prismic.io/docs/fields/table}
|
|
118
89
|
*/
|
|
119
|
-
|
|
90
|
+
defaultComponents?: string;
|
|
120
91
|
};
|
|
121
92
|
};
|
|
122
|
-
|
|
123
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Prismic Nuxt module options.
|
|
95
|
+
*
|
|
96
|
+
* @see {@link https://prismic.io/docs/nuxt}
|
|
97
|
+
* @see {@link https://prismic.io/docs/technical-reference/nuxtjs-prismic}
|
|
98
|
+
*/
|
|
99
|
+
type ModuleOptions = PrismicModuleOptions;
|
|
100
|
+
declare module "@nuxt/schema" {
|
|
124
101
|
interface PublicRuntimeConfig {
|
|
125
|
-
/**
|
|
126
|
-
* `@nuxtjs/prismic` module options.
|
|
127
|
-
*
|
|
128
|
-
* @see Module documentation: {@link https://prismic.nuxtjs.org}
|
|
129
|
-
* @see Prismic documentation: {@link https://prismic.io/docs/nuxt-3-setup}
|
|
130
|
-
*/
|
|
102
|
+
/** The Prismic Nuxt module options. */
|
|
131
103
|
prismic: PrismicModuleOptions;
|
|
132
104
|
}
|
|
133
105
|
}
|
|
134
106
|
declare const _default: _nuxt_schema.NuxtModule<PrismicModuleOptions, PrismicModuleOptions, false>;
|
|
135
107
|
|
|
136
|
-
export {
|
|
108
|
+
export { _default as default };
|
|
109
|
+
export type { ModuleOptions, PrismicModuleOptions };
|
package/dist/module.json
CHANGED