customer-chat-sdk 1.0.61 → 1.0.62
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/core/ScreenshotManager.d.ts +5 -0
- package/dist/core/ScreenshotManager.d.ts.map +1 -1
- package/dist/customer-sdk.cjs.js +85 -5
- package/dist/customer-sdk.esm.js +85 -6
- package/dist/customer-sdk.min.js +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -321,6 +321,11 @@ export declare class ScreenshotManager {
|
|
|
321
321
|
* 启用/禁用截图功能
|
|
322
322
|
*/
|
|
323
323
|
enable(enabled: boolean): void;
|
|
324
|
+
/**
|
|
325
|
+
* 更新截图配置(动态更新,无需重新初始化)
|
|
326
|
+
* @param newOptions 要更新的配置项(部分更新)
|
|
327
|
+
*/
|
|
328
|
+
updateOptions(newOptions: Partial<ScreenshotOptions>): void;
|
|
324
329
|
/**
|
|
325
330
|
* 清理资源
|
|
326
331
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenshotManager.d.ts","sourceRoot":"","sources":["../../src/core/ScreenshotManager.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAA;IACtC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAA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B;IAkChC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAYjC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IA8CzB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;YACW,2BAA2B;IAuFzC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,gCAAgC;IAwDxC;;;;;OAKG;IACH,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI;IACzD,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IACpD,uBAAuB,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,GAAG,IAAI;IAClE,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IACvE,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAwD1E;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAO9B;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI;IA+D3D;;OAEG;IACH,OAAO,IAAI,IAAI;IAoEf;;OAEG;IACH,OAAO,CAAC,cAAc;IAkBtB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAqCtB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAoBzB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAsBzB;;OAEG;IACH,QAAQ;;;;;;;;;CAWT"}
|
package/dist/customer-sdk.cjs.js
CHANGED
|
@@ -17146,11 +17146,8 @@ class ScreenshotManager {
|
|
|
17146
17146
|
const topicArray = new Uint8Array(buffer, offset, topicLength);
|
|
17147
17147
|
topicArray.set(topicBytes);
|
|
17148
17148
|
offset += topicLength;
|
|
17149
|
-
//
|
|
17150
|
-
|
|
17151
|
-
offset += 1;
|
|
17152
|
-
// routingKey: 8字节
|
|
17153
|
-
const routingKeyBytes = encoder.encode(config.routingKey);
|
|
17149
|
+
// routingKey:
|
|
17150
|
+
const routingKeyBytes = encoder.encode(config.routingKey.trim());
|
|
17154
17151
|
const routingKeyLength = routingKeyBytes.length;
|
|
17155
17152
|
// routingKeyLength: 1字节
|
|
17156
17153
|
view.setUint8(offset, routingKeyLength);
|
|
@@ -17372,6 +17369,71 @@ class ScreenshotManager {
|
|
|
17372
17369
|
this.stopScreenshot();
|
|
17373
17370
|
}
|
|
17374
17371
|
}
|
|
17372
|
+
/**
|
|
17373
|
+
* 更新截图配置(动态更新,无需重新初始化)
|
|
17374
|
+
* @param newOptions 要更新的配置项(部分更新)
|
|
17375
|
+
*/
|
|
17376
|
+
updateOptions(newOptions) {
|
|
17377
|
+
const oldEngine = this.options.engine;
|
|
17378
|
+
const newEngine = newOptions.engine;
|
|
17379
|
+
// 更新配置
|
|
17380
|
+
if (newOptions.engine !== undefined) {
|
|
17381
|
+
this.options.engine = newOptions.engine;
|
|
17382
|
+
}
|
|
17383
|
+
if (newOptions.quality !== undefined) {
|
|
17384
|
+
this.options.quality = newOptions.quality;
|
|
17385
|
+
}
|
|
17386
|
+
if (newOptions.scale !== undefined) {
|
|
17387
|
+
this.options.scale = newOptions.scale;
|
|
17388
|
+
}
|
|
17389
|
+
if (newOptions.maxWidth !== undefined) {
|
|
17390
|
+
this.options.maxWidth = newOptions.maxWidth;
|
|
17391
|
+
}
|
|
17392
|
+
if (newOptions.maxHeight !== undefined) {
|
|
17393
|
+
this.options.maxHeight = newOptions.maxHeight;
|
|
17394
|
+
}
|
|
17395
|
+
if (newOptions.outputFormat !== undefined) {
|
|
17396
|
+
this.options.outputFormat = newOptions.outputFormat;
|
|
17397
|
+
}
|
|
17398
|
+
if (newOptions.compress !== undefined) {
|
|
17399
|
+
this.options.compress = newOptions.compress;
|
|
17400
|
+
}
|
|
17401
|
+
if (newOptions.silentMode !== undefined) {
|
|
17402
|
+
this.options.silentMode = newOptions.silentMode;
|
|
17403
|
+
}
|
|
17404
|
+
if (newOptions.proxyUrl !== undefined) {
|
|
17405
|
+
this.options.proxyUrl = newOptions.proxyUrl;
|
|
17406
|
+
}
|
|
17407
|
+
if (newOptions.useProxy !== undefined) {
|
|
17408
|
+
this.options.useProxy = newOptions.useProxy;
|
|
17409
|
+
}
|
|
17410
|
+
// 如果引擎改变了,需要清理 context(下次截图时会使用新引擎)
|
|
17411
|
+
if (newEngine && newEngine !== oldEngine) {
|
|
17412
|
+
if (this.screenshotContext) {
|
|
17413
|
+
try {
|
|
17414
|
+
destroyContext(this.screenshotContext);
|
|
17415
|
+
if (!this.options.silentMode) {
|
|
17416
|
+
console.log(`📸 引擎已从 ${oldEngine} 切换到 ${newEngine},已清理旧 context`);
|
|
17417
|
+
}
|
|
17418
|
+
}
|
|
17419
|
+
catch (e) {
|
|
17420
|
+
// 忽略清理错误
|
|
17421
|
+
}
|
|
17422
|
+
this.screenshotContext = null;
|
|
17423
|
+
this.contextElement = null;
|
|
17424
|
+
this.contextOptionsHash = '';
|
|
17425
|
+
this.contextContentHash = '';
|
|
17426
|
+
this.contextLastUpdateTime = 0;
|
|
17427
|
+
}
|
|
17428
|
+
if (!this.options.silentMode) {
|
|
17429
|
+
console.log(`📸 截图引擎已更新: ${oldEngine} → ${newEngine}`);
|
|
17430
|
+
console.log(`📸 下次截图时将使用新引擎: ${newEngine}`);
|
|
17431
|
+
}
|
|
17432
|
+
}
|
|
17433
|
+
else if (!this.options.silentMode) {
|
|
17434
|
+
console.log('📸 截图配置已更新');
|
|
17435
|
+
}
|
|
17436
|
+
}
|
|
17375
17437
|
/**
|
|
17376
17438
|
* 清理资源
|
|
17377
17439
|
*/
|
|
@@ -21012,6 +21074,18 @@ class CustomerServiceSDK {
|
|
|
21012
21074
|
getScreenshotState() {
|
|
21013
21075
|
return this.screenshotManager?.getState() || null;
|
|
21014
21076
|
}
|
|
21077
|
+
/**
|
|
21078
|
+
* 更新截图配置(动态更新,无需重新初始化)
|
|
21079
|
+
* @param options 要更新的配置项(部分更新)
|
|
21080
|
+
*/
|
|
21081
|
+
updateScreenshotOptions(options) {
|
|
21082
|
+
if (!this.screenshotManager) {
|
|
21083
|
+
console.warn('截图管理器未初始化,无法更新配置');
|
|
21084
|
+
return;
|
|
21085
|
+
}
|
|
21086
|
+
this.screenshotManager.updateOptions(options);
|
|
21087
|
+
console.log('📸 截图配置已更新:', options);
|
|
21088
|
+
}
|
|
21015
21089
|
/**
|
|
21016
21090
|
* 销毁 SDK
|
|
21017
21091
|
*/
|
|
@@ -21177,6 +21251,10 @@ const getScreenshotState = () => {
|
|
|
21177
21251
|
const sdk = getInstance();
|
|
21178
21252
|
return sdk.getScreenshotState();
|
|
21179
21253
|
};
|
|
21254
|
+
const updateScreenshotOptions = (options) => {
|
|
21255
|
+
const sdk = getInstance();
|
|
21256
|
+
sdk.updateScreenshotOptions(options);
|
|
21257
|
+
};
|
|
21180
21258
|
// 默认导出
|
|
21181
21259
|
var index = {
|
|
21182
21260
|
init,
|
|
@@ -21197,6 +21275,7 @@ var index = {
|
|
|
21197
21275
|
captureScreenshot,
|
|
21198
21276
|
enableScreenshot,
|
|
21199
21277
|
getScreenshotState,
|
|
21278
|
+
updateScreenshotOptions,
|
|
21200
21279
|
destroy
|
|
21201
21280
|
};
|
|
21202
21281
|
|
|
@@ -21221,3 +21300,4 @@ exports.setIconStyle = setIconStyle;
|
|
|
21221
21300
|
exports.setScreenshotTarget = setScreenshotTarget;
|
|
21222
21301
|
exports.showIcon = showIcon;
|
|
21223
21302
|
exports.showNotification = showNotification;
|
|
21303
|
+
exports.updateScreenshotOptions = updateScreenshotOptions;
|
package/dist/customer-sdk.esm.js
CHANGED
|
@@ -17142,11 +17142,8 @@ class ScreenshotManager {
|
|
|
17142
17142
|
const topicArray = new Uint8Array(buffer, offset, topicLength);
|
|
17143
17143
|
topicArray.set(topicBytes);
|
|
17144
17144
|
offset += topicLength;
|
|
17145
|
-
//
|
|
17146
|
-
|
|
17147
|
-
offset += 1;
|
|
17148
|
-
// routingKey: 8字节
|
|
17149
|
-
const routingKeyBytes = encoder.encode(config.routingKey);
|
|
17145
|
+
// routingKey:
|
|
17146
|
+
const routingKeyBytes = encoder.encode(config.routingKey.trim());
|
|
17150
17147
|
const routingKeyLength = routingKeyBytes.length;
|
|
17151
17148
|
// routingKeyLength: 1字节
|
|
17152
17149
|
view.setUint8(offset, routingKeyLength);
|
|
@@ -17368,6 +17365,71 @@ class ScreenshotManager {
|
|
|
17368
17365
|
this.stopScreenshot();
|
|
17369
17366
|
}
|
|
17370
17367
|
}
|
|
17368
|
+
/**
|
|
17369
|
+
* 更新截图配置(动态更新,无需重新初始化)
|
|
17370
|
+
* @param newOptions 要更新的配置项(部分更新)
|
|
17371
|
+
*/
|
|
17372
|
+
updateOptions(newOptions) {
|
|
17373
|
+
const oldEngine = this.options.engine;
|
|
17374
|
+
const newEngine = newOptions.engine;
|
|
17375
|
+
// 更新配置
|
|
17376
|
+
if (newOptions.engine !== undefined) {
|
|
17377
|
+
this.options.engine = newOptions.engine;
|
|
17378
|
+
}
|
|
17379
|
+
if (newOptions.quality !== undefined) {
|
|
17380
|
+
this.options.quality = newOptions.quality;
|
|
17381
|
+
}
|
|
17382
|
+
if (newOptions.scale !== undefined) {
|
|
17383
|
+
this.options.scale = newOptions.scale;
|
|
17384
|
+
}
|
|
17385
|
+
if (newOptions.maxWidth !== undefined) {
|
|
17386
|
+
this.options.maxWidth = newOptions.maxWidth;
|
|
17387
|
+
}
|
|
17388
|
+
if (newOptions.maxHeight !== undefined) {
|
|
17389
|
+
this.options.maxHeight = newOptions.maxHeight;
|
|
17390
|
+
}
|
|
17391
|
+
if (newOptions.outputFormat !== undefined) {
|
|
17392
|
+
this.options.outputFormat = newOptions.outputFormat;
|
|
17393
|
+
}
|
|
17394
|
+
if (newOptions.compress !== undefined) {
|
|
17395
|
+
this.options.compress = newOptions.compress;
|
|
17396
|
+
}
|
|
17397
|
+
if (newOptions.silentMode !== undefined) {
|
|
17398
|
+
this.options.silentMode = newOptions.silentMode;
|
|
17399
|
+
}
|
|
17400
|
+
if (newOptions.proxyUrl !== undefined) {
|
|
17401
|
+
this.options.proxyUrl = newOptions.proxyUrl;
|
|
17402
|
+
}
|
|
17403
|
+
if (newOptions.useProxy !== undefined) {
|
|
17404
|
+
this.options.useProxy = newOptions.useProxy;
|
|
17405
|
+
}
|
|
17406
|
+
// 如果引擎改变了,需要清理 context(下次截图时会使用新引擎)
|
|
17407
|
+
if (newEngine && newEngine !== oldEngine) {
|
|
17408
|
+
if (this.screenshotContext) {
|
|
17409
|
+
try {
|
|
17410
|
+
destroyContext(this.screenshotContext);
|
|
17411
|
+
if (!this.options.silentMode) {
|
|
17412
|
+
console.log(`📸 引擎已从 ${oldEngine} 切换到 ${newEngine},已清理旧 context`);
|
|
17413
|
+
}
|
|
17414
|
+
}
|
|
17415
|
+
catch (e) {
|
|
17416
|
+
// 忽略清理错误
|
|
17417
|
+
}
|
|
17418
|
+
this.screenshotContext = null;
|
|
17419
|
+
this.contextElement = null;
|
|
17420
|
+
this.contextOptionsHash = '';
|
|
17421
|
+
this.contextContentHash = '';
|
|
17422
|
+
this.contextLastUpdateTime = 0;
|
|
17423
|
+
}
|
|
17424
|
+
if (!this.options.silentMode) {
|
|
17425
|
+
console.log(`📸 截图引擎已更新: ${oldEngine} → ${newEngine}`);
|
|
17426
|
+
console.log(`📸 下次截图时将使用新引擎: ${newEngine}`);
|
|
17427
|
+
}
|
|
17428
|
+
}
|
|
17429
|
+
else if (!this.options.silentMode) {
|
|
17430
|
+
console.log('📸 截图配置已更新');
|
|
17431
|
+
}
|
|
17432
|
+
}
|
|
17371
17433
|
/**
|
|
17372
17434
|
* 清理资源
|
|
17373
17435
|
*/
|
|
@@ -21008,6 +21070,18 @@ class CustomerServiceSDK {
|
|
|
21008
21070
|
getScreenshotState() {
|
|
21009
21071
|
return this.screenshotManager?.getState() || null;
|
|
21010
21072
|
}
|
|
21073
|
+
/**
|
|
21074
|
+
* 更新截图配置(动态更新,无需重新初始化)
|
|
21075
|
+
* @param options 要更新的配置项(部分更新)
|
|
21076
|
+
*/
|
|
21077
|
+
updateScreenshotOptions(options) {
|
|
21078
|
+
if (!this.screenshotManager) {
|
|
21079
|
+
console.warn('截图管理器未初始化,无法更新配置');
|
|
21080
|
+
return;
|
|
21081
|
+
}
|
|
21082
|
+
this.screenshotManager.updateOptions(options);
|
|
21083
|
+
console.log('📸 截图配置已更新:', options);
|
|
21084
|
+
}
|
|
21011
21085
|
/**
|
|
21012
21086
|
* 销毁 SDK
|
|
21013
21087
|
*/
|
|
@@ -21173,6 +21247,10 @@ const getScreenshotState = () => {
|
|
|
21173
21247
|
const sdk = getInstance();
|
|
21174
21248
|
return sdk.getScreenshotState();
|
|
21175
21249
|
};
|
|
21250
|
+
const updateScreenshotOptions = (options) => {
|
|
21251
|
+
const sdk = getInstance();
|
|
21252
|
+
sdk.updateScreenshotOptions(options);
|
|
21253
|
+
};
|
|
21176
21254
|
// 默认导出
|
|
21177
21255
|
var index = {
|
|
21178
21256
|
init,
|
|
@@ -21193,7 +21271,8 @@ var index = {
|
|
|
21193
21271
|
captureScreenshot,
|
|
21194
21272
|
enableScreenshot,
|
|
21195
21273
|
getScreenshotState,
|
|
21274
|
+
updateScreenshotOptions,
|
|
21196
21275
|
destroy
|
|
21197
21276
|
};
|
|
21198
21277
|
|
|
21199
|
-
export { CustomerServiceSDK, captureScreenshot, clearNotification, closeChat, index as default, destroy, enableScreenshot, getConnectionStatus, getInstance, getScreenshotState, hideIcon, init, isChatOpen, openChat, sendToIframe, setIconCoordinates, setIconPosition, setIconStyle, setScreenshotTarget, showIcon, showNotification };
|
|
21278
|
+
export { CustomerServiceSDK, captureScreenshot, clearNotification, closeChat, index as default, destroy, enableScreenshot, getConnectionStatus, getInstance, getScreenshotState, hideIcon, init, isChatOpen, openChat, sendToIframe, setIconCoordinates, setIconPosition, setIconStyle, setScreenshotTarget, showIcon, showNotification, updateScreenshotOptions };
|