@gem-sdk/pages 1.0.0 → 1.0.3
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.
|
@@ -25,6 +25,7 @@ const GoogleAnalytic = ({ trackingId }) => {
|
|
|
25
25
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Script, { src: "https://www.google-analytics.com/analytics.js", async: true, strategy: "afterInteractive" }), jsxRuntime.jsx(Script, { strategy: "afterInteractive", id: "google-analytics", dangerouslySetInnerHTML: {
|
|
26
26
|
__html: `window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
|
27
27
|
ga('create', '${trackingId}', 'auto');
|
|
28
|
+
ga('require', 'ec');
|
|
28
29
|
ga('send', 'pageview');
|
|
29
30
|
`,
|
|
30
31
|
} })] }));
|
|
@@ -23,6 +23,7 @@ const GoogleAnalytic = ({ trackingId }) => {
|
|
|
23
23
|
return (jsxs(Fragment, { children: [jsx(Script, { src: "https://www.google-analytics.com/analytics.js", async: true, strategy: "afterInteractive" }), jsx(Script, { strategy: "afterInteractive", id: "google-analytics", dangerouslySetInnerHTML: {
|
|
24
24
|
__html: `window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
|
25
25
|
ga('create', '${trackingId}', 'auto');
|
|
26
|
+
ga('require', 'ec');
|
|
26
27
|
ga('send', 'pageview');
|
|
27
28
|
`,
|
|
28
29
|
} })] }));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,49 +6,49 @@ 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
|
-
currency?: string | null;
|
|
22
|
-
locale?: string | null;
|
|
23
|
-
favicon?: string | null;
|
|
24
|
-
mobileOnly?: boolean | null;
|
|
25
|
-
swatches?: any[] | null;
|
|
26
|
-
mode?: RenderMode;
|
|
27
|
-
gaTrackingId?: string | null;
|
|
28
|
-
tiktokPixelId?: string | null;
|
|
29
|
-
facebookPixelId?: string | null;
|
|
30
|
-
};
|
|
31
|
-
type PageBuilderPropsV2 = {
|
|
32
|
-
builderData?: {
|
|
33
|
-
uid: string;
|
|
34
|
-
lazy?: boolean;
|
|
35
|
-
priority?: boolean;
|
|
36
|
-
data: BuilderState;
|
|
37
|
-
}[];
|
|
38
|
-
} & Omit<PageBuilderProps, 'builderData'>;
|
|
39
|
-
type AdditionalPageBuilderProps = {
|
|
40
|
-
components: Record<string, React.ComponentType<any>>;
|
|
41
|
-
};
|
|
42
|
-
type NextPageWithLayout<P = PageBuilderProps, IP = P> = NextPage<P, IP> & {
|
|
43
|
-
getLayout?: (page: React.ReactElement) => React.ReactNode;
|
|
44
|
-
};
|
|
45
|
-
type AppPropsWithLayout<P = PageBuilderProps> = AppProps<P> & {
|
|
46
|
-
Component: NextPageWithLayout;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
type CollectionPageProps = PageBuilderProps & {
|
|
50
|
-
collection?: CollectionQueryResponse['collection'];
|
|
51
|
-
};
|
|
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
|
+
currency?: string | null;
|
|
22
|
+
locale?: string | null;
|
|
23
|
+
favicon?: string | null;
|
|
24
|
+
mobileOnly?: boolean | null;
|
|
25
|
+
swatches?: any[] | null;
|
|
26
|
+
mode?: RenderMode;
|
|
27
|
+
gaTrackingId?: string | null;
|
|
28
|
+
tiktokPixelId?: string | null;
|
|
29
|
+
facebookPixelId?: string | null;
|
|
30
|
+
};
|
|
31
|
+
type PageBuilderPropsV2 = {
|
|
32
|
+
builderData?: {
|
|
33
|
+
uid: string;
|
|
34
|
+
lazy?: boolean;
|
|
35
|
+
priority?: boolean;
|
|
36
|
+
data: BuilderState;
|
|
37
|
+
}[];
|
|
38
|
+
} & Omit<PageBuilderProps, 'builderData'>;
|
|
39
|
+
type AdditionalPageBuilderProps = {
|
|
40
|
+
components: Record<string, React.ComponentType<any>>;
|
|
41
|
+
};
|
|
42
|
+
type NextPageWithLayout<P = PageBuilderProps, IP = P> = NextPage<P, IP> & {
|
|
43
|
+
getLayout?: (page: React.ReactElement) => React.ReactNode;
|
|
44
|
+
};
|
|
45
|
+
type AppPropsWithLayout<P = PageBuilderProps> = AppProps<P> & {
|
|
46
|
+
Component: NextPageWithLayout;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
type CollectionPageProps = PageBuilderProps & {
|
|
50
|
+
collection?: CollectionQueryResponse['collection'];
|
|
51
|
+
};
|
|
52
52
|
declare const CollectionDetailPage: React.FC<CollectionPageProps & AdditionalPageBuilderProps>;
|
|
53
53
|
|
|
54
54
|
declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<CollectionPageProps>;
|
|
@@ -59,12 +59,12 @@ declare const getHomePagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc
|
|
|
59
59
|
|
|
60
60
|
declare const getPreviewProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (pageType: ShopType.PublishedThemePageType, slug?: string) => Promise<PageBuilderProps>;
|
|
61
61
|
|
|
62
|
-
type Props$4 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
|
|
62
|
+
type Props$4 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
|
|
63
63
|
declare const getBuilderProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => Promise<Props$4>;
|
|
64
64
|
|
|
65
|
-
type ProductPageProps = PageBuilderProps & {
|
|
66
|
-
product?: ProductSelectFragment;
|
|
67
|
-
};
|
|
65
|
+
type ProductPageProps = PageBuilderProps & {
|
|
66
|
+
product?: ProductSelectFragment;
|
|
67
|
+
};
|
|
68
68
|
declare const ProductDetailPage: React.FC<ProductPageProps & AdditionalPageBuilderProps>;
|
|
69
69
|
|
|
70
70
|
declare const getProductProps: (fetcher: FetchFunc) => (handle?: string) => Promise<ProductPageProps>;
|
|
@@ -75,99 +75,99 @@ declare const getStaticPagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFu
|
|
|
75
75
|
|
|
76
76
|
declare const getStaticPagePropsPreview: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
|
|
77
77
|
|
|
78
|
-
declare const createFetcher: (token?: string | null) => FetchFunc;
|
|
78
|
+
declare const createFetcher: (token?: string | null) => FetchFunc;
|
|
79
79
|
declare const createShopifyFetcher: (storefrontToken?: string, handle?: string) => FetchFunc;
|
|
80
80
|
|
|
81
81
|
declare const getLayout: (page: React.ReactElement) => JSX.Element;
|
|
82
82
|
|
|
83
83
|
declare const genCSS: (input?: string | Record<string, any>, mobileOnly?: boolean) => string;
|
|
84
84
|
|
|
85
|
-
type PreviewPageProps = {
|
|
86
|
-
components: Record<string, React.ComponentType<any>>;
|
|
87
|
-
pageType: ShopType.PublishedThemePageType;
|
|
88
|
-
};
|
|
85
|
+
type PreviewPageProps = {
|
|
86
|
+
components: Record<string, React.ComponentType<any>>;
|
|
87
|
+
pageType: ShopType.PublishedThemePageType;
|
|
88
|
+
};
|
|
89
89
|
declare const PreviewPage: React.FC<PreviewPageProps>;
|
|
90
90
|
|
|
91
|
-
type StaticPageProps = PageBuilderProps;
|
|
91
|
+
type StaticPageProps = PageBuilderProps;
|
|
92
92
|
declare const StaticPage: React.FC<StaticPageProps & AdditionalPageBuilderProps>;
|
|
93
93
|
|
|
94
|
-
type BuilderPageProps = {
|
|
95
|
-
components: Record<string, React.ComponentType<any>>;
|
|
96
|
-
seo?: NextSeoProps;
|
|
97
|
-
themeStyle?: string | null;
|
|
98
|
-
fontStyle?: string | null;
|
|
99
|
-
header?: BuilderState;
|
|
100
|
-
footer?: BuilderState;
|
|
101
|
-
sectionData?: Record<string, SectionData>;
|
|
102
|
-
storefrontToken?: string | null;
|
|
103
|
-
storefrontHandle?: string | null;
|
|
104
|
-
shopToken?: string | null;
|
|
105
|
-
mode?: RenderMode;
|
|
106
|
-
};
|
|
94
|
+
type BuilderPageProps = {
|
|
95
|
+
components: Record<string, React.ComponentType<any>>;
|
|
96
|
+
seo?: NextSeoProps;
|
|
97
|
+
themeStyle?: string | null;
|
|
98
|
+
fontStyle?: string | null;
|
|
99
|
+
header?: BuilderState;
|
|
100
|
+
footer?: BuilderState;
|
|
101
|
+
sectionData?: Record<string, SectionData>;
|
|
102
|
+
storefrontToken?: string | null;
|
|
103
|
+
storefrontHandle?: string | null;
|
|
104
|
+
shopToken?: string | null;
|
|
105
|
+
mode?: RenderMode;
|
|
106
|
+
};
|
|
107
107
|
declare const BuilderPage: React.FC<BuilderPageProps>;
|
|
108
108
|
|
|
109
|
-
type StaticPagePropsV2 = PageBuilderPropsV2;
|
|
109
|
+
type StaticPagePropsV2 = PageBuilderPropsV2;
|
|
110
110
|
declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderProps>;
|
|
111
111
|
|
|
112
112
|
declare const getStaticPaths: GetStaticPaths;
|
|
113
113
|
|
|
114
|
-
type FontItem = {
|
|
115
|
-
family: string;
|
|
116
|
-
variants: string[];
|
|
117
|
-
subsets: string[];
|
|
118
|
-
};
|
|
119
|
-
type FontOption = {
|
|
120
|
-
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
121
|
-
subset?: string;
|
|
122
|
-
effect?: string;
|
|
123
|
-
};
|
|
114
|
+
type FontItem = {
|
|
115
|
+
family: string;
|
|
116
|
+
variants: string[];
|
|
117
|
+
subsets: string[];
|
|
118
|
+
};
|
|
119
|
+
type FontOption = {
|
|
120
|
+
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
121
|
+
subset?: string;
|
|
122
|
+
effect?: string;
|
|
123
|
+
};
|
|
124
124
|
declare function getFonts(fonts: FontItem[], option?: FontOption): Promise<string>;
|
|
125
125
|
|
|
126
126
|
declare const getStorefrontApi: (handle: string, provider?: 'BIGCOMMERCE' | 'SHOPIFY') => string;
|
|
127
127
|
|
|
128
|
-
type ErrorBoundaryProps = {
|
|
129
|
-
children?: React.ReactNode;
|
|
130
|
-
FallbackComponent: React.ComponentType<{
|
|
131
|
-
error?: Error;
|
|
132
|
-
resetErrorBoundary: () => void;
|
|
133
|
-
}>;
|
|
134
|
-
onError?: (error: Error, info: React.ErrorInfo) => void;
|
|
135
|
-
};
|
|
136
|
-
type ErrorBoundaryState = {
|
|
137
|
-
hasError?: boolean;
|
|
138
|
-
error?: Error;
|
|
139
|
-
};
|
|
140
|
-
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
141
|
-
state: ErrorBoundaryState;
|
|
142
|
-
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
143
|
-
reset: () => void;
|
|
144
|
-
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
145
|
-
render(): string | number | boolean | react.ReactFragment | JSX.Element | null | undefined;
|
|
128
|
+
type ErrorBoundaryProps = {
|
|
129
|
+
children?: React.ReactNode;
|
|
130
|
+
FallbackComponent: React.ComponentType<{
|
|
131
|
+
error?: Error;
|
|
132
|
+
resetErrorBoundary: () => void;
|
|
133
|
+
}>;
|
|
134
|
+
onError?: (error: Error, info: React.ErrorInfo) => void;
|
|
135
|
+
};
|
|
136
|
+
type ErrorBoundaryState = {
|
|
137
|
+
hasError?: boolean;
|
|
138
|
+
error?: Error;
|
|
139
|
+
};
|
|
140
|
+
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
141
|
+
state: ErrorBoundaryState;
|
|
142
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
143
|
+
reset: () => void;
|
|
144
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
145
|
+
render(): string | number | boolean | react.ReactFragment | JSX.Element | null | undefined;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
type Props$3 = {
|
|
149
|
-
error?: Error;
|
|
150
|
-
resetErrorBoundary: () => void;
|
|
151
|
-
};
|
|
148
|
+
type Props$3 = {
|
|
149
|
+
error?: Error;
|
|
150
|
+
resetErrorBoundary: () => void;
|
|
151
|
+
};
|
|
152
152
|
declare const ErrorFallback: ({ error, resetErrorBoundary }: Props$3) => JSX.Element;
|
|
153
153
|
|
|
154
154
|
declare const Page404: () => JSX.Element;
|
|
155
155
|
|
|
156
156
|
declare const Page500: () => JSX.Element;
|
|
157
157
|
|
|
158
|
-
type Props$2 = {
|
|
159
|
-
trackingId?: string | null;
|
|
160
|
-
};
|
|
158
|
+
type Props$2 = {
|
|
159
|
+
trackingId?: string | null;
|
|
160
|
+
};
|
|
161
161
|
declare const GoogleAnalytic: ({ trackingId }: Props$2) => JSX.Element | null;
|
|
162
162
|
|
|
163
|
-
type Props$1 = {
|
|
164
|
-
pixelId?: string | null;
|
|
165
|
-
};
|
|
163
|
+
type Props$1 = {
|
|
164
|
+
pixelId?: string | null;
|
|
165
|
+
};
|
|
166
166
|
declare const FacebookPixel: ({ pixelId }: Props$1) => JSX.Element | null;
|
|
167
167
|
|
|
168
|
-
type Props = {
|
|
169
|
-
pixelId?: string | null;
|
|
170
|
-
};
|
|
168
|
+
type Props = {
|
|
169
|
+
pixelId?: string | null;
|
|
170
|
+
};
|
|
171
171
|
declare const TikTokPixel: ({ pixelId }: Props) => JSX.Element | null;
|
|
172
172
|
|
|
173
173
|
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 };
|