@aikaara/chat-sdk 1.3.3 → 1.4.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.
- package/dist/{AikaaraLinkButton-C1S7MfVT.mjs → AikaaraLinkButton--t5yyst9.mjs} +20 -17
- package/dist/AikaaraLinkButton-DtbxlRUu.cjs +25 -0
- package/dist/AikaaraPaymentLink-BlxQSATl.cjs +1 -0
- package/dist/AikaaraPaymentLink-BuQX9XAE.mjs +155 -0
- package/dist/{MountTenant-2hJqV0N7.cjs → MountTenant-DUSZye2K.cjs} +71 -71
- package/dist/{MountTenant-C33lxHLm.mjs → MountTenant-xtZIgPSM.mjs} +2574 -2545
- package/dist/cdn/aikaara-chat.iife.js +56 -56
- package/dist/headless.cjs +1 -1
- package/dist/headless.d.ts +28 -7
- package/dist/headless.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +28 -7
- package/dist/index.mjs +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +5 -3
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
- package/dist/AikaaraLinkButton-VDNx7RfC.cjs +0 -25
package/dist/headless.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-DUSZye2K.cjs");class s extends e.EventEmitter{registration=null;pendingEdits=[];constructor(t){super(),this.setupListeners(t)}registerForm(t){this.registration=t;const i=this.pendingEdits.filter(r=>r.entity_type===t.entityType&&String(r.entity_id)===String(t.entityId));if(i.length>0){for(const r of i)t.onFieldUpdate(r.fields),this.emit("edit:applied",{entityType:r.entity_type,entityId:r.entity_id,fields:r.fields});this.pendingEdits=this.pendingEdits.filter(r=>!(r.entity_type===t.entityType&&String(r.entity_id)===String(t.entityId)))}}unregisterForm(t,i){this.registration?.entityType===t&&String(this.registration?.entityId)===String(i)&&(this.registration=null)}get currentForm(){return this.registration}pushFieldUpdates(t,i,r){this.registration&&this.registration.entityType===t&&String(this.registration.entityId)===String(i)?(this.registration.onFieldUpdate(r),this.emit("edit:applied",{entityType:t,entityId:i,fields:r})):(this.pendingEdits.push({action:"edit_entity",entity_type:t,entity_id:i,fields:r}),this.emit("edit:pending",{entityType:t,entityId:i,fields:r}))}async requestSave(){if(!this.registration)return{success:!1,error:"No form registered"};try{return await this.registration.onSave(),this.emit("save:success",{entityType:this.registration.entityType,entityId:this.registration.entityId}),{success:!0}}catch(t){const i=t instanceof Error?t.message:"Save failed";return this.emit("save:error",{entityType:this.registration.entityType,entityId:this.registration.entityId,error:i}),{success:!1,error:i}}}async requestTest(t){if(!this.registration?.onTest)return{success:!1,error:"Current form does not support testing"};try{return await this.registration.onTest(t),{success:!0}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Test failed"}}}setupListeners(t){t.on("action:edit_entity",i=>{this.pushFieldUpdates(i.entity_type,i.entity_id,i.fields)}),t.on("action:save_entity",i=>{this.requestSave()}),t.on("action:test_tool",i=>{this.emit("test:triggered",{toolId:i.tool_id,parameters:i.parameters}),this.requestTest(i.parameters)})}}exports.ActionCableClient=e.ActionCableClient;exports.AikaaraChatClient=e.AikaaraChatClient;exports.ApiClient=e.ApiClient;exports.ChannelSubscription=e.ChannelSubscription;exports.ConnectionManager=e.ConnectionManager;exports.ConversationManager=e.ConversationManager;exports.EventEmitter=e.EventEmitter;exports.MessageStore=e.MessageStore;exports.SessionAuthAdapter=e.SessionAuthAdapter;exports.SsoExchangeAdapter=e.SsoExchangeAdapter;exports.TiledeskTransport=e.TiledeskTransport;exports.TokenDiscoveryError=e.TokenDiscoveryError;exports.TokenDiscoveryReader=e.TokenDiscoveryReader;exports.clearPersistedConversationId=e.clearPersistedConversationId;exports.collectSsoCredentials=e.collectSsoCredentials;exports.createFetchUploadAdapter=e.createFetchUploadAdapter;exports.createPresigned3StepUploadAdapter=e.createPresigned3StepUploadAdapter;exports.createTiledeskHistoryAdapter=e.createTiledeskHistoryAdapter;exports.discoverToken=e.discoverToken;exports.extractTiledeskFileEnvelope=e.extractTiledeskFileEnvelope;exports.inferTiledeskRole=e.inferTiledeskRole;exports.isTiledeskSelfEcho=e.isTiledeskSelfEcho;exports.mountFromSlug=e.mountFromSlug;exports.mountTenantWidget=e.mount;exports.parseTiledeskTemplate=e.parseTiledeskTemplate;exports.runMethodSelectPreflight=e.runMethodSelectPreflight;exports.FormBridge=s;
|
package/dist/headless.d.ts
CHANGED
|
@@ -481,7 +481,7 @@ declare interface ChatEvents_2 {
|
|
|
481
481
|
};
|
|
482
482
|
}
|
|
483
483
|
|
|
484
|
-
export declare function clearPersistedConversationId(userId: string, projectId: string): void;
|
|
484
|
+
export declare function clearPersistedConversationId(userId: string, projectId: string, scope?: string): void;
|
|
485
485
|
|
|
486
486
|
/** Read every credential listed in `spec`. Throws on missing required. */
|
|
487
487
|
export declare function collectSsoCredentials(opts: SsoCollectorOptions): Promise<Record<string, string>>;
|
|
@@ -837,9 +837,11 @@ export declare function isTiledeskSelfEcho(message: TiledeskMessage, userId: str
|
|
|
837
837
|
export declare interface LinkHandler {
|
|
838
838
|
/** Glob pattern matched against the clicked URL. */
|
|
839
839
|
match: string;
|
|
840
|
-
/** What to do on match. `tab` opens in new tab, `
|
|
841
|
-
*
|
|
842
|
-
|
|
840
|
+
/** What to do on match. `tab` opens in new tab, `popup` opens a centered
|
|
841
|
+
* popup window (auto-closes on `window.opener.postMessage`), `iframe` uses
|
|
842
|
+
* default modal, `fetch-render` fetches data and mounts `render` inside the
|
|
843
|
+
* modal. */
|
|
844
|
+
target?: 'tab' | 'popup' | 'iframe' | 'fetch-render';
|
|
843
845
|
/** Modal title when `target` involves the modal. Default: link text. */
|
|
844
846
|
title?: string;
|
|
845
847
|
/** Fetch config (only used with `target: "fetch-render"`). */
|
|
@@ -1510,6 +1512,14 @@ export declare interface SlugMountOptions {
|
|
|
1510
1512
|
configBase?: string;
|
|
1511
1513
|
/** Additional headers for the descriptor fetch. */
|
|
1512
1514
|
configHeaders?: Record<string, string>;
|
|
1515
|
+
/**
|
|
1516
|
+
* Isolates the persisted chat thread under `{userId}:{projectId}:{scope}`.
|
|
1517
|
+
* Pass the active PAN (or any per-context discriminator) so a user filing
|
|
1518
|
+
* for multiple PANs gets a distinct conversation per PAN instead of one
|
|
1519
|
+
* shared thread. Re-mounting with a different scope loads/creates that
|
|
1520
|
+
* scope's own conversation.
|
|
1521
|
+
*/
|
|
1522
|
+
conversationScope?: string;
|
|
1513
1523
|
user: {
|
|
1514
1524
|
/**
|
|
1515
1525
|
* Initial identifier. When `descriptor.sso` is configured, the
|
|
@@ -1777,6 +1787,13 @@ export declare interface TenantMountOptions {
|
|
|
1777
1787
|
*/
|
|
1778
1788
|
conversationId?: string;
|
|
1779
1789
|
forceNewConversation?: boolean;
|
|
1790
|
+
/**
|
|
1791
|
+
* Isolates the persisted conversation under `{userId}:{projectId}:{scope}`.
|
|
1792
|
+
* Use when one user + project maps to several logically distinct threads —
|
|
1793
|
+
* e.g. a taxbuddy user filing for multiple PANs, where each PAN must keep
|
|
1794
|
+
* its own chat. Omit for the default single-thread-per-user behaviour.
|
|
1795
|
+
*/
|
|
1796
|
+
conversationScope?: string;
|
|
1780
1797
|
/** Per-mount overrides that take precedence over the descriptor. */
|
|
1781
1798
|
overrides?: Partial<WidgetConfigDescriptor>;
|
|
1782
1799
|
/** Surfaced from the SDK. */
|
|
@@ -2666,9 +2683,10 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2666
2683
|
* Razorpay Checkout config consumed by the `payment_link` IIFE template.
|
|
2667
2684
|
* `keyId` is the publishable key (safe to expose). `preferredBanksUrl`
|
|
2668
2685
|
* (optional) is a tenant endpoint that returns the list of allowed
|
|
2669
|
-
* netbanking codes for an order, called as
|
|
2670
|
-
* the chat JWT as Bearer;
|
|
2671
|
-
* netbanking with those
|
|
2686
|
+
* netbanking codes for an order, called as `<method> <url>?orderId=<id>`
|
|
2687
|
+
* (default GET; see `preferredBanksMethod`) with the chat JWT as Bearer;
|
|
2688
|
+
* when present the Razorpay UI is restricted to netbanking with those
|
|
2689
|
+
* banks.
|
|
2672
2690
|
*/
|
|
2673
2691
|
razorpay?: {
|
|
2674
2692
|
keyId?: string;
|
|
@@ -2676,6 +2694,9 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2676
2694
|
name?: string;
|
|
2677
2695
|
/** Endpoint template; `{orderId}` is substituted, else appended as `?orderId=`. */
|
|
2678
2696
|
preferredBanksUrl?: string;
|
|
2697
|
+
/** HTTP verb for the preferred-banks call. Default GET; POST also sends
|
|
2698
|
+
* `{ orderId }` as a JSON body. */
|
|
2699
|
+
preferredBanksMethod?: 'GET' | 'POST';
|
|
2679
2700
|
};
|
|
2680
2701
|
/**
|
|
2681
2702
|
* Native-login config consumed by the hosted-shell's `LoginScreen`
|
package/dist/headless.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as s } from "./MountTenant-
|
|
2
|
-
import { A as p, b as l, k as g, C as c, l as h, m as y, M as u, S as m, n as f, T, o as S, p as _, q as v, s as E, t as C, u as F, v as k, w as A, x as I, y as x, z as U, B as q, D as M, F as b, G as w } from "./MountTenant-
|
|
1
|
+
import { E as s } from "./MountTenant-xtZIgPSM.mjs";
|
|
2
|
+
import { A as p, b as l, k as g, C as c, l as h, m as y, M as u, S as m, n as f, T, o as S, p as _, q as v, s as E, t as C, u as F, v as k, w as A, x as I, y as x, z as U, B as q, D as M, F as b, G as w } from "./MountTenant-xtZIgPSM.mjs";
|
|
3
3
|
class a extends s {
|
|
4
4
|
registration = null;
|
|
5
5
|
pendingEdits = [];
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-DUSZye2K.cjs"),s=require("./headless.cjs");function l(a){e.registerComponents();const t=document.createElement("aikaara-chat-widget"),i={baseUrl:"base-url",userToken:"user-token",apiKey:"api-key",title:"title",subtitle:"subtitle",theme:"theme",primaryColor:"primary-color",position:"position",width:"width",height:"height",placeholder:"placeholder",welcomeMessage:"welcome-message",avatarUrl:"avatar-url"};for(const[o,n]of Object.entries(i)){const r=a[o];r!=null&&t.setAttribute(n,String(r))}return t.configure(a),document.body.appendChild(t),t}function d(){const a=document.querySelector("aikaara-chat-widget");a&&a.remove()}exports.ActionCableClient=e.ActionCableClient;exports.AikaaraChatBubble=e.AikaaraChatBubble;exports.AikaaraChatClient=e.AikaaraChatClient;exports.AikaaraChatHeader=e.AikaaraChatHeader;exports.AikaaraChatInput=e.AikaaraChatInput;exports.AikaaraChatWidget=e.AikaaraChatWidget;exports.AikaaraErrorBanner=e.AikaaraErrorBanner;exports.AikaaraMessageBubble=e.AikaaraMessageBubble;exports.AikaaraMessageList=e.AikaaraMessageList;exports.AikaaraStreamingMessage=e.AikaaraStreamingMessage;exports.AikaaraTypingIndicator=e.AikaaraTypingIndicator;exports.ApiClient=e.ApiClient;exports.ChannelSubscription=e.ChannelSubscription;exports.ConnectionManager=e.ConnectionManager;exports.ConversationManager=e.ConversationManager;exports.EventEmitter=e.EventEmitter;exports.MessageStore=e.MessageStore;exports.SessionAuthAdapter=e.SessionAuthAdapter;exports.SsoExchangeAdapter=e.SsoExchangeAdapter;exports.TiledeskTransport=e.TiledeskTransport;exports.TokenDiscoveryError=e.TokenDiscoveryError;exports.TokenDiscoveryReader=e.TokenDiscoveryReader;exports.clearPersistedConversationId=e.clearPersistedConversationId;exports.collectSsoCredentials=e.collectSsoCredentials;exports.createFetchUploadAdapter=e.createFetchUploadAdapter;exports.createPresigned3StepUploadAdapter=e.createPresigned3StepUploadAdapter;exports.createTiledeskHistoryAdapter=e.createTiledeskHistoryAdapter;exports.discoverToken=e.discoverToken;exports.extractTiledeskFileEnvelope=e.extractTiledeskFileEnvelope;exports.inferTiledeskRole=e.inferTiledeskRole;exports.isTiledeskSelfEcho=e.isTiledeskSelfEcho;exports.mountFromSlug=e.mountFromSlug;exports.mountTenantWidget=e.mount;exports.parseTiledeskTemplate=e.parseTiledeskTemplate;exports.registerComponents=e.registerComponents;exports.runMethodSelectPreflight=e.runMethodSelectPreflight;exports.FormBridge=s.FormBridge;exports.mount=l;exports.unmount=d;
|
package/dist/index.d.ts
CHANGED
|
@@ -476,7 +476,7 @@ export declare interface ChatEvents {
|
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
-
export declare function clearPersistedConversationId(userId: string, projectId: string): void;
|
|
479
|
+
export declare function clearPersistedConversationId(userId: string, projectId: string, scope?: string): void;
|
|
480
480
|
|
|
481
481
|
/** Read every credential listed in `spec`. Throws on missing required. */
|
|
482
482
|
export declare function collectSsoCredentials(opts: SsoCollectorOptions): Promise<Record<string, string>>;
|
|
@@ -786,9 +786,11 @@ export declare function isTiledeskSelfEcho(message: TiledeskMessage, userId: str
|
|
|
786
786
|
export declare interface LinkHandler {
|
|
787
787
|
/** Glob pattern matched against the clicked URL. */
|
|
788
788
|
match: string;
|
|
789
|
-
/** What to do on match. `tab` opens in new tab, `
|
|
790
|
-
*
|
|
791
|
-
|
|
789
|
+
/** What to do on match. `tab` opens in new tab, `popup` opens a centered
|
|
790
|
+
* popup window (auto-closes on `window.opener.postMessage`), `iframe` uses
|
|
791
|
+
* default modal, `fetch-render` fetches data and mounts `render` inside the
|
|
792
|
+
* modal. */
|
|
793
|
+
target?: 'tab' | 'popup' | 'iframe' | 'fetch-render';
|
|
792
794
|
/** Modal title when `target` involves the modal. Default: link text. */
|
|
793
795
|
title?: string;
|
|
794
796
|
/** Fetch config (only used with `target: "fetch-render"`). */
|
|
@@ -1429,6 +1431,14 @@ export declare interface SlugMountOptions {
|
|
|
1429
1431
|
configBase?: string;
|
|
1430
1432
|
/** Additional headers for the descriptor fetch. */
|
|
1431
1433
|
configHeaders?: Record<string, string>;
|
|
1434
|
+
/**
|
|
1435
|
+
* Isolates the persisted chat thread under `{userId}:{projectId}:{scope}`.
|
|
1436
|
+
* Pass the active PAN (or any per-context discriminator) so a user filing
|
|
1437
|
+
* for multiple PANs gets a distinct conversation per PAN instead of one
|
|
1438
|
+
* shared thread. Re-mounting with a different scope loads/creates that
|
|
1439
|
+
* scope's own conversation.
|
|
1440
|
+
*/
|
|
1441
|
+
conversationScope?: string;
|
|
1432
1442
|
user: {
|
|
1433
1443
|
/**
|
|
1434
1444
|
* Initial identifier. When `descriptor.sso` is configured, the
|
|
@@ -1685,6 +1695,13 @@ export declare interface TenantMountOptions {
|
|
|
1685
1695
|
*/
|
|
1686
1696
|
conversationId?: string;
|
|
1687
1697
|
forceNewConversation?: boolean;
|
|
1698
|
+
/**
|
|
1699
|
+
* Isolates the persisted conversation under `{userId}:{projectId}:{scope}`.
|
|
1700
|
+
* Use when one user + project maps to several logically distinct threads —
|
|
1701
|
+
* e.g. a taxbuddy user filing for multiple PANs, where each PAN must keep
|
|
1702
|
+
* its own chat. Omit for the default single-thread-per-user behaviour.
|
|
1703
|
+
*/
|
|
1704
|
+
conversationScope?: string;
|
|
1688
1705
|
/** Per-mount overrides that take precedence over the descriptor. */
|
|
1689
1706
|
overrides?: Partial<WidgetConfigDescriptor>;
|
|
1690
1707
|
/** Surfaced from the SDK. */
|
|
@@ -2439,9 +2456,10 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2439
2456
|
* Razorpay Checkout config consumed by the `payment_link` IIFE template.
|
|
2440
2457
|
* `keyId` is the publishable key (safe to expose). `preferredBanksUrl`
|
|
2441
2458
|
* (optional) is a tenant endpoint that returns the list of allowed
|
|
2442
|
-
* netbanking codes for an order, called as
|
|
2443
|
-
* the chat JWT as Bearer;
|
|
2444
|
-
* netbanking with those
|
|
2459
|
+
* netbanking codes for an order, called as `<method> <url>?orderId=<id>`
|
|
2460
|
+
* (default GET; see `preferredBanksMethod`) with the chat JWT as Bearer;
|
|
2461
|
+
* when present the Razorpay UI is restricted to netbanking with those
|
|
2462
|
+
* banks.
|
|
2445
2463
|
*/
|
|
2446
2464
|
razorpay?: {
|
|
2447
2465
|
keyId?: string;
|
|
@@ -2449,6 +2467,9 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2449
2467
|
name?: string;
|
|
2450
2468
|
/** Endpoint template; `{orderId}` is substituted, else appended as `?orderId=`. */
|
|
2451
2469
|
preferredBanksUrl?: string;
|
|
2470
|
+
/** HTTP verb for the preferred-banks call. Default GET; POST also sends
|
|
2471
|
+
* `{ orderId }` as a JSON body. */
|
|
2472
|
+
preferredBanksMethod?: 'GET' | 'POST';
|
|
2452
2473
|
};
|
|
2453
2474
|
/**
|
|
2454
2475
|
* Native-login config consumed by the hosted-shell's `LoginScreen`
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as o } from "./MountTenant-
|
|
2
|
-
import { A as u, a as m, b as g, c as h, d as k, e as A, f as C, g as T, h as b, i as f, j as v, k as S, C as y, l as M, m as w, E, M as x, S as B, n as F, T as U, o as D, p as I, q as P, s as j, t as q, u as H, v as R, w as W, x as z, y as G, z as K, B as L, D as O, F as J, G as N } from "./MountTenant-
|
|
1
|
+
import { r as o } from "./MountTenant-xtZIgPSM.mjs";
|
|
2
|
+
import { A as u, a as m, b as g, c as h, d as k, e as A, f as C, g as T, h as b, i as f, j as v, k as S, C as y, l as M, m as w, E, M as x, S as B, n as F, T as U, o as D, p as I, q as P, s as j, t as q, u as H, v as R, w as W, x as z, y as G, z as K, B as L, D as O, F as J, G as N } from "./MountTenant-xtZIgPSM.mjs";
|
|
3
3
|
import { FormBridge as V } from "./headless.mjs";
|
|
4
4
|
function l(e) {
|
|
5
5
|
o();
|
package/dist/ui.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./MountTenant-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./MountTenant-DUSZye2K.cjs");exports.AikaaraChat=a.AikaaraChat;exports.AikaaraChatBubble=a.AikaaraChatBubble;exports.AikaaraChatHeader=a.AikaaraChatHeader;exports.AikaaraChatInput=a.AikaaraChatInput;exports.AikaaraChatWidget=a.AikaaraChatWidget;exports.AikaaraComparePlans=a.AikaaraComparePlans;exports.AikaaraErrorBanner=a.AikaaraErrorBanner;exports.AikaaraLinkModal=a.AikaaraLinkModal;exports.AikaaraMessageBubble=a.AikaaraMessageBubble;exports.AikaaraMessageList=a.AikaaraMessageList;exports.AikaaraModalAction=a.AikaaraModalAction;exports.AikaaraOptionList=a.AikaaraOptionList;exports.AikaaraSchemaForm=a.AikaaraSchemaForm;exports.AikaaraSmartEditModal=a.AikaaraSmartEditModal;exports.AikaaraStreamingMessage=a.AikaaraStreamingMessage;exports.AikaaraSubmitAction=a.AikaaraSubmitAction;exports.AikaaraSystemPill=a.AikaaraSystemPill;exports.AikaaraTemplateRenderer=a.AikaaraTemplateRenderer;exports.AikaaraTypingIndicator=a.AikaaraTypingIndicator;exports.registerComponents=a.registerComponents;
|
package/dist/ui.d.ts
CHANGED
|
@@ -835,9 +835,11 @@ declare interface GroupField extends BaseField {
|
|
|
835
835
|
declare interface LinkHandler {
|
|
836
836
|
/** Glob pattern matched against the clicked URL. */
|
|
837
837
|
match: string;
|
|
838
|
-
/** What to do on match. `tab` opens in new tab, `
|
|
839
|
-
*
|
|
840
|
-
|
|
838
|
+
/** What to do on match. `tab` opens in new tab, `popup` opens a centered
|
|
839
|
+
* popup window (auto-closes on `window.opener.postMessage`), `iframe` uses
|
|
840
|
+
* default modal, `fetch-render` fetches data and mounts `render` inside the
|
|
841
|
+
* modal. */
|
|
842
|
+
target?: 'tab' | 'popup' | 'iframe' | 'fetch-render';
|
|
841
843
|
/** Modal title when `target` involves the modal. Default: link text. */
|
|
842
844
|
title?: string;
|
|
843
845
|
/** Fetch config (only used with `target: "fetch-render"`). */
|
package/dist/ui.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as i, a as s, c as e, d as t, e as A, J as k, f as n, K as o, g as m, h as d, L as l, N as g, O as h, P as p, i as C, Q as M, R as b, U as c, j as S, r as u } from "./MountTenant-xtZIgPSM.mjs";
|
|
2
2
|
export {
|
|
3
3
|
i as AikaaraChat,
|
|
4
4
|
s as AikaaraChatBubble,
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class d extends HTMLElement{shadow;payload=null;constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.render()}setPayload(e){this.payload=e,this.render()}render(){const e=this.payload;this.shadow.innerHTML=`
|
|
2
|
-
<style>
|
|
3
|
-
:host { display: block; margin-top: 8px; }
|
|
4
|
-
button {
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
gap: 6px;
|
|
8
|
-
padding: 10px 16px;
|
|
9
|
-
background: var(--aikaara-primary, #0f2e5c);
|
|
10
|
-
color: var(--aikaara-primary-contrast, #fff);
|
|
11
|
-
border: none;
|
|
12
|
-
border-radius: var(--aikaara-button-radius, 8px);
|
|
13
|
-
font-family: var(--aikaara-font, system-ui);
|
|
14
|
-
font-size: 14px;
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
}
|
|
18
|
-
button:hover { background: var(--aikaara-primary-hover, #0a2347); }
|
|
19
|
-
button[disabled] { opacity: 0.5; cursor: not-allowed; }
|
|
20
|
-
</style>
|
|
21
|
-
<button type="button" ${e?"":"disabled"}>
|
|
22
|
-
${c(e?.name??"Open")}
|
|
23
|
-
<span aria-hidden="true">↗</span>
|
|
24
|
-
</button>
|
|
25
|
-
`,this.shadow.querySelector("button")?.addEventListener("click",()=>this.handleClick())}handleClick(){if(!this.payload)return;const{url:e,name:a,openLinkInNewTab:o,orderId:r,extra:i,messageId:n}=this.payload,s=o?"tab":"modal",l=new CustomEvent("aikaara-link-action",{detail:{url:e,name:a,orderId:r,openedIn:s,extra:i,messageId:n},bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(l))if(o)window.open(e,"_blank","noopener,noreferrer");else{const u=p();requestAnimationFrame(()=>u?.show?.(e,a))}this.dispatchEvent(new CustomEvent("template-action",{detail:{text:a,attributes:{action:{type:"link",url:e,orderId:r,openedIn:s,...i??{}},...n?{message_id:n}:{}}},bubbles:!0,composed:!0}))}}function c(t){return t.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function p(){if(typeof document>"u")return null;let t=document.querySelector("aikaara-link-modal");if(!t){const e=document.createElement("aikaara-link-modal");document.body.appendChild(e),t=e}return t}function m(){typeof customElements>"u"||customElements.get("aikaara-link-button")||customElements.define("aikaara-link-button",d)}exports.AikaaraLinkButton=d;exports.registerAikaaraLinkButton=m;
|