@apia/components 3.0.22 → 3.0.23
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.ts +91 -1
- package/dist/index.js +976 -141
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -1797,5 +1797,95 @@ declare const SortableList: ((props: {
|
|
|
1797
1797
|
displayName: string;
|
|
1798
1798
|
};
|
|
1799
1799
|
|
|
1800
|
-
|
|
1800
|
+
type TMessageType = 'user' | 'system' | 'warning' | 'error' | 'information' | 'response' | 'multipleChoice' | 'customMessage';
|
|
1801
|
+
interface IAttachment {
|
|
1802
|
+
name: string;
|
|
1803
|
+
id: string;
|
|
1804
|
+
value: string;
|
|
1805
|
+
description?: string;
|
|
1806
|
+
}
|
|
1807
|
+
type TChatControllerState = {
|
|
1808
|
+
isLoading: boolean;
|
|
1809
|
+
canRecord: boolean;
|
|
1810
|
+
canAttach: boolean;
|
|
1811
|
+
maxAttachmentsSize: number;
|
|
1812
|
+
messages: ChatMessage[];
|
|
1813
|
+
currentMessage: ChatMessage;
|
|
1814
|
+
};
|
|
1815
|
+
interface MessageCallbackProps {
|
|
1816
|
+
message: ChatMessage;
|
|
1817
|
+
}
|
|
1818
|
+
type MessageSubmitCallback = (props: MessageCallbackProps) => unknown;
|
|
1819
|
+
|
|
1820
|
+
declare class ChatMessage {
|
|
1821
|
+
message: ReactNode;
|
|
1822
|
+
messageType: TMessageType;
|
|
1823
|
+
attachments: IAttachment[];
|
|
1824
|
+
reference: ReactNode;
|
|
1825
|
+
id: number;
|
|
1826
|
+
constructor(message?: ReactNode, messageType?: TMessageType, attachments?: IAttachment[], reference?: ReactNode);
|
|
1827
|
+
clone: () => ChatMessage;
|
|
1828
|
+
removeAttachment(attachment: IAttachment): void;
|
|
1829
|
+
addAttachmentDescription(attachment: IAttachment, description: string): void;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
declare const AutoscrollContainer: ({ children }: {
|
|
1833
|
+
children: ReactNode;
|
|
1834
|
+
}) => React$1.JSX.Element;
|
|
1835
|
+
|
|
1836
|
+
declare class ChatController<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
1837
|
+
private onMessageSubmit;
|
|
1838
|
+
currentIndex: number;
|
|
1839
|
+
state: TChatControllerState & T;
|
|
1840
|
+
private internalAudioRecorder;
|
|
1841
|
+
private internalCameraRecorder;
|
|
1842
|
+
private maxId;
|
|
1843
|
+
audioRecorder: {
|
|
1844
|
+
start: () => void;
|
|
1845
|
+
stop: () => Promise<void>;
|
|
1846
|
+
record: number;
|
|
1847
|
+
state: _apia_util.AudioRecorderState;
|
|
1848
|
+
};
|
|
1849
|
+
constructor(props: Partial<TChatControllerState & T>, onMessageSubmit: MessageSubmitCallback);
|
|
1850
|
+
removeMessage(idx: number): void;
|
|
1851
|
+
addMessage(message: ChatMessage): void;
|
|
1852
|
+
clearHistory(): void;
|
|
1853
|
+
clearMessage(): void;
|
|
1854
|
+
removeAttachment(attachment: IAttachment): void;
|
|
1855
|
+
private handleSubmit;
|
|
1856
|
+
private isForHistory;
|
|
1857
|
+
private canGoNext;
|
|
1858
|
+
private canGoPrev;
|
|
1859
|
+
nextMessage(): void;
|
|
1860
|
+
prevMessage(): void;
|
|
1861
|
+
protected getAdditionalProps(): Partial<MessageCallbackProps>;
|
|
1862
|
+
History: (() => React$1.JSX.Element) & {
|
|
1863
|
+
displayName: string;
|
|
1864
|
+
};
|
|
1865
|
+
Attachments: (() => React$1.JSX.Element) & {
|
|
1866
|
+
displayName: string;
|
|
1867
|
+
};
|
|
1868
|
+
TextArea: (() => React$1.JSX.Element) & {
|
|
1869
|
+
displayName: string;
|
|
1870
|
+
};
|
|
1871
|
+
Renderer: () => React$1.JSX.Element;
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
declare class FloatingChatController extends ChatController<{
|
|
1875
|
+
isVisible: boolean;
|
|
1876
|
+
}> {
|
|
1877
|
+
private modalTitle?;
|
|
1878
|
+
constructor(props: Partial<TChatControllerState>, onMessageSubmit: MessageSubmitCallback, modalTitle?: string | undefined);
|
|
1879
|
+
open(onClose: () => unknown): void;
|
|
1880
|
+
Window: (() => React$1.JSX.Element | null) & {
|
|
1881
|
+
displayName: string;
|
|
1882
|
+
};
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
declare function getBase64FromFile(f: File): Promise<string>;
|
|
1886
|
+
declare function getBase64FromBlob(b: Blob): Promise<string>;
|
|
1887
|
+
declare function getFileExtension(name: string): string | undefined;
|
|
1888
|
+
declare function isImage(base64: string): boolean;
|
|
1889
|
+
|
|
1890
|
+
export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, AutoEllipsis, Autocomplete, type AutocompleteCmpProps, AutocompleteController, type AutocompleteOption, type AutocompleteProps, AutogrowTextarea, AutoscrollContainer, BaseButton, CalendarModal, Captcha, ChatController, ChatMessage, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, FieldErrorMessage, FieldLabel, FloatingChatController, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type IAttachment, type ICalendarModal, type IConfirm, type IDialogButtonBar, type IDialogHeader, type IField, type IFieldErrorMessage, type IIconInput, type IOverlay, type IRequiredMark, type IResponsiveComponent, type ISimpleButton, IconButton, IconInput, IconsList, LabelBox, LinearLoader, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, type MessageCallbackProps, type MessageSubmitCallback, Modal, NumberInput, Overlay, ProgressBar, RequiredMark, ScreenLocker, SimpleButton, SortableList, SortableListItem, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TChatControllerState, type TCheckbox, type TDateProps, type TFieldLabel, type TGetTabsController, type TIcon, type TIconButton, type TIconRenderer, type TIconSize, type TIconsList, type TListbox, type TMenuItem, type TMessageType, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TSubmenu, type TTab, type TTabLabelRenderer as TTabRenderer, type TToolbarIconButton as TToolDefinition, type TTooltip, type TUseModalConfiguration, Tab, Tabs, TabsContent, TabsController, TabsList, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, WaiTypeAhead, getBase64FromBlob, getBase64FromFile, getFieldErrorStyles, getFieldTouchedStyles, getFileExtension, importComponent, isImage, makeResponsiveComponent, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useModal, useModalContext, useOtherTagButton };
|
|
1801
1891
|
//# sourceMappingURL=index.d.ts.map
|