lite-image-preview 1.0.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 ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "lite-image-preview",
3
+ "version": "1.0.0",
4
+ "description": "Lightweight image and SVG preview dialog with smooth pinch zoom, crisp SVG scaling, and mobile-friendly gesture handling.",
5
+ "keywords": [
6
+ "front-end",
7
+ "preview",
8
+ "image",
9
+ "pan",
10
+ "pinch",
11
+ "zoom"
12
+ ],
13
+ "publishConfig": {
14
+ "access": "public",
15
+ "registry": "https://registry.npmjs.org/"
16
+ },
17
+ "license": "Unlicense",
18
+ "author": "chcs1013",
19
+ "type": "module",
20
+ "main": "dist/main.js",
21
+ "types": "dist/main.d.ts",
22
+ "files": [
23
+ "README.md",
24
+ "LICENSE",
25
+ "src/**",
26
+ "dist/**",
27
+ "tsconfig.json",
28
+ "tsconfig.app.json",
29
+ "tsconfig.node.json",
30
+ "rolldown.config.js"
31
+ ],
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/main.d.ts",
35
+ "import": "./dist/main.js",
36
+ "require": "./dist/main.cjs"
37
+ }
38
+ },
39
+ "scripts": {
40
+ "test": "echo \"Error: no test specified\" && exit 1",
41
+ "build": "rimraf dist && npm run build-only",
42
+ "build-only": "npm run build:esm && npm run build:cjs",
43
+ "build:esm": "rolldown -c",
44
+ "build:cjs": "rolldown -c --environment MODE:cjs",
45
+ "dev": "tsc --watch"
46
+ },
47
+ "bugs": {
48
+ "url": "https://github.com/shc0743/MyUtility/issues"
49
+ },
50
+ "homepage": "https://github.com/shc0743/MyUtility/tree/main/js/lib/lite-image-preview#readme",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/shc0743/MyUtility.git",
54
+ "directory": "js/lib/lite-image-preview"
55
+ },
56
+ "devDependencies": {
57
+ "@tsconfig/node24": "^24.0.4",
58
+ "rimraf": "^6.1.3",
59
+ "rolldown": "^1.0.0-rc.12",
60
+ "rolldown-plugin-dts": "^0.23.2",
61
+ "typescript": "^5.9.3"
62
+ }
63
+ }
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from 'rolldown';
2
+ import { dts } from 'rolldown-plugin-dts';
3
+
4
+ const mode = process.env.MODE
5
+
6
+ export default defineConfig({
7
+ input: 'src/main.ts',
8
+ plugins: [
9
+ ...(mode === 'cjs' ? [] : [dts({
10
+ build: true,
11
+ })]),
12
+ ],
13
+ output: {
14
+ dir: 'dist',
15
+ format: mode === 'cjs' ? 'cjs' : 'esm',
16
+ entryFileNames: mode === 'cjs' ? '[name].cjs' : undefined,
17
+ },
18
+ });
package/src/main.ts ADDED
@@ -0,0 +1,11 @@
1
+ export type {
2
+ Point,
3
+ TransformState,
4
+ ViewBox,
5
+ PreviewCloseHandle,
6
+ PreviewController,
7
+ PreviewAdapter,
8
+ PreviewAdapterFactory,
9
+ } from './types'
10
+
11
+ export { createPreview, previewImage, previewSvg } from './preview'