nextjs-link-preview 1.0.2 → 1.0.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.
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Next.js Link Preview Component
5
+ *
6
+ * This component uses the Next.js API route to fetch metadata server-side,
7
+ * avoiding CORS issues entirely.
8
+ *
9
+ * Usage:
10
+ * import { LinkPreview } from './components/LinkPreview';
11
+ *
12
+ * <LinkPreview url="https://github.com" size="medium" />
13
+ */
14
+
15
+ interface LinkPreviewData {
16
+ title: string;
17
+ description: string;
18
+ image: string;
19
+ url: string;
20
+ }
21
+ type LinkPreviewSize = 'small' | 'medium' | 'large';
22
+ type LinkPreviewLayout = 'vertical' | 'horizontal';
23
+ interface LinkPreviewProps {
24
+ url: string;
25
+ size?: LinkPreviewSize;
26
+ layout?: LinkPreviewLayout;
27
+ width?: string | number;
28
+ height?: string | number;
29
+ className?: string;
30
+ onError?: (error: Error) => void;
31
+ onLoad?: (data: LinkPreviewData) => void;
32
+ apiEndpoint?: string;
33
+ }
34
+ declare function LinkPreview({ url, size, layout, width, height, className, onError, onLoad, apiEndpoint }: LinkPreviewProps): React.JSX.Element | null;
35
+
36
+ export { LinkPreview, LinkPreview as default };
37
+ export type { LinkPreviewData, LinkPreviewLayout, LinkPreviewProps, LinkPreviewSize };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkPreview.d.ts","sourceRoot":"","sources":["../../../../src/nextjs/components/LinkPreview.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE1D,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA6BD,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,IAAe,EACf,MAAmB,EACnB,KAAc,EACd,MAAe,EACf,SAAc,EACd,OAAO,EACP,MAAM,EACN,WAA4B,EAC7B,EAAE,gBAAgB,4BA8IlB;AAED,eAAe,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextjs-link-preview",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "description": "A Next.js component for generating beautiful link preview cards with server-side metadata fetching - No CORS issues!",
6
6
  "keywords": [
@@ -62,6 +62,7 @@
62
62
  "@types/react": "^19.2.2",
63
63
  "@types/react-dom": "^19.2.2",
64
64
  "rollup": "^4.53.1",
65
+ "rollup-plugin-dts": "^6.2.3",
65
66
  "rollup-plugin-peer-deps-external": "^2.2.4",
66
67
  "tslib": "^2.8.1",
67
68
  "typescript": "^5.9.3"
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkPreview.d.ts","sourceRoot":"","sources":["../../../src/nextjs/components/LinkPreview.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE1D,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA6BD,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,IAAe,EACf,MAAmB,EACnB,KAAc,EACd,MAAe,EACf,SAAc,EACd,OAAO,EACP,MAAM,EACN,WAA4B,EAC7B,EAAE,gBAAgB,4BA8IlB;AAED,eAAe,WAAW,CAAC"}