@stephenchenorg/astro 8.2.0 → 8.3.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 vue25 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: vue25.DefineComponent<vue25.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: vue25.DefineComponent<vue25.ExtractPropTypes<{
32
32
  type: PropType<FormRule[]>;
33
33
  default: () => never[];
34
34
  };
35
- }>, () => vue25.VNode<vue25.RendererNode, vue25.RendererElement, {
35
+ }>, () => vue15.VNode<vue15.RendererNode, vue15.RendererElement, {
36
36
  [key: string]: any;
37
- }>[], {}, {}, {}, vue25.ComponentOptionsMixin, vue25.ComponentOptionsMixin, {}, string, vue25.PublicProps, Readonly<vue25.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: vue25.DefineComponent<vue25.ExtractPropTypes<{
49
49
  default: {
50
50
  error: string | null;
51
51
  };
52
- }>, {}, {}, string, vue25.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: vue25.DefineComponent<vue25.ExtractPropTypes<{
58
+ declare const FormValidatorProvider: vue15.DefineComponent<vue15.ExtractPropTypes<{
59
59
  errors: {
60
60
  type: PropType<FormErrors>;
61
61
  default: () => {};
62
62
  };
63
- }>, () => vue25.VNode<vue25.RendererNode, vue25.RendererElement, {
63
+ }>, () => vue15.VNode<vue15.RendererNode, vue15.RendererElement, {
64
64
  [key: string]: any;
65
- }>[], {}, {}, {}, vue25.ComponentOptionsMixin, vue25.ComponentOptionsMixin, {}, string, vue25.PublicProps, Readonly<vue25.ExtractPropTypes<{
65
+ }>[], {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {}, string, vue15.PublicProps, Readonly<vue15.ExtractPropTypes<{
66
66
  errors: {
67
67
  type: PropType<FormErrors>;
68
68
  default: () => {};
@@ -73,7 +73,7 @@ declare const FormValidatorProvider: vue25.DefineComponent<vue25.ExtractPropType
73
73
  default: {
74
74
  errors: FormErrors;
75
75
  };
76
- }>, {}, {}, string, vue25.ComponentProvideOptions, true, {}, any>;
76
+ }>, {}, {}, string, vue15.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 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 vue9 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: vue9.ComputedRef<number[]>;
20
- showPagination: vue9.ComputedRef<boolean>;
21
- canFirst: vue9.ComputedRef<boolean>;
22
- canPrev: vue9.ComputedRef<boolean>;
23
- canNext: vue9.ComputedRef<boolean>;
24
- canLast: vue9.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
@@ -22,6 +22,7 @@ declare global {
22
22
  }
23
23
  }
24
24
  interface QueryParamsUrlOptions {
25
+ mergeArray?: string[];
25
26
  clear?: boolean;
26
27
  transformParams?: (params: Record<string, any>) => Record<string, any>;
27
28
  }
@@ -29,7 +30,10 @@ declare function queryParamsUrl(additionalParams: Record<string, any>, urlConfig
29
30
  declare function parseQueryParams(search: string): qs.ParsedQuery<string>;
30
31
  //#endregion
31
32
  //#region src/query-params/utils.d.ts
32
- declare function mergeUrlParams<Params extends Record<string, any> = Record<string, any>>(baseParams: Params, userParams: Partial<Params>): Params;
33
+ interface MergeUrlParamsOptions {
34
+ mergeArray?: string[];
35
+ }
36
+ declare function mergeUrlParams<Params extends Record<string, any> = Record<string, any>>(baseParams: Params, userParams: Partial<Params>, options?: MergeUrlParamsOptions): Params;
33
37
  declare function cleanParams(params: Record<string, any>, defaultParams: Record<string, any>): Record<string, any>;
34
38
  //#endregion
35
- export { QueryParamsUrlOptions, UrlConfig, cleanParams, createUrlConfig, mergeUrlParams, parseQueryParams, queryParamsUrl, urlConfigStore };
39
+ export { MergeUrlParamsOptions, QueryParamsUrlOptions, UrlConfig, cleanParams, createUrlConfig, mergeUrlParams, parseQueryParams, queryParamsUrl, urlConfigStore };
@@ -17,10 +17,12 @@ const urlConfigStore = atom({
17
17
 
18
18
  //#endregion
19
19
  //#region src/query-params/utils.ts
20
- function mergeUrlParams(baseParams, userParams) {
20
+ function mergeUrlParams(baseParams, userParams, options = {}) {
21
+ const { mergeArray = [] } = options;
21
22
  return Object.keys(baseParams).reduce((result, key) => {
22
23
  if (userParams[key] === null) result[key] = null;
23
- else if (Array.isArray(baseParams[key])) result[key] = Array.from(new Set([...baseParams[key], ...userParams[key] || []]));
24
+ else if (Array.isArray(baseParams[key])) if (mergeArray.includes(key)) result[key] = Array.from(new Set([...baseParams[key], ...userParams[key] || []]));
25
+ else result[key] = userParams[key] || baseParams[key] || [];
24
26
  else result[key] = typeof userParams[key] !== "undefined" ? userParams[key] : baseParams[key];
25
27
  return result;
26
28
  }, {});
@@ -39,11 +41,11 @@ function queryParamsUrl(additionalParams, urlConfig = {
39
41
  baseUrl: "",
40
42
  params: {}
41
43
  }, options = {}) {
42
- const { clear = false, transformParams } = options;
44
+ const { mergeArray = [], clear = false, transformParams } = options;
43
45
  const config = typeof window !== "undefined" ? urlConfigStore.get() : urlConfig;
44
46
  let params = {};
45
47
  if (!clear) {
46
- params = mergeUrlParams(config.params, additionalParams);
48
+ params = mergeUrlParams(config.params, additionalParams, { mergeArray });
47
49
  if (transformParams) params = transformParams(params);
48
50
  params = cleanParams(params, config.defaultParams || {});
49
51
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stephenchenorg/astro",
3
3
  "type": "module",
4
- "version": "8.2.0",
4
+ "version": "8.3.0",
5
5
  "description": "Stephenchenorg Astro 前端通用套件",
6
6
  "license": "MIT",
7
7
  "homepage": "https://stephenchenorg-astro.netlify.app",