@antdv-next/x 1.2.3 → 1.2.5
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.umd.js +80 -26
- package/dist/mermaid/Mermaid.js +30 -10
- package/dist/package.js +1 -1
- package/dist/sender/Sender.d.ts +15 -0
- package/dist/sender/Sender.js +18 -6
- package/dist/sender/SenderHeader.d.ts +15 -0
- package/dist/sender/SenderHeader.js +13 -2
- package/dist/sender/SenderSwitch.d.ts +15 -0
- package/dist/sender/SenderSwitch.js +16 -5
- package/dist/sender/components/SlotTextAreaProseMirror.js +1 -1
- package/dist/sender/components/TextArea.js +1 -1
- package/dist/sender/interface.d.ts +4 -0
- package/dist/x-provider/context.d.ts +1 -3
- package/dist/x-provider/index.d.ts +1 -3
- package/es/antdv-next-x.esm.js +127 -90
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
shiki_dist_themes_vitesse_dark_mjs = __toESM(shiki_dist_themes_vitesse_dark_mjs, 1);
|
|
67
67
|
shiki_dist_themes_vitesse_light_mjs = __toESM(shiki_dist_themes_vitesse_light_mjs, 1);
|
|
68
68
|
//#region package.json
|
|
69
|
-
var version = "1.2.
|
|
69
|
+
var version = "1.2.5";
|
|
70
70
|
//#endregion
|
|
71
71
|
//#region components/x-provider/context.ts
|
|
72
72
|
var XProviderContextKey = Symbol("antdv-next-x-provider-context");
|
|
@@ -7321,6 +7321,10 @@
|
|
|
7321
7321
|
const mergedRenderType = (0, vue.computed)(() => {
|
|
7322
7322
|
return props.renderType ?? internalRenderType.value;
|
|
7323
7323
|
});
|
|
7324
|
+
const latestRenderRef = (0, vue.ref)({
|
|
7325
|
+
content: props.content,
|
|
7326
|
+
renderType: mergedRenderType.value
|
|
7327
|
+
});
|
|
7324
7328
|
const mergedActions = (0, vue.computed)(() => {
|
|
7325
7329
|
return {
|
|
7326
7330
|
enableZoom: props.actions?.enableZoom ?? true,
|
|
@@ -7350,23 +7354,29 @@
|
|
|
7350
7354
|
svgEl.style.transition = isDragging.value ? "none" : "transform 0.1s ease-out";
|
|
7351
7355
|
svgEl.style.cursor = isDragging.value ? "grabbing" : "grab";
|
|
7352
7356
|
}
|
|
7357
|
+
let renderRequestId = 0;
|
|
7358
|
+
let latestCommittedRequestId = 0;
|
|
7353
7359
|
const renderDiagram = throttle(async () => {
|
|
7354
|
-
|
|
7355
|
-
if (graphRef.value) graphRef.value.innerHTML = "";
|
|
7356
|
-
return;
|
|
7357
|
-
}
|
|
7358
|
-
if (!props.content?.trim()) return;
|
|
7360
|
+
const { content, renderType } = latestRenderRef.value;
|
|
7359
7361
|
const graphEl = graphRef.value;
|
|
7360
|
-
if (!graphEl) return;
|
|
7362
|
+
if (!graphEl || renderType === RenderType.Code || !content?.trim()) return;
|
|
7363
|
+
const requestId = ++renderRequestId;
|
|
7361
7364
|
try {
|
|
7362
|
-
if (await parseMermaid(
|
|
7363
|
-
const { svg } = await renderMermaid(`${renderBaseId}-${idSeed++}-${
|
|
7365
|
+
if (await parseMermaid(content, { suppressErrors: true }) === false) throw new Error("Invalid Mermaid syntax");
|
|
7366
|
+
const { svg } = await renderMermaid(`${renderBaseId}-${idSeed++}-${content.length || 0}`, content);
|
|
7367
|
+
if (requestId <= latestCommittedRequestId) return;
|
|
7364
7368
|
graphEl.innerHTML = svg;
|
|
7369
|
+
latestCommittedRequestId = requestId;
|
|
7365
7370
|
applySvgTransform();
|
|
7366
7371
|
} catch (error) {
|
|
7372
|
+
if (requestId !== renderRequestId || latestRenderRef.value.content !== content || latestRenderRef.value.renderType !== renderType) return;
|
|
7367
7373
|
warning(false, "Mermaid", `Render failed: ${String(error)}`);
|
|
7368
7374
|
}
|
|
7369
7375
|
}, 100);
|
|
7376
|
+
const invalidateRender = () => {
|
|
7377
|
+
latestCommittedRequestId = ++renderRequestId;
|
|
7378
|
+
renderDiagram.cancel();
|
|
7379
|
+
};
|
|
7370
7380
|
function switchRenderType(nextType) {
|
|
7371
7381
|
if (props.renderType === void 0) internalRenderType.value = nextType;
|
|
7372
7382
|
emit("update:renderType", nextType);
|
|
@@ -7545,7 +7555,17 @@
|
|
|
7545
7555
|
mergedRenderType,
|
|
7546
7556
|
() => graphRef.value
|
|
7547
7557
|
], () => {
|
|
7548
|
-
|
|
7558
|
+
latestRenderRef.value = {
|
|
7559
|
+
content: props.content,
|
|
7560
|
+
renderType: mergedRenderType.value
|
|
7561
|
+
};
|
|
7562
|
+
const graphEl = graphRef.value;
|
|
7563
|
+
if (mergedRenderType.value === RenderType.Code || !props.content?.trim()) {
|
|
7564
|
+
invalidateRender();
|
|
7565
|
+
if (graphEl) graphEl.innerHTML = "";
|
|
7566
|
+
return;
|
|
7567
|
+
}
|
|
7568
|
+
if (!graphEl) return;
|
|
7549
7569
|
renderDiagram();
|
|
7550
7570
|
}, {
|
|
7551
7571
|
immediate: true,
|
|
@@ -7583,7 +7603,7 @@
|
|
|
7583
7603
|
applySvgTransform();
|
|
7584
7604
|
}, { deep: true });
|
|
7585
7605
|
(0, vue.onBeforeUnmount)(() => {
|
|
7586
|
-
|
|
7606
|
+
invalidateRender();
|
|
7587
7607
|
});
|
|
7588
7608
|
expose({ get nativeElement() {
|
|
7589
7609
|
return rootRef.value;
|
|
@@ -21421,7 +21441,7 @@
|
|
|
21421
21441
|
"class": (0, _v_c_util.classNames)([
|
|
21422
21442
|
inputCls,
|
|
21423
21443
|
`${inputCls}-slot`,
|
|
21424
|
-
senderCtx.value.classNames?.input
|
|
21444
|
+
senderCtx.value.classes?.input ?? senderCtx.value.classNames?.input
|
|
21425
21445
|
]),
|
|
21426
21446
|
"style": mergeInputStyle.value,
|
|
21427
21447
|
"data-placeholder": senderCtx.value.placeholder
|
|
@@ -21621,7 +21641,7 @@
|
|
|
21621
21641
|
"ref": inputRef,
|
|
21622
21642
|
"disabled": ctx.disabled,
|
|
21623
21643
|
"style": ctx.styles?.input,
|
|
21624
|
-
"class": [`${ctx.prefixCls}-input`, ctx.classNames?.input],
|
|
21644
|
+
"class": [`${ctx.prefixCls}-input`, ctx.classes?.input ?? ctx.classNames?.input],
|
|
21625
21645
|
"autoSize": ctx.autoSize,
|
|
21626
21646
|
"value": ctx.value,
|
|
21627
21647
|
"onChange": (e) => {
|
|
@@ -22179,6 +22199,13 @@
|
|
|
22179
22199
|
type: [Boolean, Object],
|
|
22180
22200
|
default: () => ({ maxRows: 8 })
|
|
22181
22201
|
},
|
|
22202
|
+
classes: {
|
|
22203
|
+
type: Object,
|
|
22204
|
+
default: () => ({})
|
|
22205
|
+
},
|
|
22206
|
+
/**
|
|
22207
|
+
* @deprecated Use `classes` instead.
|
|
22208
|
+
*/
|
|
22182
22209
|
classNames: {
|
|
22183
22210
|
type: Object,
|
|
22184
22211
|
default: () => ({})
|
|
@@ -22342,6 +22369,10 @@
|
|
|
22342
22369
|
return inputRef.value?.getValue() ?? { value: "" };
|
|
22343
22370
|
}
|
|
22344
22371
|
});
|
|
22372
|
+
const mergedClasses = (0, vue.computed)(() => ({
|
|
22373
|
+
...props.classNames,
|
|
22374
|
+
...props.classes
|
|
22375
|
+
}));
|
|
22345
22376
|
provideSenderContext((0, vue.computed)(() => ({
|
|
22346
22377
|
value: mergedValue.value,
|
|
22347
22378
|
onChange: triggerValueChange,
|
|
@@ -22356,7 +22387,8 @@
|
|
|
22356
22387
|
submitType: props.submitType,
|
|
22357
22388
|
prefixCls: prefixCls.value,
|
|
22358
22389
|
styles: props.styles,
|
|
22359
|
-
|
|
22390
|
+
classes: mergedClasses.value,
|
|
22391
|
+
classNames: mergedClasses.value,
|
|
22360
22392
|
autoSize: props.autoSize,
|
|
22361
22393
|
triggerSend,
|
|
22362
22394
|
placeholder: props.placeholder,
|
|
@@ -22406,7 +22438,7 @@
|
|
|
22406
22438
|
contextConfig.value.classes?.root,
|
|
22407
22439
|
props.class,
|
|
22408
22440
|
props.rootClass,
|
|
22409
|
-
|
|
22441
|
+
mergedClasses.value.root,
|
|
22410
22442
|
hashId.value,
|
|
22411
22443
|
cssVarCls.value,
|
|
22412
22444
|
`${cls}-main`,
|
|
@@ -22424,7 +22456,7 @@
|
|
|
22424
22456
|
}, attrs), [
|
|
22425
22457
|
headerNode,
|
|
22426
22458
|
(0, vue.createVNode)("div", {
|
|
22427
|
-
"class": [`${cls}-content`,
|
|
22459
|
+
"class": [`${cls}-content`, mergedClasses.value.content],
|
|
22428
22460
|
"style": props.styles.content,
|
|
22429
22461
|
"onMousedown": (e) => {
|
|
22430
22462
|
const inputNode = containerRef.value?.querySelector(`.${cls}-input`);
|
|
@@ -22436,7 +22468,7 @@
|
|
|
22436
22468
|
"class": [
|
|
22437
22469
|
`${cls}-prefix`,
|
|
22438
22470
|
contextConfig.value.classes?.prefix,
|
|
22439
|
-
|
|
22471
|
+
mergedClasses.value.prefix
|
|
22440
22472
|
],
|
|
22441
22473
|
"style": [contextConfig.value.styles?.prefix, props.styles.prefix]
|
|
22442
22474
|
}, [prefixNode]),
|
|
@@ -22445,7 +22477,7 @@
|
|
|
22445
22477
|
"class": [
|
|
22446
22478
|
actionListCls,
|
|
22447
22479
|
contextConfig.value.classes?.suffix,
|
|
22448
|
-
|
|
22480
|
+
mergedClasses.value.suffix
|
|
22449
22481
|
],
|
|
22450
22482
|
"style": [contextConfig.value.styles?.suffix, props.styles.suffix]
|
|
22451
22483
|
}, [suffixNode])
|
|
@@ -22454,7 +22486,7 @@
|
|
|
22454
22486
|
"class": [
|
|
22455
22487
|
`${cls}-footer`,
|
|
22456
22488
|
contextConfig.value.classes?.footer,
|
|
22457
|
-
|
|
22489
|
+
mergedClasses.value.footer
|
|
22458
22490
|
],
|
|
22459
22491
|
"style": [contextConfig.value.styles?.footer, props.styles.footer]
|
|
22460
22492
|
}, [footerNode])
|
|
@@ -22491,6 +22523,13 @@
|
|
|
22491
22523
|
type: [String, Object],
|
|
22492
22524
|
default: void 0
|
|
22493
22525
|
},
|
|
22526
|
+
classes: {
|
|
22527
|
+
type: Object,
|
|
22528
|
+
default: () => ({})
|
|
22529
|
+
},
|
|
22530
|
+
/**
|
|
22531
|
+
* @deprecated Use `classes` instead.
|
|
22532
|
+
*/
|
|
22494
22533
|
classNames: {
|
|
22495
22534
|
type: Object,
|
|
22496
22535
|
default: () => ({})
|
|
@@ -22516,6 +22555,10 @@
|
|
|
22516
22555
|
return `${props.prefixCls ?? senderPrefix ?? "antd-sender"}-header`;
|
|
22517
22556
|
});
|
|
22518
22557
|
const direction = (0, vue.computed)(() => configCtx.value.direction);
|
|
22558
|
+
const mergedClasses = (0, vue.computed)(() => ({
|
|
22559
|
+
...props.classNames,
|
|
22560
|
+
...props.classes
|
|
22561
|
+
}));
|
|
22519
22562
|
return () => {
|
|
22520
22563
|
const headerCls = prefixCls.value;
|
|
22521
22564
|
const contentNode = (0, vue.createVNode)("div", {
|
|
@@ -22526,7 +22569,7 @@
|
|
|
22526
22569
|
],
|
|
22527
22570
|
"style": props.style
|
|
22528
22571
|
}, [(props.closable || props.title) && (0, vue.createVNode)("div", {
|
|
22529
|
-
"class": [`${headerCls}-header`,
|
|
22572
|
+
"class": [`${headerCls}-header`, mergedClasses.value.header],
|
|
22530
22573
|
"style": props.styles.header
|
|
22531
22574
|
}, [(0, vue.createVNode)("div", { "class": `${headerCls}-title` }, [slots.title?.() ?? props.title]), props.closable && (0, vue.createVNode)("div", { "class": `${headerCls}-close` }, [(0, vue.createVNode)(antdv_next.Button, {
|
|
22532
22575
|
"type": "text",
|
|
@@ -22534,7 +22577,7 @@
|
|
|
22534
22577
|
"size": "small",
|
|
22535
22578
|
"onClick": () => props.onOpenChange?.(!props.open)
|
|
22536
22579
|
}, null)])]), slots.default && (0, vue.createVNode)("div", {
|
|
22537
|
-
"class": [`${headerCls}-content`,
|
|
22580
|
+
"class": [`${headerCls}-content`, mergedClasses.value.content],
|
|
22538
22581
|
"style": props.styles.content
|
|
22539
22582
|
}, [slots.default()])]);
|
|
22540
22583
|
return (0, vue.createVNode)(vue.Transition, {
|
|
@@ -22624,6 +22667,13 @@
|
|
|
22624
22667
|
type: Function,
|
|
22625
22668
|
default: void 0
|
|
22626
22669
|
},
|
|
22670
|
+
classes: {
|
|
22671
|
+
type: Object,
|
|
22672
|
+
default: () => ({})
|
|
22673
|
+
},
|
|
22674
|
+
/**
|
|
22675
|
+
* @deprecated Use `classes` instead.
|
|
22676
|
+
*/
|
|
22627
22677
|
classNames: {
|
|
22628
22678
|
type: Object,
|
|
22629
22679
|
default: () => ({})
|
|
@@ -22650,6 +22700,10 @@
|
|
|
22650
22700
|
if (val !== void 0) innerChecked.value = val;
|
|
22651
22701
|
}, { immediate: true });
|
|
22652
22702
|
const mergedChecked = (0, vue.computed)(() => props.value ?? innerChecked.value);
|
|
22703
|
+
const mergedClasses = (0, vue.computed)(() => ({
|
|
22704
|
+
...props.classNames,
|
|
22705
|
+
...props.classes
|
|
22706
|
+
}));
|
|
22653
22707
|
expose({ get nativeElement() {
|
|
22654
22708
|
return containerRef.value;
|
|
22655
22709
|
} });
|
|
@@ -22666,8 +22720,8 @@
|
|
|
22666
22720
|
props.class,
|
|
22667
22721
|
props.rootClass,
|
|
22668
22722
|
contextConfig.value.classes?.switch,
|
|
22669
|
-
senderCtx.value.classNames?.switch,
|
|
22670
|
-
|
|
22723
|
+
senderCtx.value.classes?.switch ?? senderCtx.value.classNames?.switch,
|
|
22724
|
+
mergedClasses.value.root,
|
|
22671
22725
|
{
|
|
22672
22726
|
[`${cls}-checked`]: mergedChecked.value,
|
|
22673
22727
|
[`${cls}-rtl`]: direction.value === "rtl"
|
|
@@ -22682,12 +22736,12 @@
|
|
|
22682
22736
|
}, attrs), [(0, vue.createVNode)(antdv_next.Button, (0, vue.mergeProps)({
|
|
22683
22737
|
"disabled": props.disabled,
|
|
22684
22738
|
"loading": props.loading,
|
|
22685
|
-
"class": [`${cls}-content`,
|
|
22739
|
+
"class": [`${cls}-content`, mergedClasses.value.content],
|
|
22686
22740
|
"style": props.styles.content
|
|
22687
22741
|
}, {
|
|
22688
22742
|
classes: {
|
|
22689
|
-
icon:
|
|
22690
|
-
content:
|
|
22743
|
+
icon: mergedClasses.value.icon,
|
|
22744
|
+
content: mergedClasses.value.title
|
|
22691
22745
|
},
|
|
22692
22746
|
styles: {
|
|
22693
22747
|
icon: props.styles.icon,
|
package/dist/mermaid/Mermaid.js
CHANGED
|
@@ -149,6 +149,10 @@ var XMermaid = /* @__PURE__ */ defineComponent({
|
|
|
149
149
|
const mergedRenderType = computed(() => {
|
|
150
150
|
return props.renderType ?? internalRenderType.value;
|
|
151
151
|
});
|
|
152
|
+
const latestRenderRef = ref({
|
|
153
|
+
content: props.content,
|
|
154
|
+
renderType: mergedRenderType.value
|
|
155
|
+
});
|
|
152
156
|
const mergedActions = computed(() => {
|
|
153
157
|
return {
|
|
154
158
|
enableZoom: props.actions?.enableZoom ?? true,
|
|
@@ -178,23 +182,29 @@ var XMermaid = /* @__PURE__ */ defineComponent({
|
|
|
178
182
|
svgEl.style.transition = isDragging.value ? "none" : "transform 0.1s ease-out";
|
|
179
183
|
svgEl.style.cursor = isDragging.value ? "grabbing" : "grab";
|
|
180
184
|
}
|
|
185
|
+
let renderRequestId = 0;
|
|
186
|
+
let latestCommittedRequestId = 0;
|
|
181
187
|
const renderDiagram = throttle(async () => {
|
|
182
|
-
|
|
183
|
-
if (graphRef.value) graphRef.value.innerHTML = "";
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
if (!props.content?.trim()) return;
|
|
188
|
+
const { content, renderType } = latestRenderRef.value;
|
|
187
189
|
const graphEl = graphRef.value;
|
|
188
|
-
if (!graphEl) return;
|
|
190
|
+
if (!graphEl || renderType === RenderType.Code || !content?.trim()) return;
|
|
191
|
+
const requestId = ++renderRequestId;
|
|
189
192
|
try {
|
|
190
|
-
if (await parseMermaid(
|
|
191
|
-
const { svg } = await renderMermaid(`${renderBaseId}-${idSeed++}-${
|
|
193
|
+
if (await parseMermaid(content, { suppressErrors: true }) === false) throw new Error("Invalid Mermaid syntax");
|
|
194
|
+
const { svg } = await renderMermaid(`${renderBaseId}-${idSeed++}-${content.length || 0}`, content);
|
|
195
|
+
if (requestId <= latestCommittedRequestId) return;
|
|
192
196
|
graphEl.innerHTML = svg;
|
|
197
|
+
latestCommittedRequestId = requestId;
|
|
193
198
|
applySvgTransform();
|
|
194
199
|
} catch (error) {
|
|
200
|
+
if (requestId !== renderRequestId || latestRenderRef.value.content !== content || latestRenderRef.value.renderType !== renderType) return;
|
|
195
201
|
warning(false, "Mermaid", `Render failed: ${String(error)}`);
|
|
196
202
|
}
|
|
197
203
|
}, 100);
|
|
204
|
+
const invalidateRender = () => {
|
|
205
|
+
latestCommittedRequestId = ++renderRequestId;
|
|
206
|
+
renderDiagram.cancel();
|
|
207
|
+
};
|
|
198
208
|
function switchRenderType(nextType) {
|
|
199
209
|
if (props.renderType === void 0) internalRenderType.value = nextType;
|
|
200
210
|
emit("update:renderType", nextType);
|
|
@@ -373,7 +383,17 @@ var XMermaid = /* @__PURE__ */ defineComponent({
|
|
|
373
383
|
mergedRenderType,
|
|
374
384
|
() => graphRef.value
|
|
375
385
|
], () => {
|
|
376
|
-
|
|
386
|
+
latestRenderRef.value = {
|
|
387
|
+
content: props.content,
|
|
388
|
+
renderType: mergedRenderType.value
|
|
389
|
+
};
|
|
390
|
+
const graphEl = graphRef.value;
|
|
391
|
+
if (mergedRenderType.value === RenderType.Code || !props.content?.trim()) {
|
|
392
|
+
invalidateRender();
|
|
393
|
+
if (graphEl) graphEl.innerHTML = "";
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
if (!graphEl) return;
|
|
377
397
|
renderDiagram();
|
|
378
398
|
}, {
|
|
379
399
|
immediate: true,
|
|
@@ -411,7 +431,7 @@ var XMermaid = /* @__PURE__ */ defineComponent({
|
|
|
411
431
|
applySvgTransform();
|
|
412
432
|
}, { deep: true });
|
|
413
433
|
onBeforeUnmount(() => {
|
|
414
|
-
|
|
434
|
+
invalidateRender();
|
|
415
435
|
});
|
|
416
436
|
expose({ get nativeElement() {
|
|
417
437
|
return rootRef.value;
|
package/dist/package.js
CHANGED
package/dist/sender/Sender.d.ts
CHANGED
|
@@ -66,6 +66,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
66
66
|
maxRows: number;
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
|
+
classes: {
|
|
70
|
+
type: PropType<Record<string, string>>;
|
|
71
|
+
default: () => {};
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated Use `classes` instead.
|
|
75
|
+
*/
|
|
69
76
|
classNames: {
|
|
70
77
|
type: PropType<Record<string, string>>;
|
|
71
78
|
default: () => {};
|
|
@@ -200,6 +207,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
200
207
|
maxRows: number;
|
|
201
208
|
};
|
|
202
209
|
};
|
|
210
|
+
classes: {
|
|
211
|
+
type: PropType<Record<string, string>>;
|
|
212
|
+
default: () => {};
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* @deprecated Use `classes` instead.
|
|
216
|
+
*/
|
|
203
217
|
classNames: {
|
|
204
218
|
type: PropType<Record<string, string>>;
|
|
205
219
|
default: () => {};
|
|
@@ -278,6 +292,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
278
292
|
loading: boolean;
|
|
279
293
|
rootClass: string;
|
|
280
294
|
class: string;
|
|
295
|
+
classes: Record<string, string>;
|
|
281
296
|
styles: Record<string, CSSProperties>;
|
|
282
297
|
footer: BaseNode | NodeRender;
|
|
283
298
|
header: BaseNode | NodeRender;
|
package/dist/sender/Sender.js
CHANGED
|
@@ -87,6 +87,13 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
87
87
|
type: [Boolean, Object],
|
|
88
88
|
default: () => ({ maxRows: 8 })
|
|
89
89
|
},
|
|
90
|
+
classes: {
|
|
91
|
+
type: Object,
|
|
92
|
+
default: () => ({})
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated Use `classes` instead.
|
|
96
|
+
*/
|
|
90
97
|
classNames: {
|
|
91
98
|
type: Object,
|
|
92
99
|
default: () => ({})
|
|
@@ -250,6 +257,10 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
250
257
|
return inputRef.value?.getValue() ?? { value: "" };
|
|
251
258
|
}
|
|
252
259
|
});
|
|
260
|
+
const mergedClasses = computed(() => ({
|
|
261
|
+
...props.classNames,
|
|
262
|
+
...props.classes
|
|
263
|
+
}));
|
|
253
264
|
provideSenderContext(computed(() => ({
|
|
254
265
|
value: mergedValue.value,
|
|
255
266
|
onChange: triggerValueChange,
|
|
@@ -264,7 +275,8 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
264
275
|
submitType: props.submitType,
|
|
265
276
|
prefixCls: prefixCls.value,
|
|
266
277
|
styles: props.styles,
|
|
267
|
-
|
|
278
|
+
classes: mergedClasses.value,
|
|
279
|
+
classNames: mergedClasses.value,
|
|
268
280
|
autoSize: props.autoSize,
|
|
269
281
|
triggerSend,
|
|
270
282
|
placeholder: props.placeholder,
|
|
@@ -314,7 +326,7 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
314
326
|
contextConfig.value.classes?.root,
|
|
315
327
|
props.class,
|
|
316
328
|
props.rootClass,
|
|
317
|
-
|
|
329
|
+
mergedClasses.value.root,
|
|
318
330
|
hashId.value,
|
|
319
331
|
cssVarCls.value,
|
|
320
332
|
`${cls}-main`,
|
|
@@ -332,7 +344,7 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
332
344
|
}, attrs), [
|
|
333
345
|
headerNode,
|
|
334
346
|
createVNode("div", {
|
|
335
|
-
"class": [`${cls}-content`,
|
|
347
|
+
"class": [`${cls}-content`, mergedClasses.value.content],
|
|
336
348
|
"style": props.styles.content,
|
|
337
349
|
"onMousedown": (e) => {
|
|
338
350
|
const inputNode = containerRef.value?.querySelector(`.${cls}-input`);
|
|
@@ -344,7 +356,7 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
344
356
|
"class": [
|
|
345
357
|
`${cls}-prefix`,
|
|
346
358
|
contextConfig.value.classes?.prefix,
|
|
347
|
-
|
|
359
|
+
mergedClasses.value.prefix
|
|
348
360
|
],
|
|
349
361
|
"style": [contextConfig.value.styles?.prefix, props.styles.prefix]
|
|
350
362
|
}, [prefixNode]),
|
|
@@ -353,7 +365,7 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
353
365
|
"class": [
|
|
354
366
|
actionListCls,
|
|
355
367
|
contextConfig.value.classes?.suffix,
|
|
356
|
-
|
|
368
|
+
mergedClasses.value.suffix
|
|
357
369
|
],
|
|
358
370
|
"style": [contextConfig.value.styles?.suffix, props.styles.suffix]
|
|
359
371
|
}, [suffixNode])
|
|
@@ -362,7 +374,7 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
362
374
|
"class": [
|
|
363
375
|
`${cls}-footer`,
|
|
364
376
|
contextConfig.value.classes?.footer,
|
|
365
|
-
|
|
377
|
+
mergedClasses.value.footer
|
|
366
378
|
],
|
|
367
379
|
"style": [contextConfig.value.styles?.footer, props.styles.footer]
|
|
368
380
|
}, [footerNode])
|
|
@@ -25,6 +25,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
25
25
|
type: PropType<string | CSSProperties>;
|
|
26
26
|
default: undefined;
|
|
27
27
|
};
|
|
28
|
+
classes: {
|
|
29
|
+
type: PropType<Partial<Record<HeaderSemanticType, string>>>;
|
|
30
|
+
default: () => {};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `classes` instead.
|
|
34
|
+
*/
|
|
28
35
|
classNames: {
|
|
29
36
|
type: PropType<Partial<Record<HeaderSemanticType, string>>>;
|
|
30
37
|
default: () => {};
|
|
@@ -66,6 +73,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
66
73
|
type: PropType<string | CSSProperties>;
|
|
67
74
|
default: undefined;
|
|
68
75
|
};
|
|
76
|
+
classes: {
|
|
77
|
+
type: PropType<Partial<Record<HeaderSemanticType, string>>>;
|
|
78
|
+
default: () => {};
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated Use `classes` instead.
|
|
82
|
+
*/
|
|
69
83
|
classNames: {
|
|
70
84
|
type: PropType<Partial<Record<HeaderSemanticType, string>>>;
|
|
71
85
|
default: () => {};
|
|
@@ -87,6 +101,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
87
101
|
style: string | CSSProperties;
|
|
88
102
|
open: boolean;
|
|
89
103
|
class: string;
|
|
104
|
+
classes: Partial<Record<HeaderSemanticType, string>>;
|
|
90
105
|
styles: Partial<Record<HeaderSemanticType, CSSProperties>>;
|
|
91
106
|
title: string | Record<string, any>;
|
|
92
107
|
onOpenChange: (open: boolean) => void;
|
|
@@ -31,6 +31,13 @@ var SenderHeader_default = /* @__PURE__ */ defineComponent({
|
|
|
31
31
|
type: [String, Object],
|
|
32
32
|
default: void 0
|
|
33
33
|
},
|
|
34
|
+
classes: {
|
|
35
|
+
type: Object,
|
|
36
|
+
default: () => ({})
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `classes` instead.
|
|
40
|
+
*/
|
|
34
41
|
classNames: {
|
|
35
42
|
type: Object,
|
|
36
43
|
default: () => ({})
|
|
@@ -56,6 +63,10 @@ var SenderHeader_default = /* @__PURE__ */ defineComponent({
|
|
|
56
63
|
return `${props.prefixCls ?? senderPrefix ?? "antd-sender"}-header`;
|
|
57
64
|
});
|
|
58
65
|
const direction = computed(() => configCtx.value.direction);
|
|
66
|
+
const mergedClasses = computed(() => ({
|
|
67
|
+
...props.classNames,
|
|
68
|
+
...props.classes
|
|
69
|
+
}));
|
|
59
70
|
return () => {
|
|
60
71
|
const headerCls = prefixCls.value;
|
|
61
72
|
const contentNode = createVNode("div", {
|
|
@@ -66,7 +77,7 @@ var SenderHeader_default = /* @__PURE__ */ defineComponent({
|
|
|
66
77
|
],
|
|
67
78
|
"style": props.style
|
|
68
79
|
}, [(props.closable || props.title) && createVNode("div", {
|
|
69
|
-
"class": [`${headerCls}-header`,
|
|
80
|
+
"class": [`${headerCls}-header`, mergedClasses.value.header],
|
|
70
81
|
"style": props.styles.header
|
|
71
82
|
}, [createVNode("div", { "class": `${headerCls}-title` }, [slots.title?.() ?? props.title]), props.closable && createVNode("div", { "class": `${headerCls}-close` }, [createVNode(Button, {
|
|
72
83
|
"type": "text",
|
|
@@ -74,7 +85,7 @@ var SenderHeader_default = /* @__PURE__ */ defineComponent({
|
|
|
74
85
|
"size": "small",
|
|
75
86
|
"onClick": () => props.onOpenChange?.(!props.open)
|
|
76
87
|
}, null)])]), slots.default && createVNode("div", {
|
|
77
|
-
"class": [`${headerCls}-content`,
|
|
88
|
+
"class": [`${headerCls}-content`, mergedClasses.value.content],
|
|
78
89
|
"style": props.styles.content
|
|
79
90
|
}, [slots.default()])]);
|
|
80
91
|
return createVNode(Transition, {
|
|
@@ -49,6 +49,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
49
49
|
type: PropType<(checked: boolean) => void>;
|
|
50
50
|
default: undefined;
|
|
51
51
|
};
|
|
52
|
+
classes: {
|
|
53
|
+
type: PropType<Partial<Record<SwitchSemanticType, string>>>;
|
|
54
|
+
default: () => {};
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Use `classes` instead.
|
|
58
|
+
*/
|
|
52
59
|
classNames: {
|
|
53
60
|
type: PropType<Partial<Record<SwitchSemanticType, string>>>;
|
|
54
61
|
default: () => {};
|
|
@@ -106,6 +113,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
106
113
|
type: PropType<(checked: boolean) => void>;
|
|
107
114
|
default: undefined;
|
|
108
115
|
};
|
|
116
|
+
classes: {
|
|
117
|
+
type: PropType<Partial<Record<SwitchSemanticType, string>>>;
|
|
118
|
+
default: () => {};
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* @deprecated Use `classes` instead.
|
|
122
|
+
*/
|
|
109
123
|
classNames: {
|
|
110
124
|
type: PropType<Partial<Record<SwitchSemanticType, string>>>;
|
|
111
125
|
default: () => {};
|
|
@@ -123,6 +137,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
123
137
|
loading: boolean;
|
|
124
138
|
rootClass: string;
|
|
125
139
|
class: string;
|
|
140
|
+
classes: Partial<Record<SwitchSemanticType, string>>;
|
|
126
141
|
styles: Partial<Record<SwitchSemanticType, CSSProperties>>;
|
|
127
142
|
onChange: (checked: boolean) => void;
|
|
128
143
|
classNames: Partial<Record<SwitchSemanticType, string>>;
|
|
@@ -60,6 +60,13 @@ var SenderSwitch_default = /* @__PURE__ */ defineComponent({
|
|
|
60
60
|
type: Function,
|
|
61
61
|
default: void 0
|
|
62
62
|
},
|
|
63
|
+
classes: {
|
|
64
|
+
type: Object,
|
|
65
|
+
default: () => ({})
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated Use `classes` instead.
|
|
69
|
+
*/
|
|
63
70
|
classNames: {
|
|
64
71
|
type: Object,
|
|
65
72
|
default: () => ({})
|
|
@@ -86,6 +93,10 @@ var SenderSwitch_default = /* @__PURE__ */ defineComponent({
|
|
|
86
93
|
if (val !== void 0) innerChecked.value = val;
|
|
87
94
|
}, { immediate: true });
|
|
88
95
|
const mergedChecked = computed(() => props.value ?? innerChecked.value);
|
|
96
|
+
const mergedClasses = computed(() => ({
|
|
97
|
+
...props.classNames,
|
|
98
|
+
...props.classes
|
|
99
|
+
}));
|
|
89
100
|
expose({ get nativeElement() {
|
|
90
101
|
return containerRef.value;
|
|
91
102
|
} });
|
|
@@ -102,8 +113,8 @@ var SenderSwitch_default = /* @__PURE__ */ defineComponent({
|
|
|
102
113
|
props.class,
|
|
103
114
|
props.rootClass,
|
|
104
115
|
contextConfig.value.classes?.switch,
|
|
105
|
-
senderCtx.value.classNames?.switch,
|
|
106
|
-
|
|
116
|
+
senderCtx.value.classes?.switch ?? senderCtx.value.classNames?.switch,
|
|
117
|
+
mergedClasses.value.root,
|
|
107
118
|
{
|
|
108
119
|
[`${cls}-checked`]: mergedChecked.value,
|
|
109
120
|
[`${cls}-rtl`]: direction.value === "rtl"
|
|
@@ -118,12 +129,12 @@ var SenderSwitch_default = /* @__PURE__ */ defineComponent({
|
|
|
118
129
|
}, attrs), [createVNode(Button, mergeProps({
|
|
119
130
|
"disabled": props.disabled,
|
|
120
131
|
"loading": props.loading,
|
|
121
|
-
"class": [`${cls}-content`,
|
|
132
|
+
"class": [`${cls}-content`, mergedClasses.value.content],
|
|
122
133
|
"style": props.styles.content
|
|
123
134
|
}, {
|
|
124
135
|
classes: {
|
|
125
|
-
icon:
|
|
126
|
-
content:
|
|
136
|
+
icon: mergedClasses.value.icon,
|
|
137
|
+
content: mergedClasses.value.title
|
|
127
138
|
},
|
|
128
139
|
styles: {
|
|
129
140
|
icon: props.styles.icon,
|
|
@@ -1160,7 +1160,7 @@ var SlotTextAreaProseMirror_default = /* @__PURE__ */ defineComponent({
|
|
|
1160
1160
|
"class": classNames([
|
|
1161
1161
|
inputCls,
|
|
1162
1162
|
`${inputCls}-slot`,
|
|
1163
|
-
senderCtx.value.classNames?.input
|
|
1163
|
+
senderCtx.value.classes?.input ?? senderCtx.value.classNames?.input
|
|
1164
1164
|
]),
|
|
1165
1165
|
"style": mergeInputStyle.value,
|
|
1166
1166
|
"data-placeholder": senderCtx.value.placeholder
|
|
@@ -113,7 +113,7 @@ var TextArea_default = /* @__PURE__ */ defineComponent({
|
|
|
113
113
|
"ref": inputRef,
|
|
114
114
|
"disabled": ctx.disabled,
|
|
115
115
|
"style": ctx.styles?.input,
|
|
116
|
-
"class": [`${ctx.prefixCls}-input`, ctx.classNames?.input],
|
|
116
|
+
"class": [`${ctx.prefixCls}-input`, ctx.classes?.input ?? ctx.classNames?.input],
|
|
117
117
|
"autoSize": ctx.autoSize,
|
|
118
118
|
"value": ctx.value,
|
|
119
119
|
"onChange": (e) => {
|
|
@@ -116,6 +116,10 @@ export interface SenderProps {
|
|
|
116
116
|
onCut?: (event: ClipboardEvent, info: SenderCopyInfo) => void;
|
|
117
117
|
onFocus?: (event: FocusEvent) => void;
|
|
118
118
|
onBlur?: (event: FocusEvent) => void;
|
|
119
|
+
classes?: Partial<Record<SemanticType, string>>;
|
|
120
|
+
/**
|
|
121
|
+
* @deprecated Use `classes` instead.
|
|
122
|
+
*/
|
|
119
123
|
classNames?: Partial<Record<SemanticType, string>>;
|
|
120
124
|
styles?: Partial<Record<SemanticType, CSSProperties>>;
|
|
121
125
|
rootClass?: string;
|
|
@@ -35,9 +35,7 @@ export interface XComponentsConfig {
|
|
|
35
35
|
folder?: Pick<FolderProps, "style" | "styles" | "classes">;
|
|
36
36
|
mermaid?: Pick<MermaidProps, "style" | "styles" | "classes">;
|
|
37
37
|
prompts?: Pick<PromptsProps, "style" | "styles" | "classes">;
|
|
38
|
-
sender?: Pick<SenderProps, "style" | "styles" | "
|
|
39
|
-
classes?: SenderProps["classNames"];
|
|
40
|
-
};
|
|
38
|
+
sender?: Pick<SenderProps, "style" | "styles" | "classes" | "classNames">;
|
|
41
39
|
suggestion?: Pick<SuggestionProps, "style" | "styles" | "classes">;
|
|
42
40
|
think?: Pick<ThinkProps, "style" | "styles" | "classes">;
|
|
43
41
|
thoughtChain?: Pick<ThoughtChainProps, "style" | "styles" | "classes">;
|
|
@@ -154,9 +154,7 @@ declare const XProvider: import('vue').DefineComponent<import('vue').ExtractProp
|
|
|
154
154
|
codeHighlighter: Pick<import('..').CodeHighlighterProps, "style" | "classes" | "styles"> | undefined;
|
|
155
155
|
mermaid: Pick<import('..').MermaidProps, "style" | "classes" | "styles"> | undefined;
|
|
156
156
|
prompts: Pick<import('..').PromptsProps, "style" | "classes" | "styles"> | undefined;
|
|
157
|
-
sender:
|
|
158
|
-
classes?: import('..').SenderProps["classNames"];
|
|
159
|
-
}) | undefined;
|
|
157
|
+
sender: Pick<import('..').SenderProps, "style" | "classes" | "styles" | "classNames"> | undefined;
|
|
160
158
|
suggestion: Pick<import('..').SuggestionProps<any>, "style" | "classes" | "styles"> | undefined;
|
|
161
159
|
think: Pick<import('..').ThinkProps, "style" | "classes" | "styles"> | undefined;
|
|
162
160
|
thoughtChain: Pick<import('..').ThoughtChainProps, "style" | "classes" | "styles"> | undefined;
|
package/es/antdv-next-x.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./Serializer-Sc9uEpQk.js";
|
|
2
2
|
import { Comment as S, Fragment as C, Teleport as w, Text as T, Transition as E, TransitionGroup as D, cloneVNode as O, computed as k, createTextVNode as A, createVNode as j, defineComponent as M, getCurrentInstance as N, getCurrentScope as P, h as F, inject as I, isVNode as L, markRaw as R, mergeDefaults as z, mergeProps as B, nextTick as V, onBeforeMount as ee, onBeforeUnmount as H, onBeforeUpdate as U, onMounted as te, onScopeDispose as ne, onUnmounted as re, onUpdated as ie, provide as W, reactive as ae, ref as G, render as oe, resolveDynamicComponent as se, shallowReactive as ce, shallowRef as K, toRaw as le, toRef as ue, toRefs as de, toValue as fe, triggerRef as pe, unref as me, useAttrs as he, useId as ge, useSlots as _e, vShow as ve, watch as q, watchEffect as ye, withDirectives as be } from "vue";
|
|
3
3
|
//#region package.json
|
|
4
|
-
var xe = "1.2.
|
|
4
|
+
var xe = "1.2.5", Se = "anticon", Ce = {}, we = [
|
|
5
5
|
"outlined",
|
|
6
6
|
"borderless",
|
|
7
7
|
"filled",
|
|
@@ -51167,51 +51167,55 @@ var kF = /* @__PURE__ */ M({
|
|
|
51167
51167
|
}), g = G(!1), _ = G({
|
|
51168
51168
|
x: 0,
|
|
51169
51169
|
y: 0
|
|
51170
|
-
}), v = k(() => e.renderType ?? p.value), y =
|
|
51170
|
+
}), v = k(() => e.renderType ?? p.value), y = G({
|
|
51171
|
+
content: e.content,
|
|
51172
|
+
renderType: v.value
|
|
51173
|
+
}), b = k(() => ({
|
|
51171
51174
|
enableZoom: e.actions?.enableZoom ?? !0,
|
|
51172
51175
|
enableDownload: e.actions?.enableDownload ?? !0,
|
|
51173
51176
|
enableCopy: e.actions?.enableCopy ?? !0,
|
|
51174
51177
|
customActions: e.actions?.customActions ?? []
|
|
51175
|
-
})),
|
|
51178
|
+
})), x = k(() => ({
|
|
51176
51179
|
...s.value.classes,
|
|
51177
51180
|
...e.classes
|
|
51178
|
-
})),
|
|
51181
|
+
})), S = k(() => ({
|
|
51179
51182
|
...s.value.styles,
|
|
51180
51183
|
...e.styles
|
|
51181
|
-
})),
|
|
51184
|
+
})), C = k(() => {
|
|
51182
51185
|
let { class: e, style: t, ...n } = i;
|
|
51183
51186
|
return n;
|
|
51184
51187
|
});
|
|
51185
|
-
function
|
|
51188
|
+
function w() {
|
|
51186
51189
|
if (v.value !== EF.Image) return;
|
|
51187
51190
|
let e = l.value?.querySelector("svg");
|
|
51188
51191
|
e && (e.style.transform = `scale(${m.value}) translate(${h.value.x}px, ${h.value.y}px)`, e.style.transformOrigin = "center", e.style.transition = g.value ? "none" : "transform 0.1s ease-out", e.style.cursor = g.value ? "grabbing" : "grab");
|
|
51189
51192
|
}
|
|
51190
|
-
let
|
|
51191
|
-
|
|
51192
|
-
|
|
51193
|
-
|
|
51194
|
-
|
|
51195
|
-
|
|
51196
|
-
|
|
51197
|
-
|
|
51198
|
-
|
|
51199
|
-
|
|
51200
|
-
|
|
51201
|
-
|
|
51202
|
-
|
|
51203
|
-
|
|
51204
|
-
|
|
51205
|
-
|
|
51193
|
+
let T = 0, E = 0, D = OF(async () => {
|
|
51194
|
+
let { content: e, renderType: t } = y.value, n = l.value;
|
|
51195
|
+
if (!n || t === EF.Code || !e?.trim()) return;
|
|
51196
|
+
let r = ++T;
|
|
51197
|
+
try {
|
|
51198
|
+
if (await SF(e, { suppressErrors: !0 }) === !1) throw Error("Invalid Mermaid syntax");
|
|
51199
|
+
let { svg: t } = await CF(`${u}-${DF++}-${e.length || 0}`, e);
|
|
51200
|
+
if (r <= E) return;
|
|
51201
|
+
n.innerHTML = t, E = r, w();
|
|
51202
|
+
} catch (n) {
|
|
51203
|
+
if (r !== T || y.value.content !== e || y.value.renderType !== t) return;
|
|
51204
|
+
gF(!1, "Mermaid", `Render failed: ${String(n)}`);
|
|
51205
|
+
}
|
|
51206
|
+
}, 100), O = () => {
|
|
51207
|
+
E = ++T, D.cancel();
|
|
51208
|
+
};
|
|
51209
|
+
function A(n) {
|
|
51206
51210
|
e.renderType === void 0 && (p.value = n), t("update:renderType", n), t("renderTypeChange", n);
|
|
51207
51211
|
}
|
|
51208
|
-
function
|
|
51212
|
+
function M(e) {
|
|
51209
51213
|
v.value === EF.Image && (e.preventDefault(), g.value = !0, _.value = {
|
|
51210
51214
|
x: e.clientX,
|
|
51211
51215
|
y: e.clientY
|
|
51212
51216
|
});
|
|
51213
51217
|
}
|
|
51214
|
-
function
|
|
51218
|
+
function N(e) {
|
|
51215
51219
|
if (!g.value || v.value !== EF.Image) return;
|
|
51216
51220
|
e.preventDefault();
|
|
51217
51221
|
let t = e.clientX - _.value.x, n = e.clientY - _.value.y;
|
|
@@ -51223,29 +51227,29 @@ var kF = /* @__PURE__ */ M({
|
|
|
51223
51227
|
y: e.clientY
|
|
51224
51228
|
};
|
|
51225
51229
|
}
|
|
51226
|
-
function
|
|
51230
|
+
function P() {
|
|
51227
51231
|
g.value = !1;
|
|
51228
51232
|
}
|
|
51229
|
-
function
|
|
51233
|
+
function F() {
|
|
51230
51234
|
v.value === EF.Image && (m.value += .2);
|
|
51231
51235
|
}
|
|
51232
|
-
function
|
|
51236
|
+
function I() {
|
|
51233
51237
|
v.value === EF.Image && (m.value = Math.max(m.value - .2, .5));
|
|
51234
51238
|
}
|
|
51235
|
-
function
|
|
51239
|
+
function L() {
|
|
51236
51240
|
v.value === EF.Image && (m.value = 1, h.value = {
|
|
51237
51241
|
x: 0,
|
|
51238
51242
|
y: 0
|
|
51239
51243
|
});
|
|
51240
51244
|
}
|
|
51241
|
-
async function
|
|
51245
|
+
async function R() {
|
|
51242
51246
|
try {
|
|
51243
51247
|
await navigator.clipboard.writeText(e.content);
|
|
51244
51248
|
} catch (e) {
|
|
51245
51249
|
gF(!1, "Mermaid", `Copy failed: ${String(e)}`);
|
|
51246
51250
|
}
|
|
51247
51251
|
}
|
|
51248
|
-
function
|
|
51252
|
+
function z() {
|
|
51249
51253
|
if (v.value !== EF.Image) return;
|
|
51250
51254
|
let e = l.value?.querySelector("svg");
|
|
51251
51255
|
if (!e) return;
|
|
@@ -51269,47 +51273,47 @@ var kF = /* @__PURE__ */ M({
|
|
|
51269
51273
|
e.download = `${Date.now()}.png`, e.href = o.toDataURL("image/png", 1), e.click();
|
|
51270
51274
|
}, u.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(a)}`;
|
|
51271
51275
|
}
|
|
51272
|
-
let
|
|
51276
|
+
let V = k(() => {
|
|
51273
51277
|
let t = [];
|
|
51274
|
-
return v.value === EF.Image && (
|
|
51278
|
+
return v.value === EF.Image && (b.value.enableZoom && t.push({
|
|
51275
51279
|
key: "zoomIn",
|
|
51276
51280
|
icon: j(Fp, null, null),
|
|
51277
51281
|
label: o.value.zoomIn,
|
|
51278
|
-
onItemClick:
|
|
51282
|
+
onItemClick: F
|
|
51279
51283
|
}, {
|
|
51280
51284
|
key: "zoomOut",
|
|
51281
51285
|
icon: j(Lp, null, null),
|
|
51282
51286
|
label: o.value.zoomOut,
|
|
51283
|
-
onItemClick:
|
|
51287
|
+
onItemClick: I
|
|
51284
51288
|
}, {
|
|
51285
51289
|
key: "zoomReset",
|
|
51286
51290
|
actionRender: () => j(eu, { title: o.value.zoomReset }, { default: () => [j(_h, {
|
|
51287
51291
|
type: "text",
|
|
51288
51292
|
size: "small",
|
|
51289
|
-
onClick:
|
|
51293
|
+
onClick: L
|
|
51290
51294
|
}, { default: () => [o.value.zoomReset] })] })
|
|
51291
|
-
}),
|
|
51295
|
+
}), b.value.enableDownload && t.push({
|
|
51292
51296
|
key: "download",
|
|
51293
51297
|
icon: j(af, null, null),
|
|
51294
51298
|
label: o.value.download,
|
|
51295
|
-
onItemClick:
|
|
51296
|
-
})), v.value === EF.Code &&
|
|
51299
|
+
onItemClick: z
|
|
51300
|
+
})), v.value === EF.Code && b.value.enableCopy && t.push({
|
|
51297
51301
|
key: "copy",
|
|
51298
51302
|
actionRender: () => j(PM.Copy, { text: e.content }, null)
|
|
51299
|
-
}), [...t, ...
|
|
51303
|
+
}), [...t, ...b.value.customActions];
|
|
51300
51304
|
});
|
|
51301
|
-
function
|
|
51305
|
+
function ee() {
|
|
51302
51306
|
return e.header === null ? null : r.header ? r.header({
|
|
51303
51307
|
renderType: v.value,
|
|
51304
|
-
setRenderType:
|
|
51305
|
-
zoomIn:
|
|
51306
|
-
zoomOut:
|
|
51307
|
-
resetZoom:
|
|
51308
|
-
download:
|
|
51309
|
-
copy:
|
|
51308
|
+
setRenderType: A,
|
|
51309
|
+
zoomIn: F,
|
|
51310
|
+
zoomOut: I,
|
|
51311
|
+
resetZoom: L,
|
|
51312
|
+
download: z,
|
|
51313
|
+
copy: R
|
|
51310
51314
|
}) : e.header === void 0 ? j("div", {
|
|
51311
|
-
class: [`${e.prefixCls}-header`,
|
|
51312
|
-
style:
|
|
51315
|
+
class: [`${e.prefixCls}-header`, x.value.header],
|
|
51316
|
+
style: S.value.header
|
|
51313
51317
|
}, [j(bT, {
|
|
51314
51318
|
options: [{
|
|
51315
51319
|
label: o.value.image,
|
|
@@ -51319,8 +51323,8 @@ var kF = /* @__PURE__ */ M({
|
|
|
51319
51323
|
value: EF.Code
|
|
51320
51324
|
}],
|
|
51321
51325
|
value: v.value,
|
|
51322
|
-
onChange: (e) =>
|
|
51323
|
-
}, null), j(PM, { items:
|
|
51326
|
+
onChange: (e) => A(e)
|
|
51327
|
+
}, null), j(PM, { items: V.value }, null)]) : e.header;
|
|
51324
51328
|
}
|
|
51325
51329
|
return q(() => e.renderType, (e) => {
|
|
51326
51330
|
e !== void 0 && (p.value = e);
|
|
@@ -51342,13 +51346,22 @@ var kF = /* @__PURE__ */ M({
|
|
|
51342
51346
|
v,
|
|
51343
51347
|
() => l.value
|
|
51344
51348
|
], () => {
|
|
51345
|
-
|
|
51349
|
+
y.value = {
|
|
51350
|
+
content: e.content,
|
|
51351
|
+
renderType: v.value
|
|
51352
|
+
};
|
|
51353
|
+
let t = l.value;
|
|
51354
|
+
if (v.value === EF.Code || !e.content?.trim()) {
|
|
51355
|
+
O(), t && (t.innerHTML = "");
|
|
51356
|
+
return;
|
|
51357
|
+
}
|
|
51358
|
+
t && D();
|
|
51346
51359
|
}, {
|
|
51347
51360
|
immediate: !0,
|
|
51348
51361
|
deep: !0
|
|
51349
51362
|
}), q([
|
|
51350
51363
|
v,
|
|
51351
|
-
() =>
|
|
51364
|
+
() => b.value.enableZoom,
|
|
51352
51365
|
() => l.value
|
|
51353
51366
|
], ([e, t], n, r) => {
|
|
51354
51367
|
let i = l.value;
|
|
@@ -51370,17 +51383,17 @@ var kF = /* @__PURE__ */ M({
|
|
|
51370
51383
|
v,
|
|
51371
51384
|
g
|
|
51372
51385
|
], () => {
|
|
51373
|
-
|
|
51386
|
+
w();
|
|
51374
51387
|
}, { deep: !0 }), H(() => {
|
|
51375
|
-
|
|
51388
|
+
O();
|
|
51376
51389
|
}), n({ get nativeElement() {
|
|
51377
51390
|
return c.value;
|
|
51378
|
-
} }), () => e.content ? j("div", B({ ref: c },
|
|
51391
|
+
} }), () => e.content ? j("div", B({ ref: c }, C.value, {
|
|
51379
51392
|
class: [
|
|
51380
51393
|
e.prefixCls,
|
|
51381
51394
|
s.value.classes?.root,
|
|
51382
51395
|
e.rootClass,
|
|
51383
|
-
|
|
51396
|
+
x.value.root,
|
|
51384
51397
|
d.value,
|
|
51385
51398
|
f.value,
|
|
51386
51399
|
i.class,
|
|
@@ -51390,28 +51403,28 @@ var kF = /* @__PURE__ */ M({
|
|
|
51390
51403
|
style: [
|
|
51391
51404
|
s.value.style,
|
|
51392
51405
|
s.value.styles?.root,
|
|
51393
|
-
|
|
51406
|
+
S.value.root,
|
|
51394
51407
|
i.style,
|
|
51395
51408
|
e.style
|
|
51396
51409
|
]
|
|
51397
51410
|
}), [
|
|
51398
|
-
|
|
51411
|
+
ee(),
|
|
51399
51412
|
j("div", {
|
|
51400
51413
|
ref: l,
|
|
51401
51414
|
class: [
|
|
51402
51415
|
`${e.prefixCls}-graph`,
|
|
51403
51416
|
v.value === EF.Code && `${e.prefixCls}-graph-hidden`,
|
|
51404
|
-
|
|
51417
|
+
x.value.graph
|
|
51405
51418
|
],
|
|
51406
|
-
style:
|
|
51407
|
-
onMousedown:
|
|
51408
|
-
onMousemove:
|
|
51409
|
-
onMouseup:
|
|
51410
|
-
onMouseleave:
|
|
51419
|
+
style: S.value.graph,
|
|
51420
|
+
onMousedown: M,
|
|
51421
|
+
onMousemove: N,
|
|
51422
|
+
onMouseup: P,
|
|
51423
|
+
onMouseleave: P
|
|
51411
51424
|
}, null),
|
|
51412
51425
|
v.value === EF.Code ? j("div", {
|
|
51413
|
-
class: [`${e.prefixCls}-code`,
|
|
51414
|
-
style:
|
|
51426
|
+
class: [`${e.prefixCls}-code`, x.value.code],
|
|
51427
|
+
style: S.value.code
|
|
51415
51428
|
}, [j(SP, B({
|
|
51416
51429
|
showLineNumbers: !1,
|
|
51417
51430
|
showLanguage: !1,
|
|
@@ -60495,7 +60508,7 @@ var sG = /* @__PURE__ */ M({
|
|
|
60495
60508
|
class: Y([
|
|
60496
60509
|
e,
|
|
60497
60510
|
`${e}-slot`,
|
|
60498
|
-
n.value.classNames?.input
|
|
60511
|
+
n.value.classes?.input ?? n.value.classNames?.input
|
|
60499
60512
|
]),
|
|
60500
60513
|
style: v.value,
|
|
60501
60514
|
"data-placeholder": n.value.placeholder
|
|
@@ -60644,7 +60657,7 @@ var bG = /* @__PURE__ */ M({
|
|
|
60644
60657
|
ref: r,
|
|
60645
60658
|
disabled: e.disabled,
|
|
60646
60659
|
style: e.styles?.input,
|
|
60647
|
-
class: [`${e.prefixCls}-input`, e.classNames?.input],
|
|
60660
|
+
class: [`${e.prefixCls}-input`, e.classes?.input ?? e.classNames?.input],
|
|
60648
60661
|
autoSize: e.autoSize,
|
|
60649
60662
|
value: e.value,
|
|
60650
60663
|
onChange: (t) => {
|
|
@@ -61134,6 +61147,10 @@ var CG = (e) => {
|
|
|
61134
61147
|
type: [Boolean, Object],
|
|
61135
61148
|
default: () => ({ maxRows: 8 })
|
|
61136
61149
|
},
|
|
61150
|
+
classes: {
|
|
61151
|
+
type: Object,
|
|
61152
|
+
default: () => ({})
|
|
61153
|
+
},
|
|
61137
61154
|
classNames: {
|
|
61138
61155
|
type: Object,
|
|
61139
61156
|
default: () => ({})
|
|
@@ -61275,7 +61292,12 @@ var CG = (e) => {
|
|
|
61275
61292
|
getValue() {
|
|
61276
61293
|
return f.value?.getValue() ?? { value: "" };
|
|
61277
61294
|
}
|
|
61278
|
-
})
|
|
61295
|
+
});
|
|
61296
|
+
let C = k(() => ({
|
|
61297
|
+
...e.classNames,
|
|
61298
|
+
...e.classes
|
|
61299
|
+
}));
|
|
61300
|
+
UW(k(() => ({
|
|
61279
61301
|
value: h.value,
|
|
61280
61302
|
onChange: g,
|
|
61281
61303
|
onKeyUp: e.onKeyUp,
|
|
@@ -61289,7 +61311,8 @@ var CG = (e) => {
|
|
|
61289
61311
|
submitType: e.submitType,
|
|
61290
61312
|
prefixCls: s.value,
|
|
61291
61313
|
styles: e.styles,
|
|
61292
|
-
|
|
61314
|
+
classes: C.value,
|
|
61315
|
+
classNames: C.value,
|
|
61293
61316
|
autoSize: e.autoSize,
|
|
61294
61317
|
triggerSend: x,
|
|
61295
61318
|
placeholder: e.placeholder,
|
|
@@ -61301,9 +61324,9 @@ var CG = (e) => {
|
|
|
61301
61324
|
_.value = e;
|
|
61302
61325
|
}
|
|
61303
61326
|
})));
|
|
61304
|
-
let
|
|
61327
|
+
let w = k(() => `${s.value}-actions-btn`);
|
|
61305
61328
|
UF(k(() => ({
|
|
61306
|
-
prefixCls:
|
|
61329
|
+
prefixCls: w.value,
|
|
61307
61330
|
onSend: x,
|
|
61308
61331
|
onSendDisabled: _.value,
|
|
61309
61332
|
onClear: S,
|
|
@@ -61315,12 +61338,12 @@ var CG = (e) => {
|
|
|
61315
61338
|
speechRecording: b.value,
|
|
61316
61339
|
disabled: e.disabled
|
|
61317
61340
|
})));
|
|
61318
|
-
let
|
|
61341
|
+
let T = (e, t, r) => n[t] ? n[t]?.({
|
|
61319
61342
|
defaultNode: r,
|
|
61320
61343
|
components: OG
|
|
61321
61344
|
}) : typeof e == "function" ? e(r, { components: OG }) : e || e === !1 ? e : null;
|
|
61322
61345
|
return () => {
|
|
61323
|
-
let t = s.value, n = `${t}-actions-list`, r = j(HE, { class: `${n}-presets` }, { default: () => [e.allowSpeech && j(bG, null, null), e.loading ? j(YF, null, null) : j(ZF, null, null)] }), a =
|
|
61346
|
+
let t = s.value, n = `${t}-actions-list`, r = j(HE, { class: `${n}-presets` }, { default: () => [e.allowSpeech && j(bG, null, null), e.loading ? j(YF, null, null) : j(ZF, null, null)] }), a = T(e.suffix, "suffix", r) ?? r, m = T(e.prefix, "prefix", r), h = T(e.header, "header", r), g = T(e.footer, "footer", r);
|
|
61324
61347
|
return j("div", B({
|
|
61325
61348
|
ref: d,
|
|
61326
61349
|
class: [
|
|
@@ -61328,7 +61351,7 @@ var CG = (e) => {
|
|
|
61328
61351
|
o.value.classes?.root,
|
|
61329
61352
|
e.class,
|
|
61330
61353
|
e.rootClass,
|
|
61331
|
-
|
|
61354
|
+
C.value.root,
|
|
61332
61355
|
l.value,
|
|
61333
61356
|
u.value,
|
|
61334
61357
|
`${t}-main`,
|
|
@@ -61346,7 +61369,7 @@ var CG = (e) => {
|
|
|
61346
61369
|
}, i), [
|
|
61347
61370
|
h,
|
|
61348
61371
|
j("div", {
|
|
61349
|
-
class: [`${t}-content`,
|
|
61372
|
+
class: [`${t}-content`, C.value.content],
|
|
61350
61373
|
style: e.styles.content,
|
|
61351
61374
|
onMousedown: (e) => {
|
|
61352
61375
|
let n = d.value?.querySelector(`.${t}-input`);
|
|
@@ -61357,7 +61380,7 @@ var CG = (e) => {
|
|
|
61357
61380
|
class: [
|
|
61358
61381
|
`${t}-prefix`,
|
|
61359
61382
|
o.value.classes?.prefix,
|
|
61360
|
-
|
|
61383
|
+
C.value.prefix
|
|
61361
61384
|
],
|
|
61362
61385
|
style: [o.value.styles?.prefix, e.styles.prefix]
|
|
61363
61386
|
}, [m]),
|
|
@@ -61366,7 +61389,7 @@ var CG = (e) => {
|
|
|
61366
61389
|
class: [
|
|
61367
61390
|
n,
|
|
61368
61391
|
o.value.classes?.suffix,
|
|
61369
|
-
|
|
61392
|
+
C.value.suffix
|
|
61370
61393
|
],
|
|
61371
61394
|
style: [o.value.styles?.suffix, e.styles.suffix]
|
|
61372
61395
|
}, [a])
|
|
@@ -61375,7 +61398,7 @@ var CG = (e) => {
|
|
|
61375
61398
|
class: [
|
|
61376
61399
|
`${t}-footer`,
|
|
61377
61400
|
o.value.classes?.footer,
|
|
61378
|
-
|
|
61401
|
+
C.value.footer
|
|
61379
61402
|
],
|
|
61380
61403
|
style: [o.value.styles?.footer, e.styles.footer]
|
|
61381
61404
|
}, [g])
|
|
@@ -61409,6 +61432,10 @@ var CG = (e) => {
|
|
|
61409
61432
|
type: [String, Object],
|
|
61410
61433
|
default: void 0
|
|
61411
61434
|
},
|
|
61435
|
+
classes: {
|
|
61436
|
+
type: Object,
|
|
61437
|
+
default: () => ({})
|
|
61438
|
+
},
|
|
61412
61439
|
classNames: {
|
|
61413
61440
|
type: Object,
|
|
61414
61441
|
default: () => ({})
|
|
@@ -61430,7 +61457,10 @@ var CG = (e) => {
|
|
|
61430
61457
|
let n = Oe(), r = HW(), i = k(() => {
|
|
61431
61458
|
let t = r.value.prefixCls;
|
|
61432
61459
|
return `${e.prefixCls ?? t ?? "antd-sender"}-header`;
|
|
61433
|
-
}), a = k(() => n.value.direction)
|
|
61460
|
+
}), a = k(() => n.value.direction), o = k(() => ({
|
|
61461
|
+
...e.classNames,
|
|
61462
|
+
...e.classes
|
|
61463
|
+
}));
|
|
61434
61464
|
return () => {
|
|
61435
61465
|
let n = i.value, r = j("div", {
|
|
61436
61466
|
class: [
|
|
@@ -61440,7 +61470,7 @@ var CG = (e) => {
|
|
|
61440
61470
|
],
|
|
61441
61471
|
style: e.style
|
|
61442
61472
|
}, [(e.closable || e.title) && j("div", {
|
|
61443
|
-
class: [`${n}-header`,
|
|
61473
|
+
class: [`${n}-header`, o.value.header],
|
|
61444
61474
|
style: e.styles.header
|
|
61445
61475
|
}, [j("div", { class: `${n}-title` }, [t.title?.() ?? e.title]), e.closable && j("div", { class: `${n}-close` }, [j(_h, {
|
|
61446
61476
|
type: "text",
|
|
@@ -61448,7 +61478,7 @@ var CG = (e) => {
|
|
|
61448
61478
|
size: "small",
|
|
61449
61479
|
onClick: () => e.onOpenChange?.(!e.open)
|
|
61450
61480
|
}, null)])]), t.default && j("div", {
|
|
61451
|
-
class: [`${n}-content`,
|
|
61481
|
+
class: [`${n}-content`, o.value.content],
|
|
61452
61482
|
style: e.styles.content
|
|
61453
61483
|
}, [t.default()])]);
|
|
61454
61484
|
return j(E, {
|
|
@@ -61530,6 +61560,10 @@ var CG = (e) => {
|
|
|
61530
61560
|
type: Function,
|
|
61531
61561
|
default: void 0
|
|
61532
61562
|
},
|
|
61563
|
+
classes: {
|
|
61564
|
+
type: Object,
|
|
61565
|
+
default: () => ({})
|
|
61566
|
+
},
|
|
61533
61567
|
classNames: {
|
|
61534
61568
|
type: Object,
|
|
61535
61569
|
default: () => ({})
|
|
@@ -61547,11 +61581,14 @@ var CG = (e) => {
|
|
|
61547
61581
|
q(() => e.value, (e) => {
|
|
61548
61582
|
e !== void 0 && (d.value = e);
|
|
61549
61583
|
}, { immediate: !0 });
|
|
61550
|
-
let f = k(() => e.value ?? d.value)
|
|
61584
|
+
let f = k(() => e.value ?? d.value), p = k(() => ({
|
|
61585
|
+
...e.classNames,
|
|
61586
|
+
...e.classes
|
|
61587
|
+
}));
|
|
61551
61588
|
return t({ get nativeElement() {
|
|
61552
61589
|
return u.value;
|
|
61553
61590
|
} }), () => {
|
|
61554
|
-
let t = c.value, i = n.icon?.() ?? e.icon,
|
|
61591
|
+
let t = c.value, i = n.icon?.() ?? e.icon, m = n.checkedChildren?.() ?? e.checkedChildren, h = n.unCheckedChildren?.() ?? e.unCheckedChildren;
|
|
61555
61592
|
return j("div", B({
|
|
61556
61593
|
ref: u,
|
|
61557
61594
|
class: [
|
|
@@ -61560,8 +61597,8 @@ var CG = (e) => {
|
|
|
61560
61597
|
e.class,
|
|
61561
61598
|
e.rootClass,
|
|
61562
61599
|
o.value.classes?.switch,
|
|
61563
|
-
a.value.classNames?.switch,
|
|
61564
|
-
|
|
61600
|
+
a.value.classes?.switch ?? a.value.classNames?.switch,
|
|
61601
|
+
p.value.root,
|
|
61565
61602
|
{
|
|
61566
61603
|
[`${t}-checked`]: f.value,
|
|
61567
61604
|
[`${t}-rtl`]: l.value === "rtl"
|
|
@@ -61576,12 +61613,12 @@ var CG = (e) => {
|
|
|
61576
61613
|
}, r), [j(_h, B({
|
|
61577
61614
|
disabled: e.disabled,
|
|
61578
61615
|
loading: e.loading,
|
|
61579
|
-
class: [`${t}-content`,
|
|
61616
|
+
class: [`${t}-content`, p.value.content],
|
|
61580
61617
|
style: e.styles.content
|
|
61581
61618
|
}, {
|
|
61582
61619
|
classes: {
|
|
61583
|
-
icon:
|
|
61584
|
-
content:
|
|
61620
|
+
icon: p.value.icon,
|
|
61621
|
+
content: p.value.title
|
|
61585
61622
|
},
|
|
61586
61623
|
styles: {
|
|
61587
61624
|
icon: e.styles.icon,
|
|
@@ -61595,7 +61632,7 @@ var CG = (e) => {
|
|
|
61595
61632
|
let t = !f.value;
|
|
61596
61633
|
d.value = t, e.onChange?.(t);
|
|
61597
61634
|
}
|
|
61598
|
-
}), { default: () => [f.value ?
|
|
61635
|
+
}), { default: () => [f.value ? m : h, n.default?.()] })]);
|
|
61599
61636
|
};
|
|
61600
61637
|
}
|
|
61601
61638
|
}), MG = kG;
|