@bikdotai/bik-component-library 0.0.719 → 0.0.720-beta.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.
Files changed (19) hide show
  1. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  6. package/dist/cjs/components/bik-chatbot/components/ChatWindow.js +9 -7
  7. package/dist/cjs/components/bik-chatbot/services/callToChatbot.js +1 -1
  8. package/dist/cjs/components/bik-chatbot/types/ai.d.ts +1 -0
  9. package/dist/cjs/components/bik-layout/SidebarStyles.js +1 -1
  10. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  11. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  12. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  13. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  14. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  15. package/dist/esm/components/bik-chatbot/components/ChatWindow.js +14 -12
  16. package/dist/esm/components/bik-chatbot/services/callToChatbot.js +1 -1
  17. package/dist/esm/components/bik-chatbot/types/ai.d.ts +1 -0
  18. package/dist/esm/components/bik-layout/SidebarStyles.js +1 -1
  19. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -130,13 +130,14 @@
130
130
  padding: 8px 16px;
131
131
  border-radius: 8px;
132
132
  font-size: 13px;
133
- cursor: pointer;
133
+ cursor: ${e=>e.disabled?"not-allowed":"pointer"};
134
134
  transition: all 0.2s ease;
135
135
  text-align: left;
136
136
  max-width: 280px;
137
137
  align-self: flex-end;
138
+ opacity: ${e=>e.disabled?.5:1};
138
139
 
139
- &:hover {
140
+ &:hover:not(:disabled) {
140
141
  background: linear-gradient(
141
142
  92.69deg,
142
143
  rgba(255, 230, 238, 0.7) 0.37%,
@@ -145,7 +146,7 @@
145
146
  border-color: #f472b6;
146
147
  }
147
148
 
148
- &:active {
149
+ &:active:not(:disabled) {
149
150
  transform: scale(0.98);
150
151
  }
151
152
  `,v=d.default.div`
@@ -162,16 +163,17 @@
162
163
  border-radius: 8px;
163
164
  font-size: 13px;
164
165
  border: 1px solid #fecaca;
165
- cursor: pointer;
166
+ cursor: ${e=>e.disabled?"not-allowed":"pointer"};
166
167
  transition: all 0.2s ease;
167
168
  text-align: left;
169
+ opacity: ${e=>e.disabled?.5:1};
168
170
 
169
- &:hover {
171
+ &:hover:not(:disabled) {
170
172
  background: #fee2e2;
171
173
  border-color: #fca5a5;
172
174
  }
173
175
 
174
- &:active {
176
+ &:active:not(:disabled) {
175
177
  transform: scale(0.98);
176
178
  }
177
179
  `,E=d.default.div`
@@ -249,4 +251,4 @@
249
251
  -webkit-text-fill-color: transparent;
250
252
  background-clip: text;
251
253
  display: inline-block;
252
- `;exports.CustomGradientText=T,exports.default=r=>{let{messages:o,onSend:d,header:O="Create with AI",placeholder:C="Discover the right event & launch campaigns for better conversions...",suggestions:z=["Top festivals for marketing","Top events this week?","Top August festivals near you"],iceBreakers:B,videoStarter:$,disabled:q=!1,isThinking:A=!1,onIceBreakerClick:M,chatState:_,chatWindowHeight:I,inputDisabled:D=!1}=r;const[L,H]=i.useState(""),[W,K]=i.useState(!1),[P,G]=i.useState(!1),N=i.useRef(null),V=i.useRef(null),J=W||A,Q=q||D,U=_||(W||A?"thinking":P&&L.trim().length>0?"typing":0===o.length?"conversation-starter":o.length>0?"conversation":"default"),X=()=>{!L.trim()||Q||J||(d(L),H(""),K(!0),setTimeout((()=>K(!1)),1500))},Y=L.trim().length>0,Z=Q||J||!Y;i.useEffect((()=>{var e;null===(e=N.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),[o,W,A]);const ee=I||"100%";return e.jsxRuntimeExports.jsxs(l,Object.assign({chatState:U,style:{height:ee}},{children:[e.jsxRuntimeExports.jsxs(x,{children:[e.jsxRuntimeExports.jsx(t.default,{height:24,width:24}),e.jsxRuntimeExports.jsx("div",Object.assign({className:"header-text"},{children:O}))]}),e.jsxRuntimeExports.jsxs(c,{children:[e.jsxRuntimeExports.jsxs(p,{children:["conversation-starter"===U&&$&&e.jsxRuntimeExports.jsxs(u,{children:[e.jsxRuntimeExports.jsx(h,{children:e.jsxRuntimeExports.jsx(g,Object.assign({onClick:$.onPlay},{children:e.jsxRuntimeExports.jsx("svg",Object.assign({viewBox:"0 0 24 24",fill:"currentColor"},{children:e.jsxRuntimeExports.jsx("path",{d:"M8 5v14l11-7z"})}))}))}),e.jsxRuntimeExports.jsxs(b,{children:[e.jsxRuntimeExports.jsx(n.BodySecondary,Object.assign({style:{fontWeight:500,marginBottom:"4px"}},{children:$.title})),e.jsxRuntimeExports.jsx(n.BodyCaption,{children:$.description})]})]}),o.map((t=>e.jsxRuntimeExports.jsx(f,Object.assign({role:t.role},{children:"assistant"===t.role?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s.renderMarkdownLite(t.content)}}):e.jsxRuntimeExports.jsx("div",Object.assign({style:{whiteSpace:"pre-wrap"}},{children:t.content}))}),t.id))),(W||A)&&e.jsxRuntimeExports.jsx(a.default,{}),e.jsxRuntimeExports.jsx("div",{ref:N})]}),B&&"conversation-starter"===U&&e.jsxRuntimeExports.jsx(m,{children:e.jsxRuntimeExports.jsx(j,{children:B.map((t=>e.jsxRuntimeExports.jsx(k,Object.assign({onClick:()=>{q||(null==M||M(t),d(t.text))}},{children:e.jsxRuntimeExports.jsx(T,{children:t.text})}),t.id)))})}),!B&&z.length>0&&"default"===U&&e.jsxRuntimeExports.jsx(v,{children:e.jsxRuntimeExports.jsx(w,{children:z.map((t=>e.jsxRuntimeExports.jsx(y,Object.assign({onClick:()=>!q&&d(t)},{children:t}),t)))})}),e.jsxRuntimeExports.jsx(E,{children:e.jsxRuntimeExports.jsxs(R,{children:[e.jsxRuntimeExports.jsx(F,{ref:V,value:L,onChange:e=>{if(Q)return;const t=e.target.value;H(t),G(t.trim().length>0);const i=V.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,117)}px`)},placeholder:C,onKeyDown:e=>{Q||"Enter"!==e.key||e.shiftKey||(e.preventDefault(),!J&&L.trim()&&X())},disabled:Q,hasText:Y,chatState:U}),e.jsxRuntimeExports.jsx(S,Object.assign({onClick:X,disabled:Z,hasText:Y,"aria-label":"Send"},{children:e.jsxRuntimeExports.jsxs("svg",Object.assign({viewBox:"0 0 24 24",width:"20",height:"20",stroke:"white",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},{children:[e.jsxRuntimeExports.jsx("path",{d:"M6 12h12"}),e.jsxRuntimeExports.jsx("path",{d:"M12 6l6 6-6 6"})]}))}))]})})]})]}))};
254
+ `;exports.CustomGradientText=T,exports.default=r=>{let{messages:o,onSend:d,header:$="Create with AI",placeholder:O="Discover the right event & launch campaigns for better conversions...",suggestions:C=["Top festivals for marketing","Top events this week?","Top August festivals near you"],iceBreakers:z,videoStarter:B,disabled:q=!1,isThinking:A=!1,onIceBreakerClick:M,chatState:_,chatWindowHeight:I,inputDisabled:D=!1}=r;const[L,H]=i.useState(""),[W,K]=i.useState(!1),[P,G]=i.useState(!1),N=i.useRef(null),V=i.useRef(null),J=W||A,Q=q||D,U=_||(W||A?"thinking":P&&L.trim().length>0?"typing":0===o.length?"conversation-starter":o.length>0?"conversation":"default"),X=()=>{!L.trim()||Q||J||(d(L),H(""),K(!0),setTimeout((()=>K(!1)),1500))},Y=L.trim().length>0,Z=Q||J||!Y;i.useEffect((()=>{var e;null===(e=N.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),[o,W,A]);const ee=I||"100%";return e.jsxRuntimeExports.jsxs(l,Object.assign({chatState:U,style:{height:ee}},{children:[e.jsxRuntimeExports.jsxs(x,{children:[e.jsxRuntimeExports.jsx(t.default,{height:24,width:24}),e.jsxRuntimeExports.jsx("div",Object.assign({className:"header-text"},{children:$}))]}),e.jsxRuntimeExports.jsxs(c,{children:[e.jsxRuntimeExports.jsxs(p,{children:["conversation-starter"===U&&B&&e.jsxRuntimeExports.jsxs(u,{children:[e.jsxRuntimeExports.jsx(h,{children:e.jsxRuntimeExports.jsx(g,Object.assign({onClick:B.onPlay},{children:e.jsxRuntimeExports.jsx("svg",Object.assign({viewBox:"0 0 24 24",fill:"currentColor"},{children:e.jsxRuntimeExports.jsx("path",{d:"M8 5v14l11-7z"})}))}))}),e.jsxRuntimeExports.jsxs(b,{children:[e.jsxRuntimeExports.jsx(n.BodySecondary,Object.assign({style:{fontWeight:500,marginBottom:"4px"}},{children:B.title})),e.jsxRuntimeExports.jsx(n.BodyCaption,{children:B.description})]})]}),o.map((t=>e.jsxRuntimeExports.jsx(f,Object.assign({role:t.role},{children:"assistant"===t.role?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s.renderMarkdownLite(t.content)}}):e.jsxRuntimeExports.jsx("div",Object.assign({style:{whiteSpace:"pre-wrap"}},{children:t.content}))}),t.id))),(W||A)&&e.jsxRuntimeExports.jsx(a.default,{}),e.jsxRuntimeExports.jsx("div",{ref:N})]}),z&&"conversation-starter"===U&&e.jsxRuntimeExports.jsx(m,{children:e.jsxRuntimeExports.jsx(j,{children:z.map((t=>e.jsxRuntimeExports.jsx(k,Object.assign({disabled:Q,onClick:()=>{Q||(null==M||M(t),d(t.text))}},{children:e.jsxRuntimeExports.jsx(T,{children:t.text})}),t.id)))})}),!z&&C.length>0&&"default"===U&&e.jsxRuntimeExports.jsx(v,{children:e.jsxRuntimeExports.jsx(w,{children:C.map((t=>e.jsxRuntimeExports.jsx(y,Object.assign({disabled:Q,onClick:()=>!Q&&d(t)},{children:t}),t)))})}),e.jsxRuntimeExports.jsx(E,{children:e.jsxRuntimeExports.jsxs(R,{children:[e.jsxRuntimeExports.jsx(F,{ref:V,value:L,onChange:e=>{if(Q)return;const t=e.target.value;H(t),G(t.trim().length>0);const i=V.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,117)}px`)},placeholder:O,onKeyDown:e=>{Q||"Enter"!==e.key||e.shiftKey||(e.preventDefault(),!J&&L.trim()&&X())},disabled:Q,hasText:Y,chatState:U}),e.jsxRuntimeExports.jsx(S,Object.assign({onClick:X,disabled:Z,hasText:Y,"aria-label":"Send"},{children:e.jsxRuntimeExports.jsxs("svg",Object.assign({viewBox:"0 0 24 24",width:"20",height:"20",stroke:"white",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},{children:[e.jsxRuntimeExports.jsx("path",{d:"M6 12h12"}),e.jsxRuntimeExports.jsx("path",{d:"M12 6l6 6-6 6"})]}))}))]})})]})]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("../types/ai.js");exports.callToChatbot=function(o){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default-session",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"generic",r=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:t.DEFAULT_MODEL,u=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,p=arguments.length>10?arguments[10]:void 0;return e.__awaiter(this,void 0,void 0,(function*(){if(!r)throw new Error("Chatbot authentication not configured: RequestExecutor is required");const e=u&&u.length>0?u:function(e){return e.map((e=>{let{role:t,text:o}=e;return{role:t,content:o}}))}(o),t={input:e,intent:n,conversationId:i,systemId:s,previousResponseId:l,customFunctions:a,builtinTools:c,model:d,maxTokens:null!=p?p:4e3};return yield r(t)}))},exports.createExecutorApiAdapter=function(t,o){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/openaiApiFunctions-callChatbot";return i=>e.__awaiter(this,void 0,void 0,(function*(){var e,s;const{input:r,model:l,maxTokens:a=4e3,previousResponseId:d,customFunctions:u,builtinTools:c}=i,p={input:r,tools:[...(c||[]).map((e=>({type:e}))),...(v=u,v&&0!==v.length?v.map((e=>({type:"function",name:e.name,description:e.description,parameters:e.parameters}))):[])],model:l,max_output_tokens:a,previous_response_id:d};var v;const h=`${o.replace(/\/$/,"")}${n}`,{status:g,data:m,error:_}=yield t.sendData({apiPath:h,apiMethod:"POST",requestBody:p});if(200!==g||!(null==m?void 0:m.success)){const t=(null===(s=null===(e=null==m?void 0:m.errors)||void 0===e?void 0:e[0])||void 0===s?void 0:s.message)||_;throw new Error("Backend error: "+(t?` - ${String(t)}`:""))}return function(e){const t={assistantText:e.assistantText,parsed:e.parsed,lastResponseId:e.lastResponseId,responseId:e.responseId};return e.toolCall&&(t.toolCall={name:e.toolCall.name,args:e.toolCall.args,toolCallId:e.toolCall.id,callId:e.toolCall.call_id}),t}(m.data)}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("../types/ai.js");exports.callToChatbot=function(o){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default-session",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"generic",r=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:t.DEFAULT_MODEL,u=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,p=arguments.length>10?arguments[10]:void 0;return e.__awaiter(this,void 0,void 0,(function*(){if(!r)throw new Error("Chatbot authentication not configured: RequestExecutor is required");const e=u&&u.length>0?u:function(e){return e.map((e=>{let{role:t,text:o}=e;return{role:t,content:o}}))}(o),t={input:e,intent:n,conversationId:i,systemId:s,previousResponseId:l,customFunctions:a,builtinTools:c,model:d,maxTokens:null!=p?p:4e3};return yield r(t)}))},exports.createExecutorApiAdapter=function(t,o){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/openaiApiFunctions-callChatbot";return i=>e.__awaiter(this,void 0,void 0,(function*(){var e,s;const{input:r,model:l,maxTokens:a=4e3,previousResponseId:d,customFunctions:u,builtinTools:c,conversationId:p}=i,v={input:r,tools:[...(c||[]).map((e=>({type:e}))),...(h=u,h&&0!==h.length?h.map((e=>({type:"function",name:e.name,description:e.description,parameters:e.parameters}))):[])],model:l,max_output_tokens:a,previous_response_id:d,conversation_id:p};var h;const g=`${o.replace(/\/$/,"")}${n}`,{status:m,data:_,error:f}=yield t.sendData({apiPath:g,apiMethod:"POST",requestBody:v});if(200!==m||!(null==_?void 0:_.success)){const t=(null===(s=null===(e=null==_?void 0:_.errors)||void 0===e?void 0:e[0])||void 0===s?void 0:s.message)||f;throw new Error("Backend error: "+(t?` - ${String(t)}`:""))}return function(e){const t={assistantText:e.assistantText,parsed:e.parsed,lastResponseId:e.lastResponseId,responseId:e.responseId};return e.toolCall&&(t.toolCall={name:e.toolCall.name,args:e.toolCall.args,toolCallId:e.toolCall.id,callId:e.toolCall.call_id}),t}(_.data)}))};
@@ -111,6 +111,7 @@ export interface BackendApiRequest {
111
111
  model: string;
112
112
  max_output_tokens: number;
113
113
  previous_response_id?: string;
114
+ conversation_id: string;
114
115
  }
115
116
  export interface BackendApiResponse {
116
117
  status: number;
@@ -159,7 +159,7 @@
159
159
  position: ${e=>e.postion?e.postion:"sticky"};
160
160
  top: ${e=>e.top?e.top:0}px;
161
161
  left: ${e=>e.left?e.left:0}px; //88
162
- width: ${e=>e.width?e.width:200}px;
162
+ width: ${e=>e.width?e.width:240}px;
163
163
  z-index: ${e=>e.zIndex?e.zIndex:2};
164
164
  background-color: ${e=>"brand"==e.theme?"#381062":t.COLORS.surface.standard};
165
165
  height: ${e=>e.isNewSidebar?"fit-content":"100vh"};
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -1,4 +1,4 @@
1
- import{j as e}from"../../../node_modules/react/jsx-runtime.js";import t from"../../../assets/icons/Ai_event_generating.svg.js";import{useState as i,useRef as r,useEffect as n}from"react";import a from"styled-components";import{BodySecondary as o,BodyCaption as s}from"../../TypographyStyle.js";import{renderMarkdownLite as d}from"../utils/markdown.js";import l from"./ThinkingIndicator.js";const c=a.div`
1
+ import{j as e}from"../../../node_modules/react/jsx-runtime.js";import i from"../../../assets/icons/Ai_event_generating.svg.js";import{useState as t,useRef as r,useEffect as n}from"react";import a from"styled-components";import{BodySecondary as o,BodyCaption as d}from"../../TypographyStyle.js";import{renderMarkdownLite as s}from"../utils/markdown.js";import l from"./ThinkingIndicator.js";const c=a.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: 100%;
@@ -130,13 +130,14 @@ import{j as e}from"../../../node_modules/react/jsx-runtime.js";import t from"../
130
130
  padding: 8px 16px;
131
131
  border-radius: 8px;
132
132
  font-size: 13px;
133
- cursor: pointer;
133
+ cursor: ${e=>e.disabled?"not-allowed":"pointer"};
134
134
  transition: all 0.2s ease;
135
135
  text-align: left;
136
136
  max-width: 280px;
137
137
  align-self: flex-end;
138
+ opacity: ${e=>e.disabled?.5:1};
138
139
 
139
- &:hover {
140
+ &:hover:not(:disabled) {
140
141
  background: linear-gradient(
141
142
  92.69deg,
142
143
  rgba(255, 230, 238, 0.7) 0.37%,
@@ -145,7 +146,7 @@ import{j as e}from"../../../node_modules/react/jsx-runtime.js";import t from"../
145
146
  border-color: #f472b6;
146
147
  }
147
148
 
148
- &:active {
149
+ &:active:not(:disabled) {
149
150
  transform: scale(0.98);
150
151
  }
151
152
  `,j=a.div`
@@ -162,26 +163,27 @@ import{j as e}from"../../../node_modules/react/jsx-runtime.js";import t from"../
162
163
  border-radius: 8px;
163
164
  font-size: 13px;
164
165
  border: 1px solid #fecaca;
165
- cursor: pointer;
166
+ cursor: ${e=>e.disabled?"not-allowed":"pointer"};
166
167
  transition: all 0.2s ease;
167
168
  text-align: left;
169
+ opacity: ${e=>e.disabled?.5:1};
168
170
 
169
- &:hover {
171
+ &:hover:not(:disabled) {
170
172
  background: #fee2e2;
171
173
  border-color: #fca5a5;
172
174
  }
173
175
 
174
- &:active {
176
+ &:active:not(:disabled) {
175
177
  transform: scale(0.98);
176
178
  }
177
179
  `,T=a.div`
178
180
  padding: 16px;
179
181
  flex-shrink: 0;
180
- `,O=a.div`
182
+ `,$=a.div`
181
183
  position: relative;
182
184
  display: flex;
183
185
  width: 100%;
184
- `,S=a.textarea`
186
+ `,O=a.textarea`
185
187
  flex: 1;
186
188
  border: 1px solid ${e=>e.hasText?"#3b82f6":"#d1d5db"};
187
189
  border-radius: 12px;
@@ -208,7 +210,7 @@ import{j as e}from"../../../node_modules/react/jsx-runtime.js";import t from"../
208
210
  &::placeholder {
209
211
  color: #9ca3af;
210
212
  }
211
- `,z=a.button`
213
+ `,S=a.button`
212
214
  position: absolute;
213
215
  bottom: 10px;
214
216
  right: 10px;
@@ -240,7 +242,7 @@ import{j as e}from"../../../node_modules/react/jsx-runtime.js";import t from"../
240
242
  fill: white;
241
243
  font-weight: bold;
242
244
  }
243
- `,C=a.span`
245
+ `,z=a.span`
244
246
  background: linear-gradient(
245
247
  ${e=>e.angle||92.69}deg,
246
248
  ${e=>e.colors||"#ff166a 0.37%, #fb5f08 100%"}
@@ -249,4 +251,4 @@ import{j as e}from"../../../node_modules/react/jsx-runtime.js";import t from"../
249
251
  -webkit-text-fill-color: transparent;
250
252
  background-clip: text;
251
253
  display: inline-block;
252
- `,$=a=>{let{messages:$,onSend:A,header:B="Create with AI",placeholder:I="Discover the right event & launch campaigns for better conversions...",suggestions:M=["Top festivals for marketing","Top events this week?","Top August festivals near you"],iceBreakers:_,videoStarter:D,disabled:H=!1,isThinking:L=!1,onIceBreakerClick:W,chatState:K,chatWindowHeight:E,inputDisabled:N=!1}=a;const[P,V]=i(""),[q,G]=i(!1),[J,Q]=i(!1),R=r(null),U=r(null),X=q||L,Y=H||N,Z=K||(q||L?"thinking":J&&P.trim().length>0?"typing":0===$.length?"conversation-starter":$.length>0?"conversation":"default"),ee=()=>{!P.trim()||Y||X||(A(P),V(""),G(!0),setTimeout((()=>G(!1)),1500))},te=P.trim().length>0,ie=Y||X||!te;n((()=>{var e;null===(e=R.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),[$,q,L]);const re=E||"100%";return e.jsxs(c,Object.assign({chatState:Z,style:{height:re}},{children:[e.jsxs(x,{children:[e.jsx(t,{height:24,width:24}),e.jsx("div",Object.assign({className:"header-text"},{children:B}))]}),e.jsxs(h,{children:[e.jsxs(g,{children:["conversation-starter"===Z&&D&&e.jsxs(p,{children:[e.jsx(b,{children:e.jsx(f,Object.assign({onClick:D.onPlay},{children:e.jsx("svg",Object.assign({viewBox:"0 0 24 24",fill:"currentColor"},{children:e.jsx("path",{d:"M8 5v14l11-7z"})}))}))}),e.jsxs(u,{children:[e.jsx(o,Object.assign({style:{fontWeight:500,marginBottom:"4px"}},{children:D.title})),e.jsx(s,{children:D.description})]})]}),$.map((t=>e.jsx(m,Object.assign({role:t.role},{children:"assistant"===t.role?e.jsx("div",{dangerouslySetInnerHTML:{__html:d(t.content)}}):e.jsx("div",Object.assign({style:{whiteSpace:"pre-wrap"}},{children:t.content}))}),t.id))),(q||L)&&e.jsx(l,{}),e.jsx("div",{ref:R})]}),_&&"conversation-starter"===Z&&e.jsx(k,{children:e.jsx(v,{children:_.map((t=>e.jsx(w,Object.assign({onClick:()=>{H||(null==W||W(t),A(t.text))}},{children:e.jsx(C,{children:t.text})}),t.id)))})}),!_&&M.length>0&&"default"===Z&&e.jsx(j,{children:e.jsx(y,{children:M.map((t=>e.jsx(F,Object.assign({onClick:()=>!H&&A(t)},{children:t}),t)))})}),e.jsx(T,{children:e.jsxs(O,{children:[e.jsx(S,{ref:U,value:P,onChange:e=>{if(Y)return;const t=e.target.value;V(t),Q(t.trim().length>0);const i=U.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,117)}px`)},placeholder:I,onKeyDown:e=>{Y||"Enter"!==e.key||e.shiftKey||(e.preventDefault(),!X&&P.trim()&&ee())},disabled:Y,hasText:te,chatState:Z}),e.jsx(z,Object.assign({onClick:ee,disabled:ie,hasText:te,"aria-label":"Send"},{children:e.jsxs("svg",Object.assign({viewBox:"0 0 24 24",width:"20",height:"20",stroke:"white",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},{children:[e.jsx("path",{d:"M6 12h12"}),e.jsx("path",{d:"M12 6l6 6-6 6"})]}))}))]})})]})]}))};export{C as CustomGradientText,$ as default};
254
+ `,C=a=>{let{messages:C,onSend:A,header:B="Create with AI",placeholder:I="Discover the right event & launch campaigns for better conversions...",suggestions:M=["Top festivals for marketing","Top events this week?","Top August festivals near you"],iceBreakers:_,videoStarter:D,disabled:H=!1,isThinking:L=!1,onIceBreakerClick:W,chatState:K,chatWindowHeight:E,inputDisabled:N=!1}=a;const[P,V]=t(""),[q,G]=t(!1),[J,Q]=t(!1),R=r(null),U=r(null),X=q||L,Y=H||N,Z=K||(q||L?"thinking":J&&P.trim().length>0?"typing":0===C.length?"conversation-starter":C.length>0?"conversation":"default"),ee=()=>{!P.trim()||Y||X||(A(P),V(""),G(!0),setTimeout((()=>G(!1)),1500))},ie=P.trim().length>0,te=Y||X||!ie;n((()=>{var e;null===(e=R.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),[C,q,L]);const re=E||"100%";return e.jsxs(c,Object.assign({chatState:Z,style:{height:re}},{children:[e.jsxs(x,{children:[e.jsx(i,{height:24,width:24}),e.jsx("div",Object.assign({className:"header-text"},{children:B}))]}),e.jsxs(h,{children:[e.jsxs(g,{children:["conversation-starter"===Z&&D&&e.jsxs(p,{children:[e.jsx(b,{children:e.jsx(f,Object.assign({onClick:D.onPlay},{children:e.jsx("svg",Object.assign({viewBox:"0 0 24 24",fill:"currentColor"},{children:e.jsx("path",{d:"M8 5v14l11-7z"})}))}))}),e.jsxs(u,{children:[e.jsx(o,Object.assign({style:{fontWeight:500,marginBottom:"4px"}},{children:D.title})),e.jsx(d,{children:D.description})]})]}),C.map((i=>e.jsx(m,Object.assign({role:i.role},{children:"assistant"===i.role?e.jsx("div",{dangerouslySetInnerHTML:{__html:s(i.content)}}):e.jsx("div",Object.assign({style:{whiteSpace:"pre-wrap"}},{children:i.content}))}),i.id))),(q||L)&&e.jsx(l,{}),e.jsx("div",{ref:R})]}),_&&"conversation-starter"===Z&&e.jsx(k,{children:e.jsx(v,{children:_.map((i=>e.jsx(w,Object.assign({disabled:Y,onClick:()=>{Y||(null==W||W(i),A(i.text))}},{children:e.jsx(z,{children:i.text})}),i.id)))})}),!_&&M.length>0&&"default"===Z&&e.jsx(j,{children:e.jsx(y,{children:M.map((i=>e.jsx(F,Object.assign({disabled:Y,onClick:()=>!Y&&A(i)},{children:i}),i)))})}),e.jsx(T,{children:e.jsxs($,{children:[e.jsx(O,{ref:U,value:P,onChange:e=>{if(Y)return;const i=e.target.value;V(i),Q(i.trim().length>0);const t=U.current;t&&(t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,117)}px`)},placeholder:I,onKeyDown:e=>{Y||"Enter"!==e.key||e.shiftKey||(e.preventDefault(),!X&&P.trim()&&ee())},disabled:Y,hasText:ie,chatState:Z}),e.jsx(S,Object.assign({onClick:ee,disabled:te,hasText:ie,"aria-label":"Send"},{children:e.jsxs("svg",Object.assign({viewBox:"0 0 24 24",width:"20",height:"20",stroke:"white",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},{children:[e.jsx("path",{d:"M6 12h12"}),e.jsx("path",{d:"M12 6l6 6-6 6"})]}))}))]})})]})]}))};export{z as CustomGradientText,C as default};
@@ -1 +1 @@
1
- import{__awaiter as t}from"../../../_virtual/_tslib.js";import{DEFAULT_MODEL as o}from"../types/ai.js";function e(o,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/openaiApiFunctions-callChatbot";return i=>t(this,void 0,void 0,(function*(){var t,s;const{input:l,model:r,maxTokens:a=4e3,previousResponseId:d,customFunctions:u,builtinTools:p}=i,c={input:l,tools:[...(p||[]).map((t=>({type:t}))),...(v=u,v&&0!==v.length?v.map((t=>({type:"function",name:t.name,description:t.description,parameters:t.parameters}))):[])],model:r,max_output_tokens:a,previous_response_id:d};var v;const m=`${e.replace(/\/$/,"")}${n}`,{status:h,data:g,error:f}=yield o.sendData({apiPath:m,apiMethod:"POST",requestBody:c});if(200!==h||!(null==g?void 0:g.success)){const o=(null===(s=null===(t=null==g?void 0:g.errors)||void 0===t?void 0:t[0])||void 0===s?void 0:s.message)||f;throw new Error("Backend error: "+(o?` - ${String(o)}`:""))}return function(t){const o={assistantText:t.assistantText,parsed:t.parsed,lastResponseId:t.lastResponseId,responseId:t.responseId};return t.toolCall&&(o.toolCall={name:t.toolCall.name,args:t.toolCall.args,toolCallId:t.toolCall.id,callId:t.toolCall.call_id}),o}(g.data)}))}function n(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default-session",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"generic",l=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:o,u=arguments.length>8?arguments[8]:void 0,p=arguments.length>9?arguments[9]:void 0,c=arguments.length>10?arguments[10]:void 0;return t(this,void 0,void 0,(function*(){if(!l)throw new Error("Chatbot authentication not configured: RequestExecutor is required");const t=u&&u.length>0?u:function(t){return t.map((t=>{let{role:o,text:e}=t;return{role:o,content:e}}))}(e),o={input:t,intent:n,conversationId:i,systemId:s,previousResponseId:r,customFunctions:a,builtinTools:p,model:d,maxTokens:null!=c?c:4e3};return yield l(o)}))}export{n as callToChatbot,e as createExecutorApiAdapter};
1
+ import{__awaiter as t}from"../../../_virtual/_tslib.js";import{DEFAULT_MODEL as o}from"../types/ai.js";function e(o,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/openaiApiFunctions-callChatbot";return i=>t(this,void 0,void 0,(function*(){var t,s;const{input:l,model:r,maxTokens:a=4e3,previousResponseId:d,customFunctions:u,builtinTools:c,conversationId:p}=i,v={input:l,tools:[...(c||[]).map((t=>({type:t}))),...(m=u,m&&0!==m.length?m.map((t=>({type:"function",name:t.name,description:t.description,parameters:t.parameters}))):[])],model:r,max_output_tokens:a,previous_response_id:d,conversation_id:p};var m;const h=`${e.replace(/\/$/,"")}${n}`,{status:g,data:f,error:I}=yield o.sendData({apiPath:h,apiMethod:"POST",requestBody:v});if(200!==g||!(null==f?void 0:f.success)){const o=(null===(s=null===(t=null==f?void 0:f.errors)||void 0===t?void 0:t[0])||void 0===s?void 0:s.message)||I;throw new Error("Backend error: "+(o?` - ${String(o)}`:""))}return function(t){const o={assistantText:t.assistantText,parsed:t.parsed,lastResponseId:t.lastResponseId,responseId:t.responseId};return t.toolCall&&(o.toolCall={name:t.toolCall.name,args:t.toolCall.args,toolCallId:t.toolCall.id,callId:t.toolCall.call_id}),o}(f.data)}))}function n(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default-session",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"generic",l=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:o,u=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,p=arguments.length>10?arguments[10]:void 0;return t(this,void 0,void 0,(function*(){if(!l)throw new Error("Chatbot authentication not configured: RequestExecutor is required");const t=u&&u.length>0?u:function(t){return t.map((t=>{let{role:o,text:e}=t;return{role:o,content:e}}))}(e),o={input:t,intent:n,conversationId:i,systemId:s,previousResponseId:r,customFunctions:a,builtinTools:c,model:d,maxTokens:null!=p?p:4e3};return yield l(o)}))}export{n as callToChatbot,e as createExecutorApiAdapter};
@@ -111,6 +111,7 @@ export interface BackendApiRequest {
111
111
  model: string;
112
112
  max_output_tokens: number;
113
113
  previous_response_id?: string;
114
+ conversation_id: string;
114
115
  }
115
116
  export interface BackendApiResponse {
116
117
  status: number;
@@ -159,7 +159,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
159
159
  position: ${e=>e.postion?e.postion:"sticky"};
160
160
  top: ${e=>e.top?e.top:0}px;
161
161
  left: ${e=>e.left?e.left:0}px; //88
162
- width: ${e=>e.width?e.width:200}px;
162
+ width: ${e=>e.width?e.width:240}px;
163
163
  z-index: ${e=>e.zIndex?e.zIndex:2};
164
164
  background-color: ${e=>"brand"==e.theme?"#381062":i.surface.standard};
165
165
  height: ${e=>e.isNewSidebar?"fit-content":"100vh"};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.719",
3
+ "version": "0.0.720-beta.1",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",