@stephenchenorg/astro 8.3.0 → 8.4.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/api/{index.js → index.mjs} +1 -2
- package/dist/form-validator/{index.d.ts → index.d.mts} +13 -13
- package/dist/page/{index.d.ts → index.d.mts} +3 -3
- package/dist/pagination-vue-client-side/{index.d.ts → index.d.mts} +7 -7
- package/dist/pagination-vue-server-side/{index.d.ts → index.d.mts} +11 -11
- package/package.json +33 -33
- /package/dist/api/{index.d.ts → index.d.mts} +0 -0
- /package/dist/company-setting/{index.d.ts → index.d.mts} +0 -0
- /package/dist/company-setting/{index.js → index.mjs} +0 -0
- /package/dist/form-validator/{index.js → index.mjs} +0 -0
- /package/dist/image/{index.d.ts → index.d.mts} +0 -0
- /package/dist/image/{index.js → index.mjs} +0 -0
- /package/dist/page/{index.js → index.mjs} +0 -0
- /package/dist/pagination-astro/{index.d.ts → index.d.mts} +0 -0
- /package/dist/pagination-astro/{index.js → index.mjs} +0 -0
- /package/dist/pagination-vue-client-side/{index.js → index.mjs} +0 -0
- /package/dist/pagination-vue-server-side/{index.js → index.mjs} +0 -0
- /package/dist/query-params/{index.d.ts → index.d.mts} +0 -0
- /package/dist/query-params/{index.js → index.mjs} +0 -0
|
@@ -117,8 +117,7 @@ function createGraphQLAPI(globalOptions) {
|
|
|
117
117
|
}
|
|
118
118
|
}).then((data) => resolve(data)).catch((error) => {
|
|
119
119
|
if (error instanceof GraphQLRequestError$1) {
|
|
120
|
-
const
|
|
121
|
-
const code = fieldError?.code;
|
|
120
|
+
const code = (error.fieldErrors?.[0])?.code;
|
|
122
121
|
const errorProps = {
|
|
123
122
|
code,
|
|
124
123
|
message: error.message,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue9 from "vue";
|
|
2
2
|
import { PropType, SlotsType } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/form-validator/types.d.ts
|
|
5
5
|
type FormErrors = Record<string, string[]>;
|
|
6
|
-
interface FormRule {
|
|
7
|
-
validate: (value:
|
|
6
|
+
interface FormRule<T = any> {
|
|
7
|
+
validate: (value: T, form: Record<string, any>) => boolean;
|
|
8
8
|
message: string;
|
|
9
|
-
when?: (value:
|
|
9
|
+
when?: (value: T, form: Record<string, any>) => boolean;
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/form-validator/FormValidator.d.ts
|
|
@@ -23,7 +23,7 @@ declare class FormValidator {
|
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region src/form-validator/components/FormField.d.ts
|
|
26
|
-
declare const FormField:
|
|
26
|
+
declare const FormField: vue9.DefineComponent<vue9.ExtractPropTypes<{
|
|
27
27
|
id: {
|
|
28
28
|
type: StringConstructor;
|
|
29
29
|
required: true;
|
|
@@ -32,9 +32,9 @@ declare const FormField: vue15.DefineComponent<vue15.ExtractPropTypes<{
|
|
|
32
32
|
type: PropType<FormRule[]>;
|
|
33
33
|
default: () => never[];
|
|
34
34
|
};
|
|
35
|
-
}>, () =>
|
|
35
|
+
}>, () => vue9.VNode<vue9.RendererNode, vue9.RendererElement, {
|
|
36
36
|
[key: string]: any;
|
|
37
|
-
}>[], {}, {}, {},
|
|
37
|
+
}>[], {}, {}, {}, vue9.ComponentOptionsMixin, vue9.ComponentOptionsMixin, {}, string, vue9.PublicProps, Readonly<vue9.ExtractPropTypes<{
|
|
38
38
|
id: {
|
|
39
39
|
type: StringConstructor;
|
|
40
40
|
required: true;
|
|
@@ -44,25 +44,25 @@ declare const FormField: vue15.DefineComponent<vue15.ExtractPropTypes<{
|
|
|
44
44
|
default: () => never[];
|
|
45
45
|
};
|
|
46
46
|
}>> & Readonly<{}>, {
|
|
47
|
-
rules: FormRule[];
|
|
47
|
+
rules: FormRule<any>[];
|
|
48
48
|
}, SlotsType<{
|
|
49
49
|
default: {
|
|
50
50
|
error: string | null;
|
|
51
51
|
};
|
|
52
|
-
}>, {}, {}, string,
|
|
52
|
+
}>, {}, {}, string, vue9.ComponentProvideOptions, true, {}, any>;
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region src/form-validator/components/FormValidatorProvider.d.ts
|
|
55
55
|
interface FormValidatorProviderExposed {
|
|
56
56
|
formValidator: () => FormValidator;
|
|
57
57
|
}
|
|
58
|
-
declare const FormValidatorProvider:
|
|
58
|
+
declare const FormValidatorProvider: vue9.DefineComponent<vue9.ExtractPropTypes<{
|
|
59
59
|
errors: {
|
|
60
60
|
type: PropType<FormErrors>;
|
|
61
61
|
default: () => {};
|
|
62
62
|
};
|
|
63
|
-
}>, () =>
|
|
63
|
+
}>, () => vue9.VNode<vue9.RendererNode, vue9.RendererElement, {
|
|
64
64
|
[key: string]: any;
|
|
65
|
-
}>[], {}, {}, {},
|
|
65
|
+
}>[], {}, {}, {}, vue9.ComponentOptionsMixin, vue9.ComponentOptionsMixin, {}, string, vue9.PublicProps, Readonly<vue9.ExtractPropTypes<{
|
|
66
66
|
errors: {
|
|
67
67
|
type: PropType<FormErrors>;
|
|
68
68
|
default: () => {};
|
|
@@ -73,7 +73,7 @@ declare const FormValidatorProvider: vue15.DefineComponent<vue15.ExtractPropType
|
|
|
73
73
|
default: {
|
|
74
74
|
errors: FormErrors;
|
|
75
75
|
};
|
|
76
|
-
}>, {}, {}, string,
|
|
76
|
+
}>, {}, {}, string, vue9.ComponentProvideOptions, true, {}, any>;
|
|
77
77
|
//#endregion
|
|
78
78
|
//#region src/form-validator/useFormValidator.d.ts
|
|
79
79
|
declare function useFormValidator(): FormValidator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as graphql3 from "graphql";
|
|
2
2
|
|
|
3
3
|
//#region src/page/field/fragments.d.ts
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import * as graphql4 from "graphql";
|
|
|
6
6
|
* Page fields fragment requires explicit import image
|
|
7
7
|
* fields fragment `imageFields` from Image module.
|
|
8
8
|
*/
|
|
9
|
-
declare const pageFields:
|
|
9
|
+
declare const pageFields: graphql3.DocumentNode;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/page/types.d.ts
|
|
12
12
|
interface DataPage {
|
|
@@ -88,7 +88,7 @@ declare function pageTextField(fields: PageField[], key: string): string | null;
|
|
|
88
88
|
declare function pageImageFieldForBackground(fields: PageField[], key: string): string;
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/page/seo-meta/fragments.d.ts
|
|
91
|
-
declare const seoMetaFields: (dummyClass: string) =>
|
|
91
|
+
declare const seoMetaFields: (dummyClass: string) => graphql3.DocumentNode;
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/page/seo-meta/helpers.d.ts
|
|
94
94
|
type UseSeoMetaOptions = Partial<Omit<PageMeta, 'title'>> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue29 from "vue";
|
|
2
2
|
import { MaybeRefOrGetter } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/pagination-vue-client-side/types.d.ts
|
|
@@ -16,12 +16,12 @@ declare function usePagination(options: {
|
|
|
16
16
|
visiblePages?: MaybeRefOrGetter<number | undefined>;
|
|
17
17
|
onChange?: (page: number) => void;
|
|
18
18
|
}): {
|
|
19
|
-
items:
|
|
20
|
-
showPagination:
|
|
21
|
-
canFirst:
|
|
22
|
-
canPrev:
|
|
23
|
-
canNext:
|
|
24
|
-
canLast:
|
|
19
|
+
items: vue29.ComputedRef<number[]>;
|
|
20
|
+
showPagination: vue29.ComputedRef<boolean>;
|
|
21
|
+
canFirst: vue29.ComputedRef<boolean>;
|
|
22
|
+
canPrev: vue29.ComputedRef<boolean>;
|
|
23
|
+
canNext: vue29.ComputedRef<boolean>;
|
|
24
|
+
canLast: vue29.ComputedRef<boolean>;
|
|
25
25
|
gotoFirst: () => void;
|
|
26
26
|
gotoPrev: () => void;
|
|
27
27
|
gotoNext: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue0 from "vue";
|
|
2
2
|
import { MaybeRefOrGetter } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/pagination-vue-server-side/types.d.ts
|
|
@@ -16,16 +16,16 @@ declare function usePagination(options: {
|
|
|
16
16
|
perPage?: MaybeRefOrGetter<number | undefined>;
|
|
17
17
|
visiblePages?: MaybeRefOrGetter<number | undefined>;
|
|
18
18
|
}): {
|
|
19
|
-
items:
|
|
20
|
-
showPagination:
|
|
21
|
-
canFirst:
|
|
22
|
-
canPrev:
|
|
23
|
-
canNext:
|
|
24
|
-
canLast:
|
|
25
|
-
firstUrl:
|
|
26
|
-
prevUrl:
|
|
27
|
-
nextUrl:
|
|
28
|
-
lastUrl:
|
|
19
|
+
items: vue0.ComputedRef<number[]>;
|
|
20
|
+
showPagination: vue0.ComputedRef<boolean>;
|
|
21
|
+
canFirst: vue0.ComputedRef<boolean>;
|
|
22
|
+
canPrev: vue0.ComputedRef<boolean>;
|
|
23
|
+
canNext: vue0.ComputedRef<boolean>;
|
|
24
|
+
canLast: vue0.ComputedRef<boolean>;
|
|
25
|
+
firstUrl: vue0.ComputedRef<string>;
|
|
26
|
+
prevUrl: vue0.ComputedRef<string>;
|
|
27
|
+
nextUrl: vue0.ComputedRef<string>;
|
|
28
|
+
lastUrl: vue0.ComputedRef<string>;
|
|
29
29
|
getUrl: (page: number) => string;
|
|
30
30
|
};
|
|
31
31
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stephenchenorg/astro",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.4.0",
|
|
5
5
|
"description": "Stephenchenorg Astro 前端通用套件",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://stephenchenorg-astro.netlify.app",
|
|
@@ -20,43 +20,43 @@
|
|
|
20
20
|
],
|
|
21
21
|
"exports": {
|
|
22
22
|
"./api": {
|
|
23
|
-
"types": "./dist/api/index.d.
|
|
24
|
-
"import": "./dist/api/index.
|
|
23
|
+
"types": "./dist/api/index.d.mts",
|
|
24
|
+
"import": "./dist/api/index.mjs"
|
|
25
25
|
},
|
|
26
26
|
"./company-setting": {
|
|
27
|
-
"types": "./dist/company-setting/index.d.
|
|
28
|
-
"import": "./dist/company-setting/index.
|
|
27
|
+
"types": "./dist/company-setting/index.d.mts",
|
|
28
|
+
"import": "./dist/company-setting/index.mjs"
|
|
29
29
|
},
|
|
30
30
|
"./form-validator": {
|
|
31
|
-
"types": "./dist/form-validator/index.d.
|
|
32
|
-
"import": "./dist/form-validator/index.
|
|
31
|
+
"types": "./dist/form-validator/index.d.mts",
|
|
32
|
+
"import": "./dist/form-validator/index.mjs"
|
|
33
33
|
},
|
|
34
34
|
"./image": {
|
|
35
|
-
"types": "./dist/image/index.d.
|
|
36
|
-
"import": "./dist/image/index.
|
|
35
|
+
"types": "./dist/image/index.d.mts",
|
|
36
|
+
"import": "./dist/image/index.mjs"
|
|
37
37
|
},
|
|
38
38
|
"./image/components/Image.astro": "./dist/image/components/Image.astro",
|
|
39
39
|
"./image/components/ResponsiveImage.astro": "./dist/image/components/ResponsiveImage.astro",
|
|
40
40
|
"./page": {
|
|
41
|
-
"types": "./dist/page/index.d.
|
|
42
|
-
"import": "./dist/page/index.
|
|
41
|
+
"types": "./dist/page/index.d.mts",
|
|
42
|
+
"import": "./dist/page/index.mjs"
|
|
43
43
|
},
|
|
44
44
|
"./page/components/PageFieldRender.astro": "./dist/page/components/PageFieldRender.astro",
|
|
45
45
|
"./pagination-astro": {
|
|
46
|
-
"types": "./dist/pagination-astro/index.d.
|
|
47
|
-
"import": "./dist/pagination-astro/index.
|
|
46
|
+
"types": "./dist/pagination-astro/index.d.mts",
|
|
47
|
+
"import": "./dist/pagination-astro/index.mjs"
|
|
48
48
|
},
|
|
49
49
|
"./pagination-vue-client-side": {
|
|
50
|
-
"types": "./dist/pagination-vue-client-side/index.d.
|
|
51
|
-
"import": "./dist/pagination-vue-client-side/index.
|
|
50
|
+
"types": "./dist/pagination-vue-client-side/index.d.mts",
|
|
51
|
+
"import": "./dist/pagination-vue-client-side/index.mjs"
|
|
52
52
|
},
|
|
53
53
|
"./pagination-vue-server-side": {
|
|
54
|
-
"types": "./dist/pagination-vue-server-side/index.d.
|
|
55
|
-
"import": "./dist/pagination-vue-server-side/index.
|
|
54
|
+
"types": "./dist/pagination-vue-server-side/index.d.mts",
|
|
55
|
+
"import": "./dist/pagination-vue-server-side/index.mjs"
|
|
56
56
|
},
|
|
57
57
|
"./query-params": {
|
|
58
|
-
"types": "./dist/query-params/index.d.
|
|
59
|
-
"import": "./dist/query-params/index.
|
|
58
|
+
"types": "./dist/query-params/index.d.mts",
|
|
59
|
+
"import": "./dist/query-params/index.mjs"
|
|
60
60
|
},
|
|
61
61
|
"./query-params/components/ProvideUrlConfig.astro": "./dist/query-params/components/ProvideUrlConfig.astro"
|
|
62
62
|
},
|
|
@@ -96,23 +96,23 @@
|
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
98
98
|
"awesome-graphql-client": "^2.1.0",
|
|
99
|
-
"graphql": "^16.
|
|
99
|
+
"graphql": "^16.12.0",
|
|
100
100
|
"graphql-tag": "^2.12.6",
|
|
101
101
|
"nanostores": "^1.0.1",
|
|
102
|
-
"query-string": "^9.
|
|
102
|
+
"query-string": "^9.3.1"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@astrojs/check": "^0.9.
|
|
106
|
-
"@astrojs/vue": "^5.1.
|
|
107
|
-
"@ycs77/eslint-config": "^
|
|
108
|
-
"astro": "^5.
|
|
109
|
-
"bumpp": "^10.
|
|
110
|
-
"eslint": "^9.
|
|
111
|
-
"eslint-plugin-astro": "^1.
|
|
112
|
-
"eslint-plugin-astro-explicit-wrapper": "^1.0.
|
|
113
|
-
"tsdown": "^0.
|
|
114
|
-
"typescript": "^5.9.
|
|
115
|
-
"vitest": "^
|
|
116
|
-
"vue": "^3.5.
|
|
105
|
+
"@astrojs/check": "^0.9.5",
|
|
106
|
+
"@astrojs/vue": "^5.1.3",
|
|
107
|
+
"@ycs77/eslint-config": "^6.0.0",
|
|
108
|
+
"astro": "^5.15.9",
|
|
109
|
+
"bumpp": "^10.3.1",
|
|
110
|
+
"eslint": "^9.39.1",
|
|
111
|
+
"eslint-plugin-astro": "^1.5.0",
|
|
112
|
+
"eslint-plugin-astro-explicit-wrapper": "^1.0.5",
|
|
113
|
+
"tsdown": "^0.16.5",
|
|
114
|
+
"typescript": "^5.9.3",
|
|
115
|
+
"vitest": "^4.0.10",
|
|
116
|
+
"vue": "^3.5.24"
|
|
117
117
|
}
|
|
118
118
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|