@arco-design/mobile-react 2.36.0 → 2.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.36.1](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.36.0...@arco-design/mobile-react@2.36.1) (2025-05-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * `Popover` adjust edge when popover is too tall ([#321](https://github.com/arco-design/arco-design-mobile/issues/321)) ([b105897](https://github.com/arco-design/arco-design-mobile/commit/b105897d0a6b8c521cb37364fee8263af4e8a8e0))
12
+ * fix emoji truncation issue about `Ellipsis` ([#324](https://github.com/arco-design/arco-design-mobile/issues/324)) ([3c157f1](https://github.com/arco-design/arco-design-mobile/commit/3c157f1ee9ae45552647533533864f1c5781c418))
13
+
14
+
15
+
16
+
17
+
6
18
  # [2.36.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.35.2...@arco-design/mobile-react@2.36.0) (2025-05-13)
7
19
 
8
20
 
package/README.en-US.md CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="_b
59
59
  React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">Click here</a>**
60
60
 
61
61
  ```
62
- <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.35.2/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.35.2/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.36.0/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.36.0/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## Full import
package/README.md CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="
59
59
  React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">戳这里获取</a>**
60
60
 
61
61
  ```
62
- <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.35.2/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.35.2/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.36.0/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.36.0/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## 引入全部
@@ -83,9 +83,11 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
83
83
  currentText += temp;
84
84
  l = m;
85
85
  }
86
- } // Remove the exclude char at the end of the content.
86
+ } // Remove the last character if it is orphaned high-surrogate characters (indicative of incomplete emoji).
87
87
 
88
88
 
89
+ currentText = currentText.replace(/[\uD800-\uDBFF]+$/, ''); // Remove the exclude char at the end of the content.
90
+
89
91
  while (endExcludes && endExcludes.includes(currentText[currentText.length - 1])) {
90
92
  currentText = currentText.slice(0, -1);
91
93
  } // Callback after reflow.
@@ -235,20 +235,38 @@ var usePosition = function usePosition(props, popoverRef, childRef, wrapperRef)
235
235
 
236
236
 
237
237
  if (verticalAuto) {
238
- var popoverTop = childRect.bottom - (newConfig.bottom && newConfig.height ? newConfig.bottom + newConfig.height : 0);
239
- var popoverBottom = childRect.top + (newConfig.top && newConfig.height ? newConfig.top + newConfig.height : 0); // 顶部安全距离不够,调整到底部
240
- // @en The top safety distance is not enough, adjust to the bottom
241
-
242
- if (directionState.indexOf('top') !== -1 && popoverTop < topOffset) {
238
+ var setToBottom = function setToBottom() {
243
239
  newConfig.top = verticalOffset + childRect.height;
244
240
  newConfig.bottom = null;
245
241
  onAdjustDirection('bottom');
246
- } else if (directionState.indexOf('bottom') !== -1 && popoverBottom + bottomOffset > window.innerHeight) {
247
- // 底部安全距离不够,调整到顶部
248
- // @en The bottom safety distance is not enough, adjust to the top
242
+ };
243
+
244
+ var setToTop = function setToTop() {
249
245
  newConfig.top = null;
250
246
  newConfig.bottom = verticalOffset + childRect.height;
251
247
  onAdjustDirection('top');
248
+ }; // 判断上下空间是否都不足以展示气泡内容
249
+ // @en Determine whether there is insufficient space both above and below to display content
250
+
251
+
252
+ var isPopoverTooTall = window.innerHeight - topOffset - bottomOffset < 2 * (newConfig.height || 0) + 2 * verticalOffset + childRect.height;
253
+
254
+ if (isPopoverTooTall) {
255
+ var spaceAbove = childRect.top;
256
+ var spaceBelow = window.innerHeight - childRect.bottom;
257
+ spaceAbove > spaceBelow ? setToTop() : setToBottom();
258
+ } else {
259
+ var popoverTop = childRect.bottom - (newConfig.bottom && newConfig.height ? newConfig.bottom + newConfig.height : 0);
260
+ var popoverBottom = childRect.top + (newConfig.top && newConfig.height ? newConfig.top + newConfig.height : 0); // 顶部安全距离不够,调整到底部
261
+ // @en The top safety distance is not enough, adjust to the bottom
262
+
263
+ if (directionState.indexOf('top') !== -1 && popoverTop < topOffset) {
264
+ setToBottom();
265
+ } else if ( // 底部安全距离不够,调整到顶部
266
+ // @en The bottom safety distance is not enough, adjust to the top
267
+ directionState.indexOf('bottom') !== -1 && popoverBottom + bottomOffset > window.innerHeight) {
268
+ setToTop();
269
+ }
252
270
  }
253
271
  } // 挂载在全局的气泡需要计算相对屏幕的位置
254
272
  // @en Bubble mounted in the global needs to calculate the position relative to the screen
package/dist/index.js CHANGED
@@ -16341,9 +16341,11 @@
16341
16341
  currentText += temp;
16342
16342
  l = m;
16343
16343
  }
16344
- } // Remove the exclude char at the end of the content.
16344
+ } // Remove the last character if it is orphaned high-surrogate characters (indicative of incomplete emoji).
16345
16345
 
16346
16346
 
16347
+ currentText = currentText.replace(/[\uD800-\uDBFF]+$/, ''); // Remove the exclude char at the end of the content.
16348
+
16347
16349
  while (endExcludes && endExcludes.includes(currentText[currentText.length - 1])) {
16348
16350
  currentText = currentText.slice(0, -1);
16349
16351
  } // Callback after reflow.
@@ -24851,20 +24853,38 @@
24851
24853
 
24852
24854
 
24853
24855
  if (verticalAuto) {
24854
- var popoverTop = childRect.bottom - (newConfig.bottom && newConfig.height ? newConfig.bottom + newConfig.height : 0);
24855
- var popoverBottom = childRect.top + (newConfig.top && newConfig.height ? newConfig.top + newConfig.height : 0); // 顶部安全距离不够,调整到底部
24856
- // @en The top safety distance is not enough, adjust to the bottom
24857
-
24858
- if (directionState.indexOf('top') !== -1 && popoverTop < topOffset) {
24856
+ var setToBottom = function setToBottom() {
24859
24857
  newConfig.top = verticalOffset + childRect.height;
24860
24858
  newConfig.bottom = null;
24861
24859
  onAdjustDirection('bottom');
24862
- } else if (directionState.indexOf('bottom') !== -1 && popoverBottom + bottomOffset > window.innerHeight) {
24863
- // 底部安全距离不够,调整到顶部
24864
- // @en The bottom safety distance is not enough, adjust to the top
24860
+ };
24861
+
24862
+ var setToTop = function setToTop() {
24865
24863
  newConfig.top = null;
24866
24864
  newConfig.bottom = verticalOffset + childRect.height;
24867
24865
  onAdjustDirection('top');
24866
+ }; // 判断上下空间是否都不足以展示气泡内容
24867
+ // @en Determine whether there is insufficient space both above and below to display content
24868
+
24869
+
24870
+ var isPopoverTooTall = window.innerHeight - topOffset - bottomOffset < 2 * (newConfig.height || 0) + 2 * verticalOffset + childRect.height;
24871
+
24872
+ if (isPopoverTooTall) {
24873
+ var spaceAbove = childRect.top;
24874
+ var spaceBelow = window.innerHeight - childRect.bottom;
24875
+ spaceAbove > spaceBelow ? setToTop() : setToBottom();
24876
+ } else {
24877
+ var popoverTop = childRect.bottom - (newConfig.bottom && newConfig.height ? newConfig.bottom + newConfig.height : 0);
24878
+ var popoverBottom = childRect.top + (newConfig.top && newConfig.height ? newConfig.top + newConfig.height : 0); // 顶部安全距离不够,调整到底部
24879
+ // @en The top safety distance is not enough, adjust to the bottom
24880
+
24881
+ if (directionState.indexOf('top') !== -1 && popoverTop < topOffset) {
24882
+ setToBottom();
24883
+ } else if ( // 底部安全距离不够,调整到顶部
24884
+ // @en The bottom safety distance is not enough, adjust to the top
24885
+ directionState.indexOf('bottom') !== -1 && popoverBottom + bottomOffset > window.innerHeight) {
24886
+ setToTop();
24887
+ }
24868
24888
  }
24869
24889
  } // 挂载在全局的气泡需要计算相对屏幕的位置
24870
24890
  // @en Bubble mounted in the global needs to calculate the position relative to the screen