@mobilon-dev/chotto 0.3.108 → 0.3.109
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/README.md +33 -0
- package/dist/chotto.css +1 -1
- package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +32 -27
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +1 -1
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +58 -54
- package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue.js +2 -2
- package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +55 -56
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue.js +2 -2
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +42 -35
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue.js +2 -2
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +29 -22
- package/dist/hooks/uploadFile/types.js +4 -0
- package/dist/hooks/uploadFile/uploadFile.js +12 -13
- package/dist/hooks/uploadFile/useChottoUploader.js +56 -0
- package/dist/index.js +157 -152
- package/dist/types/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.d.ts +2 -0
- package/dist/types/components/2_chatinput_elements/FileUploader/FileUploader.vue.d.ts +11 -0
- package/dist/types/components/2_chatinput_elements/FileUploader/stories/FileUploader.stories.d.ts +2 -0
- package/dist/types/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue.d.ts +13 -1
- package/dist/types/components/2_chatinput_elements/WABAAttachmentSection/stories/WABAAttachmentSection.stories.d.ts +11 -1
- package/dist/types/components/2_elements/AudioRecorder/AudioRecorder.vue.d.ts +11 -0
- package/dist/types/components/2_elements/VideoRecorder/VideoRecorder.vue.d.ts +11 -0
- package/dist/types/hooks/uploadFile/index.d.ts +2 -0
- package/dist/types/hooks/uploadFile/types.d.ts +12 -0
- package/dist/types/hooks/uploadFile/uploadFile.d.ts +2 -3
- package/dist/types/hooks/uploadFile/useChottoUploader.d.ts +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
/** Результат загрузки, который возвращает host adapter. */
|
|
3
|
+
export type ChottoUploadResult = {
|
|
4
|
+
url: string;
|
|
5
|
+
filename: string;
|
|
6
|
+
};
|
|
7
|
+
export type ChottoUploadMeta = {
|
|
8
|
+
/** Кто инициировал: обычный файл, запись аудио, запись видео. */
|
|
9
|
+
kind?: 'file' | 'audio' | 'video';
|
|
10
|
+
};
|
|
11
|
+
export type ChottoUploadFileFn = (file: File | Blob, meta?: ChottoUploadMeta) => Promise<ChottoUploadResult>;
|
|
12
|
+
export declare const chottoUploadFileKey: InjectionKey<ChottoUploadFileFn>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { generatePreview } from './generatePreview';
|
|
2
|
-
type UploadFileResult = {
|
|
2
|
+
export type UploadFileResult = {
|
|
3
3
|
url: string;
|
|
4
4
|
name: string;
|
|
5
5
|
size: number;
|
|
@@ -9,5 +9,4 @@ type UploadFileResult = {
|
|
|
9
9
|
} | {
|
|
10
10
|
status: 'error';
|
|
11
11
|
};
|
|
12
|
-
export declare const uploadFile: (filebumpUrl: string
|
|
13
|
-
export {};
|
|
12
|
+
export declare const uploadFile: (filebumpUrl: string, selectedFile: File) => Promise<UploadFileResult>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { type ChottoUploadFileFn, type ChottoUploadMeta } from './types';
|
|
3
|
+
import { type UploadFileResult } from './uploadFile';
|
|
4
|
+
export declare function runChottoUpload(params: {
|
|
5
|
+
file: File | Blob;
|
|
6
|
+
meta?: ChottoUploadMeta;
|
|
7
|
+
uploader?: ChottoUploadFileFn | null;
|
|
8
|
+
injectedUploader?: ChottoUploadFileFn | null;
|
|
9
|
+
filebumpUrl?: string | null;
|
|
10
|
+
}): Promise<UploadFileResult>;
|
|
11
|
+
export declare function useChottoUploader(options?: {
|
|
12
|
+
uploader?: MaybeRefOrGetter<ChottoUploadFileFn | undefined>;
|
|
13
|
+
filebumpUrl?: MaybeRefOrGetter<string | null | undefined>;
|
|
14
|
+
}): {
|
|
15
|
+
upload: (file: File | Blob, meta?: ChottoUploadMeta) => Promise<UploadFileResult>;
|
|
16
|
+
};
|