@deepdesk/deepdesk-sdk 10.1.10 → 10.1.12

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.d.mts CHANGED
@@ -210,14 +210,12 @@ interface InputEventMap {
210
210
  */
211
211
  change: (event: {
212
212
  plainText: string;
213
- rawHtml: string | null;
214
213
  }) => void;
215
214
  /**
216
215
  * Updated value after User, platform and plugin changes
217
216
  */
218
217
  updated: (event: {
219
218
  plainText: string;
220
- rawHtml: string | null;
221
219
  }) => void;
222
220
  /**
223
221
  * Changed selection of input
@@ -246,7 +244,6 @@ declare abstract class InputMediator<HTMLElementType extends HTMLElement> {
246
244
  protected disposeHandlers: (() => void)[];
247
245
  protected currentText: string;
248
246
  protected currentHTML: string | null;
249
- protected currentSelection: SelectionRange | null;
250
247
  protected isFocused: boolean;
251
248
  protected isActive: boolean;
252
249
  protected isSettingValue: boolean;
@@ -1784,7 +1781,7 @@ declare class DeepdeskSDK {
1784
1781
  static version: string;
1785
1782
  static count: number;
1786
1783
  private deepdeskApi;
1787
- private inputMediator;
1784
+ inputMediator: InputMediator<any> | null;
1788
1785
  private version;
1789
1786
  private broadcastEvents;
1790
1787
  private eventListeners;
@@ -1969,7 +1966,6 @@ declare class DeepdeskSDK {
1969
1966
  * Method to call when the agent input has changed
1970
1967
  */
1971
1968
  private notifyInputChanged;
1972
- private syncInputHtml;
1973
1969
  /**
1974
1970
  * Method to call for the agent input keydown event
1975
1971
  */
@@ -2048,9 +2044,11 @@ declare class DeepdeskSDK {
2048
2044
 
2049
2045
  declare class ContentEditableInput extends InputMediator<HTMLDivElement> {
2050
2046
  protected observer?: MutationObserver;
2047
+ protected lastKnownSelection: SelectionRange | null;
2051
2048
  getText(): string;
2052
2049
  getHTML(): string;
2053
- getSelection(): SelectionRange | null;
2050
+ getRange(): Range | null;
2051
+ getSelection(): SelectionRange;
2054
2052
  getSelectedText(): string;
2055
2053
  applyChanges(callback: (element: HTMLDivElement) => void | Promise<void>): void;
2056
2054
  listen(): void;
@@ -2058,6 +2056,7 @@ declare class ContentEditableInput extends InputMediator<HTMLDivElement> {
2058
2056
  }
2059
2057
 
2060
2058
  declare class TextAreaInput extends InputMediator<HTMLTextAreaElement> {
2059
+ protected lastKnownSelection: SelectionRange | null;
2061
2060
  getText(): string;
2062
2061
  getHTML(): string | null;
2063
2062
  getSelection(): SelectionRange;
@@ -2093,6 +2092,7 @@ type ContentEditableOptions = {
2093
2092
  replace?: SelectionRange;
2094
2093
  selectionAfter?: SelectionRange | false;
2095
2094
  setRange?: (range: Range) => void | Promise<void>;
2095
+ insertBRs?: boolean;
2096
2096
  };
2097
2097
  declare function updateContentEditable(element: HTMLElement, insertText: string, options?: ContentEditableOptions): Promise<void>;
2098
2098
 
@@ -2143,6 +2143,7 @@ interface TargetFileOptions {
2143
2143
  }
2144
2144
  declare function attachFile(fileInput: HTMLInputElement, target: TargetFileOptions): Promise<void>;
2145
2145
 
2146
+ declare function createFullRange(rootElement: Node): Range;
2146
2147
  declare function createRangeFromOffsets(rootElement: HTMLElement, startOffset: number, endOffset: number): Range;
2147
2148
  declare function getRangeOffsets(rootElement: HTMLElement, range: Range): {
2148
2149
  start: number;
@@ -2163,4 +2164,4 @@ declare function waitForElementVisibilityChange(element: HTMLElement, callback:
2163
2164
  type CSSModule = Record<string, string>;
2164
2165
  declare function useStyles<TStyles extends CSSModule>(componentName: string, defaultStyles: TStyles): TStyles;
2165
2166
 
2166
- 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, createOverlayContainer, createRangeFromOffsets, escapeHTML, fetchPlatformConfig, formatTextMarkup, getRangeOffsets, getRangeText, isSupportedInputElement, updateContentEditable, updateTextArea, useStyles, waitForElementVisibilityChange };
2167
+ 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 };
package/dist/index.d.ts CHANGED
@@ -210,14 +210,12 @@ interface InputEventMap {
210
210
  */
211
211
  change: (event: {
212
212
  plainText: string;
213
- rawHtml: string | null;
214
213
  }) => void;
215
214
  /**
216
215
  * Updated value after User, platform and plugin changes
217
216
  */
218
217
  updated: (event: {
219
218
  plainText: string;
220
- rawHtml: string | null;
221
219
  }) => void;
222
220
  /**
223
221
  * Changed selection of input
@@ -246,7 +244,6 @@ declare abstract class InputMediator<HTMLElementType extends HTMLElement> {
246
244
  protected disposeHandlers: (() => void)[];
247
245
  protected currentText: string;
248
246
  protected currentHTML: string | null;
249
- protected currentSelection: SelectionRange | null;
250
247
  protected isFocused: boolean;
251
248
  protected isActive: boolean;
252
249
  protected isSettingValue: boolean;
@@ -1784,7 +1781,7 @@ declare class DeepdeskSDK {
1784
1781
  static version: string;
1785
1782
  static count: number;
1786
1783
  private deepdeskApi;
1787
- private inputMediator;
1784
+ inputMediator: InputMediator<any> | null;
1788
1785
  private version;
1789
1786
  private broadcastEvents;
1790
1787
  private eventListeners;
@@ -1969,7 +1966,6 @@ declare class DeepdeskSDK {
1969
1966
  * Method to call when the agent input has changed
1970
1967
  */
1971
1968
  private notifyInputChanged;
1972
- private syncInputHtml;
1973
1969
  /**
1974
1970
  * Method to call for the agent input keydown event
1975
1971
  */
@@ -2048,9 +2044,11 @@ declare class DeepdeskSDK {
2048
2044
 
2049
2045
  declare class ContentEditableInput extends InputMediator<HTMLDivElement> {
2050
2046
  protected observer?: MutationObserver;
2047
+ protected lastKnownSelection: SelectionRange | null;
2051
2048
  getText(): string;
2052
2049
  getHTML(): string;
2053
- getSelection(): SelectionRange | null;
2050
+ getRange(): Range | null;
2051
+ getSelection(): SelectionRange;
2054
2052
  getSelectedText(): string;
2055
2053
  applyChanges(callback: (element: HTMLDivElement) => void | Promise<void>): void;
2056
2054
  listen(): void;
@@ -2058,6 +2056,7 @@ declare class ContentEditableInput extends InputMediator<HTMLDivElement> {
2058
2056
  }
2059
2057
 
2060
2058
  declare class TextAreaInput extends InputMediator<HTMLTextAreaElement> {
2059
+ protected lastKnownSelection: SelectionRange | null;
2061
2060
  getText(): string;
2062
2061
  getHTML(): string | null;
2063
2062
  getSelection(): SelectionRange;
@@ -2093,6 +2092,7 @@ type ContentEditableOptions = {
2093
2092
  replace?: SelectionRange;
2094
2093
  selectionAfter?: SelectionRange | false;
2095
2094
  setRange?: (range: Range) => void | Promise<void>;
2095
+ insertBRs?: boolean;
2096
2096
  };
2097
2097
  declare function updateContentEditable(element: HTMLElement, insertText: string, options?: ContentEditableOptions): Promise<void>;
2098
2098
 
@@ -2143,6 +2143,7 @@ interface TargetFileOptions {
2143
2143
  }
2144
2144
  declare function attachFile(fileInput: HTMLInputElement, target: TargetFileOptions): Promise<void>;
2145
2145
 
2146
+ declare function createFullRange(rootElement: Node): Range;
2146
2147
  declare function createRangeFromOffsets(rootElement: HTMLElement, startOffset: number, endOffset: number): Range;
2147
2148
  declare function getRangeOffsets(rootElement: HTMLElement, range: Range): {
2148
2149
  start: number;
@@ -2163,4 +2164,4 @@ declare function waitForElementVisibilityChange(element: HTMLElement, callback:
2163
2164
  type CSSModule = Record<string, string>;
2164
2165
  declare function useStyles<TStyles extends CSSModule>(componentName: string, defaultStyles: TStyles): TStyles;
2165
2166
 
2166
- 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, createOverlayContainer, createRangeFromOffsets, escapeHTML, fetchPlatformConfig, formatTextMarkup, getRangeOffsets, getRangeText, isSupportedInputElement, updateContentEditable, updateTextArea, useStyles, waitForElementVisibilityChange };
2167
+ 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 };