@gem-sdk/pages 1.64.0 → 2.0.0-dev.168

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 (76) hide show
  1. package/dist/cjs/components/ErrorBoundary.js +1 -0
  2. package/dist/cjs/components/ErrorFallback.js +1 -0
  3. package/dist/cjs/components/FacebookPixel.js +7 -9
  4. package/dist/cjs/components/FooterForPostPurchase.js +1 -0
  5. package/dist/cjs/components/GoogleAnalytic.js +9 -10
  6. package/dist/cjs/components/TikTokPixel.js +1 -0
  7. package/dist/cjs/components/builder/Body.js +1 -0
  8. package/dist/cjs/components/builder/Footer.js +1 -0
  9. package/dist/cjs/components/builder/Header.js +4 -5
  10. package/dist/cjs/components/builder/PopupManager.js +1 -0
  11. package/dist/cjs/components/builder/SwitchView.js +1 -0
  12. package/dist/cjs/components/builder/Toolbar.js +1 -0
  13. package/dist/cjs/components/builder/Toolbox.js +12 -1
  14. package/dist/cjs/components/image-to-layout/AddSectionImageToLayout.js +1 -0
  15. package/dist/cjs/components/image-to-layout/DropElement.js +1 -0
  16. package/dist/cjs/components/image-to-layout/ImageToLayout.js +1 -0
  17. package/dist/cjs/index.js +12 -14
  18. package/dist/cjs/layouts/main.js +2 -1
  19. package/dist/cjs/libs/api/get-builder-props.js +7 -2
  20. package/dist/cjs/libs/api/get-post-purchase-props-preview.js +1 -0
  21. package/dist/cjs/libs/api/get-static-page-props-preview.js +1 -6
  22. package/dist/cjs/libs/api/get-static-page-props-v2.js +2 -1
  23. package/dist/cjs/libs/helpers/gen-css.js +1 -1
  24. package/dist/cjs/libs/helpers/normalize.js +9 -0
  25. package/dist/cjs/libs/hooks/use-tracking-view.js +1 -0
  26. package/dist/cjs/libs/parse-html.js +23 -15
  27. package/dist/cjs/pages/404.js +1 -0
  28. package/dist/cjs/pages/500.js +1 -0
  29. package/dist/cjs/pages/CollectionGlobalProvider.js +1 -0
  30. package/dist/cjs/pages/builder.js +14 -22
  31. package/dist/cjs/pages/collection-detail.js +31 -40
  32. package/dist/cjs/pages/preview.js +1 -0
  33. package/dist/cjs/pages/product-detail.js +18 -29
  34. package/dist/cjs/pages/static-v2.js +40 -72
  35. package/dist/cjs/pages/static.js +34 -44
  36. package/dist/esm/components/ErrorBoundary.js +1 -0
  37. package/dist/esm/components/ErrorFallback.js +1 -0
  38. package/dist/esm/components/FacebookPixel.js +7 -9
  39. package/dist/esm/components/FooterForPostPurchase.js +1 -0
  40. package/dist/esm/components/GoogleAnalytic.js +9 -10
  41. package/dist/esm/components/TikTokPixel.js +1 -0
  42. package/dist/esm/components/builder/Body.js +1 -0
  43. package/dist/esm/components/builder/Footer.js +1 -0
  44. package/dist/esm/components/builder/Header.js +4 -5
  45. package/dist/esm/components/builder/PopupManager.js +1 -0
  46. package/dist/esm/components/builder/SwitchView.js +1 -0
  47. package/dist/esm/components/builder/Toolbar.js +1 -0
  48. package/dist/esm/components/builder/Toolbox.js +12 -1
  49. package/dist/esm/components/image-to-layout/AddSectionImageToLayout.js +1 -0
  50. package/dist/esm/components/image-to-layout/DropElement.js +1 -0
  51. package/dist/esm/components/image-to-layout/ImageToLayout.js +1 -0
  52. package/dist/esm/index.js +6 -7
  53. package/dist/esm/layouts/main.js +2 -1
  54. package/dist/esm/libs/api/get-builder-props.js +8 -3
  55. package/dist/esm/libs/api/get-post-purchase-props-preview.js +1 -0
  56. package/dist/esm/libs/api/get-static-page-props-preview.js +2 -7
  57. package/dist/esm/libs/api/get-static-page-props-v2.js +3 -2
  58. package/dist/esm/libs/helpers/gen-css.js +1 -1
  59. package/dist/esm/libs/helpers/normalize.js +9 -1
  60. package/dist/esm/libs/hooks/use-tracking-view.js +1 -0
  61. package/dist/esm/libs/parse-html.js +23 -15
  62. package/dist/esm/pages/404.js +1 -0
  63. package/dist/esm/pages/500.js +1 -0
  64. package/dist/esm/pages/CollectionGlobalProvider.js +1 -0
  65. package/dist/esm/pages/builder.js +14 -22
  66. package/dist/esm/pages/collection-detail.js +32 -41
  67. package/dist/esm/pages/preview.js +1 -0
  68. package/dist/esm/pages/product-detail.js +19 -30
  69. package/dist/esm/pages/static-v2.js +41 -73
  70. package/dist/esm/pages/static.js +35 -45
  71. package/dist/types/index.d.ts +37 -34
  72. package/package.json +5 -5
  73. package/dist/cjs/components/builder/InteractionSelectOnPageHeader.js +0 -192
  74. package/dist/cjs/libs/helpers/sentry.js +0 -17
  75. package/dist/esm/components/builder/InteractionSelectOnPageHeader.js +0 -188
  76. package/dist/esm/libs/helpers/sentry.js +0 -15
@@ -40,7 +40,12 @@ type PageBuilderProps = {
40
40
  customCodeBody?: string | null;
41
41
  isStorefront?: boolean;
42
42
  customFonts?: string | null;
43
- interaction?: ShopType.Maybe<Pick<ShopType.PublishedPageInteraction, "id" | "value">>;
43
+ interaction?: ShopType.Maybe<Pick<ShopType.PublishedPageInteraction, 'id' | 'value'>>;
44
+ pageBackground?: {
45
+ isUsePageBackground?: boolean;
46
+ background?: string;
47
+ };
48
+ timezone?: string;
44
49
  };
45
50
  type PageBuilderPropsV2 = {
46
51
  builderData?: {
@@ -118,7 +123,7 @@ declare const usePagePreview: (dataBuilder: ThemePageQueryResponse['themePage'],
118
123
  pageConfig: {
119
124
  mobileOnly: boolean;
120
125
  locale: string | null;
121
- 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
+ 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" | "LB" | "LT" | "LU" | "LV" | "MG" | "MK" | "ML" | "MN" | "MR" | "MS" | "MT" | "MY" | "NE" | "NL" | "NO" | "OM" | "PA" | "PL" | "PS" | "PT" | "RO" | "RU" | "RW" | "SD" | "SE" | "SG" | "SI" | "SK" | "SL" | "SN" | "SO" | "SR" | "SV" | "TA" | "TG" | "TH" | "TK" | "TO" | "TR" | "TT" | "UG" | "UZ" | "AK" | "AS" | "CE" | "CS" | "DA" | "EL" | "EN" | "EO" | "EU" | "FA" | "FF" | "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;
122
127
  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;
123
128
  moneyFormat: string | null;
124
129
  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;
@@ -157,36 +162,6 @@ type RetryConfig = {
157
162
  };
158
163
  declare const retryWithDelay: <T = unknown>(fn: () => T, config?: RetryConfig) => Promise<T>;
159
164
 
160
- type PreviewPageProps = {
161
- components: Record<string, React.ComponentType<any>>;
162
- pageType: ShopType.PublishedThemePageType;
163
- };
164
- declare const PreviewPage: React.FC<PreviewPageProps>;
165
-
166
- type StaticPageProps = PageBuilderProps;
167
- declare const StaticPage: React.FC<StaticPageProps & AdditionalPageBuilderProps>;
168
-
169
- type BuilderPageProps = {
170
- components: Record<string, React.ComponentType<any>>;
171
- seo?: NextSeoProps;
172
- themeStyle?: string | null;
173
- fontStyle?: string | null;
174
- header?: BuilderState;
175
- footer?: BuilderState;
176
- sectionData?: Record<string, SectionData$1>;
177
- storefrontToken?: string | null;
178
- storefrontHandle?: string | null;
179
- shopToken?: string | null;
180
- mode?: RenderMode;
181
- pageType: ShopType.PublishedThemePageType;
182
- editorImageToLayout?: boolean;
183
- isThemeSectionEditor?: boolean;
184
- hiddenToolbar?: boolean;
185
- pageName: string;
186
- isOriginTemplate?: boolean;
187
- };
188
- declare const BuilderPage: React.FC<BuilderPageProps>;
189
-
190
165
  declare const getStaticPaths: GetStaticPaths;
191
166
 
192
167
  type TypographyV2FontFamilyType = 'google' | 'custom' | 'theme' | 'bunny';
@@ -257,6 +232,34 @@ type Props = {
257
232
  };
258
233
  declare const TikTokPixel: ({ pixelId }: Props) => react_jsx_runtime.JSX.Element | null;
259
234
 
260
- declare const parseHtml: (key: string, html?: string | null, isHead?: boolean) => string | JSX.Element | JSX.Element[] | undefined;
235
+ type PreviewPageProps = {
236
+ components: Record<string, React.ComponentType<any>>;
237
+ pageType: ShopType.PublishedThemePageType;
238
+ };
239
+ declare const PreviewPage: React.FC<PreviewPageProps>;
240
+
241
+ type StaticPageProps = PageBuilderProps;
242
+ declare const StaticPage: React.FC<StaticPageProps & AdditionalPageBuilderProps>;
243
+
244
+ type BuilderPageProps = {
245
+ components: Record<string, React.ComponentType<any>>;
246
+ seo?: NextSeoProps;
247
+ themeStyle?: string | null;
248
+ fontStyle?: string | null;
249
+ header?: BuilderState;
250
+ footer?: BuilderState;
251
+ sectionData?: Record<string, SectionData$1>;
252
+ storefrontToken?: string | null;
253
+ storefrontHandle?: string | null;
254
+ shopToken?: string | null;
255
+ mode?: RenderMode;
256
+ pageType: ShopType.PublishedThemePageType;
257
+ editorImageToLayout?: boolean;
258
+ isThemeSectionEditor?: boolean;
259
+ hiddenToolbar?: boolean;
260
+ pageName: string;
261
+ isOriginTemplate?: boolean;
262
+ };
263
+ declare const BuilderPage: React.FC<BuilderPageProps>;
261
264
 
262
- 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 };
265
+ export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, CollectionPageProps, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PageBuilderPropsV2, 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, retryWithDelay, usePagePreview, useTrackingView };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "1.64.0",
3
+ "version": "2.0.0-dev.168",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,10 +26,10 @@
26
26
  "next": "latest"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "1.64.0",
30
- "@gem-sdk/plugin-cookie-bar": "1.58.0",
31
- "@gem-sdk/plugin-quick-view": "1.58.0",
32
- "@gem-sdk/plugin-sticky-add-to-cart": "1.58.0"
29
+ "@gem-sdk/core": "2.0.0-dev.168",
30
+ "@gem-sdk/plugin-cookie-bar": "1.58.0-dev.142",
31
+ "@gem-sdk/plugin-quick-view": "1.58.0-dev.142",
32
+ "@gem-sdk/plugin-sticky-add-to-cart": "1.58.0-dev.142"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "next": ">=13"
@@ -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,17 +0,0 @@
1
- 'use strict';
2
-
3
- var nextjs = require('@sentry/nextjs');
4
-
5
- const sentryCaptureException = (funcName, message, data, options)=>{
6
- nextjs.withScope((scope)=>{
7
- scope.setLevel(options?.level ?? 'log');
8
- if (options?.tag) {
9
- scope.setTag(options?.tag.key, options?.tag.value);
10
- }
11
- scope.setExtra('function', funcName);
12
- scope.setExtra('data', JSON.stringify(data));
13
- nextjs.captureMessage(`${funcName}: ${message}`);
14
- });
15
- };
16
-
17
- exports.sentryCaptureException = sentryCaptureException;
@@ -1,188 +0,0 @@
1
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import { usePageStore, useInteraction } from '@gem-sdk/core';
3
- import { useState, useRef, useCallback, useEffect, useMemo } from 'react';
4
-
5
- const InteractionSelectOnPageHeader = ()=>{
6
- const selectType = usePageStore((s)=>s.interactionData?.selectType);
7
- const settingType = usePageStore((s)=>s.interactionData?.settingType);
8
- const setInteractionSelectType = usePageStore((s)=>s.setInteractionSelectType);
9
- const { closeSelectOnPage, changeSelectMode } = useInteraction();
10
- const [hoverOption, setHoverOption] = useState(null);
11
- const [openDropdown, setOpenDropdown] = useState(false);
12
- const popupRef = useRef(null);
13
- const isSelectOnPage = usePageStore((s)=>s.interactionData?.isSelectOnPage);
14
- const handleSetInteraction = (type)=>{
15
- setOpenDropdown(false);
16
- setInteractionSelectType(type);
17
- changeSelectMode(type);
18
- if (type == 'PAGE') closeSelectOnPage();
19
- };
20
- const handleClickOutside = useCallback((event)=>{
21
- if (!openDropdown) return;
22
- if (popupRef.current && !popupRef.current.contains(event.target)) {
23
- setOpenDropdown(false);
24
- }
25
- }, [
26
- openDropdown
27
- ]);
28
- useEffect(()=>{
29
- document.addEventListener('mousedown', handleClickOutside);
30
- return ()=>{
31
- document.removeEventListener('mousedown', handleClickOutside);
32
- };
33
- }, [
34
- handleClickOutside
35
- ]);
36
- const isShowOverlay = useMemo(()=>{
37
- return hoverOption !== 'ELEMENT' && (selectType === 'PAGE' || selectType === 'ELEMENT' && hoverOption === 'PAGE') && settingType === 'TRIGGER';
38
- }, [
39
- hoverOption,
40
- selectType
41
- ]);
42
- const title = useMemo(()=>{
43
- const type = selectType === 'ELEMENT' ? 'an element' : 'entire page';
44
- if (settingType === 'TRIGGER') return `Start with triggering ${type}`;
45
- return `Set ${selectType === 'ELEMENT' ? 'an element' : 'entire page'} as target`;
46
- }, [
47
- selectType,
48
- settingType
49
- ]);
50
- const renderIconCheckSvg = ()=>{
51
- return /*#__PURE__*/ jsx("div", {
52
- className: "gp-w-[21px]",
53
- children: /*#__PURE__*/ jsx("svg", {
54
- width: "21",
55
- height: "20",
56
- viewBox: "0 0 21 20",
57
- fill: "none",
58
- xmlns: "http://www.w3.org/2000/svg",
59
- children: /*#__PURE__*/ jsx("path", {
60
- fillRule: "evenodd",
61
- clipRule: "evenodd",
62
- 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",
63
- fill: "#00C853"
64
- })
65
- })
66
- });
67
- };
68
- if (!isSelectOnPage) return null;
69
- return /*#__PURE__*/ jsxs(Fragment, {
70
- children: [
71
- /*#__PURE__*/ jsx("header", {
72
- 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",
73
- children: /*#__PURE__*/ jsxs("section", {
74
- className: "gp-flex gp-bg-[#151515]/[0.15] gp-items-center gp-h-full gp-rounded-b-lg gp-pt-1 gp-gap-2",
75
- children: [
76
- /*#__PURE__*/ jsxs("div", {
77
- className: "gp-relative",
78
- children: [
79
- /*#__PURE__*/ jsxs("button", {
80
- 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]`,
81
- onClick: ()=>setOpenDropdown((prev)=>!prev),
82
- children: [
83
- /*#__PURE__*/ jsx("p", {
84
- className: "gp-grow",
85
- children: title
86
- }),
87
- settingType === 'TRIGGER' && /*#__PURE__*/ jsx("div", {
88
- className: "gp-w-[21px]",
89
- children: /*#__PURE__*/ jsx("svg", {
90
- width: "16",
91
- height: "16",
92
- viewBox: "0 0 16 16",
93
- fill: "currentColor",
94
- xmlns: "http://www.w3.org/2000/svg",
95
- children: /*#__PURE__*/ jsx("path", {
96
- fillRule: "evenodd",
97
- clipRule: "evenodd",
98
- 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",
99
- fill: "currentColor"
100
- })
101
- })
102
- })
103
- ]
104
- }),
105
- openDropdown && settingType === 'TRIGGER' && /*#__PURE__*/ jsxs("div", {
106
- ref: popupRef,
107
- 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",
108
- children: [
109
- /*#__PURE__*/ jsxs("div", {
110
- className: "gp-p-2 gp-flex gp-gap-2 gp-cursor-pointer hover:gp-bg-[#3b3b3b] gp-rounded-lg",
111
- "aria-hidden": true,
112
- onClick: ()=>handleSetInteraction('ELEMENT'),
113
- onMouseOver: ()=>setHoverOption('ELEMENT'),
114
- onFocus: ()=>setHoverOption('ELEMENT'),
115
- onMouseLeave: ()=>setHoverOption(null),
116
- children: [
117
- selectType === 'ELEMENT' ? renderIconCheckSvg() : /*#__PURE__*/ jsx("div", {
118
- className: "gp-w-[21px]",
119
- children: /*#__PURE__*/ jsx("svg", {
120
- width: "18",
121
- height: "18",
122
- viewBox: "0 0 18 18",
123
- fill: "none",
124
- xmlns: "http://www.w3.org/2000/svg",
125
- children: /*#__PURE__*/ jsx("path", {
126
- fillRule: "evenodd",
127
- clipRule: "evenodd",
128
- 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",
129
- fill: "#AAAAAA"
130
- })
131
- })
132
- }),
133
- /*#__PURE__*/ jsx("p", {
134
- className: "gp-h-[21px]",
135
- children: "An element"
136
- })
137
- ]
138
- }),
139
- /*#__PURE__*/ jsxs("div", {
140
- className: "gp-p-2 gp-flex gp-gap-2 gp-cursor-pointer hover:gp-bg-[#3b3b3b] gp-rounded-lg",
141
- onClick: ()=>handleSetInteraction('PAGE'),
142
- onMouseOver: ()=>setHoverOption('PAGE'),
143
- onFocus: ()=>setHoverOption('PAGE'),
144
- onMouseLeave: ()=>setHoverOption(null),
145
- "aria-hidden": true,
146
- children: [
147
- selectType === 'PAGE' ? renderIconCheckSvg() : /*#__PURE__*/ jsx("svg", {
148
- width: "21",
149
- height: "20",
150
- viewBox: "0 0 21 20",
151
- fill: "none",
152
- xmlns: "http://www.w3.org/2000/svg",
153
- children: /*#__PURE__*/ jsx("path", {
154
- fillRule: "evenodd",
155
- clipRule: "evenodd",
156
- 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",
157
- fill: "#AAAAAA"
158
- })
159
- }),
160
- /*#__PURE__*/ jsx("p", {
161
- className: "gp-h-[21px]",
162
- children: "Entire page"
163
- })
164
- ]
165
- })
166
- ]
167
- })
168
- ]
169
- }),
170
- /*#__PURE__*/ jsx("button", {
171
- className: "",
172
- onClick: closeSelectOnPage,
173
- children: "Cancel"
174
- })
175
- ]
176
- })
177
- }),
178
- isShowOverlay && /*#__PURE__*/ jsx("div", {
179
- 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`,
180
- style: {
181
- height: 'calc(100% - 40px)'
182
- }
183
- })
184
- ]
185
- });
186
- };
187
-
188
- export { InteractionSelectOnPageHeader as default };
@@ -1,15 +0,0 @@
1
- import { withScope, captureMessage } from '@sentry/nextjs';
2
-
3
- const sentryCaptureException = (funcName, message, data, options)=>{
4
- withScope((scope)=>{
5
- scope.setLevel(options?.level ?? 'log');
6
- if (options?.tag) {
7
- scope.setTag(options?.tag.key, options?.tag.value);
8
- }
9
- scope.setExtra('function', funcName);
10
- scope.setExtra('data', JSON.stringify(data));
11
- captureMessage(`${funcName}: ${message}`);
12
- });
13
- };
14
-
15
- export { sentryCaptureException };