@lark-apaas/client-toolkit 1.2.75 → 1.2.76-alpha.20261016165327

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.
@@ -6,6 +6,7 @@ export interface UniversalLinkProps extends Omit<React.AnchorHTMLAttributes<HTML
6
6
  /**
7
7
  * 统一的链接组件,用于替换原生 <a> 标签
8
8
  * - 内部路由(/dashboard)→ react-router Link
9
+ * - 带有效 download 意图的内部路由形态 → <a>
9
10
  * - Hash 锚点(#section)→ <a>
10
11
  * - 外链(https://...)→ <a target="_blank">
11
12
  *
@@ -23,6 +23,7 @@ function isIframeUnderMainHost() {
23
23
  }
24
24
  const UniversalLink_UniversalLink = /*#__PURE__*/ react.forwardRef(function({ to, onClick, ...props }, ref) {
25
25
  const isExternal = isExternalLink(to);
26
+ const hasDownloadIntent = true === props.download || 'string' == typeof props.download;
26
27
  const preview = (isPreview() || isIframeUnderMainHost()) && isExternal;
27
28
  if (preview) {
28
29
  const handlePreviewClick = (e)=>{
@@ -45,7 +46,7 @@ const UniversalLink_UniversalLink = /*#__PURE__*/ react.forwardRef(function({ to
45
46
  rel: props.rel ?? 'noopener noreferrer'
46
47
  });
47
48
  }
48
- if (isInternalRoute(to)) return /*#__PURE__*/ jsx(Link, {
49
+ if (isInternalRoute(to) && !hasDownloadIntent) return /*#__PURE__*/ jsx(Link, {
49
50
  to: to,
50
51
  ref: ref,
51
52
  ...props,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.2.75",
3
+ "version": "1.2.76-alpha.20261016165327",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [