@xapps-platform/marketplace-ui 0.1.12 → 0.1.13
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 +16 -2
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4587,6 +4587,7 @@ function resolveMonetizationPackagePurchasePolicy(input) {
|
|
|
4587
4587
|
const packageKind = readLower(item.packageKind);
|
|
4588
4588
|
const productId = readLower(item.productId);
|
|
4589
4589
|
const currentSubscriptionProductId = readLower(currentSubscription.product_id);
|
|
4590
|
+
const includedCredits = readPackageCredits(item);
|
|
4590
4591
|
const ownershipCandidates = new Set(collectPackageOwnershipCandidates(item));
|
|
4591
4592
|
const ownedAdditiveUnlock = additiveEntitlements.some((entry) => {
|
|
4592
4593
|
const entitlement = entry && typeof entry === "object" && !Array.isArray(entry) ? entry : {};
|
|
@@ -4607,6 +4608,15 @@ function resolveMonetizationPackagePurchasePolicy(input) {
|
|
|
4607
4608
|
reason: "current_recurring_plan"
|
|
4608
4609
|
};
|
|
4609
4610
|
}
|
|
4611
|
+
const consumableOneTimeUnlock = (productFamily === "one_time_unlock" || packageKind === "one_time_unlock") && includedCredits > 0;
|
|
4612
|
+
if (consumableOneTimeUnlock) {
|
|
4613
|
+
return {
|
|
4614
|
+
canPurchase: true,
|
|
4615
|
+
status: "available",
|
|
4616
|
+
transitionKind: "buy_additive_unlock",
|
|
4617
|
+
reason: null
|
|
4618
|
+
};
|
|
4619
|
+
}
|
|
4610
4620
|
if ((productFamily === "one_time_unlock" || packageKind === "one_time_unlock") && ownedAdditiveUnlock) {
|
|
4611
4621
|
return {
|
|
4612
4622
|
canPurchase: false,
|
|
@@ -5560,7 +5570,8 @@ function XappDetailPageContent(props) {
|
|
|
5560
5570
|
return resolveMonetizationPackagePurchasePolicy({
|
|
5561
5571
|
item,
|
|
5562
5572
|
currentSubscription: monetizationSubscription,
|
|
5563
|
-
additiveEntitlements: activeAdditiveEntitlements
|
|
5573
|
+
additiveEntitlements: activeAdditiveEntitlements,
|
|
5574
|
+
accessProjection: monetizationAccessProjection
|
|
5564
5575
|
});
|
|
5565
5576
|
}
|
|
5566
5577
|
const currentAccessCard = hasMonetizationState ? /* @__PURE__ */ jsxs10("div", { className: "mx-sidebar-card", children: [
|
|
@@ -5620,6 +5631,9 @@ function XappDetailPageContent(props) {
|
|
|
5620
5631
|
/* @__PURE__ */ jsx14("div", { className: "mx-paywall-card-packages", children: selectedPaywallRenderModel.packages.map((item) => {
|
|
5621
5632
|
const normalizedPackageSlug = item.packageSlug.trim().toLowerCase();
|
|
5622
5633
|
const purchasePolicy = getPackagePurchasePolicy(item);
|
|
5634
|
+
const packageSignals = item.signals.filter(
|
|
5635
|
+
(signal) => !(purchasePolicy.transitionKind === "replace_recurring" && signal.toLowerCase().includes("trial"))
|
|
5636
|
+
);
|
|
5623
5637
|
const isCurrentPackage = purchasePolicy.status === "current_recurring_plan";
|
|
5624
5638
|
const isOwnedAdditive = purchasePolicy.status === "owned_additive_unlock";
|
|
5625
5639
|
const isAdditiveCompanion = purchasePolicy.transitionKind === "buy_additive_unlock" && subscriptionStatus === "active";
|
|
@@ -5643,7 +5657,7 @@ function XappDetailPageContent(props) {
|
|
|
5643
5657
|
isAdditiveCompanion ? /* @__PURE__ */ jsx14("span", { className: "mx-paywall-card-package-default", children: t("xapp.additive_unlock_label", void 0, "Add-on with membership") }) : null,
|
|
5644
5658
|
item.isDefault ? /* @__PURE__ */ jsx14("span", { className: "mx-paywall-card-package-default", children: t("xapp.default_label", void 0, "Default") }) : null
|
|
5645
5659
|
] }),
|
|
5646
|
-
|
|
5660
|
+
packageSignals.length > 0 ? /* @__PURE__ */ jsx14("div", { className: "mx-paywall-card-signals", children: packageSignals.map((signal) => /* @__PURE__ */ jsx14("span", { className: "mx-paywall-card-signal", children: signal }, signal)) }) : null,
|
|
5647
5661
|
isAdditiveCompanion ? /* @__PURE__ */ jsx14("div", { className: "mx-paywall-card-summary", children: t(
|
|
5648
5662
|
"xapp.additive_unlock_message",
|
|
5649
5663
|
void 0,
|