@gem-sdk/pages 1.4.0 → 1.5.0-canary-4fb10428
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/types/index.d.ts +111 -111
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -6,52 +6,52 @@ import { SWRConfig } from 'swr';
|
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
import { Component } from 'react';
|
|
8
8
|
|
|
9
|
-
type PageBuilderProps = {
|
|
10
|
-
seo?: NextSeoProps;
|
|
11
|
-
builderData?: BuilderState;
|
|
12
|
-
sectionData?: Record<string, SectionData>;
|
|
13
|
-
themeStyle?: string | null;
|
|
14
|
-
fontStyle?: string | null;
|
|
15
|
-
swr?: React.ComponentProps<typeof SWRConfig>['value'];
|
|
16
|
-
plugins?: string[];
|
|
17
|
-
pageType?: ShopType.PublishedThemePageType;
|
|
18
|
-
storefrontToken?: string | null;
|
|
19
|
-
storefrontHandle?: string | null;
|
|
20
|
-
shopToken?: string | null;
|
|
21
|
-
pageHandle?: string | null;
|
|
22
|
-
currency?: string | null;
|
|
23
|
-
locale?: string | null;
|
|
24
|
-
favicon?: string | null;
|
|
25
|
-
mobileOnly?: boolean | null;
|
|
26
|
-
swatches?: any[] | null;
|
|
27
|
-
mode?: RenderMode;
|
|
28
|
-
gaTrackingId?: string | null;
|
|
29
|
-
tiktokPixelId?: string | null;
|
|
30
|
-
facebookPixelId?: string | null;
|
|
31
|
-
customCodeHeader?: string | null;
|
|
32
|
-
customCodeBody?: string | null;
|
|
33
|
-
};
|
|
34
|
-
type PageBuilderPropsV2 = {
|
|
35
|
-
builderData?: {
|
|
36
|
-
uid: string;
|
|
37
|
-
lazy?: boolean;
|
|
38
|
-
priority?: boolean;
|
|
39
|
-
data: BuilderState;
|
|
40
|
-
}[];
|
|
41
|
-
} & Omit<PageBuilderProps, 'builderData'>;
|
|
42
|
-
type AdditionalPageBuilderProps = {
|
|
43
|
-
components: Record<string, React.ComponentType<any>>;
|
|
44
|
-
};
|
|
45
|
-
type NextPageWithLayout<P = PageBuilderProps, IP = P> = NextPage<P, IP> & {
|
|
46
|
-
getLayout?: (page: React.ReactElement, pageProps?: any) => React.ReactNode;
|
|
47
|
-
};
|
|
48
|
-
type AppPropsWithLayout<P = PageBuilderProps> = AppProps<P> & {
|
|
49
|
-
Component: NextPageWithLayout;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
type CollectionPageProps = PageBuilderProps & {
|
|
53
|
-
collection?: CollectionQueryResponse['collection'];
|
|
54
|
-
};
|
|
9
|
+
type PageBuilderProps = {
|
|
10
|
+
seo?: NextSeoProps;
|
|
11
|
+
builderData?: BuilderState;
|
|
12
|
+
sectionData?: Record<string, SectionData>;
|
|
13
|
+
themeStyle?: string | null;
|
|
14
|
+
fontStyle?: string | null;
|
|
15
|
+
swr?: React.ComponentProps<typeof SWRConfig>['value'];
|
|
16
|
+
plugins?: string[];
|
|
17
|
+
pageType?: ShopType.PublishedThemePageType;
|
|
18
|
+
storefrontToken?: string | null;
|
|
19
|
+
storefrontHandle?: string | null;
|
|
20
|
+
shopToken?: string | null;
|
|
21
|
+
pageHandle?: string | null;
|
|
22
|
+
currency?: string | null;
|
|
23
|
+
locale?: string | null;
|
|
24
|
+
favicon?: string | null;
|
|
25
|
+
mobileOnly?: boolean | null;
|
|
26
|
+
swatches?: any[] | null;
|
|
27
|
+
mode?: RenderMode;
|
|
28
|
+
gaTrackingId?: string | null;
|
|
29
|
+
tiktokPixelId?: string | null;
|
|
30
|
+
facebookPixelId?: string | null;
|
|
31
|
+
customCodeHeader?: string | null;
|
|
32
|
+
customCodeBody?: string | null;
|
|
33
|
+
};
|
|
34
|
+
type PageBuilderPropsV2 = {
|
|
35
|
+
builderData?: {
|
|
36
|
+
uid: string;
|
|
37
|
+
lazy?: boolean;
|
|
38
|
+
priority?: boolean;
|
|
39
|
+
data: BuilderState;
|
|
40
|
+
}[];
|
|
41
|
+
} & Omit<PageBuilderProps, 'builderData'>;
|
|
42
|
+
type AdditionalPageBuilderProps = {
|
|
43
|
+
components: Record<string, React.ComponentType<any>>;
|
|
44
|
+
};
|
|
45
|
+
type NextPageWithLayout<P = PageBuilderProps, IP = P> = NextPage<P, IP> & {
|
|
46
|
+
getLayout?: (page: React.ReactElement, pageProps?: any) => React.ReactNode;
|
|
47
|
+
};
|
|
48
|
+
type AppPropsWithLayout<P = PageBuilderProps> = AppProps<P> & {
|
|
49
|
+
Component: NextPageWithLayout;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type CollectionPageProps = PageBuilderProps & {
|
|
53
|
+
collection?: CollectionQueryResponse['collection'];
|
|
54
|
+
};
|
|
55
55
|
declare const CollectionDetailPage: React.FC<CollectionPageProps & AdditionalPageBuilderProps>;
|
|
56
56
|
|
|
57
57
|
declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<CollectionPageProps>;
|
|
@@ -62,12 +62,12 @@ declare const getHomePagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc
|
|
|
62
62
|
|
|
63
63
|
declare const getPreviewProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (pageType: ShopType.PublishedThemePageType, slug?: string) => Promise<PageBuilderProps>;
|
|
64
64
|
|
|
65
|
-
type Props$4 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
|
|
65
|
+
type Props$4 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
|
|
66
66
|
declare const getBuilderProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => Promise<Props$4>;
|
|
67
67
|
|
|
68
|
-
type ProductPageProps = PageBuilderProps & {
|
|
69
|
-
product?: ProductSelectFragment;
|
|
70
|
-
};
|
|
68
|
+
type ProductPageProps = PageBuilderProps & {
|
|
69
|
+
product?: ProductSelectFragment;
|
|
70
|
+
};
|
|
71
71
|
declare const ProductDetailPage: React.FC<ProductPageProps & AdditionalPageBuilderProps>;
|
|
72
72
|
|
|
73
73
|
declare const getProductProps: (fetcher: FetchFunc) => (handle?: string) => Promise<ProductPageProps>;
|
|
@@ -78,7 +78,7 @@ declare const getStaticPagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFu
|
|
|
78
78
|
|
|
79
79
|
declare const getStaticPagePropsPreview: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
|
|
80
80
|
|
|
81
|
-
declare const createFetcher: (token?: string | null) => FetchFunc;
|
|
81
|
+
declare const createFetcher: (token?: string | null) => FetchFunc;
|
|
82
82
|
declare const createShopifyFetcher: (storefrontToken?: string, handle?: string) => FetchFunc;
|
|
83
83
|
|
|
84
84
|
declare const getLayout: (page: React.ReactElement, pageProps?: any) => JSX.Element;
|
|
@@ -89,92 +89,92 @@ declare const useTrackingView: (token?: string | null, handle?: string | null, i
|
|
|
89
89
|
|
|
90
90
|
declare function isBot(input: string): boolean;
|
|
91
91
|
|
|
92
|
-
type PreviewPageProps = {
|
|
93
|
-
components: Record<string, React.ComponentType<any>>;
|
|
94
|
-
pageType: ShopType.PublishedThemePageType;
|
|
95
|
-
};
|
|
92
|
+
type PreviewPageProps = {
|
|
93
|
+
components: Record<string, React.ComponentType<any>>;
|
|
94
|
+
pageType: ShopType.PublishedThemePageType;
|
|
95
|
+
};
|
|
96
96
|
declare const PreviewPage: React.FC<PreviewPageProps>;
|
|
97
97
|
|
|
98
|
-
type StaticPageProps = PageBuilderProps;
|
|
98
|
+
type StaticPageProps = PageBuilderProps;
|
|
99
99
|
declare const StaticPage: React.FC<StaticPageProps & AdditionalPageBuilderProps>;
|
|
100
100
|
|
|
101
|
-
type BuilderPageProps = {
|
|
102
|
-
components: Record<string, React.ComponentType<any>>;
|
|
103
|
-
seo?: NextSeoProps;
|
|
104
|
-
themeStyle?: string | null;
|
|
105
|
-
fontStyle?: string | null;
|
|
106
|
-
header?: BuilderState;
|
|
107
|
-
footer?: BuilderState;
|
|
108
|
-
sectionData?: Record<string, SectionData>;
|
|
109
|
-
storefrontToken?: string | null;
|
|
110
|
-
storefrontHandle?: string | null;
|
|
111
|
-
shopToken?: string | null;
|
|
112
|
-
mode?: RenderMode;
|
|
113
|
-
};
|
|
101
|
+
type BuilderPageProps = {
|
|
102
|
+
components: Record<string, React.ComponentType<any>>;
|
|
103
|
+
seo?: NextSeoProps;
|
|
104
|
+
themeStyle?: string | null;
|
|
105
|
+
fontStyle?: string | null;
|
|
106
|
+
header?: BuilderState;
|
|
107
|
+
footer?: BuilderState;
|
|
108
|
+
sectionData?: Record<string, SectionData>;
|
|
109
|
+
storefrontToken?: string | null;
|
|
110
|
+
storefrontHandle?: string | null;
|
|
111
|
+
shopToken?: string | null;
|
|
112
|
+
mode?: RenderMode;
|
|
113
|
+
};
|
|
114
114
|
declare const BuilderPage: React.FC<BuilderPageProps>;
|
|
115
115
|
|
|
116
|
-
type StaticPagePropsV2 = PageBuilderPropsV2;
|
|
116
|
+
type StaticPagePropsV2 = PageBuilderPropsV2;
|
|
117
117
|
declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderProps>;
|
|
118
118
|
|
|
119
119
|
declare const getStaticPaths: GetStaticPaths;
|
|
120
120
|
|
|
121
|
-
type FontItem = {
|
|
122
|
-
family: string;
|
|
123
|
-
variants: string[];
|
|
124
|
-
subsets: string[];
|
|
125
|
-
};
|
|
126
|
-
type FontOption = {
|
|
127
|
-
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
128
|
-
subset?: string;
|
|
129
|
-
effect?: string;
|
|
130
|
-
};
|
|
121
|
+
type FontItem = {
|
|
122
|
+
family: string;
|
|
123
|
+
variants: string[];
|
|
124
|
+
subsets: string[];
|
|
125
|
+
};
|
|
126
|
+
type FontOption = {
|
|
127
|
+
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
128
|
+
subset?: string;
|
|
129
|
+
effect?: string;
|
|
130
|
+
};
|
|
131
131
|
declare function getFonts(fonts: FontItem[], option?: FontOption): Promise<string>;
|
|
132
132
|
|
|
133
133
|
declare const getStorefrontApi: (handle: string, provider?: 'BIGCOMMERCE' | 'SHOPIFY') => string;
|
|
134
134
|
|
|
135
|
-
type ErrorBoundaryProps = {
|
|
136
|
-
children?: React.ReactNode;
|
|
137
|
-
FallbackComponent: React.ComponentType<{
|
|
138
|
-
error?: Error;
|
|
139
|
-
resetErrorBoundary: () => void;
|
|
140
|
-
}>;
|
|
141
|
-
onError?: (error: Error, info: React.ErrorInfo) => void;
|
|
142
|
-
};
|
|
143
|
-
type ErrorBoundaryState = {
|
|
144
|
-
hasError?: boolean;
|
|
145
|
-
error?: Error;
|
|
146
|
-
};
|
|
147
|
-
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
148
|
-
state: ErrorBoundaryState;
|
|
149
|
-
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
150
|
-
reset: () => void;
|
|
151
|
-
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
152
|
-
render(): string | number | boolean | react.ReactFragment | JSX.Element | null | undefined;
|
|
135
|
+
type ErrorBoundaryProps = {
|
|
136
|
+
children?: React.ReactNode;
|
|
137
|
+
FallbackComponent: React.ComponentType<{
|
|
138
|
+
error?: Error;
|
|
139
|
+
resetErrorBoundary: () => void;
|
|
140
|
+
}>;
|
|
141
|
+
onError?: (error: Error, info: React.ErrorInfo) => void;
|
|
142
|
+
};
|
|
143
|
+
type ErrorBoundaryState = {
|
|
144
|
+
hasError?: boolean;
|
|
145
|
+
error?: Error;
|
|
146
|
+
};
|
|
147
|
+
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
148
|
+
state: ErrorBoundaryState;
|
|
149
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
150
|
+
reset: () => void;
|
|
151
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
152
|
+
render(): string | number | boolean | react.ReactFragment | JSX.Element | null | undefined;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
type Props$3 = {
|
|
156
|
-
error?: Error;
|
|
157
|
-
resetErrorBoundary: () => void;
|
|
158
|
-
};
|
|
155
|
+
type Props$3 = {
|
|
156
|
+
error?: Error;
|
|
157
|
+
resetErrorBoundary: () => void;
|
|
158
|
+
};
|
|
159
159
|
declare const ErrorFallback: ({ error, resetErrorBoundary }: Props$3) => JSX.Element;
|
|
160
160
|
|
|
161
161
|
declare const Page404: () => JSX.Element;
|
|
162
162
|
|
|
163
163
|
declare const Page500: () => JSX.Element;
|
|
164
164
|
|
|
165
|
-
type Props$2 = {
|
|
166
|
-
trackingId?: string | null;
|
|
167
|
-
};
|
|
165
|
+
type Props$2 = {
|
|
166
|
+
trackingId?: string | null;
|
|
167
|
+
};
|
|
168
168
|
declare const GoogleAnalytic: ({ trackingId }: Props$2) => JSX.Element | null;
|
|
169
169
|
|
|
170
|
-
type Props$1 = {
|
|
171
|
-
pixelId?: string | null;
|
|
172
|
-
};
|
|
170
|
+
type Props$1 = {
|
|
171
|
+
pixelId?: string | null;
|
|
172
|
+
};
|
|
173
173
|
declare const FacebookPixel: ({ pixelId }: Props$1) => JSX.Element | null;
|
|
174
174
|
|
|
175
|
-
type Props = {
|
|
176
|
-
pixelId?: string | null;
|
|
177
|
-
};
|
|
175
|
+
type Props = {
|
|
176
|
+
pixelId?: string | null;
|
|
177
|
+
};
|
|
178
178
|
declare const TikTokPixel: ({ pixelId }: Props) => JSX.Element | null;
|
|
179
179
|
|
|
180
180
|
export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, CollectionPageProps, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PreviewPage, ProductDetailPage, ProductPageProps, StaticPage, StaticPageProps, StaticPagePropsV2, StaticPageV2, TikTokPixel, createFetcher, createShopifyFetcher, genCSS, getBuilderProps, getCollectionProps, getFonts, getHomePageProps, getHomePagePropsV2, getLayout, getPreviewProps, getProductProps, getStaticPageProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, useTrackingView };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0-canary-4fb10428",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"next-seo": "^5.15.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "
|
|
28
|
+
"@gem-sdk/core": "1.5.0-canary-4fb10428",
|
|
29
29
|
"@gem-sdk/plugin-cookie-bar": "*",
|
|
30
30
|
"@gem-sdk/plugin-quick-view": "*",
|
|
31
31
|
"@gem-sdk/plugin-sticky-add-to-cart": "*"
|