@gem-sdk/pages 1.0.2 → 1.1.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.
@@ -4,10 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var core = require('@gem-sdk/core');
7
+ var parseHtml = require('../libs/parse-html.js');
7
8
 
8
- const MainLayout = ({ children }) => {
9
+ const MainLayout = ({ children, ...props }) => {
9
10
  const mobileOnly = core.useShopStore((s) => s.mobileOnly);
10
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: core.cls({
11
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [parseHtml.parseHtml(props?.customCodeBody), jsxRuntime.jsx("div", { className: core.cls({
11
12
  'max-w-mobile mx-auto w-full': mobileOnly,
12
13
  }), children: children }), jsxRuntime.jsx(core.AddOn, { name: "cookie-bar" }), jsxRuntime.jsx(core.AddOn, { name: "cart-drawer" })] }));
13
14
  };
@@ -122,6 +122,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher) => async (slug) => {
122
122
  gaTrackingId: dataBuilder.themePageAnalytic?.gaTrackingID ?? null,
123
123
  facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
124
124
  tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
125
+ customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
126
+ customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
125
127
  });
126
128
  }
127
129
  catch (err) {
@@ -119,6 +119,8 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher) => async (slug) => {
119
119
  gaTrackingId: dataBuilder.themePageAnalytic?.gaTrackingID ?? null,
120
120
  facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
121
121
  tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
122
+ customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
123
+ customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
122
124
  });
123
125
  }
124
126
  catch (err) {
@@ -3,8 +3,8 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var main = require('../layouts/main.js');
5
5
 
6
- const getLayout = (page) => {
7
- return jsxRuntime.jsx(main.default, { children: page });
6
+ const getLayout = (page, pageProps) => {
7
+ return jsxRuntime.jsx(main.default, { ...pageProps, children: page });
8
8
  };
9
9
 
10
10
  exports.getLayout = getLayout;
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var parse = require('html-react-parser');
5
+ var Script = require('next/script');
6
+
7
+ const parseHtml = (html, isHead) => {
8
+ if (!html)
9
+ return undefined;
10
+ try {
11
+ return parse(html, {
12
+ replace: (node) => {
13
+ if (node.type === 'script' && node instanceof parse.Element) {
14
+ const child = node.children?.[0];
15
+ if (child instanceof parse.Text) {
16
+ if (isHead)
17
+ return jsxRuntime.jsx("script", { ...node.attribs, dangerouslySetInnerHTML: { __html: child.data } });
18
+ else
19
+ return jsxRuntime.jsx(Script, { ...node.attribs, dangerouslySetInnerHTML: { __html: child.data } });
20
+ }
21
+ else {
22
+ if (!isHead) {
23
+ return jsxRuntime.jsx(Script, { ...node.attribs });
24
+ }
25
+ }
26
+ }
27
+ },
28
+ });
29
+ }
30
+ catch {
31
+ return undefined;
32
+ }
33
+ };
34
+
35
+ exports.parseHtml = parseHtml;
@@ -5,13 +5,14 @@ var core = require('@gem-sdk/core');
5
5
  var nextSeo = require('next-seo');
6
6
  var Head = require('next/head');
7
7
  var router = require('next/router');
8
+ var parseHtml = require('../libs/parse-html.js');
8
9
 
9
- const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, }) => {
10
+ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, customCodeHeader, }) => {
10
11
  const router$1 = router.useRouter();
11
12
  if (router$1.isFallback) {
12
13
  return (jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: jsxRuntime.jsxs("div", { className: "flex gap-2", children: [jsxRuntime.jsx("span", { className: "aspect-square h-2 animate-[flashing_500ms_infinite_alternate] rounded-full bg-slate-800" }), jsxRuntime.jsx("span", { className: "aspect-square h-2 animate-[flashing_500ms_infinite_200ms_linear_alternate] rounded-full bg-slate-800" }), jsxRuntime.jsx("span", { className: "aspect-square h-2 animate-[flashing_500ms_infinite_500ms_alternate] rounded-full bg-slate-800" })] }) }));
13
14
  }
14
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(nextSeo.NextSeo, { ...seo }), jsxRuntime.jsxs(Head, { children: [themeStyle && (jsxRuntime.jsx("style", { "data-id": "global-style", type: "text/css", dangerouslySetInnerHTML: { __html: themeStyle } })), fontStyle && (jsxRuntime.jsx("style", { "data-id": "google-fonts", type: "text/css", dangerouslySetInnerHTML: { __html: fontStyle } }))] }), jsxRuntime.jsx(core.BuilderComponentProvider, { components: components, children: jsxRuntime.jsx(core.SectionProvider, { data: sectionData, children: builderData?.map((builder) => (jsxRuntime.jsx(core.BuilderProvider, { state: builder.data, lazy: builder.lazy, priority: builder.priority, children: jsxRuntime.jsx(core.Render, { uid: builder.uid }) }, builder.uid))) }) })] }));
15
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(nextSeo.NextSeo, { ...seo }), jsxRuntime.jsxs(Head, { children: [parseHtml.parseHtml(customCodeHeader, true), themeStyle && (jsxRuntime.jsx("style", { "data-id": "global-style", type: "text/css", dangerouslySetInnerHTML: { __html: themeStyle } })), fontStyle && (jsxRuntime.jsx("style", { "data-id": "google-fonts", type: "text/css", dangerouslySetInnerHTML: { __html: fontStyle } }))] }), jsxRuntime.jsx(core.BuilderComponentProvider, { components: components, children: jsxRuntime.jsx(core.SectionProvider, { data: sectionData, children: builderData?.map((builder) => (jsxRuntime.jsx(core.BuilderProvider, { state: builder.data, lazy: builder.lazy, priority: builder.priority, children: jsxRuntime.jsx(core.Render, { uid: builder.uid }) }, builder.uid))) }) })] }));
15
16
  };
16
17
 
17
18
  exports.StaticPageV2 = StaticPageV2;
@@ -1,9 +1,10 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import { useShopStore, cls, AddOn } from '@gem-sdk/core';
3
+ import { parseHtml } from '../libs/parse-html.js';
3
4
 
4
- const MainLayout = ({ children }) => {
5
+ const MainLayout = ({ children, ...props }) => {
5
6
  const mobileOnly = useShopStore((s) => s.mobileOnly);
6
- return (jsxs(Fragment, { children: [jsx("div", { className: cls({
7
+ return (jsxs(Fragment, { children: [parseHtml(props?.customCodeBody), jsx("div", { className: cls({
7
8
  'max-w-mobile mx-auto w-full': mobileOnly,
8
9
  }), children: children }), jsx(AddOn, { name: "cookie-bar" }), jsx(AddOn, { name: "cart-drawer" })] }));
9
10
  };
@@ -120,6 +120,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher) => async (slug) => {
120
120
  gaTrackingId: dataBuilder.themePageAnalytic?.gaTrackingID ?? null,
121
121
  facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
122
122
  tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
123
+ customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
124
+ customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
123
125
  });
124
126
  }
125
127
  catch (err) {
@@ -117,6 +117,8 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher) => async (slug) => {
117
117
  gaTrackingId: dataBuilder.themePageAnalytic?.gaTrackingID ?? null,
118
118
  facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
119
119
  tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
120
+ customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
121
+ customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
120
122
  });
121
123
  }
122
124
  catch (err) {
@@ -1,8 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import MainLayout from '../layouts/main.js';
3
3
 
4
- const getLayout = (page) => {
5
- return jsx(MainLayout, { children: page });
4
+ const getLayout = (page, pageProps) => {
5
+ return jsx(MainLayout, { ...pageProps, children: page });
6
6
  };
7
7
 
8
8
  export { getLayout };
@@ -0,0 +1,33 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import parse, { Element, Text } from 'html-react-parser';
3
+ import Script from 'next/script';
4
+
5
+ const parseHtml = (html, isHead) => {
6
+ if (!html)
7
+ return undefined;
8
+ try {
9
+ return parse(html, {
10
+ replace: (node) => {
11
+ if (node.type === 'script' && node instanceof Element) {
12
+ const child = node.children?.[0];
13
+ if (child instanceof Text) {
14
+ if (isHead)
15
+ return jsx("script", { ...node.attribs, dangerouslySetInnerHTML: { __html: child.data } });
16
+ else
17
+ return jsx(Script, { ...node.attribs, dangerouslySetInnerHTML: { __html: child.data } });
18
+ }
19
+ else {
20
+ if (!isHead) {
21
+ return jsx(Script, { ...node.attribs });
22
+ }
23
+ }
24
+ }
25
+ },
26
+ });
27
+ }
28
+ catch {
29
+ return undefined;
30
+ }
31
+ };
32
+
33
+ export { parseHtml };
@@ -3,13 +3,14 @@ import { BuilderComponentProvider, SectionProvider, BuilderProvider, Render } fr
3
3
  import { NextSeo } from 'next-seo';
4
4
  import Head from 'next/head';
5
5
  import { useRouter } from 'next/router';
6
+ import { parseHtml } from '../libs/parse-html.js';
6
7
 
7
- const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, }) => {
8
+ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, customCodeHeader, }) => {
8
9
  const router = useRouter();
9
10
  if (router.isFallback) {
10
11
  return (jsx("div", { className: "flex h-full items-center justify-center", children: jsxs("div", { className: "flex gap-2", children: [jsx("span", { className: "aspect-square h-2 animate-[flashing_500ms_infinite_alternate] rounded-full bg-slate-800" }), jsx("span", { className: "aspect-square h-2 animate-[flashing_500ms_infinite_200ms_linear_alternate] rounded-full bg-slate-800" }), jsx("span", { className: "aspect-square h-2 animate-[flashing_500ms_infinite_500ms_alternate] rounded-full bg-slate-800" })] }) }));
11
12
  }
12
- return (jsxs(Fragment, { children: [jsx(NextSeo, { ...seo }), jsxs(Head, { children: [themeStyle && (jsx("style", { "data-id": "global-style", type: "text/css", dangerouslySetInnerHTML: { __html: themeStyle } })), fontStyle && (jsx("style", { "data-id": "google-fonts", type: "text/css", dangerouslySetInnerHTML: { __html: fontStyle } }))] }), jsx(BuilderComponentProvider, { components: components, children: jsx(SectionProvider, { data: sectionData, children: builderData?.map((builder) => (jsx(BuilderProvider, { state: builder.data, lazy: builder.lazy, priority: builder.priority, children: jsx(Render, { uid: builder.uid }) }, builder.uid))) }) })] }));
13
+ return (jsxs(Fragment, { children: [jsx(NextSeo, { ...seo }), jsxs(Head, { children: [parseHtml(customCodeHeader, true), themeStyle && (jsx("style", { "data-id": "global-style", type: "text/css", dangerouslySetInnerHTML: { __html: themeStyle } })), fontStyle && (jsx("style", { "data-id": "google-fonts", type: "text/css", dangerouslySetInnerHTML: { __html: fontStyle } }))] }), jsx(BuilderComponentProvider, { components: components, children: jsx(SectionProvider, { data: sectionData, children: builderData?.map((builder) => (jsx(BuilderProvider, { state: builder.data, lazy: builder.lazy, priority: builder.priority, children: jsx(Render, { uid: builder.uid }) }, builder.uid))) }) })] }));
13
14
  };
14
15
 
15
16
  export { StaticPageV2 };
@@ -6,49 +6,51 @@ import { SWRConfig } from 'swr';
6
6
  import * as react from 'react';
7
7
  import { Component } from 'react';
8
8
 
9
- type PageBuilderProps = {
10
- seo?: NextSeoProps;
11
- builderData?: BuilderState;
12
- sectionData?: Record<string, SectionData>;
13
- themeStyle?: string | null;
14
- fontStyle?: string | null;
15
- swr?: React.ComponentProps<typeof SWRConfig>['value'];
16
- plugins?: string[];
17
- pageType?: ShopType.PublishedThemePageType;
18
- storefrontToken?: string | null;
19
- storefrontHandle?: string | null;
20
- shopToken?: string | null;
21
- currency?: string | null;
22
- locale?: string | null;
23
- favicon?: string | null;
24
- mobileOnly?: boolean | null;
25
- swatches?: any[] | null;
26
- mode?: RenderMode;
27
- gaTrackingId?: string | null;
28
- tiktokPixelId?: string | null;
29
- facebookPixelId?: string | null;
30
- };
31
- type PageBuilderPropsV2 = {
32
- builderData?: {
33
- uid: string;
34
- lazy?: boolean;
35
- priority?: boolean;
36
- data: BuilderState;
37
- }[];
38
- } & Omit<PageBuilderProps, 'builderData'>;
39
- type AdditionalPageBuilderProps = {
40
- components: Record<string, React.ComponentType<any>>;
41
- };
42
- type NextPageWithLayout<P = PageBuilderProps, IP = P> = NextPage<P, IP> & {
43
- getLayout?: (page: React.ReactElement) => React.ReactNode;
44
- };
45
- type AppPropsWithLayout<P = PageBuilderProps> = AppProps<P> & {
46
- Component: NextPageWithLayout;
47
- };
48
-
49
- type CollectionPageProps = PageBuilderProps & {
50
- collection?: CollectionQueryResponse['collection'];
51
- };
9
+ type PageBuilderProps = {
10
+ seo?: NextSeoProps;
11
+ builderData?: BuilderState;
12
+ sectionData?: Record<string, SectionData>;
13
+ themeStyle?: string | null;
14
+ fontStyle?: string | null;
15
+ swr?: React.ComponentProps<typeof SWRConfig>['value'];
16
+ plugins?: string[];
17
+ pageType?: ShopType.PublishedThemePageType;
18
+ storefrontToken?: string | null;
19
+ storefrontHandle?: string | null;
20
+ shopToken?: string | null;
21
+ currency?: string | null;
22
+ locale?: string | null;
23
+ favicon?: string | null;
24
+ mobileOnly?: boolean | null;
25
+ swatches?: any[] | null;
26
+ mode?: RenderMode;
27
+ gaTrackingId?: string | null;
28
+ tiktokPixelId?: string | null;
29
+ facebookPixelId?: string | null;
30
+ customCodeHeader?: string | null;
31
+ customCodeBody?: string | null;
32
+ };
33
+ type PageBuilderPropsV2 = {
34
+ builderData?: {
35
+ uid: string;
36
+ lazy?: boolean;
37
+ priority?: boolean;
38
+ data: BuilderState;
39
+ }[];
40
+ } & Omit<PageBuilderProps, 'builderData'>;
41
+ type AdditionalPageBuilderProps = {
42
+ components: Record<string, React.ComponentType<any>>;
43
+ };
44
+ type NextPageWithLayout<P = PageBuilderProps, IP = P> = NextPage<P, IP> & {
45
+ getLayout?: (page: React.ReactElement, pageProps?: any) => React.ReactNode;
46
+ };
47
+ type AppPropsWithLayout<P = PageBuilderProps> = AppProps<P> & {
48
+ Component: NextPageWithLayout;
49
+ };
50
+
51
+ type CollectionPageProps = PageBuilderProps & {
52
+ collection?: CollectionQueryResponse['collection'];
53
+ };
52
54
  declare const CollectionDetailPage: React.FC<CollectionPageProps & AdditionalPageBuilderProps>;
53
55
 
54
56
  declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<CollectionPageProps>;
@@ -59,12 +61,12 @@ declare const getHomePagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc
59
61
 
60
62
  declare const getPreviewProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (pageType: ShopType.PublishedThemePageType, slug?: string) => Promise<PageBuilderProps>;
61
63
 
62
- type Props$4 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
64
+ type Props$4 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
63
65
  declare const getBuilderProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => Promise<Props$4>;
64
66
 
65
- type ProductPageProps = PageBuilderProps & {
66
- product?: ProductSelectFragment;
67
- };
67
+ type ProductPageProps = PageBuilderProps & {
68
+ product?: ProductSelectFragment;
69
+ };
68
70
  declare const ProductDetailPage: React.FC<ProductPageProps & AdditionalPageBuilderProps>;
69
71
 
70
72
  declare const getProductProps: (fetcher: FetchFunc) => (handle?: string) => Promise<ProductPageProps>;
@@ -75,99 +77,99 @@ declare const getStaticPagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFu
75
77
 
76
78
  declare const getStaticPagePropsPreview: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
77
79
 
78
- declare const createFetcher: (token?: string | null) => FetchFunc;
80
+ declare const createFetcher: (token?: string | null) => FetchFunc;
79
81
  declare const createShopifyFetcher: (storefrontToken?: string, handle?: string) => FetchFunc;
80
82
 
81
- declare const getLayout: (page: React.ReactElement) => JSX.Element;
83
+ declare const getLayout: (page: React.ReactElement, pageProps?: any) => JSX.Element;
82
84
 
83
85
  declare const genCSS: (input?: string | Record<string, any>, mobileOnly?: boolean) => string;
84
86
 
85
- type PreviewPageProps = {
86
- components: Record<string, React.ComponentType<any>>;
87
- pageType: ShopType.PublishedThemePageType;
88
- };
87
+ type PreviewPageProps = {
88
+ components: Record<string, React.ComponentType<any>>;
89
+ pageType: ShopType.PublishedThemePageType;
90
+ };
89
91
  declare const PreviewPage: React.FC<PreviewPageProps>;
90
92
 
91
- type StaticPageProps = PageBuilderProps;
93
+ type StaticPageProps = PageBuilderProps;
92
94
  declare const StaticPage: React.FC<StaticPageProps & AdditionalPageBuilderProps>;
93
95
 
94
- type BuilderPageProps = {
95
- components: Record<string, React.ComponentType<any>>;
96
- seo?: NextSeoProps;
97
- themeStyle?: string | null;
98
- fontStyle?: string | null;
99
- header?: BuilderState;
100
- footer?: BuilderState;
101
- sectionData?: Record<string, SectionData>;
102
- storefrontToken?: string | null;
103
- storefrontHandle?: string | null;
104
- shopToken?: string | null;
105
- mode?: RenderMode;
106
- };
96
+ type BuilderPageProps = {
97
+ components: Record<string, React.ComponentType<any>>;
98
+ seo?: NextSeoProps;
99
+ themeStyle?: string | null;
100
+ fontStyle?: string | null;
101
+ header?: BuilderState;
102
+ footer?: BuilderState;
103
+ sectionData?: Record<string, SectionData>;
104
+ storefrontToken?: string | null;
105
+ storefrontHandle?: string | null;
106
+ shopToken?: string | null;
107
+ mode?: RenderMode;
108
+ };
107
109
  declare const BuilderPage: React.FC<BuilderPageProps>;
108
110
 
109
- type StaticPagePropsV2 = PageBuilderPropsV2;
111
+ type StaticPagePropsV2 = PageBuilderPropsV2;
110
112
  declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderProps>;
111
113
 
112
114
  declare const getStaticPaths: GetStaticPaths;
113
115
 
114
- type FontItem = {
115
- family: string;
116
- variants: string[];
117
- subsets: string[];
118
- };
119
- type FontOption = {
120
- display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
121
- subset?: string;
122
- effect?: string;
123
- };
116
+ type FontItem = {
117
+ family: string;
118
+ variants: string[];
119
+ subsets: string[];
120
+ };
121
+ type FontOption = {
122
+ display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
123
+ subset?: string;
124
+ effect?: string;
125
+ };
124
126
  declare function getFonts(fonts: FontItem[], option?: FontOption): Promise<string>;
125
127
 
126
128
  declare const getStorefrontApi: (handle: string, provider?: 'BIGCOMMERCE' | 'SHOPIFY') => string;
127
129
 
128
- type ErrorBoundaryProps = {
129
- children?: React.ReactNode;
130
- FallbackComponent: React.ComponentType<{
131
- error?: Error;
132
- resetErrorBoundary: () => void;
133
- }>;
134
- onError?: (error: Error, info: React.ErrorInfo) => void;
135
- };
136
- type ErrorBoundaryState = {
137
- hasError?: boolean;
138
- error?: Error;
139
- };
140
- declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
141
- state: ErrorBoundaryState;
142
- static getDerivedStateFromError(error: Error): ErrorBoundaryState;
143
- reset: () => void;
144
- componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
145
- render(): string | number | boolean | react.ReactFragment | JSX.Element | null | undefined;
130
+ type ErrorBoundaryProps = {
131
+ children?: React.ReactNode;
132
+ FallbackComponent: React.ComponentType<{
133
+ error?: Error;
134
+ resetErrorBoundary: () => void;
135
+ }>;
136
+ onError?: (error: Error, info: React.ErrorInfo) => void;
137
+ };
138
+ type ErrorBoundaryState = {
139
+ hasError?: boolean;
140
+ error?: Error;
141
+ };
142
+ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
143
+ state: ErrorBoundaryState;
144
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
145
+ reset: () => void;
146
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
147
+ render(): string | number | boolean | react.ReactFragment | JSX.Element | null | undefined;
146
148
  }
147
149
 
148
- type Props$3 = {
149
- error?: Error;
150
- resetErrorBoundary: () => void;
151
- };
150
+ type Props$3 = {
151
+ error?: Error;
152
+ resetErrorBoundary: () => void;
153
+ };
152
154
  declare const ErrorFallback: ({ error, resetErrorBoundary }: Props$3) => JSX.Element;
153
155
 
154
156
  declare const Page404: () => JSX.Element;
155
157
 
156
158
  declare const Page500: () => JSX.Element;
157
159
 
158
- type Props$2 = {
159
- trackingId?: string | null;
160
- };
160
+ type Props$2 = {
161
+ trackingId?: string | null;
162
+ };
161
163
  declare const GoogleAnalytic: ({ trackingId }: Props$2) => JSX.Element | null;
162
164
 
163
- type Props$1 = {
164
- pixelId?: string | null;
165
- };
165
+ type Props$1 = {
166
+ pixelId?: string | null;
167
+ };
166
168
  declare const FacebookPixel: ({ pixelId }: Props$1) => JSX.Element | null;
167
169
 
168
- type Props = {
169
- pixelId?: string | null;
170
- };
170
+ type Props = {
171
+ pixelId?: string | null;
172
+ };
171
173
  declare const TikTokPixel: ({ pixelId }: Props) => JSX.Element | null;
172
174
 
173
175
  export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, CollectionPageProps, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PreviewPage, ProductDetailPage, ProductPageProps, StaticPage, StaticPageProps, StaticPagePropsV2, StaticPageV2, TikTokPixel, createFetcher, createShopifyFetcher, genCSS, getBuilderProps, getCollectionProps, getFonts, getHomePageProps, getHomePagePropsV2, getLayout, getPreviewProps, getProductProps, getStaticPageProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -21,13 +21,14 @@
21
21
  "dependencies": {
22
22
  "@sentry/nextjs": "7.21.1",
23
23
  "deepmerge": "4.2.2",
24
+ "html-react-parser": "^3.0.7",
24
25
  "next-seo": "^5.15.0"
25
26
  },
26
27
  "devDependencies": {
28
+ "@gem-sdk/core": "*",
27
29
  "@gem-sdk/plugin-cookie-bar": "*",
28
30
  "@gem-sdk/plugin-quick-view": "*",
29
- "@gem-sdk/plugin-sticky-add-to-cart": "*",
30
- "@gem-sdk/core": "*"
31
+ "@gem-sdk/plugin-sticky-add-to-cart": "*"
31
32
  },
32
33
  "peerDependencies": {
33
34
  "next": ">=13"