@aleph-alpha/chat-kit 2.1.1 → 2.2.0
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/{CkInput.vue_vue_type_script_setup_true_lang-DPZedAQS.js → CkInput.vue_vue_type_script_setup_true_lang-CjfKRuZs.js} +291 -61
- package/dist/chat-kit.css +40 -5
- package/dist/components/base/CkDropZoneOverlay/CkDropZoneIllustration.vue.d.ts +4 -0
- package/dist/components/base/CkDropZoneOverlay/CkDropZoneIllustration.vue.d.ts.map +1 -0
- package/dist/components/base/CkDropZoneOverlay/CkDropZoneOverlay.stories.d.ts +17 -0
- package/dist/components/base/CkDropZoneOverlay/CkDropZoneOverlay.stories.d.ts.map +1 -0
- package/dist/components/base/CkDropZoneOverlay/CkDropZoneOverlay.vue.d.ts +31 -0
- package/dist/components/base/CkDropZoneOverlay/CkDropZoneOverlay.vue.d.ts.map +1 -0
- package/dist/components/base/CkDropZoneOverlay/index.d.ts +3 -0
- package/dist/components/base/CkDropZoneOverlay/index.d.ts.map +1 -0
- package/dist/components/base/CkDropZoneOverlay/types.d.ts +88 -0
- package/dist/components/base/CkDropZoneOverlay/types.d.ts.map +1 -0
- package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.vue.d.ts.map +1 -1
- package/dist/components/base/index.d.ts +2 -0
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +19 -18
- package/dist/composables/fileUpload/index.d.ts.map +1 -1
- package/dist/composables/index.js +1 -1
- package/dist/{index-BPXg1Yf6.js → index-CfXEGjc7.js} +39 -19
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -20
- package/package.json +1 -1
- package/src/components/base/CkDropZoneOverlay/CkDropZoneIllustration.vue +125 -0
- package/src/components/base/CkDropZoneOverlay/CkDropZoneOverlay.spec.ts +104 -0
- package/src/components/base/CkDropZoneOverlay/CkDropZoneOverlay.stories.ts +130 -0
- package/src/components/base/CkDropZoneOverlay/CkDropZoneOverlay.vue +272 -0
- package/src/components/base/CkDropZoneOverlay/index.ts +2 -0
- package/src/components/base/CkDropZoneOverlay/types.ts +93 -0
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue +22 -1
- package/src/components/base/index.ts +7 -0
- package/src/components/index.ts +5 -0
- package/src/composables/fileUpload/index.spec.ts +18 -7
- package/src/composables/fileUpload/index.ts +39 -19
- package/src/index.ts +5 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CkDropZoneOverlayProps, CkDropZoneRejection } from './types';
|
|
2
|
+
declare var __VLS_13: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_13) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<CkDropZoneOverlayProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
7
|
+
files: (files: File[]) => any;
|
|
8
|
+
rejected: (rejections: CkDropZoneRejection[]) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<CkDropZoneOverlayProps> & Readonly<{
|
|
10
|
+
onFiles?: ((files: File[]) => any) | undefined;
|
|
11
|
+
onRejected?: ((rejections: CkDropZoneRejection[]) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
ariaLabel: string;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
accept: string;
|
|
16
|
+
maxFileSizeBytes: number;
|
|
17
|
+
maxFiles: number;
|
|
18
|
+
heading: string;
|
|
19
|
+
hint: string;
|
|
20
|
+
showErrors: boolean;
|
|
21
|
+
errorTimeoutMs: number;
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=CkDropZoneOverlay.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CkDropZoneOverlay.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkDropZoneOverlay/CkDropZoneOverlay.vue"],"names":[],"mappings":"AAsRA,OAAO,KAAK,EAEV,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAkYjB,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAGhD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkDropZoneOverlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACvE,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** Why a dropped file was rejected. */
|
|
2
|
+
export type CkDropZoneRejectionReason = 'unsupported-type' | 'too-large' | 'too-many';
|
|
3
|
+
export interface CkDropZoneRejection {
|
|
4
|
+
/** The offending file, when the rejection concerns a specific file. */
|
|
5
|
+
file?: File;
|
|
6
|
+
/** Machine-readable reason, for consumers building their own messaging. */
|
|
7
|
+
reason: CkDropZoneRejectionReason;
|
|
8
|
+
/** Default human-readable (English) message used by the built-in toast. */
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Full-window drag-and-drop overlay. Listens for file drags anywhere on the
|
|
13
|
+
* page, reveals a teleported overlay, validates dropped files against `accept`,
|
|
14
|
+
* `maxFileSizeBytes` and `maxFiles`, and emits the accepted files.
|
|
15
|
+
*
|
|
16
|
+
* Purely presentational and self-contained: it owns its own drag state and has
|
|
17
|
+
* no knowledge of the host app. All limits and copy are configurable, and
|
|
18
|
+
* rejection handling can be delegated to the consumer via the `rejected` event.
|
|
19
|
+
*
|
|
20
|
+
* @category Form Inputs
|
|
21
|
+
* @useCases page-level file attachment, drag-and-drop upload, chat composer
|
|
22
|
+
* @keywords drag and drop, drop zone, file upload, overlay, attachments
|
|
23
|
+
* @related CkFileItemsList, CkPromptInput
|
|
24
|
+
*/
|
|
25
|
+
export interface CkDropZoneOverlayProps {
|
|
26
|
+
/**
|
|
27
|
+
* HTML `accept` string used to validate dropped files (extensions, MIME
|
|
28
|
+
* types and `type/*` wildcards). Empty string accepts everything.
|
|
29
|
+
* @default ''
|
|
30
|
+
*/
|
|
31
|
+
accept?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Reject files larger than this many bytes.
|
|
34
|
+
* @default Number.POSITIVE_INFINITY
|
|
35
|
+
*/
|
|
36
|
+
maxFileSizeBytes?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Maximum number of files accepted per drop. Excess files are dropped and
|
|
39
|
+
* reported as a single rejection.
|
|
40
|
+
* @default Number.POSITIVE_INFINITY
|
|
41
|
+
*/
|
|
42
|
+
maxFiles?: number;
|
|
43
|
+
/**
|
|
44
|
+
* When true, the overlay never appears and window drag events are ignored,
|
|
45
|
+
* so the page behaves normally (e.g. while a response is streaming or the
|
|
46
|
+
* attachment limit is already reached).
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Heading text. Defaults to a sensible singular/plural string derived from
|
|
52
|
+
* `maxFiles` (e.g. "Drop a file here to add to chat" vs "Drop files here to
|
|
53
|
+
* add to chat").
|
|
54
|
+
*/
|
|
55
|
+
heading?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Secondary hint shown under the heading (e.g. supported formats / limits).
|
|
58
|
+
* Pass an empty string to hide it.
|
|
59
|
+
* @default 'Add txt, docx, pdf, md, or csv'
|
|
60
|
+
*/
|
|
61
|
+
hint?: string;
|
|
62
|
+
/**
|
|
63
|
+
* `aria-label` for the overlay dialog.
|
|
64
|
+
* @default 'Drop files anywhere to attach'
|
|
65
|
+
*/
|
|
66
|
+
ariaLabel?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Render the built-in error toast for rejected files. Set to `false` to take
|
|
69
|
+
* over messaging via the `rejected` event.
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
showErrors?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* How long the built-in error toast stays visible, in milliseconds.
|
|
75
|
+
* @default 4000
|
|
76
|
+
*/
|
|
77
|
+
errorTimeoutMs?: number;
|
|
78
|
+
}
|
|
79
|
+
export interface CkDropZoneOverlayEmits {
|
|
80
|
+
/** Files that passed validation, capped to `maxFiles`. */
|
|
81
|
+
(event: 'files', files: File[]): void;
|
|
82
|
+
/**
|
|
83
|
+
* Rejected files / drops. Emitted alongside the built-in toast so consumers
|
|
84
|
+
* can integrate their own notification system (and disable `showErrors`).
|
|
85
|
+
*/
|
|
86
|
+
(event: 'rejected', rejections: CkDropZoneRejection[]): void;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkDropZoneOverlay/types.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,MAAM,MAAM,yBAAyB,GACjC,kBAAkB,GAClB,WAAW,GACX,UAAU,CAAC;AAEf,MAAM,WAAW,mBAAmB;IAClC,uEAAuE;IACvE,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,2EAA2E;IAC3E,MAAM,EAAE,yBAAyB,CAAC;IAClC,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,0DAA0D;IAC1D,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IACtC;;;OAGG;IACH,CAAC,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC;CAC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkFeedbackDialog.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CkFeedbackDialog.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue"],"names":[],"mappings":"AAiUA,OAAO,KAAK,EACV,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAohBjB,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -3,6 +3,8 @@ export { CkAgentMessage } from './CkAgentMessage';
|
|
|
3
3
|
export { CkConversationLayout } from './CkConversationLayout';
|
|
4
4
|
export type { CkConversationLayoutProps } from './CkConversationLayout';
|
|
5
5
|
export { CkCopyMessageActionButton } from './CkCopyMessageActionButton';
|
|
6
|
+
export { CkDropZoneOverlay } from './CkDropZoneOverlay';
|
|
7
|
+
export type { CkDropZoneOverlayProps, CkDropZoneOverlayEmits, CkDropZoneRejection, CkDropZoneRejectionReason, } from './CkDropZoneOverlay';
|
|
6
8
|
export { CkFeedbackButton } from './CkFeedbackButton';
|
|
7
9
|
export type { CkFeedbackButtonProps, CkFeedbackValue, } from './CkFeedbackButton';
|
|
8
10
|
export { CkFeedbackDialog } from './CkFeedbackDialog';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM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AACpD,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CkAgentMessage, CkConversationLayout, CkCopyMessageActionButton, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistoryItem, CkHistoryWrapper, CkMarkdownRenderer, CkMessageActionButton, CkModelSelector, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './base';
|
|
2
|
-
export type { CkConversationLayoutProps, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkUserMessageProps, } from './base';
|
|
1
|
+
export { CkAgentMessage, CkConversationLayout, CkCopyMessageActionButton, CkDropZoneOverlay, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistoryItem, CkHistoryWrapper, CkMarkdownRenderer, CkMessageActionButton, CkModelSelector, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './base';
|
|
2
|
+
export type { CkConversationLayoutProps, CkDropZoneOverlayProps, CkDropZoneOverlayEmits, CkDropZoneRejection, CkDropZoneRejectionReason, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkUserMessageProps, } from './base';
|
|
3
3
|
export { CkConversation, CkHistory, CkInput } from './composed';
|
|
4
4
|
export type { CkConversationProps, CkHistoryEmits, CkHistoryProps, } from './composed';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { _, a, b, C, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s } from "../CkInput.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _, a, b, C, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t } from "../CkInput.vue_vue_type_script_setup_true_lang-CjfKRuZs.js";
|
|
2
2
|
export {
|
|
3
3
|
_ as CkAgentMessage,
|
|
4
4
|
a as CkConversation,
|
|
5
5
|
b as CkConversationLayout,
|
|
6
6
|
C as CkCopyMessageActionButton,
|
|
7
|
-
c as
|
|
8
|
-
d as
|
|
9
|
-
e as
|
|
10
|
-
f as
|
|
11
|
-
g as
|
|
12
|
-
h as
|
|
13
|
-
i as
|
|
14
|
-
j as
|
|
15
|
-
k as
|
|
16
|
-
l as
|
|
17
|
-
m as
|
|
18
|
-
n as
|
|
19
|
-
o as
|
|
20
|
-
p as
|
|
21
|
-
q as
|
|
22
|
-
r as
|
|
23
|
-
s as
|
|
7
|
+
c as CkDropZoneOverlay,
|
|
8
|
+
d as CkFeedbackButton,
|
|
9
|
+
e as CkFeedbackDialog,
|
|
10
|
+
f as CkFileItemsList,
|
|
11
|
+
g as CkHistory,
|
|
12
|
+
h as CkHistoryItem,
|
|
13
|
+
i as CkHistoryWrapper,
|
|
14
|
+
j as CkInput,
|
|
15
|
+
k as CkMarkdownRenderer,
|
|
16
|
+
l as CkMessageActionButton,
|
|
17
|
+
m as CkModelSelector,
|
|
18
|
+
n as CkPromptActionButton,
|
|
19
|
+
o as CkPromptInput,
|
|
20
|
+
p as CkPromptInputDisclaimer,
|
|
21
|
+
q as CkPromptStopButton,
|
|
22
|
+
r as CkSendIcon,
|
|
23
|
+
s as CkStopIcon,
|
|
24
|
+
t as CkUserMessage
|
|
24
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/fileUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAItE,eAAO,MAAM,2BAA2B,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/fileUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAItE,eAAO,MAAM,2BAA2B,EAAE,oBA0FzC,CAAC;AAEF,QAAA,MAA2B,kCAAkC,+FACF,CAAC;AAE5D,OAAO,EAAE,kCAAkC,EAAE,4BAA4B,EAAE,CAAC;AAE5E,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,0BAA0B,EAC1B,SAAS,EACT,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1534,40 +1534,60 @@ const defaultDocumentUploadConfig = {
|
|
|
1534
1534
|
workflowConfig: {
|
|
1535
1535
|
name: WORKFLOW_ID,
|
|
1536
1536
|
workflow_name: "DocumentAI",
|
|
1537
|
-
definition: { workflow_name: "DocumentAI" },
|
|
1538
1537
|
parameters: {
|
|
1539
|
-
|
|
1540
|
-
|
|
1538
|
+
chunk_extraction: {
|
|
1539
|
+
chunker: {
|
|
1540
|
+
batch_size: 1,
|
|
1541
|
+
chunk_overlap: 200,
|
|
1542
|
+
chunk_size: 1200,
|
|
1543
|
+
include_image_descriptions: false,
|
|
1544
|
+
kind: "recursive",
|
|
1545
|
+
separators: ["\n\n", "\n", " ", ".", ",", ""]
|
|
1546
|
+
}
|
|
1541
1547
|
},
|
|
1542
1548
|
document_extraction: {
|
|
1543
|
-
pdf_reader: { kind: "pypdf", batch_size: 10 },
|
|
1544
1549
|
docx_reader: {
|
|
1545
|
-
kind: "docx",
|
|
1546
1550
|
batch_size: 10,
|
|
1551
|
+
kind: "docx",
|
|
1547
1552
|
split_by_sections: false
|
|
1548
1553
|
},
|
|
1549
|
-
|
|
1550
|
-
xlsx_reader: {
|
|
1551
|
-
kind: "xlsx",
|
|
1554
|
+
markdown_reader: {
|
|
1552
1555
|
batch_size: 10,
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
+
kind: "markdown"
|
|
1557
|
+
},
|
|
1558
|
+
pdf_reader: {
|
|
1559
|
+
batch_size: 10,
|
|
1560
|
+
ignore_headers_footers: true,
|
|
1561
|
+
kind: "vision",
|
|
1562
|
+
max_tokens: 16384,
|
|
1563
|
+
model: "gemini-2.5-flash",
|
|
1564
|
+
retries: 3,
|
|
1565
|
+
timeout: 120,
|
|
1566
|
+
workers: 4
|
|
1556
1567
|
},
|
|
1557
|
-
markdown_reader: { kind: "markdown", batch_size: 10 },
|
|
1558
1568
|
plaintext_reader: {
|
|
1559
|
-
kind: "plaintext",
|
|
1560
1569
|
batch_size: 10,
|
|
1570
|
+
kind: "plaintext",
|
|
1561
1571
|
max_content_size: 5e5,
|
|
1562
1572
|
min_space_ratio: 0.02
|
|
1573
|
+
},
|
|
1574
|
+
pptx_reader: {
|
|
1575
|
+
batch_size: 10,
|
|
1576
|
+
include_notes: true,
|
|
1577
|
+
kind: "pptx"
|
|
1578
|
+
},
|
|
1579
|
+
xlsx_reader: {
|
|
1580
|
+
batch_size: 10,
|
|
1581
|
+
include_empty_sheets: false,
|
|
1582
|
+
kind: "xlsx",
|
|
1583
|
+
max_cols: 100,
|
|
1584
|
+
max_rows: 1e4
|
|
1563
1585
|
}
|
|
1564
1586
|
},
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
include_image_descriptions: false,
|
|
1570
|
-
chunk_size: 200
|
|
1587
|
+
initialization: {
|
|
1588
|
+
store: {
|
|
1589
|
+
batch_size: 10,
|
|
1590
|
+
pages_per_part: 25
|
|
1571
1591
|
}
|
|
1572
1592
|
}
|
|
1573
1593
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { useChat, useConversationSessions, useConversations, } from './composabl
|
|
|
5
5
|
export type { ChatActions, ChatState, ConversationSession, CreateConversationInput, MessageHandler, MutationOptions, UseChatReturn, UseConversationSessionsReturn, UseConversationsOptions, UseConversationsReturn, } from './composables';
|
|
6
6
|
export { SdkError, createDocumentUploadProvider, defaultDocumentUploadConfig, defaultEndpoints, useDocumentUploadWithDefaultConfig, } from './composables/fileUpload';
|
|
7
7
|
export type { DocumentUploadConfig, DocumentUploadProvider, FileEntry, FileStatus, } from './composables/fileUpload';
|
|
8
|
-
export { CkAgentMessage, CkConversation, CkConversationLayout, CkCopyMessageActionButton, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistory, CkHistoryItem, CkHistoryWrapper, CkInput, CkMarkdownRenderer, CkMessageActionButton, CkModelSelector, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './components';
|
|
9
|
-
export type { CkConversationLayoutProps, CkConversationProps, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryEmits, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkUserMessageProps, } from './components';
|
|
8
|
+
export { CkAgentMessage, CkConversation, CkConversationLayout, CkCopyMessageActionButton, CkDropZoneOverlay, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistory, CkHistoryItem, CkHistoryWrapper, CkInput, CkMarkdownRenderer, CkMessageActionButton, CkModelSelector, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './components';
|
|
9
|
+
export type { CkConversationLayoutProps, CkConversationProps, CkDropZoneOverlayProps, CkDropZoneOverlayEmits, CkDropZoneRejection, CkDropZoneRejectionReason, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryEmits, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkUserMessageProps, } from './components';
|
|
10
10
|
export { formatRelativeTime } from './helpers';
|
|
11
11
|
export type { BaseMessage, Conversation, ConversationTree, MessageContent, MessageContentStatus, MessageMetadata, MessageReasoningContent, MessageRole, MessageStatus, MessageTextContent, MessageToolContent, TreeMessage, } from './types';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AASpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EACL,OAAO,EACP,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,EACT,UAAU,GACX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,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BAAwB,EACxB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
import { u } from "./useMessageHandler-CMdy-lm0.js";
|
|
2
2
|
import { C, d, p, u as u2, a } from "./useChatKitLabels-ZutacPad.js";
|
|
3
|
-
import { S, c, d as d2, a as a2, u as u3, b, e, f } from "./index-
|
|
4
|
-
import { _, a as a3, b as b2, C as C2, c as c2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s, t } from "./CkInput.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { S, c, d as d2, a as a2, u as u3, b, e, f } from "./index-CfXEGjc7.js";
|
|
4
|
+
import { _, a as a3, b as b2, C as C2, c as c2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s, t, u as u4 } from "./CkInput.vue_vue_type_script_setup_true_lang-CjfKRuZs.js";
|
|
5
5
|
export {
|
|
6
6
|
C as CHAT_KIT_LABELS,
|
|
7
7
|
_ as CkAgentMessage,
|
|
8
8
|
a3 as CkConversation,
|
|
9
9
|
b2 as CkConversationLayout,
|
|
10
10
|
C2 as CkCopyMessageActionButton,
|
|
11
|
-
c2 as
|
|
12
|
-
d3 as
|
|
13
|
-
e2 as
|
|
14
|
-
f2 as
|
|
15
|
-
g as
|
|
16
|
-
h as
|
|
17
|
-
i as
|
|
18
|
-
j as
|
|
19
|
-
k as
|
|
20
|
-
l as
|
|
21
|
-
m as
|
|
22
|
-
n as
|
|
23
|
-
o as
|
|
24
|
-
p2 as
|
|
25
|
-
q as
|
|
26
|
-
r as
|
|
27
|
-
s as
|
|
11
|
+
c2 as CkDropZoneOverlay,
|
|
12
|
+
d3 as CkFeedbackButton,
|
|
13
|
+
e2 as CkFeedbackDialog,
|
|
14
|
+
f2 as CkFileItemsList,
|
|
15
|
+
g as CkHistory,
|
|
16
|
+
h as CkHistoryItem,
|
|
17
|
+
i as CkHistoryWrapper,
|
|
18
|
+
j as CkInput,
|
|
19
|
+
k as CkMarkdownRenderer,
|
|
20
|
+
l as CkMessageActionButton,
|
|
21
|
+
m as CkModelSelector,
|
|
22
|
+
n as CkPromptActionButton,
|
|
23
|
+
o as CkPromptInput,
|
|
24
|
+
p2 as CkPromptInputDisclaimer,
|
|
25
|
+
q as CkPromptStopButton,
|
|
26
|
+
r as CkSendIcon,
|
|
27
|
+
s as CkStopIcon,
|
|
28
|
+
t as CkUserMessage,
|
|
28
29
|
S as SdkError,
|
|
29
30
|
c as createDocumentUploadProvider,
|
|
30
31
|
d as defaultChatKitLabels,
|
|
31
32
|
d2 as defaultDocumentUploadConfig,
|
|
32
33
|
a2 as defaultEndpoints,
|
|
33
|
-
|
|
34
|
+
u4 as formatRelativeTime,
|
|
34
35
|
p as provideChatKitLabels,
|
|
35
36
|
u3 as useChat,
|
|
36
37
|
u2 as useChatKitLabels,
|
package/package.json
CHANGED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ name: 'CkDropZoneIllustration' });
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<svg
|
|
7
|
+
width="208"
|
|
8
|
+
height="144"
|
|
9
|
+
viewBox="0 0 208 144"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
aria-hidden="true"
|
|
13
|
+
focusable="false"
|
|
14
|
+
>
|
|
15
|
+
<g clip-path="url(#ck-drop-zone-clip)">
|
|
16
|
+
<path
|
|
17
|
+
d="M0 71.5391C0 32.0292 32.0292 0 71.5391 0H135.739C175.249 0 207.278 32.0292 207.278 71.5391C207.278 111.049 175.249 143.078 135.739 143.078H71.5392C32.0292 143.078 0 111.049 0 71.5391Z"
|
|
18
|
+
fill="#F2EBE8"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
d="M120.899 98.2608L134.973 45.7385C135.223 44.805 136.182 44.251 137.116 44.5011L172.976 54.1098C173.909 54.3599 174.463 55.3195 174.213 56.2531L160.14 108.775C159.89 109.709 158.93 110.263 157.997 110.013L122.137 100.404C121.203 100.154 120.649 99.1943 120.899 98.2608Z"
|
|
22
|
+
fill="#FFCCBB"
|
|
23
|
+
stroke="#333333"
|
|
24
|
+
/>
|
|
25
|
+
<g>
|
|
26
|
+
<path
|
|
27
|
+
d="M153.839 69.86L144.18 67.2718C143.118 66.9871 142.015 67.6235 141.731 68.686L137.589 84.1409C137.305 85.2034 137.941 86.3056 139.004 86.5904L150.595 89.6962C151.657 89.9809 152.76 89.3445 153.044 88.282L156.668 74.759L153.839 69.86Z"
|
|
28
|
+
stroke="#1D1D1B"
|
|
29
|
+
stroke-width="1.75"
|
|
30
|
+
stroke-linecap="round"
|
|
31
|
+
stroke-linejoin="round"
|
|
32
|
+
/>
|
|
33
|
+
<path
|
|
34
|
+
d="M153.839 69.86L153.063 72.7578C152.921 73.2891 153.239 73.8402 153.77 73.9825L156.668 74.759"
|
|
35
|
+
stroke="#1D1D1B"
|
|
36
|
+
stroke-width="1.75"
|
|
37
|
+
stroke-linecap="round"
|
|
38
|
+
stroke-linejoin="round"
|
|
39
|
+
/>
|
|
40
|
+
<path
|
|
41
|
+
d="M143.783 76.4828L151.51 78.5534"
|
|
42
|
+
stroke="#1D1D1B"
|
|
43
|
+
stroke-width="1.75"
|
|
44
|
+
stroke-linecap="round"
|
|
45
|
+
stroke-linejoin="round"
|
|
46
|
+
/>
|
|
47
|
+
<path
|
|
48
|
+
d="M143.006 79.3806L150.733 81.4511"
|
|
49
|
+
stroke="#1D1D1B"
|
|
50
|
+
stroke-width="1.75"
|
|
51
|
+
stroke-linecap="round"
|
|
52
|
+
stroke-linejoin="round"
|
|
53
|
+
/>
|
|
54
|
+
<path
|
|
55
|
+
d="M142.23 82.2784L147.059 83.5725"
|
|
56
|
+
stroke="#1D1D1B"
|
|
57
|
+
stroke-width="1.75"
|
|
58
|
+
stroke-linecap="round"
|
|
59
|
+
stroke-linejoin="round"
|
|
60
|
+
/>
|
|
61
|
+
</g>
|
|
62
|
+
<path
|
|
63
|
+
d="M86.3795 98.2608L72.3062 45.7385C72.0561 44.805 71.0965 44.251 70.1629 44.5011L34.3029 54.1098C33.3694 54.3599 32.8153 55.3195 33.0655 56.2531L47.1388 108.775C47.3889 109.709 48.3485 110.263 49.2821 110.013L85.1421 100.404C86.0756 100.154 86.6297 99.1943 86.3795 98.2608Z"
|
|
64
|
+
fill="#FFE9B5"
|
|
65
|
+
stroke="#333333"
|
|
66
|
+
/>
|
|
67
|
+
<g>
|
|
68
|
+
<path
|
|
69
|
+
d="M60.3294 76.0227L58.0001 67.3293C60.3057 66.7116 62.7623 67.035 64.8294 68.2284C66.8966 69.4219 68.405 71.3877 69.0228 73.6933L60.3294 76.0227Z"
|
|
70
|
+
stroke="#1D1D1B"
|
|
71
|
+
stroke-width="1.75"
|
|
72
|
+
stroke-linecap="round"
|
|
73
|
+
stroke-linejoin="round"
|
|
74
|
+
/>
|
|
75
|
+
<path
|
|
76
|
+
d="M55.3303 68.8899C54.4077 69.3934 53.5755 70.0573 52.8752 70.8559C51.7015 72.1942 50.9511 73.8504 50.7187 75.6152C50.4864 77.38 50.7826 79.1741 51.5699 80.7706C52.3572 82.367 53.6002 83.6942 55.1417 84.5842C56.6833 85.4742 58.4541 85.8871 60.2304 85.7707C62.0066 85.6543 63.7084 85.0138 65.1206 83.9302C66.5328 82.8465 67.5919 81.3685 68.1641 79.6829C68.5135 78.6536 68.6717 77.5751 68.6371 76.4998"
|
|
77
|
+
stroke="#1D1D1B"
|
|
78
|
+
stroke-width="1.75"
|
|
79
|
+
stroke-linecap="round"
|
|
80
|
+
stroke-linejoin="round"
|
|
81
|
+
/>
|
|
82
|
+
</g>
|
|
83
|
+
<path
|
|
84
|
+
d="M76.5186 107.5L76.5185 35C76.5185 33.6193 77.6378 32.5 79.0185 32.5H128.519C129.899 32.5 131.019 33.6193 131.019 35V107.5C131.019 108.881 129.899 110 128.519 110H79.0186C77.6378 110 76.5186 108.881 76.5186 107.5Z"
|
|
85
|
+
fill="#FFB3DD"
|
|
86
|
+
stroke="#333333"
|
|
87
|
+
/>
|
|
88
|
+
<g>
|
|
89
|
+
<path
|
|
90
|
+
d="M107.519 56.8335H95.519C94.419 56.8335 93.519 57.7335 93.519 58.8335V82.1665C93.519 83.2675 94.419 84.1665 95.519 84.1665H111.519C112.619 84.1665 113.519 83.2675 113.519 82.1665V64.8335L107.519 56.8335Z"
|
|
91
|
+
stroke="#1D1D1B"
|
|
92
|
+
stroke-width="1.75"
|
|
93
|
+
stroke-linecap="round"
|
|
94
|
+
stroke-linejoin="round"
|
|
95
|
+
/>
|
|
96
|
+
<path
|
|
97
|
+
d="M107.519 56.8335V62.8335C107.519 63.9335 108.419 64.8335 109.519 64.8335H113.519"
|
|
98
|
+
stroke="#1D1D1B"
|
|
99
|
+
stroke-width="1.75"
|
|
100
|
+
stroke-linecap="round"
|
|
101
|
+
stroke-linejoin="round"
|
|
102
|
+
/>
|
|
103
|
+
<path
|
|
104
|
+
d="M103.519 78.8335V70.8335"
|
|
105
|
+
stroke="#1D1D1B"
|
|
106
|
+
stroke-width="1.75"
|
|
107
|
+
stroke-linecap="round"
|
|
108
|
+
stroke-linejoin="round"
|
|
109
|
+
/>
|
|
110
|
+
<path
|
|
111
|
+
d="M99.519 74.8335L103.519 70.8335L107.519 74.8335"
|
|
112
|
+
stroke="#1D1D1B"
|
|
113
|
+
stroke-width="1.75"
|
|
114
|
+
stroke-linecap="round"
|
|
115
|
+
stroke-linejoin="round"
|
|
116
|
+
/>
|
|
117
|
+
</g>
|
|
118
|
+
</g>
|
|
119
|
+
<defs>
|
|
120
|
+
<clipPath id="ck-drop-zone-clip">
|
|
121
|
+
<rect width="208" height="144" fill="white" />
|
|
122
|
+
</clipPath>
|
|
123
|
+
</defs>
|
|
124
|
+
</svg>
|
|
125
|
+
</template>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { render } from '@testing-library/vue';
|
|
2
|
+
import { afterEach, describe, expect, it } from 'vitest';
|
|
3
|
+
import { nextTick } from 'vue';
|
|
4
|
+
import CkDropZoneOverlay from './CkDropZoneOverlay.vue';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* jsdom has no real `DataTransfer`/`DragEvent`, so we fake the minimal surface
|
|
8
|
+
* the component reads: `dataTransfer.types` (drag detection) and
|
|
9
|
+
* `dataTransfer.files` (the drop payload).
|
|
10
|
+
*/
|
|
11
|
+
function fileDragEvent(type: string, files: File[] = []): Event {
|
|
12
|
+
const event = new Event(type, { bubbles: true, cancelable: true });
|
|
13
|
+
Object.defineProperty(event, 'dataTransfer', {
|
|
14
|
+
value: { types: ['Files'], files },
|
|
15
|
+
});
|
|
16
|
+
return event;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const overlay = () =>
|
|
20
|
+
document.querySelector<HTMLElement>('[data-slot="drop-zone-overlay"]');
|
|
21
|
+
const errorToast = () =>
|
|
22
|
+
document.querySelector<HTMLElement>('[data-slot="drop-zone-errors"]');
|
|
23
|
+
|
|
24
|
+
async function enterDrag() {
|
|
25
|
+
window.dispatchEvent(fileDragEvent('dragenter'));
|
|
26
|
+
await nextTick();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
afterEach(() => {
|
|
30
|
+
// Reset window drag state between tests in case a drop didn't fire.
|
|
31
|
+
window.dispatchEvent(fileDragEvent('drop'));
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe('CkDropZoneOverlay', () => {
|
|
35
|
+
it('is hidden until a file drag enters the window', async () => {
|
|
36
|
+
render(CkDropZoneOverlay);
|
|
37
|
+
expect(overlay()).toBeNull();
|
|
38
|
+
|
|
39
|
+
await enterDrag();
|
|
40
|
+
expect(overlay()).not.toBeNull();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('stays hidden while disabled', async () => {
|
|
44
|
+
render(CkDropZoneOverlay, { props: { disabled: true } });
|
|
45
|
+
await enterDrag();
|
|
46
|
+
expect(overlay()).toBeNull();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('emits accepted files on drop', async () => {
|
|
50
|
+
const { emitted } = render(CkDropZoneOverlay);
|
|
51
|
+
await enterDrag();
|
|
52
|
+
|
|
53
|
+
const file = new File(['hello'], 'report.pdf', { type: 'application/pdf' });
|
|
54
|
+
overlay()!.dispatchEvent(fileDragEvent('drop', [file]));
|
|
55
|
+
await nextTick();
|
|
56
|
+
|
|
57
|
+
expect(emitted('files')).toEqual([[[file]]]);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('rejects files that do not match `accept`', async () => {
|
|
61
|
+
const { emitted } = render(CkDropZoneOverlay, {
|
|
62
|
+
props: { accept: '.pdf' },
|
|
63
|
+
});
|
|
64
|
+
await enterDrag();
|
|
65
|
+
|
|
66
|
+
const file = new File(['x'], 'image.png', { type: 'image/png' });
|
|
67
|
+
overlay()!.dispatchEvent(fileDragEvent('drop', [file]));
|
|
68
|
+
await nextTick();
|
|
69
|
+
|
|
70
|
+
expect(emitted('files')).toBeUndefined();
|
|
71
|
+
const rejected = emitted('rejected') as unknown[][] | undefined;
|
|
72
|
+
expect(rejected).toBeTruthy();
|
|
73
|
+
expect(rejected![0][0]).toMatchObject([{ reason: 'unsupported-type' }]);
|
|
74
|
+
expect(errorToast()).not.toBeNull();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('caps the drop to `maxFiles` and reports the overflow', async () => {
|
|
78
|
+
const { emitted } = render(CkDropZoneOverlay, { props: { maxFiles: 1 } });
|
|
79
|
+
await enterDrag();
|
|
80
|
+
|
|
81
|
+
const a = new File(['a'], 'a.txt', { type: 'text/plain' });
|
|
82
|
+
const b = new File(['b'], 'b.txt', { type: 'text/plain' });
|
|
83
|
+
overlay()!.dispatchEvent(fileDragEvent('drop', [a, b]));
|
|
84
|
+
await nextTick();
|
|
85
|
+
|
|
86
|
+
expect(emitted('files')).toEqual([[[a]]]);
|
|
87
|
+
const rejected = emitted('rejected') as unknown[][];
|
|
88
|
+
expect(rejected[0][0]).toMatchObject([{ reason: 'too-many' }]);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('suppresses the built-in toast when showErrors is false', async () => {
|
|
92
|
+
const { emitted } = render(CkDropZoneOverlay, {
|
|
93
|
+
props: { accept: '.pdf', showErrors: false },
|
|
94
|
+
});
|
|
95
|
+
await enterDrag();
|
|
96
|
+
|
|
97
|
+
const file = new File(['x'], 'image.png', { type: 'image/png' });
|
|
98
|
+
overlay()!.dispatchEvent(fileDragEvent('drop', [file]));
|
|
99
|
+
await nextTick();
|
|
100
|
+
|
|
101
|
+
expect(emitted('rejected')).toBeTruthy();
|
|
102
|
+
expect(errorToast()).toBeNull();
|
|
103
|
+
});
|
|
104
|
+
});
|