@gem-sdk/pages 1.9.52 → 1.9.60
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/index.js
CHANGED
|
@@ -14,6 +14,8 @@ var getLayout = require('./libs/get-layout.js');
|
|
|
14
14
|
var genCss = require('./libs/helpers/gen-css.js');
|
|
15
15
|
var useTrackingView = require('./libs/hooks/use-tracking-view.js');
|
|
16
16
|
var userAgent = require('./libs/helpers/user-agent.js');
|
|
17
|
+
var normalize = require('./libs/helpers/normalize.js');
|
|
18
|
+
var getFallback = require('./libs/helpers/get-fallback.js');
|
|
17
19
|
var collectionDetail = require('./pages/collection-detail.js');
|
|
18
20
|
var preview = require('./pages/preview.js');
|
|
19
21
|
var productDetail = require('./pages/product-detail.js');
|
|
@@ -48,6 +50,9 @@ exports.getLayout = getLayout.getLayout;
|
|
|
48
50
|
exports.genCSS = genCss.genCSS;
|
|
49
51
|
exports.useTrackingView = useTrackingView.useTrackingView;
|
|
50
52
|
exports.isBot = userAgent.isBot;
|
|
53
|
+
exports.normalizePageSectionResponseV2 = normalize.normalizePageSectionResponseV2;
|
|
54
|
+
exports.parseBuilderTemplateV2 = normalize.parseBuilderTemplateV2;
|
|
55
|
+
exports.getFallbackV2 = getFallback.getFallbackV2;
|
|
51
56
|
exports.CollectionDetailPage = collectionDetail.default;
|
|
52
57
|
exports.PreviewPage = preview.PreviewPage;
|
|
53
58
|
exports.ProductDetailPage = productDetail.default;
|
|
@@ -85,5 +85,6 @@ const parseBuilderTemplate = (data)=>{
|
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
exports.normalizeBuilderData = normalizeBuilderData;
|
|
88
|
+
exports.normalizePageSectionResponseV2 = normalizePageSectionResponseV2;
|
|
88
89
|
exports.parseBuilderTemplate = parseBuilderTemplate;
|
|
89
90
|
exports.parseBuilderTemplateV2 = parseBuilderTemplateV2;
|
package/dist/esm/index.js
CHANGED
|
@@ -12,6 +12,8 @@ export { getLayout } from './libs/get-layout.js';
|
|
|
12
12
|
export { genCSS } from './libs/helpers/gen-css.js';
|
|
13
13
|
export { useTrackingView } from './libs/hooks/use-tracking-view.js';
|
|
14
14
|
export { isBot } from './libs/helpers/user-agent.js';
|
|
15
|
+
export { normalizePageSectionResponseV2, parseBuilderTemplateV2 } from './libs/helpers/normalize.js';
|
|
16
|
+
export { getFallbackV2 } from './libs/helpers/get-fallback.js';
|
|
15
17
|
export { default as CollectionDetailPage } from './pages/collection-detail.js';
|
|
16
18
|
export { PreviewPage } from './pages/preview.js';
|
|
17
19
|
export { default as ProductDetailPage } from './pages/product-detail.js';
|
|
@@ -82,4 +82,4 @@ const parseBuilderTemplate = (data)=>{
|
|
|
82
82
|
], data?.sectionPosition);
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
export { normalizeBuilderData, parseBuilderTemplate, parseBuilderTemplateV2 };
|
|
85
|
+
export { normalizeBuilderData, normalizePageSectionResponseV2, parseBuilderTemplate, parseBuilderTemplateV2 };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuilderState, SectionData, ShopType, RenderMode, CollectionQueryResponse, FetchFunc, ProductSelectFragment } from '@gem-sdk/core';
|
|
1
|
+
import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode, CollectionQueryResponse, FetchFunc, ProductSelectFragment, PublishedThemePageSelectFragment } from '@gem-sdk/core';
|
|
2
2
|
import { NextPage, GetStaticPaths } from 'next';
|
|
3
3
|
import { NextSeoProps } from 'next-seo';
|
|
4
4
|
import { AppProps } from 'next/app';
|
|
@@ -9,7 +9,7 @@ import { Component } from 'react';
|
|
|
9
9
|
type PageBuilderProps = {
|
|
10
10
|
seo?: NextSeoProps;
|
|
11
11
|
builderData?: BuilderState;
|
|
12
|
-
sectionData?: Record<string, SectionData>;
|
|
12
|
+
sectionData?: Record<string, SectionData$1>;
|
|
13
13
|
themeStyle?: string | null;
|
|
14
14
|
fontStyle?: string | null;
|
|
15
15
|
swr?: React.ComponentProps<typeof SWRConfig>['value'];
|
|
@@ -92,6 +92,28 @@ declare const useTrackingView: (token?: string | null, handle?: string | null, i
|
|
|
92
92
|
|
|
93
93
|
declare function isBot(input: string): boolean;
|
|
94
94
|
|
|
95
|
+
type SectionData = {
|
|
96
|
+
id: string;
|
|
97
|
+
component?: string;
|
|
98
|
+
[key: string]: any;
|
|
99
|
+
};
|
|
100
|
+
declare function normalizePageSectionResponseV2(sections?: ShopType.Maybe<SectionData>[], orders?: string[]): {
|
|
101
|
+
uid: string;
|
|
102
|
+
lazy: boolean;
|
|
103
|
+
priority: boolean;
|
|
104
|
+
data: any;
|
|
105
|
+
}[];
|
|
106
|
+
declare const parseBuilderTemplateV2: (data?: PublishedThemePageSelectFragment) => {
|
|
107
|
+
uid: string;
|
|
108
|
+
lazy: boolean;
|
|
109
|
+
priority: boolean;
|
|
110
|
+
data: any;
|
|
111
|
+
}[];
|
|
112
|
+
|
|
113
|
+
declare const getFallbackV2: (fetcher: FetchFunc, data: {
|
|
114
|
+
data: any;
|
|
115
|
+
}[]) => Promise<{}>;
|
|
116
|
+
|
|
95
117
|
type PreviewPageProps = {
|
|
96
118
|
components: Record<string, React.ComponentType<any>>;
|
|
97
119
|
pageType: ShopType.PublishedThemePageType;
|
|
@@ -108,7 +130,7 @@ type BuilderPageProps = {
|
|
|
108
130
|
fontStyle?: string | null;
|
|
109
131
|
header?: BuilderState;
|
|
110
132
|
footer?: BuilderState;
|
|
111
|
-
sectionData?: Record<string, SectionData>;
|
|
133
|
+
sectionData?: Record<string, SectionData$1>;
|
|
112
134
|
storefrontToken?: string | null;
|
|
113
135
|
storefrontHandle?: string | null;
|
|
114
136
|
shopToken?: string | null;
|
|
@@ -183,4 +205,4 @@ type Props = {
|
|
|
183
205
|
};
|
|
184
206
|
declare const TikTokPixel: ({ pixelId }: Props) => JSX.Element | null;
|
|
185
207
|
|
|
186
|
-
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, getFontFromGlobalStyle, getFonts, getHomePageProps, getHomePagePropsV2, getLayout, getPreviewProps, getProductProps, getStaticPageProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, useTrackingView };
|
|
208
|
+
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, getFallbackV2, getFontFromGlobalStyle, getFonts, getHomePageProps, getHomePagePropsV2, getLayout, getPreviewProps, getProductProps, getStaticPageProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, useTrackingView };
|