@nlux/nlbridge-react
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -1,1 +0,1 @@ | ||
"use strict";var e=require("@nlux/nlbridge"),t=require("react");const r=t=>{const{url:r,mode:o,context:n}=t||{};if(o&&"copilot"!==o&&"chat"!==o)throw new Error("Data transfer mode not supported");if(!r)throw new Error("Runnable URL is required");let a=e.createChatAdapter().withUrl(r);return o&&(a=a.withMode(o)),n&&(a=a.withContext(n)),a.create()};Object.defineProperty(exports,"createChatAdapter",{enumerable:!0,get:function(){return e.createChatAdapter}}),Object.defineProperty(exports,"createContextAdapter",{enumerable:!0,get:function(){return e.createContextAdapter}}),exports.useChatAdapter=e=>{const{context:o,url:n,mode:a}=e,u=o?.ref?t.useContext(o.ref):void 0,[c,d]=t.useState(r({url:n,mode:a,context:u}));return t.useEffect((()=>{let e=r({url:n,mode:a,context:u});d(e)}),[n,u]),c}; | ||
"use strict";var e=require("@nlux/nlbridge"),t=require("react");const r=t=>{const{url:r,mode:o,context:n,headers:a}=t||{};if(o&&"copilot"!==o&&"chat"!==o)throw new Error("Data transfer mode not supported");if(!r)throw new Error("Runnable URL is required");let u=e.createChatAdapter().withUrl(r);return o&&(u=u.withMode(o)),n&&(u=u.withContext(n)),a&&(u=u.withHeaders(a)),u.create()};Object.defineProperty(exports,"createChatAdapter",{enumerable:!0,get:function(){return e.createChatAdapter}}),Object.defineProperty(exports,"createContextAdapter",{enumerable:!0,get:function(){return e.createContextAdapter}}),exports.useChatAdapter=e=>{const{context:o,url:n,mode:a,headers:u}=e,c=o?.ref?t.useContext(o.ref):void 0,[d,s]=t.useState(r({url:n,mode:a,context:c,headers:u}));return t.useEffect((()=>{let e=r({url:n,mode:a,context:c});s(e)}),[n,c,u]),d}; |
@@ -1,1 +0,1 @@ | ||
import{createChatAdapter as t}from"@nlux/nlbridge";export{createChatAdapter,createContextAdapter}from"@nlux/nlbridge";import{useContext as r,useState as e,useEffect as o}from"react";const n=r=>{const{url:e,mode:o,context:n}=r||{};if(o&&"copilot"!==o&&"chat"!==o)throw new Error("Data transfer mode not supported");if(!e)throw new Error("Runnable URL is required");let c=t().withUrl(e);return o&&(c=c.withMode(o)),n&&(c=c.withContext(n)),c.create()},c=t=>{const{context:c,url:d,mode:i}=t,l=c?.ref?r(c.ref):void 0,[a,u]=e(n({url:d,mode:i,context:l}));return o((()=>{let t=n({url:d,mode:i,context:l});u(t)}),[d,l]),a};export{c as useChatAdapter}; | ||
import{createChatAdapter as e}from"@nlux/nlbridge";export{createChatAdapter,createContextAdapter}from"@nlux/nlbridge";import{useContext as r,useState as t,useEffect as o}from"react";const n=r=>{const{url:t,mode:o,context:n,headers:d}=r||{};if(o&&"copilot"!==o&&"chat"!==o)throw new Error("Data transfer mode not supported");if(!t)throw new Error("Runnable URL is required");let a=e().withUrl(t);return o&&(a=a.withMode(o)),n&&(a=a.withContext(n)),d&&(a=a.withHeaders(d)),a.create()},d=e=>{const{context:d,url:a,mode:i,headers:c}=e,l=d?.ref?r(d.ref):void 0,[h,u]=t(n({url:a,mode:i,context:l,headers:c}));return o((()=>{let e=n({url:a,mode:i,context:l});u(e)}),[a,l,c]),h};export{d as useChatAdapter}; |
@@ -9,2 +9,3 @@ import { ChatAdapter } from '@nlux/nlbridge'; | ||
context?: AiContext; | ||
headers?: Record<string, string>; | ||
}; | ||
@@ -11,0 +12,0 @@ declare const useChatAdapter: (options: ReactChatAdapterOptions) => ChatAdapter; |
{ | ||
"name": "@nlux/nlbridge-react", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "The nlbridge adapters for nlux React, the React JS library for building conversational AI interfaces.", | ||
@@ -62,6 +62,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@nlux/nlbridge": "1.0.10" | ||
"@nlux/nlbridge": "1.0.11" | ||
}, | ||
"peerDependencies": { | ||
"@nlux/react": "1.0.10", | ||
"@nlux/react": "1.0.11", | ||
"react": "^18.2.0" | ||
@@ -68,0 +68,0 @@ }, |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@nlux/nlbridge"),require("react")):"function"==typeof define&&define.amd?define(["exports","@nlux/nlbridge","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@nlux/nlbridge-react"]={},e.nlbridge,e.react)}(this,(function(e,t,r){"use strict";const n=e=>{const{url:r,mode:n,context:o}=e||{};if(n&&"copilot"!==n&&"chat"!==n)throw new Error("Data transfer mode not supported");if(!r)throw new Error("Runnable URL is required");let a=t.createChatAdapter().withUrl(r);return n&&(a=a.withMode(n)),o&&(a=a.withContext(o)),a.create()};Object.defineProperty(e,"createChatAdapter",{enumerable:!0,get:function(){return t.createChatAdapter}}),Object.defineProperty(e,"createContextAdapter",{enumerable:!0,get:function(){return t.createContextAdapter}}),e.useChatAdapter=e=>{const{context:t,url:o,mode:a}=e,i=t?.ref?r.useContext(t.ref):void 0,[u,d]=r.useState(n({url:o,mode:a,context:i}));return r.useEffect((()=>{let e=n({url:o,mode:a,context:i});d(e)}),[o,i]),u}})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@nlux/nlbridge"),require("react")):"function"==typeof define&&define.amd?define(["exports","@nlux/nlbridge","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@nlux/nlbridge-react"]={},e.nlbridge,e.react)}(this,(function(e,t,r){"use strict";const n=e=>{const{url:r,mode:n,context:o,headers:a}=e||{};if(n&&"copilot"!==n&&"chat"!==n)throw new Error("Data transfer mode not supported");if(!r)throw new Error("Runnable URL is required");let d=t.createChatAdapter().withUrl(r);return n&&(d=d.withMode(n)),o&&(d=d.withContext(o)),a&&(d=d.withHeaders(a)),d.create()};Object.defineProperty(e,"createChatAdapter",{enumerable:!0,get:function(){return t.createChatAdapter}}),Object.defineProperty(e,"createContextAdapter",{enumerable:!0,get:function(){return t.createContextAdapter}}),e.useChatAdapter=e=>{const{context:t,url:o,mode:a,headers:d}=e,i=t?.ref?r.useContext(t.ref):void 0,[u,c]=r.useState(n({url:o,mode:a,context:i,headers:d}));return r.useEffect((()=>{let e=n({url:o,mode:a,context:i});c(e)}),[o,i,d]),u}})); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6071
25
+ Added@nlux/nlbridge@1.0.11(transitive)
- Removed@nlux/core@1.0.10(transitive)
- Removed@nlux/nlbridge@1.0.10(transitive)
- Removed@nlux/react@1.0.10(transitive)
- Removedreact-dom@18.3.1(transitive)
- Removedscheduler@0.23.2(transitive)
Updated@nlux/nlbridge@1.0.11