@iblai/iblai-js 2.33.3 → 2.34.0

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.
@@ -4213,6 +4213,10 @@ var embedTabLabels$3 = {
4213
4213
  label: "Show Voice Record",
4214
4214
  tooltip: "Show Voice Recording Options in Chat Interface"
4215
4215
  },
4216
+ allowMentorSelection: {
4217
+ label: "Allow Agent Selection",
4218
+ tooltip: "Let signed-in visitors open Explore from the embed and switch to another agent."
4219
+ },
4216
4220
  shareableLink: {
4217
4221
  label: "Shareable Link",
4218
4222
  tooltip: "Generate a link users can use to chat with this agent anonymously"
@@ -6847,6 +6851,9 @@ var tabsEmbedTab$3 = {
6847
6851
  moreInfoShowVoiceRecord: "More info about show voice record",
6848
6852
  showVoiceRecordEnabled: "Show voice record enabled",
6849
6853
  showVoiceRecordDisabled: "Show voice record disabled",
6854
+ moreInfoAllowMentorSelection: "More info about agent selection",
6855
+ allowMentorSelectionEnabled: "Agent selection enabled",
6856
+ allowMentorSelectionDisabled: "Agent selection disabled",
6850
6857
  moreInfoStarterPrompts: "More info about starter prompts",
6851
6858
  moreInfoShareableLink: "More info about shareable link",
6852
6859
  shareableLinkEnabled: "Generate / Revoke shareable link enabled",
@@ -12173,6 +12180,10 @@ var embedTabLabels$2 = {
12173
12180
  label: "Afficher l'enregistrement vocal",
12174
12181
  tooltip: "Afficher les options d'enregistrement vocal dans l'interface de chat"
12175
12182
  },
12183
+ allowMentorSelection: {
12184
+ label: "Autoriser la sélection d'agent",
12185
+ tooltip: "Permettre aux visiteurs connectés d'ouvrir Explorer depuis l'intégration et de passer à un autre agent."
12186
+ },
12176
12187
  shareableLink: {
12177
12188
  label: "Lien partageable",
12178
12189
  tooltip: "Générer un lien que les utilisateurs peuvent utiliser pour discuter avec cet agent de manière anonyme"
@@ -14807,6 +14818,9 @@ var tabsEmbedTab$2 = {
14807
14818
  moreInfoShowVoiceRecord: "Plus d'informations sur l'affichage des enregistrements vocaux",
14808
14819
  showVoiceRecordEnabled: "Affichage des enregistrements vocaux activé",
14809
14820
  showVoiceRecordDisabled: "Affichage des enregistrements vocaux désactivé",
14821
+ moreInfoAllowMentorSelection: "Plus d'informations sur la sélection d'agent",
14822
+ allowMentorSelectionEnabled: "Sélection d'agent activée",
14823
+ allowMentorSelectionDisabled: "Sélection d'agent désactivée",
14810
14824
  moreInfoStarterPrompts: "Plus d'informations sur les suggestions de départ",
14811
14825
  moreInfoShareableLink: "Plus d'informations sur le lien partageable",
14812
14826
  shareableLinkEnabled: "Lien partageable activé",
@@ -19967,6 +19981,10 @@ var embedTabLabels$1 = {
19967
19981
  label: "Mostrar grabación de voz",
19968
19982
  tooltip: "Mostrar opciones de grabación de voz en la interfaz de chat"
19969
19983
  },
19984
+ allowMentorSelection: {
19985
+ label: "Permitir selección de agente",
19986
+ tooltip: "Permite a los visitantes con sesión iniciada abrir Explorar desde la inserción y cambiar a otro agente."
19987
+ },
19970
19988
  shareableLink: {
19971
19989
  label: "Enlace compartible",
19972
19990
  tooltip: "Genere un enlace que los usuarios puedan usar para chatear con este agente de forma anónima"
@@ -22601,6 +22619,9 @@ var tabsEmbedTab$1 = {
22601
22619
  moreInfoShowVoiceRecord: "Más información sobre mostrar grabaciones de voz",
22602
22620
  showVoiceRecordEnabled: "Mostrar grabaciones de voz habilitado",
22603
22621
  showVoiceRecordDisabled: "Mostrar grabaciones de voz deshabilitado",
22622
+ moreInfoAllowMentorSelection: "Más información sobre la selección de agente",
22623
+ allowMentorSelectionEnabled: "Selección de agente habilitada",
22624
+ allowMentorSelectionDisabled: "Selección de agente deshabilitada",
22604
22625
  moreInfoStarterPrompts: "Más información sobre las sugerencias iniciales",
22605
22626
  moreInfoShareableLink: "Más información sobre el enlace compartible",
22606
22627
  shareableLinkEnabled: "Enlace compartible habilitado",
@@ -27761,6 +27782,10 @@ var embedTabLabels = {
27761
27782
  label: "显示语音录制",
27762
27783
  tooltip: "在聊天界面中显示语音录制选项"
27763
27784
  },
27785
+ allowMentorSelection: {
27786
+ label: "允许选择智能体",
27787
+ tooltip: "允许已登录的访问者从嵌入中打开探索并切换到其他智能体。"
27788
+ },
27764
27789
  shareableLink: {
27765
27790
  label: "可分享链接",
27766
27791
  tooltip: "生成一个链接,用户可使用该链接匿名与此智能体聊天"
@@ -30395,6 +30420,9 @@ var tabsEmbedTab = {
30395
30420
  moreInfoShowVoiceRecord: "更多关于显示语音录制的信息",
30396
30421
  showVoiceRecordEnabled: "显示语音录制已启用",
30397
30422
  showVoiceRecordDisabled: "显示语音录制已禁用",
30423
+ moreInfoAllowMentorSelection: "有关选择智能体的更多信息",
30424
+ allowMentorSelectionEnabled: "选择智能体已启用",
30425
+ allowMentorSelectionDisabled: "选择智能体已禁用",
30398
30426
  moreInfoStarterPrompts: "更多关于起始提示的信息",
30399
30427
  moreInfoShareableLink: "更多关于可分享链接的信息",
30400
30428
  shareableLinkEnabled: "可分享链接已启用",
@@ -98699,6 +98699,10 @@ var embedTabLabels$3 = {
98699
98699
  label: "Show Voice Record",
98700
98700
  tooltip: "Show Voice Recording Options in Chat Interface"
98701
98701
  },
98702
+ allowMentorSelection: {
98703
+ label: "Allow Agent Selection",
98704
+ tooltip: "Let signed-in visitors open Explore from the embed and switch to another agent."
98705
+ },
98702
98706
  shareableLink: {
98703
98707
  label: "Shareable Link",
98704
98708
  tooltip: "Generate a link users can use to chat with this agent anonymously"
@@ -101333,6 +101337,9 @@ var tabsEmbedTab$3 = {
101333
101337
  moreInfoShowVoiceRecord: "More info about show voice record",
101334
101338
  showVoiceRecordEnabled: "Show voice record enabled",
101335
101339
  showVoiceRecordDisabled: "Show voice record disabled",
101340
+ moreInfoAllowMentorSelection: "More info about agent selection",
101341
+ allowMentorSelectionEnabled: "Agent selection enabled",
101342
+ allowMentorSelectionDisabled: "Agent selection disabled",
101336
101343
  moreInfoStarterPrompts: "More info about starter prompts",
101337
101344
  moreInfoShareableLink: "More info about shareable link",
101338
101345
  shareableLinkEnabled: "Generate / Revoke shareable link enabled",
@@ -106659,6 +106666,10 @@ var embedTabLabels$2 = {
106659
106666
  label: "Afficher l'enregistrement vocal",
106660
106667
  tooltip: "Afficher les options d'enregistrement vocal dans l'interface de chat"
106661
106668
  },
106669
+ allowMentorSelection: {
106670
+ label: "Autoriser la sélection d'agent",
106671
+ tooltip: "Permettre aux visiteurs connectés d'ouvrir Explorer depuis l'intégration et de passer à un autre agent."
106672
+ },
106662
106673
  shareableLink: {
106663
106674
  label: "Lien partageable",
106664
106675
  tooltip: "Générer un lien que les utilisateurs peuvent utiliser pour discuter avec cet agent de manière anonyme"
@@ -109293,6 +109304,9 @@ var tabsEmbedTab$2 = {
109293
109304
  moreInfoShowVoiceRecord: "Plus d'informations sur l'affichage des enregistrements vocaux",
109294
109305
  showVoiceRecordEnabled: "Affichage des enregistrements vocaux activé",
109295
109306
  showVoiceRecordDisabled: "Affichage des enregistrements vocaux désactivé",
109307
+ moreInfoAllowMentorSelection: "Plus d'informations sur la sélection d'agent",
109308
+ allowMentorSelectionEnabled: "Sélection d'agent activée",
109309
+ allowMentorSelectionDisabled: "Sélection d'agent désactivée",
109296
109310
  moreInfoStarterPrompts: "Plus d'informations sur les suggestions de départ",
109297
109311
  moreInfoShareableLink: "Plus d'informations sur le lien partageable",
109298
109312
  shareableLinkEnabled: "Lien partageable activé",
@@ -114453,6 +114467,10 @@ var embedTabLabels$1 = {
114453
114467
  label: "Mostrar grabación de voz",
114454
114468
  tooltip: "Mostrar opciones de grabación de voz en la interfaz de chat"
114455
114469
  },
114470
+ allowMentorSelection: {
114471
+ label: "Permitir selección de agente",
114472
+ tooltip: "Permite a los visitantes con sesión iniciada abrir Explorar desde la inserción y cambiar a otro agente."
114473
+ },
114456
114474
  shareableLink: {
114457
114475
  label: "Enlace compartible",
114458
114476
  tooltip: "Genere un enlace que los usuarios puedan usar para chatear con este agente de forma anónima"
@@ -117087,6 +117105,9 @@ var tabsEmbedTab$1 = {
117087
117105
  moreInfoShowVoiceRecord: "Más información sobre mostrar grabaciones de voz",
117088
117106
  showVoiceRecordEnabled: "Mostrar grabaciones de voz habilitado",
117089
117107
  showVoiceRecordDisabled: "Mostrar grabaciones de voz deshabilitado",
117108
+ moreInfoAllowMentorSelection: "Más información sobre la selección de agente",
117109
+ allowMentorSelectionEnabled: "Selección de agente habilitada",
117110
+ allowMentorSelectionDisabled: "Selección de agente deshabilitada",
117090
117111
  moreInfoStarterPrompts: "Más información sobre las sugerencias iniciales",
117091
117112
  moreInfoShareableLink: "Más información sobre el enlace compartible",
117092
117113
  shareableLinkEnabled: "Enlace compartible habilitado",
@@ -122247,6 +122268,10 @@ var embedTabLabels = {
122247
122268
  label: "显示语音录制",
122248
122269
  tooltip: "在聊天界面中显示语音录制选项"
122249
122270
  },
122271
+ allowMentorSelection: {
122272
+ label: "允许选择智能体",
122273
+ tooltip: "允许已登录的访问者从嵌入中打开探索并切换到其他智能体。"
122274
+ },
122250
122275
  shareableLink: {
122251
122276
  label: "可分享链接",
122252
122277
  tooltip: "生成一个链接,用户可使用该链接匿名与此智能体聊天"
@@ -124881,6 +124906,9 @@ var tabsEmbedTab = {
124881
124906
  moreInfoShowVoiceRecord: "更多关于显示语音录制的信息",
124882
124907
  showVoiceRecordEnabled: "显示语音录制已启用",
124883
124908
  showVoiceRecordDisabled: "显示语音录制已禁用",
124909
+ moreInfoAllowMentorSelection: "有关选择智能体的更多信息",
124910
+ allowMentorSelectionEnabled: "选择智能体已启用",
124911
+ allowMentorSelectionDisabled: "选择智能体已禁用",
124884
124912
  moreInfoStarterPrompts: "更多关于起始提示的信息",
124885
124913
  moreInfoShareableLink: "更多关于可分享链接的信息",
124886
124914
  shareableLinkEnabled: "可分享链接已启用",
@@ -313817,6 +313845,9 @@ const getUrl = (settings, tenant, mentorIframeUrl, extraBodyClasses = '') => {
313817
313845
  if (settings.mode === 'advanced') {
313818
313846
  url += `&chat=advanced`;
313819
313847
  }
313848
+ if (settings.allow_mentor_selection) {
313849
+ url += `&allow-mentor-selection=true`;
313850
+ }
313820
313851
  return url;
313821
313852
  };
313822
313853
  const getEmbedCode = async (tenant, settings, redirectToken, urls, useCustomFloatingBubble, customFloatingBubbleConfig) => {
@@ -314229,6 +314260,7 @@ const defaultEmbedFormValues = {
314229
314260
  const useEmbedTab = (urls) => {
314230
314261
  var _a, _b, _c, _d, _e, _f;
314231
314262
  const [embedCode, setEmbedCode] = useState('');
314263
+ const [allowMentorSelection, setAllowMentorSelection] = useState(false);
314232
314264
  const { tenantKey, mentorId, username } = useAgentSettings();
314233
314265
  const { data: mentorPublicSettings } = useGetMentorPublicSettingsQuery({
314234
314266
  mentor: mentorId,
@@ -314364,7 +314396,7 @@ const useEmbedTab = (urls) => {
314364
314396
  }
314365
314397
  const embed = await getEmbedCode(tenantKey,
314366
314398
  // @ts-expect-error - value is not typed correctly
314367
- value, (_a = syncResult.redirectToken) !== null && _a !== void 0 ? _a : '', urls, value.icon_selection === 'custom', customFloatingBubbleConfig);
314399
+ { ...value, allow_mentor_selection: allowMentorSelection }, (_a = syncResult.redirectToken) !== null && _a !== void 0 ? _a : '', urls, value.icon_selection === 'custom', customFloatingBubbleConfig);
314368
314400
  setEmbedCode(embed);
314369
314401
  },
314370
314402
  });
@@ -314395,6 +314427,8 @@ const useEmbedTab = (urls) => {
314395
314427
  };
314396
314428
  const [focusEditCustomFloatingBubble, setFocusEditCustomFloatingBubble] = useState(false);
314397
314429
  return {
314430
+ allowMentorSelection,
314431
+ setAllowMentorSelection,
314398
314432
  createTokenHandler,
314399
314433
  form,
314400
314434
  createTokenError,
@@ -314474,6 +314508,10 @@ const AGENT_EMBED_TAB_LABELS = {
314474
314508
  label: 'Show Voice Record',
314475
314509
  tooltip: 'Show Voice Recording Options in Chat Interface',
314476
314510
  },
314511
+ allowMentorSelection: {
314512
+ label: 'Allow Agent Selection',
314513
+ tooltip: 'Let signed-in visitors open Explore from the embed and switch to another agent.',
314514
+ },
314477
314515
  shareableLink: {
314478
314516
  label: 'Shareable Link',
314479
314517
  tooltip: 'Generate a link users can use to chat with this agent anonymously',
@@ -314557,6 +314595,10 @@ function buildEmbedTabLabels(t) {
314557
314595
  label: t('embedTabLabels.fields.showVoiceRecord.label'),
314558
314596
  tooltip: t('embedTabLabels.fields.showVoiceRecord.tooltip'),
314559
314597
  },
314598
+ allowMentorSelection: {
314599
+ label: t('embedTabLabels.fields.allowMentorSelection.label'),
314600
+ tooltip: t('embedTabLabels.fields.allowMentorSelection.tooltip'),
314601
+ },
314560
314602
  shareableLink: {
314561
314603
  label: t('embedTabLabels.fields.shareableLink.label'),
314562
314604
  tooltip: t('embedTabLabels.fields.shareableLink.tooltip'),
@@ -314693,7 +314735,7 @@ function AgentEmbedTab({ labels: labelsProp, urls, CopyCodeBlock, visibilityOpti
314693
314735
  useEffect(() => {
314694
314736
  setShareableToken(shareableTokenData);
314695
314737
  }, [shareableTokenData]);
314696
- const { form, createTokenHandler, createTokenError, setCreateTokenError, isCreateTokenLoading, redirectTokenData, embedCode, setEmbedCode, customFloatingBubbleConfig, handleFloatingBubbleImageError, focusEditCustomFloatingBubble, setFocusEditCustomFloatingBubble, updateConfig, updateMultipleConfig, syncEmbedSettings, } = useEmbedTab(urls);
314738
+ const { allowMentorSelection, setAllowMentorSelection, form, createTokenHandler, createTokenError, setCreateTokenError, isCreateTokenLoading, redirectTokenData, embedCode, setEmbedCode, customFloatingBubbleConfig, handleFloatingBubbleImageError, focusEditCustomFloatingBubble, setFocusEditCustomFloatingBubble, updateConfig, updateMultipleConfig, syncEmbedSettings, } = useEmbedTab(urls);
314697
314739
  const { data: mentorSettings, isLoading: isLoadingSettings } = useGetMentorSettingsQuery(
314698
314740
  // @ts-expect-error userId is not part of useGetMentorSettingsQuery Query definition
314699
314741
  { mentor: mentorId, org: tenantKey, userId: username !== null && username !== void 0 ? username : '' }, { skip: !username || !mentorId || !tenantKey });
@@ -314960,7 +315002,9 @@ function AgentEmbedTab({ labels: labelsProp, urls, CopyCodeBlock, visibilityOpti
314960
315002
  ? t('tabsEmbedTab.showVoiceCallEnabled')
314961
315003
  : t('tabsEmbedTab.showVoiceCallDisabled') })] })) }), jsx(form.Field, { name: "embed_show_voice_record", children: (field) => (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.showVoiceRecord.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('tabsEmbedTab.moreInfoShowVoiceRecord'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.showVoiceRecord.tooltip }) })] }) })] }), jsx(CustomSwitch, { checked: field.state.value, onCheckedChange: (checked) => field.handleChange(checked), disabled: form.state.isSubmitting, "aria-label": field.state.value
314962
315004
  ? t('tabsEmbedTab.showVoiceRecordEnabled')
314963
- : t('tabsEmbedTab.showVoiceRecordDisabled') })] })) }), jsx("hr", { className: "my-4 border-t border-gray-200" }), jsx(form.Field, { name: "generateShareableLink", children: (field) => (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.shareableLink.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('tabsEmbedTab.moreInfoShareableLink'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.shareableLink.tooltip }) })] }) })] }), isLoadingShareableLink ? (jsx(Spinner, {})) : (jsxs("div", { className: "flex", children: [jsx(RefreshCw, { onClick: handleRegenerateToken, className: "mr-2 cursor-pointer text-[#646464]" }), jsx(CustomSwitch, { checked: shareableToken && shareableToken.enabled, onCheckedChange: (checked) => handleShareableTokenToggle(checked), "aria-label": field.state.value
315005
+ : t('tabsEmbedTab.showVoiceRecordDisabled') })] })) }), jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.allowMentorSelection.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('tabsEmbedTab.moreInfoAllowMentorSelection'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.allowMentorSelection.tooltip }) })] }) })] }), jsx(CustomSwitch, { "data-testid": "embed-allow-mentor-selection-switch", checked: allowMentorSelection, onCheckedChange: setAllowMentorSelection, disabled: form.state.isSubmitting, "aria-label": allowMentorSelection
315006
+ ? t('tabsEmbedTab.allowMentorSelectionEnabled')
315007
+ : t('tabsEmbedTab.allowMentorSelectionDisabled') })] }), jsx("hr", { className: "my-4 border-t border-gray-200" }), jsx(form.Field, { name: "generateShareableLink", children: (field) => (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.shareableLink.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('tabsEmbedTab.moreInfoShareableLink'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.shareableLink.tooltip }) })] }) })] }), isLoadingShareableLink ? (jsx(Spinner, {})) : (jsxs("div", { className: "flex", children: [jsx(RefreshCw, { onClick: handleRegenerateToken, className: "mr-2 cursor-pointer text-[#646464]" }), jsx(CustomSwitch, { checked: shareableToken && shareableToken.enabled, onCheckedChange: (checked) => handleShareableTokenToggle(checked), "aria-label": field.state.value
314964
315008
  ? t('tabsEmbedTab.shareableLinkEnabled')
314965
315009
  : t('tabsEmbedTab.shareableLinkDisabled') })] }))] })) }), jsx("div", { children: shareableToken && (jsx("div", { className: "mb-4 w-full lg:w-[500px]", children: jsx(CopyCodeBlock, { code: `${window.location.origin}?mentor=${mentorId}&tenant=${tenantKey}&token=${shareableToken.token}` }) })) })] }), jsx("div", { className: "h-[75vh] overflow-hidden rounded-lg border bg-gray-50", children: jsx(form.Subscribe, { selector: (formState) => [formState.values.mode], children: ([mode]) => (jsx("iframe", { id: "embed-mentor-preview", title: "embed-mentor-preview", src: `${window.location.origin}${urls.getMentorPageUrl ? urls.getMentorPageUrl(tenantKey, mentorId) : `/platform/${tenantKey}/${mentorId}`}`, style: {
314966
315010
  height: '100%',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/iblai-js",
3
- "version": "2.33.3",
3
+ "version": "2.34.0",
4
4
  "description": "Unified JavaScript SDK for IBL.ai — re-exports data-layer, web-containers, and web-utils under a single package",
5
5
  "type": "module",
6
6
  "engines": {
@@ -78,7 +78,7 @@
78
78
  "winston": "3.19.0",
79
79
  "@iblai/data-layer": "1.29.2",
80
80
  "@iblai/mcp": "1.28.1",
81
- "@iblai/web-containers": "1.38.1",
81
+ "@iblai/web-containers": "1.39.0",
82
82
  "@iblai/web-utils": "2.6.1"
83
83
  },
84
84
  "peerDependencies": {