@replohq/canopy-sdk 0.1.1 → 0.1.3

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 (46) hide show
  1. package/_vendor/replo-utils/lib/json.mjs +2 -0
  2. package/_vendor/replo-utils/lib/misc.d.ts +2 -0
  3. package/_vendor/replo-utils/lib/misc.mjs +2 -1
  4. package/_vendor/schemas/designLibrary.d.ts +333 -0
  5. package/_vendor/schemas/designLibrary.mjs +108 -0
  6. package/_vendor/schemas/errors.mjs +2 -1
  7. package/_vendor/schemas/generated/consent.d.ts +24 -0
  8. package/_vendor/schemas/savedStyles.d.ts +140 -0
  9. package/_vendor/schemas/selectMode.mjs +3 -10
  10. package/analytics/analytics-provider.js +28 -29
  11. package/analytics/analytics-provider.js.map +2 -2
  12. package/analytics/get-analytics-sinks.d.ts +25 -0
  13. package/analytics/get-analytics-sinks.js +46 -0
  14. package/analytics/get-analytics-sinks.js.map +7 -0
  15. package/chunk-GV5FY7ZZ.mjs +89 -0
  16. package/chunk-VKO7P3ED.mjs +41 -0
  17. package/{chunk-INHK6MYI.mjs → chunk-XK2K3263.mjs} +48 -128
  18. package/consent/consent-store.d.ts +52 -0
  19. package/consent/consent-store.js +160 -0
  20. package/consent/consent-store.js.map +7 -0
  21. package/consent/cookie.d.ts +38 -0
  22. package/consent/cookie.js +83 -0
  23. package/consent/cookie.js.map +7 -0
  24. package/consent/replo-scripts.d.ts +9 -0
  25. package/consent/replo-scripts.js +91 -0
  26. package/consent/replo-scripts.js.map +7 -0
  27. package/consent/script-registration-store.d.ts +25 -0
  28. package/consent/script-registration-store.js +61 -0
  29. package/consent/script-registration-store.js.map +7 -0
  30. package/consent/script-snippets.d.ts +19 -0
  31. package/consent/script-snippets.js +125 -0
  32. package/consent/script-snippets.js.map +7 -0
  33. package/consent/server.d.ts +12 -0
  34. package/consent/server.js +29 -0
  35. package/consent/server.js.map +7 -0
  36. package/consent/window-api.d.ts +41 -0
  37. package/consent/window-api.js +73 -0
  38. package/consent/window-api.js.map +7 -0
  39. package/editor/design-library-preview/DesignLibraryPreview.d.ts +1 -0
  40. package/editor/design-library-preview/DesignLibraryPreview.js +31 -0
  41. package/editor/design-library-preview/DesignLibraryPreview.js.map +7 -0
  42. package/loaders/prefetch-loaders.d.ts +1 -1
  43. package/loaders/prefetch-loaders.js.map +1 -1
  44. package/package.json +1 -1
  45. package/providers/replo-provider.js +2 -0
  46. package/providers/replo-provider.js.map +2 -2
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { consentStore, isConsentAllowed } from "./consent-store";
3
+ const CONSENT_CHANGE_EVENT = "visitorConsentCollected";
4
+ function isAllowed(category) {
5
+ return isConsentAllowed({
6
+ state: consentStore.getSnapshot(),
7
+ requiredConsent: [category]
8
+ });
9
+ }
10
+ function currentVisitorConsent() {
11
+ const state = consentStore.getSnapshot();
12
+ const signal = (category) => {
13
+ if (state.decidedAt === null) {
14
+ return "";
15
+ }
16
+ return state.categories[category] ? "yes" : "no";
17
+ };
18
+ return {
19
+ analytics: signal("analytics"),
20
+ marketing: signal("marketing"),
21
+ preferences: signal("preferences"),
22
+ sale_of_data: signal("sale_of_data")
23
+ };
24
+ }
25
+ const api = {
26
+ currentVisitorConsent,
27
+ analyticsProcessingAllowed: () => isAllowed("analytics"),
28
+ marketingAllowed: () => isAllowed("marketing"),
29
+ preferencesProcessingAllowed: () => isAllowed("preferences"),
30
+ saleOfDataAllowed: () => isAllowed("sale_of_data"),
31
+ shouldShowBanner: () => {
32
+ const state = consentStore.getSnapshot();
33
+ return state.mode !== "off" && state.decidedAt === null;
34
+ },
35
+ setTrackingConsent: (consent, callback) => {
36
+ consentStore.updateCategories(consent);
37
+ callback?.();
38
+ }
39
+ };
40
+ function consentChangeDetail() {
41
+ return {
42
+ analyticsAllowed: isAllowed("analytics"),
43
+ marketingAllowed: isAllowed("marketing"),
44
+ preferencesAllowed: isAllowed("preferences"),
45
+ saleOfDataAllowed: isAllowed("sale_of_data")
46
+ };
47
+ }
48
+ let teardown = null;
49
+ function installConsentWindowApi() {
50
+ if (typeof window === "undefined") {
51
+ return () => {
52
+ };
53
+ }
54
+ if (teardown) {
55
+ return teardown;
56
+ }
57
+ window.Replo = { ...window.Replo, customerPrivacy: api };
58
+ const unsubscribe = consentStore.subscribe(() => {
59
+ document.dispatchEvent(
60
+ new CustomEvent(CONSENT_CHANGE_EVENT, { detail: consentChangeDetail() })
61
+ );
62
+ });
63
+ teardown = () => {
64
+ unsubscribe();
65
+ teardown = null;
66
+ };
67
+ return teardown;
68
+ }
69
+ export {
70
+ CONSENT_CHANGE_EVENT,
71
+ installConsentWindowApi
72
+ };
73
+ //# sourceMappingURL=window-api.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../consent/window-api.ts"],
4
+ "sourcesContent": ["\"use client\";\n\nimport type { ConsentCategory } from \"schemas/generated/consent\";\n\nimport { consentStore, isConsentAllowed } from \"./consent-store\";\n\n/**\n * Global, framework-agnostic consent API exposed on `window.Replo.customerPrivacy`,\n * mirroring Shopify's Customer Privacy API surface so on-page (third-party)\n * scripts can query consent and react to changes without importing canopy.\n *\n * It deliberately lives under our own `window.Replo` namespace rather than\n * `window.Shopify` to avoid colliding with Shopify's real API on Shopify-backed\n * sites.\n */\n\ntype ToggleableCategory = Exclude<ConsentCategory, \"necessary\">;\n\n/** Shopify-style tri-state: declared-allowed, declared-denied, or undeclared. */\ntype ConsentSignal = \"yes\" | \"no\" | \"\";\n\nexport interface ReploCustomerPrivacyApi {\n /** Per-category declaration, or \"\" when the visitor has not decided. */\n currentVisitorConsent(): Record<ToggleableCategory, ConsentSignal>;\n analyticsProcessingAllowed(): boolean;\n marketingAllowed(): boolean;\n preferencesProcessingAllowed(): boolean;\n saleOfDataAllowed(): boolean;\n /** Whether the consent banner should still be shown (mode on + undecided). */\n shouldShowBanner(): boolean;\n /** Update a subset of categories; runs the optional callback once persisted. */\n setTrackingConsent(\n consent: Partial<Record<ToggleableCategory, boolean>>,\n callback?: () => void,\n ): void;\n}\n\ndeclare global {\n interface Window {\n Replo?: { customerPrivacy?: ReploCustomerPrivacyApi };\n }\n}\n\n/** DOM event dispatched on `document` whenever consent changes. */\nexport const CONSENT_CHANGE_EVENT = \"visitorConsentCollected\";\n\nfunction isAllowed(category: ConsentCategory): boolean {\n return isConsentAllowed({\n state: consentStore.getSnapshot(),\n requiredConsent: [category],\n });\n}\n\nfunction currentVisitorConsent(): Record<ToggleableCategory, ConsentSignal> {\n const state = consentStore.getSnapshot();\n const signal = (category: ToggleableCategory): ConsentSignal => {\n if (state.decidedAt === null) {\n return \"\";\n }\n return state.categories[category] ? \"yes\" : \"no\";\n };\n return {\n analytics: signal(\"analytics\"),\n marketing: signal(\"marketing\"),\n preferences: signal(\"preferences\"),\n sale_of_data: signal(\"sale_of_data\"),\n };\n}\n\nconst api: ReploCustomerPrivacyApi = {\n currentVisitorConsent,\n analyticsProcessingAllowed: () => isAllowed(\"analytics\"),\n marketingAllowed: () => isAllowed(\"marketing\"),\n preferencesProcessingAllowed: () => isAllowed(\"preferences\"),\n saleOfDataAllowed: () => isAllowed(\"sale_of_data\"),\n shouldShowBanner: () => {\n const state = consentStore.getSnapshot();\n return state.mode !== \"off\" && state.decidedAt === null;\n },\n setTrackingConsent: (consent, callback) => {\n consentStore.updateCategories(consent);\n callback?.();\n },\n};\n\nfunction consentChangeDetail() {\n return {\n analyticsAllowed: isAllowed(\"analytics\"),\n marketingAllowed: isAllowed(\"marketing\"),\n preferencesAllowed: isAllowed(\"preferences\"),\n saleOfDataAllowed: isAllowed(\"sale_of_data\"),\n };\n}\n\nlet teardown: (() => void) | null = null;\n\n/**\n * Installs `window.Replo.customerPrivacy` and dispatches `visitorConsentCollected`\n * on `document` whenever consent changes. Idempotent; returns a teardown that\n * removes the change subscription. Safe to call on the server (no-op).\n */\nexport function installConsentWindowApi(): () => void {\n if (typeof window === \"undefined\") {\n return () => {\n // no-op on the server\n };\n }\n if (teardown) {\n return teardown;\n }\n window.Replo = { ...window.Replo, customerPrivacy: api };\n const unsubscribe = consentStore.subscribe(() => {\n document.dispatchEvent(\n new CustomEvent(CONSENT_CHANGE_EVENT, { detail: consentChangeDetail() }),\n );\n });\n teardown = () => {\n unsubscribe();\n teardown = null;\n };\n return teardown;\n}\n"],
5
+ "mappings": ";AAIA,SAAS,cAAc,wBAAwB;AAwCxC,MAAM,uBAAuB;AAEpC,SAAS,UAAU,UAAoC;AACrD,SAAO,iBAAiB;AAAA,IACtB,OAAO,aAAa,YAAY;AAAA,IAChC,iBAAiB,CAAC,QAAQ;AAAA,EAC5B,CAAC;AACH;AAEA,SAAS,wBAAmE;AAC1E,QAAM,QAAQ,aAAa,YAAY;AACvC,QAAM,SAAS,CAAC,aAAgD;AAC9D,QAAI,MAAM,cAAc,MAAM;AAC5B,aAAO;AAAA,IACT;AACA,WAAO,MAAM,WAAW,QAAQ,IAAI,QAAQ;AAAA,EAC9C;AACA,SAAO;AAAA,IACL,WAAW,OAAO,WAAW;AAAA,IAC7B,WAAW,OAAO,WAAW;AAAA,IAC7B,aAAa,OAAO,aAAa;AAAA,IACjC,cAAc,OAAO,cAAc;AAAA,EACrC;AACF;AAEA,MAAM,MAA+B;AAAA,EACnC;AAAA,EACA,4BAA4B,MAAM,UAAU,WAAW;AAAA,EACvD,kBAAkB,MAAM,UAAU,WAAW;AAAA,EAC7C,8BAA8B,MAAM,UAAU,aAAa;AAAA,EAC3D,mBAAmB,MAAM,UAAU,cAAc;AAAA,EACjD,kBAAkB,MAAM;AACtB,UAAM,QAAQ,aAAa,YAAY;AACvC,WAAO,MAAM,SAAS,SAAS,MAAM,cAAc;AAAA,EACrD;AAAA,EACA,oBAAoB,CAAC,SAAS,aAAa;AACzC,iBAAa,iBAAiB,OAAO;AACrC,eAAW;AAAA,EACb;AACF;AAEA,SAAS,sBAAsB;AAC7B,SAAO;AAAA,IACL,kBAAkB,UAAU,WAAW;AAAA,IACvC,kBAAkB,UAAU,WAAW;AAAA,IACvC,oBAAoB,UAAU,aAAa;AAAA,IAC3C,mBAAmB,UAAU,cAAc;AAAA,EAC7C;AACF;AAEA,IAAI,WAAgC;AAO7B,SAAS,0BAAsC;AACpD,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO,MAAM;AAAA,IAEb;AAAA,EACF;AACA,MAAI,UAAU;AACZ,WAAO;AAAA,EACT;AACA,SAAO,QAAQ,EAAE,GAAG,OAAO,OAAO,iBAAiB,IAAI;AACvD,QAAM,cAAc,aAAa,UAAU,MAAM;AAC/C,aAAS;AAAA,MACP,IAAI,YAAY,sBAAsB,EAAE,QAAQ,oBAAoB,EAAE,CAAC;AAAA,IACzE;AAAA,EACF,CAAC;AACD,aAAW,MAAM;AACf,gBAAY;AACZ,eAAW;AAAA,EACb;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export declare function DesignLibraryPreview(): null;
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { useEffect, useRef } from "react";
3
+ import { designLibraryPreviewMessageSchema } from "../../_vendor/schemas/designLibrary.mjs";
4
+ function DesignLibraryPreview() {
5
+ const ownedKeys = useRef(null);
6
+ useEffect(() => {
7
+ const handleMessage = (event) => {
8
+ const parsed = designLibraryPreviewMessageSchema.safeParse(event.data);
9
+ if (!parsed.success) return;
10
+ const next = parsed.data.cssVars;
11
+ const root = document.documentElement;
12
+ const owned = ownedKeys.current ?? /* @__PURE__ */ new Set();
13
+ for (const key of owned) {
14
+ if (!(key in next)) root.style.removeProperty(key);
15
+ }
16
+ ownedKeys.current = new Set(Object.keys(next));
17
+ for (const [key, value] of Object.entries(next)) {
18
+ root.style.setProperty(key, value);
19
+ }
20
+ };
21
+ window.addEventListener("message", handleMessage);
22
+ return () => {
23
+ window.removeEventListener("message", handleMessage);
24
+ };
25
+ }, []);
26
+ return null;
27
+ }
28
+ export {
29
+ DesignLibraryPreview
30
+ };
31
+ //# sourceMappingURL=DesignLibraryPreview.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../editor/design-library-preview/DesignLibraryPreview.tsx"],
4
+ "sourcesContent": ["\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\nimport { designLibraryPreviewMessageSchema } from \"schemas/designLibrary\";\n\nexport function DesignLibraryPreview() {\n // NOTE (Ben, 2026-06-03): The custom-property keys we set last time, so on the\n // next message we remove only the ones we own that the new override set drops.\n const ownedKeys = useRef<Set<string> | null>(null);\n\n // eslint-disable-next-line replo/no-use-effect -- Subscribes to window message events from the parent editor.\n useEffect(() => {\n const handleMessage = (event: MessageEvent) => {\n const parsed = designLibraryPreviewMessageSchema.safeParse(event.data);\n if (!parsed.success) return;\n const next = parsed.data.cssVars;\n const root = document.documentElement;\n const owned = ownedKeys.current ?? new Set();\n for (const key of owned) {\n if (!(key in next)) root.style.removeProperty(key);\n }\n ownedKeys.current = new Set(Object.keys(next));\n for (const [key, value] of Object.entries(next)) {\n root.style.setProperty(key, value);\n }\n };\n window.addEventListener(\"message\", handleMessage);\n return () => {\n window.removeEventListener(\"message\", handleMessage);\n };\n }, []);\n\n return null;\n}\n"],
5
+ "mappings": ";AAEA,SAAS,WAAW,cAAc;AAElC,SAAS,yCAAyC;AAE3C,SAAS,uBAAuB;AAGrC,QAAM,YAAY,OAA2B,IAAI;AAGjD,YAAU,MAAM;AACd,UAAM,gBAAgB,CAAC,UAAwB;AAC7C,YAAM,SAAS,kCAAkC,UAAU,MAAM,IAAI;AACrE,UAAI,CAAC,OAAO,QAAS;AACrB,YAAM,OAAO,OAAO,KAAK;AACzB,YAAM,OAAO,SAAS;AACtB,YAAM,QAAQ,UAAU,WAAW,oBAAI,IAAI;AAC3C,iBAAW,OAAO,OAAO;AACvB,YAAI,EAAE,OAAO,MAAO,MAAK,MAAM,eAAe,GAAG;AAAA,MACnD;AACA,gBAAU,UAAU,IAAI,IAAI,OAAO,KAAK,IAAI,CAAC;AAC7C,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAAG;AAC/C,aAAK,MAAM,YAAY,KAAK,KAAK;AAAA,MACnC;AAAA,IACF;AACA,WAAO,iBAAiB,WAAW,aAAa;AAChD,WAAO,MAAM;AACX,aAAO,oBAAoB,WAAW,aAAa;AAAA,IACrD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -14,7 +14,7 @@ type PrefetchLoaderConfig = {
14
14
  * convention used by all loader components.
15
15
  *
16
16
  * Usage:
17
- * import { DATA_LOADER_KEYS } from "../_vendor/schemas/loaderKeys";
17
+ * import { DATA_LOADER_KEYS } from "canopy-sdk/_vendor/schemas/loaderKeys";
18
18
  *
19
19
  * <PrefetchedLoaders
20
20
  * queries={[
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../loaders/prefetch-loaders.tsx"],
4
- "sourcesContent": ["import {\n dehydrate,\n HydrationBoundary,\n QueryClient,\n} from \"@tanstack/react-query\";\n\nimport { invokeLoaderServer } from \"./invoke-loader-server\";\n\ntype PrefetchLoaderConfig = {\n loaderKey: string;\n args: Record<string, unknown>;\n /** How long the server-side cache entry is fresh. Defaults to 60s. Use `false` for indefinite (tag-based invalidation only). */\n revalidateSeconds?: number | false;\n};\n\n/**\n * Server component that prefetches one or more loader queries and seeds the\n * React Query cache via HydrationBoundary. Client components that use\n * useSuspenseQuery with the same queryKey will get the data immediately\n * in the initial HTML \u2014 no loading state on first paint.\n *\n * The queryKey is derived internally as `[loaderKey, args]`, matching the\n * convention used by all loader components.\n *\n * Usage:\n * import { DATA_LOADER_KEYS } from \"schemas/loaderKeys\";\n *\n * <PrefetchedLoaders\n * queries={[\n * {\n * loaderKey: DATA_LOADER_KEYS.SHOPIFY_PRODUCT,\n * args: { productId: \"gid://shopify/Product/123\" },\n * },\n * ]}\n * >\n * <ProductPreview productId=\"gid://shopify/Product/123\" />\n * </PrefetchedLoaders>\n */\nexport async function PrefetchedLoaders({\n queries,\n children,\n}: React.PropsWithChildren<{\n queries: PrefetchLoaderConfig[];\n}>) {\n const queryClient = new QueryClient({\n defaultOptions: {\n queries: { staleTime: 60 * 1000 },\n },\n });\n\n await Promise.all(\n queries.map((query) => {\n return queryClient.prefetchQuery({\n queryKey: [query.loaderKey, query.args],\n queryFn: () => {\n return invokeLoaderServer({\n loaderKey: query.loaderKey,\n args: query.args,\n revalidateSeconds: query.revalidateSeconds,\n });\n },\n });\n }),\n );\n\n return (\n <HydrationBoundary\n state={dehydrate(queryClient, {\n shouldDehydrateQuery: (query) => {\n return (\n query.state.status === \"success\" || query.state.status === \"pending\"\n );\n },\n })}\n >\n {children}\n </HydrationBoundary>\n );\n}\n"],
4
+ "sourcesContent": ["import {\n dehydrate,\n HydrationBoundary,\n QueryClient,\n} from \"@tanstack/react-query\";\n\nimport { invokeLoaderServer } from \"./invoke-loader-server\";\n\ntype PrefetchLoaderConfig = {\n loaderKey: string;\n args: Record<string, unknown>;\n /** How long the server-side cache entry is fresh. Defaults to 60s. Use `false` for indefinite (tag-based invalidation only). */\n revalidateSeconds?: number | false;\n};\n\n/**\n * Server component that prefetches one or more loader queries and seeds the\n * React Query cache via HydrationBoundary. Client components that use\n * useSuspenseQuery with the same queryKey will get the data immediately\n * in the initial HTML \u2014 no loading state on first paint.\n *\n * The queryKey is derived internally as `[loaderKey, args]`, matching the\n * convention used by all loader components.\n *\n * Usage:\n * import { DATA_LOADER_KEYS } from \"canopy-sdk/_vendor/schemas/loaderKeys\";\n *\n * <PrefetchedLoaders\n * queries={[\n * {\n * loaderKey: DATA_LOADER_KEYS.SHOPIFY_PRODUCT,\n * args: { productId: \"gid://shopify/Product/123\" },\n * },\n * ]}\n * >\n * <ProductPreview productId=\"gid://shopify/Product/123\" />\n * </PrefetchedLoaders>\n */\nexport async function PrefetchedLoaders({\n queries,\n children,\n}: React.PropsWithChildren<{\n queries: PrefetchLoaderConfig[];\n}>) {\n const queryClient = new QueryClient({\n defaultOptions: {\n queries: { staleTime: 60 * 1000 },\n },\n });\n\n await Promise.all(\n queries.map((query) => {\n return queryClient.prefetchQuery({\n queryKey: [query.loaderKey, query.args],\n queryFn: () => {\n return invokeLoaderServer({\n loaderKey: query.loaderKey,\n args: query.args,\n revalidateSeconds: query.revalidateSeconds,\n });\n },\n });\n }),\n );\n\n return (\n <HydrationBoundary\n state={dehydrate(queryClient, {\n shouldDehydrateQuery: (query) => {\n return (\n query.state.status === \"success\" || query.state.status === \"pending\"\n );\n },\n })}\n >\n {children}\n </HydrationBoundary>\n );\n}\n"],
5
5
  "mappings": "AAkEI;AAlEJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,0BAA0B;AAgCnC,eAAsB,kBAAkB;AAAA,EACtC;AAAA,EACA;AACF,GAEI;AACF,QAAM,cAAc,IAAI,YAAY;AAAA,IAClC,gBAAgB;AAAA,MACd,SAAS,EAAE,WAAW,KAAK,IAAK;AAAA,IAClC;AAAA,EACF,CAAC;AAED,QAAM,QAAQ;AAAA,IACZ,QAAQ,IAAI,CAAC,UAAU;AACrB,aAAO,YAAY,cAAc;AAAA,QAC/B,UAAU,CAAC,MAAM,WAAW,MAAM,IAAI;AAAA,QACtC,SAAS,MAAM;AACb,iBAAO,mBAAmB;AAAA,YACxB,WAAW,MAAM;AAAA,YACjB,MAAM,MAAM;AAAA,YACZ,mBAAmB,MAAM;AAAA,UAC3B,CAAC;AAAA,QACH;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,UAAU,aAAa;AAAA,QAC5B,sBAAsB,CAAC,UAAU;AAC/B,iBACE,MAAM,MAAM,WAAW,aAAa,MAAM,MAAM,WAAW;AAAA,QAE/D;AAAA,MACF,CAAC;AAAA,MAEA;AAAA;AAAA,EACH;AAEJ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replohq/canopy-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Replo Canopy SDK — cart, analytics, data loaders, and editor runtime for agent-built Next.js sites.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { AnalyticsProvider } from "../analytics/analytics-provider";
3
3
  import { CartLoader } from "../cart/cart-loader";
4
4
  import { ClientErrorBoundary } from "../editor/ClientErrorBoundary";
5
+ import { DesignLibraryPreview } from "../editor/design-library-preview/DesignLibraryPreview";
5
6
  import LinkInterceptor from "../editor/LinkInterceptor";
6
7
  import PostHogRelay from "../editor/posthog-relay";
7
8
  import { EditorSelection } from "../editor/select-mode/EditorSelection";
@@ -11,6 +12,7 @@ function ReploProvider({ children }) {
11
12
  /* @__PURE__ */ jsx(LinkInterceptor, {}),
12
13
  /* @__PURE__ */ jsx(PostHogRelay, {}),
13
14
  /* @__PURE__ */ jsx(EditorSelection, {}),
15
+ /* @__PURE__ */ jsx(DesignLibraryPreview, {}),
14
16
  children
15
17
  ] }) }) }) });
16
18
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../providers/replo-provider.tsx"],
4
- "sourcesContent": ["import { AnalyticsProvider } from \"../analytics/analytics-provider\";\nimport { CartLoader } from \"../cart/cart-loader\";\nimport { ClientErrorBoundary } from \"../editor/ClientErrorBoundary\";\nimport LinkInterceptor from \"../editor/LinkInterceptor\";\nimport PostHogRelay from \"../editor/posthog-relay\";\nimport { EditorSelection } from \"../editor/select-mode/EditorSelection\";\nimport { QueryProvider } from \"./query-provider\";\n\nexport function ReploProvider({ children }: React.PropsWithChildren) {\n return (\n <QueryProvider>\n <AnalyticsProvider>\n <CartLoader>\n <ClientErrorBoundary>\n <LinkInterceptor />\n <PostHogRelay />\n <EditorSelection />\n {children}\n </ClientErrorBoundary>\n </CartLoader>\n </AnalyticsProvider>\n </QueryProvider>\n );\n}\n"],
5
- "mappings": "AAaU,SACE,KADF;AAbV,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AACpC,OAAO,qBAAqB;AAC5B,OAAO,kBAAkB;AACzB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAEvB,SAAS,cAAc,EAAE,SAAS,GAA4B;AACnE,SACE,oBAAC,iBACC,8BAAC,qBACC,8BAAC,cACC,+BAAC,uBACC;AAAA,wBAAC,mBAAgB;AAAA,IACjB,oBAAC,gBAAa;AAAA,IACd,oBAAC,mBAAgB;AAAA,IAChB;AAAA,KACH,GACF,GACF,GACF;AAEJ;",
4
+ "sourcesContent": ["import { AnalyticsProvider } from \"../analytics/analytics-provider\";\nimport { CartLoader } from \"../cart/cart-loader\";\nimport { ClientErrorBoundary } from \"../editor/ClientErrorBoundary\";\nimport { DesignLibraryPreview } from \"../editor/design-library-preview/DesignLibraryPreview\";\nimport LinkInterceptor from \"../editor/LinkInterceptor\";\nimport PostHogRelay from \"../editor/posthog-relay\";\nimport { EditorSelection } from \"../editor/select-mode/EditorSelection\";\nimport { QueryProvider } from \"./query-provider\";\n\nexport function ReploProvider({ children }: React.PropsWithChildren) {\n return (\n <QueryProvider>\n <AnalyticsProvider>\n <CartLoader>\n <ClientErrorBoundary>\n <LinkInterceptor />\n <PostHogRelay />\n <EditorSelection />\n <DesignLibraryPreview />\n {children}\n </ClientErrorBoundary>\n </CartLoader>\n </AnalyticsProvider>\n </QueryProvider>\n );\n}\n"],
5
+ "mappings": "AAcU,SACE,KADF;AAdV,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC,OAAO,qBAAqB;AAC5B,OAAO,kBAAkB;AACzB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAEvB,SAAS,cAAc,EAAE,SAAS,GAA4B;AACnE,SACE,oBAAC,iBACC,8BAAC,qBACC,8BAAC,cACC,+BAAC,uBACC;AAAA,wBAAC,mBAAgB;AAAA,IACjB,oBAAC,gBAAa;AAAA,IACd,oBAAC,mBAAgB;AAAA,IACjB,oBAAC,wBAAqB;AAAA,IACrB;AAAA,KACH,GACF,GACF,GACF;AAEJ;",
6
6
  "names": []
7
7
  }