Skip to content

Commit

Permalink
Merge pull request #114 from d--j/patch
Browse files Browse the repository at this point in the history
TypeScript type declarations & various bugfixes
  • Loading branch information
s-yadav committed Jun 23, 2024
2 parents 5700741 + 4f86a41 commit 0df0723
Show file tree
Hide file tree
Showing 32 changed files with 6,626 additions and 7,004 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"presets": ["@babel/preset-env"],
"plugins": [
"@babel/plugin-proposal-class-properties",
["@babel/plugin-proposal-object-rest-spread", {}, "rest-spread"]
"@babel/plugin-transform-class-properties",
["@babel/plugin-transform-object-rest-spread", {}, "rest-spread"]
]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
node_modules
temp
.idea
*.tgz
.parcel-cache
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
*.swp
.DS_Store
.vscode
.idea
*.tgz

#ignore gitignore
.gitignore

#ignore build files
rollup.config.js
rollup.config.mjs
build-css.js
.babelrc
.eslintrc
Expand All @@ -19,3 +21,4 @@ node_modules/
temp/
assets/
example/
.parcel-cache
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ codesandbox link: [https://codesandbox.io/s/8ypwzryom0](https://codesandbox.io/s
[:star: this repo](https://github.com/s-yadav/iv-viewer)

### Major updates

#### v2.2.0

- Includes TypeScript type declarations
- Bugfixing

#### v2.1.0

- It's a complete rewrite of ImageViewer with no jQuery requirement in ES6.
Expand Down
7 changes: 4 additions & 3 deletions build-css.js → build-css.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ async function compileCss () {
const unminifiedCssPromise = postcss([autoprefixer]).process(css, { from: undefined });
const minifiedCssPromise = postcss([cssnano, autoprefixer]).process(css, { from: undefined });
const [unminifiedCss, minifiedCss] = await Promise.all([unminifiedCssPromise, minifiedCssPromise]);
const distUnminified = writeFile('./dist/iv-viewer.css', unminifiedCss);
const distMinified = writeFile('./dist/iv-viewer.min.css', minifiedCss);
const distUnminified = writeFile('./dist/iv-viewer.css', unminifiedCss.toString());
const distMinified = writeFile('./dist/iv-viewer.min.css', minifiedCss.toString());
const libUnminified = writeFile('./lib/image-viewer.css', unminifiedCss.toString());

return Promise.all([distUnminified, distMinified]);
return Promise.all([distUnminified, distMinified, libUnminified]);
}

compileCss();
16 changes: 7 additions & 9 deletions dist/iv-viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
.iv-container {
overflow: hidden;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.iv-fullscreen {
position: fixed;
Expand Down Expand Up @@ -79,8 +82,7 @@
}
.iv-snap-image {
position: relative;
-ms-touch-action: none;
touch-action: none;
touch-action: none;
}
.iv-snap-handle {
box-sizing: border-box;
Expand Down Expand Up @@ -134,12 +136,9 @@
bottom: 0;
width: 24px;
cursor: pointer;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
align-items: center;
justify-content: center;
}
.iv-button-zoom:before, .iv-button-zoom--in:before, .iv-button-zoom--out:before, .iv-button-zoom:after, .iv-button-zoom--in:after, .iv-button-zoom--out:after {
content: "";
Expand Down Expand Up @@ -177,8 +176,7 @@
max-width: 100%;
max-height: 100%;
position: absolute;
-ms-touch-action: none;
touch-action: none;
touch-action: none;
transform: translate3d(0, 0, 0);
}
.iv-loader {
Expand Down
Loading

0 comments on commit 0df0723

Please sign in to comment.