@gem-sdk/pages 17.0.0-dev.76 → 17.0.0-dev.81

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.
Files changed (51) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/libs/google-fonts.js +1 -7
  3. package/dist/cjs/libs/helpers/normalize.js +1 -1
  4. package/dist/cjs/libs/helpers/parse-json.js +1 -1
  5. package/dist/cjs/server.js +14 -0
  6. package/dist/esm/index.js +1 -1
  7. package/dist/esm/libs/google-fonts.js +1 -7
  8. package/dist/esm/libs/helpers/normalize.js +1 -1
  9. package/dist/esm/libs/helpers/parse-json.js +1 -1
  10. package/dist/esm/server.js +14 -0
  11. package/dist/types/index.d.ts +90 -125
  12. package/dist/types/server.d.ts +156 -0
  13. package/package.json +21 -9
  14. package/dist/cjs/libs/api/get-builder-props.js +0 -1
  15. package/dist/cjs/libs/api/get-collection-props.js +0 -1
  16. package/dist/cjs/libs/api/get-collection-share-page-props.js +0 -1
  17. package/dist/cjs/libs/api/get-home-page-props-v2.js +0 -1
  18. package/dist/cjs/libs/api/get-home-page-props.js +0 -1
  19. package/dist/cjs/libs/api/get-post-purchase-props-preview.js +0 -1
  20. package/dist/cjs/libs/api/get-preview-content-props.js +0 -1
  21. package/dist/cjs/libs/api/get-preview-props.js +0 -1
  22. package/dist/cjs/libs/api/get-product-props.js +0 -1
  23. package/dist/cjs/libs/api/get-share-page-props.js +0 -1
  24. package/dist/cjs/libs/api/get-static-page-props-preview.js +0 -1
  25. package/dist/cjs/libs/api/get-static-page-props-v2.js +0 -1
  26. package/dist/cjs/libs/api/get-static-page-props.js +0 -1
  27. package/dist/cjs/libs/custom-fonts.js +0 -8
  28. package/dist/cjs/libs/data/fonts.js +0 -1
  29. package/dist/cjs/libs/getStaticPaths.js +0 -1
  30. package/dist/cjs/libs/helpers/gen-favicon.js +0 -1
  31. package/dist/cjs/libs/helpers/generate-seo-links.js +0 -1
  32. package/dist/cjs/libs/helpers/get-metafield.js +0 -1
  33. package/dist/esm/libs/api/get-builder-props.js +0 -1
  34. package/dist/esm/libs/api/get-collection-props.js +0 -1
  35. package/dist/esm/libs/api/get-collection-share-page-props.js +0 -1
  36. package/dist/esm/libs/api/get-home-page-props-v2.js +0 -1
  37. package/dist/esm/libs/api/get-home-page-props.js +0 -1
  38. package/dist/esm/libs/api/get-post-purchase-props-preview.js +0 -1
  39. package/dist/esm/libs/api/get-preview-content-props.js +0 -1
  40. package/dist/esm/libs/api/get-preview-props.js +0 -1
  41. package/dist/esm/libs/api/get-product-props.js +0 -1
  42. package/dist/esm/libs/api/get-share-page-props.js +0 -1
  43. package/dist/esm/libs/api/get-static-page-props-preview.js +0 -1
  44. package/dist/esm/libs/api/get-static-page-props-v2.js +0 -1
  45. package/dist/esm/libs/api/get-static-page-props.js +0 -1
  46. package/dist/esm/libs/custom-fonts.js +0 -8
  47. package/dist/esm/libs/data/fonts.js +0 -1
  48. package/dist/esm/libs/getStaticPaths.js +0 -1
  49. package/dist/esm/libs/helpers/gen-favicon.js +0 -1
  50. package/dist/esm/libs/helpers/generate-seo-links.js +0 -1
  51. package/dist/esm/libs/helpers/get-metafield.js +0 -1
@@ -1,13 +1,97 @@
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';
1
+ import { FetchFunc, ThemePageQueryResponse, StorePropertyQueryResponse, ShopType, PublishedThemePageSelectFragment, BuilderState, SectionData as SectionData$1, RenderMode, CollectionQueryResponse, PublicStoreFrontData, ProductSelectFragment, ProductOffer, AppAPIType, TypographyV2FontFamilyType } from '@gem-sdk/core';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
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';
5
7
  import { AppProps } from 'next/app';
6
8
  import { SWRConfig } from 'swr';
7
9
  import * as React$1 from 'react';
8
10
  import React__default, { Component } from 'react';
9
- import * as react_jsx_runtime from 'react/jsx-runtime';
10
- import { ShopMetaQueryResponse } from '@gem-sdk/adapter-shopify';
11
+
12
+ declare const createFetcher: (token?: string | null) => FetchFunc;
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;
11
95
 
12
96
  type PageBuilderProps = {
13
97
  seo?: NextSeoProps;
@@ -176,125 +260,6 @@ type SharePageProps = PageBuilderPropsV2 & {
176
260
  trackingId?: string | null;
177
261
  };
178
262
 
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
-
298
263
  type FontType = 'bunny' | 'google';
299
264
 
300
265
  type FontItem = {
@@ -340,7 +305,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
340
305
  static getDerivedStateFromError(error: Error): ErrorBoundaryState;
341
306
  reset: () => void;
342
307
  componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
343
- render(): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<React$1.AwaitedReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
308
+ render(): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React$1.ReactNode> | Promise<React$1.AwaitedReactNode> | null | undefined;
344
309
  }
345
310
 
346
311
  type Props$3 = {
@@ -384,5 +349,5 @@ declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderPr
384
349
 
385
350
  declare const PreviewTemplate: React.FC<SharePageProps & AdditionalPageBuilderProps>;
386
351
 
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 };
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 };
388
353
  export type { AppPropsWithLayout, NextPageWithLayout, PageBuilderProps, PageBuilderPropsV2, SharePageAPIResponse, SharePageProps, StaticPagePropsV2 };
@@ -0,0 +1,156 @@
1
+ import { BuilderState, SectionData, ShopType, RenderMode, CollectionQueryResponse, ProductOffer, AppAPIType, PublicStoreFrontData, ProductSelectFragment, FetchFunc } from '@gem-sdk/core';
2
+ import { NextSeoProps } from 'next-seo';
3
+ import { SWRConfig } from 'swr';
4
+ import React from 'react';
5
+ import { GetStaticPaths } from 'next';
6
+
7
+ type PageBuilderProps = {
8
+ seo?: NextSeoProps;
9
+ builderData?: BuilderState;
10
+ sectionData?: Record<string, SectionData>;
11
+ themeStyle?: string | null;
12
+ fontStyle?: string | null;
13
+ elementFontStyle?: string[] | null;
14
+ swr?: React.ComponentProps<typeof SWRConfig>['value'];
15
+ plugins?: string[];
16
+ pageType?: ShopType.PublishedThemePageType;
17
+ storefrontToken?: string | null;
18
+ storefrontHandle?: string | null;
19
+ shopToken?: string | null;
20
+ pageHandle?: string | null;
21
+ currency?: string | null;
22
+ moneyFormat?: string | null;
23
+ moneyWithCurrencyFormat?: string | null;
24
+ locale?: string | null;
25
+ languageIsoCode?: string | null;
26
+ countryIsoCode?: string | null;
27
+ favicon?: string | null;
28
+ mobileOnly?: boolean | null;
29
+ swatches?: any[] | null;
30
+ mode?: RenderMode;
31
+ gaTrackingId?: string | null;
32
+ tiktokPixelId?: string | null;
33
+ facebookPixelId?: string | null;
34
+ customCodeHeader?: string | null;
35
+ customCodeBody?: string | null;
36
+ isStorefront?: boolean;
37
+ customFonts?: string | null;
38
+ interaction?: ShopType.Maybe<Pick<ShopType.PublishedPageInteraction, 'id' | 'value'>>;
39
+ timezone?: string;
40
+ pageBackground?: {
41
+ isUsePageBackground?: boolean;
42
+ background?: string;
43
+ };
44
+ id?: string | null;
45
+ shopID?: string | null;
46
+ };
47
+ type PageBuilderPropsV2 = {
48
+ builderData?: {
49
+ uid: string;
50
+ lazy?: boolean;
51
+ priority?: boolean;
52
+ data: BuilderState;
53
+ }[];
54
+ } & Omit<PageBuilderProps, 'builderData'>;
55
+ type CollectionDetailPageProps = PageBuilderProps & {
56
+ collection?: CollectionQueryResponse['collection'];
57
+ };
58
+ type ProductPageProps = PageBuilderProps & {
59
+ product?: ProductSelectFragment;
60
+ };
61
+ type StaticPagePropsV2 = PageBuilderPropsV2 & {
62
+ id?: string | null;
63
+ shopID?: string | null;
64
+ domainTrackingIlp?: string;
65
+ disableGsFont?: boolean;
66
+ isPostPurchase?: boolean;
67
+ shopName?: string;
68
+ productOffers?: ProductOffer[];
69
+ dynamicDiscountOffer?: AppAPIType.OfferDynamicDiscount;
70
+ publicStoreFrontData?: PublicStoreFrontData | null;
71
+ isPreview?: boolean;
72
+ domain?: string;
73
+ sellingPlanSetting?: Record<string, any>;
74
+ buyerConsentPreCheck?: Record<string, boolean>;
75
+ };
76
+ type SharePageType = {
77
+ designerName?: string | null;
78
+ id: string;
79
+ thumbnails?: string[] | null;
80
+ title: string;
81
+ };
82
+ type SharePageProps = PageBuilderPropsV2 & {
83
+ publicStoreFrontData?: PublicStoreFrontData | null;
84
+ seo?: NextSeoProps;
85
+ builderData?: {
86
+ uid: string;
87
+ lazy?: boolean;
88
+ priority?: boolean;
89
+ data: BuilderState;
90
+ }[];
91
+ page?: {
92
+ id: string;
93
+ name?: string;
94
+ sectionPosition?: string[];
95
+ type?: string;
96
+ shopID?: string;
97
+ };
98
+ themeStyle?: any;
99
+ share?: SharePageType;
100
+ pageSections?: {
101
+ id: bigint;
102
+ themePageID: bigint;
103
+ shopID: bigint;
104
+ cid: string;
105
+ name: string;
106
+ component: any;
107
+ };
108
+ pageMeta?: {
109
+ id: string;
110
+ themePageID: string;
111
+ key: string;
112
+ value: string;
113
+ }[];
114
+ shopMeta?: any;
115
+ pageType?: ShopType.PublishedThemePageType;
116
+ moneyFormat?: string | null;
117
+ moneyWithCurrencyFormat?: string | null;
118
+ trackingId?: string | null;
119
+ };
120
+
121
+ declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<CollectionDetailPageProps>;
122
+
123
+ declare const getCollectionSharePageProps: (fetcher: FetchFunc) => (baseId?: string) => Promise<{
124
+ collection: any;
125
+ }>;
126
+
127
+ declare const getHomePageProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => () => Promise<PageBuilderProps>;
128
+
129
+ declare const getHomePagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => () => Promise<PageBuilderPropsV2>;
130
+
131
+ declare const getPreviewProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (pageType: ShopType.PublishedThemePageType, slug?: string) => Promise<PageBuilderProps>;
132
+
133
+ type Props = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
134
+ declare const getBuilderProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => Promise<Props>;
135
+
136
+ declare const getProductProps: (fetcher: FetchFunc) => (handle?: string) => Promise<ProductPageProps>;
137
+
138
+ declare const getStaticPagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
139
+
140
+ declare const getSharePageProps: (fetcher: FetchFunc) => (slug: string) => Promise<SharePageProps | null>;
141
+
142
+ declare const getPostPurchasePropsPreview: (fetcher: FetchFunc, librarySaleFunnelID?: string, storeFrontFetcher?: FetchFunc) => (data: {
143
+ id: string;
144
+ currentOfferID: string;
145
+ isLibraryTemplate?: boolean;
146
+ isShopLibraryPage?: boolean;
147
+ sellingPlanSetting?: Record<string, any>;
148
+ }) => Promise<Omit<StaticPagePropsV2, "publicStoreFrontData">>;
149
+
150
+ declare const getStaticPagePropsPreview: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
151
+
152
+ declare const getSharePageContentProps: (fetcher: FetchFunc) => (slug: string) => Promise<SharePageProps | null>;
153
+
154
+ declare const getStaticPaths: GetStaticPaths;
155
+
156
+ export { getBuilderProps, getCollectionProps, getCollectionSharePageProps, getHomePageProps, getHomePagePropsV2, getPostPurchasePropsPreview, getPreviewProps, getProductProps, getSharePageContentProps, getSharePageProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "17.0.0-dev.76",
3
+ "version": "17.0.0-dev.81",
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 ./../../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",
13
+ "pre:publish": "node ./scripts/convert-publish.js -p",
14
+ "post:publish": "node ./scripts/convert-publish.js",
15
+ "watch": "rollup -c ./scripts/rollup.config.mjs -w",
16
+ "build": "rollup -c ./scripts/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,14 +27,21 @@
27
27
  "next": "14.2.35"
28
28
  },
29
29
  "devDependencies": {
30
- "@gem-sdk/core": "17.0.0-dev.73",
31
- "@gem-sdk/plugin-cookie-bar": "17.0.0-dev.73",
32
- "@gem-sdk/plugin-quick-view": "17.0.0-dev.73",
33
- "@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.73"
30
+ "@gem-sdk/core": "17.0.0-dev.81",
31
+ "@gem-sdk/plugin-cookie-bar": "17.0.0-dev.80",
32
+ "@gem-sdk/plugin-quick-view": "17.0.0-dev.80",
33
+ "@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.80"
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
+ },
38
45
  "module": "dist/esm/index.js",
39
46
  "types": "dist/types/index.d.ts",
40
47
  "exports": {
@@ -43,6 +50,11 @@
43
50
  "import": "./dist/esm/index.js",
44
51
  "require": "./dist/cjs/index.js",
45
52
  "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"
46
58
  }
47
59
  }
48
60
  }
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),o=require("@gem-sdk/adapter-shopify"),t=require("../helpers/parse-json.js");const l=async(l,i)=>{let[r,s,a]=await Promise.allSettled([l([e.StorePropertyDocument.toString()]),i([o.ShopMetaDocument.toString()]),l([e.ShopShopifyDocument.toString()])]),n="fulfilled"===s.status?s.value:void 0,u="fulfilled"===r.status?r.value:void 0,p="fulfilled"===a.status?a.value:void 0,c=n?{titleTemplate:`%s | ${n.shop.name}`,defaultTitle:n?.shop.name,title:"Preview",description:n?.shop.description}:{},d=n?.localization.language.isoCode??null,m=n?.localization.country.isoCode??null,h=d&&m?`${d}-${m}`:null;return t.serializableJson({moneyFormat:n?.shop.moneyFormat??null,currency:n?.localization.country.currency.isoCode??null,languageIsoCode:d,countryIsoCode:m,locale:h,swatches:t.parseJson(u?.storeProperty?.swatchesConfig),swr:{revalidateOnMount:!0},seo:c,timezone:p?.shopShopify?.timezone})};exports.getBuilderProps=l;
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),r=require("../helpers/gen-css.js"),t=require("../helpers/normalize.js"),l=require("../helpers/parse-json.js");exports.getCollectionProps=s=>async i=>{let o="COLLECTION",[a,u]=await Promise.all([s([e.CollectionDocument.toString(),{handle:i}]),s([e.PublishedThemePagesDocument.toString(),{slug:i,slugType:o}])]),n=u.publishedThemePages?.[0],c=t.parseBuilderTemplate(n);if(!a||!a?.collection||!n)throw Error("Collection not found");let{collection:p}=a,d=e.prefetchQueries(c),g=await Promise.allSettled(d.map(({query:e,variables:r,func:t})=>t?t(s,r):e?s([e,r]):{})),m=d.reduce((e,{key:r},t)=>{let l=g[t];return l?.status==="fulfilled"?{...e,[r]:l.value}:e},{});return l.serializableJson({builderData:c,collection:p,pageType:o,themeStyle:r.genCSS(n.pageStyle?.data),swr:{fallback:m},seo:{title:p.title,description:p.description}})};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),o=require("../helpers/parse-json.js");exports.getCollectionSharePageProps=r=>async s=>{let[i]=await Promise.all([r([e.CollectionsDocument.toString(),{first:1,orderBy:{direction:"DESC",field:"UPDATED_AT"},where:{isSample:!1,baseID:s||void 0}}])]);if(!i||!i?.collections?.edges?.[0]?.node)throw Error("Collection not found");let t=i?.collections?.edges?.[0]?.node;return o.serializableJson({collection:t})};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),a=require("@gem-sdk/adapter-shopify"),l=require("../google-fonts.js"),t=require("../helpers/gen-css.js"),s=require("../helpers/get-fallback.js"),i=require("../helpers/normalize.js"),o=require("../helpers/parse-json.js"),d=require("@sentry/nextjs"),r=require("../../constants/index.js"),u=require("../helpers/get-metafield.js"),n=require("../custom-fonts.js"),h=require("../helpers/generate-seo-links.js");exports.getHomePagePropsV2=(m,g)=>async()=>{try{let[d,P,T,p]=await Promise.allSettled([m([e.PublishedThemePagesDocument.toString(),{slugType:"STATIC"}]),m([e.StorePropertyDocument.toString()]),g([a.ShopMetaDocument]),m([e.PublishedShopMetasDocument.toString(),{keys:[r.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,r.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===d.status)throw Error(d.reason?.[0]);let f="fulfilled"===p.status?p.value:void 0,c=d.value?.publishedThemePages?.[0],y=d.value?.publishedThemePages?.[0]?.themePageCustomFonts;if(!c)throw Error("No data builder found for Home page");let M=i.parseBuilderTemplateV2(c),[b,S,_,I]=await Promise.all([l.getFontStyleFromPageTemplate(M,void 0,c?.pageStyle?.data),l.getFontLinkFromGlobalStyle(c?.pageStyle?.data,void 0),s.getFallbackV2(m,M),n.getCustomFonts(y)]),A=c.isMobile??!1,L=u.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,c?.metafields)||f?.publishedShopMetas?.find(e=>e?.key===r.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION)?.value,B=o.parseJson(u.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL,c?.metafields)||f?.publishedShopMetas?.find(e=>e?.key===r.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL)?.value),C="true"===u.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.ILP_DISABLE_GS_FONT,c?.metafields),D="fulfilled"===T.status?T.value:void 0,E="fulfilled"===P.status?P.value:void 0,v=E?.storeProperty?.favicon??"/favicon/favicon-32x32.png",O={defaultTitle:D?.shop.name,title:c?.name??"Home",description:L??D?.shop.description,openGraph:{locale:D?.localization.country.isoCode,title:c?.name??D?.shop.name,description:L??D?.shop.description,images:B?[B]:[]},additionalMetaTags:[{name:"theme-color",content:"#000000"}],canonical:`https://${E?.storeProperty?.primaryDomain}/`,additionalLinkTags:h.generateSeoLinks({favicon:v,shopMeta:D})},k=D?.localization.language.isoCode??null,j=D?.localization.country.isoCode??null,q=k&&j?`${k}-${j}`:null;return o.serializableJson({id:d.value?.publishedThemePages?.[0]?.id??null,shopID:d.value?.publishedThemePages?.[0]?.shopID??null,themeStyle:t.genCSS(c?.pageStyle?.data,A),fontStyle:S,elementFontStyle:b,builderData:M,swr:{fallback:_},moneyFormat:D?.shop.moneyFormat??null,currency:D?.localization.country.currency.isoCode??null,languageIsoCode:k,countryIsoCode:j,locale:q,swatches:o.parseJson(E?.storeProperty?.swatchesConfig),seo:O,mobileOnly:A,disableGsFont:C,gaTrackingId:u.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.ANALYTICS_GA_TRACKING_ID,c?.metafields)??null,facebookPixelId:u.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.ANALYTICS_FB_PIXEL_ID,c?.metafields)??null,tiktokPixelId:u.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.ANALYTICS_TIKTOK_PIXEL_ID,c?.metafields)??null,customCodeHeader:u.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.CUSTOM_CODE_HEADER,c?.metafields)??null,customCodeBody:u.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.CUSTOM_CODE_BODY,c?.metafields)??null,pageHandle:c.handle??null,customFonts:I})}catch(e){throw d.captureException(e),e}};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),s=require("@gem-sdk/adapter-shopify"),a=require("../google-fonts.js"),t=require("../helpers/gen-css.js"),r=require("../helpers/generate-manifres.js"),i=require("../helpers/normalize.js"),l=require("../helpers/parse-json.js"),o=require("../../constants/index.js"),n=require("../helpers/get-metafield.js");exports.getHomePageProps=(u,d)=>async()=>{let p="STATIC",[c,h,m,f]=await Promise.allSettled([u([e.PublishedThemePagesDocument.toString(),{slugType:p}]),u([e.StorePropertyDocument.toString()]),d([s.ShopMetaDocument]),u([e.PublishedShopMetasDocument.toString(),{keys:[o.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,o.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===c.status)return{pageType:p};let g="fulfilled"===f.status?f.value:void 0,P=c.value.publishedThemePages?.[0],T=i.parseBuilderTemplate(P),y=await a.getFontFromGlobalStyle(P?.pageStyle?.data,void 0),M=e.prefetchQueries(T),_=await Promise.allSettled(M.map(({query:e,variables:s,func:a})=>a?a(u,s):e?u([e,s]):{})),S=M.reduce((e,{key:s},a)=>{let t=_[a];return t?.status==="fulfilled"?{...e,[s]:t.value}:e},{}),b=n.getPublishedThemePageMetafieldByKey(o.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,P?.metafields)||g?.publishedShopMetas?.find(e=>e?.key===o.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION)?.value,z=l.parseJson(n.getPublishedThemePageMetafieldByKey(o.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL,P?.metafields)||g?.publishedShopMetas?.find(e=>e?.key===o.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL)?.value),A="fulfilled"===m.status?m.value:void 0,L="fulfilled"===h.status?h.value:void 0,v=L?.storeProperty?.favicon??"/favicon/favicon-32x32.png",x={defaultTitle:A?.shop.name,title:P?.name??"Home",description:b??A?.shop.description,openGraph:{locale:A?.localization.country.isoCode,title:P?.name??A?.shop.name,description:b??A?.shop.description,images:z?[z]:[]},additionalMetaTags:[{name:"theme-color",content:"#000000"}],canonical:"/",additionalLinkTags:[{rel:"icon",sizes:"32x32",href:`${v}-/crop/1:1/center/-/smart_resize/32x32/`},{rel:"icon",sizes:"16x16",href:`${v}-/crop/1:1/center/-/smart_resize/16x16/`},{rel:"apple-touch-icon",sizes:"180x180",href:`${v}-/crop/1:1/center/-/smart_resize/180x180/`},{rel:"manifest",href:r.generateManifest({theme_color:"#000000",background_color:"#ffffff",display:"standalone",scope:"/",start_url:"/",name:A?.shop.name,short_name:A?.shop.name,description:A?.shop.description,icons:[{src:`${v}-/crop/1:1/center/-/smart_resize/192x192/`,sizes:"192x192",type:"image/png",purpose:"any maskable"},{src:`${v}-/crop/1:1/center/-/smart_resize/512x512/`,sizes:"512x512",type:"image/png"}]})}]},B=A?.localization.language.isoCode??null,C=A?.localization.country.isoCode??null,I=B&&C?`${B}-${C}`:null;return l.serializableJson({themeStyle:t.genCSS(P?.pageStyle?.data),fontStyle:y,builderData:T,pageType:p,swr:{fallback:S},moneyFormat:A?.shop.moneyFormat??null,currency:A?.localization.country.currency.isoCode??null,locale:I,languageIsoCode:B,countryIsoCode:C,swatches:l.parseJson(L?.storeProperty?.swatchesConfig),seo:x})};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),r=require("@sentry/nextjs"),t=require("../google-fonts.js"),a=require("../helpers/get-fallback.js"),n=require("../helpers/normalize.js"),o=require("../hooks/usePagePreview.js"),l=require("../helpers/parse-json.js"),s=require("../helpers/gen-css.js");const i="page_settings",u=async(r,t)=>{let a={themePageId:r.themePageId,first:1,where:{default:!0}},[n,o]=await Promise.allSettled([t([e.ThemePageDocument.toString(),a]),t([e.StorePropertyDocument.toString()])]);if("rejected"===n.status)throw Error(n.reason?.[0]);return{dataBuilder:n.value.themePage,pageStyle:n.value.themePage?.theme?.themeStyles?.edges?.[0]?.node?.data,storeProperty:o,dynamicDiscountOffer:void 0,productOffers:[],sellingPlanSetting:{},buyerConsentPreCheck:{}}},c=async(r,t)=>{let a={themePageId:r.themePageId,first:1,where:{default:!0}},n={themePageID:r.themePageId,where:{key:i}},[o,l,s,u,c]=await Promise.allSettled([t([e.ThemePageDocument.toString(),a]),t([e.StorePropertyDocument.toString()]),t([e.SaleFunnelDiscountsDocument.toString(),{where:{saleFunnelOfferID:r.currentOfferID}}]),t([e.SaleFunnelOfferDocument.toString(),{saleFunnelOfferId:r.currentOfferID}]),t([e.ThemePageMetaDocument.toString(),n])]);if("rejected"===o.status)throw Error(o.reason?.[0]);if("rejected"===s.status)throw Error(s.reason?.[0]);if("rejected"===u.status)throw Error(u.reason?.[0]);if("rejected"===c.status)throw Error(c.reason?.[0]);let d={},f={};if("fulfilled"===c.status){let e=c.value.themePageMeta?.edges?.find(e=>e?.node?.key===i)?.node?.value;if(e)try{let r=JSON.parse(e);d=r?.sellingPlanSetting,f=r?.buyerConsentPreCheck}catch(e){console.error("Error parsing selling plan setting:",e)}}return{dataBuilder:o.value.themePage,pageStyle:o.value.themePage?.theme?.themeStyles?.edges?.[0]?.node?.data,storeProperty:l,dynamicDiscountOffer:u.value.saleFunnelOffer?.dynamicDiscounts?.[0],productOffers:s.value.saleFunnelDiscounts?.edges?.filter(e=>e?.node?.objectType==="PRODUCT"&&e?.node?.type==="ORDER_VALUE")||[],sellingPlanSetting:d,buyerConsentPreCheck:f}},d=async(r,t)=>{let a={libraryTemplateId:r.libraryTemplateId},n=[],[o,l]=await Promise.allSettled([t([e.LibraryTemplateDocument.toString(),a]),t([e.StorePropertyDocument.toString()])]);if(r.currentOfferID){let[a]=await Promise.allSettled([t([e.LibrarySaleFunnelDocument.toString(),{librarySaleFunnelId:r.librarySaleFunnelID}])]);if("rejected"===a.status)throw Error(a.reason?.[0]);let o=a.value.librarySaleFunnel?.offers?.find(e=>e?.id===r.currentOfferID);o&&(n=o.discounts?.filter(e=>e?.objectType==="PRODUCT"&&"ORDER_VALUE"===e.type).map(e=>({node:{...e}}))||[])}if("rejected"===o.status)throw Error(o.reason?.[0]);return{dataBuilder:o.value.libraryTemplate,pageStyle:void 0,storeProperty:l,dynamicDiscountOffer:void 0,productOffers:n,sellingPlanSetting:{},buyerConsentPreCheck:{}}},f=async(r,t)=>{let a={shopLibraryPageId:r.shopLibraryPageId},[n,o,l,s]=await Promise.allSettled([t([e.ShopLibraryPageDocument.toString(),a]),t([e.StorePropertyDocument.toString()]),t([e.SaleFunnelDiscountsDocument.toString(),{where:{saleFunnelOfferID:r.currentOfferID}}]),t([e.SaleFunnelOfferDocument.toString(),{saleFunnelOfferId:r.currentOfferID}])]);if("rejected"===n.status)throw Error(n.reason?.[0]);if("rejected"===l.status)throw Error(l.reason?.[0]);if("rejected"===s.status)throw Error(s.reason?.[0]);return{dataBuilder:n.value.shopLibraryPage,pageStyle:void 0,storeProperty:o,dynamicDiscountOffer:s.value.saleFunnelOffer?.dynamicDiscounts?.[0],productOffers:l.value.saleFunnelDiscounts?.edges?.filter(e=>e?.node?.objectType==="PRODUCT"&&e?.node?.type==="ORDER_VALUE")||[],sellingPlanSetting:{},buyerConsentPreCheck:{}}},g=async(r,t)=>{let a={libraryTemplateId:r.libraryTemplateId},[n,o,l,s]=await Promise.allSettled([t([e.LibraryTemplateDocument.toString(),a]),t([e.StorePropertyDocument.toString()]),t([e.SaleFunnelDiscountsDocument.toString(),{where:{saleFunnelOfferID:r.currentOfferID}}]),t([e.SaleFunnelOfferDocument.toString(),{saleFunnelOfferId:r.currentOfferID}])]);if("rejected"===n.status)throw Error(n.reason?.[0]);if("rejected"===l.status)throw Error(l.reason?.[0]);if("rejected"===s.status)throw Error(s.reason?.[0]);return{dataBuilder:n.value.libraryTemplate,pageStyle:void 0,storeProperty:o,dynamicDiscountOffer:s.value.saleFunnelOffer?.dynamicDiscounts?.[0],productOffers:l.value.saleFunnelDiscounts?.edges?.filter(e=>e?.node?.objectType==="PRODUCT"&&e?.node?.type==="ORDER_VALUE")||[],sellingPlanSetting:{},buyerConsentPreCheck:{}}},m=async e=>{let{id:r,currentOfferID:t,fetcher:a,isLibraryTemplate:n,librarySaleFunnelID:o,isShopLibraryPage:l}=e;return o?await d({libraryTemplateId:r,currentOfferID:t,librarySaleFunnelID:o},a):l&&t?await f({shopLibraryPageId:r,currentOfferID:t},a):n&&t?await g({libraryTemplateId:r,currentOfferID:t},a):t?await c({themePageId:r,currentOfferID:t},a):await u({themePageId:r},a)};exports.fetchLibraryTemplateDataByID=g,exports.fetchPostPurchasePageDataByID=c,exports.fetchSalePageDataByID=u,exports.fetchShopLibraryPageDataByID=f,exports.fetchThemePageDataByTemplateID=d,exports.getPostPurchasePropsPreview=(e,i,u)=>async c=>{try{let{id:r,currentOfferID:d,isLibraryTemplate:f,isShopLibraryPage:g}=c,{dataBuilder:y,storeProperty:p,productOffers:h,pageStyle:D,dynamicDiscountOffer:P,sellingPlanSetting:S,buyerConsentPreCheck:w}=await m({id:r,currentOfferID:d,fetcher:e,isLibraryTemplate:f,isShopLibraryPage:g,librarySaleFunnelID:i});if(!y)throw Error(`No data builder found for slug: /preview/${r}`);let O=i||f&&d?n.parseBuilderLibraryTemplate(y):g?n.parseShopLibraryPageTemplate(y):n.parseBuilderTemplateV2(y),b=u||e,[I,v,T]=await Promise.all([t.getFontStyleFromPageTemplate(O,void 0,D),t.getFontLinkFromGlobalStyle(D,void 0),a.getFallbackV2(b,O,!1)]),{seo:F,pageConfig:j}=o.usePagePreview(y,p);return l.serializableJson({themeStyle:s.genCSS(D),seo:F,...j,elementFontStyle:I,fontStyle:v,builderData:O,swr:{fallback:T},productOffers:h,dynamicDiscountOffer:P,sellingPlanSetting:S,buyerConsentPreCheck:w})}catch(e){throw console.log("error",e),r.captureException(e),e}},exports.getRelevantPageData=m;
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),l=require("@sentry/nextjs"),t=require("../custom-fonts.js"),r=require("../google-fonts.js"),s=require("../helpers/gen-css.js"),o=require("../helpers/normalize.js"),n=require("../helpers/parse-json.js"),a=require("../fetcher.js"),u=require("./get-collection-share-page-props.js");exports.getSharePageContentProps=i=>async c=>{try{let{sharedPage:l,customFonts:p,publicToken:d}=await i([c]);if(!l||!d)return null;let{page:f,themeStyle:y,pageMeta:g,shopMeta:P,moneyFormat:m,moneyWithCurrencyFormat:C}=l,{sectionPosition:v}=f??{},h=o.parseBuilderTemplateV2({...l,sectionPosition:v}),S=null,_=null,F=null;if(f?.type==="GP_COLLECTION"){let e=(g??[]).find(e=>"selected_preview_collection"===e.key)?.value,l=e?JSON.parse(e??{}):null;_=l?.collectionId,F=l?.collectionTitle}let O=null;if(f?.type==="GP_PRODUCT"){let e=(g??[]).find(e=>"selected_preview_product"===e.key)?.value;O=e?JSON.parse(e??{}):null}let[T,j,q,L,I]=await Promise.allSettled([r.getFontStyleFromPageTemplate(h,void 0,y?.data),r.getFontLinkFromGlobalStyle(y?.data),t.getCustomFonts(p),a.createFetcher(d)([e.StorePropertyDocument.toString()]),f?.type==="GP_COLLECTION"?u.getCollectionSharePageProps(a.createFetcher(d))(_??void 0):null]);S="fulfilled"===I.status?I.value?.collection:null;let w="fulfilled"===T.status?T.value:null,D="fulfilled"===j.status?j.value:null,G="fulfilled"===q.status?q.value:null,N="fulfilled"===L.status?L.value:void 0;return n.serializableJson({builderData:h,page:f,themeStyle:s.genCSS(y?.data,!1),pageMeta:g,shopMeta:P,elementFontStyle:w,fontStyle:D,customFonts:G,publicStoreFrontData:d?{token:d,endpoint:process.env.NEXT_PUBLIC_API_URL??""}:null,pageType:f?.type,moneyFormat:m,moneyWithCurrencyFormat:C,swatches:n.parseJson(N?.storeProperty?.swatchesConfig),collection:S,dynamicCollection:f?.type==="GP_COLLECTION"?{collectionId:S?.baseID,collectionTitle:F}:null,dynamicProduct:f?.type==="GP_PRODUCT"?O:null})}catch(e){return l.captureException(e),null}};
@@ -1 +0,0 @@
1
- "use strict";var e=require("./get-collection-props.js"),r=require("./get-product-props.js"),t=require("./get-static-page-props.js");exports.getPreviewProps=(s,o)=>async(p,c)=>{switch(p){case"COLLECTION":return e.getCollectionProps(s)(c);case"PRODUCT":return r.getProductProps(s)(c);default:return t.getStaticPageProps(s,o)(c)}};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),r=require("../helpers/gen-css.js"),t=require("../helpers/normalize.js"),a=require("../helpers/parse-json.js");exports.getProductProps=s=>async l=>{let i="PRODUCT",[u,d]=await Promise.all([e.getProductBySlug(s,l),s([e.PublishedThemePagesDocument.toString(),{slug:l,slugType:i}])]),o=d.publishedThemePages?.[0];if(!u||!o)throw Error("Product not found");let g=t.parseBuilderTemplate(o),p=e.prefetchQueries(g),h=await Promise.allSettled(p.map(({query:e,variables:r,func:t})=>t?t(s,r):e?s([e,r]):{})),m=p.reduce((e,{key:r},t)=>{let a=h[t];return a?.status==="fulfilled"?{...e,[r]:a.value}:e},{});return a.serializableJson({builderData:g,themeStyle:r.genCSS(o.pageStyle?.data),pageType:i,swr:{fallback:m},seo:{title:u.title,description:u.description,openGraph:{images:u.featuredImage?.src?[{url:u.featuredImage.src,alt:u.featuredImage?.alt,height:u.featuredImage?.height,width:u.featuredImage?.width,type:u.featuredImage?.contentType}]:[]}},product:u})};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@sentry/nextjs"),t=require("../helpers/parse-json.js");exports.getSharePageProps=r=>async a=>{try{let{sharedPage:e,publicToken:l}=await r([a]);if(!e||!l)return null;let{share:n,shopMeta:i,page:s,pageMeta:o}=e,u=n?.thumbnails?Array.isArray(n.thumbnails)?n.thumbnails.map(e=>({url:e})):"string"==typeof n.thumbnails?[{url:n.thumbnails}]:[]:[],p={defaultTitle:i?.shop?.name??"",title:n?.title,openGraph:{site_name:i?.shop?.name??"",locale:i?.localization?.country?.isoCode??"",title:n?.title??i?.shop?.name??"",images:u},nofollow:!0,noindex:!0};return t.serializableJson({seo:p,share:n,page:s,pageMeta:o})}catch(t){return e.captureException(t),null}};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),t=require("@gem-sdk/adapter-shopify"),o=require("@sentry/nextjs"),a=require("../google-fonts.js"),r=require("../helpers/gen-css.js"),l=require("../helpers/get-fallback.js"),i=require("../helpers/normalize.js"),n=require("../helpers/parse-json.js"),s=require("../custom-fonts.js"),u=require("../helpers/sentry.js"),c=require("../helpers/generate-seo-links.js");exports.getStaticPagePropsPreview=(d,m)=>async p=>{try{let o="STATIC",g={handleURL:p,pageType:o},[h,y,f]=await Promise.allSettled([d([e.PreviewThemePageDocument.toString(),g]),d([e.StorePropertyDocument.toString()]),m([t.ShopMetaDocument])]);if("rejected"===h.status)throw u.sentryCaptureException("PreviewThemePageDocument",h.reason,{variables:g,theme:h}),Error(h.reason?.[0]);let k=h.value.previewThemePage;if(!k)throw Error(`No data builder found for slug: /preview/${p}`);let P=k.customFonts,v={...k,shopID:""},S=i.parseBuilderTemplateV2(v),[w,b,C,T]=await Promise.all([a.getFontStyleFromPageTemplate(S,void 0,k?.themeStyle?.data),a.getFontLinkFromGlobalStyle(k?.themeStyle?.data),l.getFallbackV2(d,S),s.getCustomFonts(P)]),j=!!k.isMobile,q=k?.dataSEO?.find(e=>e?.key==="global-meta-description")?.value,x=n.parseJson(k?.dataSEO?.find(e=>e?.key==="global-meta-thumbnail")?.value),F="fulfilled"===f.status?f.value:void 0,D="fulfilled"===y.status?y.value:void 0,I=D?.storeProperty?.favicon??"/favicon/favicon-32x32.png",z={defaultTitle:F?.shop.name,title:k?.name,description:q??F?.shop.description,openGraph:{locale:F?.localization.country.isoCode,title:k?.name??F?.shop.name,description:q??F?.shop.description,images:x?[x]:[]},nofollow:!0,noindex:!0,canonical:`/preview/${p}`,additionalMetaTags:[{name:"theme-color",content:"#000000"}],additionalLinkTags:c.generateSeoLinks({favicon:I,shopMeta:F})},E=F?.localization.language.isoCode??null,B=F?.localization.country.isoCode??null,L=E&&B?`${E}-${B}`:null;return n.serializableJson({themeStyle:r.genCSS(k?.themeStyle?.data,j),fontStyle:b,elementFontStyle:w,builderData:S,pageType:o,moneyFormat:F?.shop?.moneyFormat??null,currency:F?.localization?.country?.currency?.isoCode??null,languageIsoCode:E,countryIsoCode:B,locale:L,swr:{fallback:C},swatches:n.parseJson(D?.storeProperty?.swatchesConfig),seo:z,mobileOnly:j,gaTrackingId:k.analytic?.gaTrackingID??null,facebookPixelId:k.analytic?.fbPixelID??null,tiktokPixelId:k.analytic?.tiktokPixelID??null,customCodeHeader:k.customCode?.header??null,customCodeBody:k.customCode?.body??null,customFonts:T,pageBackground:i.extractPageBackground(v),interaction:k?.interaction})}catch(e){throw o.captureException(e),e}};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),a=require("@gem-sdk/adapter-shopify"),t=require("../google-fonts.js"),l=require("../helpers/gen-css.js"),s=require("../helpers/get-fallback.js"),i=require("../helpers/normalize.js"),d=require("../helpers/parse-json.js"),o=require("@sentry/nextjs"),u=require("../custom-fonts.js"),h=require("../helpers/get-metafield.js"),r=require("../../constants/index.js"),n=require("../helpers/generate-seo-links.js");exports.getStaticPagePropsV2=(P,g)=>async m=>{try{let o="STATIC",[f,T,p,c]=await Promise.allSettled([P([e.PublishedThemePagesDocument.toString(),{slug:m,slugType:o}]),P([e.StorePropertyDocument.toString()]),g([a.ShopMetaDocument]),P([e.PublishedShopMetasDocument.toString(),{keys:["source_font",r.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,r.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL,r.PublishedThemePageMetafields.SHOW_PRICE_CURRENCY,r.PublishedThemePageMetafields.MONEY_WITH_CURRENCY_FORMAT]}])]);if("rejected"===f.status)throw Error(f.reason?.[0]);let M="fulfilled"===c.status?c.value:void 0,b=M?.publishedShopMetas?.find(e=>e?.key==="source_font"),y=M?.publishedShopMetas?.find(e=>e?.key===r.PublishedThemePageMetafields.SHOW_PRICE_CURRENCY),_=M?.publishedShopMetas?.find(e=>e?.key===r.PublishedThemePageMetafields.MONEY_WITH_CURRENCY_FORMAT),S=f.value.publishedThemePages?.[0],E=f.value?.publishedThemePages?.[0]?.themePageCustomFonts;if(!S)throw Error(`No data builder found for slug: /${m}`);let I=i.parseBuilderTemplateV2(S),[L,A,C,O]=await Promise.all([t.getStaticFontFacesFromPageTemplate({pageTemplate:I,sourceFont:b?.value,data:S?.pageStyle?.data}),t.getStaticFontFacesFromGlobalStyle({data:S?.pageStyle?.data,sourceFont:b?.value}),s.getFallbackV2(P,I),u.getCustomFonts(E)]),B=S.isMobile??!1,N=h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,S?.metafields)||M?.publishedShopMetas?.find(e=>e?.key===r.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION)?.value,v=h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.GLOBAL_META_TITLE,S?.metafields)||M?.publishedShopMetas?.find(e=>e?.key===r.PublishedThemePageMetafields.GLOBAL_META_TITLE)?.value,k=d.parseJson(h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL,S?.metafields)||M?.publishedShopMetas?.find(e=>e?.key===r.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL)?.value),D=h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.NOINDEX_KEY,S?.metafields)||M?.publishedShopMetas?.find(e=>e?.key===r.PublishedThemePageMetafields.NOINDEX_KEY)?.value,F=h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.NOFOLLOW_KEY,S?.metafields)||M?.publishedShopMetas?.find(e=>e?.key===r.PublishedThemePageMetafields.NOFOLLOW_KEY)?.value;console.log("\uD83D\uDE80 ~ getStaticPagePropsV2 ~ dataBuilder?.metafields:",S?.metafields);let K="true"===h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.ILP_DISABLE_GS_FONT,S?.metafields);console.log("\uD83D\uDE80 ~ getStaticPagePropsV2 ~ disableGsFont 1:",K);let R="fulfilled"===p.status?p.value:void 0,G="fulfilled"===T.status?T.value:void 0,Y=G?.storeProperty?.favicon??"/favicon/favicon-32x32.png",j={defaultTitle:R?.shop.name,title:v||S?.name,description:N??R?.shop.description,openGraph:{locale:R?.localization.country.isoCode,title:(v||S?.name)??R?.shop.name,description:N??R?.shop.description,images:k?[k]:[]},noindex:"true"===D,nofollow:"true"===F,canonical:`https://${G?.storeProperty?.primaryDomain}/${m}`,additionalMetaTags:[{name:"theme-color",content:"#000000"}],additionalLinkTags:n.generateSeoLinks({favicon:Y,shopMeta:R})},q=R?.localization.language.isoCode??null,H=R?.localization.country.isoCode??null,w=q&&H?`${q}-${H}`:null;return d.serializableJson({id:f.value?.publishedThemePages?.[0]?.id??null,shopID:f.value?.publishedThemePages?.[0]?.shopID??null,themeStyle:l.genCSS(S?.pageStyle?.data,B),fontStyle:A,elementFontStyle:L,builderData:I,pageType:o,moneyFormat:y?.value==="true"?_?.value:R?.shop.moneyFormat??null,currency:R?.localization.country.currency.isoCode??null,languageIsoCode:q,countryIsoCode:H,locale:w,swr:{fallback:C},swatches:d.parseJson(G?.storeProperty?.swatchesConfig),seo:j,mobileOnly:B,disableGsFont:K,gaTrackingId:h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.ANALYTICS_GA_TRACKING_ID,S?.metafields)??null,facebookPixelId:h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.ANALYTICS_FB_PIXEL_ID,S?.metafields)??null,tiktokPixelId:h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.ANALYTICS_TIKTOK_PIXEL_ID,S?.metafields)??null,customCodeHeader:h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.CUSTOM_CODE_HEADER,S?.metafields)??null,customCodeBody:h.getPublishedThemePageMetafieldByKey(r.PublishedThemePageMetafields.CUSTOM_CODE_BODY,S?.metafields)??null,pageHandle:S.handle??null,customFonts:O,interaction:S?.interaction,pageBackground:i.extractPageBackground(S)})}catch(e){throw o.captureException(e),e}};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@gem-sdk/core"),s=require("@gem-sdk/adapter-shopify"),t=require("../google-fonts.js"),a=require("../helpers/gen-css.js"),r=require("../helpers/generate-manifres.js"),i=require("../helpers/normalize.js"),l=require("../helpers/parse-json.js"),o=require("../../constants/index.js"),n=require("../helpers/get-metafield.js");exports.getStaticPageProps=(u,d)=>async c=>{let p="STATIC",[h,m,f,g]=await Promise.allSettled([u([e.PublishedThemePagesDocument.toString(),{slug:c,slugType:p}]),u([e.StorePropertyDocument.toString()]),d([s.ShopMetaDocument]),u([e.PublishedShopMetasDocument.toString(),{keys:["source_font",o.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,o.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===h.status)return{pageType:p};let P="fulfilled"===g.status?g.value:void 0,T=h.value.publishedThemePages?.[0],y=i.parseBuilderTemplate(T),M=await t.getFontLinkFromGlobalStyle(T?.pageStyle?.data),_=e.prefetchQueries(y),S=await Promise.allSettled(_.map(({query:e,variables:s,func:t})=>t?t(u,s):e?u([e,s]):{})),b=_.reduce((e,{key:s},t)=>{let a=S[t];return a?.status==="fulfilled"?{...e,[s]:a.value}:e},{}),L=n.getPublishedThemePageMetafieldByKey(o.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,T?.metafields)||P?.publishedShopMetas?.find(e=>e?.key===o.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION)?.value,z=l.parseJson(n.getPublishedThemePageMetafieldByKey(o.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL,T?.metafields)||P?.publishedShopMetas?.find(e=>e?.key===o.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL)?.value),A="fulfilled"===f.status?f.value:void 0,v="fulfilled"===m.status?m.value:void 0,x=v?.storeProperty?.favicon??"/favicon/favicon-32x32.png",B={defaultTitle:A?.shop.name??"",title:T?.name??"",description:L??A?.shop.description??"",openGraph:{locale:A?.localization.country.isoCode??"",title:T?.name??A?.shop.name??"",description:L??A?.shop.description??"",images:z?[z]:[]},additionalMetaTags:[{name:"theme-color",content:"#000000"}],canonical:`/${c}`,additionalLinkTags:[{rel:"icon",sizes:"32x32",href:`${x}-/crop/1:1/center/-/smart_resize/32x32/`},{rel:"icon",sizes:"16x16",href:`${x}-/crop/1:1/center/-/smart_resize/16x16/`},{rel:"apple-touch-icon",sizes:"180x180",href:`${x}-/crop/1:1/center/-/smart_resize/180x180/`},{rel:"manifest",href:r.generateManifest({theme_color:"#000000",background_color:"#ffffff",display:"standalone",scope:"/",start_url:"/",name:A?.shop.name,short_name:A?.shop.name,description:A?.shop.description,icons:[{src:`${x}-/crop/1:1/center/-/smart_resize/192x192/`,sizes:"192x192",type:"image/png",purpose:"any maskable"},{src:`${x}-/crop/1:1/center/-/smart_resize/512x512/`,sizes:"512x512",type:"image/png"}]})}]},C=A?.localization.language.isoCode??null,I=A?.localization.country.isoCode??null,j=C&&I?`${C}-${I}`:null;return l.serializableJson({themeStyle:a.genCSS(T?.pageStyle?.data),fontStyle:M,builderData:y,pageType:p,moneyFormat:A?.shop.moneyFormat??null,currency:A?.localization.country.currency.isoCode??null,languageIsoCode:C,countryIsoCode:I,locale:j,swr:{fallback:b},swatches:l.parseJson(v?.storeProperty?.swatchesConfig),seo:B})};
@@ -1,8 +0,0 @@
1
- "use strict";const t=t=>{let o={};return t?.forEach(t=>{if(!t)return;let e=`${t.fontFamily}_${t.fontStyle}_${t.fontWeight}`,n={font:{fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight},urls:[{url:t.backupFilePath||t.filePath,mimeType:t.mimeType}]};o[e]?o[e]?.urls.push(n?.urls?.[0]):o[e]=n}),o},o=t=>({"font/ttf":"truetype","application/x-font-opentype":"opentype","application/font-woff":"woff","application/font-woff2":"woff2"})[t],e=t=>{let e=[];for(let[,n]of Object.entries(t))e.push(`
2
- @font-face {
3
- font-family: '${n.font.fontFamily}';
4
- src: ${n.urls.map(t=>`url('${t.url}') format('${o(t.mimeType)}')`).join("\n")};
5
- font-style: ${n?.font?.fontStyle??"normal"};
6
- font-weight: ${n?.font?.fontWeight??"normal"};
7
- }
8
- `);return e.map(t=>t).join("\n")};exports.composeFontFaces=e,exports.composeFontMimeType=t,exports.formatName=o,exports.getCustomFonts=o=>{if(!o)return null;let n=t(o);return e(n)};