@gem-sdk/pages 2.0.0-staging.152 → 2.0.0-staging.709
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/components/FooterForPostPurchase.js +1 -1
- package/dist/cjs/components/builder/Footer.js +2 -2
- package/dist/cjs/components/builder/Header.js +0 -1
- package/dist/cjs/components/builder/Toolbar.js +6 -0
- package/dist/cjs/components/builder/Toolbox.js +27 -14
- package/dist/cjs/components/composable/getListFontWeightTypos.js +14 -0
- package/dist/cjs/components/image-to-layout/AddSectionImageToLayout.js +5 -4
- package/dist/cjs/components/image-to-layout/DropElement.js +34 -9
- package/dist/cjs/constants/index.js +15 -0
- package/dist/cjs/libs/api/get-home-page-props-v2.js +20 -8
- package/dist/cjs/libs/api/get-home-page-props.js +15 -3
- package/dist/cjs/libs/api/get-post-purchase-props-preview.js +38 -5
- package/dist/cjs/libs/api/get-static-page-props-preview.js +5 -0
- package/dist/cjs/libs/api/get-static-page-props-v2.js +19 -10
- package/dist/cjs/libs/api/get-static-page-props.js +16 -3
- package/dist/cjs/libs/google-fonts.js +25 -5
- package/dist/cjs/libs/helpers/gen-fonts.js +9 -3
- package/dist/cjs/libs/helpers/get-metafield.js +7 -0
- package/dist/cjs/libs/helpers/normalize.js +2 -1
- package/dist/cjs/libs/helpers/parse-json.js +1 -1
- package/dist/cjs/libs/helpers/sentry.js +17 -0
- package/dist/cjs/pages/404.js +1 -0
- package/dist/cjs/pages/500.js +1 -0
- package/dist/cjs/pages/CollectionGlobalProvider.js +1 -0
- package/dist/cjs/pages/builder.js +46 -41
- package/dist/cjs/pages/collection-detail.js +1 -0
- package/dist/cjs/pages/preview.js +1 -0
- package/dist/cjs/pages/product-detail.js +1 -0
- package/dist/cjs/pages/static-v2.js +22 -17
- package/dist/cjs/pages/static.js +1 -0
- package/dist/esm/components/FooterForPostPurchase.js +1 -1
- package/dist/esm/components/builder/Footer.js +2 -2
- package/dist/esm/components/builder/Header.js +1 -2
- package/dist/esm/components/builder/Toolbar.js +6 -0
- package/dist/esm/components/builder/Toolbox.js +27 -14
- package/dist/esm/components/composable/getListFontWeightTypos.js +12 -0
- package/dist/esm/components/image-to-layout/AddSectionImageToLayout.js +6 -5
- package/dist/esm/components/image-to-layout/DropElement.js +34 -9
- package/dist/esm/constants/index.js +15 -0
- package/dist/esm/libs/api/get-home-page-props-v2.js +21 -9
- package/dist/esm/libs/api/get-home-page-props.js +16 -4
- package/dist/esm/libs/api/get-post-purchase-props-preview.js +39 -6
- package/dist/esm/libs/api/get-static-page-props-preview.js +5 -0
- package/dist/esm/libs/api/get-static-page-props-v2.js +19 -10
- package/dist/esm/libs/api/get-static-page-props.js +17 -4
- package/dist/esm/libs/google-fonts.js +25 -5
- package/dist/esm/libs/helpers/gen-fonts.js +9 -3
- package/dist/esm/libs/helpers/get-metafield.js +5 -0
- package/dist/esm/libs/helpers/normalize.js +2 -1
- package/dist/esm/libs/helpers/parse-json.js +1 -1
- package/dist/esm/libs/helpers/sentry.js +15 -0
- package/dist/esm/pages/404.js +1 -0
- package/dist/esm/pages/500.js +1 -0
- package/dist/esm/pages/CollectionGlobalProvider.js +1 -0
- package/dist/esm/pages/builder.js +47 -42
- package/dist/esm/pages/collection-detail.js +1 -0
- package/dist/esm/pages/preview.js +1 -0
- package/dist/esm/pages/product-detail.js +1 -0
- package/dist/esm/pages/static-v2.js +23 -18
- package/dist/esm/pages/static.js +1 -0
- package/dist/types/index.d.ts +61 -53
- package/package.json +6 -6
package/dist/types/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode,
|
|
1
|
+
import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode, ProductOffer, AppAPIType, PublicStoreFrontData, CollectionQueryResponse, ProductSelectFragment, 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;
|
|
@@ -40,7 +40,7 @@ type PageBuilderProps = {
|
|
|
40
40
|
customCodeBody?: string | null;
|
|
41
41
|
isStorefront?: boolean;
|
|
42
42
|
customFonts?: string | null;
|
|
43
|
-
interaction?: ShopType.Maybe<Pick<ShopType.PublishedPageInteraction,
|
|
43
|
+
interaction?: ShopType.Maybe<Pick<ShopType.PublishedPageInteraction, 'id' | 'value'>>;
|
|
44
44
|
timezone?: string;
|
|
45
45
|
pageBackground?: {
|
|
46
46
|
isUsePageBackground?: boolean;
|
|
@@ -56,21 +56,54 @@ 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
|
+
domain?: string;
|
|
104
|
+
};
|
|
72
105
|
|
|
73
|
-
declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<
|
|
106
|
+
declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<CollectionDetailPageProps>;
|
|
74
107
|
|
|
75
108
|
declare const getHomePageProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => () => Promise<PageBuilderProps>;
|
|
76
109
|
|
|
@@ -81,24 +114,10 @@ declare const getPreviewProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) =
|
|
|
81
114
|
type Props$4 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
|
|
82
115
|
declare const getBuilderProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => Promise<Props$4>;
|
|
83
116
|
|
|
84
|
-
type ProductPageProps = PageBuilderProps & {
|
|
85
|
-
product?: ProductSelectFragment;
|
|
86
|
-
};
|
|
87
|
-
declare const ProductDetailPage: React.FC<ProductPageProps & AdditionalPageBuilderProps>;
|
|
88
|
-
|
|
89
117
|
declare const getProductProps: (fetcher: FetchFunc) => (handle?: string) => Promise<ProductPageProps>;
|
|
90
118
|
|
|
91
119
|
declare const getStaticPagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
|
|
92
120
|
|
|
93
|
-
type StaticPagePropsV2 = PageBuilderPropsV2 & {
|
|
94
|
-
isPostPurchase?: boolean;
|
|
95
|
-
shopName?: string;
|
|
96
|
-
productOffers?: ProductOffer[];
|
|
97
|
-
publicStoreFrontData?: PublicStoreFrontData | null;
|
|
98
|
-
isPreview?: boolean;
|
|
99
|
-
};
|
|
100
|
-
declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderProps>;
|
|
101
|
-
|
|
102
121
|
declare const getPostPurchasePropsPreview: (fetcher: FetchFunc, librarySaleFunnelID?: string, storeFrontFetcher?: FetchFunc) => (data: {
|
|
103
122
|
id: string;
|
|
104
123
|
currentOfferID: string;
|
|
@@ -144,7 +163,14 @@ declare function normalizePageSectionResponseV2(sections?: ShopType.Maybe<Sectio
|
|
|
144
163
|
priority: boolean;
|
|
145
164
|
data: any;
|
|
146
165
|
}[];
|
|
147
|
-
|
|
166
|
+
type ParseBuilderTemplateV2Props = PublishedThemePageSelectFragment & {
|
|
167
|
+
themeSections?: {
|
|
168
|
+
id: string;
|
|
169
|
+
name: string;
|
|
170
|
+
content: string;
|
|
171
|
+
}[];
|
|
172
|
+
};
|
|
173
|
+
declare const parseBuilderTemplateV2: (data?: ParseBuilderTemplateV2Props) => {
|
|
148
174
|
uid: string;
|
|
149
175
|
lazy: boolean;
|
|
150
176
|
priority: boolean;
|
|
@@ -204,7 +230,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
|
|
|
204
230
|
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
205
231
|
reset: () => void;
|
|
206
232
|
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
207
|
-
render(): string | number | boolean | Iterable<
|
|
233
|
+
render(): string | number | boolean | Iterable<React$1.ReactNode> | React$1.PromiseLikeOfReactNode | react_jsx_runtime.JSX.Element | null | undefined;
|
|
208
234
|
}
|
|
209
235
|
|
|
210
236
|
type Props$3 = {
|
|
@@ -232,34 +258,16 @@ type Props = {
|
|
|
232
258
|
};
|
|
233
259
|
declare const TikTokPixel: ({ pixelId }: Props) => react_jsx_runtime.JSX.Element | null;
|
|
234
260
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
pageType: ShopType.PublishedThemePageType;
|
|
238
|
-
};
|
|
261
|
+
declare const CollectionDetailPage: React.FC<CollectionDetailPageProps & AdditionalPageBuilderProps>;
|
|
262
|
+
|
|
239
263
|
declare const PreviewPage: React.FC<PreviewPageProps>;
|
|
240
264
|
|
|
241
|
-
|
|
242
|
-
|
|
265
|
+
declare const ProductDetailPage: React.FC<ProductPageProps & AdditionalPageBuilderProps>;
|
|
266
|
+
|
|
267
|
+
declare const StaticPage: React.FC<PageBuilderProps & AdditionalPageBuilderProps>;
|
|
243
268
|
|
|
244
|
-
type BuilderPageProps = {
|
|
245
|
-
components: Record<string, React.ComponentType<any>>;
|
|
246
|
-
seo?: NextSeoProps;
|
|
247
|
-
themeStyle?: string | null;
|
|
248
|
-
fontStyle?: string | null;
|
|
249
|
-
header?: BuilderState;
|
|
250
|
-
footer?: BuilderState;
|
|
251
|
-
sectionData?: Record<string, SectionData$1>;
|
|
252
|
-
storefrontToken?: string | null;
|
|
253
|
-
storefrontHandle?: string | null;
|
|
254
|
-
shopToken?: string | null;
|
|
255
|
-
mode?: RenderMode;
|
|
256
|
-
pageType: ShopType.PublishedThemePageType;
|
|
257
|
-
editorImageToLayout?: boolean;
|
|
258
|
-
isThemeSectionEditor?: boolean;
|
|
259
|
-
hiddenToolbar?: boolean;
|
|
260
|
-
pageName: string;
|
|
261
|
-
isOriginTemplate?: boolean;
|
|
262
|
-
};
|
|
263
269
|
declare const BuilderPage: React.FC<BuilderPageProps>;
|
|
264
270
|
|
|
265
|
-
|
|
271
|
+
declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderProps>;
|
|
272
|
+
|
|
273
|
+
export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PageBuilderPropsV2, PreviewPage, ProductDetailPage, StaticPage, StaticPagePropsV2, 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-staging.
|
|
3
|
+
"version": "2.0.0-staging.709",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"deepmerge": "4.3.1",
|
|
24
24
|
"html-react-parser": "3.0.15",
|
|
25
25
|
"next-seo": "^6.0.0",
|
|
26
|
-
"next": "
|
|
26
|
+
"next": "14.2.20"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "2.0.0-staging.
|
|
30
|
-
"@gem-sdk/plugin-cookie-bar": "
|
|
31
|
-
"@gem-sdk/plugin-quick-view": "
|
|
32
|
-
"@gem-sdk/plugin-sticky-add-to-cart": "
|
|
29
|
+
"@gem-sdk/core": "2.0.0-staging.709",
|
|
30
|
+
"@gem-sdk/plugin-cookie-bar": "2.0.0-staging.709",
|
|
31
|
+
"@gem-sdk/plugin-quick-view": "2.0.0-staging.709",
|
|
32
|
+
"@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-staging.709"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"next": ">=13"
|