@eternalheart/vue-file-preview 1.7.1 → 1.7.2

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.
Files changed (35) hide show
  1. package/lib/chunks/{EmptyState.vue_vue_type_script_setup_true_lang-DSQp7H-K.mjs → EmptyState.vue_vue_type_script_setup_true_lang-Dna6LmVT.mjs} +1 -1
  2. package/lib/chunks/{avifLoader-CAUzjn-d-Cf00sjt2.mjs → avifLoader-CAUzjn-d-dPsP28D5.mjs} +1 -1
  3. package/lib/chunks/{heicLoader-D_9PukkA-cn1P7b2x.mjs → heicLoader-D_9PukkA-T-k1DSgY.mjs} +1 -1
  4. package/lib/chunks/{index-DBzyeU0G.mjs → index-B5hprvcF.mjs} +1649 -1650
  5. package/lib/chunks/{index-0fXL30y0.mjs → index-BN__EwfT.mjs} +1 -1
  6. package/lib/chunks/{index-CZlnxQFA.mjs → index-BPutNVAf.mjs} +1 -1
  7. package/lib/chunks/{index-BBIn-k4u.mjs → index-B_Spz6Wn.mjs} +2 -2
  8. package/lib/chunks/{index-DXf3wXT5.mjs → index-BjHEHkZ8.mjs} +1 -1
  9. package/lib/chunks/{index-DKFX5ToE.mjs → index-BlZ6RmeR.mjs} +1 -1
  10. package/lib/chunks/{index-Dp7QQjNH.mjs → index-C95y29OL.mjs} +1 -1
  11. package/lib/chunks/{index-tX9VR6Vo.mjs → index-CegPYMyO.mjs} +1 -1
  12. package/lib/chunks/{index-B77rFiau.mjs → index-CqOGKCyE.mjs} +1 -1
  13. package/lib/chunks/{index-BSzaI9ea.mjs → index-Cv3Sg87O.mjs} +1 -1
  14. package/lib/chunks/{index-BlJEM2Lb.mjs → index-DHba2Axz.mjs} +1 -1
  15. package/lib/chunks/{index-B1AwVHWI.mjs → index-DInI3RTN.mjs} +2 -2
  16. package/lib/chunks/{index-0VXtKKev.mjs → index-DXzvgRuo.mjs} +1 -1
  17. package/lib/chunks/{index-ClhTPqDI.mjs → index-DcvlMm9Q.mjs} +1 -1
  18. package/lib/chunks/{index-D7WykPYL.mjs → index-Dnyl1HQk.mjs} +1 -1
  19. package/lib/chunks/{index-DRmKaFXK.mjs → index-JjVQZbDt.mjs} +2 -2
  20. package/lib/chunks/{index-PWjCziZG.mjs → index-QPk2c2Tl.mjs} +2 -2
  21. package/lib/chunks/{index-bT6XWKO_.mjs → index-TZv0MqBH.mjs} +1 -1
  22. package/lib/chunks/{index-BB10as16.mjs → index-cRhwUlQN.mjs} +1 -1
  23. package/lib/chunks/{index-FzI__DHC.mjs → index-dOxDeWYi.mjs} +1 -1
  24. package/lib/chunks/{index-BZvy39tn.mjs → index-eNZr1h6f.mjs} +3 -3
  25. package/lib/chunks/{index-D690gnNu.mjs → index-oJF-hur2.mjs} +1 -1
  26. package/lib/chunks/{jp2Loader-Dig19xyo-D-OEDL3n.mjs → jp2Loader-Dig19xyo-hrIg_KJ3.mjs} +1 -1
  27. package/lib/chunks/{psdLoader-C0tKUXXl-CVN06LUc.mjs → psdLoader-C0tKUXXl-B2cJ4s7t.mjs} +1 -1
  28. package/lib/chunks/{rawLoader-C-tPeFAB-DBqcJPFK.mjs → rawLoader-C-tPeFAB-BNV-Wmzr.mjs} +1 -1
  29. package/lib/chunks/{tiffLoader-BlhByX8w-8-0icdyL.mjs → tiffLoader-BlhByX8w-BzSrLE9Y.mjs} +1 -1
  30. package/lib/chunks/{useShikiHighlight-a_GUszuU.mjs → useShikiHighlight-CpL0RAQg.mjs} +1 -1
  31. package/lib/composables/useRequest.d.ts +8 -2
  32. package/lib/index.cjs +34 -34
  33. package/lib/index.css +1 -1
  34. package/lib/index.mjs +1 -1
  35. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { J as i } from "./index-DBzyeU0G.mjs";
1
+ import { J as i } from "./index-B5hprvcF.mjs";
2
2
  class f {
3
3
  async needsDecode(t) {
4
4
  return t === "image/vnd.adobe.photoshop";
@@ -1,4 +1,4 @@
1
- import { J as b } from "./index-DBzyeU0G.mjs";
1
+ import { J as b } from "./index-B5hprvcF.mjs";
2
2
  const B = /* @__PURE__ */ new Set([
3
3
  "image/x-canon-cr2",
4
4
  "image/x-nikon-nef",
@@ -1,4 +1,4 @@
1
- import { J as i } from "./index-DBzyeU0G.mjs";
1
+ import { J as i } from "./index-B5hprvcF.mjs";
2
2
  class p {
3
3
  /**
4
4
  * TIFF 浏览器均不原生支持(除 Safari 部分版本),始终需要解码
@@ -1,6 +1,6 @@
1
1
  import { ref as i, watch as c } from "vue";
2
2
  import { codeToHtml as h } from "shiki";
3
- import { e as f } from "./index-DBzyeU0G.mjs";
3
+ import { e as f } from "./index-B5hprvcF.mjs";
4
4
  function T(t, n) {
5
5
  const a = f(), e = i(""), r = i([]), l = i(!0);
6
6
  return c([t, n, a], async () => {
@@ -18,7 +18,13 @@ export declare function provideRequestContext(options: {
18
18
  shouldFetchAsBlob?: ShouldFetchAsBlob;
19
19
  onRequestError?: (url: string, error: unknown) => void;
20
20
  })): ComputedRef<RequestContextValue>;
21
- export declare function useRequestContext(): ComputedRef<RequestContextValue>;
21
+ /**
22
+ * 获取请求上下文。
23
+ *
24
+ * Vue 的 `inject` 只读取父级 provides,同组件内先 `provide` 再 `inject` 拿不到自身值;
25
+ * 因此组件内如需使用自己 provide 的上下文,必须通过 `context` 显式传入。
26
+ */
27
+ export declare function useRequestContext(context?: ComputedRef<RequestContextValue>): ComputedRef<RequestContextValue>;
22
28
  export declare function useFetcher(): ComputedRef<Fetcher>;
23
29
  declare const DEPRECATED_REQUEST_PROPS: readonly ["requestInit", "requestHandler", "shouldFetchAsBlob"];
24
30
  /** 过渡期提示:旧鉴权参数已废弃,1.8.0 移除。 */
@@ -31,5 +37,5 @@ export declare function warnDeprecatedRequestProps(used: Partial<Record<(typeof
31
37
  *
32
38
  * onError 用于把取数失败上报给宿主(默认仍回退原 URL 继续尝试)。
33
39
  */
34
- export declare function useResolvedUrl(file: Ref<PreviewFile | undefined>, onError?: (error: unknown) => void): ComputedRef<string>;
40
+ export declare function useResolvedUrl(file: Ref<PreviewFile | undefined>, onError?: (error: unknown) => void, context?: ComputedRef<RequestContextValue>): ComputedRef<string>;
35
41
  export {};