@jarvinbyintromatic/nextjs 1.0.0 → 1.0.1
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/index.d.ts +6 -0
- package/dist/index.js +8 -0
- package/package.json +12 -3
- package/src/index.tsx +0 -20
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WidgetOptions } from 'jarvin-widget';
|
|
2
|
+
interface JarvinWidgetProps extends WidgetOptions {
|
|
3
|
+
defaultOpen?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function JarvinChatWidget(props: JarvinWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export type { WidgetOptions } from 'jarvin-widget';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
4
|
+
// Dynamic import with SSR disabled — the widget needs DOM APIs
|
|
5
|
+
const JarvinChatWidgetInner = dynamic(() => import('@jarvinbyintromatic/react').then(m => ({ default: m.JarvinChatWidget })), { ssr: false });
|
|
6
|
+
export function JarvinChatWidget(props) {
|
|
7
|
+
return _jsx(JarvinChatWidgetInner, { ...props });
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jarvinbyintromatic/nextjs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Jarvin chat widget — Next.js component (SSR-safe)",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "
|
|
7
|
-
"
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": ["dist"],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc"
|
|
12
|
+
},
|
|
8
13
|
"license": "MIT",
|
|
9
14
|
"dependencies": {
|
|
10
15
|
"@jarvinbyintromatic/react": "^1.0.0",
|
|
@@ -13,5 +18,9 @@
|
|
|
13
18
|
"peerDependencies": {
|
|
14
19
|
"react": ">=18",
|
|
15
20
|
"next": ">=13"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.7.2",
|
|
24
|
+
"@types/react": "^18.0.0"
|
|
16
25
|
}
|
|
17
26
|
}
|
package/src/index.tsx
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import dynamic from 'next/dynamic';
|
|
4
|
-
import type { WidgetOptions } from 'jarvin-widget';
|
|
5
|
-
|
|
6
|
-
interface JarvinWidgetProps extends WidgetOptions {
|
|
7
|
-
defaultOpen?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// Dynamic import with SSR disabled — the widget needs DOM APIs
|
|
11
|
-
const JarvinChatWidgetInner = dynamic(
|
|
12
|
-
() => import('@jarvinbyintromatic/react').then(m => ({ default: m.JarvinChatWidget })),
|
|
13
|
-
{ ssr: false },
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
export function JarvinChatWidget(props: JarvinWidgetProps) {
|
|
17
|
-
return <JarvinChatWidgetInner {...props} />;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type { WidgetOptions } from 'jarvin-widget';
|