@gem-sdk/pages 17.0.0-dev.82 → 17.0.0-dev.84
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 +1 -1
- package/dist/cjs/layouts/main.js +1 -1
- package/dist/cjs/libs/api/get-builder-props.js +1 -0
- package/dist/cjs/libs/api/get-collection-props.js +1 -0
- package/dist/cjs/libs/api/get-collection-share-page-props.js +1 -0
- package/dist/cjs/libs/api/get-home-page-props-v2.js +1 -0
- package/dist/cjs/libs/api/get-home-page-props.js +1 -0
- package/dist/cjs/libs/api/get-post-purchase-props-preview.js +1 -0
- package/dist/cjs/libs/api/get-preview-content-props.js +1 -0
- package/dist/cjs/libs/api/get-preview-props.js +1 -0
- package/dist/cjs/libs/api/get-product-props.js +1 -0
- package/dist/cjs/libs/api/get-share-page-props.js +1 -0
- package/dist/cjs/libs/api/get-static-page-props-preview.js +1 -0
- package/dist/cjs/libs/api/get-static-page-props-v2.js +1 -0
- package/dist/cjs/libs/api/get-static-page-props.js +1 -0
- package/dist/cjs/libs/custom-fonts.js +8 -0
- package/dist/cjs/libs/data/fonts.js +1 -0
- package/dist/cjs/libs/getStaticPaths.js +1 -0
- package/dist/cjs/libs/google-fonts.js +7 -1
- package/dist/cjs/libs/helpers/gen-favicon.js +1 -0
- package/dist/cjs/libs/helpers/generate-seo-links.js +1 -0
- package/dist/cjs/libs/helpers/get-metafield.js +1 -0
- package/dist/cjs/libs/helpers/normalize.js +1 -1
- package/dist/cjs/libs/helpers/parse-json.js +1 -1
- package/dist/cjs/pages/preview-template.js +2 -2
- package/dist/cjs/pages/static-v2.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/layouts/main.js +1 -1
- package/dist/esm/libs/api/get-builder-props.js +1 -0
- package/dist/esm/libs/api/get-collection-props.js +1 -0
- package/dist/esm/libs/api/get-collection-share-page-props.js +1 -0
- package/dist/esm/libs/api/get-home-page-props-v2.js +1 -0
- package/dist/esm/libs/api/get-home-page-props.js +1 -0
- package/dist/esm/libs/api/get-post-purchase-props-preview.js +1 -0
- package/dist/esm/libs/api/get-preview-content-props.js +1 -0
- package/dist/esm/libs/api/get-preview-props.js +1 -0
- package/dist/esm/libs/api/get-product-props.js +1 -0
- package/dist/esm/libs/api/get-share-page-props.js +1 -0
- package/dist/esm/libs/api/get-static-page-props-preview.js +1 -0
- package/dist/esm/libs/api/get-static-page-props-v2.js +1 -0
- package/dist/esm/libs/api/get-static-page-props.js +1 -0
- package/dist/esm/libs/custom-fonts.js +8 -0
- package/dist/esm/libs/data/fonts.js +1 -0
- package/dist/esm/libs/getStaticPaths.js +1 -0
- package/dist/esm/libs/google-fonts.js +7 -1
- package/dist/esm/libs/helpers/gen-favicon.js +1 -0
- package/dist/esm/libs/helpers/generate-seo-links.js +1 -0
- package/dist/esm/libs/helpers/get-metafield.js +1 -0
- package/dist/esm/libs/helpers/normalize.js +1 -1
- package/dist/esm/libs/helpers/parse-json.js +1 -1
- package/dist/esm/pages/preview-template.js +3 -3
- package/dist/esm/pages/static-v2.js +3 -3
- package/dist/types/index.d.ts +125 -90
- package/package.json +9 -21
- package/dist/cjs/server.js +0 -14
- package/dist/esm/server.js +0 -14
- package/dist/types/server.d.ts +0 -156
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import{useI18n as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import{useI18n as r,PageProvider as a,BuilderComponentProvider as n,I18nProvider as l,SectionProvider as i,LazyPriorityProvider as o,BuilderProvider as p,Render as c}from"@gem-sdk/core";import{NextSeo as d}from"next-seo";import g from"next/head";import{useRouter as m}from"next/router";import{parseHtml as u}from"../libs/parse-html.js";import h from"../components/builder/Header.js";import f from"../components/FooterForPostPurchase.js";import y from"next/script";import{useEffect as _}from"react";import{usePageViewedTracking as b}from"../libs/hooks/usePageViewedTracking.js";let v=({components:v,builderData:S,sectionData:x,seo:P,themeStyle:k,fontStyle:N,elementFontStyle:T,customCodeHeader:j,customFonts:H,isPostPurchase:I,shopName:L,productOffers:M,publicStoreFrontData:$,dynamicDiscountOffer:E,isPreview:q,interaction:w,pageBackground:A,sellingPlanSetting:F,buyerConsentPreCheck:O,id:z,shopID:C,domainTrackingIlp:D,disableGsFont:U})=>{let B=m(),{t:R}=r(),V=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";b({id:z,shopID:C,domain:D});let G="custom-code-header";if(_(()=>{let e=document.querySelectorAll(`[class*="${G}-"]`),t=[];e.length>1&&e.forEach(e=>{let s=e.className;if(t.includes(s)){e.remove();return}t.push(s)})},[]),B.isFallback)return e("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:t("div",{className:"gp-flex gp-gap-2",children:[e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})});let J=(w?.value||[]).length>0;return t(s,{children:[e(d,{...P}),t(g,{children:[u(G,j,!0),k&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:k}},"global-style"),N&&!U&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:N}},"google-fonts"),T&&T.map(t=>e("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),H&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:H}},N),A?.isUsePageBackground&&A?.background&&e("style",{children:`
|
|
2
2
|
body {
|
|
3
|
-
background: ${
|
|
3
|
+
background: ${A.background};
|
|
4
4
|
}
|
|
5
|
-
`},`page_background_${
|
|
5
|
+
`},`page_background_${A?.background}`)]}),e(a,{productOffers:M,publicStoreFrontData:$,dynamicDiscountOffer:E,sellingPlanMeta:F,buyerConsentChecked:O,children:e(n,{components:v,children:e(l,{t:R,children:t("div",{className:`${I?"gp-bg-white post-purchase-page":""} `,role:"main",children:[I&&e(h,{pageType:"POST_PURCHASE"}),J&&e("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(w?.value||[])}</div>`}}),e(i,{data:x,children:S?.map((s,r)=>e(o,{priority:!!s.priority||0===r,children:t(p,{state:s.data,lazy:s.lazy,priority:s.priority,isPostPurchase:I,isPreview:q,children:[e(c,{uid:s.uid}),J&&e(y,{defer:!0,src:`${V}/assets-v2/gp-flow-action-lip-v7-5.js`})]})},s.uid))}),I&&e(f,{shopName:L||""})]})})})})]})};export{v as StaticPageV2};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,97 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode, CollectionQueryResponse, PublicStoreFrontData, ProductSelectFragment, ProductOffer, AppAPIType, FetchFunc, ThemePageQueryResponse, StorePropertyQueryResponse, PublishedThemePageSelectFragment, TypographyV2FontFamilyType } from '@gem-sdk/core';
|
|
2
|
+
import { NextPage, GetStaticPaths } from 'next';
|
|
3
3
|
import * as next_seo from 'next-seo';
|
|
4
4
|
import { NextSeoProps } from 'next-seo';
|
|
5
|
-
import { ShopMetaQueryResponse } from '@gem-sdk/adapter-shopify';
|
|
6
|
-
import { NextPage } from 'next';
|
|
7
5
|
import { AppProps } from 'next/app';
|
|
8
6
|
import { SWRConfig } from 'swr';
|
|
9
7
|
import * as React$1 from 'react';
|
|
10
8
|
import React__default, { Component } from 'react';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
declare const createAppAPIFetcher: (token?: string | null, shopID?: string) => FetchFunc;
|
|
14
|
-
declare const createShopifyFetcher: (storefrontToken?: string, handle?: string) => FetchFunc;
|
|
15
|
-
declare const createTemplateFetcher: (handle: string) => FetchFunc;
|
|
16
|
-
|
|
17
|
-
declare const getLayout: (page: React.ReactElement, pageProps?: any) => react_jsx_runtime.JSX.Element;
|
|
18
|
-
|
|
19
|
-
declare const genCSS: (input?: string | Record<string, any>, mobileOnly?: boolean) => string;
|
|
20
|
-
|
|
21
|
-
type SendPageViewedTrackingParams = {
|
|
22
|
-
id: string | number | null | undefined;
|
|
23
|
-
shopID: string | number | null | undefined;
|
|
24
|
-
domain?: string;
|
|
25
|
-
};
|
|
26
|
-
declare const sendPageViewedTracking: (params: SendPageViewedTrackingParams) => void;
|
|
27
|
-
|
|
28
|
-
declare const usePagePreview: (dataBuilder: ThemePageQueryResponse["themePage"], storeProperty: PromiseSettledResult<StorePropertyQueryResponse>, shopifyMeta?: PromiseSettledResult<ShopMetaQueryResponse>) => {
|
|
29
|
-
seo: next_seo.NextSeoProps;
|
|
30
|
-
pageConfig: {
|
|
31
|
-
mobileOnly: boolean;
|
|
32
|
-
locale: string | null;
|
|
33
|
-
languageIsoCode: ("ID" | "AF" | "AM" | "AR" | "AZ" | "BE" | "BG" | "BM" | "BN" | "BO" | "BR" | "BS" | "CA" | "CU" | "CY" | "DE" | "DZ" | "EE" | "ES" | "ET" | "FI" | "FO" | "FR" | "GA" | "GD" | "GL" | "HR" | "HU" | "IS" | "IT" | "KI" | "KM" | "KN" | "KW" | "KY" | "LA" | "LB" | "LT" | "LU" | "LV" | "MG" | "MK" | "ML" | "MN" | "MO" | "MR" | "MS" | "MT" | "MY" | "NE" | "NL" | "NO" | "OM" | "PA" | "PL" | "PS" | "PT" | "RO" | "RU" | "RW" | "SA" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SK" | "SL" | "SN" | "SO" | "SR" | "SV" | "TA" | "TG" | "TH" | "TK" | "TO" | "TR" | "TT" | "UG" | "UZ" | "AK" | "AS" | "CE" | "CKB" | "CS" | "DA" | "EL" | "EN" | "EO" | "EU" | "FA" | "FF" | "FIL" | "FY" | "GU" | "GV" | "HA" | "HE" | "HI" | "HY" | "IA" | "IG" | "II" | "JA" | "JV" | "KA" | "KK" | "KL" | "KO" | "KS" | "KU" | "LG" | "LN" | "LO" | "MI" | "NB" | "ND" | "NN" | "OR" | "OS" | "PT_BR" | "PT_PT" | "QU" | "RM" | "RN" | "SQ" | "SU" | "SW" | "TE" | "TI" | "UK" | "UR" | "VI" | "VO" | "WO" | "XH" | "YI" | "YO" | "ZH" | "ZH_CN" | "ZH_TW" | "ZU") | null;
|
|
34
|
-
countryIsoCode: ("ID" | "AC" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AN" | "AO" | "AR" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MK" | "ML" | "MM" | "MN" | "MO" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PS" | "PT" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TA" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW" | "ZZ") | null;
|
|
35
|
-
moneyFormat: string | null;
|
|
36
|
-
currency: ("AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BYR" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KID" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VEF" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "XXX" | "YER" | "ZAR" | "ZMW") | null;
|
|
37
|
-
swatches: any;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
type IUsePageViewedTrackingParams = {
|
|
42
|
-
id?: string | number | null;
|
|
43
|
-
shopID?: string | number | null;
|
|
44
|
-
enabled?: boolean;
|
|
45
|
-
domain?: string;
|
|
46
|
-
};
|
|
47
|
-
declare const usePageViewedTracking: ({ id, shopID, enabled, domain, }: IUsePageViewedTrackingParams) => void;
|
|
48
|
-
|
|
49
|
-
declare function isBot(input: string): boolean;
|
|
50
|
-
|
|
51
|
-
type SectionData = {
|
|
52
|
-
id: string;
|
|
53
|
-
component?: string;
|
|
54
|
-
[key: string]: any;
|
|
55
|
-
};
|
|
56
|
-
declare function normalizePageSectionResponseV2(sections?: ShopType.Maybe<SectionData>[], orders?: string[]): {
|
|
57
|
-
uid: string;
|
|
58
|
-
lazy: boolean;
|
|
59
|
-
priority: boolean;
|
|
60
|
-
data: any;
|
|
61
|
-
}[];
|
|
62
|
-
type ParseBuilderTemplateV2Props = PublishedThemePageSelectFragment & {
|
|
63
|
-
themeSections?: {
|
|
64
|
-
id: string;
|
|
65
|
-
name: string;
|
|
66
|
-
content: string;
|
|
67
|
-
}[];
|
|
68
|
-
};
|
|
69
|
-
declare const parseBuilderTemplateV2: (data?: ParseBuilderTemplateV2Props) => {
|
|
70
|
-
uid: string;
|
|
71
|
-
lazy: boolean;
|
|
72
|
-
priority: boolean;
|
|
73
|
-
data: any;
|
|
74
|
-
}[];
|
|
75
|
-
|
|
76
|
-
declare const getFallbackV2: (fetcher: FetchFunc, data: {
|
|
77
|
-
data: any;
|
|
78
|
-
}[], isStorefront?: boolean, disableIsSample?: boolean) => Promise<{}>;
|
|
79
|
-
|
|
80
|
-
type RetryConfig = {
|
|
81
|
-
retries?: number;
|
|
82
|
-
delay?: number;
|
|
83
|
-
retryIf?: (error: any) => boolean;
|
|
84
|
-
};
|
|
85
|
-
declare const retryWithDelay: <T = unknown>(fn: () => T, config?: RetryConfig) => Promise<T>;
|
|
86
|
-
|
|
87
|
-
type Props$4 = {
|
|
88
|
-
trackingId?: string | null;
|
|
89
|
-
params?: {
|
|
90
|
-
page_id?: string;
|
|
91
|
-
source_shop_id?: string;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
declare const SharePageTracking: ({ trackingId, params }: Props$4) => react_jsx_runtime.JSX.Element | null;
|
|
9
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
10
|
+
import { ShopMetaQueryResponse } from '@gem-sdk/adapter-shopify';
|
|
95
11
|
|
|
96
12
|
type PageBuilderProps = {
|
|
97
13
|
seo?: NextSeoProps;
|
|
@@ -260,6 +176,125 @@ type SharePageProps = PageBuilderPropsV2 & {
|
|
|
260
176
|
trackingId?: string | null;
|
|
261
177
|
};
|
|
262
178
|
|
|
179
|
+
declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<CollectionDetailPageProps>;
|
|
180
|
+
|
|
181
|
+
declare const getCollectionSharePageProps: (fetcher: FetchFunc) => (baseId?: string) => Promise<{
|
|
182
|
+
collection: any;
|
|
183
|
+
}>;
|
|
184
|
+
|
|
185
|
+
declare const getHomePageProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => () => Promise<PageBuilderProps>;
|
|
186
|
+
|
|
187
|
+
declare const getHomePagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => () => Promise<PageBuilderPropsV2>;
|
|
188
|
+
|
|
189
|
+
declare const getPreviewProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (pageType: ShopType.PublishedThemePageType, slug?: string) => Promise<PageBuilderProps>;
|
|
190
|
+
|
|
191
|
+
type Props$5 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
|
|
192
|
+
declare const getBuilderProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => Promise<Props$5>;
|
|
193
|
+
|
|
194
|
+
declare const getProductProps: (fetcher: FetchFunc) => (handle?: string) => Promise<ProductPageProps>;
|
|
195
|
+
|
|
196
|
+
declare const getStaticPagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
|
|
197
|
+
|
|
198
|
+
declare const getSharePageProps: (fetcher: FetchFunc) => (slug: string) => Promise<SharePageProps | null>;
|
|
199
|
+
|
|
200
|
+
declare const getPostPurchasePropsPreview: (fetcher: FetchFunc, librarySaleFunnelID?: string, storeFrontFetcher?: FetchFunc) => (data: {
|
|
201
|
+
id: string;
|
|
202
|
+
currentOfferID: string;
|
|
203
|
+
isLibraryTemplate?: boolean;
|
|
204
|
+
isShopLibraryPage?: boolean;
|
|
205
|
+
sellingPlanSetting?: Record<string, any>;
|
|
206
|
+
}) => Promise<Omit<StaticPagePropsV2, "publicStoreFrontData">>;
|
|
207
|
+
|
|
208
|
+
declare const getStaticPagePropsPreview: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
|
|
209
|
+
|
|
210
|
+
declare const getSharePageContentProps: (fetcher: FetchFunc) => (slug: string) => Promise<SharePageProps | null>;
|
|
211
|
+
|
|
212
|
+
declare const createFetcher: (token?: string | null) => FetchFunc;
|
|
213
|
+
declare const createAppAPIFetcher: (token?: string | null, shopID?: string) => FetchFunc;
|
|
214
|
+
declare const createShopifyFetcher: (storefrontToken?: string, handle?: string) => FetchFunc;
|
|
215
|
+
declare const createTemplateFetcher: (handle: string) => FetchFunc;
|
|
216
|
+
|
|
217
|
+
declare const getLayout: (page: React.ReactElement, pageProps?: any) => react_jsx_runtime.JSX.Element;
|
|
218
|
+
|
|
219
|
+
declare const genCSS: (input?: string | Record<string, any>, mobileOnly?: boolean) => string;
|
|
220
|
+
|
|
221
|
+
type SendPageViewedTrackingParams = {
|
|
222
|
+
id: string | number | null | undefined;
|
|
223
|
+
shopID: string | number | null | undefined;
|
|
224
|
+
domain?: string;
|
|
225
|
+
};
|
|
226
|
+
declare const sendPageViewedTracking: (params: SendPageViewedTrackingParams) => void;
|
|
227
|
+
|
|
228
|
+
declare const usePagePreview: (dataBuilder: ThemePageQueryResponse["themePage"], storeProperty: PromiseSettledResult<StorePropertyQueryResponse>, shopifyMeta?: PromiseSettledResult<ShopMetaQueryResponse>) => {
|
|
229
|
+
seo: next_seo.NextSeoProps;
|
|
230
|
+
pageConfig: {
|
|
231
|
+
mobileOnly: boolean;
|
|
232
|
+
locale: string | null;
|
|
233
|
+
languageIsoCode: ("ID" | "AF" | "AM" | "AR" | "AZ" | "BE" | "BG" | "BM" | "BN" | "BO" | "BR" | "BS" | "CA" | "CU" | "CY" | "DE" | "DZ" | "EE" | "ES" | "ET" | "FI" | "FO" | "FR" | "GA" | "GD" | "GL" | "HR" | "HU" | "IS" | "IT" | "KI" | "KM" | "KN" | "KW" | "KY" | "LA" | "LB" | "LT" | "LU" | "LV" | "MG" | "MK" | "ML" | "MN" | "MO" | "MR" | "MS" | "MT" | "MY" | "NE" | "NL" | "NO" | "OM" | "PA" | "PL" | "PS" | "PT" | "RO" | "RU" | "RW" | "SA" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SK" | "SL" | "SN" | "SO" | "SR" | "SV" | "TA" | "TG" | "TH" | "TK" | "TO" | "TR" | "TT" | "UG" | "UZ" | "AK" | "AS" | "CE" | "CKB" | "CS" | "DA" | "EL" | "EN" | "EO" | "EU" | "FA" | "FF" | "FIL" | "FY" | "GU" | "GV" | "HA" | "HE" | "HI" | "HY" | "IA" | "IG" | "II" | "JA" | "JV" | "KA" | "KK" | "KL" | "KO" | "KS" | "KU" | "LG" | "LN" | "LO" | "MI" | "NB" | "ND" | "NN" | "OR" | "OS" | "PT_BR" | "PT_PT" | "QU" | "RM" | "RN" | "SQ" | "SU" | "SW" | "TE" | "TI" | "UK" | "UR" | "VI" | "VO" | "WO" | "XH" | "YI" | "YO" | "ZH" | "ZH_CN" | "ZH_TW" | "ZU") | null;
|
|
234
|
+
countryIsoCode: ("ID" | "AC" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AN" | "AO" | "AR" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MK" | "ML" | "MM" | "MN" | "MO" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PS" | "PT" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TA" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW" | "ZZ") | null;
|
|
235
|
+
moneyFormat: string | null;
|
|
236
|
+
currency: ("AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BYR" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KID" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VEF" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "XXX" | "YER" | "ZAR" | "ZMW") | null;
|
|
237
|
+
swatches: any;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
type IUsePageViewedTrackingParams = {
|
|
242
|
+
id?: string | number | null;
|
|
243
|
+
shopID?: string | number | null;
|
|
244
|
+
enabled?: boolean;
|
|
245
|
+
domain?: string;
|
|
246
|
+
};
|
|
247
|
+
declare const usePageViewedTracking: ({ id, shopID, enabled, domain, }: IUsePageViewedTrackingParams) => void;
|
|
248
|
+
|
|
249
|
+
declare function isBot(input: string): boolean;
|
|
250
|
+
|
|
251
|
+
type SectionData = {
|
|
252
|
+
id: string;
|
|
253
|
+
component?: string;
|
|
254
|
+
[key: string]: any;
|
|
255
|
+
};
|
|
256
|
+
declare function normalizePageSectionResponseV2(sections?: ShopType.Maybe<SectionData>[], orders?: string[]): {
|
|
257
|
+
uid: string;
|
|
258
|
+
lazy: boolean;
|
|
259
|
+
priority: boolean;
|
|
260
|
+
data: any;
|
|
261
|
+
}[];
|
|
262
|
+
type ParseBuilderTemplateV2Props = PublishedThemePageSelectFragment & {
|
|
263
|
+
themeSections?: {
|
|
264
|
+
id: string;
|
|
265
|
+
name: string;
|
|
266
|
+
content: string;
|
|
267
|
+
}[];
|
|
268
|
+
};
|
|
269
|
+
declare const parseBuilderTemplateV2: (data?: ParseBuilderTemplateV2Props) => {
|
|
270
|
+
uid: string;
|
|
271
|
+
lazy: boolean;
|
|
272
|
+
priority: boolean;
|
|
273
|
+
data: any;
|
|
274
|
+
}[];
|
|
275
|
+
|
|
276
|
+
declare const getFallbackV2: (fetcher: FetchFunc, data: {
|
|
277
|
+
data: any;
|
|
278
|
+
}[], isStorefront?: boolean, disableIsSample?: boolean) => Promise<{}>;
|
|
279
|
+
|
|
280
|
+
type RetryConfig = {
|
|
281
|
+
retries?: number;
|
|
282
|
+
delay?: number;
|
|
283
|
+
retryIf?: (error: any) => boolean;
|
|
284
|
+
};
|
|
285
|
+
declare const retryWithDelay: <T = unknown>(fn: () => T, config?: RetryConfig) => Promise<T>;
|
|
286
|
+
|
|
287
|
+
type Props$4 = {
|
|
288
|
+
trackingId?: string | null;
|
|
289
|
+
params?: {
|
|
290
|
+
page_id?: string;
|
|
291
|
+
source_shop_id?: string;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
declare const SharePageTracking: ({ trackingId, params }: Props$4) => react_jsx_runtime.JSX.Element | null;
|
|
295
|
+
|
|
296
|
+
declare const getStaticPaths: GetStaticPaths;
|
|
297
|
+
|
|
263
298
|
type FontType = 'bunny' | 'google';
|
|
264
299
|
|
|
265
300
|
type FontItem = {
|
|
@@ -305,7 +340,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
|
|
|
305
340
|
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
306
341
|
reset: () => void;
|
|
307
342
|
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
308
|
-
render(): string | number | bigint | boolean |
|
|
343
|
+
render(): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<React$1.AwaitedReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
309
344
|
}
|
|
310
345
|
|
|
311
346
|
type Props$3 = {
|
|
@@ -349,5 +384,5 @@ declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderPr
|
|
|
349
384
|
|
|
350
385
|
declare const PreviewTemplate: React.FC<SharePageProps & AdditionalPageBuilderProps>;
|
|
351
386
|
|
|
352
|
-
export { BuilderPage, BuilderUpsellPage, CollectionDetailPage, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, Page404, Page500, PreviewPage, PreviewTemplate, ProductDetailPage, SharePageTracking, StaticPage, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, createTemplateFetcher, genCSS, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFontLinkFromGlobalStyle, getFonts, getFontsFromDataBuilder, getLayout, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, retryWithDelay, sendPageViewedTracking, usePagePreview, usePageViewedTracking };
|
|
387
|
+
export { BuilderPage, BuilderUpsellPage, CollectionDetailPage, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, Page404, Page500, PreviewPage, PreviewTemplate, ProductDetailPage, SharePageTracking, StaticPage, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, createTemplateFetcher, genCSS, getBuilderProps, getCollectionProps, getCollectionSharePageProps, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFontLinkFromGlobalStyle, getFonts, getFontsFromDataBuilder, getHomePageProps, getHomePagePropsV2, getLayout, getPostPurchasePropsPreview, getPreviewProps, getProductProps, getSharePageContentProps, getSharePageProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, retryWithDelay, sendPageViewedTracking, usePagePreview, usePageViewedTracking };
|
|
353
388
|
export type { AppPropsWithLayout, NextPageWithLayout, PageBuilderProps, PageBuilderPropsV2, SharePageAPIResponse, SharePageProps, StaticPagePropsV2 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "17.0.0-dev.
|
|
3
|
+
"version": "17.0.0-dev.84",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"cleanup": "rimraf es dist lib",
|
|
12
12
|
"prebuild": "yarn cleanup",
|
|
13
|
-
"pre:publish": "node
|
|
14
|
-
"post:publish": "node
|
|
15
|
-
"watch": "rollup -c
|
|
16
|
-
"build": "rollup -c
|
|
13
|
+
"pre:publish": "node ./../../helpers/convert-publish.js -p",
|
|
14
|
+
"post:publish": "node ./../../helpers/convert-publish.js",
|
|
15
|
+
"watch": "rollup -c ./../../helpers/rollup.config.mjs -w",
|
|
16
|
+
"build": "rollup -c ./../../helpers/rollup.config.mjs --environment NODE_ENV:production",
|
|
17
17
|
"lint": "oxlint --format=stylish ./src",
|
|
18
18
|
"type-check": "yarn tsc --noEmit",
|
|
19
19
|
"test": "jest -c ./../../helpers/jest.config.ts",
|
|
@@ -27,21 +27,14 @@
|
|
|
27
27
|
"next": "14.2.35"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@gem-sdk/core": "17.0.0-dev.
|
|
31
|
-
"@gem-sdk/plugin-cookie-bar": "17.0.0-dev.
|
|
32
|
-
"@gem-sdk/plugin-quick-view": "17.0.0-dev.
|
|
33
|
-
"@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.
|
|
30
|
+
"@gem-sdk/core": "17.0.0-dev.84",
|
|
31
|
+
"@gem-sdk/plugin-cookie-bar": "17.0.0-dev.84",
|
|
32
|
+
"@gem-sdk/plugin-quick-view": "17.0.0-dev.84",
|
|
33
|
+
"@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.84"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"next": "14.2.35"
|
|
37
37
|
},
|
|
38
|
-
"typesVersions": {
|
|
39
|
-
"*": {
|
|
40
|
-
"server": [
|
|
41
|
-
"./dist/types/server.d.ts"
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
38
|
"module": "dist/esm/index.js",
|
|
46
39
|
"types": "dist/types/index.d.ts",
|
|
47
40
|
"exports": {
|
|
@@ -50,11 +43,6 @@
|
|
|
50
43
|
"import": "./dist/esm/index.js",
|
|
51
44
|
"require": "./dist/cjs/index.js",
|
|
52
45
|
"types": "./dist/types/index.d.ts"
|
|
53
|
-
},
|
|
54
|
-
"./server": {
|
|
55
|
-
"import": "./dist/esm/server.js",
|
|
56
|
-
"require": "./dist/cjs/server.js",
|
|
57
|
-
"types": "./dist/types/server.d.ts"
|
|
58
46
|
}
|
|
59
47
|
}
|
|
60
48
|
}
|