@prismicio/vue 3.0.0-beta.8 → 3.1.0
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/README.md +1 -1
- package/dist/index.cjs +58 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +25 -168
- package/dist/index.js +58 -20
- package/dist/index.js.map +1 -1
- package/package.json +25 -24
- package/src/components/PrismicRichText.ts +1 -1
- package/src/components/SliceZone.ts +7 -1
- package/src/createPrismic.ts +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismicio/vue",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Vue plugin, components, and composables to fetch and present Prismic content",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -44,44 +44,45 @@
|
|
|
44
44
|
"release:beta:dry": "standard-version --release-as major --prerelease beta --dry-run",
|
|
45
45
|
"release:dry": "standard-version --dry-run",
|
|
46
46
|
"size": "size-limit",
|
|
47
|
-
"test": "npm run lint && npm run unit && npm run build && npm run size",
|
|
47
|
+
"test": "npm run lint && npm run types && npm run unit && npm run build && npm run size",
|
|
48
|
+
"types": "tsc --noEmit",
|
|
48
49
|
"unit": "vitest run --coverage",
|
|
49
50
|
"unit:watch": "vitest watch"
|
|
50
51
|
},
|
|
51
52
|
"dependencies": {
|
|
52
|
-
"@prismicio/client": "^6.
|
|
53
|
-
"@prismicio/helpers": "^2.3.
|
|
54
|
-
"@prismicio/types": "^0.
|
|
53
|
+
"@prismicio/client": "^6.7.0",
|
|
54
|
+
"@prismicio/helpers": "^2.3.3",
|
|
55
|
+
"@prismicio/types": "^0.2.3",
|
|
55
56
|
"isomorphic-unfetch": "^3.1.0",
|
|
56
|
-
"vue-router": "^4.
|
|
57
|
+
"vue-router": "^4.1.4"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
|
-
"@prismicio/mock": "^0.
|
|
60
|
-
"@size-limit/preset-small-lib": "^
|
|
60
|
+
"@prismicio/mock": "^0.1.1",
|
|
61
|
+
"@size-limit/preset-small-lib": "^8.0.1",
|
|
61
62
|
"@types/escape-html": "^1.0.2",
|
|
62
|
-
"@types/jsdom-global": "^3.0.
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "
|
|
64
|
-
"@typescript-eslint/parser": "^5.
|
|
65
|
-
"@vitejs/plugin-vue": "^
|
|
63
|
+
"@types/jsdom-global": "^3.0.3",
|
|
64
|
+
"@typescript-eslint/eslint-plugin": "~5.33.0",
|
|
65
|
+
"@typescript-eslint/parser": "^5.34.0",
|
|
66
|
+
"@vitejs/plugin-vue": "^3.0.3",
|
|
67
|
+
"@vitest/coverage-c8": "0.22.1",
|
|
66
68
|
"@vue/compiler-sfc": "^3.2.37",
|
|
67
|
-
"@vue/eslint-config-typescript": "^
|
|
68
|
-
"@vue/test-utils": "^2.0.
|
|
69
|
-
"
|
|
70
|
-
"eslint": "^8.17.0",
|
|
69
|
+
"@vue/eslint-config-typescript": "^11.0.0",
|
|
70
|
+
"@vue/test-utils": "^2.0.2",
|
|
71
|
+
"eslint": "^8.22.0",
|
|
71
72
|
"eslint-config-prettier": "^8.5.0",
|
|
72
|
-
"eslint-plugin-prettier": "^4.
|
|
73
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
73
74
|
"eslint-plugin-tsdoc": "^0.2.16",
|
|
74
|
-
"eslint-plugin-vue": "^9.
|
|
75
|
-
"jsdom": "^
|
|
75
|
+
"eslint-plugin-vue": "^9.4.0",
|
|
76
|
+
"jsdom": "^20.0.0",
|
|
76
77
|
"jsdom-global": "^3.0.2",
|
|
77
|
-
"prettier": "^2.
|
|
78
|
+
"prettier": "^2.7.1",
|
|
78
79
|
"prettier-plugin-jsdoc": "^0.3.38",
|
|
79
80
|
"siroc": "^0.16.0",
|
|
80
|
-
"size-limit": "^
|
|
81
|
+
"size-limit": "^8.0.1",
|
|
81
82
|
"standard-version": "^9.5.0",
|
|
82
|
-
"typescript": "^4.7.
|
|
83
|
-
"vite": "^
|
|
84
|
-
"vitest": "^0.
|
|
83
|
+
"typescript": "^4.7.4",
|
|
84
|
+
"vite": "^3.0.9",
|
|
85
|
+
"vitest": "^0.22.1",
|
|
85
86
|
"vue": "^3.2.37"
|
|
86
87
|
},
|
|
87
88
|
"peerDependencies": {
|
|
@@ -169,7 +169,7 @@ export const PrismicRichTextImpl = /*#__PURE__*/ defineComponent({
|
|
|
169
169
|
const root = ref<HTMLElement | Comment | Component | null>(null);
|
|
170
170
|
|
|
171
171
|
const maybeRouter = inject(routerKey, null);
|
|
172
|
-
if (maybeRouter
|
|
172
|
+
if (maybeRouter) {
|
|
173
173
|
type InternalLink = {
|
|
174
174
|
element: HTMLAnchorElement;
|
|
175
175
|
listener: EventListener;
|
|
@@ -41,6 +41,7 @@ type ExtractSliceType<TSlice extends SliceLike> = TSlice extends SliceLikeRestV2
|
|
|
41
41
|
*/
|
|
42
42
|
export type SliceLikeRestV2<TSliceType extends string = string> = {
|
|
43
43
|
slice_type: Slice<TSliceType>["slice_type"];
|
|
44
|
+
id?: string;
|
|
44
45
|
};
|
|
45
46
|
|
|
46
47
|
/**
|
|
@@ -506,8 +507,13 @@ export const SliceZoneImpl = /*#__PURE__*/ defineComponent({
|
|
|
506
507
|
}
|
|
507
508
|
}
|
|
508
509
|
|
|
510
|
+
const key =
|
|
511
|
+
"id" in slice && slice.id
|
|
512
|
+
? slice.id
|
|
513
|
+
: `${index}-${JSON.stringify(slice)}`;
|
|
514
|
+
|
|
509
515
|
const p = {
|
|
510
|
-
key
|
|
516
|
+
key,
|
|
511
517
|
slice,
|
|
512
518
|
index,
|
|
513
519
|
context: props.context,
|
package/src/createPrismic.ts
CHANGED
|
@@ -54,9 +54,12 @@ export const createPrismic = (options: PrismicPluginOptions): PrismicPlugin => {
|
|
|
54
54
|
fetch: async (endpoint, options) => {
|
|
55
55
|
let fetchFunction: FetchLike;
|
|
56
56
|
if (typeof globalThis.fetch === "function") {
|
|
57
|
-
|
|
57
|
+
// TODO: Remove after https://github.com/prismicio/prismic-client/issues/254
|
|
58
|
+
fetchFunction = globalThis.fetch as FetchLike;
|
|
58
59
|
} else {
|
|
59
|
-
|
|
60
|
+
// TODO: Remove after https://github.com/prismicio/prismic-client/issues/254
|
|
61
|
+
fetchFunction = (await import("isomorphic-unfetch"))
|
|
62
|
+
.default as FetchLike;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
return await fetchFunction(endpoint, options);
|