@shoppexio/storefront 1.0.81 → 1.0.82

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.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  union,
23
23
  unknown,
24
24
  url
25
- } from "./chunk-QNHOMMRG.js";
25
+ } from "./chunk-ROQI7BO6.js";
26
26
 
27
27
  // ../sdk/src/core/errors.ts
28
28
  var CURRENCY_UNAVAILABLE_ERROR_CODE = "errors.storefront.currency_unavailable";
@@ -806,11 +806,13 @@ var CHECKOUT_METHOD_ORDER_KEYS = [
806
806
  "SHOPPEXPAY",
807
807
  "MONEYMOTION",
808
808
  "OVGC",
809
+ "MISTICPAY",
809
810
  "WHOP",
810
811
  "DODO",
811
812
  "MAVERICK",
812
813
  "CASHAPP",
813
814
  "VENMO",
815
+ "REWARBLE",
814
816
  "CRYPTO",
815
817
  "CUSTOMER_BALANCE",
816
818
  "EXTERNAL",
@@ -909,13 +911,15 @@ var FINANCE_GATEWAY_KEYS = [
909
911
  "SHOPPEXPAY",
910
912
  "MONEYMOTION",
911
913
  "OVGC",
914
+ "MISTICPAY",
912
915
  "WHOP",
913
916
  "DODO",
914
917
  "MAVERICK",
915
918
  "VENMO",
916
919
  "MOLLIE",
917
920
  "AUTHORIZENET",
918
- "NMI"
921
+ "NMI",
922
+ "REWARBLE"
919
923
  ];
920
924
  var FINANCE_GATEWAY_KEY_SET = new Set(
921
925
  FINANCE_GATEWAY_KEYS.map((gateway) => normalizeGatewayKey(gateway))
@@ -1259,6 +1263,11 @@ var checkoutStyleSlotValues = [
1259
1263
  "status.processing",
1260
1264
  "status.details",
1261
1265
  "status.wait_hint",
1266
+ // The seller's own wording on a paid order waiting for restock. Styleable but
1267
+ // NOT protected: the sentence that states the mechanics — delivery runs by
1268
+ // itself, nothing to resubmit — is `status.processing` above and stays
1269
+ // whatever a theme does with this one.
1270
+ "status.seller_stock_note",
1262
1271
  // The open order kept its gateway: the buyer is told which one, and why the
1263
1272
  // picker is gone.
1264
1273
  "status.method_locked",
@@ -2098,6 +2107,15 @@ var publicInvoiceWireProductSchema = external_exports.object({
2098
2107
  delivery_instruction_config: external_exports.unknown().optional(),
2099
2108
  delivery_instruction_label: external_exports.unknown().optional(),
2100
2109
  delivery_text: external_exports.string().nullable().optional(),
2110
+ // The seller's own wording for this product's delivery, published by
2111
+ // `InvoiceDataLoader` on every catalog-backed line. This schema strips what
2112
+ // it does not declare, so an undeclared field never reaches the buyer's page
2113
+ // however faithfully the API emits it — the four below are what the
2114
+ // completion page and the awaiting-stock card read.
2115
+ label_singular: external_exports.string().nullable().optional(),
2116
+ label_plural: external_exports.string().nullable().optional(),
2117
+ thank_you_message: external_exports.string().nullable().optional(),
2118
+ out_of_stock_message: external_exports.string().nullable().optional(),
2101
2119
  // Delivery wait as a bare COUNT. `0` and `null` both mean instant (the
2102
2120
  // digital-goods default); a positive value is a "within N <unit>" promise.
2103
2121
  delivery_time: external_exports.number().nullable().optional(),
@@ -2180,6 +2198,11 @@ var customerBalanceSchema = external_exports.object({
2180
2198
  available: external_exports.string(),
2181
2199
  currency: external_exports.string()
2182
2200
  });
2201
+ var voucherStoreCreditSchema = external_exports.object({
2202
+ gateway: external_exports.literal("REWARBLE"),
2203
+ amount: external_exports.string(),
2204
+ currency: external_exports.string()
2205
+ });
2183
2206
  var pricingBreakdownSchema = external_exports.object({
2184
2207
  affiliate_code: external_exports.string().nullable().optional(),
2185
2208
  already_paid: stringOrNumberSchema.nullable().optional(),
@@ -2436,6 +2459,7 @@ var publicInvoiceWireSchema = external_exports.object({
2436
2459
  custom_gateways: external_exports.array(customGatewaySchema).optional(),
2437
2460
  external_payment_adapters: external_exports.array(externalPaymentAdapterSchema).optional(),
2438
2461
  customer_balance: customerBalanceSchema.nullable().optional(),
2462
+ voucher_store_credit: voucherStoreCreditSchema.nullable().optional(),
2439
2463
  customer_email_masked: external_exports.string().nullable().optional(),
2440
2464
  dark_mode: external_exports.union([external_exports.literal(0), external_exports.literal(1)]).optional(),
2441
2465
  delivery: deliverySchema.optional(),
@@ -6032,10 +6056,38 @@ function resolveUtmParameters(storeSlug) {
6032
6056
  return Object.keys(stored).length > 0 ? stored : void 0;
6033
6057
  }
6034
6058
 
6059
+ // ../sdk/src/core/page-path.ts
6060
+ var MAX_PATH_LENGTH = 256;
6061
+ function resolveStorefrontPagePath() {
6062
+ if (typeof window === "undefined") return void 0;
6063
+ let pathname;
6064
+ try {
6065
+ const location = window.location;
6066
+ pathname = typeof location?.pathname === "string" && location.pathname ? location.pathname : new URL(String(location?.href ?? "")).pathname;
6067
+ } catch {
6068
+ return void 0;
6069
+ }
6070
+ if (!pathname || !pathname.startsWith("/")) return void 0;
6071
+ return pathname.slice(0, MAX_PATH_LENGTH);
6072
+ }
6073
+
6074
+ // ../sdk/src/core/page-tracker.ts
6075
+ var PLATFORM_PAGE_TRACKER_FLAG = "__shoppexPageTracker";
6076
+ function isPlatformPageTrackerActive() {
6077
+ if (typeof window === "undefined") return false;
6078
+ try {
6079
+ return Boolean(window[PLATFORM_PAGE_TRACKER_FLAG]);
6080
+ } catch {
6081
+ return false;
6082
+ }
6083
+ }
6084
+
6035
6085
  // ../sdk/src/modules/analytics.ts
6036
6086
  async function trackPageView(cartValue, itemCount) {
6037
6087
  if (!isInitialized()) return;
6038
6088
  if (typeof document === "undefined") return;
6089
+ const carriesCart = cartValue !== void 0 || itemCount !== void 0;
6090
+ if (isPlatformPageTrackerActive() && !carriesCart) return;
6039
6091
  const config = getConfig();
6040
6092
  const connectionId = getStorefrontConnectionId(config.storeSlug);
6041
6093
  try {
@@ -6050,6 +6102,7 @@ async function trackPageView(cartValue, itemCount) {
6050
6102
  cart_value: cartValue ?? void 0,
6051
6103
  item_count: itemCount ?? void 0,
6052
6104
  connection_id: connectionId ?? void 0,
6105
+ path: resolveStorefrontPagePath(),
6053
6106
  utm: resolveUtmParameters(config.storeSlug)
6054
6107
  })
6055
6108
  });
@@ -6095,6 +6148,9 @@ async function touchStorefrontPresence() {
6095
6148
  if (typeof document === "undefined") {
6096
6149
  return { success: false, message: "Document is not available" };
6097
6150
  }
6151
+ if (isPlatformPageTrackerActive()) {
6152
+ return { success: true, message: "Presence is reported by the storefront page tracker" };
6153
+ }
6098
6154
  const config = getConfig();
6099
6155
  const shopId = getShopId();
6100
6156
  const endpoint = shopId ? buildEndpoint("/v1/storefront/shops/id/:id/ping", { id: shopId }) : buildEndpoint("/v1/storefront/shops/:storeSlug/ping", {
@@ -6105,6 +6161,7 @@ async function touchStorefrontPresence() {
6105
6161
  {
6106
6162
  referer: document.referrer || void 0,
6107
6163
  connection_id: getStorefrontConnectionId(config.storeSlug) ?? void 0,
6164
+ path: resolveStorefrontPagePath(),
6108
6165
  utm: resolveUtmParameters(config.storeSlug)
6109
6166
  },
6110
6167
  {