@burdenoff/website-sdk 2026.728.2 → 2026.728.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.
- package/dist/components/pricing.d.mts +29 -1
- package/dist/components/pricing.d.ts +29 -1
- package/dist/components/pricing.js +15 -13
- package/dist/components/pricing.js.map +1 -1
- package/dist/components/pricing.mjs +15 -14
- package/dist/components/pricing.mjs.map +1 -1
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2484,6 +2484,7 @@ var GET_PLANS_QUERY = `
|
|
|
2484
2484
|
features {
|
|
2485
2485
|
id
|
|
2486
2486
|
quotaId
|
|
2487
|
+
context
|
|
2487
2488
|
quota {
|
|
2488
2489
|
id
|
|
2489
2490
|
name
|
|
@@ -2596,27 +2597,27 @@ function humanizeQuotaName(name) {
|
|
|
2596
2597
|
const resource = parts.length >= 3 ? parts[parts.length - 2] : parts[parts.length - 1];
|
|
2597
2598
|
return resource.replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
2598
2599
|
}
|
|
2599
|
-
function
|
|
2600
|
+
function transformFeatureToLabel(feature) {
|
|
2601
|
+
const quota = feature.quota;
|
|
2602
|
+
if (!quota) return "";
|
|
2600
2603
|
const { name, limits } = quota;
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
const
|
|
2605
|
-
const
|
|
2606
|
-
const
|
|
2607
|
-
|
|
2608
|
-
const description = limitsObj.description;
|
|
2609
|
-
if (typeof description === "string" && description) {
|
|
2604
|
+
const featureContext = feature.context && typeof feature.context === "object" ? feature.context : null;
|
|
2605
|
+
const limitsObj = limits && typeof limits === "object" ? limits : null;
|
|
2606
|
+
const value = typeof featureContext?.quantity === "number" ? featureContext.quantity : typeof limitsObj?.value === "number" ? limitsObj.value : void 0;
|
|
2607
|
+
const unit = typeof featureContext?.unit === "string" && featureContext.unit || typeof limitsObj?.unit === "string" && limitsObj.unit || void 0;
|
|
2608
|
+
const description = typeof featureContext?.description === "string" && featureContext.description || typeof limitsObj?.description === "string" && limitsObj.description || void 0;
|
|
2609
|
+
const type = limitsObj?.type;
|
|
2610
|
+
if (description) {
|
|
2610
2611
|
if (type === "number" && typeof value === "number") {
|
|
2611
2612
|
return `${value.toLocaleString()} ${description}`;
|
|
2612
2613
|
}
|
|
2613
2614
|
return description;
|
|
2614
2615
|
}
|
|
2615
|
-
if (
|
|
2616
|
+
if (unit) {
|
|
2616
2617
|
if (typeof value === "number") {
|
|
2617
2618
|
return `${value.toLocaleString()} ${unit}`;
|
|
2618
2619
|
}
|
|
2619
|
-
return
|
|
2620
|
+
return unit;
|
|
2620
2621
|
}
|
|
2621
2622
|
const label = humanizeQuotaName(name);
|
|
2622
2623
|
if (type === "boolean") {
|
|
@@ -2635,7 +2636,7 @@ function extractDisplayFeatures(features, planName, fallbackFeatures) {
|
|
|
2635
2636
|
return tierFeatures;
|
|
2636
2637
|
}
|
|
2637
2638
|
}
|
|
2638
|
-
const quotaFeatures = features.filter((f) => f.quota).map((f) =>
|
|
2639
|
+
const quotaFeatures = features.filter((f) => f.quota).map((f) => transformFeatureToLabel(f));
|
|
2639
2640
|
if (quotaFeatures.length > 0) {
|
|
2640
2641
|
return quotaFeatures;
|
|
2641
2642
|
}
|