@prismicio/vue 3.0.0-beta.3 → 3.0.0-beta.6

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-beta.3",
3
+ "version": "3.0.0-beta.6",
4
4
  "description": "Vue plugin, components, and composables to fetch and present Prismic content",
5
5
  "keywords": [
6
6
  "typescript",
@@ -48,43 +48,43 @@
48
48
  "unit": "nyc --reporter=lcovonly --reporter=text --exclude-after-remap=false ava"
49
49
  },
50
50
  "dependencies": {
51
- "@prismicio/client": "^6.3.0",
52
- "@prismicio/helpers": "^2.1.1",
53
- "@prismicio/types": "^0.1.24",
51
+ "@prismicio/client": "^6.4.3",
52
+ "@prismicio/helpers": "^2.3.0",
53
+ "@prismicio/types": "^0.1.27",
54
54
  "isomorphic-unfetch": "^3.1.0",
55
- "vue-router": "^4.0.12"
55
+ "vue-router": "^4.0.14"
56
56
  },
57
57
  "devDependencies": {
58
- "@prismicio/mock": "^0.0.6",
58
+ "@prismicio/mock": "^0.0.10",
59
59
  "@size-limit/preset-small-lib": "^7.0.8",
60
- "@types/escape-html": "^1.0.1",
60
+ "@types/escape-html": "^1.0.2",
61
61
  "@types/jsdom-global": "3.0.2",
62
62
  "@types/sinon": "10.0.11",
63
- "@typescript-eslint/eslint-plugin": "^5.12.0",
64
- "@typescript-eslint/parser": "^5.12.0",
65
- "@vitejs/plugin-vue": "^2.2.0",
66
- "@vue/compiler-sfc": "^3.2.31",
63
+ "@typescript-eslint/eslint-plugin": "^5.21.0",
64
+ "@typescript-eslint/parser": "^5.21.0",
65
+ "@vitejs/plugin-vue": "^2.3.1",
66
+ "@vue/compiler-sfc": "^3.2.33",
67
67
  "@vue/eslint-config-typescript": "^10.0.0",
68
68
  "@vue/test-utils": "2.0.0-rc.17",
69
69
  "ava": "^3.15.0",
70
- "eslint": "^8.9.0",
71
- "eslint-config-prettier": "^8.3.0",
70
+ "eslint": "^8.14.0",
71
+ "eslint-config-prettier": "^8.5.0",
72
72
  "eslint-plugin-prettier": "^4.0.0",
73
- "eslint-plugin-tsdoc": "^0.2.14",
74
- "eslint-plugin-vue": "^8.4.1",
73
+ "eslint-plugin-tsdoc": "^0.2.16",
74
+ "eslint-plugin-vue": "^8.7.1",
75
75
  "jsdom": "^19.0.0",
76
76
  "jsdom-global": "^3.0.2",
77
77
  "nyc": "^15.1.0",
78
- "prettier": "^2.5.1",
79
- "prettier-plugin-jsdoc": "^0.3.30",
80
- "sinon": "^13.0.1",
78
+ "prettier": "^2.6.2",
79
+ "prettier-plugin-jsdoc": "^0.3.38",
80
+ "sinon": "^13.0.2",
81
81
  "siroc": "^0.16.0",
82
82
  "size-limit": "^7.0.8",
83
83
  "standard-version": "^9.3.2",
84
84
  "ts-eager": "^2.0.2",
85
- "typescript": "^4.5.5",
86
- "vite": "^2.8.3",
87
- "vue": "^3.2.31"
85
+ "typescript": "^4.6.4",
86
+ "vite": "^2.9.6",
87
+ "vue": "^3.2.33"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "vue": "^3.0.0"
@@ -59,8 +59,8 @@ export type PrismicImageProps = {
59
59
  * Adds an additional `srcset` attribute to the image following given widths.
60
60
  *
61
61
  * @remarks
62
- * A special value of `"auto"` is accepted to automatically use image widths
63
- * coming from the API.
62
+ * A special value of `"thumbnails"` is accepted to automatically use image
63
+ * widths coming from the API.
64
64
  * @remarks
65
65
  * A special value of `"defaults"` is accepted to automatically use image
66
66
  * widths coming from the plugin configuration.
@@ -70,7 +70,7 @@ export type PrismicImageProps = {
70
70
  */
71
71
  widths?:
72
72
  | NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"]
73
- | "auto"
73
+ | "thumbnails"
74
74
  | "defaults";
75
75
 
76
76
  /**
@@ -114,7 +114,7 @@ export type UsePrismicImageReturnType = {
114
114
  /**
115
115
  * Resolved image `alt` value.
116
116
  */
117
- alt: ComputedRef<string | null>;
117
+ alt: ComputedRef<string>;
118
118
 
119
119
  /**
120
120
  * Resolved image `copyright` value.
@@ -156,23 +156,13 @@ export const usePrismicImage = (
156
156
  );
157
157
  }
158
158
 
159
- if (widths === "auto") {
160
- return asImageWidthSrcSet(field, imgixParams);
161
- } else {
162
- // Remove potential thumbnails when using manual widths
163
- const { url, dimensions, alt, copyright } = field;
164
-
165
- return asImageWidthSrcSet(
166
- { url, dimensions, alt, copyright },
167
- {
168
- ...imgixParams,
169
- widths:
170
- widths === "defaults"
171
- ? options.components?.imageWidthSrcSetDefaults
172
- : widths,
173
- },
174
- );
175
- }
159
+ return asImageWidthSrcSet(field, {
160
+ ...imgixParams,
161
+ widths:
162
+ widths === "defaults"
163
+ ? options.components?.imageWidthSrcSetDefaults
164
+ : widths,
165
+ });
176
166
  } else if (pixelDensities) {
177
167
  return asImagePixelDensitySrcSet(field, {
178
168
  ...imgixParams,
@@ -196,7 +186,7 @@ export const usePrismicImage = (
196
186
  return asImage.value.srcset;
197
187
  });
198
188
  const alt = computed(() => {
199
- return unref(props.field).alt || null;
189
+ return unref(props.field).alt || "";
200
190
  });
201
191
  const copyright = computed(() => {
202
192
  return unref(props.field).copyright || null;
@@ -235,7 +225,7 @@ export const PrismicImageImpl = /*#__PURE__*/ defineComponent({
235
225
  widths: {
236
226
  type: [String, Object] as PropType<
237
227
  | NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"]
238
- | "auto"
228
+ | "thumbnails"
239
229
  | "defaults"
240
230
  >,
241
231
  default: undefined,
@@ -106,8 +106,7 @@ export const usePrismicRichText = (
106
106
  const htmlSerializer =
107
107
  unref(props.htmlSerializer) ?? options.htmlSerializer;
108
108
 
109
- // TODO: Update after https://github.com/prismicio/prismic-helpers/pull/43
110
- return asHTML(unref(props.field), linkResolver, htmlSerializer) || "";
109
+ return asHTML(unref(props.field), linkResolver, htmlSerializer);
111
110
  });
112
111
 
113
112
  return {
@@ -74,8 +74,7 @@ export const usePrismicText = (
74
74
  props: UsePrismicTextOptions,
75
75
  ): UsePrismicTextReturnType => {
76
76
  const text = computed(() => {
77
- // TODO: Update after https://github.com/prismicio/prismic-helpers/pull/43
78
- return asText(unref(props.field), unref(props.separator)) || "";
77
+ return asText(unref(props.field), unref(props.separator));
79
78
  });
80
79
 
81
80
  return {