@jacktea/img-viewer-react 0.1.3
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/LICENSE +25 -0
- package/README.md +57 -0
- package/dist/ImgViewer.d.ts +54 -0
- package/dist/ImgViewer.d.ts.map +1 -0
- package/dist/img-viewer-react.js +1 -0
- package/dist/img-viewer-react.umd.cjs +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
This license applies to original source code in this repository, excluding
|
|
2
|
+
third-party components and generated codec binaries listed in
|
|
3
|
+
`THIRD_PARTY_NOTICES.md`.
|
|
4
|
+
|
|
5
|
+
MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2026 zhuzhigang
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# @jacktea/img-viewer-react
|
|
2
|
+
|
|
3
|
+
基于 `@jacktea/img-viewer` 封装的 React 版本图片预览器组件。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @jacktea/img-viewer-react @jacktea/img-viewer
|
|
9
|
+
# 或者
|
|
10
|
+
pnpm add @jacktea/img-viewer-react @jacktea/img-viewer
|
|
11
|
+
# 或者
|
|
12
|
+
yarn add @jacktea/img-viewer-react @jacktea/img-viewer
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
> **注意:** 该包依赖于核心包 `@jacktea/img-viewer`,请确保同时安装。
|
|
16
|
+
|
|
17
|
+
## 引入样式
|
|
18
|
+
|
|
19
|
+
在你的入口点文件(例如 `main.tsx`, `App.tsx` 或 `index.css` 所在的位置)引入核心包的 CSS:
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import '@jacktea/img-viewer/dist/style.css';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 使用组件
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { ReactNode } from 'react';
|
|
29
|
+
import { ImgViewerReact } from '@jacktea/img-viewer-react';
|
|
30
|
+
|
|
31
|
+
function App() {
|
|
32
|
+
return (
|
|
33
|
+
<div style={{ padding: 20 }}>
|
|
34
|
+
<h1>图片预览演示</h1>
|
|
35
|
+
<ImgViewerReact
|
|
36
|
+
src="https://example.com/path/to/your/image.jpg"
|
|
37
|
+
style={{ width: '800px', height: '600px', border: '1px solid #ccc' }}
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default App;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Props 说明
|
|
47
|
+
|
|
48
|
+
支持所有标准的 HTML 属性(例如 `style`, `className` 等)以及:
|
|
49
|
+
|
|
50
|
+
| Prop | 类型 | 描述 |
|
|
51
|
+
| :--- | :--- | :--- |
|
|
52
|
+
| `src` | `string` (必须) | 想要预览的图片 URL |
|
|
53
|
+
| `style` | `React.CSSProperties` | 内联样式,建议至少设定 width 和 height |
|
|
54
|
+
|
|
55
|
+
## 许可证
|
|
56
|
+
|
|
57
|
+
MIT
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@jacktea/img-viewer';
|
|
3
|
+
import type { ImageSource, ViewMode, ImgViewerElement, DecoderType } from '@jacktea/img-viewer';
|
|
4
|
+
export interface ImgViewerProps {
|
|
5
|
+
/** 图片来源列表 */
|
|
6
|
+
sources?: ImageSource[];
|
|
7
|
+
/** 预览模式 */
|
|
8
|
+
mode?: ViewMode;
|
|
9
|
+
/** 只读 */
|
|
10
|
+
readonly?: boolean;
|
|
11
|
+
/** 自动播放 */
|
|
12
|
+
autoPlay?: boolean;
|
|
13
|
+
/** 自动播放间隔 (ms) */
|
|
14
|
+
interval?: number;
|
|
15
|
+
/** 解码模式 */
|
|
16
|
+
decodeType?: DecoderType;
|
|
17
|
+
/** rgba16 失败时是否回退到 rgba8 */
|
|
18
|
+
decodeFallback?: boolean;
|
|
19
|
+
/** 图片加载回调 */
|
|
20
|
+
onImageLoad?: (detail: {
|
|
21
|
+
index: number;
|
|
22
|
+
}) => void;
|
|
23
|
+
/** 图片加载错误 */
|
|
24
|
+
onImageError?: (detail: {
|
|
25
|
+
index: number;
|
|
26
|
+
error: Error;
|
|
27
|
+
}) => void;
|
|
28
|
+
/** 图片切换 */
|
|
29
|
+
onImageChange?: (detail: {
|
|
30
|
+
index: number;
|
|
31
|
+
}) => void;
|
|
32
|
+
/** 模式切换 */
|
|
33
|
+
onModeChange?: (detail: {
|
|
34
|
+
mode: ViewMode;
|
|
35
|
+
}) => void;
|
|
36
|
+
/** 样式类名 */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** 行内样式 */
|
|
39
|
+
style?: React.CSSProperties;
|
|
40
|
+
}
|
|
41
|
+
export interface ImgViewerRef {
|
|
42
|
+
/** 获取底层 Web Component 实例 */
|
|
43
|
+
getElement: () => ImgViewerElement | null;
|
|
44
|
+
/** 打开图片 */
|
|
45
|
+
open: (sources: ImageSource[]) => void;
|
|
46
|
+
/** 打开文件选择器 */
|
|
47
|
+
openFileDialog: () => void;
|
|
48
|
+
/** 设置模式 */
|
|
49
|
+
setMode: (mode: ViewMode) => void;
|
|
50
|
+
/** 下载当前图片 */
|
|
51
|
+
downloadCurrent: () => void;
|
|
52
|
+
}
|
|
53
|
+
export declare const ImgViewer: React.ForwardRefExoticComponent<ImgViewerProps & React.RefAttributes<ImgViewerRef>>;
|
|
54
|
+
//# sourceMappingURL=ImgViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImgViewer.d.ts","sourceRoot":"","sources":["../src/ImgViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAClF,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEhG,MAAM,WAAW,cAAc;IAC7B,aAAa;IACb,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW;IACX,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS;IACT,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW;IACX,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,4BAA4B;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa;IACb,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAClD,aAAa;IACb,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,IAAI,CAAC;IACjE,WAAW;IACX,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACpD,WAAW;IACX,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IACpD,WAAW;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW;IACX,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,UAAU,EAAE,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAC1C,WAAW;IACX,IAAI,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IACvC,cAAc;IACd,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW;IACX,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAClC,aAAa;IACb,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,SAAS,qFA4FpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x5bd1(){const _0x4b571d=['downloadCurrent','img-viewer','image-error','addEventListener','232938eCRkgC','setMode','auto-play','push','162mLIyBz','image-load','8YgLbSr','open','forEach','length','createElement','image-change','openFileDialog','2862801FoOUoX','detail','913886hopNTc','656845zbEoVj','2ZRWhlD','current','mode-change','2262860mueKSm','1080FZvrDh','9284610EBiNBx','single'];_0x5bd1=function(){return _0x4b571d;};return _0x5bd1();}function _0x4e6e(_0x379e78,_0x2738b9){_0x379e78=_0x379e78-0xd8;const _0x5bd1ae=_0x5bd1();let _0x4e6ecc=_0x5bd1ae[_0x379e78];return _0x4e6ecc;}const _0x5f281e=_0x4e6e;(function(_0x530494,_0xf5d34c){const _0x2cfe04=_0x4e6e,_0x1324ba=_0x530494();while(!![]){try{const _0x551ddb=parseInt(_0x2cfe04(0xe7))/0x1*(parseInt(_0x2cfe04(0xe5))/0x2)+parseInt(_0x2cfe04(0xe3))/0x3+-parseInt(_0x2cfe04(0xea))/0x4+parseInt(_0x2cfe04(0xeb))/0x5*(parseInt(_0x2cfe04(0xda))/0x6)+parseInt(_0x2cfe04(0xe6))/0x7+parseInt(_0x2cfe04(0xdc))/0x8*(parseInt(_0x2cfe04(0xf2))/0x9)+-parseInt(_0x2cfe04(0xec))/0xa;if(_0x551ddb===_0xf5d34c)break;else _0x1324ba['push'](_0x1324ba['shift']());}catch(_0x3a72f3){_0x1324ba['push'](_0x1324ba['shift']());}}}(_0x5bd1,0x79f46));import _0x329773,{forwardRef as _0x2033c7,useRef as _0x525319,useImperativeHandle as _0x41b0e3,useEffect as _0x543161}from'react';import{configureNativeWasm as _0x41f791,getNativeWasmOptions as _0x25ba98,resetNativeWasmOptions as _0xc0cd71}from'@jacktea/img-viewer';const F=_0x2033c7(function({sources:_0x3b20e5,mode:_0x191ef8=_0x5f281e(0xed),readonly:_0x140e63=!0x1,autoPlay:_0x340de1=!0x1,interval:_0x576b83=0xbb8,decodeType:_0x247a83='auto',decodeFallback:_0x25f996=!0x0,onImageLoad:_0x5a02bd,onImageError:_0x4f592f,onImageChange:_0x8bf8e,onModeChange:_0x1b4083,className:_0x35e162,style:_0x34771b},_0x4fd926){const _0x91675b=_0x5f281e,_0x49b545=_0x525319(null);_0x41b0e3(_0x4fd926,()=>({'getElement':()=>_0x49b545[_0x91675b(0xe8)],'open':_0x2acdab=>{const _0x4ce422=_0x91675b;var _0x5d1e54;return(_0x5d1e54=_0x49b545['current'])==null?void 0x0:_0x5d1e54[_0x4ce422(0xdd)](_0x2acdab);},'openFileDialog':()=>{const _0x64843a=_0x91675b;var _0x52232f;return(_0x52232f=_0x49b545[_0x64843a(0xe8)])==null?void 0x0:_0x52232f[_0x64843a(0xe2)]();},'setMode':_0x59a7c6=>{const _0x36b0e6=_0x91675b;var _0x34cd20;return(_0x34cd20=_0x49b545[_0x36b0e6(0xe8)])==null?void 0x0:_0x34cd20[_0x36b0e6(0xf3)](_0x59a7c6);},'downloadCurrent':()=>{const _0x40fa6c=_0x91675b;var _0x207f8d;return(_0x207f8d=_0x49b545[_0x40fa6c(0xe8)])==null?void 0x0:_0x207f8d[_0x40fa6c(0xee)]();}})),_0x543161(()=>{const _0x568e06=_0x91675b,_0x2250c1=_0x49b545[_0x568e06(0xe8)];if(!_0x2250c1)return;const _0x3b3508=[];if(_0x5a02bd){const _0x23fdcb=_0x2a3724=>_0x5a02bd(_0x2a3724[_0x568e06(0xe4)]);_0x2250c1[_0x568e06(0xf1)](_0x568e06(0xdb),_0x23fdcb),_0x3b3508[_0x568e06(0xd9)](['image-load',_0x23fdcb]);}if(_0x4f592f){const _0x21520c=_0x20cfa4=>_0x4f592f(_0x20cfa4[_0x568e06(0xe4)]);_0x2250c1[_0x568e06(0xf1)]('image-error',_0x21520c),_0x3b3508[_0x568e06(0xd9)]([_0x568e06(0xf0),_0x21520c]);}if(_0x8bf8e){const _0x520988=_0x1ee48f=>_0x8bf8e(_0x1ee48f[_0x568e06(0xe4)]);_0x2250c1[_0x568e06(0xf1)](_0x568e06(0xe1),_0x520988),_0x3b3508[_0x568e06(0xd9)]([_0x568e06(0xe1),_0x520988]);}if(_0x1b4083){const _0x9a392b=_0x7adc4f=>_0x1b4083(_0x7adc4f['detail']);_0x2250c1[_0x568e06(0xf1)]('mode-change',_0x9a392b),_0x3b3508[_0x568e06(0xd9)]([_0x568e06(0xe9),_0x9a392b]);}return()=>{const _0x5dfa87=_0x568e06;_0x3b3508[_0x5dfa87(0xde)](([_0x56c800,_0x9d5b69])=>_0x2250c1['removeEventListener'](_0x56c800,_0x9d5b69));};},[_0x5a02bd,_0x4f592f,_0x8bf8e,_0x1b4083]),_0x543161(()=>{const _0x42a99c=_0x91675b;_0x3b20e5&&_0x3b20e5[_0x42a99c(0xdf)]>0x0&&_0x49b545['current']&&_0x49b545[_0x42a99c(0xe8)][_0x42a99c(0xdd)](_0x3b20e5);},[_0x3b20e5]),_0x543161(()=>()=>{var _0xeec091;(_0xeec091=_0x49b545['current'])==null||_0xeec091['destroy']();},[]);const _0x2f3139={'mode':_0x191ef8,'interval':String(_0x576b83),'decode-type':_0x247a83,'decode-fallback':String(_0x25f996)};return _0x140e63&&(_0x2f3139['readonly']=''),_0x340de1&&(_0x2f3139[_0x91675b(0xd8)]=''),_0x329773[_0x91675b(0xe0)](_0x91675b(0xef),{'ref':_0x49b545,'class':_0x35e162,'style':_0x34771b,..._0x2f3139});});export{F as ImgViewer,_0x41f791 as configureNativeWasm,_0x25ba98 as getNativeWasmOptions,_0xc0cd71 as resetNativeWasmOptions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x5cae(){const _0x5a7e72=['Module','ImgViewerReact','configureNativeWasm','function','44015udsbzY','mode-change','9DcdCXH','resetNativeWasmOptions','87567YZHjYT','228HcwUQU','auto-play','open','defineProperty','detail','image-change','forwardRef','openFileDialog','destroy','length','ImgViewer','1102336YoCigq','toStringTag','useRef','push','3858730mcZgOu','2692963eSPjgs','3646770SMjsYX','exports','removeEventListener','createElement','object','image-load','forEach','13004hehVIm','readonly','img-viewer','addEventListener','@jacktea/img-viewer','123kvNthX','amd','current','getNativeWasmOptions','react','useEffect','useImperativeHandle','image-error','setMode'];_0x5cae=function(){return _0x5a7e72;};return _0x5cae();}function _0x2e52(_0x5ea80f,_0x5eade3){_0x5ea80f=_0x5ea80f-0x1b7;const _0x5cae5d=_0x5cae();let _0x2e525c=_0x5cae5d[_0x5ea80f];return _0x2e525c;}(function(_0x3d1feb,_0x432016){const _0x2b880e=_0x2e52,_0x440c19=_0x3d1feb();while(!![]){try{const _0x470477=-parseInt(_0x2b880e(0x1d6))/0x1*(-parseInt(_0x2b880e(0x1d1))/0x2)+-parseInt(_0x2b880e(0x1b8))/0x3+parseInt(_0x2b880e(0x1b9))/0x4*(-parseInt(_0x2b880e(0x1e3))/0x5)+-parseInt(_0x2b880e(0x1ca))/0x6+parseInt(_0x2b880e(0x1c9))/0x7+parseInt(_0x2b880e(0x1c4))/0x8+-parseInt(_0x2b880e(0x1e5))/0x9*(-parseInt(_0x2b880e(0x1c8))/0xa);if(_0x470477===_0x432016)break;else _0x440c19['push'](_0x440c19['shift']());}catch(_0x1a2768){_0x440c19['push'](_0x440c19['shift']());}}}(_0x5cae,0x8b015),function(_0x4ef2cb,_0x2df793){const _0x492347=_0x2e52;typeof exports==_0x492347(0x1ce)&&typeof module<'u'?_0x2df793(exports,require(_0x492347(0x1da)),require(_0x492347(0x1d5))):typeof define==_0x492347(0x1e2)&&define[_0x492347(0x1d7)]?define([_0x492347(0x1cb),_0x492347(0x1da),'@jacktea/img-viewer'],_0x2df793):(_0x4ef2cb=typeof globalThis<'u'?globalThis:_0x4ef2cb||self,_0x2df793(_0x4ef2cb[_0x492347(0x1e0)]={},_0x4ef2cb['React'],_0x4ef2cb[_0x492347(0x1c3)]));}(this,function(_0xc9c293,_0x139e33,_0x28aa43){'use strict';const _0x4e4348=_0x2e52;const _0x538795=_0x139e33[_0x4e4348(0x1bf)](function({sources:_0x5d553c,mode:_0x34d3d2='single',readonly:_0x1201dc=!0x1,autoPlay:_0x5d9207=!0x1,interval:_0x4a577f=0xbb8,decodeType:_0x28d41b='auto',decodeFallback:_0x5b7fee=!0x0,onImageLoad:_0x9042bb,onImageError:_0x4e8df6,onImageChange:_0x188f6a,onModeChange:_0x3f2901,className:_0x3f2f23,style:_0x5a361d},_0x31995d){const _0x7adac3=_0x4e4348,_0x92e485=_0x139e33[_0x7adac3(0x1c6)](null);_0x139e33[_0x7adac3(0x1dc)](_0x31995d,()=>({'getElement':()=>_0x92e485[_0x7adac3(0x1d8)],'open':_0x2a3e65=>{const _0x4c10a2=_0x7adac3;var _0x1ec317;return(_0x1ec317=_0x92e485[_0x4c10a2(0x1d8)])==null?void 0x0:_0x1ec317[_0x4c10a2(0x1bb)](_0x2a3e65);},'openFileDialog':()=>{const _0x5daf52=_0x7adac3;var _0x3a0bc9;return(_0x3a0bc9=_0x92e485[_0x5daf52(0x1d8)])==null?void 0x0:_0x3a0bc9[_0x5daf52(0x1c0)]();},'setMode':_0x129608=>{const _0x28bf35=_0x7adac3;var _0x3dc7fc;return(_0x3dc7fc=_0x92e485[_0x28bf35(0x1d8)])==null?void 0x0:_0x3dc7fc[_0x28bf35(0x1de)](_0x129608);},'downloadCurrent':()=>{var _0xc4b7d6;return(_0xc4b7d6=_0x92e485['current'])==null?void 0x0:_0xc4b7d6['downloadCurrent']();}})),_0x139e33[_0x7adac3(0x1db)](()=>{const _0x23c42c=_0x7adac3,_0x4dcf57=_0x92e485[_0x23c42c(0x1d8)];if(!_0x4dcf57)return;const _0x44ae27=[];if(_0x9042bb){const _0x57a0fa=_0x3d9d00=>_0x9042bb(_0x3d9d00[_0x23c42c(0x1bd)]);_0x4dcf57['addEventListener'](_0x23c42c(0x1cf),_0x57a0fa),_0x44ae27['push']([_0x23c42c(0x1cf),_0x57a0fa]);}if(_0x4e8df6){const _0x79862b=_0x41f90f=>_0x4e8df6(_0x41f90f[_0x23c42c(0x1bd)]);_0x4dcf57[_0x23c42c(0x1d4)](_0x23c42c(0x1dd),_0x79862b),_0x44ae27['push'](['image-error',_0x79862b]);}if(_0x188f6a){const _0x26b06b=_0x19bbc7=>_0x188f6a(_0x19bbc7[_0x23c42c(0x1bd)]);_0x4dcf57[_0x23c42c(0x1d4)](_0x23c42c(0x1be),_0x26b06b),_0x44ae27[_0x23c42c(0x1c7)]([_0x23c42c(0x1be),_0x26b06b]);}if(_0x3f2901){const _0x4fccbb=_0x3bd38a=>_0x3f2901(_0x3bd38a[_0x23c42c(0x1bd)]);_0x4dcf57[_0x23c42c(0x1d4)]('mode-change',_0x4fccbb),_0x44ae27['push']([_0x23c42c(0x1e4),_0x4fccbb]);}return()=>{const _0x2c0093=_0x23c42c;_0x44ae27[_0x2c0093(0x1d0)](([_0x44dca1,_0x32d01a])=>_0x4dcf57[_0x2c0093(0x1cc)](_0x44dca1,_0x32d01a));};},[_0x9042bb,_0x4e8df6,_0x188f6a,_0x3f2901]),_0x139e33['useEffect'](()=>{const _0x360865=_0x7adac3;_0x5d553c&&_0x5d553c[_0x360865(0x1c2)]>0x0&&_0x92e485['current']&&_0x92e485[_0x360865(0x1d8)][_0x360865(0x1bb)](_0x5d553c);},[_0x5d553c]),_0x139e33[_0x7adac3(0x1db)](()=>()=>{const _0x17d240=_0x7adac3;var _0x26b1df;(_0x26b1df=_0x92e485[_0x17d240(0x1d8)])==null||_0x26b1df[_0x17d240(0x1c1)]();},[]);const _0x4536c8={'mode':_0x34d3d2,'interval':String(_0x4a577f),'decode-type':_0x28d41b,'decode-fallback':String(_0x5b7fee)};return _0x1201dc&&(_0x4536c8[_0x7adac3(0x1d2)]=''),_0x5d9207&&(_0x4536c8[_0x7adac3(0x1ba)]=''),_0x139e33[_0x7adac3(0x1cd)](_0x7adac3(0x1d3),{'ref':_0x92e485,'class':_0x3f2f23,'style':_0x5a361d,..._0x4536c8});});Object[_0x4e4348(0x1bc)](_0xc9c293,_0x4e4348(0x1e1),{'enumerable':!0x0,'get':()=>_0x28aa43['configureNativeWasm']}),Object[_0x4e4348(0x1bc)](_0xc9c293,_0x4e4348(0x1d9),{'enumerable':!0x0,'get':()=>_0x28aa43[_0x4e4348(0x1d9)]}),Object['defineProperty'](_0xc9c293,_0x4e4348(0x1b7),{'enumerable':!0x0,'get':()=>_0x28aa43[_0x4e4348(0x1b7)]}),_0xc9c293[_0x4e4348(0x1c3)]=_0x538795,Object[_0x4e4348(0x1bc)](_0xc9c293,Symbol[_0x4e4348(0x1c5)],{'value':_0x4e4348(0x1df)});}));
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ImgViewer } from './ImgViewer';
|
|
2
|
+
export type { ImgViewerProps, ImgViewerRef } from './ImgViewer';
|
|
3
|
+
export { configureNativeWasm, getNativeWasmOptions, resetNativeWasmOptions } from '@jacktea/img-viewer';
|
|
4
|
+
export type { NativeWasmCodec, NativeWasmOptions } from '@jacktea/img-viewer';
|
|
5
|
+
export type { ImageSource, ViewMode, ViewerConfig, TransformState, MagnifierConfig, LoadedImage } from '@jacktea/img-viewer';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACxG,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jacktea/img-viewer-react",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/img-viewer-react.umd.cjs",
|
|
7
|
+
"module": "dist/img-viewer-react.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/img-viewer-react.js",
|
|
12
|
+
"require": "./dist/img-viewer-react.umd.cjs",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@jacktea/img-viewer": "0.1.3"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
24
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/react": "^19.0.0",
|
|
28
|
+
"@types/react-dom": "^19.0.0",
|
|
29
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
30
|
+
"react": "^19.0.0",
|
|
31
|
+
"react-dom": "^19.0.0"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "vite build && tsc --emitDeclarationOnly --outDir dist"
|
|
35
|
+
}
|
|
36
|
+
}
|