@stephenchenorg/astro 5.0.1 → 6.0.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.d.ts +76 -3
- package/dist/api/index.js +140 -3
- package/dist/company-setting/index.d.ts +47 -3
- package/dist/company-setting/index.js +47 -3
- package/dist/form-validator/index.d.ts +72 -6
- package/dist/form-validator/index.js +106 -5
- package/dist/image/index.d.ts +16 -4
- package/dist/image/index.js +30 -4
- package/dist/page/components/PageFieldRender.astro +3 -3
- package/dist/page/index.d.ts +101 -4
- package/dist/page/index.js +88 -4
- package/dist/pagination-astro/index.d.ts +30 -2
- package/dist/pagination-astro/index.js +37 -2
- package/dist/pagination-vue/index.d.ts +33 -2
- package/dist/pagination-vue/index.js +44 -2
- package/dist/product-variant/index.d.ts +69 -2
- package/dist/product-variant/index.js +57 -2
- package/dist/query-params/components/ProvideUrlConfig.astro +1 -2
- package/dist/query-params/index.d.ts +35 -6
- package/dist/query-params/index.js +62 -6
- package/package.json +10 -6
- package/dist/api/error.d.ts +0 -54
- package/dist/api/error.js +0 -97
- package/dist/api/errorResponse.d.ts +0 -1
- package/dist/api/errorResponse.js +0 -9
- package/dist/api/fetch.d.ts +0 -13
- package/dist/api/fetch.js +0 -49
- package/dist/company-setting/create.d.ts +0 -18
- package/dist/company-setting/create.js +0 -19
- package/dist/company-setting/fragments.d.ts +0 -1
- package/dist/company-setting/fragments.js +0 -20
- package/dist/company-setting/types.d.ts +0 -20
- package/dist/company-setting/types.js +0 -0
- package/dist/form-validator/FormValidator.d.ts +0 -12
- package/dist/form-validator/FormValidator.js +0 -47
- package/dist/form-validator/components/FormField.vue +0 -30
- package/dist/form-validator/components/FormValidatorProvider.d.ts +0 -22
- package/dist/form-validator/components/FormValidatorProvider.js +0 -24
- package/dist/form-validator/injectionKey.d.ts +0 -3
- package/dist/form-validator/injectionKey.js +0 -1
- package/dist/form-validator/types.d.ts +0 -5
- package/dist/form-validator/types.js +0 -0
- package/dist/image/fragments.d.ts +0 -3
- package/dist/image/fragments.js +0 -25
- package/dist/image/types.d.ts +0 -6
- package/dist/image/types.js +0 -0
- package/dist/page/field/fragments.d.ts +0 -5
- package/dist/page/field/fragments.js +0 -23
- package/dist/page/field/helpers.d.ts +0 -7
- package/dist/page/field/helpers.js +0 -20
- package/dist/page/field/index.d.ts +0 -2
- package/dist/page/field/index.js +0 -2
- package/dist/page/seo-meta/fragments.d.ts +0 -1
- package/dist/page/seo-meta/fragments.js +0 -14
- package/dist/page/seo-meta/helpers.d.ts +0 -7
- package/dist/page/seo-meta/helpers.js +0 -14
- package/dist/page/seo-meta/index.d.ts +0 -2
- package/dist/page/seo-meta/index.js +0 -2
- package/dist/page/types.d.ts +0 -69
- package/dist/page/types.js +0 -0
- package/dist/pagination-astro/types.d.ts +0 -5
- package/dist/pagination-astro/types.js +0 -0
- package/dist/pagination-astro/usePagination.d.ts +0 -20
- package/dist/pagination-astro/usePagination.js +0 -42
- package/dist/pagination-vue/types.d.ts +0 -5
- package/dist/pagination-vue/types.js +0 -0
- package/dist/pagination-vue/usePagination.d.ts +0 -21
- package/dist/pagination-vue/usePagination.js +0 -44
- package/dist/product-variant/ProductVariantSelector.d.ts +0 -42
- package/dist/product-variant/ProductVariantSelector.js +0 -52
- package/dist/product-variant/types.d.ts +0 -20
- package/dist/product-variant/types.js +0 -0
- package/dist/query-params/config.d.ts +0 -2
- package/dist/query-params/config.js +0 -3
- package/dist/query-params/store.d.ts +0 -2
- package/dist/query-params/store.js +0 -7
- package/dist/query-params/types.d.ts +0 -6
- package/dist/query-params/types.js +0 -0
- package/dist/query-params/url.d.ts +0 -13
- package/dist/query-params/url.js +0 -30
- package/dist/query-params/utils.d.ts +0 -2
- package/dist/query-params/utils.js +0 -21
package/dist/api/error.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
export class GraphQLRequestError extends Error {
|
|
2
|
-
type = "GraphQLRequestError";
|
|
3
|
-
name = "GraphQLRequestError";
|
|
4
|
-
title = "GraphQL request error.";
|
|
5
|
-
code;
|
|
6
|
-
originalMessage;
|
|
7
|
-
query;
|
|
8
|
-
variables;
|
|
9
|
-
extensions;
|
|
10
|
-
fieldErrors;
|
|
11
|
-
constructor(props, options) {
|
|
12
|
-
const { code, message, query, variables, extensions, fieldErrors } = props;
|
|
13
|
-
super("GraphQL request error.", options);
|
|
14
|
-
const originalStack = this.stack;
|
|
15
|
-
this.title = "GraphQL request error.";
|
|
16
|
-
this.code = code;
|
|
17
|
-
this.originalMessage = message;
|
|
18
|
-
this.query = query;
|
|
19
|
-
this.variables = variables;
|
|
20
|
-
this.extensions = extensions;
|
|
21
|
-
this.fieldErrors = fieldErrors;
|
|
22
|
-
this.message = this.buildMessage();
|
|
23
|
-
this.stack = originalStack;
|
|
24
|
-
}
|
|
25
|
-
isNotFound() {
|
|
26
|
-
return this.originalMessage.includes("Http Status 404");
|
|
27
|
-
}
|
|
28
|
-
buildMessage() {
|
|
29
|
-
let message = `${this.originalMessage}
|
|
30
|
-
`;
|
|
31
|
-
if (this.code) {
|
|
32
|
-
message += "\n";
|
|
33
|
-
message += `[code]
|
|
34
|
-
${this.code}
|
|
35
|
-
`;
|
|
36
|
-
}
|
|
37
|
-
if (this.extensions) {
|
|
38
|
-
if (this.extensions.debugMessage) {
|
|
39
|
-
message += "\n";
|
|
40
|
-
message += `${this.extensions.debugMessage}
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
if (this.extensions.file || this.extensions.line || this.extensions.trace) {
|
|
44
|
-
message += "\n";
|
|
45
|
-
message += "[stacktrace]\n";
|
|
46
|
-
if (this.extensions.file) {
|
|
47
|
-
message += `file: ${this.extensions.file}
|
|
48
|
-
`;
|
|
49
|
-
}
|
|
50
|
-
if (this.extensions.line) {
|
|
51
|
-
message += `line: ${this.extensions.line}
|
|
52
|
-
`;
|
|
53
|
-
}
|
|
54
|
-
if (this.extensions.trace && Array.isArray(this.extensions.trace)) {
|
|
55
|
-
message += "trace:\n";
|
|
56
|
-
for (const trace of this.extensions.trace.slice(0, 3)) {
|
|
57
|
-
message += ` - file: ${trace.file}
|
|
58
|
-
`;
|
|
59
|
-
message += ` line: ${trace.line}
|
|
60
|
-
`;
|
|
61
|
-
message += ` call: ${trace.call}
|
|
62
|
-
`;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (this.query) {
|
|
68
|
-
message += "\n";
|
|
69
|
-
message += `[query]
|
|
70
|
-
${this.query}
|
|
71
|
-
`;
|
|
72
|
-
}
|
|
73
|
-
if (this.variables) {
|
|
74
|
-
message += "\n";
|
|
75
|
-
message += `[variables]
|
|
76
|
-
${JSON.stringify(this.variables, null, 2)}
|
|
77
|
-
`;
|
|
78
|
-
}
|
|
79
|
-
return message;
|
|
80
|
-
}
|
|
81
|
-
static is(err) {
|
|
82
|
-
return err.type === "GraphQLRequestError";
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
export class GraphQLNotFoundError extends GraphQLRequestError {
|
|
86
|
-
type = "GraphQLNotFoundError";
|
|
87
|
-
name = "GraphQLNotFoundError";
|
|
88
|
-
}
|
|
89
|
-
export class GraphQLValidationError extends GraphQLRequestError {
|
|
90
|
-
type = "GraphQLValidationError";
|
|
91
|
-
name = "GraphQLValidationError";
|
|
92
|
-
errors;
|
|
93
|
-
constructor(props, options) {
|
|
94
|
-
super(props, options);
|
|
95
|
-
this.errors = this.fieldErrors?.[0]?.data?.validation || {};
|
|
96
|
-
}
|
|
97
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function handleErrorResponse(e: unknown): Response | undefined;
|
package/dist/api/fetch.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
2
|
-
import type { APIContext } from 'astro';
|
|
3
|
-
export interface CreateGraphQLAPIOptions {
|
|
4
|
-
endpoint: string;
|
|
5
|
-
defaultVariables?: Record<string, any> | ((astroContext?: APIContext) => Record<string, any>);
|
|
6
|
-
fetchOptions?: RequestInit | ((astroContext?: APIContext) => RequestInit);
|
|
7
|
-
}
|
|
8
|
-
export declare function createGraphQLAPI(globalOptions: CreateGraphQLAPIOptions): <TData extends Record<string, any>, TVariables extends Record<string, any> = Record<string, any>>(query: TypedDocumentNode<TData, TVariables>, options?: {
|
|
9
|
-
variables?: TVariables;
|
|
10
|
-
fetchOptions?: RequestInit;
|
|
11
|
-
Astro?: APIContext;
|
|
12
|
-
}) => Promise<TData>;
|
|
13
|
-
export { gql } from 'graphql-tag';
|
package/dist/api/fetch.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { AwesomeGraphQLClient, GraphQLRequestError as AwesomeGraphQLRequestError } from "awesome-graphql-client";
|
|
2
|
-
import { print } from "graphql/language/printer";
|
|
3
|
-
import { GraphQLNotFoundError, GraphQLRequestError, GraphQLValidationError } from "./error.js";
|
|
4
|
-
export function createGraphQLAPI(globalOptions) {
|
|
5
|
-
const client = new AwesomeGraphQLClient({
|
|
6
|
-
endpoint: globalOptions.endpoint,
|
|
7
|
-
formatQuery: (query) => print(query)
|
|
8
|
-
});
|
|
9
|
-
return function graphQLAPI(query, options) {
|
|
10
|
-
const { variables, fetchOptions, Astro: astroContext } = options || {};
|
|
11
|
-
const defaultVariables = typeof globalOptions.defaultVariables === "function" ? globalOptions.defaultVariables(astroContext) : globalOptions.defaultVariables;
|
|
12
|
-
const defaultFetchOptions = typeof globalOptions.fetchOptions === "function" ? globalOptions.fetchOptions(astroContext) : globalOptions.fetchOptions;
|
|
13
|
-
return new Promise((resolve, reject) => {
|
|
14
|
-
client.request(query, {
|
|
15
|
-
...defaultVariables,
|
|
16
|
-
...variables
|
|
17
|
-
}, {
|
|
18
|
-
...defaultFetchOptions,
|
|
19
|
-
...fetchOptions,
|
|
20
|
-
headers: {
|
|
21
|
-
...defaultFetchOptions?.headers,
|
|
22
|
-
...fetchOptions?.headers
|
|
23
|
-
}
|
|
24
|
-
}).then((data) => resolve(data)).catch((error) => {
|
|
25
|
-
if (error instanceof AwesomeGraphQLRequestError) {
|
|
26
|
-
const fieldError = error.fieldErrors?.[0];
|
|
27
|
-
const code = fieldError?.code;
|
|
28
|
-
const errorProps = {
|
|
29
|
-
code,
|
|
30
|
-
message: error.message,
|
|
31
|
-
query: error.query,
|
|
32
|
-
variables: error.variables,
|
|
33
|
-
extensions: error.extensions,
|
|
34
|
-
fieldErrors: error.fieldErrors
|
|
35
|
-
};
|
|
36
|
-
if (code === 404) {
|
|
37
|
-
reject(new GraphQLNotFoundError(errorProps));
|
|
38
|
-
} else if (code === 422) {
|
|
39
|
-
reject(new GraphQLValidationError(errorProps));
|
|
40
|
-
}
|
|
41
|
-
reject(new GraphQLRequestError(errorProps));
|
|
42
|
-
} else {
|
|
43
|
-
reject(error);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export { gql } from "graphql-tag";
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export declare const companySettingFields: import("graphql").DocumentNode;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { gql } from "graphql-tag";
|
|
2
|
-
export const companySettingFields = gql`
|
|
3
|
-
fragment CompanySettingFields on CompanySetting {
|
|
4
|
-
lang
|
|
5
|
-
name
|
|
6
|
-
description
|
|
7
|
-
logo
|
|
8
|
-
address_1
|
|
9
|
-
address_2
|
|
10
|
-
email_1
|
|
11
|
-
email_2
|
|
12
|
-
fb_link
|
|
13
|
-
ig_link
|
|
14
|
-
line_link
|
|
15
|
-
phone_1
|
|
16
|
-
phone_2
|
|
17
|
-
twitter_link
|
|
18
|
-
threads_link
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface DataCompanySetting {
|
|
2
|
-
companySetting: CompanySetting;
|
|
3
|
-
}
|
|
4
|
-
export interface CompanySetting {
|
|
5
|
-
lang: string;
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
logo: string;
|
|
9
|
-
address_1: string;
|
|
10
|
-
address_2: string;
|
|
11
|
-
email_1: string;
|
|
12
|
-
email_2: string;
|
|
13
|
-
fb_link: string;
|
|
14
|
-
ig_link: string;
|
|
15
|
-
line_link: string;
|
|
16
|
-
phone_1: string;
|
|
17
|
-
phone_2: string;
|
|
18
|
-
twitter_link: string;
|
|
19
|
-
threads_link: string;
|
|
20
|
-
}
|
|
File without changes
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FormErrors, Rule } from './types';
|
|
2
|
-
export declare class FormValidator {
|
|
3
|
-
rules: Record<string, Rule[]>;
|
|
4
|
-
errors: FormErrors;
|
|
5
|
-
errorsUpdatedCallbacks: ((errors: FormErrors) => void)[];
|
|
6
|
-
validate(data: Record<string, any>): boolean;
|
|
7
|
-
prependRules(field: string, rules: Rule | Rule[]): void;
|
|
8
|
-
appendRules(field: string, rules: Rule | Rule[]): void;
|
|
9
|
-
setErrors(errors: FormErrors): void;
|
|
10
|
-
resetErrors(): void;
|
|
11
|
-
onErrorsUpdated(callback: (errors: FormErrors) => void): void;
|
|
12
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export class FormValidator {
|
|
2
|
-
rules = {};
|
|
3
|
-
errors = {};
|
|
4
|
-
errorsUpdatedCallbacks = [];
|
|
5
|
-
validate(data) {
|
|
6
|
-
const errors = {};
|
|
7
|
-
let isValid = true;
|
|
8
|
-
for (const field in this.rules) {
|
|
9
|
-
const fieldRules = this.rules[field];
|
|
10
|
-
const value = data[field];
|
|
11
|
-
for (const rule of fieldRules) {
|
|
12
|
-
if (!rule.validate(value)) {
|
|
13
|
-
isValid = false;
|
|
14
|
-
if (!errors[field]) {
|
|
15
|
-
errors[field] = [];
|
|
16
|
-
}
|
|
17
|
-
errors[field].push(rule.message);
|
|
18
|
-
break;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
this.setErrors(errors);
|
|
23
|
-
return isValid;
|
|
24
|
-
}
|
|
25
|
-
prependRules(field, rules) {
|
|
26
|
-
if (!this.rules[field]) {
|
|
27
|
-
this.rules[field] = [];
|
|
28
|
-
}
|
|
29
|
-
this.rules[field].unshift(...Array.isArray(rules) ? rules : [rules]);
|
|
30
|
-
}
|
|
31
|
-
appendRules(field, rules) {
|
|
32
|
-
if (!this.rules[field]) {
|
|
33
|
-
this.rules[field] = [];
|
|
34
|
-
}
|
|
35
|
-
this.rules[field].push(...Array.isArray(rules) ? rules : [rules]);
|
|
36
|
-
}
|
|
37
|
-
setErrors(errors) {
|
|
38
|
-
this.errors = structuredClone(errors);
|
|
39
|
-
this.errorsUpdatedCallbacks.forEach((callback) => callback(this.errors));
|
|
40
|
-
}
|
|
41
|
-
resetErrors() {
|
|
42
|
-
this.setErrors({});
|
|
43
|
-
}
|
|
44
|
-
onErrorsUpdated(callback) {
|
|
45
|
-
this.errorsUpdatedCallbacks.push(callback);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<slot :error />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script setup lang="ts">
|
|
6
|
-
import type { Rule } from '../types'
|
|
7
|
-
import { inject, ref } from 'vue'
|
|
8
|
-
// Must be imported from the regular package path to avoid duplicate instances
|
|
9
|
-
import { formValidatorInjectionKey } from '@stephenchenorg/astro/form-validator'
|
|
10
|
-
|
|
11
|
-
const props = defineProps<{
|
|
12
|
-
id: string
|
|
13
|
-
rules?: Rule[]
|
|
14
|
-
}>()
|
|
15
|
-
|
|
16
|
-
const error = ref<string | undefined>(undefined)
|
|
17
|
-
|
|
18
|
-
const formValidator = inject(formValidatorInjectionKey)
|
|
19
|
-
if (!formValidator) {
|
|
20
|
-
throw new Error('FormValidator is not provided in the context.')
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (props.rules) {
|
|
24
|
-
formValidator.appendRules(props.id, props.rules)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
formValidator.onErrorsUpdated(errors => {
|
|
28
|
-
error.value = errors[props.id]?.[0]
|
|
29
|
-
})
|
|
30
|
-
</script>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { PropType } from 'vue';
|
|
2
|
-
import type { FormErrors } from '../types';
|
|
3
|
-
import { FormValidator } from '../FormValidator';
|
|
4
|
-
export interface FormValidatorProviderExposed {
|
|
5
|
-
formValidator: () => FormValidator;
|
|
6
|
-
}
|
|
7
|
-
declare const FormValidatorProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
-
errors: {
|
|
9
|
-
type: PropType<FormErrors>;
|
|
10
|
-
default: () => {};
|
|
11
|
-
};
|
|
12
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
}>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
-
errors: {
|
|
16
|
-
type: PropType<FormErrors>;
|
|
17
|
-
default: () => {};
|
|
18
|
-
};
|
|
19
|
-
}>> & Readonly<{}>, {
|
|
20
|
-
errors: FormErrors;
|
|
21
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
22
|
-
export default FormValidatorProvider;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineComponent, onMounted, provide } from "vue";
|
|
2
|
-
import { FormValidator } from "../FormValidator.js";
|
|
3
|
-
import { formValidatorInjectionKey } from "../injectionKey.js";
|
|
4
|
-
const FormValidatorProvider = defineComponent({
|
|
5
|
-
name: "FormValidatorProvider",
|
|
6
|
-
props: {
|
|
7
|
-
errors: {
|
|
8
|
-
type: Object,
|
|
9
|
-
default: () => ({})
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
setup(props, { slots, expose }) {
|
|
13
|
-
const formValidator = new FormValidator();
|
|
14
|
-
provide(formValidatorInjectionKey, formValidator);
|
|
15
|
-
onMounted(() => {
|
|
16
|
-
formValidator.setErrors(props.errors);
|
|
17
|
-
});
|
|
18
|
-
expose({
|
|
19
|
-
formValidator: () => formValidator
|
|
20
|
-
});
|
|
21
|
-
return () => slots.default?.();
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
export default FormValidatorProvider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const formValidatorInjectionKey = Symbol("");
|
|
File without changes
|
package/dist/image/fragments.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { gql } from "graphql-tag";
|
|
2
|
-
export const imageFields = gql`
|
|
3
|
-
fragment ImageFields on Image {
|
|
4
|
-
desktop
|
|
5
|
-
desktop_blur
|
|
6
|
-
mobile
|
|
7
|
-
mobile_blur
|
|
8
|
-
}
|
|
9
|
-
`;
|
|
10
|
-
export const coverFields = gql`
|
|
11
|
-
fragment CoverFields on Cover {
|
|
12
|
-
desktop
|
|
13
|
-
desktop_blur
|
|
14
|
-
mobile
|
|
15
|
-
mobile_blur
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
export const backgroundFields = gql`
|
|
19
|
-
fragment BackgroundFields on Background {
|
|
20
|
-
desktop
|
|
21
|
-
desktop_blur
|
|
22
|
-
mobile
|
|
23
|
-
mobile_blur
|
|
24
|
-
}
|
|
25
|
-
`;
|
package/dist/image/types.d.ts
DELETED
package/dist/image/types.js
DELETED
|
File without changes
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { gql } from "graphql-tag";
|
|
2
|
-
export const pageFields = gql`
|
|
3
|
-
fragment PageFields on Page {
|
|
4
|
-
title
|
|
5
|
-
seo_title
|
|
6
|
-
seo_description
|
|
7
|
-
seo_keyword
|
|
8
|
-
seo_json_ld
|
|
9
|
-
seo_head
|
|
10
|
-
seo_body
|
|
11
|
-
og_title
|
|
12
|
-
og_description
|
|
13
|
-
og_image
|
|
14
|
-
fields {
|
|
15
|
-
key
|
|
16
|
-
content
|
|
17
|
-
type
|
|
18
|
-
image {
|
|
19
|
-
...ImageFields
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PageContentField, PageField, PageImageField, PagePlainTextareaField, PagePlainTextField } from '../types';
|
|
2
|
-
export declare function isPlainTextField(field: PageField): field is PagePlainTextField;
|
|
3
|
-
export declare function isPlainTextareaField(field: PageField): field is PagePlainTextareaField;
|
|
4
|
-
export declare function isContentField(field: PageField): field is PageContentField;
|
|
5
|
-
export declare function isImageField(field: PageField): field is PageImageField;
|
|
6
|
-
export declare function pageTextField(fields: PageField[], key: string): string | null;
|
|
7
|
-
export declare function pageImageFieldForBackground(fields: PageField[], key: string): string;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export function isPlainTextField(field) {
|
|
2
|
-
return field.type === "text";
|
|
3
|
-
}
|
|
4
|
-
export function isPlainTextareaField(field) {
|
|
5
|
-
return field.type === "textarea";
|
|
6
|
-
}
|
|
7
|
-
export function isContentField(field) {
|
|
8
|
-
return field.type === "html";
|
|
9
|
-
}
|
|
10
|
-
export function isImageField(field) {
|
|
11
|
-
return field.type === "image";
|
|
12
|
-
}
|
|
13
|
-
export function pageTextField(fields, key) {
|
|
14
|
-
const field = fields.find((field2) => field2.key === key && isPlainTextField(field2));
|
|
15
|
-
return field ? field.content : "";
|
|
16
|
-
}
|
|
17
|
-
export function pageImageFieldForBackground(fields, key) {
|
|
18
|
-
const field = fields.find((field2) => field2.key === key && isImageField(field2));
|
|
19
|
-
return field ? `background-image: url('${field.image.desktop}');` : "";
|
|
20
|
-
}
|
package/dist/page/field/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const seoMetaFields: (dummyClass: string) => import("graphql").DocumentNode;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { gql } from "graphql-tag";
|
|
2
|
-
export const seoMetaFields = (dummyClass) => gql(`
|
|
3
|
-
fragment DummyClassSeoMetaFields on DummyClass {
|
|
4
|
-
seo_title
|
|
5
|
-
seo_description
|
|
6
|
-
seo_keyword
|
|
7
|
-
seo_json_ld
|
|
8
|
-
seo_head
|
|
9
|
-
seo_body
|
|
10
|
-
og_title
|
|
11
|
-
og_description
|
|
12
|
-
og_image
|
|
13
|
-
}
|
|
14
|
-
`.replace(/DummyClass/g, dummyClass));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PageMeta } from '../types';
|
|
2
|
-
export type UseSeoMetaOptions = Partial<Omit<PageMeta, 'title'>> & {
|
|
3
|
-
title: string;
|
|
4
|
-
description?: string | null;
|
|
5
|
-
image?: string | null;
|
|
6
|
-
};
|
|
7
|
-
export declare function seoMeta(options: UseSeoMetaOptions, modelMeta?: PageMeta): PageMeta;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function seoMeta(options, modelMeta) {
|
|
2
|
-
return {
|
|
3
|
-
title: modelMeta?.title || options.title,
|
|
4
|
-
seo_title: modelMeta?.seo_title || options.seo_title || null,
|
|
5
|
-
seo_description: modelMeta?.seo_description || options.seo_description || options.description || null,
|
|
6
|
-
seo_keyword: modelMeta?.seo_keyword || options.seo_keyword || null,
|
|
7
|
-
seo_json_ld: modelMeta?.seo_json_ld || options.seo_json_ld || null,
|
|
8
|
-
seo_head: modelMeta?.seo_head || options.seo_head,
|
|
9
|
-
seo_body: modelMeta?.seo_body || options.seo_body,
|
|
10
|
-
og_title: modelMeta?.og_title || options.og_title || options.title || null,
|
|
11
|
-
og_description: modelMeta?.og_description || options.og_description || options.description || null,
|
|
12
|
-
og_image: modelMeta?.og_image || options.og_image || options.image || null
|
|
13
|
-
};
|
|
14
|
-
}
|
package/dist/page/types.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
export interface DataPage {
|
|
2
|
-
page: Page;
|
|
3
|
-
}
|
|
4
|
-
export interface Page extends PageMeta {
|
|
5
|
-
fields: PageField[];
|
|
6
|
-
}
|
|
7
|
-
export interface PageMeta {
|
|
8
|
-
title: string;
|
|
9
|
-
seo_title: string | null;
|
|
10
|
-
seo_description: string | null;
|
|
11
|
-
seo_keyword: string | null;
|
|
12
|
-
seo_json_ld: string | null;
|
|
13
|
-
seo_head?: string | null;
|
|
14
|
-
seo_body?: string | null;
|
|
15
|
-
og_title: string | null;
|
|
16
|
-
og_description: string | null;
|
|
17
|
-
og_image: string | null;
|
|
18
|
-
}
|
|
19
|
-
export interface PageField {
|
|
20
|
-
key: string;
|
|
21
|
-
type: 'text' | 'textarea' | 'html' | 'image';
|
|
22
|
-
content: string | null;
|
|
23
|
-
image: {
|
|
24
|
-
desktop: string | null;
|
|
25
|
-
desktop_blur: string | null;
|
|
26
|
-
mobile: string | null;
|
|
27
|
-
mobile_blur: string | null;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export interface PagePlainTextField extends PageField {
|
|
31
|
-
type: 'text';
|
|
32
|
-
content: string;
|
|
33
|
-
image: {
|
|
34
|
-
desktop: null;
|
|
35
|
-
desktop_blur: null;
|
|
36
|
-
mobile: null;
|
|
37
|
-
mobile_blur: null;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export interface PagePlainTextareaField extends PageField {
|
|
41
|
-
type: 'textarea';
|
|
42
|
-
content: string;
|
|
43
|
-
image: {
|
|
44
|
-
desktop: null;
|
|
45
|
-
desktop_blur: null;
|
|
46
|
-
mobile: null;
|
|
47
|
-
mobile_blur: null;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export interface PageContentField extends PageField {
|
|
51
|
-
type: 'html';
|
|
52
|
-
content: string;
|
|
53
|
-
image: {
|
|
54
|
-
desktop: null;
|
|
55
|
-
desktop_blur: null;
|
|
56
|
-
mobile: null;
|
|
57
|
-
mobile_blur: null;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
export interface PageImageField extends PageField {
|
|
61
|
-
type: 'image';
|
|
62
|
-
content: null;
|
|
63
|
-
image: {
|
|
64
|
-
desktop: string;
|
|
65
|
-
desktop_blur: string;
|
|
66
|
-
mobile: string;
|
|
67
|
-
mobile_blur: string;
|
|
68
|
-
};
|
|
69
|
-
}
|
package/dist/page/types.js
DELETED
|
File without changes
|
|
File without changes
|