@bikariya/image-viewer 0.0.6 → 0.0.7

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bikariya/image-viewer",
3
3
  "configKey": "image-viewer",
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,13 +1,9 @@
1
- type __VLS_Props = {
1
+ import type { ModalProps } from "#modals";
2
+ type __VLS_Props = ModalProps & {
2
3
  /**
3
4
  * 目标 `<img>` 元素
4
5
  */
5
6
  target: HTMLImageElement;
6
- /**
7
- * 过渡动画时长 (ms)
8
- * @default 400
9
- */
10
- duration?: number;
11
7
  /**
12
8
  * 放大后占窗口比率
13
9
  * @default 0.9
@@ -18,7 +14,6 @@ type __VLS_Props = {
18
14
  * @default false
19
15
  */
20
16
  clamp?: boolean;
21
- open?: boolean;
22
17
  };
23
18
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
19
  close: () => any;
@@ -1,11 +1,11 @@
1
1
  <script setup>
2
2
  import { computed, ref, useEventListener, usePointer, useTemplateRef } from "#imports";
3
- const { target, duration = 400, rate = 0.9, clamp } = defineProps({
4
- target: { type: null, required: true },
3
+ const { target, duration, rate = 0.9, clamp } = defineProps({
5
4
  duration: { type: Number, required: false },
5
+ open: { type: Boolean, required: false },
6
+ target: { type: null, required: true },
6
7
  rate: { type: Number, required: false },
7
- clamp: { type: Boolean, required: false },
8
- open: { type: Boolean, required: false }
8
+ clamp: { type: Boolean, required: false }
9
9
  });
10
10
  const emit = defineEmits(["close"]);
11
11
  const rootEl = useTemplateRef("root");
@@ -159,8 +159,8 @@ const onLeave = (el, done) => {
159
159
  const { left, top } = el.getBoundingClientRect();
160
160
  const { scrollX, scrollY } = window;
161
161
  const animation = el.animate([{
162
- top: 2 * scrollY + top + "px",
163
- left: 2 * scrollX + left + "px",
162
+ top: `calc(${2 * scrollY + top}px + 50dvh - 50svh)`,
163
+ left: `calc(${2 * scrollX + left}px + 50dvw - 50svw)`,
164
164
  clipPath: "inset(0)"
165
165
  }, getOriginalKeyframe(scrollX, scrollY)], options.value);
166
166
  animation.addEventListener("finish", done);
@@ -1,13 +1,9 @@
1
- type __VLS_Props = {
1
+ import type { ModalProps } from "#modals";
2
+ type __VLS_Props = ModalProps & {
2
3
  /**
3
4
  * 目标 `<img>` 元素
4
5
  */
5
6
  target: HTMLImageElement;
6
- /**
7
- * 过渡动画时长 (ms)
8
- * @default 400
9
- */
10
- duration?: number;
11
7
  /**
12
8
  * 放大后占窗口比率
13
9
  * @default 0.9
@@ -18,7 +14,6 @@ type __VLS_Props = {
18
14
  * @default false
19
15
  */
20
16
  clamp?: boolean;
21
- open?: boolean;
22
17
  };
23
18
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
19
  close: () => any;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bikariya/image-viewer",
3
3
  "type": "module",
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "description": "Bikariya image viewer for Nuxt",
6
6
  "author": "KazariEX",
7
7
  "license": "MIT",
@@ -15,8 +15,8 @@
15
15
  "dist"
16
16
  ],
17
17
  "dependencies": {
18
- "@bikariya/modals": "",
19
- "@nuxt/kit": "^4.3.0"
18
+ "@nuxt/kit": "^4.3.1",
19
+ "@bikariya/modals": "0.0.7"
20
20
  },
21
21
  "scripts": {
22
22
  "build": "nuxt-module-build build",