@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.
@@ -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 fieldError = error.fieldErrors?.[0];
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 vue15 from "vue";
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: any, form: Record<string, any>) => boolean;
6
+ interface FormRule<T = any> {
7
+ validate: (value: T, form: Record<string, any>) => boolean;
8
8
  message: string;
9
- when?: (value: any, form: Record<string, any>) => boolean;
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: vue15.DefineComponent<vue15.ExtractPropTypes<{
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
- }>, () => vue15.VNode<vue15.RendererNode, vue15.RendererElement, {
35
+ }>, () => vue9.VNode<vue9.RendererNode, vue9.RendererElement, {
36
36
  [key: string]: any;
37
- }>[], {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {}, string, vue15.PublicProps, Readonly<vue15.ExtractPropTypes<{
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, vue15.ComponentProvideOptions, true, {}, any>;
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: vue15.DefineComponent<vue15.ExtractPropTypes<{
58
+ declare const FormValidatorProvider: vue9.DefineComponent<vue9.ExtractPropTypes<{
59
59
  errors: {
60
60
  type: PropType<FormErrors>;
61
61
  default: () => {};
62
62
  };
63
- }>, () => vue15.VNode<vue15.RendererNode, vue15.RendererElement, {
63
+ }>, () => vue9.VNode<vue9.RendererNode, vue9.RendererElement, {
64
64
  [key: string]: any;
65
- }>[], {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {}, string, vue15.PublicProps, Readonly<vue15.ExtractPropTypes<{
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, vue15.ComponentProvideOptions, true, {}, any>;
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 graphql4 from "graphql";
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: graphql4.DocumentNode;
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) => graphql4.DocumentNode;
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 vue0 from "vue";
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: 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>;
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 vue5 from "vue";
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: vue5.ComputedRef<number[]>;
20
- showPagination: vue5.ComputedRef<boolean>;
21
- canFirst: vue5.ComputedRef<boolean>;
22
- canPrev: vue5.ComputedRef<boolean>;
23
- canNext: vue5.ComputedRef<boolean>;
24
- canLast: vue5.ComputedRef<boolean>;
25
- firstUrl: vue5.ComputedRef<string>;
26
- prevUrl: vue5.ComputedRef<string>;
27
- nextUrl: vue5.ComputedRef<string>;
28
- lastUrl: vue5.ComputedRef<string>;
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.3.0",
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.ts",
24
- "import": "./dist/api/index.js"
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.ts",
28
- "import": "./dist/company-setting/index.js"
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.ts",
32
- "import": "./dist/form-validator/index.js"
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.ts",
36
- "import": "./dist/image/index.js"
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.ts",
42
- "import": "./dist/page/index.js"
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.ts",
47
- "import": "./dist/pagination-astro/index.js"
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.ts",
51
- "import": "./dist/pagination-vue-client-side/index.js"
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.ts",
55
- "import": "./dist/pagination-vue-server-side/index.js"
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.ts",
59
- "import": "./dist/query-params/index.js"
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.11.0",
99
+ "graphql": "^16.12.0",
100
100
  "graphql-tag": "^2.12.6",
101
101
  "nanostores": "^1.0.1",
102
- "query-string": "^9.2.2"
102
+ "query-string": "^9.3.1"
103
103
  },
104
104
  "devDependencies": {
105
- "@astrojs/check": "^0.9.4",
106
- "@astrojs/vue": "^5.1.0",
107
- "@ycs77/eslint-config": "^5.0.1",
108
- "astro": "^5.13.4",
109
- "bumpp": "^10.2.3",
110
- "eslint": "^9.34.0",
111
- "eslint-plugin-astro": "^1.3.1",
112
- "eslint-plugin-astro-explicit-wrapper": "^1.0.3",
113
- "tsdown": "^0.14.2",
114
- "typescript": "^5.9.2",
115
- "vitest": "^3.2.4",
116
- "vue": "^3.5.20"
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