@mobilon-dev/chotto 0.3.107 → 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/messages/useMessageHoverActions.js +9 -8
- 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/apps/data/messages.d.ts +197 -0
- 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/messages/useMessageHoverActions.d.ts +2 -1
- 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
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { type PropType } from "vue";
|
|
2
|
+
import { type ChottoUploadFileFn } from '@/hooks';
|
|
1
3
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
4
|
filebumpUrl: {
|
|
3
5
|
type: StringConstructor;
|
|
4
6
|
default: string;
|
|
5
7
|
};
|
|
8
|
+
uploader: {
|
|
9
|
+
type: PropType<ChottoUploadFileFn>;
|
|
10
|
+
default: undefined;
|
|
11
|
+
};
|
|
6
12
|
state: {
|
|
7
13
|
type: StringConstructor;
|
|
8
14
|
default: string;
|
|
@@ -18,6 +24,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
18
24
|
type: StringConstructor;
|
|
19
25
|
default: string;
|
|
20
26
|
};
|
|
27
|
+
uploader: {
|
|
28
|
+
type: PropType<ChottoUploadFileFn>;
|
|
29
|
+
default: undefined;
|
|
30
|
+
};
|
|
21
31
|
state: {
|
|
22
32
|
type: StringConstructor;
|
|
23
33
|
default: string;
|
|
@@ -30,6 +40,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
30
40
|
onFileUploaded?: ((...args: any[]) => any) | undefined;
|
|
31
41
|
}>, {
|
|
32
42
|
state: string;
|
|
43
|
+
uploader: ChottoUploadFileFn;
|
|
33
44
|
filebumpUrl: string;
|
|
34
45
|
maxAttachedFiles: number;
|
|
35
46
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/dist/types/components/2_chatinput_elements/FileUploader/stories/FileUploader.stories.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ declare const meta: Meta<typeof FileUploader>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof FileUploader>;
|
|
6
6
|
export declare const Standard: Story;
|
|
7
|
+
export declare const CustomUploader: Story;
|
|
8
|
+
export declare const InjectedUploader: Story;
|
|
7
9
|
export declare const InactiveButton: Story;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type PropType } from "vue";
|
|
2
|
+
import { type ChottoUploadFileFn } from '@/hooks';
|
|
1
3
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
4
|
type: {
|
|
3
5
|
type: StringConstructor;
|
|
@@ -7,6 +9,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
7
9
|
type: StringConstructor;
|
|
8
10
|
required: true;
|
|
9
11
|
};
|
|
12
|
+
uploader: {
|
|
13
|
+
type: PropType<ChottoUploadFileFn>;
|
|
14
|
+
default: undefined;
|
|
15
|
+
};
|
|
10
16
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
17
|
fileSelected: (...args: any[]) => void;
|
|
12
18
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -18,7 +24,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
18
24
|
type: StringConstructor;
|
|
19
25
|
required: true;
|
|
20
26
|
};
|
|
27
|
+
uploader: {
|
|
28
|
+
type: PropType<ChottoUploadFileFn>;
|
|
29
|
+
default: undefined;
|
|
30
|
+
};
|
|
21
31
|
}>> & Readonly<{
|
|
22
32
|
onFileSelected?: ((...args: any[]) => any) | undefined;
|
|
23
|
-
}>, {
|
|
33
|
+
}>, {
|
|
34
|
+
uploader: ChottoUploadFileFn;
|
|
35
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
24
36
|
export default _default;
|
|
@@ -10,6 +10,10 @@ declare const meta: {
|
|
|
10
10
|
type: StringConstructor;
|
|
11
11
|
required: true;
|
|
12
12
|
};
|
|
13
|
+
uploader: {
|
|
14
|
+
type: import("vue").PropType<import("../../../../index.ts").ChottoUploadFileFn>;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
13
17
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
18
|
fileSelected: (...args: any[]) => void;
|
|
15
19
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -21,9 +25,15 @@ declare const meta: {
|
|
|
21
25
|
type: StringConstructor;
|
|
22
26
|
required: true;
|
|
23
27
|
};
|
|
28
|
+
uploader: {
|
|
29
|
+
type: import("vue").PropType<import("../../../../index.ts").ChottoUploadFileFn>;
|
|
30
|
+
default: undefined;
|
|
31
|
+
};
|
|
24
32
|
}>> & Readonly<{
|
|
25
33
|
onFileSelected?: ((...args: any[]) => any) | undefined;
|
|
26
|
-
}>, {
|
|
34
|
+
}>, {
|
|
35
|
+
uploader: import("../../../../index.ts").ChottoUploadFileFn;
|
|
36
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
27
37
|
args: {};
|
|
28
38
|
};
|
|
29
39
|
export default meta;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type ChottoUploadFileFn } from '@/hooks';
|
|
1
3
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
4
|
state: {
|
|
3
5
|
type: StringConstructor;
|
|
@@ -7,6 +9,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
7
9
|
type: StringConstructor;
|
|
8
10
|
default: null;
|
|
9
11
|
};
|
|
12
|
+
uploader: {
|
|
13
|
+
type: PropType<ChottoUploadFileFn>;
|
|
14
|
+
default: undefined;
|
|
15
|
+
};
|
|
10
16
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
17
|
state: {
|
|
12
18
|
type: StringConstructor;
|
|
@@ -16,8 +22,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
16
22
|
type: StringConstructor;
|
|
17
23
|
default: null;
|
|
18
24
|
};
|
|
25
|
+
uploader: {
|
|
26
|
+
type: PropType<ChottoUploadFileFn>;
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
19
29
|
}>> & Readonly<{}>, {
|
|
20
30
|
state: string;
|
|
31
|
+
uploader: ChottoUploadFileFn;
|
|
21
32
|
filebumpUrl: string;
|
|
22
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
34
|
export default _default;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type ChottoUploadFileFn } from '@/hooks';
|
|
1
3
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
4
|
state: {
|
|
3
5
|
type: StringConstructor;
|
|
@@ -7,6 +9,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
7
9
|
type: StringConstructor;
|
|
8
10
|
default: null;
|
|
9
11
|
};
|
|
12
|
+
uploader: {
|
|
13
|
+
type: PropType<ChottoUploadFileFn>;
|
|
14
|
+
default: undefined;
|
|
15
|
+
};
|
|
10
16
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
17
|
state: {
|
|
12
18
|
type: StringConstructor;
|
|
@@ -16,8 +22,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
16
22
|
type: StringConstructor;
|
|
17
23
|
default: null;
|
|
18
24
|
};
|
|
25
|
+
uploader: {
|
|
26
|
+
type: PropType<ChottoUploadFileFn>;
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
19
29
|
}>> & Readonly<{}>, {
|
|
20
30
|
state: string;
|
|
31
|
+
uploader: ChottoUploadFileFn;
|
|
21
32
|
filebumpUrl: string;
|
|
22
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
34
|
export default _default;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type MaybeRefOrGetter } from 'vue';
|
|
2
2
|
/**
|
|
3
3
|
* Hover-панели сообщения (реакции и меню по трём точкам).
|
|
4
|
-
*
|
|
4
|
+
* Недоступны для SMS (канал не поддерживает реакции, ответ и редактирование)
|
|
5
|
+
* и для удалённых сообщений (tombstone).
|
|
5
6
|
*/
|
|
6
7
|
export declare function useMessageHoverActions(channel: MaybeRefOrGetter<string | undefined>, reactionsEnabled?: MaybeRefOrGetter<boolean>, message?: MaybeRefOrGetter<unknown>): {
|
|
7
8
|
hoverActionsEnabled: import("vue").ComputedRef<boolean>;
|
|
@@ -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
|
+
};
|