jeawin-astro 3.0.9 → 3.0.11

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.9",
3
+ "version": "3.0.11",
4
4
  "author": "chaegumi <chaegumi@qq.com>",
5
5
  "description": "",
6
6
  "license": "MIT",
@@ -57,7 +57,7 @@ const final_content = truncate(content, {
57
57
  <Fragment>
58
58
  {!is_default_image(img) ? (
59
59
  <div class="flex justify-center">
60
- {<JeawinImage img_html={img_html} />}
60
+ {<JeawinImage img_html={img_html} add_classes="border border-gray-200" />}
61
61
  </div>
62
62
  ) : null}
63
63
  </Fragment>
@@ -33,7 +33,7 @@ const categories = get_children_categories(
33
33
  const ProductCountLang = render_value(all_langs, "product");
34
34
  ---
35
35
 
36
- <div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4">
36
+ <div class="grid grid-cols-2 xl:grid-cols-6 gap-4">
37
37
  {
38
38
  categories.map((category: any) => (
39
39
  <a
@@ -51,16 +51,16 @@ const RequestBtnText = render_value(all_langs, "request a quote");
51
51
  >{title}</a
52
52
  >
53
53
  </TitleTag>
54
- <div class="hidden md:block h-6 overflow-hidden">
54
+ <div class="hidden md:block h-9 overflow-hidden">
55
55
  <div
56
- class="h-6 text-center -translate-y-full group-hover:translate-y-0 transition-transform duration-300"
56
+ class="h-9 text-center -translate-y-full group-hover:translate-y-1 transition-transform duration-300"
57
57
  >
58
58
  <Button tag_name="a"
59
59
  href={`${render_url(`request-a-quote`, base)}?product=${title}`}
60
60
  title={RequestBtnText} rel="nofollow">{RequestBtnText}</Button>
61
61
  </div>
62
62
  <div
63
- class="h-6 flex items-center justify-center gap-5 text-center -translate-y-full group-hover:translate-y-0 transition-transform duration-300"
63
+ class="h-6 flex items-center justify-center gap-5 text-center -translate-y-full group-hover:translate-y-1 transition-transform duration-300"
64
64
  >
65
65
  {
66
66
  original_price ? (
@@ -43,7 +43,7 @@ const {
43
43
  show_children_categories = true,
44
44
  show_category_nodes = false,
45
45
  has_sider = false,
46
- layout = "grid gap-4 grid-cols-2 md:grid-cols-4",
46
+ layout = "grid gap-4 grid-cols-2 xl:grid-cols-4",
47
47
  node_item_component,
48
48
  } = Astro.props;
49
49
 
@@ -53,6 +53,8 @@ function initPageFind() {
53
53
  query = params.q;
54
54
  }
55
55
  if (query) {
56
+ document.querySelectorAll(`input[name="q"]`).forEach((elem: any) => elem.value = query);
57
+
56
58
  const input = el.querySelector<HTMLInputElement>(`input[type="text"]`);
57
59
  if (input) {
58
60
  input.value = query;
@@ -34,3 +34,7 @@ export function get_children_categories(all_categories: any, channel_id: any, ca
34
34
  * 截取html
35
35
  */
36
36
  export function truncate(content: any, options: any): any;
37
+ /**
38
+ * 判断是否使用pagefind搜索
39
+ */
40
+ export function is_pagefind(language_id: any): boolean;
@@ -315,4 +315,18 @@ export function truncate(content, options) {
315
315
  const striphtml = stripHtml(content).result.replaceAll("\n", " ");
316
316
  const final_content = _.truncate(striphtml, options);
317
317
  return final_content;
318
+ }
319
+
320
+ /**
321
+ * 判断是否使用pagefind搜索
322
+ */
323
+ export function is_pagefind(language_id) {
324
+ if (language_id === 'zh' || language_id.indexOf('zh-') === 0) {
325
+ // 是中文,不使用pagefind
326
+ return false;
327
+ }
328
+ if (language_id === 'jp' || language_id.indexOf('jp-') === 0) {
329
+ return false;
330
+ }
331
+ return true;
318
332
  }