@prismicio/vue 3.0.0 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/vue",
3
- "version": "3.0.0",
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.6.1",
53
- "@prismicio/helpers": "^2.3.2",
54
- "@prismicio/types": "^0.2.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.1.2"
57
+ "vue-router": "^4.1.4"
57
58
  },
58
59
  "devDependencies": {
59
- "@prismicio/mock": "^0.0.10",
60
- "@size-limit/preset-small-lib": "^7.0.8",
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.2",
63
- "@typescript-eslint/eslint-plugin": "^5.30.6",
64
- "@typescript-eslint/parser": "^5.30.6",
65
- "@vitejs/plugin-vue": "^3.0.1",
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
69
  "@vue/eslint-config-typescript": "^11.0.0",
68
70
  "@vue/test-utils": "^2.0.2",
69
- "c8": "^7.11.3",
70
- "eslint": "^8.20.0",
71
+ "eslint": "^8.22.0",
71
72
  "eslint-config-prettier": "^8.5.0",
72
73
  "eslint-plugin-prettier": "^4.2.1",
73
74
  "eslint-plugin-tsdoc": "^0.2.16",
74
- "eslint-plugin-vue": "^9.2.0",
75
+ "eslint-plugin-vue": "^9.4.0",
75
76
  "jsdom": "^20.0.0",
76
77
  "jsdom-global": "^3.0.2",
77
78
  "prettier": "^2.7.1",
78
79
  "prettier-plugin-jsdoc": "^0.3.38",
79
80
  "siroc": "^0.16.0",
80
- "size-limit": "^7.0.8",
81
+ "size-limit": "^8.0.1",
81
82
  "standard-version": "^9.5.0",
82
83
  "typescript": "^4.7.4",
83
- "vite": "^3.0.1",
84
- "vitest": "^0.18.1",
84
+ "vite": "^3.0.9",
85
+ "vitest": "^0.22.1",
85
86
  "vue": "^3.2.37"
86
87
  },
87
88
  "peerDependencies": {
@@ -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: `${index}-${JSON.stringify(slice)}`,
516
+ key,
511
517
  slice,
512
518
  index,
513
519
  context: props.context,
@@ -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
- fetchFunction = globalThis.fetch;
57
+ // TODO: Remove after https://github.com/prismicio/prismic-client/issues/254
58
+ fetchFunction = globalThis.fetch as FetchLike;
58
59
  } else {
59
- fetchFunction = (await import("isomorphic-unfetch")).default;
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);