@gem-sdk/pages 3.0.0-pre-production.0 → 3.0.0

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 (150) hide show
  1. package/dist/cjs/components/ErrorBoundary.js +2 -40
  2. package/dist/cjs/components/ErrorFallback.js +2 -26
  3. package/dist/cjs/components/FacebookPixel.js +4 -36
  4. package/dist/cjs/components/FooterForPostPurchase.js +2 -34
  5. package/dist/cjs/components/GoogleAnalytic.js +6 -67
  6. package/dist/cjs/components/TikTokPixel.js +4 -19
  7. package/dist/cjs/components/builder/Body.js +2 -36
  8. package/dist/cjs/components/builder/Footer.js +2 -154
  9. package/dist/cjs/components/builder/Header.js +2 -189
  10. package/dist/cjs/components/builder/PopupManager.js +2 -63
  11. package/dist/cjs/components/builder/SwitchView.js +2 -184
  12. package/dist/cjs/components/builder/Toolbar.js +2 -706
  13. package/dist/cjs/components/builder/Toolbox.js +2 -494
  14. package/dist/cjs/components/builder/const.js +1 -56
  15. package/dist/cjs/components/builder/toolbar/const.js +1 -7
  16. package/dist/cjs/components/builder/toolbar/utils/findDOMClosest.js +1 -41
  17. package/dist/cjs/components/builder/toolbar/utils/findOverflowParent.js +1 -20
  18. package/dist/cjs/components/builder/toolbar/utils/getChildrenByAttrSelector.js +1 -18
  19. package/dist/cjs/components/builder/toolbar/utils/getDOMElementParents.js +1 -32
  20. package/dist/cjs/components/builder/toolbar/utils/isOverParent.js +1 -16
  21. package/dist/cjs/components/builder/toolbar/utils/isOverToolbarPosition.js +1 -12
  22. package/dist/cjs/components/builder/toolbar/utils/isSection.js +1 -8
  23. package/dist/cjs/components/builder/toolbar/utils/notVisible.js +1 -8
  24. package/dist/cjs/components/builder/toolbar/utils/waitForElementToExist.js +1 -27
  25. package/dist/cjs/components/image-to-layout/AddSectionImageToLayout.js +2 -150
  26. package/dist/cjs/components/image-to-layout/DropElement.js +2 -190
  27. package/dist/cjs/components/image-to-layout/ImageToLayout.js +2 -41
  28. package/dist/cjs/constants/index.js +1 -0
  29. package/dist/cjs/index.js +1 -82
  30. package/dist/cjs/layouts/main.js +2 -30
  31. package/dist/cjs/libs/api/get-builder-props.js +1 -46
  32. package/dist/cjs/libs/api/get-collection-props.js +1 -68
  33. package/dist/cjs/libs/api/get-home-page-props-v2.js +1 -145
  34. package/dist/cjs/libs/api/get-home-page-props.js +1 -151
  35. package/dist/cjs/libs/api/get-post-purchase-props-preview.js +1 -300
  36. package/dist/cjs/libs/api/get-preview-props.js +1 -18
  37. package/dist/cjs/libs/api/get-product-props.js +1 -73
  38. package/dist/cjs/libs/api/get-static-page-props-preview.js +1 -159
  39. package/dist/cjs/libs/api/get-static-page-props-v2.js +1 -168
  40. package/dist/cjs/libs/api/get-static-page-props.js +1 -148
  41. package/dist/cjs/libs/custom-fonts.js +6 -60
  42. package/dist/cjs/libs/fetcher.js +1 -100
  43. package/dist/cjs/libs/get-layout.js +1 -13
  44. package/dist/cjs/libs/get-storefront-api.js +1 -12
  45. package/dist/cjs/libs/getStaticPaths.js +1 -10
  46. package/dist/cjs/libs/google-fonts.js +1 -118
  47. package/dist/cjs/libs/helpers/check-option-font.js +1 -65
  48. package/dist/cjs/libs/helpers/common.js +1 -27
  49. package/dist/cjs/libs/helpers/extract-operation.js +1 -0
  50. package/dist/cjs/libs/helpers/gen-css.js +1 -135
  51. package/dist/cjs/libs/helpers/gen-fonts.js +1 -90
  52. package/dist/cjs/libs/helpers/generate-manifres.js +1 -5
  53. package/dist/cjs/libs/helpers/get-fallback.js +1 -34
  54. package/dist/cjs/libs/helpers/get-metafield.js +1 -0
  55. package/dist/cjs/libs/helpers/normalize.js +1 -103
  56. package/dist/cjs/libs/helpers/parse-json.js +1 -16
  57. package/dist/cjs/libs/helpers/sentry.js +1 -17
  58. package/dist/cjs/libs/helpers/user-agent.js +1 -7
  59. package/dist/cjs/libs/hooks/use-tracking-view.js +2 -42
  60. package/dist/cjs/libs/hooks/usePagePreview.js +1 -92
  61. package/dist/cjs/libs/parse-html.js +1 -34
  62. package/dist/cjs/libs/shopify-cdn-with-google-fonts.js +1 -1845
  63. package/dist/cjs/pages/404.js +2 -43
  64. package/dist/cjs/pages/500.js +2 -74
  65. package/dist/cjs/pages/CollectionGlobalProvider.js +2 -59
  66. package/dist/cjs/pages/builder.js +2 -115
  67. package/dist/cjs/pages/collection-detail.js +2 -64
  68. package/dist/cjs/pages/preview.js +2 -26
  69. package/dist/cjs/pages/product-detail.js +2 -69
  70. package/dist/cjs/pages/static-v2.js +5 -133
  71. package/dist/cjs/pages/static.js +2 -75
  72. package/dist/cjs/store/libs-store.js +1 -14
  73. package/dist/esm/components/ErrorBoundary.js +2 -38
  74. package/dist/esm/components/ErrorFallback.js +2 -24
  75. package/dist/esm/components/FacebookPixel.js +4 -34
  76. package/dist/esm/components/FooterForPostPurchase.js +2 -30
  77. package/dist/esm/components/GoogleAnalytic.js +6 -65
  78. package/dist/esm/components/TikTokPixel.js +4 -17
  79. package/dist/esm/components/builder/Body.js +2 -32
  80. package/dist/esm/components/builder/Footer.js +2 -150
  81. package/dist/esm/components/builder/Header.js +2 -185
  82. package/dist/esm/components/builder/PopupManager.js +2 -59
  83. package/dist/esm/components/builder/SwitchView.js +2 -180
  84. package/dist/esm/components/builder/Toolbar.js +2 -702
  85. package/dist/esm/components/builder/Toolbox.js +2 -490
  86. package/dist/esm/components/builder/const.js +1 -54
  87. package/dist/esm/components/builder/toolbar/const.js +1 -4
  88. package/dist/esm/components/builder/toolbar/utils/findDOMClosest.js +1 -39
  89. package/dist/esm/components/builder/toolbar/utils/findOverflowParent.js +1 -18
  90. package/dist/esm/components/builder/toolbar/utils/getChildrenByAttrSelector.js +1 -16
  91. package/dist/esm/components/builder/toolbar/utils/getDOMElementParents.js +1 -30
  92. package/dist/esm/components/builder/toolbar/utils/isOverParent.js +1 -14
  93. package/dist/esm/components/builder/toolbar/utils/isOverToolbarPosition.js +1 -10
  94. package/dist/esm/components/builder/toolbar/utils/isSection.js +1 -6
  95. package/dist/esm/components/builder/toolbar/utils/notVisible.js +1 -6
  96. package/dist/esm/components/builder/toolbar/utils/waitForElementToExist.js +1 -25
  97. package/dist/esm/components/image-to-layout/AddSectionImageToLayout.js +2 -146
  98. package/dist/esm/components/image-to-layout/DropElement.js +2 -188
  99. package/dist/esm/components/image-to-layout/ImageToLayout.js +2 -37
  100. package/dist/esm/constants/index.js +1 -0
  101. package/dist/esm/index.js +1 -36
  102. package/dist/esm/layouts/main.js +2 -26
  103. package/dist/esm/libs/api/get-builder-props.js +1 -44
  104. package/dist/esm/libs/api/get-collection-props.js +1 -66
  105. package/dist/esm/libs/api/get-home-page-props-v2.js +1 -143
  106. package/dist/esm/libs/api/get-home-page-props.js +1 -149
  107. package/dist/esm/libs/api/get-post-purchase-props-preview.js +1 -292
  108. package/dist/esm/libs/api/get-preview-props.js +1 -16
  109. package/dist/esm/libs/api/get-product-props.js +1 -71
  110. package/dist/esm/libs/api/get-static-page-props-preview.js +1 -157
  111. package/dist/esm/libs/api/get-static-page-props-v2.js +1 -166
  112. package/dist/esm/libs/api/get-static-page-props.js +1 -146
  113. package/dist/esm/libs/custom-fonts.js +6 -55
  114. package/dist/esm/libs/fetcher.js +1 -96
  115. package/dist/esm/libs/get-layout.js +1 -11
  116. package/dist/esm/libs/get-storefront-api.js +1 -10
  117. package/dist/esm/libs/getStaticPaths.js +1 -8
  118. package/dist/esm/libs/google-fonts.js +1 -112
  119. package/dist/esm/libs/helpers/check-option-font.js +1 -63
  120. package/dist/esm/libs/helpers/common.js +1 -24
  121. package/dist/esm/libs/helpers/extract-operation.js +1 -0
  122. package/dist/esm/libs/helpers/gen-css.js +1 -133
  123. package/dist/esm/libs/helpers/gen-fonts.js +1 -87
  124. package/dist/esm/libs/helpers/generate-manifres.js +1 -3
  125. package/dist/esm/libs/helpers/get-fallback.js +1 -32
  126. package/dist/esm/libs/helpers/get-metafield.js +1 -0
  127. package/dist/esm/libs/helpers/normalize.js +1 -96
  128. package/dist/esm/libs/helpers/parse-json.js +1 -13
  129. package/dist/esm/libs/helpers/sentry.js +1 -15
  130. package/dist/esm/libs/helpers/user-agent.js +1 -5
  131. package/dist/esm/libs/hooks/use-tracking-view.js +2 -40
  132. package/dist/esm/libs/hooks/usePagePreview.js +1 -90
  133. package/dist/esm/libs/parse-html.js +1 -32
  134. package/dist/esm/libs/shopify-cdn-with-google-fonts.js +1 -1843
  135. package/dist/esm/pages/404.js +2 -41
  136. package/dist/esm/pages/500.js +2 -72
  137. package/dist/esm/pages/CollectionGlobalProvider.js +2 -55
  138. package/dist/esm/pages/builder.js +2 -113
  139. package/dist/esm/pages/collection-detail.js +2 -60
  140. package/dist/esm/pages/preview.js +2 -24
  141. package/dist/esm/pages/product-detail.js +2 -65
  142. package/dist/esm/pages/static-v2.js +5 -131
  143. package/dist/esm/pages/static.js +2 -71
  144. package/dist/esm/store/libs-store.js +1 -12
  145. package/dist/types/index.d.ts +61 -63
  146. package/package.json +7 -7
  147. package/dist/cjs/components/builder/InteractionSelectOnPageHeader.js +0 -192
  148. package/dist/cjs/libs/helpers/gen-favicon.js +0 -22
  149. package/dist/esm/components/builder/InteractionSelectOnPageHeader.js +0 -188
  150. package/dist/esm/libs/helpers/gen-favicon.js +0 -20
@@ -1,71 +1,2 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
3
- import { NextSeo } from 'next-seo';
4
- import Head from 'next/head';
5
- import { useRouter } from 'next/router';
6
-
7
- const StaticPage = ({ components, builderData, sectionData, seo, themeStyle, fontStyle })=>{
8
- const router = useRouter();
9
- if (router.isFallback) {
10
- return /*#__PURE__*/ jsx("div", {
11
- className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
12
- children: /*#__PURE__*/ jsxs("div", {
13
- className: "gp-flex gp-gap-2",
14
- children: [
15
- /*#__PURE__*/ jsx("span", {
16
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"
17
- }),
18
- /*#__PURE__*/ jsx("span", {
19
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"
20
- }),
21
- /*#__PURE__*/ jsx("span", {
22
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"
23
- })
24
- ]
25
- })
26
- });
27
- }
28
- return /*#__PURE__*/ jsxs(Fragment, {
29
- children: [
30
- /*#__PURE__*/ jsx(NextSeo, {
31
- ...seo
32
- }),
33
- /*#__PURE__*/ jsxs(Head, {
34
- children: [
35
- themeStyle && /*#__PURE__*/ jsx("style", {
36
- "data-id": "global-style",
37
- type: "text/css",
38
- dangerouslySetInnerHTML: {
39
- __html: themeStyle
40
- }
41
- }),
42
- fontStyle && /*#__PURE__*/ jsx("style", {
43
- "data-id": "google-fonts",
44
- type: "text/css",
45
- dangerouslySetInnerHTML: {
46
- __html: fontStyle
47
- }
48
- })
49
- ]
50
- }),
51
- /*#__PURE__*/ jsx(PageProvider, {
52
- children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
53
- components: components,
54
- children: /*#__PURE__*/ jsx(SectionProvider, {
55
- data: sectionData,
56
- children: /*#__PURE__*/ jsx(Fragment, {
57
- children: builderData && /*#__PURE__*/ jsx(BuilderProvider, {
58
- state: builderData,
59
- children: /*#__PURE__*/ jsx(Render, {
60
- uid: "ROOT"
61
- })
62
- }, "body")
63
- })
64
- })
65
- })
66
- })
67
- ]
68
- });
69
- };
70
-
71
- export { StaticPage as default };
1
+ 'use client';
2
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{PageProvider as s,BuilderComponentProvider as l,SectionProvider as n,BuilderProvider as r,Render as i}from"@gem-sdk/core";import{NextSeo as p}from"next-seo";import g from"next/head";import{useRouter as d}from"next/router";let StaticPage=({components:m,builderData:c,sectionData:o,seo:h,themeStyle:f,fontStyle:u})=>{let _=d();return _.isFallback?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"})]})}):t(a,{children:[e(p,{...h}),t(g,{children:[f&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:f}}),u&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:u}})]}),e(s,{children:e(l,{components:m,children:e(n,{data:o,children:e(a,{children:c&&e(r,{state:c,children:e(i,{uid:"ROOT"})},"body")})})})})]})};export{StaticPage as default};
@@ -1,12 +1 @@
1
- import { create } from 'zustand';
2
-
3
- const libsStore = create((set)=>({
4
- fontType: 'google',
5
- changeFontType: (fontType)=>{
6
- set({
7
- fontType
8
- });
9
- }
10
- }));
11
-
12
- export { libsStore };
1
+ import{create as o}from"zustand";let libsStore=o(o=>({fontType:"google",changeFontType:e=>{o({fontType:e})}}));export{libsStore};
@@ -1,14 +1,13 @@
1
- import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode, CollectionQueryResponse, FetchFunc, ProductSelectFragment, ProductOffer, PublicStoreFrontData, ThemePageQueryResponse, StorePropertyQueryResponse, PublishedThemePageSelectFragment } from '@gem-sdk/core';
1
+ import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode, ProductOffer, AppAPIType, PublicStoreFrontData, CollectionQueryResponse, ProductSelectFragment, FetchFunc, ThemePageQueryResponse, StorePropertyQueryResponse, PublishedThemePageSelectFragment, TypographyV2FontFamilyType } from '@gem-sdk/core';
2
2
  import { NextPage, GetStaticPaths } from 'next';
3
3
  import * as next_seo from 'next-seo';
4
4
  import { NextSeoProps } from 'next-seo';
5
5
  import { AppProps } from 'next/app';
6
6
  import { SWRConfig } from 'swr';
7
- import { OfferDynamicDiscount } from '@gem-sdk/core/src/types/appAPI';
7
+ import * as React$1 from 'react';
8
+ import React__default, { Component } from 'react';
8
9
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
10
  import { ShopMetaQueryResponse } from '@gem-sdk/adapter-shopify';
10
- import * as react from 'react';
11
- import { Component } from 'react';
12
11
 
13
12
  type PageBuilderProps = {
14
13
  seo?: NextSeoProps;
@@ -17,7 +16,7 @@ type PageBuilderProps = {
17
16
  themeStyle?: string | null;
18
17
  fontStyle?: string | null;
19
18
  elementFontStyle?: string[] | null;
20
- swr?: React.ComponentProps<typeof SWRConfig>['value'];
19
+ swr?: React__default.ComponentProps<typeof SWRConfig>['value'];
21
20
  plugins?: string[];
22
21
  pageType?: ShopType.PublishedThemePageType;
23
22
  storefrontToken?: string | null;
@@ -43,6 +42,10 @@ type PageBuilderProps = {
43
42
  customFonts?: string | null;
44
43
  interaction?: ShopType.Maybe<Pick<ShopType.PublishedPageInteraction, 'id' | 'value'>>;
45
44
  timezone?: string;
45
+ pageBackground?: {
46
+ isUsePageBackground?: boolean;
47
+ background?: string;
48
+ };
46
49
  };
47
50
  type PageBuilderPropsV2 = {
48
51
  builderData?: {
@@ -53,21 +56,54 @@ type PageBuilderPropsV2 = {
53
56
  }[];
54
57
  } & Omit<PageBuilderProps, 'builderData'>;
55
58
  type AdditionalPageBuilderProps = {
56
- components: Record<string, React.ComponentType<any>>;
59
+ components: Record<string, React__default.ComponentType<any>>;
57
60
  };
58
61
  type NextPageWithLayout<P = PageBuilderProps, IP = P> = NextPage<P, IP> & {
59
- getLayout?: (page: React.ReactElement, pageProps?: any) => React.ReactNode;
62
+ getLayout?: (page: React__default.ReactElement, pageProps?: any) => React__default.ReactNode;
60
63
  };
61
64
  type AppPropsWithLayout<P = PageBuilderProps> = AppProps<P> & {
62
65
  Component: NextPageWithLayout;
63
66
  };
64
-
65
- type CollectionPageProps = PageBuilderProps & {
67
+ type BuilderPageProps = {
68
+ components: Record<string, React__default.ComponentType<any>>;
69
+ seo?: NextSeoProps;
70
+ themeStyle?: string | null;
71
+ fontStyle?: string | null;
72
+ header?: BuilderState;
73
+ footer?: BuilderState;
74
+ sectionData?: Record<string, SectionData$1>;
75
+ storefrontToken?: string | null;
76
+ storefrontHandle?: string | null;
77
+ shopToken?: string | null;
78
+ mode?: RenderMode;
79
+ pageType: ShopType.PublishedThemePageType;
80
+ editorImageToLayout?: boolean;
81
+ isThemeSectionEditor?: boolean;
82
+ hiddenToolbar?: boolean;
83
+ pageName: string;
84
+ isOriginTemplate?: boolean;
85
+ };
86
+ type CollectionDetailPageProps = PageBuilderProps & {
66
87
  collection?: CollectionQueryResponse['collection'];
67
88
  };
68
- declare const CollectionDetailPage: React.FC<CollectionPageProps & AdditionalPageBuilderProps>;
89
+ type PreviewPageProps = {
90
+ components: Record<string, React__default.ComponentType<any>>;
91
+ pageType: ShopType.PublishedThemePageType;
92
+ };
93
+ type ProductPageProps = PageBuilderProps & {
94
+ product?: ProductSelectFragment;
95
+ };
96
+ type StaticPagePropsV2 = PageBuilderPropsV2 & {
97
+ isPostPurchase?: boolean;
98
+ shopName?: string;
99
+ productOffers?: ProductOffer[];
100
+ dynamicDiscountOffer?: AppAPIType.OfferDynamicDiscount;
101
+ publicStoreFrontData?: PublicStoreFrontData | null;
102
+ isPreview?: boolean;
103
+ domain?: string;
104
+ };
69
105
 
70
- declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<CollectionPageProps>;
106
+ declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<CollectionDetailPageProps>;
71
107
 
72
108
  declare const getHomePageProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => () => Promise<PageBuilderProps>;
73
109
 
@@ -78,26 +114,10 @@ declare const getPreviewProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) =
78
114
  type Props$4 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
79
115
  declare const getBuilderProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => Promise<Props$4>;
80
116
 
81
- type ProductPageProps = PageBuilderProps & {
82
- product?: ProductSelectFragment;
83
- };
84
- declare const ProductDetailPage: React.FC<ProductPageProps & AdditionalPageBuilderProps>;
85
-
86
117
  declare const getProductProps: (fetcher: FetchFunc) => (handle?: string) => Promise<ProductPageProps>;
87
118
 
88
119
  declare const getStaticPagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
89
120
 
90
- type StaticPagePropsV2 = PageBuilderPropsV2 & {
91
- isPostPurchase?: boolean;
92
- shopName?: string;
93
- productOffers?: ProductOffer[];
94
- dynamicDiscountOffer?: OfferDynamicDiscount;
95
- publicStoreFrontData?: PublicStoreFrontData | null;
96
- isPreview?: boolean;
97
- domain?: string;
98
- };
99
- declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderProps>;
100
-
101
121
  declare const getPostPurchasePropsPreview: (fetcher: FetchFunc, librarySaleFunnelID?: string, storeFrontFetcher?: FetchFunc) => (data: {
102
122
  id: string;
103
123
  currentOfferID: string;
@@ -123,7 +143,7 @@ declare const usePagePreview: (dataBuilder: ThemePageQueryResponse['themePage'],
123
143
  mobileOnly: boolean;
124
144
  locale: string | null;
125
145
  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;
126
- 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;
146
+ countryIsoCode: ("ID" | "UA" | "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" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW" | "ZZ") | null;
127
147
  moneyFormat: string | null;
128
148
  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;
129
149
  swatches: any;
@@ -168,40 +188,8 @@ type RetryConfig = {
168
188
  };
169
189
  declare const retryWithDelay: <T = unknown>(fn: () => T, config?: RetryConfig) => Promise<T>;
170
190
 
171
- type PreviewPageProps = {
172
- components: Record<string, React.ComponentType<any>>;
173
- pageType: ShopType.PublishedThemePageType;
174
- };
175
- declare const PreviewPage: React.FC<PreviewPageProps>;
176
-
177
- type StaticPageProps = PageBuilderProps;
178
- declare const StaticPage: React.FC<StaticPageProps & AdditionalPageBuilderProps>;
179
-
180
- type BuilderPageProps = {
181
- components: Record<string, React.ComponentType<any>>;
182
- seo?: NextSeoProps;
183
- themeStyle?: string | null;
184
- fontStyle?: string | null;
185
- header?: BuilderState;
186
- footer?: BuilderState;
187
- sectionData?: Record<string, SectionData$1>;
188
- storefrontToken?: string | null;
189
- storefrontHandle?: string | null;
190
- shopToken?: string | null;
191
- mode?: RenderMode;
192
- pageType: ShopType.PublishedThemePageType;
193
- editorImageToLayout?: boolean;
194
- isThemeSectionEditor?: boolean;
195
- hiddenToolbar?: boolean;
196
- pageName: string;
197
- isOriginTemplate?: boolean;
198
- };
199
- declare const BuilderPage: React.FC<BuilderPageProps>;
200
-
201
191
  declare const getStaticPaths: GetStaticPaths;
202
192
 
203
- type TypographyV2FontFamilyType = 'google' | 'custom' | 'theme' | 'bunny';
204
-
205
193
  type FontType = 'bunny' | 'google';
206
194
 
207
195
  type FontItem = {
@@ -240,7 +228,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
240
228
  static getDerivedStateFromError(error: Error): ErrorBoundaryState;
241
229
  reset: () => void;
242
230
  componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
243
- render(): string | number | boolean | Iterable<react.ReactNode> | react.PromiseLikeOfReactNode | react_jsx_runtime.JSX.Element | null | undefined;
231
+ render(): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<React$1.AwaitedReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
244
232
  }
245
233
 
246
234
  type Props$3 = {
@@ -268,6 +256,16 @@ type Props = {
268
256
  };
269
257
  declare const TikTokPixel: ({ pixelId }: Props) => react_jsx_runtime.JSX.Element | null;
270
258
 
271
- declare const parseHtml: (key: string, html?: string | null, isHead?: boolean) => string | JSX.Element | JSX.Element[] | undefined;
259
+ declare const CollectionDetailPage: React.FC<CollectionDetailPageProps & AdditionalPageBuilderProps>;
260
+
261
+ declare const PreviewPage: React.FC<PreviewPageProps>;
262
+
263
+ declare const ProductDetailPage: React.FC<ProductPageProps & AdditionalPageBuilderProps>;
264
+
265
+ declare const StaticPage: React.FC<PageBuilderProps & AdditionalPageBuilderProps>;
266
+
267
+ declare const BuilderPage: React.FC<BuilderPageProps>;
268
+
269
+ declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderProps>;
272
270
 
273
- export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, CollectionPageProps, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PreviewPage, ProductDetailPage, ProductPageProps, StaticPage, StaticPageProps, StaticPagePropsV2, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, genCSS, getBuilderProps, getCollectionProps, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFonts, getFontsFromDataBuilder, getHomePageProps, getHomePagePropsV2, getLayout, getPostPurchasePropsPreview, getPreviewProps, getProductProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, parseHtml, retryWithDelay, usePagePreview, useTrackingView };
271
+ export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PageBuilderPropsV2, PreviewPage, ProductDetailPage, StaticPage, StaticPagePropsV2, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, genCSS, getBuilderProps, getCollectionProps, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFonts, getFontsFromDataBuilder, getHomePageProps, getHomePagePropsV2, getLayout, getPostPurchasePropsPreview, getPreviewProps, getProductProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, retryWithDelay, usePagePreview, useTrackingView };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "3.0.0-pre-production.0",
3
+ "version": "3.0.0",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -23,16 +23,16 @@
23
23
  "deepmerge": "4.3.1",
24
24
  "html-react-parser": "3.0.15",
25
25
  "next-seo": "^6.0.0",
26
- "next": "latest"
26
+ "next": "14.2.20"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "3.0.0-pre-production.0",
30
- "@gem-sdk/plugin-cookie-bar": "3.0.0-pre-production.0",
31
- "@gem-sdk/plugin-quick-view": "3.0.0-pre-production.0",
32
- "@gem-sdk/plugin-sticky-add-to-cart": "3.0.0-pre-production.0"
29
+ "@gem-sdk/core": "3.0.0",
30
+ "@gem-sdk/plugin-cookie-bar": "3.0.0",
31
+ "@gem-sdk/plugin-quick-view": "3.0.0",
32
+ "@gem-sdk/plugin-sticky-add-to-cart": "3.0.0"
33
33
  },
34
34
  "peerDependencies": {
35
- "next": ">=13"
35
+ "next": ">=14"
36
36
  },
37
37
  "module": "dist/esm/index.js",
38
38
  "types": "dist/types/index.d.ts",
@@ -1,192 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var core = require('@gem-sdk/core');
7
- var react = require('react');
8
-
9
- const InteractionSelectOnPageHeader = ()=>{
10
- const selectType = core.usePageStore((s)=>s.interactionData?.selectType);
11
- const settingType = core.usePageStore((s)=>s.interactionData?.settingType);
12
- const setInteractionSelectType = core.usePageStore((s)=>s.setInteractionSelectType);
13
- const { closeSelectOnPage, changeSelectMode } = core.useInteraction();
14
- const [hoverOption, setHoverOption] = react.useState(null);
15
- const [openDropdown, setOpenDropdown] = react.useState(false);
16
- const popupRef = react.useRef(null);
17
- const isSelectOnPage = core.usePageStore((s)=>s.interactionData?.isSelectOnPage);
18
- const handleSetInteraction = (type)=>{
19
- setOpenDropdown(false);
20
- setInteractionSelectType(type);
21
- changeSelectMode(type);
22
- if (type == 'PAGE') closeSelectOnPage();
23
- };
24
- const handleClickOutside = react.useCallback((event)=>{
25
- if (!openDropdown) return;
26
- if (popupRef.current && !popupRef.current.contains(event.target)) {
27
- setOpenDropdown(false);
28
- }
29
- }, [
30
- openDropdown
31
- ]);
32
- react.useEffect(()=>{
33
- document.addEventListener('mousedown', handleClickOutside);
34
- return ()=>{
35
- document.removeEventListener('mousedown', handleClickOutside);
36
- };
37
- }, [
38
- handleClickOutside
39
- ]);
40
- const isShowOverlay = react.useMemo(()=>{
41
- return hoverOption !== 'ELEMENT' && (selectType === 'PAGE' || selectType === 'ELEMENT' && hoverOption === 'PAGE') && settingType === 'TRIGGER';
42
- }, [
43
- hoverOption,
44
- selectType
45
- ]);
46
- const title = react.useMemo(()=>{
47
- const type = selectType === 'ELEMENT' ? 'an element' : 'entire page';
48
- if (settingType === 'TRIGGER') return `Start with triggering ${type}`;
49
- return `Set ${selectType === 'ELEMENT' ? 'an element' : 'entire page'} as target`;
50
- }, [
51
- selectType,
52
- settingType
53
- ]);
54
- const renderIconCheckSvg = ()=>{
55
- return /*#__PURE__*/ jsxRuntime.jsx("div", {
56
- className: "gp-w-[21px]",
57
- children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
58
- width: "21",
59
- height: "20",
60
- viewBox: "0 0 21 20",
61
- fill: "none",
62
- xmlns: "http://www.w3.org/2000/svg",
63
- children: /*#__PURE__*/ jsxRuntime.jsx("path", {
64
- fillRule: "evenodd",
65
- clipRule: "evenodd",
66
- d: "M16.3415 5.1766C16.5528 5.41207 16.5528 5.79383 16.3415 6.0293L8.45016 14.8234C8.34869 14.9365 8.21107 15 8.06757 15C7.92408 15 7.78645 14.9365 7.68499 14.8234L4.65846 11.4505C4.44717 11.215 4.44718 10.8333 4.65848 10.5978C4.86978 10.3623 5.21236 10.3623 5.42365 10.5978L8.06759 13.5443L15.5764 5.1766C15.7877 4.94113 16.1302 4.94113 16.3415 5.1766Z",
67
- fill: "#00C853"
68
- })
69
- })
70
- });
71
- };
72
- if (!isSelectOnPage) return null;
73
- return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
74
- children: [
75
- /*#__PURE__*/ jsxRuntime.jsx("header", {
76
- className: "gp-flex gp-text-[12px] gp-justify-center gp-items-center gp-h-10 gp-fixed gp-top-0 gp-left-0 gp-w-full gp-z-[1000] gp-bg-[#151515] gp-text-white interaction-select-mode-header",
77
- children: /*#__PURE__*/ jsxRuntime.jsxs("section", {
78
- className: "gp-flex gp-bg-[#151515]/[0.15] gp-items-center gp-h-full gp-rounded-b-lg gp-pt-1 gp-gap-2",
79
- children: [
80
- /*#__PURE__*/ jsxRuntime.jsxs("div", {
81
- className: "gp-relative",
82
- children: [
83
- /*#__PURE__*/ jsxRuntime.jsxs("button", {
84
- className: `gp-h-full hover:gp-bg-[#7190FF] gp-w-[280px] gp-gap-2 gp-py-2 gp-px-4 gp-items-center gp-justify-center gp-leading-5 gp-font-medium gp-flex gp-rounded-b-[8px] gp-bg-[#3C67FF] gp-text-[#F9F9F9]`,
85
- onClick: ()=>setOpenDropdown((prev)=>!prev),
86
- children: [
87
- /*#__PURE__*/ jsxRuntime.jsx("p", {
88
- className: "gp-grow",
89
- children: title
90
- }),
91
- settingType === 'TRIGGER' && /*#__PURE__*/ jsxRuntime.jsx("div", {
92
- className: "gp-w-[21px]",
93
- children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
94
- width: "16",
95
- height: "16",
96
- viewBox: "0 0 16 16",
97
- fill: "currentColor",
98
- xmlns: "http://www.w3.org/2000/svg",
99
- children: /*#__PURE__*/ jsxRuntime.jsx("path", {
100
- fillRule: "evenodd",
101
- clipRule: "evenodd",
102
- d: "M4.13017 6.11716C4.30374 5.96095 4.58515 5.96095 4.75871 6.11716L8 9.03431L11.2413 6.11716C11.4149 5.96095 11.6963 5.96095 11.8698 6.11716C12.0434 6.27337 12.0434 6.52663 11.8698 6.68284L8.31427 9.88284C8.1407 10.0391 7.8593 10.0391 7.68573 9.88284L4.13017 6.68284C3.95661 6.52663 3.95661 6.27337 4.13017 6.11716Z",
103
- fill: "currentColor"
104
- })
105
- })
106
- })
107
- ]
108
- }),
109
- openDropdown && settingType === 'TRIGGER' && /*#__PURE__*/ jsxRuntime.jsxs("div", {
110
- ref: popupRef,
111
- className: "gp-p-2 gp-flex gp-flex-col gp-absolute gp-top-[calc(100%_+_4px)] gp-w-[280px] gp-bg-[#151515] gp-rounded-xl gp-text-white",
112
- children: [
113
- /*#__PURE__*/ jsxRuntime.jsxs("div", {
114
- className: "gp-p-2 gp-flex gp-gap-2 gp-cursor-pointer hover:gp-bg-[#3b3b3b] gp-rounded-lg",
115
- "aria-hidden": true,
116
- onClick: ()=>handleSetInteraction('ELEMENT'),
117
- onMouseOver: ()=>setHoverOption('ELEMENT'),
118
- onFocus: ()=>setHoverOption('ELEMENT'),
119
- onMouseLeave: ()=>setHoverOption(null),
120
- children: [
121
- selectType === 'ELEMENT' ? renderIconCheckSvg() : /*#__PURE__*/ jsxRuntime.jsx("div", {
122
- className: "gp-w-[21px]",
123
- children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
124
- width: "18",
125
- height: "18",
126
- viewBox: "0 0 18 18",
127
- fill: "none",
128
- xmlns: "http://www.w3.org/2000/svg",
129
- children: /*#__PURE__*/ jsxRuntime.jsx("path", {
130
- fillRule: "evenodd",
131
- clipRule: "evenodd",
132
- d: "M8.99983 0.351562C9.34501 0.351562 9.62483 0.631385 9.62483 0.976562V2.15278C12.923 2.45 15.5496 5.07654 15.8468 8.37476H17.0233C17.3684 8.37476 17.6483 8.65458 17.6483 8.99976C17.6483 9.34493 17.3684 9.62476 17.0233 9.62476H15.8468C15.5496 12.923 12.923 15.5495 9.62483 15.8467V17.0232C9.62483 17.3683 9.34501 17.6482 8.99983 17.6482C8.65465 17.6482 8.37483 17.3683 8.37483 17.0232V15.8467C5.07662 15.5495 2.45007 12.923 2.15286 9.62476H0.976562C0.631385 9.62476 0.351562 9.34493 0.351562 8.99976C0.351562 8.65458 0.631385 8.37476 0.976562 8.37476H2.15286C2.45007 5.07654 5.07662 2.45 8.37483 2.15278V0.976562C8.37483 0.631385 8.65465 0.351562 8.99983 0.351562ZM3.40916 9.62476H5.97656C6.32174 9.62476 6.60156 9.34493 6.60156 8.99976C6.60156 8.65458 6.32174 8.37476 5.97656 8.37476H3.40916C3.69738 5.7675 5.76757 3.6973 8.37483 3.40909V5.97656C8.37483 6.32174 8.65465 6.60156 8.99983 6.60156C9.34501 6.60156 9.62483 6.32174 9.62483 5.97656V3.40909C12.2321 3.6973 14.3023 5.7675 14.5905 8.37476H12.0233C11.6781 8.37476 11.3983 8.65458 11.3983 8.99976C11.3983 9.34493 11.6781 9.62476 12.0233 9.62476H14.5905C14.3023 12.232 12.2321 14.3022 9.62483 14.5904V12.0232C9.62483 11.678 9.34501 11.3982 8.99983 11.3982C8.65465 11.3982 8.37483 11.678 8.37483 12.0232V14.5904C5.76757 14.3022 3.69738 12.232 3.40916 9.62476Z",
133
- fill: "#AAAAAA"
134
- })
135
- })
136
- }),
137
- /*#__PURE__*/ jsxRuntime.jsx("p", {
138
- className: "gp-h-[21px]",
139
- children: "An element"
140
- })
141
- ]
142
- }),
143
- /*#__PURE__*/ jsxRuntime.jsxs("div", {
144
- className: "gp-p-2 gp-flex gp-gap-2 gp-cursor-pointer hover:gp-bg-[#3b3b3b] gp-rounded-lg",
145
- onClick: ()=>handleSetInteraction('PAGE'),
146
- onMouseOver: ()=>setHoverOption('PAGE'),
147
- onFocus: ()=>setHoverOption('PAGE'),
148
- onMouseLeave: ()=>setHoverOption(null),
149
- "aria-hidden": true,
150
- children: [
151
- selectType === 'PAGE' ? renderIconCheckSvg() : /*#__PURE__*/ jsxRuntime.jsx("svg", {
152
- width: "21",
153
- height: "20",
154
- viewBox: "0 0 21 20",
155
- fill: "none",
156
- xmlns: "http://www.w3.org/2000/svg",
157
- children: /*#__PURE__*/ jsxRuntime.jsx("path", {
158
- fillRule: "evenodd",
159
- clipRule: "evenodd",
160
- d: "M7.25 4.5C6.55964 4.5 6 5.05964 6 5.75V14.25C6 14.9404 6.55964 15.5 7.25 15.5H13.75C14.4404 15.5 15 14.9404 15 14.25V9.5H11.75C10.7835 9.5 10 8.7165 10 7.75V4.5H7.25ZM11.5 5.56066L13.9393 8H11.75C11.6119 8 11.5 7.88807 11.5 7.75V5.56066ZM4.5 5.75C4.5 4.23122 5.73122 3 7.25 3H10.75C10.9489 3 11.1397 3.07902 11.2803 3.21967L16.2803 8.21967C16.421 8.36032 16.5 8.55109 16.5 8.75V14.25C16.5 15.7688 15.2688 17 13.75 17H7.25C5.73122 17 4.5 15.7688 4.5 14.25V5.75Z",
161
- fill: "#AAAAAA"
162
- })
163
- }),
164
- /*#__PURE__*/ jsxRuntime.jsx("p", {
165
- className: "gp-h-[21px]",
166
- children: "Entire page"
167
- })
168
- ]
169
- })
170
- ]
171
- })
172
- ]
173
- }),
174
- /*#__PURE__*/ jsxRuntime.jsx("button", {
175
- className: "",
176
- onClick: closeSelectOnPage,
177
- children: "Cancel"
178
- })
179
- ]
180
- })
181
- }),
182
- isShowOverlay && /*#__PURE__*/ jsxRuntime.jsx("div", {
183
- className: `gp-w-full gp-fixed gp-top-0 gp-left-0 gp-mt-[40px] gp-z-[999] gp-bg-[#3c67ff]/[0.25] gp-pointer-events-none`,
184
- style: {
185
- height: 'calc(100% - 40px)'
186
- }
187
- })
188
- ]
189
- });
190
- };
191
-
192
- exports.default = InteractionSelectOnPageHeader;
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- const genResizeFaviconUrl = (faviconUrl, size)=>{
4
- if (!faviconUrl) {
5
- return '/favicon/favicon-32x32.png';
6
- }
7
- const urlParts = faviconUrl.split('.');
8
- const extension = urlParts.pop();
9
- if ([
10
- 'jpg',
11
- 'jpeg',
12
- 'png',
13
- 'gif',
14
- 'webp',
15
- 'ico'
16
- ].includes(extension?.toLocaleLowerCase())) {
17
- return `${urlParts.join('.')}_x${size}.${extension}`;
18
- }
19
- return faviconUrl;
20
- };
21
-
22
- exports.genResizeFaviconUrl = genResizeFaviconUrl;