@antdv-next/x 1.1.2-beta.5 → 1.1.2

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.
Files changed (111) hide show
  1. package/dist/bubble/BubbleList.js +3 -8
  2. package/dist/index.umd.js +49 -36
  3. package/dist/package.js +1 -1
  4. package/dist/sender/components/SlotTextArea.js +42 -24
  5. package/dist/x-provider/hooks/use-x-provider-context.d.ts +2 -2
  6. package/es/{Serializer-y_SfSPKv.js → Serializer-D1JYN1kI.js} +4 -4
  7. package/es/{_basePickBy-Cy7KVmkk.js → _basePickBy-DFHEGO2M.js} +23 -23
  8. package/es/{_baseUniq-Ch3HuHeT.js → _baseUniq-BlS7rXTs.js} +83 -83
  9. package/es/antdv-next-x.esm.js +7561 -7556
  10. package/es/{arc-caEkbRYF.js → arc-BuXEd18J.js} +3 -3
  11. package/es/architecture-PBZL5I3N-D7tS55xM.js +3 -0
  12. package/es/{architectureDiagram-2XIMDMQ5-B4BHdsAL.js → architectureDiagram-2XIMDMQ5-CmfsCwJk.js} +9 -9
  13. package/es/{blockDiagram-WCTKOSBZ-nXanZ0sc.js → blockDiagram-WCTKOSBZ-lJAan65A.js} +12 -12
  14. package/es/{c4Diagram-IC4MRINW-C-gVp6th.js → c4Diagram-IC4MRINW-B1c2x_1Q.js} +6 -6
  15. package/es/channel-DFgF_2F7.js +5 -0
  16. package/es/{chunk-4BX2VUAB-fLFD6XW0.js → chunk-4BX2VUAB-J2N81Fpp.js} +2 -2
  17. package/es/{chunk-55IACEB6-OtyKJzCH.js → chunk-55IACEB6-DGtfGRgi.js} +2 -2
  18. package/es/{chunk-7E7YKBS2-C1dd36rm.js → chunk-7E7YKBS2-CL2d4WAf.js} +2 -2
  19. package/es/{chunk-7R4GIKGN-DuTRhdsf.js → chunk-7R4GIKGN-QT6IorJ_.js} +3 -3
  20. package/es/{chunk-C72U2L5F-ClmZGhFC.js → chunk-C72U2L5F-OHTVpS-m.js} +2 -2
  21. package/es/{chunk-EGIJ26TM-Bar_u1MN.js → chunk-EGIJ26TM-DyMPGYrB.js} +2 -2
  22. package/es/{chunk-FMBD7UC4-C_uJ_JJA.js → chunk-FMBD7UC4-DCcRjunY.js} +2 -2
  23. package/es/{chunk-GEFDOKGD-P7WhyrTU.js → chunk-GEFDOKGD-BWpC-zoH.js} +30 -30
  24. package/es/{chunk-GLR3WWYH-BBFkZWLy.js → chunk-GLR3WWYH-DiXcKb5Y.js} +8 -8
  25. package/es/{chunk-HHEYEP7N-rv5s5WD4.js → chunk-HHEYEP7N-Cxc7E4dX.js} +3 -3
  26. package/es/{chunk-JSJVCQXG-89HUGe9V.js → chunk-JSJVCQXG-D8_heHOp.js} +4 -4
  27. package/es/{chunk-KX2RTZJC-pMHnNRQg.js → chunk-KX2RTZJC-D5cc4rj6.js} +3 -3
  28. package/es/{chunk-KYZI473N-DJmSs1gK.js → chunk-KYZI473N-BHJ3T5Zv.js} +8 -8
  29. package/es/{chunk-L3YUKLVL-Ck54qytQ.js → chunk-L3YUKLVL-7oGaUOdc.js} +2 -2
  30. package/es/{chunk-MX3YWQON-MkpK3uBD.js → chunk-MX3YWQON-BxE-Aq9c.js} +2 -2
  31. package/es/{chunk-NQ4KR5QH-I7cFzfZu.js → chunk-NQ4KR5QH-EYQBXkqP.js} +7 -7
  32. package/es/{chunk-O4XLMI2P-e-ZzDQwg.js → chunk-O4XLMI2P-qjOoGpnx.js} +11 -11
  33. package/es/{chunk-OZEHJAEY-DULNd43V.js → chunk-OZEHJAEY-D82nx27s.js} +2 -2
  34. package/es/{chunk-PQ6SQG4A-CQ9Csv7s.js → chunk-PQ6SQG4A-D3jtNCWN.js} +3 -3
  35. package/es/{chunk-PU5JKC2W-DkEFvrjH.js → chunk-PU5JKC2W-DdP8BS-S.js} +16 -16
  36. package/es/{chunk-QZHKN3VN-qww1plfw.js → chunk-QZHKN3VN-CW3cFN-h.js} +2 -2
  37. package/es/{chunk-R5LLSJPH-BERXSDGJ.js → chunk-R5LLSJPH-CreI2kO9.js} +2 -2
  38. package/es/{chunk-WL4C6EOR-B6HgoDzQ.js → chunk-WL4C6EOR-BDbxJyGk.js} +9 -9
  39. package/es/{chunk-XIRO2GV7-CFHofxVB.js → chunk-XIRO2GV7-S5KkbVnN.js} +2 -2
  40. package/es/{chunk-XPW4576I-DgvoNZkW.js → chunk-XPW4576I-B0KVSHwE.js} +2 -2
  41. package/es/{chunk-XZSTWKYB-k8_EXrSa.js → chunk-XZSTWKYB-CucN1XvM.js} +93 -93
  42. package/es/{chunk-YBOYWFTD-BUW4AzEX.js → chunk-YBOYWFTD-CvaddD9G.js} +4 -4
  43. package/es/classDiagram-VBA2DB6C-Co3LMmg8.js +29 -0
  44. package/es/classDiagram-v2-RAHNMMFH-BZscgdF2.js +29 -0
  45. package/es/clone-r3YukIBB.js +8 -0
  46. package/es/{cose-bilkent-S5V4N54A-DS-oTq56.js → cose-bilkent-S5V4N54A-B5OQuIhl.js} +3 -3
  47. package/es/{cytoscape.esm-BY3wHcbp.js → cytoscape.esm-i2CZcWd-.js} +1 -1
  48. package/es/{dagre-BJOzGlhW.js → dagre-5aGJFKmT.js} +57 -57
  49. package/es/{dagre-KLK3FWXG-CFC0naVr.js → dagre-KLK3FWXG-BI5QQMXo.js} +16 -16
  50. package/es/{defaultLocale-BaPFSbai.js → defaultLocale-bckJcYh1.js} +12 -12
  51. package/es/{diagram-E7M64L7V-DxuJj8ZG.js → diagram-E7M64L7V-Dz62Vz_a.js} +32 -32
  52. package/es/{diagram-IFDJBPK2-BOpPZ6pu.js → diagram-IFDJBPK2-9fjvFkSc.js} +7 -7
  53. package/es/{diagram-P4PSJMXO--ChDmcya.js → diagram-P4PSJMXO-BlX6jFjZ.js} +7 -7
  54. package/es/{dist-DltyvPj3.js → dist-BX_roQzC.js} +1 -1
  55. package/es/{erDiagram-INFDFZHY-TwqnRnWa.js → erDiagram-INFDFZHY-BcRXu8Cp.js} +14 -14
  56. package/es/{flowDiagram-PKNHOUZH-DOIW1Sy9.js → flowDiagram-PKNHOUZH-UeyfgU8z.js} +17 -17
  57. package/es/{ganttDiagram-A5KZAMGK-DdMePS21.js → ganttDiagram-A5KZAMGK-txCzqgQ5.js} +28 -28
  58. package/es/gitGraph-HDMCJU4V-CxsS0Qr1.js +3 -0
  59. package/es/{gitGraphDiagram-K3NZZRJ6-CLbRwChG.js → gitGraphDiagram-K3NZZRJ6-DghWYaFU.js} +7 -7
  60. package/es/{graphlib-C7ysKz4u.js → graphlib-dRkI1OCL.js} +4 -4
  61. package/es/{html-C2-_98S6.js → html-B6UxjOv0.js} +1 -1
  62. package/es/html-Hb1oe8XT.js +2 -0
  63. package/es/info-3K5VOQVL-COqdvM99.js +3 -0
  64. package/es/{infoDiagram-LFFYTUFH-DQAZ-vFk.js → infoDiagram-LFFYTUFH-CA-vlAvP.js} +5 -5
  65. package/es/{init-PAs0hR-b.js → init-B75p2clj.js} +1 -1
  66. package/es/{isArrayLikeObject-y3HlYDaX.js → isArrayLikeObject-jl2bjkAJ.js} +80 -80
  67. package/es/{isEmpty-2JxdWtc-.js → isEmpty-CmA-HYrg.js} +3 -3
  68. package/es/{ishikawaDiagram-PHBUUO56-B0r2IgGz.js → ishikawaDiagram-PHBUUO56-DjdpS9Lb.js} +6 -6
  69. package/es/{journeyDiagram-4ABVD52K-DnMUhOvg.js → journeyDiagram-4ABVD52K-CIJfC1fp.js} +6 -6
  70. package/es/{kanban-definition-K7BYSVSG-Da5Y-nJy.js → kanban-definition-K7BYSVSG-CC2vwGck.js} +11 -11
  71. package/es/{katex-b-xdokOf.js → katex-DCMiIo1z.js} +1 -1
  72. package/es/{line-h2iCTGsE.js → line-Cu9NTacD.js} +4 -4
  73. package/es/{linear-Bv7XrZCH.js → linear-C0rAYYmp.js} +23 -23
  74. package/es/{math-DPzKeDKn.js → math-CoDOuve-.js} +1 -1
  75. package/es/{mermaid-parser.core-kTgpNO7M.js → mermaid-parser.core-7Wn2L29P.js} +16 -16
  76. package/es/{mermaid.core-Cdr_0as6.js → mermaid.core-Bvy_Q6Hu.js} +44 -44
  77. package/es/{mindmap-definition-YRQLILUH-CtrmThyY.js → mindmap-definition-YRQLILUH-BzTYDYmK.js} +16 -16
  78. package/es/{ordinal-D8PKtxfM.js → ordinal-F3U6aXtP.js} +3 -3
  79. package/es/packet-RMMSAZCW-2PTjWKLd.js +3 -0
  80. package/es/{path-DZ-6AyWK.js → path-Dm3C8WEs.js} +3 -3
  81. package/es/pie-UPGHQEXC-Du8-k-EA.js +3 -0
  82. package/es/{pieDiagram-SKSYHLDU-DAsfTGvY.js → pieDiagram-SKSYHLDU-COvqE_C6.js} +14 -14
  83. package/es/{quadrantDiagram-337W2JSQ-CZLbmQS4.js → quadrantDiagram-337W2JSQ-Dgv8ccjt.js} +4 -4
  84. package/es/radar-KQ55EAFF-jJOhyjxC.js +3 -0
  85. package/es/{requirementDiagram-Z7DCOOCP-DwsKf6TC.js → requirementDiagram-Z7DCOOCP-B2NyhxO-.js} +13 -13
  86. package/es/{rough.esm-C_hJ3ICT.js → rough.esm-BhGP2Udb.js} +1 -1
  87. package/es/{sankeyDiagram-WA2Y5GQK-DBe5YfW4.js → sankeyDiagram-WA2Y5GQK-BfnH_gpl.js} +18 -18
  88. package/es/{sequenceDiagram-2WXFIKYE-C_KUoojT.js → sequenceDiagram-2WXFIKYE-DXssVQOF.js} +8 -8
  89. package/es/{src-BukXhifV.js → src-CUQ6oOYk.js} +86 -86
  90. package/es/{stateDiagram-RAJIS63D-Bjd_66hy.js → stateDiagram-RAJIS63D-DvDLfupV.js} +17 -17
  91. package/es/stateDiagram-v2-FVOUBMTO-DIXyaX9W.js +27 -0
  92. package/es/{timeline-definition-YZTLITO2-pFt6rZ6S.js → timeline-definition-YZTLITO2-ErcRjbZf.js} +4 -4
  93. package/es/treemap-KZPCXAKY-CvZAIYVa.js +3 -0
  94. package/es/{vennDiagram-LZ73GAT5-VaCO6k4H.js → vennDiagram-LZ73GAT5-CDTZUtc8.js} +7 -7
  95. package/es/{vue-DTiWrQBM.js → vue-2aJw7p5p.js} +2 -2
  96. package/es/{vue-html-BG3Xflut.js → vue-html-DEjI8X9t.js} +1 -1
  97. package/es/{xychartDiagram-JWTSCODW-xS5ybemA.js → xychartDiagram-JWTSCODW-Y21jBOTg.js} +12 -12
  98. package/package.json +2 -2
  99. package/es/architecture-PBZL5I3N-DHfBr78A.js +0 -3
  100. package/es/channel-DoEe9DF9.js +0 -5
  101. package/es/classDiagram-VBA2DB6C-CqK9jdgh.js +0 -29
  102. package/es/classDiagram-v2-RAHNMMFH-ZDIng8Gz.js +0 -29
  103. package/es/clone-BXDbKCDu.js +0 -8
  104. package/es/gitGraph-HDMCJU4V-DbzpICZW.js +0 -3
  105. package/es/html-JbFqcNgP.js +0 -2
  106. package/es/info-3K5VOQVL-CpUiQuel.js +0 -3
  107. package/es/packet-RMMSAZCW-UTFQ0FQx.js +0 -3
  108. package/es/pie-UPGHQEXC-CarAcBSi.js +0 -3
  109. package/es/radar-KQ55EAFF-NXK5PC9R.js +0 -3
  110. package/es/stateDiagram-v2-FVOUBMTO-BjIcGAyh.js +0 -27
  111. package/es/treemap-KZPCXAKY-Cj9QakFB.js +0 -3
@@ -4,15 +4,11 @@ import { XBubbleDivider } from "./Divider.js";
4
4
  import { useCompatibleScroll } from "./hooks/useCompatibleScroll.js";
5
5
  import { XBubbleSystem } from "./System.js";
6
6
  import { computed, createVNode, defineComponent, mergeProps, ref } from "vue";
7
+ import { createElementRef } from "@v-c/util/dist/vnode";
7
8
  //#region components/bubble/BubbleList.tsx
8
9
  function roleCfgIsFunction(roleCfg) {
9
10
  return typeof roleCfg === "function";
10
11
  }
11
- function pickBubbleRef(instance) {
12
- if (!instance) return null;
13
- if ("nativeElement" in instance) return instance.nativeElement ?? null;
14
- return instance;
15
- }
16
12
  var bubbleSlotNames = [
17
13
  "contentRender",
18
14
  "loadingRender",
@@ -115,11 +111,10 @@ var XBubbleList = /* @__PURE__ */ defineComponent({
115
111
  rest
116
112
  };
117
113
  });
118
- const setBubbleRef = (key) => (instance) => {
119
- const element = pickBubbleRef(instance);
114
+ const setBubbleRef = (key) => createElementRef((element) => {
120
115
  if (element) bubbleRefs.set(key, element);
121
116
  else bubbleRefs.delete(key);
122
- };
117
+ });
123
118
  const scrollTo = ({ key, top, behavior = "smooth", block }) => {
124
119
  const scrollBox = scrollBoxRef.value;
125
120
  if (!scrollBox) return;
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("antdv-next/config-provider/context"), require("antdv-next"), require("@antdv-next/icons"), require("@antdv-next/cssinjs"), require("@antdv-next/cssinjs/cssinjs-utils"), require("@ant-design/fast-color"), require("antdv-next/dist/theme/useToken"), require("@vueuse/core"), require("shiki/core"), require("shiki/dist/themes/vitesse-dark.mjs"), require("shiki/dist/themes/vitesse-light.mjs"), require("shiki/engine/javascript"), require("@v-c/util")) : typeof define === "function" && define.amd ? define([
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("antdv-next/config-provider/context"), require("antdv-next"), require("@antdv-next/icons"), require("@antdv-next/cssinjs"), require("@antdv-next/cssinjs/cssinjs-utils"), require("@ant-design/fast-color"), require("antdv-next/dist/theme/useToken"), require("@vueuse/core"), require("@v-c/util/dist/vnode"), require("shiki/core"), require("shiki/dist/themes/vitesse-dark.mjs"), require("shiki/dist/themes/vitesse-light.mjs"), require("shiki/engine/javascript"), require("@v-c/util")) : typeof define === "function" && define.amd ? define([
3
3
  "exports",
4
4
  "vue",
5
5
  "antdv-next/config-provider/context",
@@ -10,13 +10,14 @@
10
10
  "@ant-design/fast-color",
11
11
  "antdv-next/dist/theme/useToken",
12
12
  "@vueuse/core",
13
+ "@v-c/util/dist/vnode",
13
14
  "shiki/core",
14
15
  "shiki/dist/themes/vitesse-dark.mjs",
15
16
  "shiki/dist/themes/vitesse-light.mjs",
16
17
  "shiki/engine/javascript",
17
18
  "@v-c/util"
18
- ], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.AntdComponents = {}, global.Vue, global.antdv_next_config_provider_context, global.antd, global.AntdIcons, global._antdv_next_cssinjs, global._antdv_next_cssinjs_cssinjs_utils, global._ant_design_fast_color, global.antdv_next_dist_theme_useToken, global._vueuse_core, global.shiki_core, global.shiki_dist_themes_vitesse_dark_mjs, global.shiki_dist_themes_vitesse_light_mjs, global.shiki_engine_javascript, global._v_c_util));
19
- })(this, function(exports, vue, antdv_next_config_provider_context, antdv_next, _antdv_next_icons, _antdv_next_cssinjs, _antdv_next_cssinjs_cssinjs_utils, _ant_design_fast_color, antdv_next_dist_theme_useToken, _vueuse_core, shiki_core, shiki_dist_themes_vitesse_dark_mjs, shiki_dist_themes_vitesse_light_mjs, shiki_engine_javascript, _v_c_util) {
19
+ ], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.AntdComponents = {}, global.Vue, global.antdv_next_config_provider_context, global.antd, global.AntdIcons, global._antdv_next_cssinjs, global._antdv_next_cssinjs_cssinjs_utils, global._ant_design_fast_color, global.antdv_next_dist_theme_useToken, global._vueuse_core, global._v_c_util_dist_vnode, global.shiki_core, global.shiki_dist_themes_vitesse_dark_mjs, global.shiki_dist_themes_vitesse_light_mjs, global.shiki_engine_javascript, global._v_c_util));
20
+ })(this, function(exports, vue, antdv_next_config_provider_context, antdv_next, _antdv_next_icons, _antdv_next_cssinjs, _antdv_next_cssinjs_cssinjs_utils, _ant_design_fast_color, antdv_next_dist_theme_useToken, _vueuse_core, _v_c_util_dist_vnode, shiki_core, shiki_dist_themes_vitesse_dark_mjs, shiki_dist_themes_vitesse_light_mjs, shiki_engine_javascript, _v_c_util) {
20
21
  Object.defineProperties(exports, {
21
22
  __esModule: { value: true },
22
23
  [Symbol.toStringTag]: { value: "Module" }
@@ -48,7 +49,7 @@
48
49
  shiki_dist_themes_vitesse_dark_mjs = __toESM(shiki_dist_themes_vitesse_dark_mjs);
49
50
  shiki_dist_themes_vitesse_light_mjs = __toESM(shiki_dist_themes_vitesse_light_mjs);
50
51
  //#region package.json
51
- var version = "1.1.2-beta.5";
52
+ var version = "1.1.2";
52
53
  //#endregion
53
54
  //#region components/x-provider/context.ts
54
55
  var XProviderContextKey = Symbol("antdv-next-x-provider-context");
@@ -4507,11 +4508,6 @@
4507
4508
  function roleCfgIsFunction(roleCfg) {
4508
4509
  return typeof roleCfg === "function";
4509
4510
  }
4510
- function pickBubbleRef(instance) {
4511
- if (!instance) return null;
4512
- if ("nativeElement" in instance) return instance.nativeElement ?? null;
4513
- return instance;
4514
- }
4515
4511
  var bubbleSlotNames = [
4516
4512
  "contentRender",
4517
4513
  "loadingRender",
@@ -4614,11 +4610,10 @@
4614
4610
  rest
4615
4611
  };
4616
4612
  });
4617
- const setBubbleRef = (key) => (instance) => {
4618
- const element = pickBubbleRef(instance);
4613
+ const setBubbleRef = (key) => (0, _v_c_util_dist_vnode.createElementRef)((element) => {
4619
4614
  if (element) bubbleRefs.set(key, element);
4620
4615
  else bubbleRefs.delete(key);
4621
- };
4616
+ });
4622
4617
  const scrollTo = ({ key, top, behavior = "smooth", block }) => {
4623
4618
  const scrollBox = scrollBoxRef.value;
4624
4619
  if (!scrollBox) return;
@@ -8652,38 +8647,56 @@
8652
8647
  }
8653
8648
  return null;
8654
8649
  };
8655
- const handleBackspaceDelete = (event) => {
8650
+ const handleDeleteOperation = (event, operationType) => {
8656
8651
  const selection = getSelection();
8657
- if (!selection || !selection.isCollapsed) return false;
8658
8652
  const editable = editableRef.value;
8659
- if (!editable) return false;
8653
+ if (!editable || !selection || selection.rangeCount === 0) return false;
8654
+ const range = selection.getRangeAt(0);
8660
8655
  const anchorNode = selection.anchorNode;
8661
- const offset = selection.anchorOffset;
8656
+ const focusOffset = selection.focusOffset;
8662
8657
  if (!anchorNode || !editable.contains(anchorNode)) return false;
8663
- const isSlotOrSkill = (node) => {
8664
- if (!(node instanceof HTMLElement)) return false;
8665
- const info = getNodeInfo(node);
8666
- return !!(info?.slotKey || info?.skillKey);
8667
- };
8668
- let previous = null;
8669
- if (anchorNode === editable) {
8670
- for (let i = offset - 1; i >= 0; i--) if (isSlotOrSkill(editable.childNodes[i])) {
8671
- previous = editable.childNodes[i];
8672
- break;
8658
+ if (anchorNode.nodeType === Node.TEXT_NODE && range) {
8659
+ const parentElement = anchorNode.parentNode;
8660
+ const nodeInfo = getNodeInfo(parentElement);
8661
+ const selectedText = range.toString();
8662
+ const textLength = anchorNode.textContent?.length ?? 0;
8663
+ const isFullTextSelected = textLength === selectedText.length;
8664
+ const isSingleCharAtEnd = textLength === 1 && focusOffset === 1;
8665
+ if (nodeInfo?.slotConfig?.type === "content" && (isFullTextSelected || isSingleCharAtEnd)) {
8666
+ event.preventDefault();
8667
+ parentElement.innerHTML = "";
8668
+ parentElement.innerText = "";
8669
+ return true;
8673
8670
  }
8674
- } else {
8675
- if (anchorNode.nodeType === Node.TEXT_NODE && offset > 0) return false;
8676
- let current = anchorNode.nodeType === Node.TEXT_NODE ? anchorNode.previousSibling : anchorNode.previousSibling;
8671
+ }
8672
+ const isIgnorableBoundaryNode = (node) => {
8673
+ if (node.nodeType === Node.TEXT_NODE) return !(node.textContent ?? "");
8674
+ if (!(node instanceof HTMLElement)) return true;
8675
+ if (node.tagName === "BR") return true;
8676
+ return !node.textContent;
8677
+ };
8678
+ const getPreviousSibling = () => {
8679
+ if (operationType !== "backspace") return null;
8680
+ if (anchorNode === editable) return editable.childNodes[focusOffset - 1] || null;
8681
+ if (focusOffset !== 0) return null;
8682
+ const outer = findOuterContainer(anchorNode);
8683
+ return (outer && editable.contains(outer) ? outer : anchorNode.nodeType === Node.TEXT_NODE ? anchorNode : anchorNode).previousSibling;
8684
+ };
8685
+ const findPreviousDeletableNode = (node) => {
8686
+ let current = node;
8677
8687
  while (current) {
8678
- if (isSlotOrSkill(current)) {
8679
- previous = current;
8680
- break;
8688
+ if (current instanceof HTMLElement) {
8689
+ const nodeInfo = getNodeInfo(current);
8690
+ if (nodeInfo?.slotKey || nodeInfo?.skillKey) return current;
8681
8691
  }
8692
+ if (!isIgnorableBoundaryNode(current)) return null;
8682
8693
  current = current.previousSibling;
8683
8694
  }
8684
- }
8685
- if (!previous) return false;
8686
- const info = getNodeInfo(previous);
8695
+ return null;
8696
+ };
8697
+ const target = findPreviousDeletableNode(getPreviousSibling());
8698
+ if (!target) return false;
8699
+ const info = getNodeInfo(target);
8687
8700
  if (info?.slotKey) {
8688
8701
  event.preventDefault();
8689
8702
  removeSlot(info.slotKey, event);
@@ -8698,7 +8711,7 @@
8698
8711
  };
8699
8712
  const onInternalKeyDown = (event) => {
8700
8713
  if (senderCtx.value.onKeyDown?.(event) === false || keyLock.value || isComposing.value) return;
8701
- if (event.key === "Backspace" && handleBackspaceDelete(event)) return;
8714
+ if (event.key === "Backspace" && handleDeleteOperation(event, "backspace")) return;
8702
8715
  if (shouldSubmit(event)) {
8703
8716
  event.preventDefault();
8704
8717
  keyLock.value = true;
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "1.1.2-beta.5";
2
+ var version = "1.1.2";
3
3
  //#endregion
4
4
  export { version };
@@ -495,38 +495,56 @@ var SlotTextArea_default = /* @__PURE__ */ defineComponent({
495
495
  }
496
496
  return null;
497
497
  };
498
- const handleBackspaceDelete = (event) => {
498
+ const handleDeleteOperation = (event, operationType) => {
499
499
  const selection = getSelection();
500
- if (!selection || !selection.isCollapsed) return false;
501
500
  const editable = editableRef.value;
502
- if (!editable) return false;
501
+ if (!editable || !selection || selection.rangeCount === 0) return false;
502
+ const range = selection.getRangeAt(0);
503
503
  const anchorNode = selection.anchorNode;
504
- const offset = selection.anchorOffset;
504
+ const focusOffset = selection.focusOffset;
505
505
  if (!anchorNode || !editable.contains(anchorNode)) return false;
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;
512
- if (anchorNode === editable) {
513
- for (let i = offset - 1; i >= 0; i--) if (isSlotOrSkill(editable.childNodes[i])) {
514
- previous = editable.childNodes[i];
515
- break;
506
+ if (anchorNode.nodeType === Node.TEXT_NODE && range) {
507
+ const parentElement = anchorNode.parentNode;
508
+ const nodeInfo = getNodeInfo(parentElement);
509
+ const selectedText = range.toString();
510
+ const textLength = anchorNode.textContent?.length ?? 0;
511
+ const isFullTextSelected = textLength === selectedText.length;
512
+ const isSingleCharAtEnd = textLength === 1 && focusOffset === 1;
513
+ if (nodeInfo?.slotConfig?.type === "content" && (isFullTextSelected || isSingleCharAtEnd)) {
514
+ event.preventDefault();
515
+ parentElement.innerHTML = "";
516
+ parentElement.innerText = "";
517
+ return true;
516
518
  }
517
- } else {
518
- if (anchorNode.nodeType === Node.TEXT_NODE && offset > 0) return false;
519
- let current = anchorNode.nodeType === Node.TEXT_NODE ? anchorNode.previousSibling : anchorNode.previousSibling;
519
+ }
520
+ const isIgnorableBoundaryNode = (node) => {
521
+ if (node.nodeType === Node.TEXT_NODE) return !(node.textContent ?? "");
522
+ if (!(node instanceof HTMLElement)) return true;
523
+ if (node.tagName === "BR") return true;
524
+ return !node.textContent;
525
+ };
526
+ const getPreviousSibling = () => {
527
+ if (operationType !== "backspace") return null;
528
+ if (anchorNode === editable) return editable.childNodes[focusOffset - 1] || null;
529
+ if (focusOffset !== 0) return null;
530
+ const outer = findOuterContainer(anchorNode);
531
+ return (outer && editable.contains(outer) ? outer : anchorNode.nodeType === Node.TEXT_NODE ? anchorNode : anchorNode).previousSibling;
532
+ };
533
+ const findPreviousDeletableNode = (node) => {
534
+ let current = node;
520
535
  while (current) {
521
- if (isSlotOrSkill(current)) {
522
- previous = current;
523
- break;
536
+ if (current instanceof HTMLElement) {
537
+ const nodeInfo = getNodeInfo(current);
538
+ if (nodeInfo?.slotKey || nodeInfo?.skillKey) return current;
524
539
  }
540
+ if (!isIgnorableBoundaryNode(current)) return null;
525
541
  current = current.previousSibling;
526
542
  }
527
- }
528
- if (!previous) return false;
529
- const info = getNodeInfo(previous);
543
+ return null;
544
+ };
545
+ const target = findPreviousDeletableNode(getPreviousSibling());
546
+ if (!target) return false;
547
+ const info = getNodeInfo(target);
530
548
  if (info?.slotKey) {
531
549
  event.preventDefault();
532
550
  removeSlot(info.slotKey, event);
@@ -541,7 +559,7 @@ var SlotTextArea_default = /* @__PURE__ */ defineComponent({
541
559
  };
542
560
  const onInternalKeyDown = (event) => {
543
561
  if (senderCtx.value.onKeyDown?.(event) === false || keyLock.value || isComposing.value) return;
544
- if (event.key === "Backspace" && handleBackspaceDelete(event)) return;
562
+ if (event.key === "Backspace" && handleDeleteOperation(event, "backspace")) return;
545
563
  if (shouldSubmit(event)) {
546
564
  event.preventDefault();
547
565
  keyLock.value = true;
@@ -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/config-provider/context').DirectionType;
6
- csp: import('antdv-next/config-provider/context').CSPConfig | undefined;
5
+ direction: import('antdv-next/dist/config-provider/context').DirectionType;
6
+ csp: import('antdv-next/dist/config-provider/context').CSPConfig | undefined;
7
7
  iconPrefixCls: string;
8
8
  };
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/stylis/src/Enum.js
1
+ //#region ../../node_modules/.pnpm/stylis@4.3.6/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/stylis/src/Tokenizer.js
42
+ //#region ../../node_modules/.pnpm/stylis@4.3.6/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/stylis/src/Parser.js
153
+ //#region ../../node_modules/.pnpm/stylis@4.3.6/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/stylis/src/Serializer.js
244
+ //#region ../../node_modules/.pnpm/stylis@4.3.6/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-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
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-jl2bjkAJ.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-BlS7rXTs.js";
3
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/_baseTrim.js
10
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/toNumber.js
16
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/toFinite.js
31
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/toInteger.js
37
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/flatten.js
43
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/defaults.js
48
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/last.js
59
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/_createFind.js
65
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/findIndex.js
80
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/find.js
89
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/find.js
90
90
  var W = V(U);
91
91
  //#endregion
92
- //#region ../../node_modules/lodash-es/_baseMap.js
92
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/map.js
100
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/_baseHas.js
105
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/has.js
111
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/isString.js
116
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/_baseLt.js
122
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/_baseExtremum.js
127
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/min.js
136
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/_baseSet.js
141
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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/lodash-es/_basePickBy.js
157
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.23/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);