@deepdesk/deepdesk-sdk 12.1.1-beta.5 → 13.0.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/index.cjs.js +6 -6
- package/dist/index.d.mts +45 -62
- package/dist/index.d.ts +45 -62
- package/dist/index.esm.js +7 -7
- package/dist/index.iife.js +12 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1539,6 +1539,7 @@ type CustomDataSchema = Array<{
|
|
|
1539
1539
|
trueValue?: string;
|
|
1540
1540
|
falseValue?: string;
|
|
1541
1541
|
}>;
|
|
1542
|
+
type PlatformConfig = CamelCaseKeys<Server.PlatformConfig>;
|
|
1542
1543
|
/**
|
|
1543
1544
|
* Utils
|
|
1544
1545
|
*/
|
|
@@ -2317,6 +2318,8 @@ declare class DeepdeskSDK {
|
|
|
2317
2318
|
private refreshWidgetSuggestions;
|
|
2318
2319
|
}
|
|
2319
2320
|
|
|
2321
|
+
declare function useClickOutsideRoot(cb: (event: Event) => void): void;
|
|
2322
|
+
|
|
2320
2323
|
declare class ContentEditableInput extends InputMediator<HTMLDivElement> {
|
|
2321
2324
|
protected observer?: MutationObserver;
|
|
2322
2325
|
protected lastKnownSelection: SelectionRange | null;
|
|
@@ -2343,7 +2346,40 @@ declare class TextAreaInput extends InputMediator<HTMLTextAreaElement> {
|
|
|
2343
2346
|
listen(): void;
|
|
2344
2347
|
}
|
|
2345
2348
|
|
|
2346
|
-
|
|
2349
|
+
interface TargetFileOptions {
|
|
2350
|
+
/**
|
|
2351
|
+
* path to file
|
|
2352
|
+
* eg: https://example.com/test.jpeg
|
|
2353
|
+
*/
|
|
2354
|
+
url: string;
|
|
2355
|
+
/**
|
|
2356
|
+
* name of file
|
|
2357
|
+
* eg: test.jpeg
|
|
2358
|
+
*/
|
|
2359
|
+
name: string;
|
|
2360
|
+
/**
|
|
2361
|
+
* mime type of file
|
|
2362
|
+
* default: image/jpeg
|
|
2363
|
+
*/
|
|
2364
|
+
mimeType?: string;
|
|
2365
|
+
/**
|
|
2366
|
+
* optionally override default window.fetch
|
|
2367
|
+
*/
|
|
2368
|
+
fetch?: typeof window.fetch;
|
|
2369
|
+
}
|
|
2370
|
+
declare function attachFile(fileInput: HTMLInputElement, target: TargetFileOptions): Promise<void>;
|
|
2371
|
+
|
|
2372
|
+
declare function authenticateWithKey(accountOrigin: string, key: string, user: User): Promise<void>;
|
|
2373
|
+
|
|
2374
|
+
declare function escapeHTML(text: string): string;
|
|
2375
|
+
declare function isHTML(input: string): boolean;
|
|
2376
|
+
|
|
2377
|
+
/**
|
|
2378
|
+
* Format (markdown) patterns to html.
|
|
2379
|
+
*/
|
|
2380
|
+
declare function formatTextMarkup(message: string): string;
|
|
2381
|
+
|
|
2382
|
+
declare function isSupportedInputElement(element?: HTMLElement): boolean;
|
|
2347
2383
|
|
|
2348
2384
|
type OverlayOptions = {
|
|
2349
2385
|
appendTo?: HTMLElement;
|
|
@@ -2363,7 +2399,13 @@ type OverlayOptions = {
|
|
|
2363
2399
|
*/
|
|
2364
2400
|
declare function createOverlayContainer(target: HTMLElement, options?: OverlayOptions): [HTMLElement, () => void];
|
|
2365
2401
|
|
|
2366
|
-
declare function
|
|
2402
|
+
declare function createFullRange(rootElement: Node): Range;
|
|
2403
|
+
declare function createRangeFromOffsets(rootElement: HTMLElement, startOffset: number, endOffset: number): Range;
|
|
2404
|
+
declare function getRangeOffsets(rootElement: HTMLElement, range: Range | StaticRange): {
|
|
2405
|
+
start: number;
|
|
2406
|
+
end: number;
|
|
2407
|
+
};
|
|
2408
|
+
declare function getRangeText(rootElement: Node, range: Range | StaticRange): string;
|
|
2367
2409
|
|
|
2368
2410
|
type TextAreaOptions = {
|
|
2369
2411
|
replace?: SelectionRange;
|
|
@@ -2384,65 +2426,6 @@ interface InsertCKEditorOptions {
|
|
|
2384
2426
|
}
|
|
2385
2427
|
declare function insertCKEditor(element: HTMLElement, insertText: string, { isBlock, isHTML }?: InsertCKEditorOptions): Promise<void>;
|
|
2386
2428
|
|
|
2387
|
-
/**
|
|
2388
|
-
* Format (markdown) patterns to html.
|
|
2389
|
-
*/
|
|
2390
|
-
declare function formatTextMarkup(message: string): string;
|
|
2391
|
-
|
|
2392
|
-
declare function authenticateWithKey(accountOrigin: string, key: string, user: User): Promise<void>;
|
|
2393
|
-
|
|
2394
|
-
type PlatformConfig = {
|
|
2395
|
-
config: {
|
|
2396
|
-
account: {
|
|
2397
|
-
name: string;
|
|
2398
|
-
url: string;
|
|
2399
|
-
};
|
|
2400
|
-
platform: {
|
|
2401
|
-
name: string;
|
|
2402
|
-
hasSso: boolean;
|
|
2403
|
-
authorizationUrl: string;
|
|
2404
|
-
};
|
|
2405
|
-
};
|
|
2406
|
-
};
|
|
2407
|
-
/**
|
|
2408
|
-
* @deprecated Use DeepdeskAPI.getPlatformConfig() in stead.
|
|
2409
|
-
*/
|
|
2410
|
-
declare function fetchPlatformConfig(accountOrigin: string): Promise<PlatformConfig>;
|
|
2411
|
-
|
|
2412
|
-
declare function escapeHTML(text: string): string;
|
|
2413
|
-
declare function isHTML(input: string): boolean;
|
|
2414
|
-
|
|
2415
|
-
interface TargetFileOptions {
|
|
2416
|
-
/**
|
|
2417
|
-
* path to file
|
|
2418
|
-
* eg: https://example.com/test.jpeg
|
|
2419
|
-
*/
|
|
2420
|
-
url: string;
|
|
2421
|
-
/**
|
|
2422
|
-
* name of file
|
|
2423
|
-
* eg: test.jpeg
|
|
2424
|
-
*/
|
|
2425
|
-
name: string;
|
|
2426
|
-
/**
|
|
2427
|
-
* mime type of file
|
|
2428
|
-
* default: image/jpeg
|
|
2429
|
-
*/
|
|
2430
|
-
mimeType?: string;
|
|
2431
|
-
/**
|
|
2432
|
-
* optionally override default window.fetch
|
|
2433
|
-
*/
|
|
2434
|
-
fetch?: typeof window.fetch;
|
|
2435
|
-
}
|
|
2436
|
-
declare function attachFile(fileInput: HTMLInputElement, target: TargetFileOptions): Promise<void>;
|
|
2437
|
-
|
|
2438
|
-
declare function createFullRange(rootElement: Node): Range;
|
|
2439
|
-
declare function createRangeFromOffsets(rootElement: HTMLElement, startOffset: number, endOffset: number): Range;
|
|
2440
|
-
declare function getRangeOffsets(rootElement: HTMLElement, range: Range | StaticRange): {
|
|
2441
|
-
start: number;
|
|
2442
|
-
end: number;
|
|
2443
|
-
};
|
|
2444
|
-
declare function getRangeText(rootElement: Node, range: Range | StaticRange): string;
|
|
2445
|
-
|
|
2446
2429
|
interface Cancelable {
|
|
2447
2430
|
(): void;
|
|
2448
2431
|
}
|
|
@@ -2456,4 +2439,4 @@ declare function waitForElementVisibilityChange(element: HTMLElement, callback:
|
|
|
2456
2439
|
type CSSModule = Record<string, string>;
|
|
2457
2440
|
declare function useStyles<TStyles extends CSSModule>(componentName: string, defaultStyles: TStyles): TStyles;
|
|
2458
2441
|
|
|
2459
|
-
export { AgentInfo, Card, ContentEditableInput, Conversation, ConversationMessage, DeepdeskAPI, DeepdeskSDK, HTTPClient, InputMediator, InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, Logger, MountOptions, PinnedMessage, PlatformConfig, RootState, Section, SectionList, SelectionRange, Sources, Suggestion, SuggestionEventMetrics, SuggestionList, SuggestionMetrics, TextAreaInput, TextSuggestion, ToggleButton, UrlSuggestion, VisitorInfo, WidgetCustomStyles, WidgetOptions, attachFile, authenticateWithKey, createFullRange, createOverlayContainer, createRangeFromOffsets, escapeHTML,
|
|
2442
|
+
export { AgentInfo, Card, ContentEditableInput, Conversation, ConversationMessage, DeepdeskAPI, DeepdeskSDK, HTTPClient, InputMediator, InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, Logger, MountOptions, PinnedMessage, PlatformConfig, RootState, Section, SectionList, SelectionRange, Sources, Suggestion, SuggestionEventMetrics, SuggestionList, SuggestionMetrics, TextAreaInput, TextSuggestion, ToggleButton, UrlSuggestion, VisitorInfo, WidgetCustomStyles, WidgetOptions, attachFile, authenticateWithKey, createFullRange, createOverlayContainer, createRangeFromOffsets, escapeHTML, formatTextMarkup, getRangeOffsets, getRangeText, insertCKEditor, isHTML, isSupportedInputElement, updateContentEditable, updateTextArea, useClickOutsideRoot, useStyles, waitForElementVisibilityChange };
|
package/dist/index.d.ts
CHANGED
|
@@ -1539,6 +1539,7 @@ type CustomDataSchema = Array<{
|
|
|
1539
1539
|
trueValue?: string;
|
|
1540
1540
|
falseValue?: string;
|
|
1541
1541
|
}>;
|
|
1542
|
+
type PlatformConfig = CamelCaseKeys<Server.PlatformConfig>;
|
|
1542
1543
|
/**
|
|
1543
1544
|
* Utils
|
|
1544
1545
|
*/
|
|
@@ -2317,6 +2318,8 @@ declare class DeepdeskSDK {
|
|
|
2317
2318
|
private refreshWidgetSuggestions;
|
|
2318
2319
|
}
|
|
2319
2320
|
|
|
2321
|
+
declare function useClickOutsideRoot(cb: (event: Event) => void): void;
|
|
2322
|
+
|
|
2320
2323
|
declare class ContentEditableInput extends InputMediator<HTMLDivElement> {
|
|
2321
2324
|
protected observer?: MutationObserver;
|
|
2322
2325
|
protected lastKnownSelection: SelectionRange | null;
|
|
@@ -2343,7 +2346,40 @@ declare class TextAreaInput extends InputMediator<HTMLTextAreaElement> {
|
|
|
2343
2346
|
listen(): void;
|
|
2344
2347
|
}
|
|
2345
2348
|
|
|
2346
|
-
|
|
2349
|
+
interface TargetFileOptions {
|
|
2350
|
+
/**
|
|
2351
|
+
* path to file
|
|
2352
|
+
* eg: https://example.com/test.jpeg
|
|
2353
|
+
*/
|
|
2354
|
+
url: string;
|
|
2355
|
+
/**
|
|
2356
|
+
* name of file
|
|
2357
|
+
* eg: test.jpeg
|
|
2358
|
+
*/
|
|
2359
|
+
name: string;
|
|
2360
|
+
/**
|
|
2361
|
+
* mime type of file
|
|
2362
|
+
* default: image/jpeg
|
|
2363
|
+
*/
|
|
2364
|
+
mimeType?: string;
|
|
2365
|
+
/**
|
|
2366
|
+
* optionally override default window.fetch
|
|
2367
|
+
*/
|
|
2368
|
+
fetch?: typeof window.fetch;
|
|
2369
|
+
}
|
|
2370
|
+
declare function attachFile(fileInput: HTMLInputElement, target: TargetFileOptions): Promise<void>;
|
|
2371
|
+
|
|
2372
|
+
declare function authenticateWithKey(accountOrigin: string, key: string, user: User): Promise<void>;
|
|
2373
|
+
|
|
2374
|
+
declare function escapeHTML(text: string): string;
|
|
2375
|
+
declare function isHTML(input: string): boolean;
|
|
2376
|
+
|
|
2377
|
+
/**
|
|
2378
|
+
* Format (markdown) patterns to html.
|
|
2379
|
+
*/
|
|
2380
|
+
declare function formatTextMarkup(message: string): string;
|
|
2381
|
+
|
|
2382
|
+
declare function isSupportedInputElement(element?: HTMLElement): boolean;
|
|
2347
2383
|
|
|
2348
2384
|
type OverlayOptions = {
|
|
2349
2385
|
appendTo?: HTMLElement;
|
|
@@ -2363,7 +2399,13 @@ type OverlayOptions = {
|
|
|
2363
2399
|
*/
|
|
2364
2400
|
declare function createOverlayContainer(target: HTMLElement, options?: OverlayOptions): [HTMLElement, () => void];
|
|
2365
2401
|
|
|
2366
|
-
declare function
|
|
2402
|
+
declare function createFullRange(rootElement: Node): Range;
|
|
2403
|
+
declare function createRangeFromOffsets(rootElement: HTMLElement, startOffset: number, endOffset: number): Range;
|
|
2404
|
+
declare function getRangeOffsets(rootElement: HTMLElement, range: Range | StaticRange): {
|
|
2405
|
+
start: number;
|
|
2406
|
+
end: number;
|
|
2407
|
+
};
|
|
2408
|
+
declare function getRangeText(rootElement: Node, range: Range | StaticRange): string;
|
|
2367
2409
|
|
|
2368
2410
|
type TextAreaOptions = {
|
|
2369
2411
|
replace?: SelectionRange;
|
|
@@ -2384,65 +2426,6 @@ interface InsertCKEditorOptions {
|
|
|
2384
2426
|
}
|
|
2385
2427
|
declare function insertCKEditor(element: HTMLElement, insertText: string, { isBlock, isHTML }?: InsertCKEditorOptions): Promise<void>;
|
|
2386
2428
|
|
|
2387
|
-
/**
|
|
2388
|
-
* Format (markdown) patterns to html.
|
|
2389
|
-
*/
|
|
2390
|
-
declare function formatTextMarkup(message: string): string;
|
|
2391
|
-
|
|
2392
|
-
declare function authenticateWithKey(accountOrigin: string, key: string, user: User): Promise<void>;
|
|
2393
|
-
|
|
2394
|
-
type PlatformConfig = {
|
|
2395
|
-
config: {
|
|
2396
|
-
account: {
|
|
2397
|
-
name: string;
|
|
2398
|
-
url: string;
|
|
2399
|
-
};
|
|
2400
|
-
platform: {
|
|
2401
|
-
name: string;
|
|
2402
|
-
hasSso: boolean;
|
|
2403
|
-
authorizationUrl: string;
|
|
2404
|
-
};
|
|
2405
|
-
};
|
|
2406
|
-
};
|
|
2407
|
-
/**
|
|
2408
|
-
* @deprecated Use DeepdeskAPI.getPlatformConfig() in stead.
|
|
2409
|
-
*/
|
|
2410
|
-
declare function fetchPlatformConfig(accountOrigin: string): Promise<PlatformConfig>;
|
|
2411
|
-
|
|
2412
|
-
declare function escapeHTML(text: string): string;
|
|
2413
|
-
declare function isHTML(input: string): boolean;
|
|
2414
|
-
|
|
2415
|
-
interface TargetFileOptions {
|
|
2416
|
-
/**
|
|
2417
|
-
* path to file
|
|
2418
|
-
* eg: https://example.com/test.jpeg
|
|
2419
|
-
*/
|
|
2420
|
-
url: string;
|
|
2421
|
-
/**
|
|
2422
|
-
* name of file
|
|
2423
|
-
* eg: test.jpeg
|
|
2424
|
-
*/
|
|
2425
|
-
name: string;
|
|
2426
|
-
/**
|
|
2427
|
-
* mime type of file
|
|
2428
|
-
* default: image/jpeg
|
|
2429
|
-
*/
|
|
2430
|
-
mimeType?: string;
|
|
2431
|
-
/**
|
|
2432
|
-
* optionally override default window.fetch
|
|
2433
|
-
*/
|
|
2434
|
-
fetch?: typeof window.fetch;
|
|
2435
|
-
}
|
|
2436
|
-
declare function attachFile(fileInput: HTMLInputElement, target: TargetFileOptions): Promise<void>;
|
|
2437
|
-
|
|
2438
|
-
declare function createFullRange(rootElement: Node): Range;
|
|
2439
|
-
declare function createRangeFromOffsets(rootElement: HTMLElement, startOffset: number, endOffset: number): Range;
|
|
2440
|
-
declare function getRangeOffsets(rootElement: HTMLElement, range: Range | StaticRange): {
|
|
2441
|
-
start: number;
|
|
2442
|
-
end: number;
|
|
2443
|
-
};
|
|
2444
|
-
declare function getRangeText(rootElement: Node, range: Range | StaticRange): string;
|
|
2445
|
-
|
|
2446
2429
|
interface Cancelable {
|
|
2447
2430
|
(): void;
|
|
2448
2431
|
}
|
|
@@ -2456,4 +2439,4 @@ declare function waitForElementVisibilityChange(element: HTMLElement, callback:
|
|
|
2456
2439
|
type CSSModule = Record<string, string>;
|
|
2457
2440
|
declare function useStyles<TStyles extends CSSModule>(componentName: string, defaultStyles: TStyles): TStyles;
|
|
2458
2441
|
|
|
2459
|
-
export { AgentInfo, Card, ContentEditableInput, Conversation, ConversationMessage, DeepdeskAPI, DeepdeskSDK, HTTPClient, InputMediator, InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, Logger, MountOptions, PinnedMessage, PlatformConfig, RootState, Section, SectionList, SelectionRange, Sources, Suggestion, SuggestionEventMetrics, SuggestionList, SuggestionMetrics, TextAreaInput, TextSuggestion, ToggleButton, UrlSuggestion, VisitorInfo, WidgetCustomStyles, WidgetOptions, attachFile, authenticateWithKey, createFullRange, createOverlayContainer, createRangeFromOffsets, escapeHTML,
|
|
2442
|
+
export { AgentInfo, Card, ContentEditableInput, Conversation, ConversationMessage, DeepdeskAPI, DeepdeskSDK, HTTPClient, InputMediator, InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, Logger, MountOptions, PinnedMessage, PlatformConfig, RootState, Section, SectionList, SelectionRange, Sources, Suggestion, SuggestionEventMetrics, SuggestionList, SuggestionMetrics, TextAreaInput, TextSuggestion, ToggleButton, UrlSuggestion, VisitorInfo, WidgetCustomStyles, WidgetOptions, attachFile, authenticateWithKey, createFullRange, createOverlayContainer, createRangeFromOffsets, escapeHTML, formatTextMarkup, getRangeOffsets, getRangeText, insertCKEditor, isHTML, isSupportedInputElement, updateContentEditable, updateTextArea, useClickOutsideRoot, useStyles, waitForElementVisibilityChange };
|