@lonik/oh-image 1.0.3 → 1.1.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/dist/client.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- import type { ImageSrc } from "@lonik/oh-image/plugin";
2
-
3
1
  declare module "*?oh" {
4
- const imageSrc: ImageSrc;
2
+ const imageSrc: any;
5
3
  export default imageSrc;
6
4
  }
package/dist/react.js CHANGED
@@ -1,7 +1,8 @@
1
- import { preload } from "react-dom";
1
+ import * as ReactDOM from "react-dom";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/react/image.tsx
5
+ const preload = "preload" in ReactDOM && typeof ReactDOM.preload === "function" ? ReactDOM.preload : null;
5
6
  function resolveOptions(props) {
6
7
  const { src, ...rest } = props;
7
8
  const resolved = { ...rest };
@@ -16,7 +17,7 @@ function resolveOptions(props) {
16
17
  resolved.decoding = "async";
17
18
  resolved.loading = "eager";
18
19
  resolved.fetchPriority = "high";
19
- preload(resolved.src, {
20
+ if (preload) preload(resolved.src, {
20
21
  as: "image",
21
22
  fetchPriority: "high"
22
23
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lonik/oh-image",
3
3
  "type": "module",
4
- "version": "1.0.3",
4
+ "version": "1.1.0",
5
5
  "description": "A React component library for optimized image handling.",
6
6
  "author": "Luka Onikadze <lukonik@gmail.com>",
7
7
  "license": "MIT",
@@ -45,16 +45,16 @@
45
45
  "prepublishOnly": "pnpm run build"
46
46
  },
47
47
  "peerDependencies": {
48
- "react": "^19.2.0",
49
- "react-dom": "^19.2.0",
50
- "sharp": "^0.34.5"
48
+ "react": ">=18",
49
+ "react-dom": ">=18",
50
+ "sharp": ">=0.34.5"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@eslint/js": "^9.39.2",
54
54
  "@tsconfig/strictest": "^2.0.8",
55
55
  "@types/node": "^25.0.3",
56
- "@types/react": "^19.2.7",
57
- "@types/react-dom": "^19.2.3",
56
+ "@types/react": "^18",
57
+ "@types/react-dom": "^18",
58
58
  "@vitejs/plugin-react": "^5.1.2",
59
59
  "@vitest/browser-playwright": "^4.0.16",
60
60
  "bumpp": "^10.3.2",