@rxdrag/website-lib-core 0.0.126 → 0.0.127
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/package.json +3 -3
- package/src/astro/background.ts +35 -2
- package/src/astro/index.ts +1 -0
- package/src/astro/link.ts +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdrag/website-lib-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.127",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.ts"
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"eslint": "^9.39.2",
|
|
25
25
|
"typescript": "^5",
|
|
26
26
|
"@rxdrag/tiptap-preview": "0.0.3",
|
|
27
|
-
"@rxdrag/
|
|
28
|
-
"@rxdrag/
|
|
27
|
+
"@rxdrag/tsconfig": "0.2.1",
|
|
28
|
+
"@rxdrag/eslint-config-custom": "0.2.13"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@iconify/utils": "^3.0.2",
|
package/src/astro/background.ts
CHANGED
|
@@ -10,7 +10,13 @@ export type ColorBackgroundConfig = {
|
|
|
10
10
|
export type BlurBackgroundConfig = {
|
|
11
11
|
id?: string;
|
|
12
12
|
type: "blur";
|
|
13
|
-
class?: string; //
|
|
13
|
+
class?: string; // 模糊,磨砂玻璃效果,如 "backdrop-blur"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type GlassBackgroundConfig = {
|
|
17
|
+
id?: string;
|
|
18
|
+
type: "glass";
|
|
19
|
+
class?: string; // 折射,模拟液态玻璃效果
|
|
14
20
|
};
|
|
15
21
|
|
|
16
22
|
export type ImageBackgroundConfig = {
|
|
@@ -44,10 +50,37 @@ export type SplineBackgroundConfig = {
|
|
|
44
50
|
url?: string; // Spline 场景 URL
|
|
45
51
|
};
|
|
46
52
|
|
|
53
|
+
export type GradientDirection = "to-r" | "to-l" | "to-t" | "to-b" | "to-tr" | "to-tl" | "to-br" | "to-bl";
|
|
54
|
+
// 镂空背景/渐变边框/特色边框/渐变边框
|
|
55
|
+
export type GradientBorderConfig = {
|
|
56
|
+
id?: string;
|
|
57
|
+
type: "gradient-border";
|
|
58
|
+
colors?: string[];
|
|
59
|
+
fromColor?: string;
|
|
60
|
+
toColor?: string;
|
|
61
|
+
viaColor?: string;
|
|
62
|
+
angle?: number | string;
|
|
63
|
+
direction?: GradientDirection;
|
|
64
|
+
width?: number | string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// 镂空背景/特色边框/玻璃边框
|
|
68
|
+
export type GlassBorderConfig = {
|
|
69
|
+
id?: string;
|
|
70
|
+
type: "glass-border";
|
|
71
|
+
color?: string;
|
|
72
|
+
width?: number | string;
|
|
73
|
+
radius?: number | string;
|
|
74
|
+
opacity?: number;
|
|
75
|
+
};
|
|
76
|
+
|
|
47
77
|
export type BackgroundConfig =
|
|
48
78
|
| ColorBackgroundConfig
|
|
49
79
|
| BlurBackgroundConfig
|
|
80
|
+
| GlassBackgroundConfig
|
|
50
81
|
| ImageBackgroundConfig
|
|
51
82
|
| SvgBackgroundConfig
|
|
52
83
|
| VideoBackgroundConfig
|
|
53
|
-
| SplineBackgroundConfig
|
|
84
|
+
| SplineBackgroundConfig
|
|
85
|
+
| GradientBorderConfig
|
|
86
|
+
| GlassBorderConfig;
|
package/src/astro/index.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes } from "astro/types";
|
|
2
|
+
import { LinkType } from "../component-logic";
|
|
3
|
+
|
|
4
|
+
export interface LinkProps extends HTMLAttributes<"a"> {
|
|
5
|
+
type?: LinkType | string;
|
|
6
|
+
to?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
//用于active类名的传递
|
|
9
|
+
activeWhen?: string | true;
|
|
10
|
+
|
|
11
|
+
// 链接生成配置:用于 toHref 计算最终 href 的路径前缀
|
|
12
|
+
// - productsSlug:产品详情页路径前缀(如 "products")
|
|
13
|
+
// - postsSlug:文章详情页路径前缀(如 "posts")
|
|
14
|
+
options?: {
|
|
15
|
+
productsSlug?: string;
|
|
16
|
+
postsSlug?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// 允许外部传入以便兼容旧用法,但运行时会被忽略(href 统一由 type/to/options 生成)
|
|
20
|
+
href?: string;
|
|
21
|
+
}
|