@moonbase.sh/react 0.0.0-next-20261111174148 → 0.0.0-next-20261111181003
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/README.md +5 -2
- package/dist/index.cjs +19 -10
- package/dist/index.d.cts +16 -3
- package/dist/index.d.ts +16 -3
- package/dist/index.js +21 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -286,8 +286,11 @@ Where the store connected Meta or Google Analytics in Moonbase, and the visitor'
|
|
|
286
286
|
carry the visitor's Meta and Google Analytics browser IDs (read from the `_fbp`, `_fbc`, `_ga` and `_ga_<stream>`
|
|
287
287
|
cookies as each request is made) and the page's origin and path. `storefront.adSignals()` returns what they send, and
|
|
288
288
|
`attributionConsentStatus` in the storefront's state says where the visitor's consent stands (`'granted'`, `'refused'`
|
|
289
|
-
or `'unknown'`).
|
|
290
|
-
|
|
289
|
+
or `'unknown'`). A browser that sends Global Privacy Control counts as refusing for each platform the store has not set
|
|
290
|
+
to ignore it in Moonbase: no browser IDs go for that platform, and `attributionConsentStatusByPlatform` in the state
|
|
291
|
+
says where consent stands for `meta` and `googleAnalytics` each. `attributionConsentStatus` is `'refused'` for it unless
|
|
292
|
+
the store set every platform it connected to ignore it. When your banner reports a refusal for a signed-in customer, or the browser sends Global Privacy Control, the
|
|
293
|
+
storefront tells Moonbase, once per tab.
|
|
291
294
|
|
|
292
295
|
A cookie banner of your own gets what it needs from `useAttributionConsent()`. `required` says whether the store's
|
|
293
296
|
setting asks this visitor at all: `true` or `false` once the browser has loaded the catalog for them, and `undefined`
|
package/dist/index.cjs
CHANGED
|
@@ -66,7 +66,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
66
66
|
var import_storefront_api13 = require("@moonbase.sh/storefront-api");
|
|
67
67
|
|
|
68
68
|
// package.json
|
|
69
|
-
var version = "0.0.0-next-
|
|
69
|
+
var version = "0.0.0-next-20261111181003";
|
|
70
70
|
|
|
71
71
|
// src/storefront.ts
|
|
72
72
|
var import_storefront_api5 = require("@moonbase.sh/storefront-api");
|
|
@@ -670,6 +670,7 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
670
670
|
attributionConsentAnswer: null,
|
|
671
671
|
attributionConsentRequired: void 0,
|
|
672
672
|
attributionConsentStatus: "unknown",
|
|
673
|
+
attributionConsentStatusByPlatform: { meta: "unknown", googleAnalytics: "unknown" },
|
|
673
674
|
catalog: initialCatalog,
|
|
674
675
|
catalogLoaded: !!options.initialCatalog,
|
|
675
676
|
closed: false,
|
|
@@ -756,7 +757,7 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
756
757
|
this.state = {
|
|
757
758
|
attributionConsentAnswer: answer,
|
|
758
759
|
attributionConsentRequired: void 0,
|
|
759
|
-
|
|
760
|
+
...this.consentStatus(catalog.tracking),
|
|
760
761
|
catalog,
|
|
761
762
|
catalogLoaded: !!cachedCatalog || this.serverState.catalogLoaded,
|
|
762
763
|
closed: false,
|
|
@@ -896,7 +897,7 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
896
897
|
const before = this.attributionConsent;
|
|
897
898
|
this.attributionConsentSetting = (0, import_storefront_api5.copyConsent)(granted);
|
|
898
899
|
this.attributionConsentChanged(before);
|
|
899
|
-
this.setState(
|
|
900
|
+
this.setState(this.consentStatus(this.state.catalog.tracking));
|
|
900
901
|
void this.reportAdConsentRefusal();
|
|
901
902
|
if ((0, import_storefront_api5.grantsClickIds)(this.attributionConsentSetting) === false && typeof window !== "undefined") {
|
|
902
903
|
if (this.hasUtmOrReferrer)
|
|
@@ -968,7 +969,7 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
968
969
|
const consentedBefore = this.attributionConsent;
|
|
969
970
|
this.storeAllowsAttribution = latest.cookieConsentRequired === false;
|
|
970
971
|
this.attributionConsentChanged(consentedBefore);
|
|
971
|
-
this.setState(
|
|
972
|
+
this.setState(this.consentStatus(this.state.catalog.tracking));
|
|
972
973
|
if (typeof window !== "undefined") {
|
|
973
974
|
this.setState({ attributionConsentRequired: latest.cookieConsentRequired !== false });
|
|
974
975
|
window.dispatchEvent(new CustomEvent("moonbase-storefront-updated", { detail: { storefront: latest } }));
|
|
@@ -1133,15 +1134,16 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
1133
1134
|
}
|
|
1134
1135
|
/**
|
|
1135
1136
|
* The visitor's Meta and Google Analytics browser IDs, and this page, for a store that connected either
|
|
1136
|
-
* in Moonbase, while the visitor's consent lets click IDs go.
|
|
1137
|
+
* in Moonbase, while the visitor's consent lets click IDs go. A browser that sends Global Privacy Control
|
|
1138
|
+
* gives only those of a platform the store set to ignore it. Read as each request is made, since the
|
|
1137
1139
|
* vendors' tags write their cookies after the storefront starts.
|
|
1138
1140
|
*/
|
|
1139
1141
|
browserIdentifiers(landing) {
|
|
1140
1142
|
var _a, _b, _c, _d, _e;
|
|
1141
1143
|
const tracking = this.state.catalog.tracking;
|
|
1142
|
-
const meta = ((_b = (_a = tracking == null ? void 0 : tracking.meta) == null ? void 0 : _a.pixels.length) != null ? _b : 0) > 0;
|
|
1143
|
-
const googleAnalytics = (_d = (_c = tracking == null ? void 0 : tracking.googleAnalytics) == null ? void 0 : _c.streams.map((stream) => stream.id)) != null ? _d : [];
|
|
1144
|
-
if (!meta && googleAnalytics.length === 0 || !this.attributionConsent || typeof window === "undefined"
|
|
1144
|
+
const meta = ((_b = (_a = tracking == null ? void 0 : tracking.meta) == null ? void 0 : _a.pixels.length) != null ? _b : 0) > 0 && !(0, import_storefront_api5.refusedByGlobalPrivacyControl)(tracking == null ? void 0 : tracking.meta);
|
|
1145
|
+
const googleAnalytics = (0, import_storefront_api5.refusedByGlobalPrivacyControl)(tracking == null ? void 0 : tracking.googleAnalytics) ? [] : (_d = (_c = tracking == null ? void 0 : tracking.googleAnalytics) == null ? void 0 : _c.streams.map((stream) => stream.id)) != null ? _d : [];
|
|
1146
|
+
if (!meta && googleAnalytics.length === 0 || !this.attributionConsent || typeof window === "undefined")
|
|
1145
1147
|
return {};
|
|
1146
1148
|
return {
|
|
1147
1149
|
...(0, import_storefront_api5.readBrowserIdentifiers)({
|
|
@@ -1153,8 +1155,15 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
1153
1155
|
pageUrl: `${window.location.origin}${window.location.pathname}`
|
|
1154
1156
|
};
|
|
1155
1157
|
}
|
|
1156
|
-
consentStatus() {
|
|
1157
|
-
|
|
1158
|
+
consentStatus(tracking) {
|
|
1159
|
+
const answered = (0, import_storefront_api5.grantsClickIds)(this.attributionConsentSetting) === false ? "refused" : this.attributionConsent ? "granted" : "unknown";
|
|
1160
|
+
return {
|
|
1161
|
+
attributionConsentStatus: (0, import_storefront_api5.globalPrivacyControlRefuses)(tracking) ? "refused" : answered,
|
|
1162
|
+
attributionConsentStatusByPlatform: {
|
|
1163
|
+
meta: (0, import_storefront_api5.refusedByGlobalPrivacyControl)(tracking == null ? void 0 : tracking.meta) ? "refused" : answered,
|
|
1164
|
+
googleAnalytics: (0, import_storefront_api5.refusedByGlobalPrivacyControl)(tracking == null ? void 0 : tracking.googleAnalytics) ? "refused" : answered
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1158
1167
|
}
|
|
1159
1168
|
/**
|
|
1160
1169
|
* Tells Moonbase when the site reports that a signed-in customer refuses ad tracking, which renewals
|
package/dist/index.d.cts
CHANGED
|
@@ -134,6 +134,11 @@ interface StorefrontCart {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
type AttributionConsentStatus = 'granted' | 'refused' | 'unknown';
|
|
137
|
+
/** Where the visitor's consent stands for each ad platform a store can connect in Moonbase. */
|
|
138
|
+
interface AttributionConsentStatusByPlatform {
|
|
139
|
+
meta: AttributionConsentStatus;
|
|
140
|
+
googleAnalytics: AttributionConsentStatus;
|
|
141
|
+
}
|
|
137
142
|
/** Everything a storefront knows that a page draws from. Replaced, never changed in place, on every update. */
|
|
138
143
|
interface StorefrontState {
|
|
139
144
|
/**
|
|
@@ -153,9 +158,16 @@ interface StorefrontState {
|
|
|
153
158
|
/**
|
|
154
159
|
* Where the visitor's consent to marketing cookies stands: `'refused'` once the site reports a refusal,
|
|
155
160
|
* `'granted'` once the site reports consent or the store's own setting lets them go unasked, and
|
|
156
|
-
* `'unknown'` until either says.
|
|
161
|
+
* `'unknown'` until either says. A browser that sends Global Privacy Control counts as refusing, unless the
|
|
162
|
+
* store set every ad platform it connected in Moonbase to ignore it.
|
|
157
163
|
*/
|
|
158
164
|
attributionConsentStatus: AttributionConsentStatus;
|
|
165
|
+
/**
|
|
166
|
+
* Where the visitor's consent stands for each ad platform a store can connect in Moonbase: as
|
|
167
|
+
* `attributionConsentStatus`, except that Global Privacy Control refuses only a platform the store has
|
|
168
|
+
* it honored for (`honorGlobalPrivacyControl` on `catalog.tracking.meta` and `.googleAnalytics`).
|
|
169
|
+
*/
|
|
170
|
+
attributionConsentStatusByPlatform: AttributionConsentStatusByPlatform;
|
|
159
171
|
/**
|
|
160
172
|
* The store's catalog for this visitor: products, bundles, offers and promotions, priced in their
|
|
161
173
|
* currency, with `owned` worked out for whoever is signed in. Starts from the copy this browser
|
|
@@ -422,7 +434,8 @@ declare class MoonbaseStorefront {
|
|
|
422
434
|
private consentedUtm;
|
|
423
435
|
/**
|
|
424
436
|
* The visitor's Meta and Google Analytics browser IDs, and this page, for a store that connected either
|
|
425
|
-
* in Moonbase, while the visitor's consent lets click IDs go.
|
|
437
|
+
* in Moonbase, while the visitor's consent lets click IDs go. A browser that sends Global Privacy Control
|
|
438
|
+
* gives only those of a platform the store set to ignore it. Read as each request is made, since the
|
|
426
439
|
* vendors' tags write their cookies after the storefront starts.
|
|
427
440
|
*/
|
|
428
441
|
private browserIdentifiers;
|
|
@@ -894,4 +907,4 @@ declare function createStorefront(endpoint: string, options?: StorefrontOptions)
|
|
|
894
907
|
*/
|
|
895
908
|
declare function getStorefront(endpoint: string, options?: StorefrontOptions): MoonbaseStorefront;
|
|
896
909
|
|
|
897
|
-
export { type AccountData, type ActivationRequestOptions, type ActivationRequestState, type AddToCartOptions, type AttributionConsent, type AttributionConsentStatus, type Auth, type Cart, type CartCheckoutOptions, type CartItem, type CartOfferState, type CheckoutItem, type CheckoutOptions, type CheckoutRedirectOptions, type CheckoutResult, type Communications, type Groups, type LockedOffer, MoonbaseStorefront, type Orders, type PagedAccountData, type ProductReviews, type StorefrontAuth, type StorefrontCart, type StorefrontEvents, type StorefrontInventory, type StorefrontOptions, StorefrontProvider, type StorefrontProviderProps, type StorefrontState, type VariationPrice, type VendorState, type Vouchers, createStorefront, getStorefront, useActivationRequest, useAttributionConsent, useAuth, useBundle, useBundles, useCart, useCartActions, useCartOffer, useCatalog, useCheckout, useCommunicationPreferences, useCurrency, useEligibleOffers, useGroups, useInventory, useLockedOffers, useOffer, useOffers, useOrderHistory, useOrders, useOwnedProduct, useOwnedProducts, usePrice, useProduct, useProductActivations, useProductLicenses, useProducts, usePromotions, useReviews, useStorefront, useStorefrontEvent, useStorefrontState, useSubscription, useSubscriptions, useVendor, useVoucher };
|
|
910
|
+
export { type AccountData, type ActivationRequestOptions, type ActivationRequestState, type AddToCartOptions, type AttributionConsent, type AttributionConsentStatus, type AttributionConsentStatusByPlatform, type Auth, type Cart, type CartCheckoutOptions, type CartItem, type CartOfferState, type CheckoutItem, type CheckoutOptions, type CheckoutRedirectOptions, type CheckoutResult, type Communications, type Groups, type LockedOffer, MoonbaseStorefront, type Orders, type PagedAccountData, type ProductReviews, type StorefrontAuth, type StorefrontCart, type StorefrontEvents, type StorefrontInventory, type StorefrontOptions, StorefrontProvider, type StorefrontProviderProps, type StorefrontState, type VariationPrice, type VendorState, type Vouchers, createStorefront, getStorefront, useActivationRequest, useAttributionConsent, useAuth, useBundle, useBundles, useCart, useCartActions, useCartOffer, useCatalog, useCheckout, useCommunicationPreferences, useCurrency, useEligibleOffers, useGroups, useInventory, useLockedOffers, useOffer, useOffers, useOrderHistory, useOrders, useOwnedProduct, useOwnedProducts, usePrice, useProduct, useProductActivations, useProductLicenses, useProducts, usePromotions, useReviews, useStorefront, useStorefrontEvent, useStorefrontState, useSubscription, useSubscriptions, useVendor, useVoucher };
|
package/dist/index.d.ts
CHANGED
|
@@ -134,6 +134,11 @@ interface StorefrontCart {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
type AttributionConsentStatus = 'granted' | 'refused' | 'unknown';
|
|
137
|
+
/** Where the visitor's consent stands for each ad platform a store can connect in Moonbase. */
|
|
138
|
+
interface AttributionConsentStatusByPlatform {
|
|
139
|
+
meta: AttributionConsentStatus;
|
|
140
|
+
googleAnalytics: AttributionConsentStatus;
|
|
141
|
+
}
|
|
137
142
|
/** Everything a storefront knows that a page draws from. Replaced, never changed in place, on every update. */
|
|
138
143
|
interface StorefrontState {
|
|
139
144
|
/**
|
|
@@ -153,9 +158,16 @@ interface StorefrontState {
|
|
|
153
158
|
/**
|
|
154
159
|
* Where the visitor's consent to marketing cookies stands: `'refused'` once the site reports a refusal,
|
|
155
160
|
* `'granted'` once the site reports consent or the store's own setting lets them go unasked, and
|
|
156
|
-
* `'unknown'` until either says.
|
|
161
|
+
* `'unknown'` until either says. A browser that sends Global Privacy Control counts as refusing, unless the
|
|
162
|
+
* store set every ad platform it connected in Moonbase to ignore it.
|
|
157
163
|
*/
|
|
158
164
|
attributionConsentStatus: AttributionConsentStatus;
|
|
165
|
+
/**
|
|
166
|
+
* Where the visitor's consent stands for each ad platform a store can connect in Moonbase: as
|
|
167
|
+
* `attributionConsentStatus`, except that Global Privacy Control refuses only a platform the store has
|
|
168
|
+
* it honored for (`honorGlobalPrivacyControl` on `catalog.tracking.meta` and `.googleAnalytics`).
|
|
169
|
+
*/
|
|
170
|
+
attributionConsentStatusByPlatform: AttributionConsentStatusByPlatform;
|
|
159
171
|
/**
|
|
160
172
|
* The store's catalog for this visitor: products, bundles, offers and promotions, priced in their
|
|
161
173
|
* currency, with `owned` worked out for whoever is signed in. Starts from the copy this browser
|
|
@@ -422,7 +434,8 @@ declare class MoonbaseStorefront {
|
|
|
422
434
|
private consentedUtm;
|
|
423
435
|
/**
|
|
424
436
|
* The visitor's Meta and Google Analytics browser IDs, and this page, for a store that connected either
|
|
425
|
-
* in Moonbase, while the visitor's consent lets click IDs go.
|
|
437
|
+
* in Moonbase, while the visitor's consent lets click IDs go. A browser that sends Global Privacy Control
|
|
438
|
+
* gives only those of a platform the store set to ignore it. Read as each request is made, since the
|
|
426
439
|
* vendors' tags write their cookies after the storefront starts.
|
|
427
440
|
*/
|
|
428
441
|
private browserIdentifiers;
|
|
@@ -894,4 +907,4 @@ declare function createStorefront(endpoint: string, options?: StorefrontOptions)
|
|
|
894
907
|
*/
|
|
895
908
|
declare function getStorefront(endpoint: string, options?: StorefrontOptions): MoonbaseStorefront;
|
|
896
909
|
|
|
897
|
-
export { type AccountData, type ActivationRequestOptions, type ActivationRequestState, type AddToCartOptions, type AttributionConsent, type AttributionConsentStatus, type Auth, type Cart, type CartCheckoutOptions, type CartItem, type CartOfferState, type CheckoutItem, type CheckoutOptions, type CheckoutRedirectOptions, type CheckoutResult, type Communications, type Groups, type LockedOffer, MoonbaseStorefront, type Orders, type PagedAccountData, type ProductReviews, type StorefrontAuth, type StorefrontCart, type StorefrontEvents, type StorefrontInventory, type StorefrontOptions, StorefrontProvider, type StorefrontProviderProps, type StorefrontState, type VariationPrice, type VendorState, type Vouchers, createStorefront, getStorefront, useActivationRequest, useAttributionConsent, useAuth, useBundle, useBundles, useCart, useCartActions, useCartOffer, useCatalog, useCheckout, useCommunicationPreferences, useCurrency, useEligibleOffers, useGroups, useInventory, useLockedOffers, useOffer, useOffers, useOrderHistory, useOrders, useOwnedProduct, useOwnedProducts, usePrice, useProduct, useProductActivations, useProductLicenses, useProducts, usePromotions, useReviews, useStorefront, useStorefrontEvent, useStorefrontState, useSubscription, useSubscriptions, useVendor, useVoucher };
|
|
910
|
+
export { type AccountData, type ActivationRequestOptions, type ActivationRequestState, type AddToCartOptions, type AttributionConsent, type AttributionConsentStatus, type AttributionConsentStatusByPlatform, type Auth, type Cart, type CartCheckoutOptions, type CartItem, type CartOfferState, type CheckoutItem, type CheckoutOptions, type CheckoutRedirectOptions, type CheckoutResult, type Communications, type Groups, type LockedOffer, MoonbaseStorefront, type Orders, type PagedAccountData, type ProductReviews, type StorefrontAuth, type StorefrontCart, type StorefrontEvents, type StorefrontInventory, type StorefrontOptions, StorefrontProvider, type StorefrontProviderProps, type StorefrontState, type VariationPrice, type VendorState, type Vouchers, createStorefront, getStorefront, useActivationRequest, useAttributionConsent, useAuth, useBundle, useBundles, useCart, useCartActions, useCartOffer, useCatalog, useCheckout, useCommunicationPreferences, useCurrency, useEligibleOffers, useGroups, useInventory, useLockedOffers, useOffer, useOffers, useOrderHistory, useOrders, useOwnedProduct, useOwnedProducts, usePrice, useProduct, useProductActivations, useProductLicenses, useProducts, usePromotions, useReviews, useStorefront, useStorefrontEvent, useStorefrontState, useSubscription, useSubscriptions, useVendor, useVoucher };
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { MoonbaseClient } from "@moonbase.sh/storefront-api";
|
|
3
3
|
|
|
4
4
|
// package.json
|
|
5
|
-
var version = "0.0.0-next-
|
|
5
|
+
var version = "0.0.0-next-20261111181003";
|
|
6
6
|
|
|
7
7
|
// src/storefront.ts
|
|
8
8
|
import {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
closeCheckout as closeCheckout2,
|
|
11
11
|
copyConsent,
|
|
12
12
|
forgetPurchase as forgetPurchase3,
|
|
13
|
+
globalPrivacyControlRefuses,
|
|
13
14
|
grantsClickIds,
|
|
14
15
|
hasCampaignData,
|
|
15
16
|
isSameArrival,
|
|
@@ -26,6 +27,7 @@ import {
|
|
|
26
27
|
readBrowserIdentifiers,
|
|
27
28
|
readCookies,
|
|
28
29
|
readStorage,
|
|
30
|
+
refusedByGlobalPrivacyControl,
|
|
29
31
|
refusesAny,
|
|
30
32
|
removeStorage,
|
|
31
33
|
resolveDisplayCurrency as resolveDisplayCurrency3,
|
|
@@ -673,6 +675,7 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
673
675
|
attributionConsentAnswer: null,
|
|
674
676
|
attributionConsentRequired: void 0,
|
|
675
677
|
attributionConsentStatus: "unknown",
|
|
678
|
+
attributionConsentStatusByPlatform: { meta: "unknown", googleAnalytics: "unknown" },
|
|
676
679
|
catalog: initialCatalog,
|
|
677
680
|
catalogLoaded: !!options.initialCatalog,
|
|
678
681
|
closed: false,
|
|
@@ -759,7 +762,7 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
759
762
|
this.state = {
|
|
760
763
|
attributionConsentAnswer: answer,
|
|
761
764
|
attributionConsentRequired: void 0,
|
|
762
|
-
|
|
765
|
+
...this.consentStatus(catalog.tracking),
|
|
763
766
|
catalog,
|
|
764
767
|
catalogLoaded: !!cachedCatalog || this.serverState.catalogLoaded,
|
|
765
768
|
closed: false,
|
|
@@ -899,7 +902,7 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
899
902
|
const before = this.attributionConsent;
|
|
900
903
|
this.attributionConsentSetting = copyConsent(granted);
|
|
901
904
|
this.attributionConsentChanged(before);
|
|
902
|
-
this.setState(
|
|
905
|
+
this.setState(this.consentStatus(this.state.catalog.tracking));
|
|
903
906
|
void this.reportAdConsentRefusal();
|
|
904
907
|
if (grantsClickIds(this.attributionConsentSetting) === false && typeof window !== "undefined") {
|
|
905
908
|
if (this.hasUtmOrReferrer)
|
|
@@ -971,7 +974,7 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
971
974
|
const consentedBefore = this.attributionConsent;
|
|
972
975
|
this.storeAllowsAttribution = latest.cookieConsentRequired === false;
|
|
973
976
|
this.attributionConsentChanged(consentedBefore);
|
|
974
|
-
this.setState(
|
|
977
|
+
this.setState(this.consentStatus(this.state.catalog.tracking));
|
|
975
978
|
if (typeof window !== "undefined") {
|
|
976
979
|
this.setState({ attributionConsentRequired: latest.cookieConsentRequired !== false });
|
|
977
980
|
window.dispatchEvent(new CustomEvent("moonbase-storefront-updated", { detail: { storefront: latest } }));
|
|
@@ -1136,15 +1139,16 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
1136
1139
|
}
|
|
1137
1140
|
/**
|
|
1138
1141
|
* The visitor's Meta and Google Analytics browser IDs, and this page, for a store that connected either
|
|
1139
|
-
* in Moonbase, while the visitor's consent lets click IDs go.
|
|
1142
|
+
* in Moonbase, while the visitor's consent lets click IDs go. A browser that sends Global Privacy Control
|
|
1143
|
+
* gives only those of a platform the store set to ignore it. Read as each request is made, since the
|
|
1140
1144
|
* vendors' tags write their cookies after the storefront starts.
|
|
1141
1145
|
*/
|
|
1142
1146
|
browserIdentifiers(landing) {
|
|
1143
1147
|
var _a, _b, _c, _d, _e;
|
|
1144
1148
|
const tracking = this.state.catalog.tracking;
|
|
1145
|
-
const meta = ((_b = (_a = tracking == null ? void 0 : tracking.meta) == null ? void 0 : _a.pixels.length) != null ? _b : 0) > 0;
|
|
1146
|
-
const googleAnalytics = (_d = (_c = tracking == null ? void 0 : tracking.googleAnalytics) == null ? void 0 : _c.streams.map((stream) => stream.id)) != null ? _d : [];
|
|
1147
|
-
if (!meta && googleAnalytics.length === 0 || !this.attributionConsent || typeof window === "undefined"
|
|
1149
|
+
const meta = ((_b = (_a = tracking == null ? void 0 : tracking.meta) == null ? void 0 : _a.pixels.length) != null ? _b : 0) > 0 && !refusedByGlobalPrivacyControl(tracking == null ? void 0 : tracking.meta);
|
|
1150
|
+
const googleAnalytics = refusedByGlobalPrivacyControl(tracking == null ? void 0 : tracking.googleAnalytics) ? [] : (_d = (_c = tracking == null ? void 0 : tracking.googleAnalytics) == null ? void 0 : _c.streams.map((stream) => stream.id)) != null ? _d : [];
|
|
1151
|
+
if (!meta && googleAnalytics.length === 0 || !this.attributionConsent || typeof window === "undefined")
|
|
1148
1152
|
return {};
|
|
1149
1153
|
return {
|
|
1150
1154
|
...readBrowserIdentifiers({
|
|
@@ -1156,8 +1160,15 @@ var _MoonbaseStorefront = class _MoonbaseStorefront {
|
|
|
1156
1160
|
pageUrl: `${window.location.origin}${window.location.pathname}`
|
|
1157
1161
|
};
|
|
1158
1162
|
}
|
|
1159
|
-
consentStatus() {
|
|
1160
|
-
|
|
1163
|
+
consentStatus(tracking) {
|
|
1164
|
+
const answered = grantsClickIds(this.attributionConsentSetting) === false ? "refused" : this.attributionConsent ? "granted" : "unknown";
|
|
1165
|
+
return {
|
|
1166
|
+
attributionConsentStatus: globalPrivacyControlRefuses(tracking) ? "refused" : answered,
|
|
1167
|
+
attributionConsentStatusByPlatform: {
|
|
1168
|
+
meta: refusedByGlobalPrivacyControl(tracking == null ? void 0 : tracking.meta) ? "refused" : answered,
|
|
1169
|
+
googleAnalytics: refusedByGlobalPrivacyControl(tracking == null ? void 0 : tracking.googleAnalytics) ? "refused" : answered
|
|
1170
|
+
}
|
|
1171
|
+
};
|
|
1161
1172
|
}
|
|
1162
1173
|
/**
|
|
1163
1174
|
* Tells Moonbase when the site reports that a signed-in customer refuses ad tracking, which renewals
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-next-
|
|
4
|
+
"version": "0.0.0-next-20261111181003",
|
|
5
5
|
"description": "Package to let you build React storefronts with Moonbase.sh as payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"react": ">=18"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@moonbase.sh/storefront-api": "0.0.0-next-
|
|
19
|
+
"@moonbase.sh/storefront-api": "0.0.0-next-20261111181003"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "^22.5.4",
|