jeawin-astro 3.0.41 → 3.0.43
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jeawin-astro",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.43",
|
|
4
4
|
"author": "chaegumi <chaegumi@qq.com>",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"chai": "^5.2.0",
|
|
42
42
|
"mocha": "^10.8.2",
|
|
43
43
|
"postcss": "^8.5.3",
|
|
44
|
-
"rollup": "^4.
|
|
44
|
+
"rollup": "^4.37.0",
|
|
45
45
|
"rollup-plugin-node-externals": "^7.1.3",
|
|
46
46
|
"rollup-plugin-postcss": "^4.0.2",
|
|
47
47
|
"typescript": "^5.8.2"
|
|
@@ -49,23 +49,23 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@astrojs/alpinejs": "^0.4.3",
|
|
51
51
|
"@astrojs/check": "^0.9.4",
|
|
52
|
-
"@astrojs/cloudflare": "^12.
|
|
52
|
+
"@astrojs/cloudflare": "^12.3.0",
|
|
53
53
|
"@astrojs/rss": "^4.0.11",
|
|
54
54
|
"@astrojs/sitemap": "3.2.1",
|
|
55
55
|
"@astrojs/ts-plugin": "^1.10.4",
|
|
56
56
|
"@astrojs/vue": "^5.0.7",
|
|
57
57
|
"@iconify-json/fa6-brands": "^1.2.5",
|
|
58
58
|
"@iconify-json/fa6-solid": "^1.2.3",
|
|
59
|
-
"@iconify/tools": "^4.1.
|
|
59
|
+
"@iconify/tools": "^4.1.2",
|
|
60
60
|
"@keyv/compress-brotli": "^2.0.3",
|
|
61
61
|
"@pagefind/default-ui": "^1.3.0",
|
|
62
62
|
"@tailwindcss/forms": "^0.5.10",
|
|
63
63
|
"@tailwindcss/typography": "^0.5.16",
|
|
64
|
-
"@tailwindcss/vite": "^4.0.
|
|
64
|
+
"@tailwindcss/vite": "^4.0.15",
|
|
65
65
|
"@types/alpinejs": "^3.13.11",
|
|
66
66
|
"alpinejs": "^3.14.9",
|
|
67
67
|
"aos": "3.0.0-beta.6",
|
|
68
|
-
"astro": "^5.5.
|
|
68
|
+
"astro": "^5.5.4",
|
|
69
69
|
"astro-color-scheme": "^1.1.5",
|
|
70
70
|
"astro-embed": "^0.9.0",
|
|
71
71
|
"astro-icon": "^1.1.5",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"dayjs": "^1.11.13",
|
|
76
76
|
"fetch-jsonp": "^1.3.0",
|
|
77
77
|
"glob": "^11.0.1",
|
|
78
|
-
"keyv": "^5.3.
|
|
78
|
+
"keyv": "^5.3.2",
|
|
79
79
|
"keyv-lru": "^3.0.4",
|
|
80
80
|
"lodash": "^4.17.21",
|
|
81
81
|
"pagefind": "^1.3.0",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"smartmenus": "2.0.0-alpha.1",
|
|
85
85
|
"sprintf-js": "^1.1.3",
|
|
86
86
|
"string-strip-html": "^13.4.12",
|
|
87
|
-
"swiper": "^11.2.
|
|
87
|
+
"swiper": "^11.2.6",
|
|
88
88
|
"tailwind-scrollbar": "^4.0.1",
|
|
89
|
-
"tailwindcss": "^4.0.
|
|
89
|
+
"tailwindcss": "^4.0.15",
|
|
90
90
|
"tslib": "^2.8.1",
|
|
91
91
|
"zod": "^3.24.2"
|
|
92
92
|
}
|
|
@@ -32,8 +32,9 @@ interface Props {
|
|
|
32
32
|
nodepics?: any[]; // 产品图片
|
|
33
33
|
video?: JWVIDEO; // 产品视频
|
|
34
34
|
view360?: any; // 360 view
|
|
35
|
+
thumbs_position?: any;
|
|
35
36
|
}
|
|
36
|
-
const { node_title, nodepics = [], video, view360 } = Astro.props;
|
|
37
|
+
const { node_title, nodepics = [], video, view360, thumbs_position = 'left' } = Astro.props;
|
|
37
38
|
---
|
|
38
39
|
|
|
39
40
|
<custom-detail-images data-nodepics={nodepics} data-video={video} data-view360={view360}>
|
|
@@ -54,8 +55,8 @@ const { node_title, nodepics = [], video, view360 } = Astro.props;
|
|
|
54
55
|
}
|
|
55
56
|
}`}
|
|
56
57
|
>
|
|
57
|
-
<div class="flex flex-col lg:flex-row gap-5">
|
|
58
|
-
<div class="order-2 lg:order-1 lg:w-2/12 lg:flex lg:flex-col gap-3">
|
|
58
|
+
<div class:list={["flex flex-col", {"lg:flex-row":thumbs_position=='left'}, "gap-5"]}>
|
|
59
|
+
<div class:list={["order-2", {"lg:order-1 lg:w-2/12 lg:flex lg:flex-col":thumbs_position=='left'}, "gap-3"]}>
|
|
59
60
|
<!-- thumbs swiper -->
|
|
60
61
|
<swiper-container
|
|
61
62
|
init="false"
|
|
@@ -103,7 +104,7 @@ const { node_title, nodepics = [], video, view360 } = Astro.props;
|
|
|
103
104
|
|
|
104
105
|
</swiper-container>
|
|
105
106
|
</div>
|
|
106
|
-
<div class="order-1 lg:order-2 w-full lg:w-10/12">
|
|
107
|
+
<div class:list={["order-1", {"lg:order-2":thumbs_position=='left'}, "w-full", {"lg:w-10/12":thumbs_position=='left'}]}>
|
|
107
108
|
<!-- main swiper, pass thumbs swiper as CSS selector -->
|
|
108
109
|
<swiper-container
|
|
109
110
|
init="false"
|
package/src/scripts/index.ts
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// 数组深度
|
|
2
|
+
export function array_depth(array) {
|
|
3
|
+
let max_depth = 1;
|
|
4
|
+
|
|
5
|
+
for (const value of array) {
|
|
6
|
+
// console.log(value);
|
|
7
|
+
if (value.children && Array.isArray(value.children)) {
|
|
8
|
+
let depth = array_depth(value.children) + 1;
|
|
9
|
+
if (depth > max_depth) {
|
|
10
|
+
max_depth = depth;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return max_depth;
|
|
16
|
+
}
|
|
17
|
+
// 数组广度
|
|
18
|
+
export function array_breadth(array) {
|
|
19
|
+
let max_breadth = array.length; // 当前层级的广度
|
|
20
|
+
|
|
21
|
+
for (const value of array) {
|
|
22
|
+
if (value.children && Array.isArray(value.children)) {
|
|
23
|
+
// 递归计算子数组的广度
|
|
24
|
+
let breadth = array_breadth(value.children);
|
|
25
|
+
if (breadth > max_breadth) {
|
|
26
|
+
max_breadth = breadth;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return max_breadth;
|
|
32
|
+
}
|
|
33
|
+
// 叶子节点数
|
|
34
|
+
export function countLeafNodes(tree) {
|
|
35
|
+
let count = 0;
|
|
36
|
+
for (const value of tree) {
|
|
37
|
+
if (value.children && Array.isArray(value.children)) {
|
|
38
|
+
count += countLeafNodes(value.children);
|
|
39
|
+
} else {
|
|
40
|
+
count += 1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return count;
|
|
44
|
+
}
|