@replohq/canopy-sdk 3.0.2 → 3.0.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 (132) hide show
  1. package/_vendor/replo-utils/lib/url.d.ts +12 -0
  2. package/_vendor/replo-utils/lib/url.mjs +1 -1
  3. package/_vendor/schemas/generated/consent.d.ts +19 -2
  4. package/_vendor/schemas/generated/selectMode.d.ts +1 -1
  5. package/_vendor/schemas/routing/rules.mjs +1 -1
  6. package/_vendor/schemas/selectMode.d.ts +10 -2
  7. package/_vendor/schemas/selectMode.mjs +1 -1
  8. package/_vendor/schemas/selectModeIframeRpc.d.ts +6 -0
  9. package/_vendor/schemas/selectModeIframeRpc.mjs +6 -1
  10. package/analytics/analytics-provider.js +1 -1
  11. package/analytics/get-analytics-sinks.js +1 -1
  12. package/analytics/hooks/use-product-viewed-analytics.js +1 -1
  13. package/analytics/replo-first-party-pixel.js +1 -1
  14. package/analytics/replo-pixel-script.js +1 -1
  15. package/analytics/sinks/ga4-sink.js +1 -1
  16. package/analytics/sinks/meta-sink.js +1 -1
  17. package/analytics/sinks/pinterest-sink.js +1 -1
  18. package/analytics/sinks/reddit-sink.js +1 -1
  19. package/analytics/sinks/replo-sink.js +1 -1
  20. package/analytics/sinks/snapchat-sink.js +1 -1
  21. package/analytics/sinks/tiktok-sink.js +1 -1
  22. package/analytics/sinks/window-sink.js +1 -1
  23. package/analytics/utils/analytics-utils.js +1 -1
  24. package/analytics/utils/navigation-tracker.js +1 -1
  25. package/analytics/utils/shopify-funnel-gate.js +1 -1
  26. package/cart/buy-now-action.js +1 -1
  27. package/cart/cart-actions.js +1 -1
  28. package/cart/cart-loader.js +1 -1
  29. package/cart/cart-provider.js +1 -1
  30. package/cart/cart-schema.js +1 -1
  31. package/cart/cart-types.js +1 -1
  32. package/cart/gateways/cart-gateway.js +1 -1
  33. package/cart/gateways/cookie-cart-gateway.js +1 -1
  34. package/cart/gateways/default-cart-gateway.js +1 -1
  35. package/cart/gateways/resolver-cart-gateway.js +1 -1
  36. package/cart/gateways/stripe-cart-gateway.js +1 -1
  37. package/cart/hooks/use-add-to-cart.js +1 -1
  38. package/cart/hooks/use-buy-now.js +1 -1
  39. package/cart/utils/cart-utils.js +1 -1
  40. package/cart/utils/cookie-cart-persistence.js +1 -1
  41. package/cart/utils/variant-to-cart-line.js +1 -1
  42. package/{chunk-7GWIUERW.mjs → chunk-2BNHFQZH.mjs} +32 -22
  43. package/{chunk-2GKD6VTQ.mjs → chunk-IQVZY6EV.mjs} +40 -1
  44. package/consent/consent-action.js +1 -1
  45. package/consent/consent-actions.js +1 -1
  46. package/consent/consent-store.js +1 -1
  47. package/consent/cookie.js +1 -1
  48. package/consent/replo-scripts.js +1 -1
  49. package/consent/script-registration-store.js +1 -1
  50. package/consent/script-snippets.js +1 -1
  51. package/consent/window-api.js +1 -1
  52. package/editor/ClientErrorBoundary.js +1 -1
  53. package/editor/DocumentReadyBeacon.js +1 -1
  54. package/editor/LinkInterceptor.js +1 -1
  55. package/editor/NextErrorReporter.js +1 -1
  56. package/editor/annotations/AnnotationLayerMount.js +1 -1
  57. package/editor/annotations/annotationController.js +1 -1
  58. package/editor/annotations/bridgeGate.js +1 -1
  59. package/editor/design-library-preview/DesignLibraryPreview.js +1 -1
  60. package/editor/posthog-relay.js +1 -1
  61. package/editor/select-mode/EditorSelection.js +1 -1
  62. package/editor/select-mode/annotationFrames.js +1 -1
  63. package/editor/select-mode/descriptor/elementDescriptor.js +1 -1
  64. package/editor/select-mode/descriptor/styleExtraction.js +1 -1
  65. package/editor/select-mode/displayModeStore.js +1 -1
  66. package/editor/select-mode/fast-refresh-relay.js +1 -1
  67. package/editor/select-mode/fiber.js +1 -1
  68. package/editor/select-mode/hooks/useCrosshairCursor.js +1 -1
  69. package/editor/select-mode/hooks/useEditModeStateMachine.js +1 -1
  70. package/editor/select-mode/hooks/useOptimisticOverrides.js +1 -1
  71. package/editor/select-mode/hooks/useParentMessaging.js +1 -1
  72. package/editor/select-mode/hooks/useSelectModeController.js +1 -1
  73. package/editor/select-mode/hooks/useSelectionHover.js +1 -1
  74. package/editor/select-mode/hooks/useSelectionInteractions.js +1 -1
  75. package/editor/select-mode/hooks/useSelectionScrollSync.js +1 -1
  76. package/editor/select-mode/hooks/useSiblingResolution.js +1 -1
  77. package/editor/select-mode/iframeRpcChannel.js +1 -1
  78. package/editor/select-mode/inlineTextMarks.js +1 -1
  79. package/editor/select-mode/interactions/selectionGeometry.js +1 -1
  80. package/editor/select-mode/selectModeSession.js +1 -1
  81. package/editor/select-mode/selectionFrame.js +1 -1
  82. package/editor/select-mode/symbolicate.js +1 -1
  83. package/editor/select-mode/tiptapInlineEditor.js +1 -1
  84. package/env.js +1 -1
  85. package/gateways/canopy-api.js +1 -1
  86. package/hooks/use-client-value.js +1 -1
  87. package/hooks/use-formatted-price.js +1 -1
  88. package/lib/canopy-error.js +1 -1
  89. package/lib/get-query-client.js +1 -1
  90. package/lib/integration-utils.js +1 -1
  91. package/lib/shopify-utils.js +1 -1
  92. package/lib/url-utils.js +1 -1
  93. package/loaders/collection-loader.js +1 -1
  94. package/loaders/collection-products-loader.js +1 -1
  95. package/loaders/contentful-entries-loader.js +1 -1
  96. package/loaders/contentful-entry-loader.js +1 -1
  97. package/loaders/invoke-loader-action.js +1 -1
  98. package/loaders/invoke-loader-server.js +1 -1
  99. package/loaders/invoke-loader.js +1 -1
  100. package/loaders/levanta-product-loader.js +1 -1
  101. package/loaders/loader-error-boundary.js +1 -1
  102. package/loaders/loader-keys.js +1 -1
  103. package/loaders/loader-schemas.js +1 -1
  104. package/loaders/metaobject-loader.js +1 -1
  105. package/loaders/metaobjects-loader.js +1 -1
  106. package/loaders/okendo-review-aggregate-loader.js +1 -1
  107. package/loaders/okendo-reviews-loader.js +1 -1
  108. package/loaders/prefetch-loaders.js +1 -1
  109. package/loaders/preview-placeholder.js +1 -1
  110. package/loaders/product-loader-args.js +1 -1
  111. package/loaders/product-loader.js +1 -1
  112. package/loaders/rebuy-recommendations-loader.js +1 -1
  113. package/loaders/reviews-io-review-aggregate-loader.js +1 -1
  114. package/loaders/reviews-io-reviews-loader.js +1 -1
  115. package/loaders/smile-earning-rules-loader.js +1 -1
  116. package/loaders/smile-rewards-loader.js +1 -1
  117. package/loaders/smile-vip-tiers-loader.js +1 -1
  118. package/loaders/statsig-experiment-loader.js +1 -1
  119. package/loaders/vendor-loader-keys.js +1 -1
  120. package/loaders/yotpo-review-aggregate-loader.js +1 -1
  121. package/loaders/yotpo-reviews-loader.js +1 -1
  122. package/money.js +1 -1
  123. package/next/config.js +1 -1
  124. package/next/image-loader.js +1 -1
  125. package/next/open-next.js +1 -1
  126. package/orders/order-status-schema.js +1 -1
  127. package/orders/order-status.js +1 -1
  128. package/package.json +1 -1
  129. package/providers/query-provider.js +1 -1
  130. package/providers/replo-provider.js +1 -1
  131. package/routing/evaluate.js +1 -1
  132. package/routing/rules.js +1 -1
@@ -55,3 +55,15 @@ export declare const isValidRoutePath: (path: string) => boolean;
55
55
  * relative value such as a site path.
56
56
  */
57
57
  export declare function parseUrl(value: string, base?: string): URL | null;
58
+ /**
59
+ * File extension from a URL's path, lowercased, defaulting to "jpg" for
60
+ * extensionless paths (product imagery is the primary consumer).
61
+ */
62
+ export declare function fileExtensionFromUrl(url: string): string;
63
+ /**
64
+ * Registration inputs are attacker-typeable, and the pipeline fetches them
65
+ * server-side — so only plain public https(+http) origins pass: no
66
+ * credentials, no ports, no IP literals, no localhost/RFC-6762 style names.
67
+ */
68
+ export declare function sanitizePublicHttpUrl(value: string | null): string | null;
69
+ export declare function safeHost(url: string): string | null;
@@ -1,4 +1,4 @@
1
- export { buildUrlSearchParams, isPreviewInternalHostname, isPreviewOrigin, isValidHttpUrl, isValidRoutePath, normalizeCustomDomain, normalizeUrlIncludingProtocolRelative, normalizeUrlScheme, parseUrl, truncateDomain } from '../../../chunk-2GKD6VTQ.mjs';
1
+ export { buildUrlSearchParams, fileExtensionFromUrl, isPreviewInternalHostname, isPreviewOrigin, isValidHttpUrl, isValidRoutePath, normalizeCustomDomain, normalizeUrlIncludingProtocolRelative, normalizeUrlScheme, parseUrl, safeHost, sanitizePublicHttpUrl, truncateDomain } from '../../../chunk-IQVZY6EV.mjs';
2
2
  import '../../../chunk-AKZNN7F2.mjs';
3
3
  import '../../../chunk-FNTGY7I5.mjs';
4
4
  import '../../../chunk-UJCSKKID.mjs';
@@ -1,4 +1,4 @@
1
- export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "snippet" | "custom";
1
+ export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "Cookiebot" | "snippet" | "custom" | "consentPlatform";
2
2
  export type ConsentCategory = "necessary" | "analytics" | "marketing" | "preferences" | "sale_of_data";
3
3
  export type ConsentMode = "off" | "simple" | "per-category";
4
4
  export type ScriptTagDescriptor = {
@@ -13,7 +13,11 @@ export type ScriptTagDescriptor = {
13
13
  module?: boolean;
14
14
  };
15
15
  export type ReploScriptEntry = {
16
- type: "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam";
16
+ type: "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge";
17
+ identifier: string;
18
+ requiredConsent?: ConsentCategory[];
19
+ } | {
20
+ type: "Cookiebot";
17
21
  identifier: string;
18
22
  requiredConsent?: ConsentCategory[];
19
23
  } | {
@@ -28,6 +32,19 @@ export type ReploScriptEntry = {
28
32
  requiredConsent: ConsentCategory[];
29
33
  src?: string;
30
34
  body?: string;
35
+ } | {
36
+ type: "consentPlatform";
37
+ id: string;
38
+ src: string;
39
+ attributes?: {
40
+ [x: string]: string;
41
+ };
42
+ blockingAttribute: {
43
+ name: string;
44
+ values: {
45
+ [x: string]: string;
46
+ };
47
+ };
31
48
  };
32
49
  export type ConsentAction = "accept" | "reject" | "update" | "withdraw";
33
50
  export type ConsentRecordRequest = {
@@ -1,6 +1,6 @@
1
1
  export type DisplayMode = "browse" | "selection";
2
2
  export type SelectModeSelectionType = "none" | "element" | "area" | "drag";
3
- export type SelectModeInlineTextStatus = "editable" | "dynamic" | null;
3
+ export type SelectModeInlineTextStatus = "editable" | "dynamic" | "translated" | null;
4
4
  export type SelectModeTextMetrics = {
5
5
  tightWidth: number;
6
6
  lineCount: number;
@@ -1,5 +1,5 @@
1
1
  import { getParamSegment, getRouteParams, hasRouteParam, matchSource } from '../../../chunk-VPEVERWE.mjs';
2
- import { parseUrl } from '../../../chunk-2GKD6VTQ.mjs';
2
+ import { parseUrl } from '../../../chunk-IQVZY6EV.mjs';
3
3
  import '../../../chunk-AKZNN7F2.mjs';
4
4
  import { ReploError } from '../../../chunk-ZZPQ3E7S.mjs';
5
5
  import '../../../chunk-H36NDYLG.mjs';
@@ -8,6 +8,7 @@ export declare const displayModeSchema: z.ZodEnum<{
8
8
  export declare const selectModeInlineTextStatusSchema: z.ZodNullable<z.ZodEnum<{
9
9
  editable: "editable";
10
10
  dynamic: "dynamic";
11
+ translated: "translated";
11
12
  }>>;
12
13
  export declare const selectModeTextMetricsSchema: z.ZodObject<{
13
14
  tightWidth: z.ZodNumber;
@@ -86,13 +87,15 @@ export type RectOffset = {
86
87
  left: number;
87
88
  top: number;
88
89
  };
89
- export declare function transformRect({ rect, offset, }: {
90
+ export declare function transformRect({ rect, offset, scale, }: {
90
91
  rect: SelectModeBoundingRect;
91
92
  offset: RectOffset;
93
+ scale?: number;
92
94
  }): SelectModeBoundingRect;
93
- export declare function transformPoint({ point, offset, }: {
95
+ export declare function transformPoint({ point, offset, scale, }: {
94
96
  point: SelectModeClickPosition;
95
97
  offset: RectOffset;
98
+ scale?: number;
96
99
  }): SelectModeClickPosition;
97
100
  export declare function getIframeOffset(iframe: HTMLIFrameElement | null): RectOffset;
98
101
  export declare const selectedElementSchema: z.ZodObject<{
@@ -256,6 +259,11 @@ export type SelectModeBoundingRect = z.infer<typeof selectModeBoundingRectSchema
256
259
  export type SelectModeClickPosition = z.infer<typeof selectModeClickPositionSchema>;
257
260
  export type SelectableData = z.infer<typeof selectableDataSchema>;
258
261
  export type SelectableDataPayload = z.infer<typeof selectableDataPayloadSchema>;
262
+ export declare function transformSelectedElement({ element, offset, scale, }: {
263
+ element: z.infer<typeof selectedElementSchema>;
264
+ offset: RectOffset;
265
+ scale?: number;
266
+ }): z.infer<typeof selectedElementSchema>;
259
267
  export declare function transformSelectableData({ data, offset, }: {
260
268
  data: SelectableData;
261
269
  offset: RectOffset;
@@ -1,4 +1,4 @@
1
- export { SELECT_MODE_SELECTABLE_ATTRIBUTE, SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE, displayModeSchema, getIframeOffset, readSelectablePayload, selectModeBoundingRectSchema, selectModeClickPositionSchema, selectModeDefinedStyleSchema, selectModeFiberChainEntrySchema, selectModeFormatCommandSchema, selectModeInlineTextStatusSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionRectSchema, selectModeSelectionSchema, selectModeSelectionTypeSchema, selectModeSourceLocationSchema, selectModeStyleAtRuleSchema, selectModeStyleVariantSchema, selectModeTextMetricsSchema, selectModeTiptapActiveMarksSchema, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData } from '../../chunk-7GWIUERW.mjs';
1
+ export { SELECT_MODE_SELECTABLE_ATTRIBUTE, SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE, displayModeSchema, getIframeOffset, readSelectablePayload, selectModeBoundingRectSchema, selectModeClickPositionSchema, selectModeDefinedStyleSchema, selectModeFiberChainEntrySchema, selectModeFormatCommandSchema, selectModeInlineTextStatusSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionRectSchema, selectModeSelectionSchema, selectModeSelectionTypeSchema, selectModeSourceLocationSchema, selectModeStyleAtRuleSchema, selectModeStyleVariantSchema, selectModeTextMetricsSchema, selectModeTiptapActiveMarksSchema, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData, transformSelectedElement } from '../../chunk-2BNHFQZH.mjs';
2
2
  import '../../chunk-VKO7P3ED.mjs';
3
3
  import '../../chunk-H36NDYLG.mjs';
4
4
  import '../../chunk-ILGEM42C.mjs';
@@ -131,6 +131,12 @@ export declare const websiteBuilderToCanopyMethodConfig: {
131
131
  }, z.core.$strip>;
132
132
  timeoutMs: number;
133
133
  };
134
+ navigateToRoute: {
135
+ inputSchema: z.ZodObject<{
136
+ pathname: z.ZodString;
137
+ }, z.core.$strip>;
138
+ outputSchema: z.ZodVoid;
139
+ };
134
140
  setDisplayMode: {
135
141
  inputSchema: z.ZodObject<{
136
142
  displayMode: z.ZodEnum<{
@@ -1,4 +1,4 @@
1
- import { selectModeFormatCommandSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionTypeSchema, displayModeSchema, selectModeTiptapActiveMarksSchema, selectModeBoundingRectSchema, selectableDataSchema, selectModeSelectionRectSchema, selectModeClickPositionSchema, selectedElementSchema } from '../../chunk-7GWIUERW.mjs';
1
+ import { selectModeFormatCommandSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionTypeSchema, displayModeSchema, selectModeTiptapActiveMarksSchema, selectModeBoundingRectSchema, selectableDataSchema, selectModeSelectionRectSchema, selectModeClickPositionSchema, selectedElementSchema } from '../../chunk-2BNHFQZH.mjs';
2
2
  import '../../chunk-VKO7P3ED.mjs';
3
3
  import '../../chunk-H36NDYLG.mjs';
4
4
  import '../../chunk-ILGEM42C.mjs';
@@ -21,6 +21,11 @@ var websiteBuilderToCanopyMethodConfig = {
21
21
  outputSchema: selectedElementSchema,
22
22
  timeoutMs: 1500
23
23
  },
24
+ // Client-side transition command; fire-and-forget because success is observed as the `replo:navigated` echo.
25
+ navigateToRoute: {
26
+ inputSchema: z.object({ pathname: z.string() }),
27
+ outputSchema: z.void()
28
+ },
24
29
  setDisplayMode: {
25
30
  inputSchema: z.object({ displayMode: displayModeSchema }),
26
31
  outputSchema: z.void()
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError } from "../lib/tombstone";
2
+ import { canopyTombstoneError } from "../lib/tombstone.js";
3
3
  function AnalyticsProvider(_props) {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "AnalyticsProvider",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../lib/tombstone";
1
+ import { canopyTombstoneError } from "../lib/tombstone.js";
2
2
  function getAnalyticsSinks(_args) {
3
3
  throw canopyTombstoneError({
4
4
  symbol: "getAnalyticsSinks",
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError } from "../../lib/tombstone";
2
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
3
3
  function useProductViewedAnalytics(_props) {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "useProductViewedAnalytics",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../lib/tombstone";
1
+ import { canopyTombstoneError } from "../lib/tombstone.js";
2
2
  async function ReploFirstPartyPixel() {
3
3
  throw canopyTombstoneError({
4
4
  symbol: "ReploFirstPartyPixel",
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError } from "../lib/tombstone";
2
+ import { canopyTombstoneError } from "../lib/tombstone.js";
3
3
  function ReploPixelScript(_args) {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "ReploPixelScript",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  class GA4Sink {
3
3
  // oxlint-disable-next-line typescript/no-explicit-any -- legacy any, may or may not be needed
4
4
  send;
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  class MetaSink {
3
3
  // oxlint-disable-next-line typescript/no-explicit-any -- legacy any, may or may not be needed
4
4
  track;
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  class PinterestSink {
3
3
  // oxlint-disable-next-line typescript/no-explicit-any -- legacy any, may or may not be needed
4
4
  track;
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  class RedditSink {
3
3
  // oxlint-disable-next-line typescript/no-explicit-any -- legacy any, may or may not be needed
4
4
  track;
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  class ReploSink {
3
3
  // oxlint-disable-next-line typescript/no-explicit-any -- legacy any, may or may not be needed
4
4
  forward;
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  class SnapchatSink {
3
3
  // oxlint-disable-next-line typescript/no-explicit-any -- legacy any, may or may not be needed
4
4
  track;
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  class TikTokSink {
3
3
  // oxlint-disable-next-line typescript/no-explicit-any -- legacy any, may or may not be needed
4
4
  track;
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  class WindowSink {
3
3
  constructor() {
4
4
  throw canopyTombstoneError({
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  function createEventQueue(_checkPixelReady, _sendEvent, _pixelName) {
3
3
  throw canopyTombstoneError({
4
4
  symbol: "createEventQueue",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  class NavigationTracker {
3
3
  lastUrl;
4
4
  onNavigate;
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  function gateShopifyOwnedFunnelEvents(_sink) {
3
3
  throw canopyTombstoneError({
4
4
  symbol: "gateShopifyOwnedFunnelEvents",
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { canopyTombstoneError } from "../lib/tombstone";
2
+ import { canopyTombstoneError } from "../lib/tombstone.js";
3
3
  async function buyNowAction(_input) {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "buyNowAction",
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { canopyTombstoneError } from "../lib/tombstone";
2
+ import { canopyTombstoneError } from "../lib/tombstone.js";
3
3
  async function getOrCreateCartAction() {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "getOrCreateCartAction",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../lib/tombstone";
1
+ import { canopyTombstoneError } from "../lib/tombstone.js";
2
2
  async function CartLoader(_args) {
3
3
  throw canopyTombstoneError({
4
4
  symbol: "CartLoader",
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError } from "../lib/tombstone";
2
+ import { canopyTombstoneError } from "../lib/tombstone.js";
3
3
  function CartProvider(_props) {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "CartProvider",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneObject } from "../lib/tombstone";
1
+ import { canopyTombstoneObject } from "../lib/tombstone.js";
2
2
  const cartSchema = canopyTombstoneObject({
3
3
  symbol: "cartSchema",
4
4
  subpath: "cart/cart-schema",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneObject } from "../lib/tombstone";
1
+ import { canopyTombstoneObject } from "../lib/tombstone.js";
2
2
  const REPLO_ATTRIBUTION_PROPERTY = canopyTombstoneObject({
3
3
  symbol: "REPLO_ATTRIBUTION_PROPERTY",
4
4
  subpath: "cart/cart-types"
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { canopyTombstoneError } from "../../lib/tombstone";
2
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
3
3
  async function getCartGateway() {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "getCartGateway",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  class CookieBasedCartGateway {
3
3
  constructor() {
4
4
  throw canopyTombstoneError({
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { canopyTombstoneError } from "../../lib/tombstone";
2
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
3
3
  async function createDefaultCartGateway() {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "createDefaultCartGateway",
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { canopyTombstoneError } from "../../lib/tombstone";
2
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
3
3
  async function createResolverCartGateway() {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "createResolverCartGateway",
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { canopyTombstoneError } from "../../lib/tombstone";
2
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
3
3
  async function createStripeCartGateway() {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "createStripeCartGateway",
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError } from "../../lib/tombstone";
2
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
3
3
  function findMerchandiseInQueryCache(_options) {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "findMerchandiseInQueryCache",
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError } from "../../lib/tombstone";
2
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
3
3
  function useBuyNow() {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "useBuyNow",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  function calculateLineItemsSubtotal(_lineItems) {
3
3
  throw canopyTombstoneError({
4
4
  symbol: "calculateLineItemsSubtotal",
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { canopyTombstoneError } from "../../lib/tombstone";
2
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
3
3
  async function saveCartToCookie(_cart, _cookieName) {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "saveCartToCookie",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../../lib/tombstone";
1
+ import { canopyTombstoneError } from "../../lib/tombstone.js";
2
2
  function getCartLineAttribute(_cartLine, _key) {
3
3
  throw canopyTombstoneError({
4
4
  symbol: "getCartLineAttribute",
@@ -10,7 +10,7 @@ function parseSchemaOrNull(value, schema) {
10
10
  var SELECT_MODE_SELECTABLE_ATTRIBUTE = "data-replo-selectable";
11
11
  var SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE = "data-replo-selectable-payload";
12
12
  var displayModeSchema = z.enum(["browse", "selection"]).describe("DisplayMode");
13
- var selectModeInlineTextStatusSchema = z.enum(["editable", "dynamic"]).nullable().describe("SelectModeInlineTextStatus");
13
+ var selectModeInlineTextStatusSchema = z.enum(["editable", "dynamic", "translated"]).nullable().describe("SelectModeInlineTextStatus");
14
14
  var selectModeTextMetricsSchema = z.object({
15
15
  tightWidth: z.number(),
16
16
  lineCount: z.number(),
@@ -63,26 +63,28 @@ var selectModeDefinedStyleSchema = z.object({
63
63
  }).describe("SelectModeDefinedStyle");
64
64
  function transformRect({
65
65
  rect,
66
- offset
66
+ offset,
67
+ scale = 1
67
68
  }) {
68
69
  return {
69
- x: rect.x + offset.left,
70
- y: rect.y + offset.top,
71
- left: rect.left + offset.left,
72
- right: rect.right + offset.left,
73
- top: rect.top + offset.top,
74
- bottom: rect.bottom + offset.top,
75
- width: rect.width,
76
- height: rect.height
70
+ x: rect.x * scale + offset.left,
71
+ y: rect.y * scale + offset.top,
72
+ left: rect.left * scale + offset.left,
73
+ right: rect.right * scale + offset.left,
74
+ top: rect.top * scale + offset.top,
75
+ bottom: rect.bottom * scale + offset.top,
76
+ width: rect.width * scale,
77
+ height: rect.height * scale
77
78
  };
78
79
  }
79
80
  function transformPoint({
80
81
  point,
81
- offset
82
+ offset,
83
+ scale = 1
82
84
  }) {
83
85
  return {
84
- x: point.x + offset.left,
85
- y: point.y + offset.top
86
+ x: point.x * scale + offset.left,
87
+ y: point.y * scale + offset.top
86
88
  };
87
89
  }
88
90
  function getIframeOffset(iframe) {
@@ -117,6 +119,21 @@ var selectablePlanDataSchema = z.object({
117
119
  var selectablePlanPayloadSchema = selectablePlanDataSchema.omit({ rect: true }).describe("SelectablePlanPayload");
118
120
  var selectableDataPayloadSchema = z.discriminatedUnion("kind", [selectablePlanPayloadSchema]).describe("SelectableDataPayload");
119
121
  var selectableDataSchema = z.discriminatedUnion("kind", [selectedElementSchema, selectablePlanDataSchema]).describe("SelectableData");
122
+ function transformSelectedElement({
123
+ element,
124
+ offset,
125
+ scale = 1
126
+ }) {
127
+ return {
128
+ ...element,
129
+ rect: transformRect({ rect: element.rect, offset, scale }),
130
+ clickPosition: transformPoint({
131
+ point: element.clickPosition,
132
+ offset,
133
+ scale
134
+ })
135
+ };
136
+ }
120
137
  function transformSelectableData({
121
138
  data,
122
139
  offset
@@ -125,14 +142,7 @@ function transformSelectableData({
125
142
  data,
126
143
  "kind"
127
144
  )({
128
- "react-element": (element) => ({
129
- ...element,
130
- rect: transformRect({ rect: element.rect, offset }),
131
- clickPosition: transformPoint({
132
- point: element.clickPosition,
133
- offset
134
- })
135
- }),
145
+ "react-element": (element) => transformSelectedElement({ element, offset }),
136
146
  plan: (plan) => ({
137
147
  ...plan,
138
148
  rect: transformRect({ rect: plan.rect, offset })
@@ -194,4 +204,4 @@ var selectModeSelectionSchema = z.discriminatedUnion("type", [
194
204
  })
195
205
  ]).describe("SelectModeSelection");
196
206
 
197
- export { SELECT_MODE_SELECTABLE_ATTRIBUTE, SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE, displayModeSchema, getIframeOffset, readSelectablePayload, selectModeBoundingRectSchema, selectModeClickPositionSchema, selectModeDefinedStyleSchema, selectModeFiberChainEntrySchema, selectModeFormatCommandSchema, selectModeInlineTextStatusSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionRectSchema, selectModeSelectionSchema, selectModeSelectionTypeSchema, selectModeSourceLocationSchema, selectModeStyleAtRuleSchema, selectModeStyleVariantSchema, selectModeTextMetricsSchema, selectModeTiptapActiveMarksSchema, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData };
207
+ export { SELECT_MODE_SELECTABLE_ATTRIBUTE, SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE, displayModeSchema, getIframeOffset, readSelectablePayload, selectModeBoundingRectSchema, selectModeClickPositionSchema, selectModeDefinedStyleSchema, selectModeFiberChainEntrySchema, selectModeFormatCommandSchema, selectModeInlineTextStatusSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionRectSchema, selectModeSelectionSchema, selectModeSelectionTypeSchema, selectModeSourceLocationSchema, selectModeStyleAtRuleSchema, selectModeStyleVariantSchema, selectModeTextMetricsSchema, selectModeTiptapActiveMarksSchema, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData, transformSelectedElement };
@@ -146,5 +146,44 @@ function parseUrl(value, base) {
146
146
  return null;
147
147
  }
148
148
  }
149
+ function fileExtensionFromUrl(url) {
150
+ const pathname = URL.canParse(url) ? new URL(url).pathname : url;
151
+ const lastSegment = pathname.split("/").pop() ?? "";
152
+ const extension = lastSegment.includes(".") ? lastSegment.split(".").pop() ?? "" : "";
153
+ return extension.toLowerCase() || "jpg";
154
+ }
155
+ function sanitizePublicHttpUrl(value) {
156
+ const trimmed = value?.trim();
157
+ if (!trimmed) {
158
+ return null;
159
+ }
160
+ const withScheme = /^[a-z][a-z0-9+.-]*:/iu.test(trimmed) ? trimmed : `https://${trimmed}`;
161
+ let url;
162
+ try {
163
+ url = new URL(withScheme);
164
+ } catch {
165
+ return null;
166
+ }
167
+ if (url.protocol !== "https:" && url.protocol !== "http:") {
168
+ return null;
169
+ }
170
+ if (url.username || url.password || url.port) {
171
+ return null;
172
+ }
173
+ const host = url.hostname.toLowerCase();
174
+ if (!host.includes(".") || host === "localhost" || host.endsWith(".local") || host.endsWith(".internal") || host.endsWith(".lan") || /^\d{1,3}(\.\d{1,3}){3}$/u.test(host) || host.startsWith("[")) {
175
+ return null;
176
+ }
177
+ url.protocol = "https:";
178
+ url.hash = "";
179
+ return url.toString();
180
+ }
181
+ function safeHost(url) {
182
+ try {
183
+ return new URL(url).hostname.toLowerCase();
184
+ } catch {
185
+ return null;
186
+ }
187
+ }
149
188
 
150
- export { buildUrlSearchParams, isPreviewInternalHostname, isPreviewOrigin, isValidHttpUrl, isValidRoutePath, normalizeCustomDomain, normalizeUrlIncludingProtocolRelative, normalizeUrlScheme, parseUrl, truncateDomain };
189
+ export { buildUrlSearchParams, fileExtensionFromUrl, isPreviewInternalHostname, isPreviewOrigin, isValidHttpUrl, isValidRoutePath, normalizeCustomDomain, normalizeUrlIncludingProtocolRelative, normalizeUrlScheme, parseUrl, safeHost, sanitizePublicHttpUrl, truncateDomain };
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../lib/tombstone";
1
+ import { canopyTombstoneError } from "../lib/tombstone.js";
2
2
  function deriveConsentAction(_args) {
3
3
  throw canopyTombstoneError({
4
4
  symbol: "deriveConsentAction",
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { canopyTombstoneError } from "../lib/tombstone";
2
+ import { canopyTombstoneError } from "../lib/tombstone.js";
3
3
  async function recordConsentAction(_decision) {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "recordConsentAction",
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError, canopyTombstoneObject } from "../lib/tombstone";
2
+ import { canopyTombstoneError, canopyTombstoneObject } from "../lib/tombstone.js";
3
3
  const consentStore = canopyTombstoneObject({
4
4
  symbol: "consentStore",
5
5
  subpath: "consent/consent-store"
package/consent/cookie.js CHANGED
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError, canopyTombstoneObject } from "../lib/tombstone";
1
+ import { canopyTombstoneError, canopyTombstoneObject } from "../lib/tombstone.js";
2
2
  const CONSENT_COOKIE_NAME = "replo_consent";
3
3
  const CONSENT_COOKIE_VERSION = 1;
4
4
  const CONSENT_COOKIE_MAX_AGE_SECONDS = 60 * 60 * 24 * 180;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError } from "../lib/tombstone";
2
+ import { canopyTombstoneError } from "../lib/tombstone.js";
3
3
  function InjectedScript(_props) {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "InjectedScript",
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError, canopyTombstoneObject } from "../lib/tombstone";
2
+ import { canopyTombstoneError, canopyTombstoneObject } from "../lib/tombstone.js";
3
3
  const scriptRegistrationStore = canopyTombstoneObject({
4
4
  symbol: "scriptRegistrationStore",
5
5
  subpath: "consent/script-registration-store",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../lib/tombstone";
1
+ import { canopyTombstoneError } from "../lib/tombstone.js";
2
2
  function buildScriptTags(_args) {
3
3
  throw canopyTombstoneError({
4
4
  symbol: "buildScriptTags",
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError } from "../lib/tombstone";
2
+ import { canopyTombstoneError } from "../lib/tombstone.js";
3
3
  const CONSENT_CHANGE_EVENT = "visitorConsentCollected";
4
4
  function installConsentWindowApi() {
5
5
  throw canopyTombstoneError({
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { canopyTombstoneError } from "../lib/tombstone";
2
+ import { canopyTombstoneError } from "../lib/tombstone.js";
3
3
  function ClientErrorBoundary(_args) {
4
4
  throw canopyTombstoneError({
5
5
  symbol: "ClientErrorBoundary",
@@ -1,4 +1,4 @@
1
- import { canopyTombstoneError } from "../lib/tombstone";
1
+ import { canopyTombstoneError } from "../lib/tombstone.js";
2
2
  function DocumentReadyBeacon() {
3
3
  throw canopyTombstoneError({
4
4
  symbol: "DocumentReadyBeacon",