@gem-sdk/pages 2.0.0-dev.453 → 2.0.0-dev.504
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/cjs/libs/google-fonts.js +1 -1
- package/dist/cjs/libs/helpers/parse-json.js +1 -1
- package/dist/cjs/pages/static-v2.js +20 -16
- package/dist/esm/libs/google-fonts.js +1 -1
- package/dist/esm/libs/helpers/parse-json.js +1 -1
- package/dist/esm/pages/static-v2.js +21 -17
- package/dist/types/index.d.ts +51 -52
- package/package.json +2 -2
|
@@ -14,6 +14,7 @@ var react = require('react');
|
|
|
14
14
|
|
|
15
15
|
const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, dynamicDiscountOffer, isPreview, interaction, pageBackground })=>{
|
|
16
16
|
const router$1 = router.useRouter();
|
|
17
|
+
const { t } = core.useI18n();
|
|
17
18
|
const baseAssetURL = process.env.NEXT_GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
|
|
18
19
|
useTrackingView.useTrackingView(shopToken, pageHandle, router$1.isFallback);
|
|
19
20
|
const customCodeHeaderID = 'custom-code-header';
|
|
@@ -109,22 +110,25 @@ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, f
|
|
|
109
110
|
}),
|
|
110
111
|
/*#__PURE__*/ jsxRuntime.jsx(core.SectionProvider, {
|
|
111
112
|
data: sectionData,
|
|
112
|
-
children:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
113
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core.I18nProvider, {
|
|
114
|
+
t: t,
|
|
115
|
+
children: builderData?.map((builder)=>/*#__PURE__*/ jsxRuntime.jsxs(core.BuilderProvider, {
|
|
116
|
+
state: builder.data,
|
|
117
|
+
lazy: builder.lazy,
|
|
118
|
+
priority: builder.priority,
|
|
119
|
+
isPostPurchase: isPostPurchase,
|
|
120
|
+
isPreview: isPreview,
|
|
121
|
+
children: [
|
|
122
|
+
/*#__PURE__*/ jsxRuntime.jsx(core.Render, {
|
|
123
|
+
uid: builder.uid
|
|
124
|
+
}),
|
|
125
|
+
hasInteraction && /*#__PURE__*/ jsxRuntime.jsx(Script, {
|
|
126
|
+
defer: true,
|
|
127
|
+
src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
}, builder.uid))
|
|
131
|
+
})
|
|
128
132
|
}),
|
|
129
133
|
isPostPurchase && /*#__PURE__*/ jsxRuntime.jsx(FooterForPostPurchase.default, {
|
|
130
134
|
shopName: shopName || ''
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
|
|
2
|
+
import { useI18n, PageProvider, BuilderComponentProvider, SectionProvider, I18nProvider, BuilderProvider, Render } from '@gem-sdk/core';
|
|
3
3
|
import { NextSeo } from 'next-seo';
|
|
4
4
|
import Head from 'next/head';
|
|
5
5
|
import { useRouter } from 'next/router';
|
|
@@ -12,6 +12,7 @@ import { useEffect } from 'react';
|
|
|
12
12
|
|
|
13
13
|
const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, dynamicDiscountOffer, isPreview, interaction, pageBackground })=>{
|
|
14
14
|
const router = useRouter();
|
|
15
|
+
const { t } = useI18n();
|
|
15
16
|
const baseAssetURL = process.env.NEXT_GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
|
|
16
17
|
useTrackingView(shopToken, pageHandle, router.isFallback);
|
|
17
18
|
const customCodeHeaderID = 'custom-code-header';
|
|
@@ -107,22 +108,25 @@ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, f
|
|
|
107
108
|
}),
|
|
108
109
|
/*#__PURE__*/ jsx(SectionProvider, {
|
|
109
110
|
data: sectionData,
|
|
110
|
-
children:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
children: /*#__PURE__*/ jsx(I18nProvider, {
|
|
112
|
+
t: t,
|
|
113
|
+
children: builderData?.map((builder)=>/*#__PURE__*/ jsxs(BuilderProvider, {
|
|
114
|
+
state: builder.data,
|
|
115
|
+
lazy: builder.lazy,
|
|
116
|
+
priority: builder.priority,
|
|
117
|
+
isPostPurchase: isPostPurchase,
|
|
118
|
+
isPreview: isPreview,
|
|
119
|
+
children: [
|
|
120
|
+
/*#__PURE__*/ jsx(Render, {
|
|
121
|
+
uid: builder.uid
|
|
122
|
+
}),
|
|
123
|
+
hasInteraction && /*#__PURE__*/ jsx(Script, {
|
|
124
|
+
defer: true,
|
|
125
|
+
src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
}, builder.uid))
|
|
129
|
+
})
|
|
126
130
|
}),
|
|
127
131
|
isPostPurchase && /*#__PURE__*/ jsx(FooterForPostPurchase, {
|
|
128
132
|
shopName: shopName || ''
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode, CollectionQueryResponse,
|
|
1
|
+
import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode, CollectionQueryResponse, ProductSelectFragment, ProductOffer, AppAPIType, PublicStoreFrontData, FetchFunc, ThemePageQueryResponse, StorePropertyQueryResponse, PublishedThemePageSelectFragment } from '@gem-sdk/core';
|
|
2
2
|
import { NextPage, GetStaticPaths } from 'next';
|
|
3
3
|
import * as next_seo from 'next-seo';
|
|
4
4
|
import { NextSeoProps } from 'next-seo';
|
|
5
5
|
import { AppProps } from 'next/app';
|
|
6
6
|
import { SWRConfig } from 'swr';
|
|
7
|
+
import * as React$1 from 'react';
|
|
8
|
+
import React__default, { Component } from 'react';
|
|
7
9
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
10
|
import { ShopMetaQueryResponse } from '@gem-sdk/adapter-shopify';
|
|
9
|
-
import * as react from 'react';
|
|
10
|
-
import { Component } from 'react';
|
|
11
11
|
|
|
12
12
|
type PageBuilderProps = {
|
|
13
13
|
seo?: NextSeoProps;
|
|
@@ -16,7 +16,7 @@ type PageBuilderProps = {
|
|
|
16
16
|
themeStyle?: string | null;
|
|
17
17
|
fontStyle?: string | null;
|
|
18
18
|
elementFontStyle?: string[] | null;
|
|
19
|
-
swr?:
|
|
19
|
+
swr?: React__default.ComponentProps<typeof SWRConfig>['value'];
|
|
20
20
|
plugins?: string[];
|
|
21
21
|
pageType?: ShopType.PublishedThemePageType;
|
|
22
22
|
storefrontToken?: string | null;
|
|
@@ -56,21 +56,53 @@ type PageBuilderPropsV2 = {
|
|
|
56
56
|
}[];
|
|
57
57
|
} & Omit<PageBuilderProps, 'builderData'>;
|
|
58
58
|
type AdditionalPageBuilderProps = {
|
|
59
|
-
components: Record<string,
|
|
59
|
+
components: Record<string, React__default.ComponentType<any>>;
|
|
60
60
|
};
|
|
61
61
|
type NextPageWithLayout<P = PageBuilderProps, IP = P> = NextPage<P, IP> & {
|
|
62
|
-
getLayout?: (page:
|
|
62
|
+
getLayout?: (page: React__default.ReactElement, pageProps?: any) => React__default.ReactNode;
|
|
63
63
|
};
|
|
64
64
|
type AppPropsWithLayout<P = PageBuilderProps> = AppProps<P> & {
|
|
65
65
|
Component: NextPageWithLayout;
|
|
66
66
|
};
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
type BuilderPageProps = {
|
|
68
|
+
components: Record<string, React__default.ComponentType<any>>;
|
|
69
|
+
seo?: NextSeoProps;
|
|
70
|
+
themeStyle?: string | null;
|
|
71
|
+
fontStyle?: string | null;
|
|
72
|
+
header?: BuilderState;
|
|
73
|
+
footer?: BuilderState;
|
|
74
|
+
sectionData?: Record<string, SectionData$1>;
|
|
75
|
+
storefrontToken?: string | null;
|
|
76
|
+
storefrontHandle?: string | null;
|
|
77
|
+
shopToken?: string | null;
|
|
78
|
+
mode?: RenderMode;
|
|
79
|
+
pageType: ShopType.PublishedThemePageType;
|
|
80
|
+
editorImageToLayout?: boolean;
|
|
81
|
+
isThemeSectionEditor?: boolean;
|
|
82
|
+
hiddenToolbar?: boolean;
|
|
83
|
+
pageName: string;
|
|
84
|
+
isOriginTemplate?: boolean;
|
|
85
|
+
};
|
|
86
|
+
type CollectionDetailPageProps = PageBuilderProps & {
|
|
69
87
|
collection?: CollectionQueryResponse['collection'];
|
|
70
88
|
};
|
|
71
|
-
|
|
89
|
+
type PreviewPageProps = {
|
|
90
|
+
components: Record<string, React__default.ComponentType<any>>;
|
|
91
|
+
pageType: ShopType.PublishedThemePageType;
|
|
92
|
+
};
|
|
93
|
+
type ProductPageProps = PageBuilderProps & {
|
|
94
|
+
product?: ProductSelectFragment;
|
|
95
|
+
};
|
|
96
|
+
type StaticPagePropsV2 = PageBuilderPropsV2 & {
|
|
97
|
+
isPostPurchase?: boolean;
|
|
98
|
+
shopName?: string;
|
|
99
|
+
productOffers?: ProductOffer[];
|
|
100
|
+
dynamicDiscountOffer?: AppAPIType.OfferDynamicDiscount;
|
|
101
|
+
publicStoreFrontData?: PublicStoreFrontData | null;
|
|
102
|
+
isPreview?: boolean;
|
|
103
|
+
};
|
|
72
104
|
|
|
73
|
-
declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<
|
|
105
|
+
declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<CollectionDetailPageProps>;
|
|
74
106
|
|
|
75
107
|
declare const getHomePageProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => () => Promise<PageBuilderProps>;
|
|
76
108
|
|
|
@@ -81,25 +113,10 @@ declare const getPreviewProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) =
|
|
|
81
113
|
type Props$4 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
|
|
82
114
|
declare const getBuilderProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => Promise<Props$4>;
|
|
83
115
|
|
|
84
|
-
type ProductPageProps = PageBuilderProps & {
|
|
85
|
-
product?: ProductSelectFragment;
|
|
86
|
-
};
|
|
87
|
-
declare const ProductDetailPage: React.FC<ProductPageProps & AdditionalPageBuilderProps>;
|
|
88
|
-
|
|
89
116
|
declare const getProductProps: (fetcher: FetchFunc) => (handle?: string) => Promise<ProductPageProps>;
|
|
90
117
|
|
|
91
118
|
declare const getStaticPagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
|
|
92
119
|
|
|
93
|
-
type StaticPagePropsV2 = PageBuilderPropsV2 & {
|
|
94
|
-
isPostPurchase?: boolean;
|
|
95
|
-
shopName?: string;
|
|
96
|
-
productOffers?: ProductOffer[];
|
|
97
|
-
dynamicDiscountOffer?: AppAPIType.OfferDynamicDiscount;
|
|
98
|
-
publicStoreFrontData?: PublicStoreFrontData | null;
|
|
99
|
-
isPreview?: boolean;
|
|
100
|
-
};
|
|
101
|
-
declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderProps>;
|
|
102
|
-
|
|
103
120
|
declare const getPostPurchasePropsPreview: (fetcher: FetchFunc, librarySaleFunnelID?: string, storeFrontFetcher?: FetchFunc) => (data: {
|
|
104
121
|
id: string;
|
|
105
122
|
currentOfferID: string;
|
|
@@ -205,7 +222,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
|
|
|
205
222
|
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
206
223
|
reset: () => void;
|
|
207
224
|
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
208
|
-
render(): string | number | boolean | Iterable<
|
|
225
|
+
render(): string | number | boolean | Iterable<React$1.ReactNode> | React$1.PromiseLikeOfReactNode | react_jsx_runtime.JSX.Element | null | undefined;
|
|
209
226
|
}
|
|
210
227
|
|
|
211
228
|
type Props$3 = {
|
|
@@ -233,34 +250,16 @@ type Props = {
|
|
|
233
250
|
};
|
|
234
251
|
declare const TikTokPixel: ({ pixelId }: Props) => react_jsx_runtime.JSX.Element | null;
|
|
235
252
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
pageType: ShopType.PublishedThemePageType;
|
|
239
|
-
};
|
|
253
|
+
declare const CollectionDetailPage: React.FC<CollectionDetailPageProps & AdditionalPageBuilderProps>;
|
|
254
|
+
|
|
240
255
|
declare const PreviewPage: React.FC<PreviewPageProps>;
|
|
241
256
|
|
|
242
|
-
|
|
243
|
-
|
|
257
|
+
declare const ProductDetailPage: React.FC<ProductPageProps & AdditionalPageBuilderProps>;
|
|
258
|
+
|
|
259
|
+
declare const StaticPage: React.FC<PageBuilderProps & AdditionalPageBuilderProps>;
|
|
244
260
|
|
|
245
|
-
type BuilderPageProps = {
|
|
246
|
-
components: Record<string, React.ComponentType<any>>;
|
|
247
|
-
seo?: NextSeoProps;
|
|
248
|
-
themeStyle?: string | null;
|
|
249
|
-
fontStyle?: string | null;
|
|
250
|
-
header?: BuilderState;
|
|
251
|
-
footer?: BuilderState;
|
|
252
|
-
sectionData?: Record<string, SectionData$1>;
|
|
253
|
-
storefrontToken?: string | null;
|
|
254
|
-
storefrontHandle?: string | null;
|
|
255
|
-
shopToken?: string | null;
|
|
256
|
-
mode?: RenderMode;
|
|
257
|
-
pageType: ShopType.PublishedThemePageType;
|
|
258
|
-
editorImageToLayout?: boolean;
|
|
259
|
-
isThemeSectionEditor?: boolean;
|
|
260
|
-
hiddenToolbar?: boolean;
|
|
261
|
-
pageName: string;
|
|
262
|
-
isOriginTemplate?: boolean;
|
|
263
|
-
};
|
|
264
261
|
declare const BuilderPage: React.FC<BuilderPageProps>;
|
|
265
262
|
|
|
266
|
-
|
|
263
|
+
declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderProps>;
|
|
264
|
+
|
|
265
|
+
export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PageBuilderPropsV2, PreviewPage, ProductDetailPage, StaticPage, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, genCSS, getBuilderProps, getCollectionProps, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFonts, getFontsFromDataBuilder, getHomePageProps, getHomePagePropsV2, getLayout, getPostPurchasePropsPreview, getPreviewProps, getProductProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, retryWithDelay, usePagePreview, useTrackingView };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.504",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"next": "14.2.20"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
29
|
+
"@gem-sdk/core": "2.0.0-dev.504",
|
|
30
30
|
"@gem-sdk/plugin-cookie-bar": "2.0.0-dev.348",
|
|
31
31
|
"@gem-sdk/plugin-quick-view": "2.0.0-dev.348",
|
|
32
32
|
"@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.348"
|