@antdv-next/x 1.1.2-beta.2 → 1.1.2-beta.4
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 +33 -15
- package/dist/package.js +1 -1
- package/dist/sender/Sender.js +2 -2
- package/dist/sender/components/SlotTextArea.js +22 -7
- package/dist/sender/hooks/use-speech.d.ts +1 -1
- package/dist/sender/hooks/use-speech.js +8 -5
- package/dist/sender/interface.d.ts +1 -1
- package/dist/x-provider/hooks/use-x-provider-context.d.ts +2 -2
- package/es/{Serializer-D1JYN1kI.js → Serializer-y_SfSPKv.js} +4 -4
- package/es/{_basePickBy-DFHEGO2M.js → _basePickBy-Cy7KVmkk.js} +23 -23
- package/es/{_baseUniq-BlS7rXTs.js → _baseUniq-Ch3HuHeT.js} +83 -83
- package/es/antdv-next-x.esm.js +433 -414
- package/es/{arc-BuXEd18J.js → arc-caEkbRYF.js} +3 -3
- package/es/architecture-PBZL5I3N-DHfBr78A.js +3 -0
- package/es/{architectureDiagram-2XIMDMQ5-CmfsCwJk.js → architectureDiagram-2XIMDMQ5-B4BHdsAL.js} +9 -9
- package/es/{blockDiagram-WCTKOSBZ-lJAan65A.js → blockDiagram-WCTKOSBZ-nXanZ0sc.js} +12 -12
- package/es/{c4Diagram-IC4MRINW-B1c2x_1Q.js → c4Diagram-IC4MRINW-C-gVp6th.js} +6 -6
- package/es/channel-DoEe9DF9.js +5 -0
- package/es/{chunk-4BX2VUAB-J2N81Fpp.js → chunk-4BX2VUAB-fLFD6XW0.js} +2 -2
- package/es/{chunk-55IACEB6-DGtfGRgi.js → chunk-55IACEB6-OtyKJzCH.js} +2 -2
- package/es/{chunk-7E7YKBS2-CL2d4WAf.js → chunk-7E7YKBS2-C1dd36rm.js} +2 -2
- package/es/{chunk-7R4GIKGN-QT6IorJ_.js → chunk-7R4GIKGN-DuTRhdsf.js} +3 -3
- package/es/{chunk-C72U2L5F-OHTVpS-m.js → chunk-C72U2L5F-ClmZGhFC.js} +2 -2
- package/es/{chunk-EGIJ26TM-DyMPGYrB.js → chunk-EGIJ26TM-Bar_u1MN.js} +2 -2
- package/es/{chunk-FMBD7UC4-DCcRjunY.js → chunk-FMBD7UC4-C_uJ_JJA.js} +2 -2
- package/es/{chunk-GEFDOKGD-BWpC-zoH.js → chunk-GEFDOKGD-P7WhyrTU.js} +30 -30
- package/es/{chunk-GLR3WWYH-DiXcKb5Y.js → chunk-GLR3WWYH-BBFkZWLy.js} +8 -8
- package/es/{chunk-HHEYEP7N-Cxc7E4dX.js → chunk-HHEYEP7N-rv5s5WD4.js} +3 -3
- package/es/{chunk-JSJVCQXG-D8_heHOp.js → chunk-JSJVCQXG-89HUGe9V.js} +4 -4
- package/es/{chunk-KX2RTZJC-D5cc4rj6.js → chunk-KX2RTZJC-pMHnNRQg.js} +3 -3
- package/es/{chunk-KYZI473N-BHJ3T5Zv.js → chunk-KYZI473N-DJmSs1gK.js} +8 -8
- package/es/{chunk-L3YUKLVL-7oGaUOdc.js → chunk-L3YUKLVL-Ck54qytQ.js} +2 -2
- package/es/{chunk-MX3YWQON-BxE-Aq9c.js → chunk-MX3YWQON-MkpK3uBD.js} +2 -2
- package/es/{chunk-NQ4KR5QH-EYQBXkqP.js → chunk-NQ4KR5QH-I7cFzfZu.js} +7 -7
- package/es/{chunk-O4XLMI2P-qjOoGpnx.js → chunk-O4XLMI2P-e-ZzDQwg.js} +11 -11
- package/es/{chunk-OZEHJAEY-D82nx27s.js → chunk-OZEHJAEY-DULNd43V.js} +2 -2
- package/es/{chunk-PQ6SQG4A-D3jtNCWN.js → chunk-PQ6SQG4A-CQ9Csv7s.js} +3 -3
- package/es/{chunk-PU5JKC2W-DdP8BS-S.js → chunk-PU5JKC2W-DkEFvrjH.js} +16 -16
- package/es/{chunk-QZHKN3VN-CW3cFN-h.js → chunk-QZHKN3VN-qww1plfw.js} +2 -2
- package/es/{chunk-R5LLSJPH-CreI2kO9.js → chunk-R5LLSJPH-BERXSDGJ.js} +2 -2
- package/es/{chunk-WL4C6EOR-BDbxJyGk.js → chunk-WL4C6EOR-B6HgoDzQ.js} +9 -9
- package/es/{chunk-XIRO2GV7-S5KkbVnN.js → chunk-XIRO2GV7-CFHofxVB.js} +2 -2
- package/es/{chunk-XPW4576I-B0KVSHwE.js → chunk-XPW4576I-DgvoNZkW.js} +2 -2
- package/es/{chunk-XZSTWKYB-CucN1XvM.js → chunk-XZSTWKYB-k8_EXrSa.js} +93 -93
- package/es/{chunk-YBOYWFTD-CvaddD9G.js → chunk-YBOYWFTD-BUW4AzEX.js} +4 -4
- package/es/classDiagram-VBA2DB6C-CqK9jdgh.js +29 -0
- package/es/classDiagram-v2-RAHNMMFH-ZDIng8Gz.js +29 -0
- package/es/clone-BXDbKCDu.js +8 -0
- package/es/{cose-bilkent-S5V4N54A-B5OQuIhl.js → cose-bilkent-S5V4N54A-DS-oTq56.js} +3 -3
- package/es/{cytoscape.esm-i2CZcWd-.js → cytoscape.esm-BY3wHcbp.js} +1 -1
- package/es/{dagre-5aGJFKmT.js → dagre-BJOzGlhW.js} +57 -57
- package/es/{dagre-KLK3FWXG-BI5QQMXo.js → dagre-KLK3FWXG-CFC0naVr.js} +16 -16
- package/es/{defaultLocale-bckJcYh1.js → defaultLocale-BaPFSbai.js} +12 -12
- package/es/{diagram-E7M64L7V-Dz62Vz_a.js → diagram-E7M64L7V-DxuJj8ZG.js} +32 -32
- package/es/{diagram-IFDJBPK2-9fjvFkSc.js → diagram-IFDJBPK2-BOpPZ6pu.js} +7 -7
- package/es/{diagram-P4PSJMXO-BlX6jFjZ.js → diagram-P4PSJMXO--ChDmcya.js} +7 -7
- package/es/{dist-BX_roQzC.js → dist-DltyvPj3.js} +1 -1
- package/es/{erDiagram-INFDFZHY-BcRXu8Cp.js → erDiagram-INFDFZHY-TwqnRnWa.js} +14 -14
- package/es/{flowDiagram-PKNHOUZH-UeyfgU8z.js → flowDiagram-PKNHOUZH-DOIW1Sy9.js} +17 -17
- package/es/{ganttDiagram-A5KZAMGK-txCzqgQ5.js → ganttDiagram-A5KZAMGK-DdMePS21.js} +28 -28
- package/es/gitGraph-HDMCJU4V-DbzpICZW.js +3 -0
- package/es/{gitGraphDiagram-K3NZZRJ6-DghWYaFU.js → gitGraphDiagram-K3NZZRJ6-CLbRwChG.js} +7 -7
- package/es/{graphlib-dRkI1OCL.js → graphlib-C7ysKz4u.js} +4 -4
- package/es/{html-B6UxjOv0.js → html-C2-_98S6.js} +1 -1
- package/es/html-JbFqcNgP.js +2 -0
- package/es/info-3K5VOQVL-CpUiQuel.js +3 -0
- package/es/{infoDiagram-LFFYTUFH-CA-vlAvP.js → infoDiagram-LFFYTUFH-DQAZ-vFk.js} +5 -5
- package/es/{init-B75p2clj.js → init-PAs0hR-b.js} +1 -1
- package/es/{isArrayLikeObject-jl2bjkAJ.js → isArrayLikeObject-y3HlYDaX.js} +80 -80
- package/es/{isEmpty-CmA-HYrg.js → isEmpty-2JxdWtc-.js} +3 -3
- package/es/{ishikawaDiagram-PHBUUO56-DjdpS9Lb.js → ishikawaDiagram-PHBUUO56-B0r2IgGz.js} +6 -6
- package/es/{journeyDiagram-4ABVD52K-CIJfC1fp.js → journeyDiagram-4ABVD52K-DnMUhOvg.js} +6 -6
- package/es/{kanban-definition-K7BYSVSG-CC2vwGck.js → kanban-definition-K7BYSVSG-Da5Y-nJy.js} +11 -11
- package/es/{katex-DCMiIo1z.js → katex-b-xdokOf.js} +1 -1
- package/es/{line-Cu9NTacD.js → line-h2iCTGsE.js} +4 -4
- package/es/{linear-C0rAYYmp.js → linear-Bv7XrZCH.js} +23 -23
- package/es/{math-CoDOuve-.js → math-DPzKeDKn.js} +1 -1
- package/es/{mermaid-parser.core-7Wn2L29P.js → mermaid-parser.core-kTgpNO7M.js} +16 -16
- package/es/{mermaid.core-Bvy_Q6Hu.js → mermaid.core-Cdr_0as6.js} +44 -44
- package/es/{mindmap-definition-YRQLILUH-BzTYDYmK.js → mindmap-definition-YRQLILUH-CtrmThyY.js} +16 -16
- package/es/{ordinal-F3U6aXtP.js → ordinal-D8PKtxfM.js} +3 -3
- package/es/packet-RMMSAZCW-UTFQ0FQx.js +3 -0
- package/es/{path-Dm3C8WEs.js → path-DZ-6AyWK.js} +3 -3
- package/es/pie-UPGHQEXC-CarAcBSi.js +3 -0
- package/es/{pieDiagram-SKSYHLDU-COvqE_C6.js → pieDiagram-SKSYHLDU-DAsfTGvY.js} +14 -14
- package/es/{quadrantDiagram-337W2JSQ-Dgv8ccjt.js → quadrantDiagram-337W2JSQ-CZLbmQS4.js} +4 -4
- package/es/radar-KQ55EAFF-NXK5PC9R.js +3 -0
- package/es/{requirementDiagram-Z7DCOOCP-B2NyhxO-.js → requirementDiagram-Z7DCOOCP-DwsKf6TC.js} +13 -13
- package/es/{rough.esm-BhGP2Udb.js → rough.esm-C_hJ3ICT.js} +1 -1
- package/es/{sankeyDiagram-WA2Y5GQK-BfnH_gpl.js → sankeyDiagram-WA2Y5GQK-DBe5YfW4.js} +18 -18
- package/es/{sequenceDiagram-2WXFIKYE-DXssVQOF.js → sequenceDiagram-2WXFIKYE-C_KUoojT.js} +8 -8
- package/es/{src-CUQ6oOYk.js → src-BukXhifV.js} +86 -86
- package/es/{stateDiagram-RAJIS63D-DvDLfupV.js → stateDiagram-RAJIS63D-Bjd_66hy.js} +17 -17
- package/es/stateDiagram-v2-FVOUBMTO-BjIcGAyh.js +27 -0
- package/es/{timeline-definition-YZTLITO2-ErcRjbZf.js → timeline-definition-YZTLITO2-pFt6rZ6S.js} +4 -4
- package/es/treemap-KZPCXAKY-Cj9QakFB.js +3 -0
- package/es/{vennDiagram-LZ73GAT5-CDTZUtc8.js → vennDiagram-LZ73GAT5-VaCO6k4H.js} +7 -7
- package/es/{vue-2aJw7p5p.js → vue-DTiWrQBM.js} +2 -2
- package/es/{vue-html-DEjI8X9t.js → vue-html-BG3Xflut.js} +1 -1
- package/es/{xychartDiagram-JWTSCODW-Y21jBOTg.js → xychartDiagram-JWTSCODW-xS5ybemA.js} +12 -12
- package/package.json +1 -1
- package/es/architecture-PBZL5I3N-D7tS55xM.js +0 -3
- package/es/channel-DFgF_2F7.js +0 -5
- package/es/classDiagram-VBA2DB6C-Co3LMmg8.js +0 -29
- package/es/classDiagram-v2-RAHNMMFH-BZscgdF2.js +0 -29
- package/es/clone-r3YukIBB.js +0 -8
- package/es/gitGraph-HDMCJU4V-CxsS0Qr1.js +0 -3
- package/es/html-Hb1oe8XT.js +0 -2
- package/es/info-3K5VOQVL-COqdvM99.js +0 -3
- package/es/packet-RMMSAZCW-2PTjWKLd.js +0 -3
- package/es/pie-UPGHQEXC-Du8-k-EA.js +0 -3
- package/es/radar-KQ55EAFF-jJOhyjxC.js +0 -3
- package/es/stateDiagram-v2-FVOUBMTO-DIXyaX9W.js +0 -27
- package/es/treemap-KZPCXAKY-CvZAIYVa.js +0 -3
package/dist/index.umd.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
shiki_dist_themes_vitesse_dark_mjs = __toESM(shiki_dist_themes_vitesse_dark_mjs);
|
|
49
49
|
shiki_dist_themes_vitesse_light_mjs = __toESM(shiki_dist_themes_vitesse_light_mjs);
|
|
50
50
|
//#region package.json
|
|
51
|
-
var version = "1.1.2-beta.
|
|
51
|
+
var version = "1.1.2-beta.4";
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region components/x-provider/context.ts
|
|
54
54
|
var XProviderContextKey = Symbol("antdv-next-x-provider-context");
|
|
@@ -8613,7 +8613,7 @@
|
|
|
8613
8613
|
const updateSkillEmptyStatus = (value = getEditorValue()) => {
|
|
8614
8614
|
const skillDom = skillDomRef.value;
|
|
8615
8615
|
if (!skillDom) return;
|
|
8616
|
-
if (!value.value && value.slotConfig.length === 0 && !!senderCtx.value.placeholder) {
|
|
8616
|
+
if (!value.value && value.slotConfig.length === 0 && !!senderCtx.value.placeholder && !skillDom.hasChildNodes()) {
|
|
8617
8617
|
skillDom.setAttribute("contenteditable", "true");
|
|
8618
8618
|
skillDom.classList.add(`${prefixCls.value}-skill-empty`);
|
|
8619
8619
|
} else {
|
|
@@ -8671,15 +8671,29 @@
|
|
|
8671
8671
|
const anchorNode = selection.anchorNode;
|
|
8672
8672
|
const offset = selection.anchorOffset;
|
|
8673
8673
|
if (!anchorNode || !editable.contains(anchorNode)) return false;
|
|
8674
|
-
|
|
8674
|
+
const isSlotOrSkill = (node) => {
|
|
8675
|
+
if (!(node instanceof HTMLElement)) return false;
|
|
8676
|
+
const info = getNodeInfo(node);
|
|
8677
|
+
return !!(info?.slotKey || info?.skillKey);
|
|
8678
|
+
};
|
|
8679
|
+
let previous = null;
|
|
8675
8680
|
if (anchorNode === editable) {
|
|
8676
|
-
|
|
8677
|
-
|
|
8681
|
+
for (let i = offset - 1; i >= 0; i--) if (isSlotOrSkill(editable.childNodes[i])) {
|
|
8682
|
+
previous = editable.childNodes[i];
|
|
8683
|
+
break;
|
|
8684
|
+
}
|
|
8678
8685
|
} else {
|
|
8679
8686
|
if (anchorNode.nodeType === Node.TEXT_NODE && offset > 0) return false;
|
|
8680
|
-
|
|
8687
|
+
let current = anchorNode.nodeType === Node.TEXT_NODE ? anchorNode.previousSibling : anchorNode.previousSibling;
|
|
8688
|
+
while (current) {
|
|
8689
|
+
if (isSlotOrSkill(current)) {
|
|
8690
|
+
previous = current;
|
|
8691
|
+
break;
|
|
8692
|
+
}
|
|
8693
|
+
current = current.previousSibling;
|
|
8694
|
+
}
|
|
8681
8695
|
}
|
|
8682
|
-
if (!
|
|
8696
|
+
if (!previous) return false;
|
|
8683
8697
|
const info = getNodeInfo(previous);
|
|
8684
8698
|
if (info?.slotKey) {
|
|
8685
8699
|
event.preventDefault();
|
|
@@ -8824,7 +8838,8 @@
|
|
|
8824
8838
|
const { range, selection } = insertContext;
|
|
8825
8839
|
editable.focus({ preventScroll });
|
|
8826
8840
|
if (replaceCharacters) {
|
|
8827
|
-
|
|
8841
|
+
const { startContainer, startOffset } = range;
|
|
8842
|
+
if ((startContainer.nodeType === Node.TEXT_NODE ? startContainer.textContent?.slice(0, startOffset) ?? "" : "").endsWith(replaceCharacters)) range.setStart(startContainer, Math.max(0, startOffset - replaceCharacters.length));
|
|
8828
8843
|
}
|
|
8829
8844
|
range.deleteContents();
|
|
8830
8845
|
nodes.forEach((node) => {
|
|
@@ -9148,6 +9163,7 @@
|
|
|
9148
9163
|
return window.SpeechRecognition || window.webkitSpeechRecognition || null;
|
|
9149
9164
|
};
|
|
9150
9165
|
const mergedAllowSpeech = (0, vue.computed)(() => !!(isControlled.value || getSpeechRecognition() && permissionState.value !== "denied"));
|
|
9166
|
+
const mergedRecording = (0, vue.computed)(() => isControlled.value ? !!speechConfig.value?.recording : recording.value);
|
|
9151
9167
|
const ensureRecognition = () => {
|
|
9152
9168
|
if (!mergedAllowSpeech.value || recognition) return;
|
|
9153
9169
|
const SpeechRecognitionCtor = getSpeechRecognition();
|
|
@@ -9168,15 +9184,17 @@
|
|
|
9168
9184
|
};
|
|
9169
9185
|
};
|
|
9170
9186
|
const triggerSpeech = (doForceBreak) => {
|
|
9171
|
-
|
|
9187
|
+
const currentRecording = mergedRecording.value;
|
|
9188
|
+
if (doForceBreak && !currentRecording) return;
|
|
9172
9189
|
forceBreak = doForceBreak;
|
|
9173
|
-
|
|
9174
|
-
|
|
9190
|
+
const config = speechConfig.value;
|
|
9191
|
+
if (typeof config?.recording === "boolean") {
|
|
9192
|
+
config.onRecordingChange(!config.recording);
|
|
9175
9193
|
return;
|
|
9176
9194
|
}
|
|
9177
9195
|
ensureRecognition();
|
|
9178
9196
|
if (!recognition) return;
|
|
9179
|
-
if (
|
|
9197
|
+
if (currentRecording) {
|
|
9180
9198
|
recognition.stop();
|
|
9181
9199
|
speechConfig.value?.onRecordingChange?.(false);
|
|
9182
9200
|
} else {
|
|
@@ -9187,7 +9205,7 @@
|
|
|
9187
9205
|
return [
|
|
9188
9206
|
mergedAllowSpeech,
|
|
9189
9207
|
triggerSpeech,
|
|
9190
|
-
|
|
9208
|
+
mergedRecording
|
|
9191
9209
|
];
|
|
9192
9210
|
}
|
|
9193
9211
|
//#endregion
|
|
@@ -9767,13 +9785,13 @@
|
|
|
9767
9785
|
clear() {
|
|
9768
9786
|
triggerClear();
|
|
9769
9787
|
},
|
|
9770
|
-
insert(text, position) {
|
|
9788
|
+
insert(text, position, replaceCharacters) {
|
|
9771
9789
|
if (isSlotMode.value) {
|
|
9772
9790
|
const slotList = Array.isArray(text) ? text : [{
|
|
9773
9791
|
type: "text",
|
|
9774
9792
|
value: text
|
|
9775
9793
|
}];
|
|
9776
|
-
inputRef.value?.insert?.(slotList, position);
|
|
9794
|
+
inputRef.value?.insert?.(slotList, position, replaceCharacters);
|
|
9777
9795
|
return;
|
|
9778
9796
|
}
|
|
9779
9797
|
const textValue = Array.isArray(text) ? text.map((config) => {
|
package/dist/package.js
CHANGED
package/dist/sender/Sender.js
CHANGED
|
@@ -223,13 +223,13 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
223
223
|
clear() {
|
|
224
224
|
triggerClear();
|
|
225
225
|
},
|
|
226
|
-
insert(text, position) {
|
|
226
|
+
insert(text, position, replaceCharacters) {
|
|
227
227
|
if (isSlotMode.value) {
|
|
228
228
|
const slotList = Array.isArray(text) ? text : [{
|
|
229
229
|
type: "text",
|
|
230
230
|
value: text
|
|
231
231
|
}];
|
|
232
|
-
inputRef.value?.insert?.(slotList, position);
|
|
232
|
+
inputRef.value?.insert?.(slotList, position, replaceCharacters);
|
|
233
233
|
return;
|
|
234
234
|
}
|
|
235
235
|
const textValue = Array.isArray(text) ? text.map((config) => {
|
|
@@ -445,7 +445,7 @@ var SlotTextArea_default = /* @__PURE__ */ defineComponent({
|
|
|
445
445
|
const updateSkillEmptyStatus = (value = getEditorValue()) => {
|
|
446
446
|
const skillDom = skillDomRef.value;
|
|
447
447
|
if (!skillDom) return;
|
|
448
|
-
if (!value.value && value.slotConfig.length === 0 && !!senderCtx.value.placeholder) {
|
|
448
|
+
if (!value.value && value.slotConfig.length === 0 && !!senderCtx.value.placeholder && !skillDom.hasChildNodes()) {
|
|
449
449
|
skillDom.setAttribute("contenteditable", "true");
|
|
450
450
|
skillDom.classList.add(`${prefixCls.value}-skill-empty`);
|
|
451
451
|
} else {
|
|
@@ -503,15 +503,29 @@ var SlotTextArea_default = /* @__PURE__ */ defineComponent({
|
|
|
503
503
|
const anchorNode = selection.anchorNode;
|
|
504
504
|
const offset = selection.anchorOffset;
|
|
505
505
|
if (!anchorNode || !editable.contains(anchorNode)) return false;
|
|
506
|
-
|
|
506
|
+
const isSlotOrSkill = (node) => {
|
|
507
|
+
if (!(node instanceof HTMLElement)) return false;
|
|
508
|
+
const info = getNodeInfo(node);
|
|
509
|
+
return !!(info?.slotKey || info?.skillKey);
|
|
510
|
+
};
|
|
511
|
+
let previous = null;
|
|
507
512
|
if (anchorNode === editable) {
|
|
508
|
-
|
|
509
|
-
|
|
513
|
+
for (let i = offset - 1; i >= 0; i--) if (isSlotOrSkill(editable.childNodes[i])) {
|
|
514
|
+
previous = editable.childNodes[i];
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
510
517
|
} else {
|
|
511
518
|
if (anchorNode.nodeType === Node.TEXT_NODE && offset > 0) return false;
|
|
512
|
-
|
|
519
|
+
let current = anchorNode.nodeType === Node.TEXT_NODE ? anchorNode.previousSibling : anchorNode.previousSibling;
|
|
520
|
+
while (current) {
|
|
521
|
+
if (isSlotOrSkill(current)) {
|
|
522
|
+
previous = current;
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
current = current.previousSibling;
|
|
526
|
+
}
|
|
513
527
|
}
|
|
514
|
-
if (!
|
|
528
|
+
if (!previous) return false;
|
|
515
529
|
const info = getNodeInfo(previous);
|
|
516
530
|
if (info?.slotKey) {
|
|
517
531
|
event.preventDefault();
|
|
@@ -656,7 +670,8 @@ var SlotTextArea_default = /* @__PURE__ */ defineComponent({
|
|
|
656
670
|
const { range, selection } = insertContext;
|
|
657
671
|
editable.focus({ preventScroll });
|
|
658
672
|
if (replaceCharacters) {
|
|
659
|
-
|
|
673
|
+
const { startContainer, startOffset } = range;
|
|
674
|
+
if ((startContainer.nodeType === Node.TEXT_NODE ? startContainer.textContent?.slice(0, startOffset) ?? "" : "").endsWith(replaceCharacters)) range.setStart(startContainer, Math.max(0, startOffset - replaceCharacters.length));
|
|
660
675
|
}
|
|
661
676
|
range.deleteContents();
|
|
662
677
|
nodes.forEach((node) => {
|
|
@@ -3,4 +3,4 @@ export type ControlledSpeechConfig = {
|
|
|
3
3
|
onRecordingChange: (recording: boolean) => void;
|
|
4
4
|
};
|
|
5
5
|
export type AllowSpeech = boolean | ControlledSpeechConfig;
|
|
6
|
-
export default function useSpeech(onSpeech: (transcript: string) => void, allowSpeech?: () => AllowSpeech | undefined): readonly [import('vue').ComputedRef<boolean>, (doForceBreak: boolean) => void, import('vue').
|
|
6
|
+
export default function useSpeech(onSpeech: (transcript: string) => void, allowSpeech?: () => AllowSpeech | undefined): readonly [import('vue').ComputedRef<boolean>, (doForceBreak: boolean) => void, import('vue').ComputedRef<boolean>];
|
|
@@ -32,6 +32,7 @@ function useSpeech(onSpeech, allowSpeech) {
|
|
|
32
32
|
return window.SpeechRecognition || window.webkitSpeechRecognition || null;
|
|
33
33
|
};
|
|
34
34
|
const mergedAllowSpeech = computed(() => !!(isControlled.value || getSpeechRecognition() && permissionState.value !== "denied"));
|
|
35
|
+
const mergedRecording = computed(() => isControlled.value ? !!speechConfig.value?.recording : recording.value);
|
|
35
36
|
const ensureRecognition = () => {
|
|
36
37
|
if (!mergedAllowSpeech.value || recognition) return;
|
|
37
38
|
const SpeechRecognitionCtor = getSpeechRecognition();
|
|
@@ -52,15 +53,17 @@ function useSpeech(onSpeech, allowSpeech) {
|
|
|
52
53
|
};
|
|
53
54
|
};
|
|
54
55
|
const triggerSpeech = (doForceBreak) => {
|
|
55
|
-
|
|
56
|
+
const currentRecording = mergedRecording.value;
|
|
57
|
+
if (doForceBreak && !currentRecording) return;
|
|
56
58
|
forceBreak = doForceBreak;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
const config = speechConfig.value;
|
|
60
|
+
if (typeof config?.recording === "boolean") {
|
|
61
|
+
config.onRecordingChange(!config.recording);
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
61
64
|
ensureRecognition();
|
|
62
65
|
if (!recognition) return;
|
|
63
|
-
if (
|
|
66
|
+
if (currentRecording) {
|
|
64
67
|
recognition.stop();
|
|
65
68
|
speechConfig.value?.onRecordingChange?.(false);
|
|
66
69
|
} else {
|
|
@@ -71,7 +74,7 @@ function useSpeech(onSpeech, allowSpeech) {
|
|
|
71
74
|
return [
|
|
72
75
|
mergedAllowSpeech,
|
|
73
76
|
triggerSpeech,
|
|
74
|
-
|
|
77
|
+
mergedRecording
|
|
75
78
|
];
|
|
76
79
|
}
|
|
77
80
|
//#endregion
|
|
@@ -128,7 +128,7 @@ export interface SenderRef {
|
|
|
128
128
|
focus: (options?: SenderFocusOptions) => void;
|
|
129
129
|
blur: () => void;
|
|
130
130
|
clear: () => void;
|
|
131
|
-
insert: (value: string | SlotConfigType[], position?: InsertPosition) => void;
|
|
131
|
+
insert: (value: string | SlotConfigType[], position?: InsertPosition, replaceCharacters?: string) => void;
|
|
132
132
|
getValue: () => {
|
|
133
133
|
value: string;
|
|
134
134
|
slotConfig?: SlotConfigType[];
|
|
@@ -2,7 +2,7 @@ export declare const defaultPrefixCls = "ant";
|
|
|
2
2
|
export default function useXProviderContext(): {
|
|
3
3
|
theme: import('antdv-next').ThemeConfig | undefined;
|
|
4
4
|
getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
|
|
5
|
-
direction: import('antdv-next/
|
|
6
|
-
csp: import('antdv-next/
|
|
5
|
+
direction: import('antdv-next/config-provider/context').DirectionType;
|
|
6
|
+
csp: import('antdv-next/config-provider/context').CSPConfig | undefined;
|
|
7
7
|
iconPrefixCls: string;
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules
|
|
1
|
+
//#region ../../node_modules/stylis/src/Enum.js
|
|
2
2
|
var e = "-ms-", t = "-moz-", n = "-webkit-", r = "comm", i = "rule", a = "decl", o = "@import", s = "@namespace", c = "@keyframes", l = "@layer", u = Math.abs, d = String.fromCharCode, f = Object.assign;
|
|
3
3
|
function p(e, t) {
|
|
4
4
|
return v(e, 0) ^ 45 ? (((t << 2 ^ v(e, 0)) << 2 ^ v(e, 1)) << 2 ^ v(e, 2)) << 2 ^ v(e, 3) : 0;
|
|
@@ -39,7 +39,7 @@ function w(e, t) {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
|
-
//#region ../../node_modules
|
|
42
|
+
//#region ../../node_modules/stylis/src/Tokenizer.js
|
|
43
43
|
var T = 1, E = 1, D = 0, O = 0, k = 0, A = "";
|
|
44
44
|
function j(e, t, n, r, i, a, o, s) {
|
|
45
45
|
return {
|
|
@@ -150,7 +150,7 @@ function J(e) {
|
|
|
150
150
|
return z(e, O);
|
|
151
151
|
}
|
|
152
152
|
//#endregion
|
|
153
|
-
//#region ../../node_modules
|
|
153
|
+
//#region ../../node_modules/stylis/src/Parser.js
|
|
154
154
|
function Y(e) {
|
|
155
155
|
return H(X("", null, null, null, [""], e = V(e), 0, [0], e));
|
|
156
156
|
}
|
|
@@ -241,7 +241,7 @@ function Q(e, t, n, r, i) {
|
|
|
241
241
|
return j(e, t, n, a, y(e, 0, r), y(e, r + 1, -1), r, i);
|
|
242
242
|
}
|
|
243
243
|
//#endregion
|
|
244
|
-
//#region ../../node_modules
|
|
244
|
+
//#region ../../node_modules/stylis/src/Serializer.js
|
|
245
245
|
function $(e, t) {
|
|
246
246
|
for (var n = "", r = 0; r < e.length; r++) n += t(e[r], r, e, t) || "";
|
|
247
247
|
return n;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, E as r, H as i, M as a, U as o, V as s, k as c, p as l, w as u, z as d } from "./isArrayLikeObject-
|
|
2
|
-
import { A as f, C as p, D as m, M as h, N as g, S as _, T as v, f as y, h as b, u as x, w as S } from "./_baseUniq-
|
|
3
|
-
//#region ../../node_modules
|
|
1
|
+
import { A as e, B as t, C as n, E as r, H as i, M as a, U as o, V as s, k as c, p as l, w as u, z as d } from "./isArrayLikeObject-y3HlYDaX.js";
|
|
2
|
+
import { A as f, C as p, D as m, M as h, N as g, S as _, T as v, f as y, h as b, u as x, w as S } from "./_baseUniq-Ch3HuHeT.js";
|
|
3
|
+
//#region ../../node_modules/lodash-es/_trimmedEndIndex.js
|
|
4
4
|
var C = /\s/;
|
|
5
5
|
function w(e) {
|
|
6
6
|
for (var t = e.length; t-- && C.test(e.charAt(t)););
|
|
7
7
|
return t;
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
|
-
//#region ../../node_modules
|
|
10
|
+
//#region ../../node_modules/lodash-es/_baseTrim.js
|
|
11
11
|
var ee = /^\s+/;
|
|
12
12
|
function T(e) {
|
|
13
13
|
return e && e.slice(0, w(e) + 1).replace(ee, "");
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region ../../node_modules
|
|
16
|
+
//#region ../../node_modules/lodash-es/toNumber.js
|
|
17
17
|
var E = NaN, D = /^[-+]0x[0-9a-f]+$/i, O = /^0b[01]+$/i, k = /^0o[0-7]+$/i, A = parseInt;
|
|
18
18
|
function j(e) {
|
|
19
19
|
if (typeof e == "number") return e;
|
|
@@ -28,24 +28,24 @@ function j(e) {
|
|
|
28
28
|
return r || k.test(e) ? A(e.slice(2), r ? 2 : 8) : D.test(e) ? E : +e;
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../../node_modules
|
|
31
|
+
//#region ../../node_modules/lodash-es/toFinite.js
|
|
32
32
|
var M = Infinity, N = 17976931348623157e292;
|
|
33
33
|
function P(e) {
|
|
34
34
|
return e ? (e = j(e), e === M || e === -M ? (e < 0 ? -1 : 1) * N : e === e ? e : 0) : e === 0 ? e : 0;
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region ../../node_modules
|
|
37
|
+
//#region ../../node_modules/lodash-es/toInteger.js
|
|
38
38
|
function F(e) {
|
|
39
39
|
var t = P(e), n = t % 1;
|
|
40
40
|
return t === t ? n ? t - n : t : 0;
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
|
-
//#region ../../node_modules
|
|
43
|
+
//#region ../../node_modules/lodash-es/flatten.js
|
|
44
44
|
function I(e) {
|
|
45
45
|
return e != null && e.length ? _(e, 1) : [];
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region ../../node_modules
|
|
48
|
+
//#region ../../node_modules/lodash-es/defaults.js
|
|
49
49
|
var L = Object.prototype, R = L.hasOwnProperty, z = r(function(t, r) {
|
|
50
50
|
t = Object(t);
|
|
51
51
|
var i = -1, a = r.length, o = a > 2 ? r[2] : void 0;
|
|
@@ -56,13 +56,13 @@ var L = Object.prototype, R = L.hasOwnProperty, z = r(function(t, r) {
|
|
|
56
56
|
return t;
|
|
57
57
|
});
|
|
58
58
|
//#endregion
|
|
59
|
-
//#region ../../node_modules
|
|
59
|
+
//#region ../../node_modules/lodash-es/last.js
|
|
60
60
|
function B(e) {
|
|
61
61
|
var t = e == null ? 0 : e.length;
|
|
62
62
|
return t ? e[t - 1] : void 0;
|
|
63
63
|
}
|
|
64
64
|
//#endregion
|
|
65
|
-
//#region ../../node_modules
|
|
65
|
+
//#region ../../node_modules/lodash-es/_createFind.js
|
|
66
66
|
function V(e) {
|
|
67
67
|
return function(t, n, r) {
|
|
68
68
|
var i = Object(t);
|
|
@@ -77,7 +77,7 @@ function V(e) {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
//#endregion
|
|
80
|
-
//#region ../../node_modules
|
|
80
|
+
//#region ../../node_modules/lodash-es/findIndex.js
|
|
81
81
|
var H = Math.max;
|
|
82
82
|
function U(e, t, n) {
|
|
83
83
|
var r = e == null ? 0 : e.length;
|
|
@@ -86,10 +86,10 @@ function U(e, t, n) {
|
|
|
86
86
|
return i < 0 && (i = H(r + i, 0)), f(e, y(t, 3), i);
|
|
87
87
|
}
|
|
88
88
|
//#endregion
|
|
89
|
-
//#region ../../node_modules
|
|
89
|
+
//#region ../../node_modules/lodash-es/find.js
|
|
90
90
|
var W = V(U);
|
|
91
91
|
//#endregion
|
|
92
|
-
//#region ../../node_modules
|
|
92
|
+
//#region ../../node_modules/lodash-es/_baseMap.js
|
|
93
93
|
function G(e, t) {
|
|
94
94
|
var n = -1, r = u(e) ? Array(e.length) : [];
|
|
95
95
|
return x(e, function(e, i, a) {
|
|
@@ -97,34 +97,34 @@ function G(e, t) {
|
|
|
97
97
|
}), r;
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
|
-
//#region ../../node_modules
|
|
100
|
+
//#region ../../node_modules/lodash-es/map.js
|
|
101
101
|
function K(e, t) {
|
|
102
102
|
return (s(e) ? h : G)(e, y(t, 3));
|
|
103
103
|
}
|
|
104
104
|
//#endregion
|
|
105
|
-
//#region ../../node_modules
|
|
105
|
+
//#region ../../node_modules/lodash-es/_baseHas.js
|
|
106
106
|
var q = Object.prototype.hasOwnProperty;
|
|
107
107
|
function J(e, t) {
|
|
108
108
|
return e != null && q.call(e, t);
|
|
109
109
|
}
|
|
110
110
|
//#endregion
|
|
111
|
-
//#region ../../node_modules
|
|
111
|
+
//#region ../../node_modules/lodash-es/has.js
|
|
112
112
|
function Y(e, t) {
|
|
113
113
|
return e != null && b(e, t, J);
|
|
114
114
|
}
|
|
115
115
|
//#endregion
|
|
116
|
-
//#region ../../node_modules
|
|
116
|
+
//#region ../../node_modules/lodash-es/isString.js
|
|
117
117
|
var X = "[object String]";
|
|
118
118
|
function Z(e) {
|
|
119
119
|
return typeof e == "string" || !s(e) && i(e) && o(e) == X;
|
|
120
120
|
}
|
|
121
121
|
//#endregion
|
|
122
|
-
//#region ../../node_modules
|
|
122
|
+
//#region ../../node_modules/lodash-es/_baseLt.js
|
|
123
123
|
function Q(e, t) {
|
|
124
124
|
return e < t;
|
|
125
125
|
}
|
|
126
126
|
//#endregion
|
|
127
|
-
//#region ../../node_modules
|
|
127
|
+
//#region ../../node_modules/lodash-es/_baseExtremum.js
|
|
128
128
|
function $(e, t, n) {
|
|
129
129
|
for (var r = -1, i = e.length; ++r < i;) {
|
|
130
130
|
var a = e[r], o = t(a);
|
|
@@ -133,12 +133,12 @@ function $(e, t, n) {
|
|
|
133
133
|
return c;
|
|
134
134
|
}
|
|
135
135
|
//#endregion
|
|
136
|
-
//#region ../../node_modules
|
|
136
|
+
//#region ../../node_modules/lodash-es/min.js
|
|
137
137
|
function te(e) {
|
|
138
138
|
return e && e.length ? $(e, d, Q) : void 0;
|
|
139
139
|
}
|
|
140
140
|
//#endregion
|
|
141
|
-
//#region ../../node_modules
|
|
141
|
+
//#region ../../node_modules/lodash-es/_baseSet.js
|
|
142
142
|
function ne(e, n, r, i) {
|
|
143
143
|
if (!t(e)) return e;
|
|
144
144
|
n = v(n, e);
|
|
@@ -154,7 +154,7 @@ function ne(e, n, r, i) {
|
|
|
154
154
|
return e;
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
|
-
//#region ../../node_modules
|
|
157
|
+
//#region ../../node_modules/lodash-es/_basePickBy.js
|
|
158
158
|
function re(e, t, n) {
|
|
159
159
|
for (var r = -1, i = t.length, a = {}; ++r < i;) {
|
|
160
160
|
var o = t[r], s = p(e, o);
|