@pack/react 2.2.3 → 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.
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/pack/pack-analytics.d.ts.map +1 -0
- package/dist/pack/pack-context.d.ts +30 -0
- package/dist/pack/pack-context.d.ts.map +1 -0
- package/dist/{preview/preview-content.js → pack/pack-context.js} +11 -8
- package/dist/pack/preview-toast.d.ts.map +1 -0
- package/dist/pack/render-sections.d.ts.map +1 -0
- package/dist/{preview → pack}/render-sections.js +5 -5
- package/dist/use-customizer-shell.d.ts.map +1 -1
- package/dist/use-customizer-shell.js +23 -31
- package/dist/use-overlay-script.js +2 -2
- package/dist/use-site-settings.d.ts.map +1 -1
- package/dist/use-site-settings.js +2 -11
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/preview/pack-analytics.d.ts.map +0 -1
- package/dist/preview/preview-content.d.ts +0 -34
- package/dist/preview/preview-content.d.ts.map +0 -1
- package/dist/preview/preview-toast.d.ts.map +0 -1
- package/dist/preview/render-sections.d.ts.map +0 -1
- /package/dist/{preview → pack}/pack-analytics.d.ts +0 -0
- /package/dist/{preview → pack}/pack-analytics.js +0 -0
- /package/dist/{preview → pack}/preview-toast.d.ts +0 -0
- /package/dist/{preview → pack}/preview-toast.js +0 -0
- /package/dist/{preview → pack}/render-sections.d.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { RenderSections, useSections } from "./
|
|
2
|
-
import {
|
|
1
|
+
import { RenderSections, useSections } from "./pack/render-sections";
|
|
2
|
+
import { PackProvider, PreviewProvider } from "./pack/pack-context";
|
|
3
|
+
import { usePackContext } from "./pack/pack-context";
|
|
3
4
|
import { useSiteSettings } from "./use-site-settings";
|
|
4
5
|
import { useOverlayScript } from "./use-overlay-script";
|
|
5
6
|
import { registerSection } from "./register-section";
|
|
6
7
|
import { registerStorefrontSettingsSchema } from "./register-storefront-settings-schema";
|
|
7
|
-
export { PreviewProvider, RenderSections, registerSection, registerStorefrontSettingsSchema, useOverlayScript,
|
|
8
|
+
export { PackProvider, PreviewProvider, RenderSections, registerSection, registerStorefrontSettingsSchema, useOverlayScript, usePackContext, useSections, useSiteSettings, };
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF,OAAO,EACL,YAAY,EACZ,eAAe,EACf,cAAc,EACd,eAAe,EACf,gCAAgC,EAChC,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,eAAe,GAChB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { RenderSections, useSections } from "./
|
|
2
|
-
import {
|
|
1
|
+
import { RenderSections, useSections } from "./pack/render-sections";
|
|
2
|
+
import { PackProvider, PreviewProvider } from "./pack/pack-context";
|
|
3
|
+
import { usePackContext } from "./pack/pack-context";
|
|
3
4
|
import { useSiteSettings } from "./use-site-settings";
|
|
4
5
|
import { useOverlayScript } from "./use-overlay-script";
|
|
5
6
|
import { registerSection } from "./register-section";
|
|
6
7
|
import { registerStorefrontSettingsSchema } from "./register-storefront-settings-schema";
|
|
7
|
-
export { PreviewProvider, RenderSections, registerSection, registerStorefrontSettingsSchema, useOverlayScript,
|
|
8
|
+
export { PackProvider, PreviewProvider, RenderSections, registerSection, registerStorefrontSettingsSchema, useOverlayScript, usePackContext, useSections, useSiteSettings, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-analytics.d.ts","sourceRoot":"","sources":["../../src/pack/pack-analytics.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAiDF,wBAAgB,YAAY,SA0B3B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
type PackContextValue = {
|
|
3
|
+
isPreview: boolean;
|
|
4
|
+
customizerMeta?: {
|
|
5
|
+
overlay?: {
|
|
6
|
+
src?: string;
|
|
7
|
+
version?: string;
|
|
8
|
+
};
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
siteSettings: any;
|
|
12
|
+
setSiteSettings: (siteSettings: any) => void;
|
|
13
|
+
liveContent: any;
|
|
14
|
+
setLiveContent: (content: any) => void;
|
|
15
|
+
contentEnvironment: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const PackContext: React.Context<PackContextValue>;
|
|
18
|
+
export declare const usePackContext: () => PackContextValue;
|
|
19
|
+
interface PackContentProps {
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
siteSettings: any;
|
|
22
|
+
isPreviewModeEnabled?: boolean;
|
|
23
|
+
customizerMeta?: PackContextValue["customizerMeta"];
|
|
24
|
+
contentEnvironment?: string;
|
|
25
|
+
liveContent?: any;
|
|
26
|
+
}
|
|
27
|
+
export declare function PackProvider({ children, isPreviewModeEnabled, siteSettings: previewStorefrontSettings, customizerMeta, contentEnvironment, }: PackContentProps): React.JSX.Element;
|
|
28
|
+
export declare const PreviewProvider: typeof PackProvider;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=pack-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-context.d.ts","sourceRoot":"","sources":["../../src/pack/pack-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAMf,KAAK,gBAAgB,GAAG;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE;QACf,OAAO,CAAC,EAAE;YACR,GAAG,CAAC,EAAE,MAAM,CAAC;YACb,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,YAAY,EAAE,GAAG,CAAC;IAClB,eAAe,EAAE,CAAC,YAAY,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7C,WAAW,EAAE,GAAG,CAAC;IACjB,cAAc,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,WAAW,iCAQtB,CAAC;AAEH,eAAO,MAAM,cAAc,wBAAgC,CAAC;AAE5D,UAAU,gBAAgB;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,GAAG,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,GAAG,CAAC;CACnB;AAUD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,oBAA4B,EAC5B,YAAY,EAAE,yBAAyB,EACvC,cAAc,EACd,kBAAuB,GACxB,EAAE,gBAAgB,qBAuClB;AAED,eAAO,MAAM,eAAe,qBAAe,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { createContext, useContext, useState, useMemo, } from "react";
|
|
1
|
+
import React, { createContext, useContext, useState, useMemo, useEffect, } from "react";
|
|
2
2
|
import { usePackTrack } from "./pack-analytics";
|
|
3
3
|
import { PreviewToast } from "./preview-toast";
|
|
4
|
-
import { useCustomizerShell } from "../use-customizer-shell";
|
|
5
4
|
import { useOverlayScript } from "../use-overlay-script";
|
|
6
|
-
|
|
5
|
+
import { useCustomizerShell } from "../use-customizer-shell";
|
|
6
|
+
export const PackContext = createContext({
|
|
7
7
|
isPreview: false,
|
|
8
8
|
setSiteSettings: () => { },
|
|
9
9
|
siteSettings: undefined,
|
|
@@ -12,7 +12,7 @@ export const PreviewContext = createContext({
|
|
|
12
12
|
setLiveContent: () => { },
|
|
13
13
|
contentEnvironment: "",
|
|
14
14
|
});
|
|
15
|
-
export const
|
|
15
|
+
export const usePackContext = () => useContext(PackContext);
|
|
16
16
|
const CustomizerShell = () => {
|
|
17
17
|
// Render inside the PreviewProvider so useCustomizerShell
|
|
18
18
|
// and useOverlayScript can access the context
|
|
@@ -20,7 +20,7 @@ const CustomizerShell = () => {
|
|
|
20
20
|
useOverlayScript();
|
|
21
21
|
return null;
|
|
22
22
|
};
|
|
23
|
-
export function
|
|
23
|
+
export function PackProvider({ children, isPreviewModeEnabled = false, siteSettings: previewStorefrontSettings, customizerMeta, contentEnvironment = "", }) {
|
|
24
24
|
const [liveContent, setLiveContent] = useState(null);
|
|
25
25
|
const [siteSettings, setSiteSettings] = useState(previewStorefrontSettings);
|
|
26
26
|
const value = useMemo(() => ({
|
|
@@ -30,18 +30,21 @@ export function PreviewProvider({ children, isPreviewModeEnabled = false, siteSe
|
|
|
30
30
|
setSiteSettings,
|
|
31
31
|
liveContent,
|
|
32
32
|
setLiveContent,
|
|
33
|
-
contentEnvironment,
|
|
33
|
+
contentEnvironment: contentEnvironment || customizerMeta?.environment || "",
|
|
34
34
|
}), [
|
|
35
35
|
isPreviewModeEnabled,
|
|
36
36
|
siteSettings,
|
|
37
37
|
customizerMeta,
|
|
38
|
-
setSiteSettings,
|
|
39
38
|
liveContent,
|
|
40
39
|
contentEnvironment,
|
|
41
40
|
]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
setSiteSettings(previewStorefrontSettings);
|
|
43
|
+
}, [previewStorefrontSettings]);
|
|
42
44
|
usePackTrack();
|
|
43
|
-
return (React.createElement(
|
|
45
|
+
return (React.createElement(PackContext.Provider, { value: value },
|
|
44
46
|
React.createElement(CustomizerShell, null),
|
|
45
47
|
children,
|
|
46
48
|
React.createElement(PreviewToast, { isPreviewModeEnabled: !!isPreviewModeEnabled })));
|
|
47
49
|
}
|
|
50
|
+
export const PreviewProvider = PackProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-toast.d.ts","sourceRoot":"","sources":["../../src/pack/preview-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,UAAU,iBAAiB;IACzB,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAsBD,eAAO,MAAM,YAAY,6BAA8B,iBAAiB,6BA+GvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-sections.d.ts","sourceRoot":"","sources":["../../src/pack/render-sections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAiDlD,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAoBD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,4BAKxD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,mBAAmB,uCAOrD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useMemo } from "react";
|
|
2
|
-
import {
|
|
1
|
+
import React, { useMemo, useEffect } from "react";
|
|
2
|
+
import { usePackContext } from "./pack-context";
|
|
3
3
|
import { sectionMap } from "../register-section";
|
|
4
4
|
import { generateSectionStylesheet } from "../lib/style-utils";
|
|
5
5
|
function renderSectionContent(sections) {
|
|
@@ -30,10 +30,10 @@ function Sections({ sections }) {
|
|
|
30
30
|
return React.createElement(React.Fragment, null, renderedSections);
|
|
31
31
|
}
|
|
32
32
|
function useRenderSections({ content }) {
|
|
33
|
-
const { isPreview, liveContent, setLiveContent } =
|
|
33
|
+
const { isPreview, liveContent, setLiveContent } = usePackContext();
|
|
34
34
|
// Update content in context for preview mode
|
|
35
|
-
|
|
36
|
-
if (isPreview) {
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (isPreview && setLiveContent) {
|
|
37
37
|
setLiveContent(content);
|
|
38
38
|
}
|
|
39
39
|
}, [content, isPreview, setLiveContent]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-customizer-shell.d.ts","sourceRoot":"","sources":["../src/use-customizer-shell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-customizer-shell.d.ts","sourceRoot":"","sources":["../src/use-customizer-shell.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,kBAAkB,YAmQ9B,CAAC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { useCallback,
|
|
2
|
-
import { VERSION } from "./version";
|
|
3
|
-
import { PreviewContext } from "./preview/preview-content";
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
2
|
import { sectionMap as sectionComponents } from "./register-section";
|
|
5
3
|
import { storefrontSettingsSchema } from "./register-storefront-settings-schema";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
4
|
+
import { usePackContext } from "./pack/pack-context";
|
|
5
|
+
const VERSION = "3.0.0";
|
|
8
6
|
export const useCustomizerShell = () => {
|
|
9
|
-
|
|
10
|
-
const { contentEnvironment: environment, isPreview, liveContent, setLiveContent, setSiteSettings, } = useContext(PreviewContext);
|
|
7
|
+
const { contentEnvironment: environment, isPreview, liveContent, setLiveContent, setSiteSettings, } = usePackContext();
|
|
11
8
|
const data = {
|
|
12
9
|
template: liveContent?.template?.type,
|
|
13
10
|
templateType: liveContent?.template?.type,
|
|
@@ -17,8 +14,7 @@ export const useCustomizerShell = () => {
|
|
|
17
14
|
};
|
|
18
15
|
const [hasInit, setHasInit] = useState(false);
|
|
19
16
|
const pendingMessagesRef = useRef(new Map());
|
|
20
|
-
const currentPathRef = useRef();
|
|
21
|
-
const canConnectToParent = useCanConnectCheck({ isPreview });
|
|
17
|
+
const currentPathRef = useRef(undefined);
|
|
22
18
|
const sendToParent = useCallback(async (type, data) => {
|
|
23
19
|
const messageId = crypto.randomUUID();
|
|
24
20
|
const message = {
|
|
@@ -51,7 +47,7 @@ export const useCustomizerShell = () => {
|
|
|
51
47
|
return messagePromise;
|
|
52
48
|
}, []);
|
|
53
49
|
useEffect(() => {
|
|
54
|
-
if (!isPreview ||
|
|
50
|
+
if (!isPreview || hasInit)
|
|
55
51
|
return;
|
|
56
52
|
sendToParent("INIT", {
|
|
57
53
|
storefrontMeta: [],
|
|
@@ -99,17 +95,22 @@ export const useCustomizerShell = () => {
|
|
|
99
95
|
}
|
|
100
96
|
break;
|
|
101
97
|
case "SET_PAGE_DATA":
|
|
102
|
-
setLiveContent
|
|
98
|
+
if (setLiveContent) {
|
|
99
|
+
setLiveContent(message.pack.data
|
|
100
|
+
?.content);
|
|
101
|
+
}
|
|
103
102
|
break;
|
|
104
103
|
case "SET_STOREFRONT_SETTINGS":
|
|
105
|
-
setSiteSettings
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
.
|
|
104
|
+
if (setSiteSettings) {
|
|
105
|
+
setSiteSettings({
|
|
106
|
+
data: {
|
|
107
|
+
siteSettings: {
|
|
108
|
+
settings: message.pack
|
|
109
|
+
.data?.settings,
|
|
110
|
+
},
|
|
110
111
|
},
|
|
111
|
-
}
|
|
112
|
-
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
113
114
|
break;
|
|
114
115
|
default:
|
|
115
116
|
break;
|
|
@@ -125,7 +126,7 @@ export const useCustomizerShell = () => {
|
|
|
125
126
|
});
|
|
126
127
|
pendingMessagesRef.current.clear();
|
|
127
128
|
};
|
|
128
|
-
}, [
|
|
129
|
+
}, [isPreview, sendToParent]);
|
|
129
130
|
const refreshSections = useCallback(() => {
|
|
130
131
|
if (!sectionComponents)
|
|
131
132
|
return [];
|
|
@@ -178,10 +179,11 @@ export const useCustomizerShell = () => {
|
|
|
178
179
|
const { template, templateType, handle, title, description } = data;
|
|
179
180
|
if (!hasInit ||
|
|
180
181
|
!currentPathRef.current ||
|
|
181
|
-
(!template && !templateType && !handle && !title && !description))
|
|
182
|
+
(!template && !templateType && !handle && !title && !description)) {
|
|
182
183
|
return;
|
|
184
|
+
}
|
|
183
185
|
sendToParent("SET_CURRENT_ROUTE", {
|
|
184
|
-
environment,
|
|
186
|
+
environment: environment || "",
|
|
185
187
|
currentPath: currentPathRef.current,
|
|
186
188
|
template,
|
|
187
189
|
templateType,
|
|
@@ -205,13 +207,3 @@ export const useCustomizerShell = () => {
|
|
|
205
207
|
hasInit,
|
|
206
208
|
]);
|
|
207
209
|
};
|
|
208
|
-
const useCanConnectCheck = ({ isPreview }) => {
|
|
209
|
-
const [canConnect, setCanConnect] = useState(false);
|
|
210
|
-
useEffect(() => {
|
|
211
|
-
const isIframe = window.self !== window.top;
|
|
212
|
-
if (!isIframe || !isPreview)
|
|
213
|
-
return;
|
|
214
|
-
setCanConnect(isIframe);
|
|
215
|
-
}, [isPreview]);
|
|
216
|
-
return canConnect;
|
|
217
|
-
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { usePackContext } from "./pack/pack-context";
|
|
3
3
|
export const useOverlayScript = () => {
|
|
4
|
-
const { isPreview, customizerMeta } =
|
|
4
|
+
const { isPreview, customizerMeta } = usePackContext();
|
|
5
5
|
const overlay = customizerMeta?.overlay || {};
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
if (isPreview &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-site-settings.d.ts","sourceRoot":"","sources":["../src/use-site-settings.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,QAAO,OAAO,MAAM,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"use-site-settings.d.ts","sourceRoot":"","sources":["../src/use-site-settings.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,QAAO,OAAO,MAAM,EAAE,GAAG,CAIpD,CAAC"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { usePackContext } from "./pack/pack-context";
|
|
2
2
|
export const useSiteSettings = () => {
|
|
3
|
-
const { siteSettings } =
|
|
4
|
-
let isIframe = false;
|
|
5
|
-
if (!(typeof document === "undefined")) {
|
|
6
|
-
isIframe = window.self !== window.top;
|
|
7
|
-
}
|
|
8
|
-
/*
|
|
9
|
-
* If the storefront both in preview mode and
|
|
10
|
-
* in an iFrame we want to show the live customizer
|
|
11
|
-
* preview data. Else, we show the normal site settings data
|
|
12
|
-
* */
|
|
3
|
+
const { siteSettings } = usePackContext();
|
|
13
4
|
return siteSettings?.data?.siteSettings;
|
|
14
5
|
};
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "
|
|
1
|
+
export const VERSION = "3.0.0";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pack-analytics.d.ts","sourceRoot":"","sources":["../../src/preview/pack-analytics.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAiDF,wBAAgB,YAAY,SA0B3B"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React, { type ReactNode } from "react";
|
|
2
|
-
type PreviewContextValue = {
|
|
3
|
-
isPreview: boolean;
|
|
4
|
-
customizerMeta?: {
|
|
5
|
-
overlay?: {
|
|
6
|
-
src?: string;
|
|
7
|
-
version?: string;
|
|
8
|
-
};
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
siteSettings: any;
|
|
12
|
-
setSiteSettings: (siteSettings: any) => void;
|
|
13
|
-
liveContent: any;
|
|
14
|
-
setLiveContent: (content: any) => void;
|
|
15
|
-
contentEnvironment: string;
|
|
16
|
-
};
|
|
17
|
-
export declare const PreviewContext: React.Context<PreviewContextValue>;
|
|
18
|
-
export declare const usePreviewContext: () => PreviewContextValue;
|
|
19
|
-
interface PreviewProviderProps {
|
|
20
|
-
children: ReactNode;
|
|
21
|
-
siteSettings: any;
|
|
22
|
-
isPreviewModeEnabled?: boolean;
|
|
23
|
-
contentEnvironment?: string;
|
|
24
|
-
customizerMeta?: {
|
|
25
|
-
overlay?: {
|
|
26
|
-
src?: string;
|
|
27
|
-
version?: string;
|
|
28
|
-
};
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export declare function PreviewProvider({ children, isPreviewModeEnabled, siteSettings: previewStorefrontSettings, customizerMeta, contentEnvironment, }: PreviewProviderProps): React.JSX.Element;
|
|
33
|
-
export {};
|
|
34
|
-
//# sourceMappingURL=preview-content.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview-content.d.ts","sourceRoot":"","sources":["../../src/preview/preview-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAOf,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE;QACf,OAAO,CAAC,EAAE;YACR,GAAG,CAAC,EAAE,MAAM,CAAC;YACb,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,YAAY,EAAE,GAAG,CAAC;IAClB,eAAe,EAAE,CAAC,YAAY,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7C,WAAW,EAAE,GAAG,CAAC;IACjB,cAAc,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,cAAc,oCAQzB,CAAC;AAEH,eAAO,MAAM,iBAAiB,2BAAmC,CAAC;AAElE,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,GAAG,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE;QACf,OAAO,CAAC,EAAE;YACR,GAAG,CAAC,EAAE,MAAM,CAAC;YACb,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAUD,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,oBAA4B,EAC5B,YAAY,EAAE,yBAAyB,EACvC,cAAc,EACd,kBAAuB,GACxB,EAAE,oBAAoB,qBAmCtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview-toast.d.ts","sourceRoot":"","sources":["../../src/preview/preview-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,UAAU,iBAAiB;IACzB,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAsBD,eAAO,MAAM,YAAY,6BAA8B,iBAAiB,6BA+GvE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-sections.d.ts","sourceRoot":"","sources":["../../src/preview/render-sections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAiDvC,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAoBD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,4BAKxD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,mBAAmB,uCAOrD"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|