dinesh-ai-chat-widget 1.0.7 โ†’ 1.0.8

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.cjs CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,o,p,m,p),R[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===E&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=require("react"),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.view_transition`),k=Symbol.for(`react.client.reference`),A=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,M=Array.isArray,N=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var P,F={},I=m.react_stack_bottom_frame.bind(m,o)(),L=N(i(o)),R={};e.Fragment=_,e.jsx=function(e,t,n){var r=1e4>A.recentlyCreatedOwnerStacks++;if(r){var a=Error.stackTraceLimit;Error.stackTraceLimit=10;var o=Error(`react-stack-top-frame`);Error.stackTraceLimit=a}else o=I;return d(e,t,n,!1,o,r?N(i(e)):L)},e.jsxs=function(e,t,n){var r=1e4>A.recentlyCreatedOwnerStacks++;if(r){var a=Error.stackTraceLimit;Error.stackTraceLimit=10;var o=Error(`react-stack-top-frame`);Error.stackTraceLimit=a}else o=I;return d(e,t,n,!0,o,r?N(i(e)):L)}})()})),O=o(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?E():D()})),k=c(T()),A=O(),j=[`Check vehicle status`,`Schedule maintenance`,`Pricing information`],M=[{id:1,role:`assistant`,text:`Hello! ๐Ÿ‘‹ I'm your AI assistant. How can I help you today?`,time:`Just now`}];function N(e){let t=e.toLowerCase();return t.includes(`vehicle`)||t.includes(`status`)?`I can help check vehicle status. Please provide the vehicle number plate, such as VDR6117.`:t.includes(`maintenance`)||t.includes(`repair`)?`I can help with maintenance! Please describe the vehicle issue, and I'll suggest the next steps.`:t.includes(`price`)||t.includes(`cost`)?`Pricing depends on your requirements. Tell me which service you're interested in, and I'll help estimate the cost.`:t.includes(`hello`)||t.includes(`hi`)?`Hello! ๐Ÿ˜Š What would you like help with today?`:`Thanks for your message: "${e}". This is a demo response. Configure apiUrl to connect your AI backend.`}function P({key:e,title:t=`AI Assistant`,subtitle:n=`Online ยท Ready to help`,primaryColor:r=`#2563eb`}){let[i,a]=(0,l.useState)(!1),[o,s]=(0,l.useState)(!1),[c,u]=(0,l.useState)(``),[d,f]=(0,l.useState)(!1),[p,m]=(0,l.useState)(M),h=(0,l.useRef)(null),g=(0,l.useRef)(null),[_,T]=(0,l.useState)(null);(0,l.useEffect)(()=>{h.current?.scrollIntoView({behavior:`smooth`})},[p,d,i,o]),(0,l.useEffect)(()=>{i&&!o&&g.current?.focus()},[i,o]);let E=typeof window<`u`?window.NEXT_PUBLIC_API_URL??void 0:void 0;if(!E||!e)return``;async function D(t=c){let n=t.trim();if(!n||d)return;let r=(0,k.default)().format(`HH:mm`);m(e=>[...e,{id:Date.now(),role:`user`,text:n,time:r}]),u(``),f(!0),T(null);try{let t;if(E){let r;try{r=await fetch(E,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({message:n,key:e})})}catch(e){throw T(`Failed to fetch.
6
+ <%s key={someKey} {...props} />`,o,p,m,p),R[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===E&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=require("react"),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.view_transition`),k=Symbol.for(`react.client.reference`),A=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,M=Array.isArray,N=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var P,F={},I=m.react_stack_bottom_frame.bind(m,o)(),L=N(i(o)),R={};e.Fragment=_,e.jsx=function(e,t,n){var r=1e4>A.recentlyCreatedOwnerStacks++;if(r){var a=Error.stackTraceLimit;Error.stackTraceLimit=10;var o=Error(`react-stack-top-frame`);Error.stackTraceLimit=a}else o=I;return d(e,t,n,!1,o,r?N(i(e)):L)},e.jsxs=function(e,t,n){var r=1e4>A.recentlyCreatedOwnerStacks++;if(r){var a=Error.stackTraceLimit;Error.stackTraceLimit=10;var o=Error(`react-stack-top-frame`);Error.stackTraceLimit=a}else o=I;return d(e,t,n,!0,o,r?N(i(e)):L)}})()})),O=o(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?E():D()})),k=c(T()),A=O(),j=[`Check vehicle status`,`Schedule maintenance`,`Pricing information`],M=[{id:1,role:`assistant`,text:`Hello! ๐Ÿ‘‹ I'm your AI assistant. How can I help you today?`,time:`Just now`}];function N(e){let t=e.toLowerCase();return t.includes(`vehicle`)||t.includes(`status`)?`I can help check vehicle status. Please provide the vehicle number plate, such as VDR6117.`:t.includes(`maintenance`)||t.includes(`repair`)?`I can help with maintenance! Please describe the vehicle issue, and I'll suggest the next steps.`:t.includes(`price`)||t.includes(`cost`)?`Pricing depends on your requirements. Tell me which service you're interested in, and I'll help estimate the cost.`:t.includes(`hello`)||t.includes(`hi`)?`Hello! ๐Ÿ˜Š What would you like help with today?`:`Thanks for your message: "${e}". This is a demo response. Configure apiUrl to connect your AI backend.`}function P({key:e,title:t=`AI Assistant`,subtitle:n=`Online ยท Ready to help`,primaryColor:r=`#2563eb`}){let[i,a]=(0,l.useState)(!1),[o,s]=(0,l.useState)(!1),[c,u]=(0,l.useState)(``),[d,f]=(0,l.useState)(!1),[p,m]=(0,l.useState)(M),h=(0,l.useRef)(null),g=(0,l.useRef)(null),[_,T]=(0,l.useState)(null);(0,l.useEffect)(()=>{h.current?.scrollIntoView({behavior:`smooth`})},[p,d,i,o]),(0,l.useEffect)(()=>{i&&!o&&g.current?.focus()},[i,o]);let E=process.env.NEXT_PUBLIC_API_URL;if(!E||!e)return``;async function D(t=c){let n=t.trim();if(!n||d)return;let r=(0,k.default)().format(`HH:mm`);m(e=>[...e,{id:Date.now(),role:`user`,text:n,time:r}]),u(``),f(!0),T(null);try{let t;if(E){let r;try{r=await fetch(E,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({message:n,key:e})})}catch(e){throw T(`Failed to fetch.
7
7
 
8
8
  Possible Reasons:
9
9
 
package/dist/index.js CHANGED
@@ -646,7 +646,7 @@ function z({ key: e, title: t = "AI Assistant", subtitle: a = "Online ยท Ready t
646
646
  ]), n(() => {
647
647
  s && !l && v.current?.focus();
648
648
  }, [s, l]);
649
- let x = typeof window < "u" ? window.NEXT_PUBLIC_API_URL ?? void 0 : void 0;
649
+ let x = process.env.NEXT_PUBLIC_API_URL;
650
650
  if (!x || !e) return "";
651
651
  async function S(t = d) {
652
652
  let n = t.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinesh-ai-chat-widget",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Reusable floating AI chat widget for React and Next.js",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",