@stephenchenorg/astro 1.1.2 → 1.2.0
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/dist/company-setting/create.d.ts +18 -0
- package/dist/company-setting/create.js +19 -0
- package/dist/company-setting/index.d.ts +1 -0
- package/dist/company-setting/index.js +1 -0
- package/dist/page/components/PageFieldRender.astro +7 -7
- package/dist/page/field/helpers.d.ts +1 -1
- package/dist/query-params/components/ProvideUrlConfig.astro +1 -0
- package/package.json +6 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CompanySetting } from './types';
|
|
2
|
+
export declare function createCompanySetting(companySetting: Partial<CompanySetting>): {
|
|
3
|
+
lang: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
logo: string;
|
|
7
|
+
address_1: string;
|
|
8
|
+
address_2: string;
|
|
9
|
+
email_1: string;
|
|
10
|
+
email_2: string;
|
|
11
|
+
fb_link: string;
|
|
12
|
+
ig_link: string;
|
|
13
|
+
line_link: string;
|
|
14
|
+
phone_1: string;
|
|
15
|
+
phone_2: string;
|
|
16
|
+
twitter_link: string;
|
|
17
|
+
threads_link: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function createCompanySetting(companySetting) {
|
|
2
|
+
return {
|
|
3
|
+
lang: companySetting.lang || "zh_TW",
|
|
4
|
+
name: companySetting.name || "Astro",
|
|
5
|
+
description: companySetting.description || "",
|
|
6
|
+
logo: companySetting.logo || "",
|
|
7
|
+
address_1: companySetting.address_1 || "",
|
|
8
|
+
address_2: companySetting.address_2 || "",
|
|
9
|
+
email_1: companySetting.email_1 || "",
|
|
10
|
+
email_2: companySetting.email_2 || "",
|
|
11
|
+
fb_link: companySetting.fb_link || "",
|
|
12
|
+
ig_link: companySetting.ig_link || "",
|
|
13
|
+
line_link: companySetting.line_link || "",
|
|
14
|
+
phone_1: companySetting.phone_1 || "",
|
|
15
|
+
phone_2: companySetting.phone_2 || "",
|
|
16
|
+
twitter_link: companySetting.twitter_link || "",
|
|
17
|
+
threads_link: companySetting.threads_link || ""
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import {
|
|
2
|
+
import { isContentField, isImageField, isPlainTextField, isPlainTextareaField } from '../field/helpers'
|
|
3
3
|
import type { PageField } from '../types'
|
|
4
4
|
import { ResponsiveImage } from '../../image'
|
|
5
5
|
|
|
@@ -16,10 +16,10 @@ const field = fields.find(field => field.key === key)
|
|
|
16
16
|
|
|
17
17
|
{
|
|
18
18
|
field && (
|
|
19
|
-
isPlainTextField(field) ? <Fragment set:text={field.content} />
|
|
20
|
-
isPlainTextareaField(field) ? <Fragment set:html={field.content} />
|
|
21
|
-
isContentField(field) ? <Fragment set:html={field.content} />
|
|
22
|
-
isImageField(field) ? (
|
|
19
|
+
isPlainTextField(field) ? <Fragment set:text={field.content} />
|
|
20
|
+
: isPlainTextareaField(field) ? <Fragment set:html={field.content} />
|
|
21
|
+
: isContentField(field) ? <Fragment set:html={field.content} />
|
|
22
|
+
: isImageField(field) ? (
|
|
23
23
|
<ResponsiveImage
|
|
24
24
|
desktop={field.image.desktop}
|
|
25
25
|
desktopBlur={field.image.desktop_blur}
|
|
@@ -28,7 +28,7 @@ const field = fields.find(field => field.key === key)
|
|
|
28
28
|
alt={`Image of ${key}`}
|
|
29
29
|
{...attributes}
|
|
30
30
|
/>
|
|
31
|
-
)
|
|
32
|
-
null
|
|
31
|
+
)
|
|
32
|
+
: null
|
|
33
33
|
)
|
|
34
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PageContentField, PageField, PageImageField, PagePlainTextField, PagePlainTextareaField } from '../types';
|
|
2
2
|
export declare function isPlainTextField(field: PageField): field is PagePlainTextField;
|
|
3
3
|
export declare function isPlainTextareaField(field: PageField): field is PagePlainTextareaField;
|
|
4
4
|
export declare function isContentField(field: PageField): field is PageContentField;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stephenchenorg/astro",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"description": "Stephenchenorg Astro 前端通用套件",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://stephenchenorg-astro.netlify.app",
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "mkdist --declaration --ext=js",
|
|
59
|
-
"
|
|
59
|
+
"lint": "eslint .",
|
|
60
|
+
"code-check": "astro check && npm run lint",
|
|
60
61
|
"prepack": "npm run build",
|
|
61
62
|
"release": "bumpp --commit \"Release v%s\" && npm publish"
|
|
62
63
|
},
|
|
@@ -73,8 +74,11 @@
|
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
76
|
"@astrojs/check": "^0.9.4",
|
|
77
|
+
"@ycs77/eslint-config": "^4.1.0",
|
|
76
78
|
"astro": "^5.4.1",
|
|
77
79
|
"bumpp": "^10.0.3",
|
|
80
|
+
"eslint": "^9.21.0",
|
|
81
|
+
"eslint-plugin-astro": "^1.3.1",
|
|
78
82
|
"mkdist": "^2.2.0",
|
|
79
83
|
"typescript": "~5.7.3"
|
|
80
84
|
}
|