@stephenchenorg/astro 8.4.0 → 8.5.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.
@@ -1,4 +1,4 @@
1
- import * as graphql0 from "graphql";
1
+ import * as graphql2 from "graphql";
2
2
 
3
3
  //#region src/company-setting/types.d.ts
4
4
  interface DataCompanySetting {
@@ -42,6 +42,6 @@ declare function createCompanySetting(companySetting: Partial<CompanySetting>):
42
42
  };
43
43
  //#endregion
44
44
  //#region src/company-setting/fragments.d.ts
45
- declare const companySettingFields: graphql0.DocumentNode;
45
+ declare const companySettingFields: graphql2.DocumentNode;
46
46
  //#endregion
47
47
  export { CompanySetting, DataCompanySetting, companySettingFields, createCompanySetting };
@@ -1,4 +1,4 @@
1
- import * as vue9 from "vue";
1
+ import * as vue15 from "vue";
2
2
  import { PropType, SlotsType } from "vue";
3
3
 
4
4
  //#region src/form-validator/types.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: vue9.DefineComponent<vue9.ExtractPropTypes<{
26
+ declare const FormField: vue15.DefineComponent<vue15.ExtractPropTypes<{
27
27
  id: {
28
28
  type: StringConstructor;
29
29
  required: true;
@@ -32,9 +32,9 @@ declare const FormField: vue9.DefineComponent<vue9.ExtractPropTypes<{
32
32
  type: PropType<FormRule[]>;
33
33
  default: () => never[];
34
34
  };
35
- }>, () => vue9.VNode<vue9.RendererNode, vue9.RendererElement, {
35
+ }>, () => vue15.VNode<vue15.RendererNode, vue15.RendererElement, {
36
36
  [key: string]: any;
37
- }>[], {}, {}, {}, vue9.ComponentOptionsMixin, vue9.ComponentOptionsMixin, {}, string, vue9.PublicProps, Readonly<vue9.ExtractPropTypes<{
37
+ }>[], {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {}, string, vue15.PublicProps, Readonly<vue15.ExtractPropTypes<{
38
38
  id: {
39
39
  type: StringConstructor;
40
40
  required: true;
@@ -49,20 +49,20 @@ declare const FormField: vue9.DefineComponent<vue9.ExtractPropTypes<{
49
49
  default: {
50
50
  error: string | null;
51
51
  };
52
- }>, {}, {}, string, vue9.ComponentProvideOptions, true, {}, any>;
52
+ }>, {}, {}, string, vue15.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: vue9.DefineComponent<vue9.ExtractPropTypes<{
58
+ declare const FormValidatorProvider: vue15.DefineComponent<vue15.ExtractPropTypes<{
59
59
  errors: {
60
60
  type: PropType<FormErrors>;
61
61
  default: () => {};
62
62
  };
63
- }>, () => vue9.VNode<vue9.RendererNode, vue9.RendererElement, {
63
+ }>, () => vue15.VNode<vue15.RendererNode, vue15.RendererElement, {
64
64
  [key: string]: any;
65
- }>[], {}, {}, {}, vue9.ComponentOptionsMixin, vue9.ComponentOptionsMixin, {}, string, vue9.PublicProps, Readonly<vue9.ExtractPropTypes<{
65
+ }>[], {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {}, string, vue15.PublicProps, Readonly<vue15.ExtractPropTypes<{
66
66
  errors: {
67
67
  type: PropType<FormErrors>;
68
68
  default: () => {};
@@ -72,8 +72,9 @@ declare const FormValidatorProvider: vue9.DefineComponent<vue9.ExtractPropTypes<
72
72
  }, SlotsType<{
73
73
  default: {
74
74
  errors: FormErrors;
75
+ hasErrors: boolean;
75
76
  };
76
- }>, {}, {}, string, vue9.ComponentProvideOptions, true, {}, any>;
77
+ }>, {}, {}, string, vue15.ComponentProvideOptions, true, {}, any>;
77
78
  //#endregion
78
79
  //#region src/form-validator/useFormValidator.d.ts
79
80
  declare function useFormValidator(): FormValidator;
@@ -1,4 +1,4 @@
1
- import { defineComponent, inject, onMounted, provide, ref, toRaw, watch } from "vue";
1
+ import { defineComponent, inject, onMounted, provide, ref, shallowRef, toRaw, watch } from "vue";
2
2
 
3
3
  //#region src/form-validator/injectionKey.ts
4
4
  const formValidatorInjectionKey = Symbol("");
@@ -94,7 +94,13 @@ const FormValidatorProvider = defineComponent({
94
94
  slots: Object,
95
95
  setup(props, { slots, expose }) {
96
96
  const formValidator = new FormValidator();
97
+ const errors = shallowRef({});
98
+ const hasErrors = ref(false);
97
99
  provide(formValidatorInjectionKey, formValidator);
100
+ formValidator.onErrorsUpdated((_errors) => {
101
+ hasErrors.value = Object.keys(_errors).length > 0;
102
+ errors.value = structuredClone(_errors);
103
+ });
98
104
  onMounted(() => {
99
105
  formValidator.setErrors(props.errors);
100
106
  });
@@ -102,7 +108,10 @@ const FormValidatorProvider = defineComponent({
102
108
  formValidator.setErrors(props.errors);
103
109
  }, { deep: true });
104
110
  expose({ formValidator: () => formValidator });
105
- return () => slots.default?.({ errors: formValidator.errors });
111
+ return () => slots.default?.({
112
+ errors: errors.value,
113
+ hasErrors: hasErrors.value
114
+ });
106
115
  }
107
116
  });
108
117
  var FormValidatorProvider_default = FormValidatorProvider;
@@ -1,4 +1,4 @@
1
- import * as graphql3 from "graphql";
1
+ import * as graphql4 from "graphql";
2
2
 
3
3
  //#region src/page/field/fragments.d.ts
4
4
 
@@ -6,7 +6,7 @@ import * as graphql3 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: graphql3.DocumentNode;
9
+ declare const pageFields: graphql4.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) => graphql3.DocumentNode;
91
+ declare const seoMetaFields: (dummyClass: string) => graphql4.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 vue29 from "vue";
1
+ import * as vue0 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: 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>;
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
25
  gotoFirst: () => void;
26
26
  gotoPrev: () => void;
27
27
  gotoNext: () => void;
@@ -1,4 +1,4 @@
1
- import * as vue0 from "vue";
1
+ import * as vue5 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: 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>;
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>;
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.0",
4
+ "version": "8.5.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.mts",
24
- "import": "./dist/api/index.mjs"
23
+ "types": "./dist/api/index.d.ts",
24
+ "import": "./dist/api/index.js"
25
25
  },
26
26
  "./company-setting": {
27
- "types": "./dist/company-setting/index.d.mts",
28
- "import": "./dist/company-setting/index.mjs"
27
+ "types": "./dist/company-setting/index.d.ts",
28
+ "import": "./dist/company-setting/index.js"
29
29
  },
30
30
  "./form-validator": {
31
- "types": "./dist/form-validator/index.d.mts",
32
- "import": "./dist/form-validator/index.mjs"
31
+ "types": "./dist/form-validator/index.d.ts",
32
+ "import": "./dist/form-validator/index.js"
33
33
  },
34
34
  "./image": {
35
- "types": "./dist/image/index.d.mts",
36
- "import": "./dist/image/index.mjs"
35
+ "types": "./dist/image/index.d.ts",
36
+ "import": "./dist/image/index.js"
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.mts",
42
- "import": "./dist/page/index.mjs"
41
+ "types": "./dist/page/index.d.ts",
42
+ "import": "./dist/page/index.js"
43
43
  },
44
44
  "./page/components/PageFieldRender.astro": "./dist/page/components/PageFieldRender.astro",
45
45
  "./pagination-astro": {
46
- "types": "./dist/pagination-astro/index.d.mts",
47
- "import": "./dist/pagination-astro/index.mjs"
46
+ "types": "./dist/pagination-astro/index.d.ts",
47
+ "import": "./dist/pagination-astro/index.js"
48
48
  },
49
49
  "./pagination-vue-client-side": {
50
- "types": "./dist/pagination-vue-client-side/index.d.mts",
51
- "import": "./dist/pagination-vue-client-side/index.mjs"
50
+ "types": "./dist/pagination-vue-client-side/index.d.ts",
51
+ "import": "./dist/pagination-vue-client-side/index.js"
52
52
  },
53
53
  "./pagination-vue-server-side": {
54
- "types": "./dist/pagination-vue-server-side/index.d.mts",
55
- "import": "./dist/pagination-vue-server-side/index.mjs"
54
+ "types": "./dist/pagination-vue-server-side/index.d.ts",
55
+ "import": "./dist/pagination-vue-server-side/index.js"
56
56
  },
57
57
  "./query-params": {
58
- "types": "./dist/query-params/index.d.mts",
59
- "import": "./dist/query-params/index.mjs"
58
+ "types": "./dist/query-params/index.d.ts",
59
+ "import": "./dist/query-params/index.js"
60
60
  },
61
61
  "./query-params/components/ProvideUrlConfig.astro": "./dist/query-params/components/ProvideUrlConfig.astro"
62
62
  },
@@ -104,7 +104,7 @@
104
104
  "devDependencies": {
105
105
  "@astrojs/check": "^0.9.5",
106
106
  "@astrojs/vue": "^5.1.3",
107
- "@ycs77/eslint-config": "^6.0.0",
107
+ "@ycs77/eslint-config": "^6.1.0",
108
108
  "astro": "^5.15.9",
109
109
  "bumpp": "^10.3.1",
110
110
  "eslint": "^9.39.1",
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