@antdv-next/x 1.2.1 → 1.2.3-beta.1
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 +1 -1
- package/dist/index.umd.js +13195 -761
- package/dist/package.js +1 -1
- package/dist/sender/Sender.d.ts +23 -5
- package/dist/sender/Sender.js +13 -3
- package/dist/sender/components/Skill.d.ts +11 -1
- package/dist/sender/components/Skill.js +31 -3
- package/dist/sender/components/SlotTextAreaProseMirror.js +1144 -0
- package/dist/sender/components/TextArea.js +44 -3
- package/dist/sender/components/prosemirror/model.d.ts +15 -0
- package/dist/sender/components/prosemirror/model.js +276 -0
- package/dist/sender/components/prosemirror/value.d.ts +11 -0
- package/dist/sender/components/prosemirror/value.js +171 -0
- package/dist/sender/index.d.ts +2 -2
- package/dist/sender/interface.d.ts +14 -1
- package/dist/sender/style/slot-textarea.js +9 -2
- package/dist/suggestion/Suggestion.js +37 -6
- package/dist/suggestion/useActive.d.ts +1 -1
- package/dist/suggestion/useActive.js +42 -2
- package/dist/thought-chain/style/index.d.ts +71 -3
- package/dist/thought-chain/style/index.js +25 -14
- package/dist/thought-chain/style/item.d.ts +5 -5
- package/dist/thought-chain/style/item.js +5 -5
- package/dist/thought-chain/style/thought-chain.d.ts +2 -1
- package/dist/thought-chain/style/thought-chain.js +8 -20
- package/es/antdv-next-x.esm.js +14988 -6949
- package/package.json +7 -1
- package/dist/sender/components/SlotTextArea.js +0 -808
- /package/dist/sender/components/{SlotTextArea.d.ts → SlotTextAreaProseMirror.d.ts} +0 -0
package/dist/package.js
CHANGED
package/dist/sender/Sender.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType, StyleValue, CSSProperties } from 'vue';
|
|
2
|
-
import { AllowSpeech, BaseNode, NodeRender, SkillType, SlotConfigType, SubmitType } from './interface';
|
|
2
|
+
import { AllowSpeech, BaseNode, NodeRender, SenderCopyInfo, SenderPasteInfo, SkillType, SlotConfigType, SubmitType } from './interface';
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
4
|
prefixCls: {
|
|
5
5
|
type: StringConstructor;
|
|
@@ -111,13 +111,21 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
111
111
|
default: undefined;
|
|
112
112
|
};
|
|
113
113
|
onPaste: {
|
|
114
|
-
type: PropType<(event: ClipboardEvent) => void>;
|
|
114
|
+
type: PropType<(event: ClipboardEvent, info: SenderPasteInfo) => void>;
|
|
115
115
|
default: undefined;
|
|
116
116
|
};
|
|
117
117
|
onPasteFile: {
|
|
118
118
|
type: PropType<(files: FileList) => void>;
|
|
119
119
|
default: undefined;
|
|
120
120
|
};
|
|
121
|
+
onCopy: {
|
|
122
|
+
type: PropType<(event: ClipboardEvent, info: SenderCopyInfo) => void>;
|
|
123
|
+
default: undefined;
|
|
124
|
+
};
|
|
125
|
+
onCut: {
|
|
126
|
+
type: PropType<(event: ClipboardEvent, info: SenderCopyInfo) => void>;
|
|
127
|
+
default: undefined;
|
|
128
|
+
};
|
|
121
129
|
onFocus: {
|
|
122
130
|
type: PropType<(event: FocusEvent) => void>;
|
|
123
131
|
default: undefined;
|
|
@@ -237,13 +245,21 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
237
245
|
default: undefined;
|
|
238
246
|
};
|
|
239
247
|
onPaste: {
|
|
240
|
-
type: PropType<(event: ClipboardEvent) => void>;
|
|
248
|
+
type: PropType<(event: ClipboardEvent, info: SenderPasteInfo) => void>;
|
|
241
249
|
default: undefined;
|
|
242
250
|
};
|
|
243
251
|
onPasteFile: {
|
|
244
252
|
type: PropType<(files: FileList) => void>;
|
|
245
253
|
default: undefined;
|
|
246
254
|
};
|
|
255
|
+
onCopy: {
|
|
256
|
+
type: PropType<(event: ClipboardEvent, info: SenderCopyInfo) => void>;
|
|
257
|
+
default: undefined;
|
|
258
|
+
};
|
|
259
|
+
onCut: {
|
|
260
|
+
type: PropType<(event: ClipboardEvent, info: SenderCopyInfo) => void>;
|
|
261
|
+
default: undefined;
|
|
262
|
+
};
|
|
247
263
|
onFocus: {
|
|
248
264
|
type: PropType<(event: FocusEvent) => void>;
|
|
249
265
|
default: undefined;
|
|
@@ -265,7 +281,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
265
281
|
styles: Record<string, CSSProperties>;
|
|
266
282
|
footer: BaseNode | NodeRender;
|
|
267
283
|
header: BaseNode | NodeRender;
|
|
268
|
-
|
|
284
|
+
onCopy: (event: ClipboardEvent, info: SenderCopyInfo) => void;
|
|
285
|
+
onCut: (event: ClipboardEvent, info: SenderCopyInfo) => void;
|
|
286
|
+
onPaste: (event: ClipboardEvent, info: SenderPasteInfo) => void;
|
|
269
287
|
onFocus: (event: FocusEvent) => void;
|
|
270
288
|
onBlur: (event: FocusEvent) => void;
|
|
271
289
|
onChange: (value: string, event?: Event, slotConfig?: SlotConfigType[], skill?: SkillType) => void;
|
|
@@ -278,7 +296,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
278
296
|
onKeyUp: (event: KeyboardEvent) => void;
|
|
279
297
|
onKeyDown: (event: KeyboardEvent) => void | false;
|
|
280
298
|
skill: SkillType;
|
|
281
|
-
slotConfig: readonly SlotConfigType[];
|
|
282
299
|
readOnly: boolean;
|
|
283
300
|
autoSize: boolean | {
|
|
284
301
|
minRows?: number;
|
|
@@ -286,6 +303,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
286
303
|
};
|
|
287
304
|
onCancel: () => void;
|
|
288
305
|
submitType: SubmitType;
|
|
306
|
+
slotConfig: readonly SlotConfigType[];
|
|
289
307
|
allowSpeech: AllowSpeech;
|
|
290
308
|
onPasteFile: (files: FileList) => void;
|
|
291
309
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/dist/sender/Sender.js
CHANGED
|
@@ -4,7 +4,7 @@ import ClearButton_default from "./components/ClearButton.js";
|
|
|
4
4
|
import LoadingButton_default from "./components/LoadingButton/index.js";
|
|
5
5
|
import SendButton_default from "./components/SendButton.js";
|
|
6
6
|
import { provideSenderContext } from "./context.js";
|
|
7
|
-
import
|
|
7
|
+
import SlotTextAreaProseMirror_default from "./components/SlotTextAreaProseMirror.js";
|
|
8
8
|
import SpeechButton_default from "./components/SpeechButton/index.js";
|
|
9
9
|
import TextArea_default from "./components/TextArea.js";
|
|
10
10
|
import useSpeech from "./hooks/use-speech.js";
|
|
@@ -155,6 +155,14 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
155
155
|
type: Function,
|
|
156
156
|
default: void 0
|
|
157
157
|
},
|
|
158
|
+
onCopy: {
|
|
159
|
+
type: Function,
|
|
160
|
+
default: void 0
|
|
161
|
+
},
|
|
162
|
+
onCut: {
|
|
163
|
+
type: Function,
|
|
164
|
+
default: void 0
|
|
165
|
+
},
|
|
158
166
|
onFocus: {
|
|
159
167
|
type: Function,
|
|
160
168
|
default: void 0
|
|
@@ -197,7 +205,7 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
197
205
|
triggerValueChange(`${mergedValue.value} ${transcript}`);
|
|
198
206
|
}, () => props.allowSpeech);
|
|
199
207
|
const triggerSend = () => {
|
|
200
|
-
if (!props.onSubmit || props.loading || submitDisabled.value) return;
|
|
208
|
+
if (!props.onSubmit || props.disabled || props.loading || submitDisabled.value) return;
|
|
201
209
|
const value = inputRef.value?.getValue?.() ?? { value: "" };
|
|
202
210
|
const slotConfig = "slotConfig" in value ? value.slotConfig : void 0;
|
|
203
211
|
const skill = "skill" in value ? value.skill : void 0;
|
|
@@ -249,6 +257,8 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
249
257
|
onKeyDown: props.onKeyDown,
|
|
250
258
|
onPaste: props.onPaste,
|
|
251
259
|
onPasteFile: props.onPasteFile,
|
|
260
|
+
onCopy: props.onCopy,
|
|
261
|
+
onCut: props.onCut,
|
|
252
262
|
disabled: props.disabled,
|
|
253
263
|
readOnly: props.readOnly,
|
|
254
264
|
submitType: props.submitType,
|
|
@@ -338,7 +348,7 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
338
348
|
],
|
|
339
349
|
"style": [contextConfig.value.styles?.prefix, props.styles.prefix]
|
|
340
350
|
}, [prefixNode]),
|
|
341
|
-
isSlotMode.value ? createVNode(
|
|
351
|
+
isSlotMode.value ? createVNode(SlotTextAreaProseMirror_default, { "ref": inputRef }, null) : createVNode(TextArea_default, { "ref": inputRef }, null),
|
|
342
352
|
suffixNode && createVNode("div", {
|
|
343
353
|
"class": [
|
|
344
354
|
actionListCls,
|
|
@@ -13,6 +13,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
13
13
|
type: PropType<() => void>;
|
|
14
14
|
required: true;
|
|
15
15
|
};
|
|
16
|
+
disabled: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
16
20
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
17
21
|
prefixCls: {
|
|
18
22
|
type: StringConstructor;
|
|
@@ -26,5 +30,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
26
30
|
type: PropType<() => void>;
|
|
27
31
|
required: true;
|
|
28
32
|
};
|
|
29
|
-
|
|
33
|
+
disabled: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
}>> & Readonly<{}>, {
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
30
40
|
export default _default;
|
|
@@ -20,6 +20,10 @@ var Skill_default = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
removeSkill: {
|
|
21
21
|
type: Function,
|
|
22
22
|
required: true
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
setup(props) {
|
|
@@ -28,17 +32,41 @@ var Skill_default = /* @__PURE__ */ defineComponent({
|
|
|
28
32
|
const closable = props.skill.closable;
|
|
29
33
|
if (!closable) return null;
|
|
30
34
|
const config = typeof closable === "boolean" ? {} : closable;
|
|
35
|
+
const disabled = !!(props.disabled || config.disabled);
|
|
31
36
|
const closeIcon = config.closeIcon ?? createVNode(CloseOutlined, { "class": `${componentCls.value}-close-icon` }, null);
|
|
32
37
|
return createVNode("div", {
|
|
33
|
-
"class": classNames([`${componentCls.value}-close`, { [`${componentCls.value}-close-disabled`]:
|
|
38
|
+
"class": classNames([`${componentCls.value}-close`, { [`${componentCls.value}-close-disabled`]: disabled }]),
|
|
34
39
|
"role": "button",
|
|
35
40
|
"aria-label": "Close skill",
|
|
36
|
-
"
|
|
41
|
+
"aria-disabled": disabled ? "true" : "false",
|
|
42
|
+
"tabindex": disabled ? -1 : 0,
|
|
37
43
|
"onClick": (event) => {
|
|
38
|
-
if (config.disabled) return;
|
|
39
44
|
event.stopPropagation();
|
|
45
|
+
if (disabled) return;
|
|
40
46
|
props.removeSkill();
|
|
41
47
|
config.onClose?.(event);
|
|
48
|
+
},
|
|
49
|
+
"onKeydown": (event) => {
|
|
50
|
+
if (disabled) return;
|
|
51
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
const closeElement = event.currentTarget;
|
|
55
|
+
if (closeElement instanceof HTMLElement) closeElement.dispatchEvent(new MouseEvent("click", {
|
|
56
|
+
bubbles: true,
|
|
57
|
+
cancelable: true,
|
|
58
|
+
view: event.view,
|
|
59
|
+
detail: 1,
|
|
60
|
+
button: 0,
|
|
61
|
+
buttons: 0,
|
|
62
|
+
clientX: 0,
|
|
63
|
+
clientY: 0,
|
|
64
|
+
ctrlKey: event.ctrlKey,
|
|
65
|
+
altKey: event.altKey,
|
|
66
|
+
shiftKey: event.shiftKey,
|
|
67
|
+
metaKey: event.metaKey
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
42
70
|
}
|
|
43
71
|
}, [closeIcon]);
|
|
44
72
|
});
|