jeawin-astro 3.0.21 → 3.0.22

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.
Files changed (37) hide show
  1. package/package.json +10 -10
  2. package/src/components/blocks/block1.astro +1 -1
  3. package/src/components/category_list.astro +138 -138
  4. package/src/components/comment_form.astro +126 -126
  5. package/src/components/default_image.astro +36 -36
  6. package/src/components/formitem/checkbox.astro +48 -48
  7. package/src/components/formitem/country.astro +37 -37
  8. package/src/components/formitem/input.astro +30 -30
  9. package/src/components/formitem/radio.astro +48 -48
  10. package/src/components/formitem/select.astro +21 -21
  11. package/src/components/formitem/textarea.astro +24 -24
  12. package/src/components/image.astro +36 -36
  13. package/src/components/nodes_list.astro +125 -125
  14. package/src/components/pagination.astro +205 -205
  15. package/src/components/product_category_list.astro +195 -195
  16. package/src/components/rel_nodes_list.astro +63 -63
  17. package/src/components/site_options.astro +39 -39
  18. package/src/components/stat.astro +76 -76
  19. package/src/integrations/jeawin-site-clearcache/index.ts +6 -0
  20. package/src/layouts/Footer.astro +190 -190
  21. package/src/layouts/Header.astro +65 -65
  22. package/src/layouts/channel.astro +168 -168
  23. package/src/layouts/page.astro +148 -148
  24. package/src/pages/robots.txt.ts +10 -10
  25. package/src/pages/site.webmanifest.ts +30 -30
  26. package/src/scripts/aos.d.ts +1 -1
  27. package/src/scripts/cms.d.ts +129 -129
  28. package/src/scripts/consts.d.ts +26 -26
  29. package/src/scripts/consts.js +1 -1
  30. package/src/scripts/lightbox.d.ts +1 -1
  31. package/src/scripts/magnify.d.ts +6 -6
  32. package/src/scripts/search-result-list.d.ts +1 -1
  33. package/src/scripts/smartmenus.d.ts +2 -2
  34. package/src/scripts/swiper.d.ts +1 -1
  35. package/src/scripts/util.d.ts +40 -40
  36. package/src/service/image-service.ts +18 -18
  37. package/src/service/jeawin.ts +162 -162
@@ -1,36 +1,36 @@
1
- ---
2
- /**
3
- * 默认图片组件
4
- *
5
- * jeawin-astro/src/components/default_image.astro
6
- *
7
- * @package jeawin-astro
8
- * @author Chaegumi
9
- * @copyright Copyright (c) 2024-2099 jeawin.com
10
- * @email chaegumi@jeawin.com
11
- * @filesource
12
- */
13
- import { render_value } from "../scripts/util.js";
14
- import defaultimg from "../assets/images/default.png";
15
-
16
- let classList = "";
17
- let alt = "No Image";
18
- if (render_value(Astro.props, "class")) {
19
- classList = Astro.props.class;
20
- }
21
- if (render_value(Astro.props, "alt")) {
22
- alt = Astro.props.alt;
23
- }
24
- ---
25
-
26
- <img
27
- class:list={[
28
- "mx-auto rounded-xl transition duration-500 ease-in-out group-hover:scale-105",
29
- classList,
30
- ]}
31
- src={defaultimg.src}
32
- alt={alt}
33
- title={alt}
34
- decoding="async"
35
- loading="lazy"
36
- />
1
+ ---
2
+ /**
3
+ * 默认图片组件
4
+ *
5
+ * jeawin-astro/src/components/default_image.astro
6
+ *
7
+ * @package jeawin-astro
8
+ * @author Chaegumi
9
+ * @copyright Copyright (c) 2024-2099 jeawin.com
10
+ * @email chaegumi@jeawin.com
11
+ * @filesource
12
+ */
13
+ import { render_value } from "../scripts/util.js";
14
+ import defaultimg from "../assets/images/default.png";
15
+
16
+ let classList = "";
17
+ let alt = "No Image";
18
+ if (render_value(Astro.props, "class")) {
19
+ classList = Astro.props.class;
20
+ }
21
+ if (render_value(Astro.props, "alt")) {
22
+ alt = Astro.props.alt;
23
+ }
24
+ ---
25
+
26
+ <img
27
+ class:list={[
28
+ "mx-auto rounded-xl transition duration-500 ease-in-out group-hover:scale-105",
29
+ classList,
30
+ ]}
31
+ src={defaultimg.src}
32
+ alt={alt}
33
+ title={alt}
34
+ decoding="async"
35
+ loading="lazy"
36
+ />
@@ -1,48 +1,48 @@
1
- ---
2
- /**
3
- * checkbox表单项
4
- *
5
- * @package jeawin-astro
6
- * @author Chaegumi
7
- * @copyright Copyright (c) 2024-2099 jeawin.com
8
- * @email chaegumi@jeawin.com
9
- * @filesource
10
- */
11
- import { render_value } from "../../scripts/util.js";
12
- const { field } = Astro.props;
13
-
14
- let field_option_arr = field.field_options.split("\n");
15
- let field_option_defaults_arr = field.field_option_defaults.split("\n");
16
- ---
17
-
18
- <div class="block">
19
- <span class="text-gray-700">
20
- {field.field_label}
21
- </span>
22
- {
23
- field_option_arr.map((option: any) => (
24
- <label>
25
- {field_option_defaults_arr.includes(option) ? (
26
- <input
27
- type="checkbox"
28
- id={field.field_name}
29
- name={field.field_name}
30
- value={option}
31
- checked="checked"
32
- class="mt-1 block w-full"
33
- />
34
- ) : (
35
- <input
36
- type="checkbox"
37
- id={field.field_name}
38
- name={field.field_name}
39
- value={option}
40
- class="mt-1 block w-full"
41
- />
42
- )}
43
- {option}
44
- </label>
45
- ))
46
- }
47
- {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
48
- </div>
1
+ ---
2
+ /**
3
+ * checkbox表单项
4
+ *
5
+ * @package jeawin-astro
6
+ * @author Chaegumi
7
+ * @copyright Copyright (c) 2024-2099 jeawin.com
8
+ * @email chaegumi@jeawin.com
9
+ * @filesource
10
+ */
11
+ import { render_value } from "../../scripts/util.js";
12
+ const { field } = Astro.props;
13
+
14
+ let field_option_arr = field.field_options.split("\n");
15
+ let field_option_defaults_arr = field.field_option_defaults.split("\n");
16
+ ---
17
+
18
+ <div class="block">
19
+ <span class="text-gray-700">
20
+ {field.field_label}
21
+ </span>
22
+ {
23
+ field_option_arr.map((option: any) => (
24
+ <label>
25
+ {field_option_defaults_arr.includes(option) ? (
26
+ <input
27
+ type="checkbox"
28
+ id={field.field_name}
29
+ name={field.field_name}
30
+ value={option}
31
+ checked="checked"
32
+ class="mt-1 block w-full"
33
+ />
34
+ ) : (
35
+ <input
36
+ type="checkbox"
37
+ id={field.field_name}
38
+ name={field.field_name}
39
+ value={option}
40
+ class="mt-1 block w-full"
41
+ />
42
+ )}
43
+ {option}
44
+ </label>
45
+ ))
46
+ }
47
+ {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
48
+ </div>
@@ -1,37 +1,37 @@
1
- ---
2
- /**
3
- * 国家地区下来表单项
4
- *
5
- * @package jeawin-astro
6
- * @author Chaegumi
7
- * @copyright Copyright (c) 2024-2099 jeawin.com
8
- * @email chaegumi@jeawin.com
9
- * @filesource
10
- */
11
- import JeawinApi from "../../scripts/cms.js";
12
- import { render_value } from "../../scripts/util.js";
13
- const { field } = Astro.props;
14
- const { all_langs, jeawin_apikey, jeawin_api_domain, jeawin_api_path } =
15
- Astro.locals;
16
- const jeawinapi = new JeawinApi({
17
- apikey: jeawin_apikey,
18
- api_domain: jeawin_api_domain,
19
- api_path: jeawin_api_path,
20
- });
21
- const countrylist = await jeawinapi.get_country();
22
- ---
23
-
24
- <label class="block">
25
- <span class="text-gray-700">
26
- {field.field_label}
27
- </span>
28
- <select class="mt-1 block w-full" autocomplete="off">
29
- <option value="">{render_value(all_langs, "Chooce One")}</option>
30
- {
31
- countrylist.map((country: any) => (
32
- <option value={country.en}>{country.en}</option>
33
- ))
34
- }
35
- </select>
36
- {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
37
- </label>
1
+ ---
2
+ /**
3
+ * 国家地区下来表单项
4
+ *
5
+ * @package jeawin-astro
6
+ * @author Chaegumi
7
+ * @copyright Copyright (c) 2024-2099 jeawin.com
8
+ * @email chaegumi@jeawin.com
9
+ * @filesource
10
+ */
11
+ import JeawinApi from "../../scripts/cms.js";
12
+ import { render_value } from "../../scripts/util.js";
13
+ const { field } = Astro.props;
14
+ const { all_langs, jeawin_apikey, jeawin_api_domain, jeawin_api_path } =
15
+ Astro.locals;
16
+ const jeawinapi = new JeawinApi({
17
+ apikey: jeawin_apikey,
18
+ api_domain: jeawin_api_domain,
19
+ api_path: jeawin_api_path,
20
+ });
21
+ const countrylist = await jeawinapi.get_country();
22
+ ---
23
+
24
+ <label class="block">
25
+ <span class="text-gray-700">
26
+ {field.field_label}
27
+ </span>
28
+ <select class="mt-1 block w-full" autocomplete="off">
29
+ <option value="">{render_value(all_langs, "Chooce One")}</option>
30
+ {
31
+ countrylist.map((country: any) => (
32
+ <option value={country.en}>{country.en}</option>
33
+ ))
34
+ }
35
+ </select>
36
+ {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
37
+ </label>
@@ -1,30 +1,30 @@
1
- ---
2
- /**
3
- * 文本框表单项
4
- *
5
- * @package jeawin-astro
6
- * @author Chaegumi
7
- * @copyright Copyright (c) 2024-2099 jeawin.com
8
- * @email chaegumi@jeawin.com
9
- * @filesource
10
- */
11
- import { render_value } from "../../scripts/util.js";
12
- const { field, type } = Astro.props;
13
- ---
14
-
15
- <label class="block">
16
- <span class="text-gray-700">
17
- {field.field_label}
18
- </span>
19
- <input
20
- type={type}
21
- required="required"
22
- id={field.field_name}
23
- name={field.field_name}
24
- placeholder={field.placeholder ? field.placeholder : field.field_label}
25
- autocomplete="off"
26
- class="form-input mt-1 block w-full"
27
- />
28
-
29
- {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
30
- </label>
1
+ ---
2
+ /**
3
+ * 文本框表单项
4
+ *
5
+ * @package jeawin-astro
6
+ * @author Chaegumi
7
+ * @copyright Copyright (c) 2024-2099 jeawin.com
8
+ * @email chaegumi@jeawin.com
9
+ * @filesource
10
+ */
11
+ import { render_value } from "../../scripts/util.js";
12
+ const { field, type } = Astro.props;
13
+ ---
14
+
15
+ <label class="block">
16
+ <span class="text-gray-700">
17
+ {field.field_label}
18
+ </span>
19
+ <input
20
+ type={type}
21
+ required="required"
22
+ id={field.field_name}
23
+ name={field.field_name}
24
+ placeholder={field.placeholder ? field.placeholder : field.field_label}
25
+ autocomplete="off"
26
+ class="form-input mt-1 block w-full"
27
+ />
28
+
29
+ {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
30
+ </label>
@@ -1,48 +1,48 @@
1
- ---
2
- /**
3
- * radio表单项
4
- *
5
- * @package jeawin-astro
6
- * @author Chaegumi
7
- * @copyright Copyright (c) 2024-2099 jeawin.com
8
- * @email chaegumi@jeawin.com
9
- * @filesource
10
- */
11
- import { render_value } from "../../scripts/util.js";
12
- const { field } = Astro.props;
13
-
14
- let field_option_arr = field.field_options.split("\n");
15
- let field_option_defaults_arr = field.field_option_defaults.split("\n");
16
- ---
17
-
18
- <div class="block">
19
- <span class="text-gray-700">
20
- {field.field_label}
21
- </span>
22
- {
23
- field_option_arr.map((option: any) => (
24
- <label>
25
- {field_option_defaults_arr.includes(option) ? (
26
- <input
27
- type="radio"
28
- id={field.field_name}
29
- name={field.field_name}
30
- value={option}
31
- checked="checked"
32
- class="mt-1 block w-full"
33
- />
34
- ) : (
35
- <input
36
- type="radio"
37
- id={field.field_name}
38
- name={field.field_name}
39
- value={option}
40
- class="mt-1 block w-full"
41
- />
42
- )}
43
- {option}
44
- </label>
45
- ))
46
- }
47
- {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
48
- </div>
1
+ ---
2
+ /**
3
+ * radio表单项
4
+ *
5
+ * @package jeawin-astro
6
+ * @author Chaegumi
7
+ * @copyright Copyright (c) 2024-2099 jeawin.com
8
+ * @email chaegumi@jeawin.com
9
+ * @filesource
10
+ */
11
+ import { render_value } from "../../scripts/util.js";
12
+ const { field } = Astro.props;
13
+
14
+ let field_option_arr = field.field_options.split("\n");
15
+ let field_option_defaults_arr = field.field_option_defaults.split("\n");
16
+ ---
17
+
18
+ <div class="block">
19
+ <span class="text-gray-700">
20
+ {field.field_label}
21
+ </span>
22
+ {
23
+ field_option_arr.map((option: any) => (
24
+ <label>
25
+ {field_option_defaults_arr.includes(option) ? (
26
+ <input
27
+ type="radio"
28
+ id={field.field_name}
29
+ name={field.field_name}
30
+ value={option}
31
+ checked="checked"
32
+ class="mt-1 block w-full"
33
+ />
34
+ ) : (
35
+ <input
36
+ type="radio"
37
+ id={field.field_name}
38
+ name={field.field_name}
39
+ value={option}
40
+ class="mt-1 block w-full"
41
+ />
42
+ )}
43
+ {option}
44
+ </label>
45
+ ))
46
+ }
47
+ {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
48
+ </div>
@@ -1,21 +1,21 @@
1
- ---
2
- /**
3
- * 下拉框表单项
4
- *
5
- * @package jeawin-astro
6
- * @author Chaegumi
7
- * @copyright Copyright (c) 2024-2099 jeawin.com
8
- * @email chaegumi@jeawin.com
9
- * @filesource
10
- */
11
- import { render_value } from "../../scripts/util.js";
12
- const { field } = Astro.props;
13
- ---
14
-
15
- <label class="block">
16
- <span class="text-gray-700">
17
- {field.field_label}
18
- </span>
19
- <select class="mt-1 block w-full" autocomplete="off"> </select>
20
- {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
21
- </label>
1
+ ---
2
+ /**
3
+ * 下拉框表单项
4
+ *
5
+ * @package jeawin-astro
6
+ * @author Chaegumi
7
+ * @copyright Copyright (c) 2024-2099 jeawin.com
8
+ * @email chaegumi@jeawin.com
9
+ * @filesource
10
+ */
11
+ import { render_value } from "../../scripts/util.js";
12
+ const { field } = Astro.props;
13
+ ---
14
+
15
+ <label class="block">
16
+ <span class="text-gray-700">
17
+ {field.field_label}
18
+ </span>
19
+ <select class="mt-1 block w-full" autocomplete="off"> </select>
20
+ {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
21
+ </label>
@@ -1,24 +1,24 @@
1
- ---
2
- /**
3
- * 文本域表单项
4
- *
5
- * @package jeawin-astro
6
- * @author Chaegumi
7
- * @copyright Copyright (c) 2024-2099 jeawin.com
8
- * @email chaegumi@jeawin.com
9
- * @filesource
10
- */
11
- import { render_value } from "../../scripts/util.js";
12
- const { field } = Astro.props;
13
- ---
14
-
15
- <label class="block">
16
- <span class="text-gray-700">{field.field_label}</span>
17
- <textarea
18
- id={field.field_name}
19
- name={field.field_name}
20
- required="required"
21
- class="mt-1 block w-full"
22
- autocomplete="off"></textarea>
23
- {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
24
- </label>
1
+ ---
2
+ /**
3
+ * 文本域表单项
4
+ *
5
+ * @package jeawin-astro
6
+ * @author Chaegumi
7
+ * @copyright Copyright (c) 2024-2099 jeawin.com
8
+ * @email chaegumi@jeawin.com
9
+ * @filesource
10
+ */
11
+ import { render_value } from "../../scripts/util.js";
12
+ const { field } = Astro.props;
13
+ ---
14
+
15
+ <label class="block">
16
+ <span class="text-gray-700">{field.field_label}</span>
17
+ <textarea
18
+ id={field.field_name}
19
+ name={field.field_name}
20
+ required="required"
21
+ class="mt-1 block w-full"
22
+ autocomplete="off"></textarea>
23
+ {render_value(field, "field_help") ? <p>{field.field_help}</p> : null}
24
+ </label>
@@ -1,36 +1,36 @@
1
- ---
2
- /**
3
- * 输出图片元素
4
- *
5
- * @package jeawin-astro
6
- * @author Chaegumi
7
- * @copyright Copyright (c) 2024-2099 jeawin.com
8
- * @email chaegumi@jeawin.com
9
- * @filesource
10
- */
11
- import * as cheerio from "cheerio";
12
-
13
- const { img_html, add_classes, ...other_props } = Astro.props;
14
-
15
- let final_img_html: any = "";
16
- if (img_html) {
17
- const $ = cheerio.load(img_html);
18
- const img = $("img");
19
-
20
- if (add_classes) {
21
- img.addClass(add_classes);
22
- } else {
23
- img.addClass(" transition duration-500 ease-in-out group-hover:scale-105");
24
- }
25
-
26
- if (other_props) {
27
- for (const k in other_props) {
28
- img.attr(k, other_props[k]);
29
- }
30
- }
31
-
32
- final_img_html = img.prop("outerHTML");
33
- }
34
- ---
35
-
36
- <Fragment set:html={final_img_html} />
1
+ ---
2
+ /**
3
+ * 输出图片元素
4
+ *
5
+ * @package jeawin-astro
6
+ * @author Chaegumi
7
+ * @copyright Copyright (c) 2024-2099 jeawin.com
8
+ * @email chaegumi@jeawin.com
9
+ * @filesource
10
+ */
11
+ import * as cheerio from "cheerio";
12
+
13
+ const { img_html, add_classes, ...other_props } = Astro.props;
14
+
15
+ let final_img_html: any = "";
16
+ if (img_html) {
17
+ const $ = cheerio.load(img_html);
18
+ const img = $("img");
19
+
20
+ if (add_classes) {
21
+ img.addClass(add_classes);
22
+ } else {
23
+ img.addClass(" transition duration-500 ease-in-out group-hover:scale-105");
24
+ }
25
+
26
+ if (other_props) {
27
+ for (const k in other_props) {
28
+ img.attr(k, other_props[k]);
29
+ }
30
+ }
31
+
32
+ final_img_html = img.prop("outerHTML");
33
+ }
34
+ ---
35
+
36
+ <Fragment set:html={final_img_html} />