isometrik-plugin-chat-sdk 1.0.0 → 1.0.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.
- package/dist/cjs/{MessageSearch-5fc9dc00.js → MessageSearch-f5b72462.js} +2 -2
- package/dist/cjs/{MessageSearch-5fc9dc00.js.map → MessageSearch-f5b72462.js.map} +1 -1
- package/dist/cjs/{WebChat-403e7ab1.js → WebChat-2329244b.js} +33 -23
- package/dist/cjs/WebChat-2329244b.js.map +1 -0
- package/dist/cjs/audio-bubble_8.cjs.entry.js +2 -2
- package/dist/cjs/chat-app.cjs.entry.js +3 -3
- package/dist/cjs/chat-creds-7ddd5f40.js +27 -0
- package/dist/cjs/chat-creds-7ddd5f40.js.map +1 -0
- package/dist/cjs/login-page.cjs.entry.js +1 -1
- package/dist/cjs/signup-page.cjs.entry.js +1 -1
- package/dist/cjs/theme-provider_2.cjs.entry.js +3 -3
- package/dist/collection/components/my-component/web-chat/WebChat.js +30 -20
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/constants/chat-creds.js +18 -29
- package/dist/esm/{MessageSearch-4101a627.js → MessageSearch-4010486c.js} +2 -2
- package/dist/esm/{MessageSearch-4101a627.js.map → MessageSearch-4010486c.js.map} +1 -1
- package/dist/esm/{WebChat-5448d615.js → WebChat-95518d72.js} +33 -23
- package/dist/esm/WebChat-95518d72.js.map +1 -0
- package/dist/esm/audio-bubble_8.entry.js +3 -3
- package/dist/esm/chat-app.entry.js +3 -3
- package/dist/esm/chat-creds-99dd8834.js +24 -0
- package/dist/esm/chat-creds-99dd8834.js.map +1 -0
- package/dist/esm/login-page.entry.js +1 -1
- package/dist/esm/signup-page.entry.js +1 -1
- package/dist/esm/theme-provider_2.entry.js +3 -3
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/{p-bfd51dd4.entry.js → p-35f143c9.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-8dcdea59.js → p-55355714.js} +2 -2
- package/dist/isometrik-webchat/{p-adbb398d.entry.js → p-675c105e.entry.js} +2 -2
- package/dist/isometrik-webchat/p-70f4360e.js +2 -0
- package/dist/isometrik-webchat/p-70f4360e.js.map +1 -0
- package/dist/isometrik-webchat/{p-48e243ec.entry.js → p-72a0b844.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-89108249.entry.js → p-d7e335cb.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-bf0aeb22.entry.js → p-e36db3f6.entry.js} +2 -2
- package/dist/isometrik-webchat/p-e954c29f.js +591 -0
- package/dist/isometrik-webchat/p-e954c29f.js.map +1 -0
- package/package.json +1 -1
- package/readme.md +5 -5
- package/dist/cjs/WebChat-403e7ab1.js.map +0 -1
- package/dist/cjs/chat-creds-f4cbf400.js +0 -38
- package/dist/cjs/chat-creds-f4cbf400.js.map +0 -1
- package/dist/esm/WebChat-5448d615.js.map +0 -1
- package/dist/esm/chat-creds-ff086f05.js +0 -35
- package/dist/esm/chat-creds-ff086f05.js.map +0 -1
- package/dist/isometrik-webchat/p-12774661.js +0 -2
- package/dist/isometrik-webchat/p-12774661.js.map +0 -1
- package/dist/isometrik-webchat/p-e09b32eb.js +0 -591
- package/dist/isometrik-webchat/p-e09b32eb.js.map +0 -1
- /package/dist/isometrik-webchat/{p-bfd51dd4.entry.js.map → p-35f143c9.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-8dcdea59.js.map → p-55355714.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-adbb398d.entry.js.map → p-675c105e.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-48e243ec.entry.js.map → p-72a0b844.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-89108249.entry.js.map → p-d7e335cb.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-bf0aeb22.entry.js.map → p-e36db3f6.entry.js.map} +0 -0
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index-9afe62b6.js');
|
|
4
4
|
const Image = require('./Image-67c52acd.js');
|
|
5
|
-
const chatCreds = require('./chat-creds-
|
|
5
|
+
const chatCreds = require('./chat-creds-7ddd5f40.js');
|
|
6
6
|
const dialogDrawer = require('./dialog-drawer-9d04911c.js');
|
|
7
7
|
const groupMembers = require('./group-members-a60fb1cb.js');
|
|
8
8
|
const toastHelper = require('./toast-helper-defae4a5.js');
|
|
9
|
-
const MessageSearch = require('./MessageSearch-
|
|
9
|
+
const MessageSearch = require('./MessageSearch-f5b72462.js');
|
|
10
10
|
const content = require('./content-eca5336c.js');
|
|
11
11
|
const groupcast = require('./groupcast-49dae5ab.js');
|
|
12
12
|
|
|
@@ -930,9 +930,29 @@ const WebChat = class {
|
|
|
930
930
|
if (parts.length === 2)
|
|
931
931
|
return parts.pop().split(';').shift();
|
|
932
932
|
};
|
|
933
|
-
//
|
|
934
|
-
this.userTokenFromCookie =
|
|
935
|
-
this.isometrikUserIdFromCookie =
|
|
933
|
+
// Filled from parent <web-chat> props in applyParentCreds()
|
|
934
|
+
this.userTokenFromCookie = '';
|
|
935
|
+
this.isometrikUserIdFromCookie = '';
|
|
936
|
+
/** Copy parent props into CHAT_CREDS so API helpers use host values (no hardcode). */
|
|
937
|
+
this.applyParentCreds = () => {
|
|
938
|
+
var _a;
|
|
939
|
+
const pick = (prop, fallback = '') => typeof prop === 'string' && prop.trim() ? prop.trim() : fallback;
|
|
940
|
+
chatCreds.CHAT_CREDS.userToken = pick(this.userToken);
|
|
941
|
+
chatCreds.CHAT_CREDS.appSecret = pick(this.appSecret);
|
|
942
|
+
chatCreds.CHAT_CREDS.licenseKey = pick(this.licenseKey);
|
|
943
|
+
chatCreds.CHAT_CREDS.userSecret = pick(this.userSecret);
|
|
944
|
+
chatCreds.CHAT_CREDS.accountId = pick(this.accountId);
|
|
945
|
+
chatCreds.CHAT_CREDS.keysetId = pick(this.keysetId);
|
|
946
|
+
chatCreds.CHAT_CREDS.projectId = pick(this.projectId);
|
|
947
|
+
chatCreds.CHAT_CREDS.isometrikUserId = pick(this.isometrikUserId);
|
|
948
|
+
chatCreds.CHAT_CREDS.baseUrl = pick(this.baseUrl, chatCreds.CHAT_CREDS.baseUrl || 'https://apis.isometrik.ai');
|
|
949
|
+
chatCreds.CHAT_CREDS.socialRedirectUrl = pick(this.socialRedirectUrl);
|
|
950
|
+
if ((_a = this.hostUrl) === null || _a === void 0 ? void 0 : _a.trim()) {
|
|
951
|
+
chatCreds.MQTT_CREDS.URL = this.hostUrl.trim();
|
|
952
|
+
}
|
|
953
|
+
this.userTokenFromCookie = chatCreds.CHAT_CREDS.userToken;
|
|
954
|
+
this.isometrikUserIdFromCookie = chatCreds.CHAT_CREDS.isometrikUserId;
|
|
955
|
+
};
|
|
936
956
|
this.clearConversationState = () => {
|
|
937
957
|
this.allConversationList = [];
|
|
938
958
|
this.selectedConversationId = null;
|
|
@@ -1612,11 +1632,7 @@ const WebChat = class {
|
|
|
1612
1632
|
this.isMobileView = window.innerWidth <= 768;
|
|
1613
1633
|
}
|
|
1614
1634
|
componentWillLoad() {
|
|
1615
|
-
|
|
1616
|
-
// Instagram OAuth return URL — host page where accounts are linked
|
|
1617
|
-
if ((_a = this.socialRedirectUrl) === null || _a === void 0 ? void 0 : _a.trim()) {
|
|
1618
|
-
chatCreds.CHAT_CREDS.socialRedirectUrl = this.socialRedirectUrl.trim();
|
|
1619
|
-
}
|
|
1635
|
+
this.applyParentCreds();
|
|
1620
1636
|
// OAuth popup return: notify opener ASAP and close (skip full chat boot)
|
|
1621
1637
|
if (MessageSearch.notifyOpenerIfSocialPopupCallback())
|
|
1622
1638
|
return;
|
|
@@ -1656,12 +1672,13 @@ const WebChat = class {
|
|
|
1656
1672
|
// Initialize SDK
|
|
1657
1673
|
try {
|
|
1658
1674
|
this.updateLoading(25, 'Initializing chat SDK...');
|
|
1675
|
+
this.applyParentCreds();
|
|
1659
1676
|
Image.M.initializeInstance({
|
|
1660
1677
|
baseUrl: chatCreds.CHAT_CREDS.baseUrl,
|
|
1661
1678
|
licenseKey: chatCreds.CHAT_CREDS.licenseKey,
|
|
1662
1679
|
appSecret: chatCreds.CHAT_CREDS.appSecret,
|
|
1663
1680
|
userSecret: chatCreds.CHAT_CREDS.userSecret,
|
|
1664
|
-
userToken:
|
|
1681
|
+
userToken: chatCreds.CHAT_CREDS.userToken,
|
|
1665
1682
|
});
|
|
1666
1683
|
this.isInitialized = true;
|
|
1667
1684
|
}
|
|
@@ -1776,10 +1793,12 @@ const WebChat = class {
|
|
|
1776
1793
|
}
|
|
1777
1794
|
}
|
|
1778
1795
|
async setupMqttClient() {
|
|
1796
|
+
var _a;
|
|
1779
1797
|
// let retryToConnect:any = null;
|
|
1780
1798
|
const deviceID = await dialogDrawer.getDeviceID();
|
|
1799
|
+
this.applyParentCreds();
|
|
1781
1800
|
const mqttClient = Image.M.getInstance().initializeMqtt({
|
|
1782
|
-
hostUri: chatCreds.MQTT_CREDS.URL
|
|
1801
|
+
hostUri: ((_a = this.hostUrl) === null || _a === void 0 ? void 0 : _a.trim()) || chatCreds.MQTT_CREDS.URL,
|
|
1783
1802
|
clientId: chatCreds.CHAT_CREDS.isometrikUserId,
|
|
1784
1803
|
licenseKey: chatCreds.CHAT_CREDS.licenseKey,
|
|
1785
1804
|
projectId: chatCreds.CHAT_CREDS.projectId,
|
|
@@ -1787,15 +1806,6 @@ const WebChat = class {
|
|
|
1787
1806
|
accountId: chatCreds.CHAT_CREDS.accountId,
|
|
1788
1807
|
deviceId: deviceID,
|
|
1789
1808
|
});
|
|
1790
|
-
// const mqttClient = ChatSDK.getInstance().initializeMqtt({
|
|
1791
|
-
// hostUri: this.hostUrl,
|
|
1792
|
-
// clientId: this.isometrikUserId,
|
|
1793
|
-
// licenseKey: this.licenseKey,
|
|
1794
|
-
// projectId: this.projectId,
|
|
1795
|
-
// keysetId: this.keysetId,
|
|
1796
|
-
// accountId: this.accountId,
|
|
1797
|
-
// deviceId: deviceID,
|
|
1798
|
-
// });
|
|
1799
1809
|
this.mqttClient = mqttClient;
|
|
1800
1810
|
let refetchInterval = null;
|
|
1801
1811
|
this.isMqttConnected = false;
|
|
@@ -2817,7 +2827,7 @@ const WebChat = class {
|
|
|
2817
2827
|
}
|
|
2818
2828
|
render() {
|
|
2819
2829
|
var _a, _b, _c, _d, _e;
|
|
2820
|
-
return (index.h(index.Fragment, { key: '
|
|
2830
|
+
return (index.h(index.Fragment, { key: '120ba07af7eb93f1f6cbed603f6e25bfd48b0900' }, this.isLoading ? (index.h("chat-loading-placeholder", { progress: this.loadingProgress, loadingStatus: this.loadingStatus })) : (index.h(index.Fragment, null, this.isConversationLoading ? (index.h("div", { class: "loaderoverlay" }, index.h("spinner-loader", { height: "30px", width: "30px", spinTime: "1s", spinnerPrimaryColor: "var(--bg-primary-color)", spinnerSecondaryColor: "var(--text-primary-color)", spinnerBorderWidth: "2px" }))) : null, index.h("div", { class: {
|
|
2821
2831
|
'isometrik-quickchat': true,
|
|
2822
2832
|
'is-resizing': this.isResizingSidebar,
|
|
2823
2833
|
'is-instagram-gate': !this.isInstagramConnected,
|
|
@@ -2881,4 +2891,4 @@ WebChat.style = WebChatStyle0;
|
|
|
2881
2891
|
|
|
2882
2892
|
exports.WebChat = WebChat;
|
|
2883
2893
|
|
|
2884
|
-
//# sourceMappingURL=WebChat-
|
|
2894
|
+
//# sourceMappingURL=WebChat-2329244b.js.map
|