@deepdesk/deepdesk-sdk 10.3.1-beta.0 → 10.3.1-beta.2
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/dialogs.css +1 -1
- package/dist/index.cjs.js +6 -5
- package/dist/index.d.mts +72 -45
- package/dist/index.d.ts +72 -45
- package/dist/index.esm.js +6 -5
- package/dist/index.iife.js +13 -12
- package/input.css +1 -1
- package/package.json +4 -4
- package/styles/index.js +1 -1
- package/styles.css +1 -1
- package/widget.css +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import * as _reduxjs_toolkit_dist_configureStore from '@reduxjs/toolkit/dist/con
|
|
|
4
4
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
5
5
|
import { Middleware } from '@reduxjs/toolkit';
|
|
6
6
|
|
|
7
|
-
declare const styles$
|
|
7
|
+
declare const styles$n: {
|
|
8
8
|
readonly "root": string;
|
|
9
9
|
readonly "imageWrapper": string;
|
|
10
10
|
readonly "image": string;
|
|
@@ -33,20 +33,20 @@ interface CardComposition {
|
|
|
33
33
|
Content: FC<ContentProps>;
|
|
34
34
|
Title: FC<TitleProps>;
|
|
35
35
|
}
|
|
36
|
-
type CardStyles = typeof styles$
|
|
36
|
+
type CardStyles = typeof styles$n;
|
|
37
37
|
declare const Card: FC & CardComposition;
|
|
38
38
|
|
|
39
|
-
declare const styles$
|
|
39
|
+
declare const styles$m: {
|
|
40
40
|
readonly "root": string;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
interface Props$7 {
|
|
44
44
|
children: React.ReactNode;
|
|
45
45
|
}
|
|
46
|
-
type ChipStyles = typeof styles$
|
|
46
|
+
type ChipStyles = typeof styles$m;
|
|
47
47
|
declare const Chip: React.FC<Props$7>;
|
|
48
48
|
|
|
49
|
-
declare const styles$
|
|
49
|
+
declare const styles$l: {
|
|
50
50
|
readonly "root": string;
|
|
51
51
|
readonly "isArrowUp": string;
|
|
52
52
|
readonly "isArrowDown": string;
|
|
@@ -66,18 +66,18 @@ type Props$6 = HTMLAttributes<HTMLSpanElement> & {
|
|
|
66
66
|
className?: string;
|
|
67
67
|
keyCode: KeyboardHintKey;
|
|
68
68
|
};
|
|
69
|
-
type KeyboardHintStyles = typeof styles$
|
|
69
|
+
type KeyboardHintStyles = typeof styles$l;
|
|
70
70
|
declare const KeyboardHint: React.FC<Props$6>;
|
|
71
71
|
|
|
72
|
-
declare const styles$
|
|
72
|
+
declare const styles$k: {
|
|
73
73
|
readonly "root": string;
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
type Props$5 = HTMLAttributes<HTMLSpanElement>;
|
|
77
|
-
type LabelStyles = typeof styles$
|
|
77
|
+
type LabelStyles = typeof styles$k;
|
|
78
78
|
declare const Label: React.FC<Props$5>;
|
|
79
79
|
|
|
80
|
-
declare const styles$
|
|
80
|
+
declare const styles$j: {
|
|
81
81
|
readonly "root": string;
|
|
82
82
|
readonly "subTitleContainer": string;
|
|
83
83
|
readonly "subtitle": string;
|
|
@@ -88,10 +88,10 @@ type Props$4 = HTMLAttributes<HTMLElement> & {
|
|
|
88
88
|
type: string;
|
|
89
89
|
title?: string;
|
|
90
90
|
};
|
|
91
|
-
type SectionStyles = typeof styles$
|
|
91
|
+
type SectionStyles = typeof styles$j;
|
|
92
92
|
declare const Section: React.FC<Props$4>;
|
|
93
93
|
|
|
94
|
-
declare const styles$
|
|
94
|
+
declare const styles$i: {
|
|
95
95
|
readonly "root": string;
|
|
96
96
|
};
|
|
97
97
|
|
|
@@ -99,10 +99,10 @@ type Props$3 = {
|
|
|
99
99
|
className?: string;
|
|
100
100
|
children?: React.ReactNode;
|
|
101
101
|
};
|
|
102
|
-
type SectionListStyles = typeof styles$
|
|
102
|
+
type SectionListStyles = typeof styles$i;
|
|
103
103
|
declare const SectionList: React.ForwardRefExoticComponent<Props$3 & React.RefAttributes<HTMLDivElement>>;
|
|
104
104
|
|
|
105
|
-
declare const styles$
|
|
105
|
+
declare const styles$h: {
|
|
106
106
|
readonly "root": string;
|
|
107
107
|
readonly "fadein": string;
|
|
108
108
|
readonly "isClickable": string;
|
|
@@ -147,21 +147,21 @@ interface SuggestionComposition {
|
|
|
147
147
|
DropdownItem: FC<DropdownItemProps>;
|
|
148
148
|
Labels: FC<LabelProps>;
|
|
149
149
|
}
|
|
150
|
-
type SuggestionStyles = typeof styles$
|
|
150
|
+
type SuggestionStyles = typeof styles$h;
|
|
151
151
|
declare const Suggestion: ForwardRefExoticComponent<Props$2 & RefAttributes<any>> & SuggestionComposition;
|
|
152
152
|
|
|
153
|
-
declare const styles$
|
|
153
|
+
declare const styles$g: {
|
|
154
154
|
readonly "root": string;
|
|
155
155
|
readonly "isWithDivider": string;
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
-
type SuggestionListStyles = typeof styles$
|
|
158
|
+
type SuggestionListStyles = typeof styles$g;
|
|
159
159
|
interface Props$1 {
|
|
160
160
|
withDivider?: boolean;
|
|
161
161
|
}
|
|
162
162
|
declare const SuggestionList: React.FC<Props$1>;
|
|
163
163
|
|
|
164
|
-
declare const styles$
|
|
164
|
+
declare const styles$f: {
|
|
165
165
|
readonly "root": string;
|
|
166
166
|
readonly "isCollapsed": string;
|
|
167
167
|
};
|
|
@@ -170,7 +170,7 @@ type Props = HTMLAttributes<HTMLButtonElement> & {
|
|
|
170
170
|
isCollapsed: boolean;
|
|
171
171
|
title: string;
|
|
172
172
|
};
|
|
173
|
-
type ToggleButtonStyles = typeof styles$
|
|
173
|
+
type ToggleButtonStyles = typeof styles$f;
|
|
174
174
|
declare const ToggleButton: React.FC<Props>;
|
|
175
175
|
|
|
176
176
|
declare enum Sources {
|
|
@@ -204,6 +204,13 @@ type SelectionRange = {
|
|
|
204
204
|
start: number;
|
|
205
205
|
end: number;
|
|
206
206
|
};
|
|
207
|
+
/**
|
|
208
|
+
* A selection range representation for textarea's and contenteditables only using offsets.
|
|
209
|
+
*/
|
|
210
|
+
type Caret = {
|
|
211
|
+
top: number;
|
|
212
|
+
left: number;
|
|
213
|
+
};
|
|
207
214
|
interface InputEventMap {
|
|
208
215
|
/**
|
|
209
216
|
* User and platform changes (excluding changes by plugin)
|
|
@@ -221,6 +228,7 @@ interface InputEventMap {
|
|
|
221
228
|
* Emits when only the caret/selection changes. (No other state changes).
|
|
222
229
|
*/
|
|
223
230
|
selection: (event: SelectionRange | null) => void;
|
|
231
|
+
caret: (event: Caret | null) => void;
|
|
224
232
|
keydown: (event: KeyboardEvent) => void;
|
|
225
233
|
paste: (event: {
|
|
226
234
|
pastedText: string;
|
|
@@ -243,6 +251,7 @@ declare abstract class InputMediator<HTMLElementType extends HTMLElement> {
|
|
|
243
251
|
protected eventListeners: Partial<InputEventListeners<keyof InputEventMap>>;
|
|
244
252
|
protected disposeHandlers: (() => void)[];
|
|
245
253
|
protected currentText: string;
|
|
254
|
+
protected currentCaret: Caret | null;
|
|
246
255
|
protected currentSelection: SelectionRange;
|
|
247
256
|
protected currentHTML: string | null;
|
|
248
257
|
protected isFocused: boolean;
|
|
@@ -256,6 +265,7 @@ declare abstract class InputMediator<HTMLElementType extends HTMLElement> {
|
|
|
256
265
|
protected removeEventListener(eventName: string, listener: EventListenerOrEventListenerObject): void;
|
|
257
266
|
protected triggerChange(): void;
|
|
258
267
|
protected triggerSelection(): void;
|
|
268
|
+
protected triggerCaretPosition(): void;
|
|
259
269
|
abstract getSelectedText(): string;
|
|
260
270
|
protected handleKeyUp(event: KeyboardEvent): void;
|
|
261
271
|
protected handleClick(): void;
|
|
@@ -268,7 +278,8 @@ declare abstract class InputMediator<HTMLElementType extends HTMLElement> {
|
|
|
268
278
|
abstract getText(): string;
|
|
269
279
|
abstract getHTML(): string | null;
|
|
270
280
|
abstract getSelection(): SelectionRange;
|
|
271
|
-
abstract
|
|
281
|
+
abstract getCaretPosition(): Caret | null;
|
|
282
|
+
abstract applyChanges(callback: (element: HTMLElementType) => void | Promise<void>): void | Promise<void>;
|
|
272
283
|
focus(): void;
|
|
273
284
|
emit<K extends keyof InputEventMap>(type: K, ...args: Parameters<InputHandler<K>>): void;
|
|
274
285
|
on<K extends keyof InputEventMap>(type: K, handler: InputHandler<K>): void;
|
|
@@ -1433,7 +1444,7 @@ interface TextSuggestionState {
|
|
|
1433
1444
|
[type: string]: SuggestionState;
|
|
1434
1445
|
}
|
|
1435
1446
|
|
|
1436
|
-
declare const styles$
|
|
1447
|
+
declare const styles$e: {
|
|
1437
1448
|
readonly "isDisabled": string;
|
|
1438
1449
|
readonly "buttonStart": string;
|
|
1439
1450
|
readonly "root": string;
|
|
@@ -1444,9 +1455,9 @@ declare const styles$d: {
|
|
|
1444
1455
|
readonly "isAborted": string;
|
|
1445
1456
|
};
|
|
1446
1457
|
|
|
1447
|
-
type AutoflowStyles = typeof styles$
|
|
1458
|
+
type AutoflowStyles = typeof styles$e;
|
|
1448
1459
|
|
|
1449
|
-
declare const styles$
|
|
1460
|
+
declare const styles$d: {
|
|
1450
1461
|
readonly "root": string;
|
|
1451
1462
|
readonly "list": string;
|
|
1452
1463
|
readonly "listWrapper": string;
|
|
@@ -1489,16 +1500,16 @@ declare const styles$c: {
|
|
|
1489
1500
|
readonly "actionShortcutFixKerning": string;
|
|
1490
1501
|
};
|
|
1491
1502
|
|
|
1492
|
-
type CommandPaletteStyles = typeof styles$
|
|
1503
|
+
type CommandPaletteStyles = typeof styles$d;
|
|
1493
1504
|
|
|
1494
|
-
declare const styles$
|
|
1505
|
+
declare const styles$c: {
|
|
1495
1506
|
readonly "root": string;
|
|
1496
1507
|
readonly "content": string;
|
|
1497
1508
|
};
|
|
1498
1509
|
|
|
1499
|
-
type DialogStyles = typeof styles$
|
|
1510
|
+
type DialogStyles = typeof styles$c;
|
|
1500
1511
|
|
|
1501
|
-
declare const styles$
|
|
1512
|
+
declare const styles$b: {
|
|
1502
1513
|
readonly "root": string;
|
|
1503
1514
|
readonly "content": string;
|
|
1504
1515
|
readonly "title": string;
|
|
@@ -1508,9 +1519,9 @@ declare const styles$a: {
|
|
|
1508
1519
|
readonly "primaryButtons": string;
|
|
1509
1520
|
};
|
|
1510
1521
|
|
|
1511
|
-
type EditSuggestionFormStyles = typeof styles$
|
|
1522
|
+
type EditSuggestionFormStyles = typeof styles$b;
|
|
1512
1523
|
|
|
1513
|
-
declare const styles$
|
|
1524
|
+
declare const styles$a: {
|
|
1514
1525
|
readonly "root": string;
|
|
1515
1526
|
readonly "agentText": string;
|
|
1516
1527
|
readonly "textInput": string;
|
|
@@ -1521,32 +1532,32 @@ declare const styles$9: {
|
|
|
1521
1532
|
readonly "success": string;
|
|
1522
1533
|
};
|
|
1523
1534
|
|
|
1524
|
-
type EditSuggestionTextInputStyles = typeof styles$
|
|
1535
|
+
type EditSuggestionTextInputStyles = typeof styles$a;
|
|
1525
1536
|
|
|
1526
|
-
declare const styles$
|
|
1537
|
+
declare const styles$9: {
|
|
1527
1538
|
readonly "root": string;
|
|
1528
1539
|
readonly "title": string;
|
|
1529
1540
|
readonly "empty": string;
|
|
1530
1541
|
};
|
|
1531
1542
|
|
|
1532
|
-
type EntitiesListStyles = typeof styles$
|
|
1543
|
+
type EntitiesListStyles = typeof styles$9;
|
|
1533
1544
|
|
|
1534
|
-
declare const styles$
|
|
1545
|
+
declare const styles$8: {
|
|
1535
1546
|
readonly "root": string;
|
|
1536
1547
|
readonly "content": string;
|
|
1537
1548
|
};
|
|
1538
1549
|
|
|
1539
|
-
type LinkSearchStyles = typeof styles$
|
|
1550
|
+
type LinkSearchStyles = typeof styles$8;
|
|
1540
1551
|
|
|
1541
|
-
declare const styles$
|
|
1552
|
+
declare const styles$7: {
|
|
1542
1553
|
readonly "root": string;
|
|
1543
1554
|
readonly "anchor": string;
|
|
1544
1555
|
readonly "anchorButton": string;
|
|
1545
1556
|
};
|
|
1546
1557
|
|
|
1547
|
-
type LoginStyles = typeof styles$
|
|
1558
|
+
type LoginStyles = typeof styles$7;
|
|
1548
1559
|
|
|
1549
|
-
declare const styles$
|
|
1560
|
+
declare const styles$6: {
|
|
1550
1561
|
readonly "root": string;
|
|
1551
1562
|
readonly "anchorButton": string;
|
|
1552
1563
|
readonly "errorMessage": string;
|
|
@@ -1559,16 +1570,16 @@ declare const styles$5: {
|
|
|
1559
1570
|
readonly "primaryButton": string;
|
|
1560
1571
|
};
|
|
1561
1572
|
|
|
1562
|
-
type LoginTokenDialogStyles = typeof styles$
|
|
1573
|
+
type LoginTokenDialogStyles = typeof styles$6;
|
|
1563
1574
|
|
|
1564
|
-
declare const styles$
|
|
1575
|
+
declare const styles$5: {
|
|
1565
1576
|
readonly "root": string;
|
|
1566
1577
|
readonly "text": string;
|
|
1567
1578
|
};
|
|
1568
1579
|
|
|
1569
|
-
type SearchTriggerStyles = typeof styles$
|
|
1580
|
+
type SearchTriggerStyles = typeof styles$5;
|
|
1570
1581
|
|
|
1571
|
-
declare const styles$
|
|
1582
|
+
declare const styles$4: {
|
|
1572
1583
|
readonly "root": string;
|
|
1573
1584
|
readonly "isInline": string;
|
|
1574
1585
|
readonly "toggleButton": string;
|
|
@@ -1582,7 +1593,14 @@ declare const styles$3: {
|
|
|
1582
1593
|
readonly "triggersRight": string;
|
|
1583
1594
|
};
|
|
1584
1595
|
|
|
1585
|
-
type SuggestionsOverlayStyles = typeof styles$
|
|
1596
|
+
type SuggestionsOverlayStyles = typeof styles$4;
|
|
1597
|
+
|
|
1598
|
+
declare const styles$3: {
|
|
1599
|
+
readonly "root": string;
|
|
1600
|
+
readonly "paper": string;
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
type InlineSuggestionsOverlayStyles = typeof styles$3;
|
|
1586
1604
|
|
|
1587
1605
|
declare const styles$2: {
|
|
1588
1606
|
readonly "root": string;
|
|
@@ -1655,6 +1673,7 @@ type InputOverlayCustomStyles = {
|
|
|
1655
1673
|
Suggestion?: Partial<SuggestionStyles>;
|
|
1656
1674
|
SuggestionList?: Partial<SuggestionListStyles>;
|
|
1657
1675
|
SuggestionsOverlay?: Partial<SuggestionsOverlayStyles>;
|
|
1676
|
+
InlineSuggestionsOverlay?: Partial<InlineSuggestionsOverlayStyles>;
|
|
1658
1677
|
TextSuggestion?: Partial<TextSuggestionStyles>;
|
|
1659
1678
|
ToggleButton?: Partial<ToggleButtonStyles>;
|
|
1660
1679
|
KeyboardHint?: Partial<KeyboardHintStyles>;
|
|
@@ -2023,6 +2042,7 @@ declare class DeepdeskSDK {
|
|
|
2023
2042
|
}>>): void;
|
|
2024
2043
|
whenConversationLoaded(callback: () => void): void;
|
|
2025
2044
|
private overlayContainerFactory;
|
|
2045
|
+
private createInlineContainer;
|
|
2026
2046
|
private createContainer;
|
|
2027
2047
|
/**
|
|
2028
2048
|
* Renders the tab completion and suggestions overlay and 2-way binds events
|
|
@@ -2052,10 +2072,14 @@ declare class ContentEditableInput extends InputMediator<HTMLDivElement> {
|
|
|
2052
2072
|
protected getRootNode(): Document | ShadowRoot;
|
|
2053
2073
|
getText(): string;
|
|
2054
2074
|
getHTML(): string;
|
|
2055
|
-
getRange(): Range |
|
|
2075
|
+
getRange(): Range | null;
|
|
2076
|
+
getCaretPosition(): {
|
|
2077
|
+
top: number;
|
|
2078
|
+
left: number;
|
|
2079
|
+
} | null;
|
|
2056
2080
|
getSelection(): SelectionRange;
|
|
2057
2081
|
getSelectedText(): string;
|
|
2058
|
-
applyChanges(callback: (element: HTMLDivElement) => void | Promise<void>): void
|
|
2082
|
+
applyChanges(callback: (element: HTMLDivElement) => void | Promise<void>): void | Promise<void>;
|
|
2059
2083
|
listen(): void;
|
|
2060
2084
|
dispose(): void;
|
|
2061
2085
|
}
|
|
@@ -2066,7 +2090,8 @@ declare class TextAreaInput extends InputMediator<HTMLTextAreaElement> {
|
|
|
2066
2090
|
getHTML(): string | null;
|
|
2067
2091
|
getSelection(): SelectionRange;
|
|
2068
2092
|
getSelectedText(): string;
|
|
2069
|
-
|
|
2093
|
+
getCaretPosition(): Caret | null;
|
|
2094
|
+
applyChanges(callback: (element: HTMLTextAreaElement) => void | Promise<void>): void | Promise<void>;
|
|
2070
2095
|
listen(): void;
|
|
2071
2096
|
}
|
|
2072
2097
|
|
|
@@ -2075,6 +2100,7 @@ type OverlayOptions = {
|
|
|
2075
2100
|
mirrorOverflow?: boolean;
|
|
2076
2101
|
closestScrollElement?: HTMLElement;
|
|
2077
2102
|
overlayContainer?: HTMLElement;
|
|
2103
|
+
position?: 'fixed' | 'absolute';
|
|
2078
2104
|
onHide?(): void;
|
|
2079
2105
|
onShow?(): void;
|
|
2080
2106
|
onRemove?(): void;
|
|
@@ -2100,6 +2126,7 @@ type ContentEditableOptions = {
|
|
|
2100
2126
|
insertBRs?: boolean;
|
|
2101
2127
|
};
|
|
2102
2128
|
declare function updateContentEditable(element: HTMLElement, insertText: string, options?: ContentEditableOptions): Promise<void>;
|
|
2129
|
+
declare function insertCKEditor(element: HTMLElement, insertText: string): Promise<void>;
|
|
2103
2130
|
|
|
2104
2131
|
/**
|
|
2105
2132
|
* Format (markdown) patterns to html.
|
|
@@ -2169,4 +2196,4 @@ declare function waitForElementVisibilityChange(element: HTMLElement, callback:
|
|
|
2169
2196
|
type CSSModule = Record<string, string>;
|
|
2170
2197
|
declare function useStyles<TStyles extends CSSModule>(componentName: string, defaultStyles: TStyles): TStyles;
|
|
2171
2198
|
|
|
2172
|
-
export { AgentInfo, Card, Chip, 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, fetchPlatformConfig, formatTextMarkup, getRangeOffsets, getRangeText, isSupportedInputElement, updateContentEditable, updateTextArea, useStyles, waitForElementVisibilityChange };
|
|
2199
|
+
export { AgentInfo, Card, Chip, 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, fetchPlatformConfig, formatTextMarkup, getRangeOffsets, getRangeText, insertCKEditor, isSupportedInputElement, updateContentEditable, updateTextArea, useStyles, waitForElementVisibilityChange };
|