@rxdrag/website-lib 0.0.150 → 0.0.152
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/components/Carousel.astro +1 -0
- package/components/Link.astro +4 -21
- package/package.json +3 -3
package/components/Link.astro
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { toHref, type
|
|
2
|
+
import { toHref, type LinkProps } from "@rxdrag/website-lib-core";
|
|
3
3
|
|
|
4
4
|
import type { HTMLAttributes } from "astro/types";
|
|
5
5
|
|
|
@@ -13,24 +13,7 @@ import type { HTMLAttributes } from "astro/types";
|
|
|
13
13
|
* - href 由 type/to/options 计算得出;不允许外部通过 props 覆盖(避免行为不稳定)
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
interface Props extends
|
|
17
|
-
type?: LinkType | string;
|
|
18
|
-
to?: string;
|
|
19
|
-
className?: string;
|
|
20
|
-
//用于active类名的传递
|
|
21
|
-
activeWhen?: string | true;
|
|
22
|
-
|
|
23
|
-
// 链接生成配置:用于 toHref 计算最终 href 的路径前缀
|
|
24
|
-
// - productsSlug:产品详情页路径前缀(如 "products")
|
|
25
|
-
// - postsSlug:文章详情页路径前缀(如 "posts")
|
|
26
|
-
options?: {
|
|
27
|
-
productsSlug?: string;
|
|
28
|
-
postsSlug?: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// 允许外部传入以便兼容旧用法,但运行时会被忽略(href 统一由 type/to/options 生成)
|
|
32
|
-
href?: string;
|
|
33
|
-
}
|
|
16
|
+
interface Props extends LinkProps {}
|
|
34
17
|
|
|
35
18
|
const {
|
|
36
19
|
type,
|
|
@@ -46,12 +29,12 @@ const {
|
|
|
46
29
|
|
|
47
30
|
if (hrefFromProps) {
|
|
48
31
|
console.log(
|
|
49
|
-
`[Link] prop "href" is ignored. Use type/to/options to generate href. href=${hrefFromProps}
|
|
32
|
+
`[Link] prop "href" is ignored. Use type/to/options to generate href. href=${hrefFromProps}`,
|
|
50
33
|
);
|
|
51
34
|
}
|
|
52
35
|
if (classListFromProps) {
|
|
53
36
|
console.log(
|
|
54
|
-
'[Link] prop "class:list" is ignored. Use class/className instead.'
|
|
37
|
+
'[Link] prop "class:list" is ignored. Use class/className instead.',
|
|
55
38
|
);
|
|
56
39
|
}
|
|
57
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdrag/website-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.152",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.ts",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"gsap": "^3.12.7",
|
|
30
30
|
"typescript": "^5",
|
|
31
31
|
"@rxdrag/entify-hooks": "0.2.79",
|
|
32
|
-
"@rxdrag/eslint-config-custom": "0.2.13",
|
|
33
|
-
"@rxdrag/website-lib-core": "0.0.126",
|
|
34
32
|
"@rxdrag/rxcms-models": "0.3.106",
|
|
33
|
+
"@rxdrag/website-lib-core": "0.0.127",
|
|
34
|
+
"@rxdrag/eslint-config-custom": "0.2.13",
|
|
35
35
|
"@rxdrag/tiptap-preview": "0.0.3",
|
|
36
36
|
"@rxdrag/tsconfig": "0.2.1"
|
|
37
37
|
},
|