@schematichq/schematic-components 1.5.0 → 1.6.1
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/schematic-components.cjs.js +159 -98
- package/dist/schematic-components.d.ts +128 -7
- package/dist/schematic-components.esm.js +159 -98
- package/package.json +9 -9
|
@@ -6805,6 +6805,7 @@ var en_default = {
|
|
|
6805
6805
|
Expired: "Expired",
|
|
6806
6806
|
"Expires in X months": "Expires in {{months}} mo",
|
|
6807
6807
|
Expires: "Expires {{date}}",
|
|
6808
|
+
Free: "Free",
|
|
6808
6809
|
"Hide all": "Hide all",
|
|
6809
6810
|
"Hide balance details": "Hide balance details",
|
|
6810
6811
|
"Hide details": "Hide details",
|
|
@@ -7096,7 +7097,7 @@ var import_debounce = __toESM(require_debounce());
|
|
|
7096
7097
|
var import_merge2 = __toESM(require_merge());
|
|
7097
7098
|
var import_react12 = require("react");
|
|
7098
7099
|
|
|
7099
|
-
// node_modules/uuid/dist/
|
|
7100
|
+
// node_modules/uuid/dist/stringify.js
|
|
7100
7101
|
var byteToHex = [];
|
|
7101
7102
|
for (let i2 = 0; i2 < 256; ++i2) {
|
|
7102
7103
|
byteToHex.push((i2 + 256).toString(16).slice(1));
|
|
@@ -7105,7 +7106,7 @@ function unsafeStringify(arr, offset = 0) {
|
|
|
7105
7106
|
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
7106
7107
|
}
|
|
7107
7108
|
|
|
7108
|
-
// node_modules/uuid/dist/
|
|
7109
|
+
// node_modules/uuid/dist/rng.js
|
|
7109
7110
|
var getRandomValues;
|
|
7110
7111
|
var rnds8 = new Uint8Array(16);
|
|
7111
7112
|
function rng() {
|
|
@@ -7118,15 +7119,12 @@ function rng() {
|
|
|
7118
7119
|
return getRandomValues(rnds8);
|
|
7119
7120
|
}
|
|
7120
7121
|
|
|
7121
|
-
// node_modules/uuid/dist/
|
|
7122
|
+
// node_modules/uuid/dist/native.js
|
|
7122
7123
|
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
7123
7124
|
var native_default = { randomUUID };
|
|
7124
7125
|
|
|
7125
|
-
// node_modules/uuid/dist/
|
|
7126
|
-
function
|
|
7127
|
-
if (native_default.randomUUID && !buf && !options) {
|
|
7128
|
-
return native_default.randomUUID();
|
|
7129
|
-
}
|
|
7126
|
+
// node_modules/uuid/dist/v4.js
|
|
7127
|
+
function _v4(options, buf, offset) {
|
|
7130
7128
|
options = options || {};
|
|
7131
7129
|
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
7132
7130
|
if (rnds.length < 16) {
|
|
@@ -7146,6 +7144,12 @@ function v4(options, buf, offset) {
|
|
|
7146
7144
|
}
|
|
7147
7145
|
return unsafeStringify(rnds);
|
|
7148
7146
|
}
|
|
7147
|
+
function v4(options, buf, offset) {
|
|
7148
|
+
if (native_default.randomUUID && !buf && !options) {
|
|
7149
|
+
return native_default.randomUUID();
|
|
7150
|
+
}
|
|
7151
|
+
return _v4(options, buf, offset);
|
|
7152
|
+
}
|
|
7149
7153
|
var v4_default = v4;
|
|
7150
7154
|
|
|
7151
7155
|
// src/api/checkoutexternal/runtime.ts
|
|
@@ -7533,6 +7537,30 @@ function BillingCreditResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
7533
7537
|
};
|
|
7534
7538
|
}
|
|
7535
7539
|
|
|
7540
|
+
// src/api/checkoutexternal/models/BillingPlanCreditGrantResponseData.ts
|
|
7541
|
+
function BillingPlanCreditGrantResponseDataFromJSON(json) {
|
|
7542
|
+
return BillingPlanCreditGrantResponseDataFromJSONTyped(json, false);
|
|
7543
|
+
}
|
|
7544
|
+
function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
7545
|
+
if (json == null) {
|
|
7546
|
+
return json;
|
|
7547
|
+
}
|
|
7548
|
+
return {
|
|
7549
|
+
createdAt: new Date(json["created_at"]),
|
|
7550
|
+
creditAmount: json["credit_amount"],
|
|
7551
|
+
creditId: json["credit_id"],
|
|
7552
|
+
creditName: json["credit_name"],
|
|
7553
|
+
creditPluralName: json["credit_plural_name"] == null ? void 0 : json["credit_plural_name"],
|
|
7554
|
+
creditSingularName: json["credit_singular_name"] == null ? void 0 : json["credit_singular_name"],
|
|
7555
|
+
id: json["id"],
|
|
7556
|
+
planId: json["plan_id"],
|
|
7557
|
+
planName: json["plan_name"],
|
|
7558
|
+
resetCadence: json["reset_cadence"],
|
|
7559
|
+
resetStart: json["reset_start"],
|
|
7560
|
+
updatedAt: new Date(json["updated_at"])
|
|
7561
|
+
};
|
|
7562
|
+
}
|
|
7563
|
+
|
|
7536
7564
|
// src/api/checkoutexternal/models/BillingProductPriceTierResponseData.ts
|
|
7537
7565
|
function BillingProductPriceTierResponseDataFromJSON(json) {
|
|
7538
7566
|
return BillingProductPriceTierResponseDataFromJSONTyped(json, false);
|
|
@@ -8447,6 +8475,63 @@ function CustomPlanConfigFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8447
8475
|
};
|
|
8448
8476
|
}
|
|
8449
8477
|
|
|
8478
|
+
// src/api/checkoutexternal/models/CreditGrantDetail.ts
|
|
8479
|
+
function CreditGrantDetailFromJSON(json) {
|
|
8480
|
+
return CreditGrantDetailFromJSONTyped(json, false);
|
|
8481
|
+
}
|
|
8482
|
+
function CreditGrantDetailFromJSONTyped(json, ignoreDiscriminator) {
|
|
8483
|
+
if (json == null) {
|
|
8484
|
+
return json;
|
|
8485
|
+
}
|
|
8486
|
+
return {
|
|
8487
|
+
creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
|
|
8488
|
+
expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
|
|
8489
|
+
grantReason: json["grant_reason"],
|
|
8490
|
+
quantity: json["quantity"]
|
|
8491
|
+
};
|
|
8492
|
+
}
|
|
8493
|
+
|
|
8494
|
+
// src/api/checkoutexternal/models/FeatureUsageResponseData.ts
|
|
8495
|
+
function FeatureUsageResponseDataFromJSON(json) {
|
|
8496
|
+
return FeatureUsageResponseDataFromJSONTyped(json, false);
|
|
8497
|
+
}
|
|
8498
|
+
function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
8499
|
+
if (json == null) {
|
|
8500
|
+
return json;
|
|
8501
|
+
}
|
|
8502
|
+
return {
|
|
8503
|
+
access: json["access"],
|
|
8504
|
+
allocation: json["allocation"] == null ? void 0 : json["allocation"],
|
|
8505
|
+
allocationType: json["allocation_type"],
|
|
8506
|
+
companyOverride: json["company_override"] == null ? void 0 : CompanyOverrideResponseDataFromJSON(json["company_override"]),
|
|
8507
|
+
creditConsumptionRate: json["credit_consumption_rate"] == null ? void 0 : json["credit_consumption_rate"],
|
|
8508
|
+
creditGrantCounts: json["credit_grant_counts"] == null ? void 0 : json["credit_grant_counts"],
|
|
8509
|
+
creditGrantDetails: json["credit_grant_details"] == null ? void 0 : json["credit_grant_details"].map(
|
|
8510
|
+
CreditGrantDetailFromJSON
|
|
8511
|
+
),
|
|
8512
|
+
creditGrantReason: json["credit_grant_reason"] == null ? void 0 : json["credit_grant_reason"],
|
|
8513
|
+
creditRemaining: json["credit_remaining"] == null ? void 0 : json["credit_remaining"],
|
|
8514
|
+
creditTotal: json["credit_total"] == null ? void 0 : json["credit_total"],
|
|
8515
|
+
creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
|
|
8516
|
+
creditUsed: json["credit_used"] == null ? void 0 : json["credit_used"],
|
|
8517
|
+
entitlementExpirationDate: json["entitlement_expiration_date"] == null ? void 0 : new Date(json["entitlement_expiration_date"]),
|
|
8518
|
+
entitlementId: json["entitlement_id"],
|
|
8519
|
+
entitlementSource: json["entitlement_source"] == null ? void 0 : json["entitlement_source"],
|
|
8520
|
+
entitlementType: json["entitlement_type"],
|
|
8521
|
+
feature: json["feature"] == null ? void 0 : FeatureDetailResponseDataFromJSON(json["feature"]),
|
|
8522
|
+
metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
|
|
8523
|
+
monthReset: json["month_reset"] == null ? void 0 : json["month_reset"],
|
|
8524
|
+
monthlyUsageBasedPrice: json["monthly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_usage_based_price"]),
|
|
8525
|
+
period: json["period"] == null ? void 0 : json["period"],
|
|
8526
|
+
plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
|
|
8527
|
+
planEntitlement: json["plan_entitlement"] == null ? void 0 : PlanEntitlementResponseDataFromJSON(json["plan_entitlement"]),
|
|
8528
|
+
priceBehavior: json["price_behavior"] == null ? void 0 : json["price_behavior"],
|
|
8529
|
+
softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
|
|
8530
|
+
usage: json["usage"] == null ? void 0 : json["usage"],
|
|
8531
|
+
yearlyUsageBasedPrice: json["yearly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["yearly_usage_based_price"])
|
|
8532
|
+
};
|
|
8533
|
+
}
|
|
8534
|
+
|
|
8450
8535
|
// src/api/checkoutexternal/models/CompanyPlanDetailResponseData.ts
|
|
8451
8536
|
function CompanyPlanDetailResponseDataFromJSON(json) {
|
|
8452
8537
|
return CompanyPlanDetailResponseDataFromJSONTyped(json, false);
|
|
@@ -8489,6 +8574,9 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8489
8574
|
planType: json["plan_type"],
|
|
8490
8575
|
trialDays: json["trial_days"] == null ? void 0 : json["trial_days"],
|
|
8491
8576
|
updatedAt: new Date(json["updated_at"]),
|
|
8577
|
+
usageViolations: json["usage_violations"].map(
|
|
8578
|
+
FeatureUsageResponseDataFromJSON
|
|
8579
|
+
),
|
|
8492
8580
|
valid: json["valid"],
|
|
8493
8581
|
yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["yearly_price"])
|
|
8494
8582
|
};
|
|
@@ -8588,6 +8676,9 @@ function PlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8588
8676
|
),
|
|
8589
8677
|
icon: json["icon"],
|
|
8590
8678
|
id: json["id"],
|
|
8679
|
+
includedCreditGrants: json["included_credit_grants"] == null ? void 0 : json["included_credit_grants"].map(
|
|
8680
|
+
BillingPlanCreditGrantResponseDataFromJSON
|
|
8681
|
+
),
|
|
8591
8682
|
isDefault: json["is_default"],
|
|
8592
8683
|
isFree: json["is_free"],
|
|
8593
8684
|
isTrialable: json["is_trialable"],
|
|
@@ -8699,62 +8790,6 @@ function ComponentResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8699
8790
|
};
|
|
8700
8791
|
}
|
|
8701
8792
|
|
|
8702
|
-
// src/api/checkoutexternal/models/CreditGrantDetail.ts
|
|
8703
|
-
function CreditGrantDetailFromJSON(json) {
|
|
8704
|
-
return CreditGrantDetailFromJSONTyped(json, false);
|
|
8705
|
-
}
|
|
8706
|
-
function CreditGrantDetailFromJSONTyped(json, ignoreDiscriminator) {
|
|
8707
|
-
if (json == null) {
|
|
8708
|
-
return json;
|
|
8709
|
-
}
|
|
8710
|
-
return {
|
|
8711
|
-
creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
|
|
8712
|
-
expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
|
|
8713
|
-
grantReason: json["grant_reason"],
|
|
8714
|
-
quantity: json["quantity"]
|
|
8715
|
-
};
|
|
8716
|
-
}
|
|
8717
|
-
|
|
8718
|
-
// src/api/checkoutexternal/models/FeatureUsageResponseData.ts
|
|
8719
|
-
function FeatureUsageResponseDataFromJSON(json) {
|
|
8720
|
-
return FeatureUsageResponseDataFromJSONTyped(json, false);
|
|
8721
|
-
}
|
|
8722
|
-
function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
8723
|
-
if (json == null) {
|
|
8724
|
-
return json;
|
|
8725
|
-
}
|
|
8726
|
-
return {
|
|
8727
|
-
access: json["access"],
|
|
8728
|
-
allocation: json["allocation"] == null ? void 0 : json["allocation"],
|
|
8729
|
-
allocationType: json["allocation_type"],
|
|
8730
|
-
companyOverride: json["company_override"] == null ? void 0 : CompanyOverrideResponseDataFromJSON(json["company_override"]),
|
|
8731
|
-
creditGrantCounts: json["credit_grant_counts"] == null ? void 0 : json["credit_grant_counts"],
|
|
8732
|
-
creditGrantDetails: json["credit_grant_details"] == null ? void 0 : json["credit_grant_details"].map(
|
|
8733
|
-
CreditGrantDetailFromJSON
|
|
8734
|
-
),
|
|
8735
|
-
creditGrantReason: json["credit_grant_reason"] == null ? void 0 : json["credit_grant_reason"],
|
|
8736
|
-
creditRemaining: json["credit_remaining"] == null ? void 0 : json["credit_remaining"],
|
|
8737
|
-
creditTotal: json["credit_total"] == null ? void 0 : json["credit_total"],
|
|
8738
|
-
creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
|
|
8739
|
-
creditUsed: json["credit_used"] == null ? void 0 : json["credit_used"],
|
|
8740
|
-
entitlementExpirationDate: json["entitlement_expiration_date"] == null ? void 0 : new Date(json["entitlement_expiration_date"]),
|
|
8741
|
-
entitlementId: json["entitlement_id"],
|
|
8742
|
-
entitlementSource: json["entitlement_source"] == null ? void 0 : json["entitlement_source"],
|
|
8743
|
-
entitlementType: json["entitlement_type"],
|
|
8744
|
-
feature: json["feature"] == null ? void 0 : FeatureDetailResponseDataFromJSON(json["feature"]),
|
|
8745
|
-
metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
|
|
8746
|
-
monthReset: json["month_reset"] == null ? void 0 : json["month_reset"],
|
|
8747
|
-
monthlyUsageBasedPrice: json["monthly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_usage_based_price"]),
|
|
8748
|
-
period: json["period"] == null ? void 0 : json["period"],
|
|
8749
|
-
plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
|
|
8750
|
-
planEntitlement: json["plan_entitlement"] == null ? void 0 : PlanEntitlementResponseDataFromJSON(json["plan_entitlement"]),
|
|
8751
|
-
priceBehavior: json["price_behavior"] == null ? void 0 : json["price_behavior"],
|
|
8752
|
-
softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
|
|
8753
|
-
usage: json["usage"] == null ? void 0 : json["usage"],
|
|
8754
|
-
yearlyUsageBasedPrice: json["yearly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["yearly_usage_based_price"])
|
|
8755
|
-
};
|
|
8756
|
-
}
|
|
8757
|
-
|
|
8758
8793
|
// src/api/checkoutexternal/models/FeatureUsageDetailResponseData.ts
|
|
8759
8794
|
function FeatureUsageDetailResponseDataFromJSON(json) {
|
|
8760
8795
|
return FeatureUsageDetailResponseDataFromJSONTyped(json, false);
|
|
@@ -8804,6 +8839,7 @@ function ComponentHydrateResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8804
8839
|
defaultPlan: json["default_plan"] == null ? void 0 : PlanDetailResponseDataFromJSON(json["default_plan"]),
|
|
8805
8840
|
featureUsage: json["feature_usage"] == null ? void 0 : FeatureUsageDetailResponseDataFromJSON(json["feature_usage"]),
|
|
8806
8841
|
showPeriodToggle: json["show_period_toggle"],
|
|
8842
|
+
showZeroPriceAsFree: json["show_zero_price_as_free"],
|
|
8807
8843
|
stripeEmbed: json["stripe_embed"] == null ? void 0 : StripeEmbedInfoFromJSON(json["stripe_embed"]),
|
|
8808
8844
|
subscription: json["subscription"] == null ? void 0 : CompanySubscriptionResponseDataFromJSON(json["subscription"]),
|
|
8809
8845
|
trialPaymentMethodRequired: json["trial_payment_method_required"] == null ? void 0 : json["trial_payment_method_required"],
|
|
@@ -10356,7 +10392,8 @@ function PublicPlansResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10356
10392
|
CompatiblePlansFromJSON2
|
|
10357
10393
|
),
|
|
10358
10394
|
capabilities: json["capabilities"] == null ? void 0 : ComponentCapabilitiesFromJSON2(json["capabilities"]),
|
|
10359
|
-
showPeriodToggle: json["show_period_toggle"]
|
|
10395
|
+
showPeriodToggle: json["show_period_toggle"],
|
|
10396
|
+
showZeroPriceAsFree: json["show_zero_price_as_free"]
|
|
10360
10397
|
};
|
|
10361
10398
|
}
|
|
10362
10399
|
|
|
@@ -10554,7 +10591,7 @@ var EmbedProvider = ({
|
|
|
10554
10591
|
});
|
|
10555
10592
|
const customHeaders = (0, import_react12.useMemo)(
|
|
10556
10593
|
() => ({
|
|
10557
|
-
"X-Schematic-Components-Version": "1.
|
|
10594
|
+
"X-Schematic-Components-Version": "1.6.1",
|
|
10558
10595
|
"X-Schematic-Session-ID": sessionIdRef.current
|
|
10559
10596
|
}),
|
|
10560
10597
|
[]
|
|
@@ -10820,17 +10857,15 @@ var EmbedProvider = ({
|
|
|
10820
10857
|
const colorMode = darkModeQuery.matches ? "dark" : "light";
|
|
10821
10858
|
dispatch({
|
|
10822
10859
|
type: "UPDATE_SETTINGS",
|
|
10823
|
-
settings: {
|
|
10824
|
-
|
|
10825
|
-
colorMode
|
|
10826
|
-
}
|
|
10827
|
-
}
|
|
10860
|
+
settings: { theme: { colorMode } },
|
|
10861
|
+
update: true
|
|
10828
10862
|
});
|
|
10829
10863
|
function darkModeQueryHandler(event) {
|
|
10830
10864
|
const newColorMode = event.matches ? "dark" : "light";
|
|
10831
10865
|
dispatch({
|
|
10832
10866
|
type: "UPDATE_SETTINGS",
|
|
10833
|
-
settings: { theme: { colorMode: newColorMode } }
|
|
10867
|
+
settings: { theme: { colorMode: newColorMode } },
|
|
10868
|
+
update: true
|
|
10834
10869
|
});
|
|
10835
10870
|
}
|
|
10836
10871
|
darkModeQuery.addEventListener("change", darkModeQueryHandler);
|
|
@@ -10883,8 +10918,9 @@ var EmbedProvider = ({
|
|
|
10883
10918
|
}
|
|
10884
10919
|
}, [state.accessToken, apiConfig, customHeaders]);
|
|
10885
10920
|
(0, import_react12.useEffect)(() => {
|
|
10886
|
-
|
|
10887
|
-
|
|
10921
|
+
if (options.settings) {
|
|
10922
|
+
updateSettings(options.settings, { update: true });
|
|
10923
|
+
}
|
|
10888
10924
|
}, [options.settings, updateSettings]);
|
|
10889
10925
|
(0, import_react12.useEffect)(() => {
|
|
10890
10926
|
function planChangedHandler(event) {
|
|
@@ -12779,6 +12815,10 @@ var Sidebar = ({
|
|
|
12779
12815
|
() => creditBundles.filter((bundle) => bundle.count > 0),
|
|
12780
12816
|
[creditBundles]
|
|
12781
12817
|
);
|
|
12818
|
+
const discountApplied = (0, import_react27.useMemo)(
|
|
12819
|
+
() => promoCode && (amountOff > 0 || percentOff > 0),
|
|
12820
|
+
[promoCode, amountOff, percentOff]
|
|
12821
|
+
);
|
|
12782
12822
|
const handleCheckout = (0, import_react27.useCallback)(async () => {
|
|
12783
12823
|
const planId = selectedPlan?.id;
|
|
12784
12824
|
const priceId = (planPeriod === "year" ? selectedPlan?.yearlyPrice : selectedPlan?.monthlyPrice)?.id;
|
|
@@ -12845,7 +12885,7 @@ var Sidebar = ({
|
|
|
12845
12885
|
},
|
|
12846
12886
|
[]
|
|
12847
12887
|
),
|
|
12848
|
-
skipTrial: !
|
|
12888
|
+
skipTrial: !shouldTrial,
|
|
12849
12889
|
...paymentMethodId && { paymentMethodId },
|
|
12850
12890
|
...promoCode && { promoCode }
|
|
12851
12891
|
});
|
|
@@ -12871,7 +12911,7 @@ var Sidebar = ({
|
|
|
12871
12911
|
setLayout,
|
|
12872
12912
|
payInAdvanceEntitlements,
|
|
12873
12913
|
addOnUsageBasedEntitlements,
|
|
12874
|
-
|
|
12914
|
+
shouldTrial,
|
|
12875
12915
|
promoCode
|
|
12876
12916
|
]);
|
|
12877
12917
|
const handleUnsubscribe = (0, import_react27.useCallback)(async () => {
|
|
@@ -13248,7 +13288,7 @@ var Sidebar = ({
|
|
|
13248
13288
|
$width: "100%",
|
|
13249
13289
|
$padding: "1.5rem",
|
|
13250
13290
|
children: [
|
|
13251
|
-
|
|
13291
|
+
discountApplied && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
13252
13292
|
Flex,
|
|
13253
13293
|
{
|
|
13254
13294
|
$justifyContent: "space-between",
|
|
@@ -13920,10 +13960,18 @@ var Plan = ({
|
|
|
13920
13960
|
const [entitlementCounts, setEntitlementCounts] = (0, import_react29.useState)(
|
|
13921
13961
|
() => plans.reduce(entitlementCountsReducer, {})
|
|
13922
13962
|
);
|
|
13923
|
-
const isTrialing = (0, import_react29.useMemo)(
|
|
13924
|
-
(
|
|
13925
|
-
|
|
13926
|
-
|
|
13963
|
+
const { isTrialing, showZeroPriceAsFree } = (0, import_react29.useMemo)(() => {
|
|
13964
|
+
if (isCheckoutData(data)) {
|
|
13965
|
+
return {
|
|
13966
|
+
isTrialing: data.subscription?.status === "trialing",
|
|
13967
|
+
showZeroPriceAsFree: data.showZeroPriceAsFree
|
|
13968
|
+
};
|
|
13969
|
+
}
|
|
13970
|
+
return {
|
|
13971
|
+
isTrialing: false,
|
|
13972
|
+
showZeroPriceAsFree: false
|
|
13973
|
+
};
|
|
13974
|
+
}, [data]);
|
|
13927
13975
|
const handleToggleShowAll = (id) => {
|
|
13928
13976
|
setEntitlementCounts((prev2) => {
|
|
13929
13977
|
const count = prev2[id] ? { ...prev2[id] } : void 0;
|
|
@@ -13957,7 +14005,8 @@ var Plan = ({
|
|
|
13957
14005
|
const hasUsageBasedEntitlements = plan.entitlements.some(
|
|
13958
14006
|
(entitlement) => !!entitlement.priceBehavior
|
|
13959
14007
|
);
|
|
13960
|
-
const
|
|
14008
|
+
const isFreePlan = planPrice === 0;
|
|
14009
|
+
const isUsageBasedPlan = isFreePlan && hasUsageBasedEntitlements;
|
|
13961
14010
|
const headerPriceFontStyle = settings.theme.typography.heading2;
|
|
13962
14011
|
const count = entitlementCounts[plan.id];
|
|
13963
14012
|
const isExpanded = count && count.limit > VISIBLE_ENTITLEMENT_COUNT;
|
|
@@ -14002,10 +14051,10 @@ var Plan = ({
|
|
|
14002
14051
|
$size: headerPriceFontStyle.fontSize,
|
|
14003
14052
|
$weight: headerPriceFontStyle.fontWeight,
|
|
14004
14053
|
$color: headerPriceFontStyle.color,
|
|
14005
|
-
children: plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : formatCurrency(planPrice ?? 0, planCurrency)
|
|
14054
|
+
children: plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : isFreePlan && showZeroPriceAsFree ? t2("Free") : formatCurrency(planPrice ?? 0, planCurrency)
|
|
14006
14055
|
}
|
|
14007
14056
|
),
|
|
14008
|
-
!plan.custom && !
|
|
14057
|
+
!plan.custom && !isFreePlan && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
14009
14058
|
Text,
|
|
14010
14059
|
{
|
|
14011
14060
|
display: "heading2",
|
|
@@ -15206,7 +15255,7 @@ var Label = dt.label`
|
|
|
15206
15255
|
transition:
|
|
15207
15256
|
transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
|
|
15208
15257
|
opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
|
|
15209
|
-
color: #cdd6f4;
|
|
15258
|
+
color: ${({ theme }) => theme.colorMode === "dark" ? "#cdd6f4" : "#000000"};
|
|
15210
15259
|
touch-action: manipulation;
|
|
15211
15260
|
`;
|
|
15212
15261
|
var Input2 = dt.input`
|
|
@@ -16826,7 +16875,7 @@ var MeteredFeatures = (0, import_react43.forwardRef)(({ className, ...rest }, re
|
|
|
16826
16875
|
)
|
|
16827
16876
|
);
|
|
16828
16877
|
}, []);
|
|
16829
|
-
const shouldShowFeatures = meteredFeatures.length > 0;
|
|
16878
|
+
const shouldShowFeatures = meteredFeatures.length > 0 || creditGroups.length > 0;
|
|
16830
16879
|
if (!shouldShowFeatures) {
|
|
16831
16880
|
return null;
|
|
16832
16881
|
}
|
|
@@ -17981,6 +18030,7 @@ var PlanManager = (0, import_react48.forwardRef)(({ children, className, portal,
|
|
|
17981
18030
|
canCheckout,
|
|
17982
18031
|
defaultPlan,
|
|
17983
18032
|
featureUsage,
|
|
18033
|
+
showZeroPriceAsFree,
|
|
17984
18034
|
trialPaymentMethodRequired
|
|
17985
18035
|
} = (0, import_react48.useMemo)(() => {
|
|
17986
18036
|
if (isCheckoutData(data)) {
|
|
@@ -17991,6 +18041,7 @@ var PlanManager = (0, import_react48.forwardRef)(({ children, className, portal,
|
|
|
17991
18041
|
capabilities,
|
|
17992
18042
|
defaultPlan: defaultPlan2,
|
|
17993
18043
|
featureUsage: featureUsage2,
|
|
18044
|
+
showZeroPriceAsFree: showZeroPriceAsFree2,
|
|
17994
18045
|
trialPaymentMethodRequired: trialPaymentMethodRequired2
|
|
17995
18046
|
} = data;
|
|
17996
18047
|
const creditGroups2 = groupCreditGrants(creditGrants, {
|
|
@@ -18020,6 +18071,7 @@ var PlanManager = (0, import_react48.forwardRef)(({ children, className, portal,
|
|
|
18020
18071
|
canCheckout: capabilities?.checkout ?? true,
|
|
18021
18072
|
defaultPlan: defaultPlan2,
|
|
18022
18073
|
featureUsage: featureUsage2?.features || [],
|
|
18074
|
+
showZeroPriceAsFree: showZeroPriceAsFree2,
|
|
18023
18075
|
trialPaymentMethodRequired: trialPaymentMethodRequired2
|
|
18024
18076
|
};
|
|
18025
18077
|
}
|
|
@@ -18032,6 +18084,7 @@ var PlanManager = (0, import_react48.forwardRef)(({ children, className, portal,
|
|
|
18032
18084
|
canCheckout: false,
|
|
18033
18085
|
defaultPlan: void 0,
|
|
18034
18086
|
featureUsage: [],
|
|
18087
|
+
showZeroPriceAsFree: false,
|
|
18035
18088
|
trialPaymentMethodRequired: false
|
|
18036
18089
|
};
|
|
18037
18090
|
}, [data]);
|
|
@@ -18056,7 +18109,8 @@ var PlanManager = (0, import_react48.forwardRef)(({ children, className, portal,
|
|
|
18056
18109
|
willSubscriptionCancel: willSubscriptionCancel2
|
|
18057
18110
|
};
|
|
18058
18111
|
}, [billingSubscription]);
|
|
18059
|
-
const
|
|
18112
|
+
const isFreePlan = currentPlan?.planPrice === 0;
|
|
18113
|
+
const isUsageBasedPlan = isFreePlan && usageBasedEntitlements.length > 0;
|
|
18060
18114
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
18061
18115
|
isTrialSubscription && !willSubscriptionCancel ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
18062
18116
|
Notice,
|
|
@@ -18130,13 +18184,13 @@ var PlanManager = (0, import_react48.forwardRef)(({ children, className, portal,
|
|
|
18130
18184
|
Text,
|
|
18131
18185
|
{
|
|
18132
18186
|
display: isUsageBasedPlan ? "heading3" : props.header.price.fontStyle,
|
|
18133
|
-
children: isUsageBasedPlan ? t2("Usage-based") : formatCurrency(
|
|
18187
|
+
children: isUsageBasedPlan ? t2("Usage-based") : isFreePlan && showZeroPriceAsFree ? t2("Free") : formatCurrency(
|
|
18134
18188
|
currentPlan.planPrice,
|
|
18135
18189
|
subscriptionCurrency
|
|
18136
18190
|
)
|
|
18137
18191
|
}
|
|
18138
18192
|
),
|
|
18139
|
-
!
|
|
18193
|
+
!isFreePlan && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text, { display: props.header.price.fontStyle, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("sub", { children: [
|
|
18140
18194
|
"/",
|
|
18141
18195
|
shortenPeriod(currentPlan.planPeriod)
|
|
18142
18196
|
] }) })
|
|
@@ -18695,7 +18749,8 @@ var Plan2 = ({
|
|
|
18695
18749
|
isTrialSubscription,
|
|
18696
18750
|
willSubscriptionCancel,
|
|
18697
18751
|
isStandalone,
|
|
18698
|
-
showCallToAction
|
|
18752
|
+
showCallToAction,
|
|
18753
|
+
showZeroPriceAsFree
|
|
18699
18754
|
} = (0, import_react50.useMemo)(() => {
|
|
18700
18755
|
if (isCheckoutData(data)) {
|
|
18701
18756
|
const billingSubscription = data.company?.billingSubscription;
|
|
@@ -18707,7 +18762,8 @@ var Plan2 = ({
|
|
|
18707
18762
|
isTrialSubscription: isTrialSubscription2,
|
|
18708
18763
|
willSubscriptionCancel: willSubscriptionCancel2,
|
|
18709
18764
|
isStandalone: false,
|
|
18710
|
-
showCallToAction: true
|
|
18765
|
+
showCallToAction: true,
|
|
18766
|
+
showZeroPriceAsFree: data.showZeroPriceAsFree
|
|
18711
18767
|
};
|
|
18712
18768
|
}
|
|
18713
18769
|
return {
|
|
@@ -18716,7 +18772,8 @@ var Plan2 = ({
|
|
|
18716
18772
|
isTrialSubscription: false,
|
|
18717
18773
|
willSubscriptionCancel: false,
|
|
18718
18774
|
isStandalone: true,
|
|
18719
|
-
showCallToAction: typeof sharedProps.callToActionUrl === "string" || typeof sharedProps.onCallToAction === "function"
|
|
18775
|
+
showCallToAction: typeof sharedProps.callToActionUrl === "string" || typeof sharedProps.onCallToAction === "function",
|
|
18776
|
+
showZeroPriceAsFree: false
|
|
18720
18777
|
};
|
|
18721
18778
|
}, [data, sharedProps.callToActionUrl, sharedProps.onCallToAction]);
|
|
18722
18779
|
const callToActionTarget = (0, import_react50.useMemo)(() => {
|
|
@@ -18744,7 +18801,8 @@ var Plan2 = ({
|
|
|
18744
18801
|
const hasUsageBasedEntitlements = plan.entitlements.some(
|
|
18745
18802
|
(entitlement) => !!entitlement.priceBehavior
|
|
18746
18803
|
);
|
|
18747
|
-
const
|
|
18804
|
+
const isFreePlan = planPrice === 0;
|
|
18805
|
+
const isUsageBasedPlan = isFreePlan && hasUsageBasedEntitlements;
|
|
18748
18806
|
const headerPriceFontStyle = settings.theme.typography[layout.plans.name.fontStyle];
|
|
18749
18807
|
const count = entitlementCounts[plan.id];
|
|
18750
18808
|
const isExpanded = count && count.limit > VISIBLE_ENTITLEMENT_COUNT;
|
|
@@ -18786,8 +18844,8 @@ var Plan2 = ({
|
|
|
18786
18844
|
$weight: headerPriceFontStyle.fontWeight,
|
|
18787
18845
|
$color: headerPriceFontStyle.color,
|
|
18788
18846
|
children: [
|
|
18789
|
-
plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : formatCurrency(planPrice ?? 0, planCurrency),
|
|
18790
|
-
!plan.custom && !
|
|
18847
|
+
plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : isFreePlan && showZeroPriceAsFree ? t2("Free") : formatCurrency(planPrice ?? 0, planCurrency),
|
|
18848
|
+
!plan.custom && !isFreePlan && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("sub", { children: [
|
|
18791
18849
|
"/",
|
|
18792
18850
|
selectedPeriod
|
|
18793
18851
|
] })
|
|
@@ -19008,14 +19066,14 @@ var resolveDesignProps8 = (props) => {
|
|
|
19008
19066
|
},
|
|
19009
19067
|
showInclusionText: props.plans?.showInclusionText ?? true,
|
|
19010
19068
|
showFeatureIcons: props.plans?.showFeatureIcons ?? true,
|
|
19011
|
-
showFeatureDescriptions: props.plans?.showFeatureDescriptions ??
|
|
19069
|
+
showFeatureDescriptions: props.plans?.showFeatureDescriptions ?? false,
|
|
19012
19070
|
showEntitlements: props.plans?.showEntitlements ?? true
|
|
19013
19071
|
},
|
|
19014
19072
|
addOns: {
|
|
19015
19073
|
isVisible: props.addOns?.isVisible ?? true,
|
|
19016
19074
|
showDescription: props.addOns?.showDescription ?? true,
|
|
19017
19075
|
showFeatureIcons: props.addOns?.showFeatureIcons ?? true,
|
|
19018
|
-
showFeatureDescriptions: props.plans?.showFeatureDescriptions ??
|
|
19076
|
+
showFeatureDescriptions: props.plans?.showFeatureDescriptions ?? false,
|
|
19019
19077
|
showEntitlements: props.addOns?.showEntitlements ?? true
|
|
19020
19078
|
},
|
|
19021
19079
|
upgrade: {
|
|
@@ -23857,7 +23915,10 @@ var SchematicEmbed = ({ id, accessToken }) => {
|
|
|
23857
23915
|
);
|
|
23858
23916
|
const ast = getEditorState(json);
|
|
23859
23917
|
if (ast) {
|
|
23860
|
-
|
|
23918
|
+
const settings = ast.ROOT.props.settings;
|
|
23919
|
+
const { colorMode, ...theme2 } = settings.theme;
|
|
23920
|
+
const updated = { mode: settings.mode, theme: theme2, badge: settings.badge };
|
|
23921
|
+
updateSettings(updated, { update: true });
|
|
23861
23922
|
nodes.push(...parseEditorState(ast));
|
|
23862
23923
|
setChildren(nodes.map(renderer));
|
|
23863
23924
|
}
|
|
@@ -331,6 +331,97 @@ declare interface BillingCreditResponseData_2 {
|
|
|
331
331
|
updatedAt: Date;
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Schematic API
|
|
336
|
+
* Schematic API
|
|
337
|
+
*
|
|
338
|
+
* The version of the OpenAPI document: 0.1
|
|
339
|
+
*
|
|
340
|
+
*
|
|
341
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
342
|
+
* https://openapi-generator.tech
|
|
343
|
+
* Do not edit the class manually.
|
|
344
|
+
*/
|
|
345
|
+
/**
|
|
346
|
+
*
|
|
347
|
+
* @export
|
|
348
|
+
* @interface BillingPlanCreditGrantResponseData
|
|
349
|
+
*/
|
|
350
|
+
declare interface BillingPlanCreditGrantResponseData {
|
|
351
|
+
/**
|
|
352
|
+
*
|
|
353
|
+
* @type {Date}
|
|
354
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
355
|
+
*/
|
|
356
|
+
createdAt: Date;
|
|
357
|
+
/**
|
|
358
|
+
*
|
|
359
|
+
* @type {number}
|
|
360
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
361
|
+
*/
|
|
362
|
+
creditAmount: number;
|
|
363
|
+
/**
|
|
364
|
+
*
|
|
365
|
+
* @type {string}
|
|
366
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
367
|
+
*/
|
|
368
|
+
creditId: string;
|
|
369
|
+
/**
|
|
370
|
+
*
|
|
371
|
+
* @type {string}
|
|
372
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
373
|
+
*/
|
|
374
|
+
creditName: string;
|
|
375
|
+
/**
|
|
376
|
+
*
|
|
377
|
+
* @type {string}
|
|
378
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
379
|
+
*/
|
|
380
|
+
creditPluralName?: string | null;
|
|
381
|
+
/**
|
|
382
|
+
*
|
|
383
|
+
* @type {string}
|
|
384
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
385
|
+
*/
|
|
386
|
+
creditSingularName?: string | null;
|
|
387
|
+
/**
|
|
388
|
+
*
|
|
389
|
+
* @type {string}
|
|
390
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
391
|
+
*/
|
|
392
|
+
id: string;
|
|
393
|
+
/**
|
|
394
|
+
*
|
|
395
|
+
* @type {string}
|
|
396
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
397
|
+
*/
|
|
398
|
+
planId: string;
|
|
399
|
+
/**
|
|
400
|
+
*
|
|
401
|
+
* @type {string}
|
|
402
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
403
|
+
*/
|
|
404
|
+
planName: string;
|
|
405
|
+
/**
|
|
406
|
+
*
|
|
407
|
+
* @type {string}
|
|
408
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
409
|
+
*/
|
|
410
|
+
resetCadence: string;
|
|
411
|
+
/**
|
|
412
|
+
*
|
|
413
|
+
* @type {string}
|
|
414
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
415
|
+
*/
|
|
416
|
+
resetStart: string;
|
|
417
|
+
/**
|
|
418
|
+
*
|
|
419
|
+
* @type {Date}
|
|
420
|
+
* @memberof BillingPlanCreditGrantResponseData
|
|
421
|
+
*/
|
|
422
|
+
updatedAt: Date;
|
|
423
|
+
}
|
|
424
|
+
|
|
334
425
|
/**
|
|
335
426
|
* Schematic API
|
|
336
427
|
* Schematic API
|
|
@@ -1967,7 +2058,7 @@ export declare interface ColumnProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
1967
2058
|
}
|
|
1968
2059
|
|
|
1969
2060
|
/**
|
|
1970
|
-
*
|
|
2061
|
+
*
|
|
1971
2062
|
* @export
|
|
1972
2063
|
* @interface CompanyCustomerBalance
|
|
1973
2064
|
*/
|
|
@@ -2485,6 +2576,12 @@ declare interface CompanyPlanDetailResponseData {
|
|
|
2485
2576
|
* @memberof CompanyPlanDetailResponseData
|
|
2486
2577
|
*/
|
|
2487
2578
|
updatedAt: Date;
|
|
2579
|
+
/**
|
|
2580
|
+
*
|
|
2581
|
+
* @type {Array<FeatureUsageResponseData>}
|
|
2582
|
+
* @memberof CompanyPlanDetailResponseData
|
|
2583
|
+
*/
|
|
2584
|
+
usageViolations: Array<FeatureUsageResponseData>;
|
|
2488
2585
|
/**
|
|
2489
2586
|
*
|
|
2490
2587
|
* @type {boolean}
|
|
@@ -2826,7 +2923,7 @@ declare interface ComponentCheckoutSettings {
|
|
|
2826
2923
|
}
|
|
2827
2924
|
|
|
2828
2925
|
/**
|
|
2829
|
-
*
|
|
2926
|
+
*
|
|
2830
2927
|
* @export
|
|
2831
2928
|
* @interface ComponentHydrateResponseData
|
|
2832
2929
|
*/
|
|
@@ -2909,6 +3006,12 @@ declare interface ComponentHydrateResponseData {
|
|
|
2909
3006
|
* @memberof ComponentHydrateResponseData
|
|
2910
3007
|
*/
|
|
2911
3008
|
showPeriodToggle: boolean;
|
|
3009
|
+
/**
|
|
3010
|
+
*
|
|
3011
|
+
* @type {boolean}
|
|
3012
|
+
* @memberof ComponentHydrateResponseData
|
|
3013
|
+
*/
|
|
3014
|
+
showZeroPriceAsFree: boolean;
|
|
2912
3015
|
/**
|
|
2913
3016
|
*
|
|
2914
3017
|
* @type {StripeEmbedInfo}
|
|
@@ -4552,6 +4655,12 @@ declare interface FeatureUsageResponseData {
|
|
|
4552
4655
|
* @memberof FeatureUsageResponseData
|
|
4553
4656
|
*/
|
|
4554
4657
|
companyOverride?: CompanyOverrideResponseData;
|
|
4658
|
+
/**
|
|
4659
|
+
* The rate at which credits are consumed per unit of usage
|
|
4660
|
+
* @type {number}
|
|
4661
|
+
* @memberof FeatureUsageResponseData
|
|
4662
|
+
*/
|
|
4663
|
+
creditConsumptionRate?: number | null;
|
|
4555
4664
|
/**
|
|
4556
4665
|
*
|
|
4557
4666
|
* @type {{ [key: string]: number; }}
|
|
@@ -5252,7 +5361,7 @@ declare interface ListInvoicesParams {
|
|
|
5252
5361
|
*/
|
|
5253
5362
|
declare interface ListInvoicesResponse {
|
|
5254
5363
|
/**
|
|
5255
|
-
*
|
|
5364
|
+
*
|
|
5256
5365
|
* @type {Array<InvoiceResponseData>}
|
|
5257
5366
|
* @memberof ListInvoicesResponse
|
|
5258
5367
|
*/
|
|
@@ -5344,7 +5453,7 @@ export declare type PaymentMethodProps = DesignProps_5;
|
|
|
5344
5453
|
* Do not edit the class manually.
|
|
5345
5454
|
*/
|
|
5346
5455
|
/**
|
|
5347
|
-
*
|
|
5456
|
+
*
|
|
5348
5457
|
* @export
|
|
5349
5458
|
* @interface PaymentMethodResponseData
|
|
5350
5459
|
*/
|
|
@@ -5727,6 +5836,12 @@ declare interface PlanDetailResponseData {
|
|
|
5727
5836
|
* @memberof PlanDetailResponseData
|
|
5728
5837
|
*/
|
|
5729
5838
|
id: string;
|
|
5839
|
+
/**
|
|
5840
|
+
*
|
|
5841
|
+
* @type {Array<BillingPlanCreditGrantResponseData>}
|
|
5842
|
+
* @memberof PlanDetailResponseData
|
|
5843
|
+
*/
|
|
5844
|
+
includedCreditGrants?: Array<BillingPlanCreditGrantResponseData>;
|
|
5730
5845
|
/**
|
|
5731
5846
|
*
|
|
5732
5847
|
* @type {boolean}
|
|
@@ -6604,7 +6719,7 @@ declare interface PreviewObjectResponseData_2 {
|
|
|
6604
6719
|
}
|
|
6605
6720
|
|
|
6606
6721
|
/**
|
|
6607
|
-
*
|
|
6722
|
+
*
|
|
6608
6723
|
* @export
|
|
6609
6724
|
* @interface PreviewSubscriptionChangeResponseData
|
|
6610
6725
|
*/
|
|
@@ -6819,7 +6934,7 @@ export declare interface ProgressBarProps extends React.ComponentPropsWithoutRef
|
|
|
6819
6934
|
export declare const progressColorMap: ("blue" | "red" | "yellow")[];
|
|
6820
6935
|
|
|
6821
6936
|
/**
|
|
6822
|
-
*
|
|
6937
|
+
*
|
|
6823
6938
|
* @export
|
|
6824
6939
|
* @interface PublicPlansResponseData
|
|
6825
6940
|
*/
|
|
@@ -6854,6 +6969,12 @@ declare interface PublicPlansResponseData {
|
|
|
6854
6969
|
* @memberof PublicPlansResponseData
|
|
6855
6970
|
*/
|
|
6856
6971
|
showPeriodToggle: boolean;
|
|
6972
|
+
/**
|
|
6973
|
+
*
|
|
6974
|
+
* @type {boolean}
|
|
6975
|
+
* @memberof PublicPlansResponseData
|
|
6976
|
+
*/
|
|
6977
|
+
showZeroPriceAsFree: boolean;
|
|
6857
6978
|
}
|
|
6858
6979
|
|
|
6859
6980
|
declare interface RequestContext {
|
|
@@ -7452,7 +7573,7 @@ declare type SelectedPlan = Plan & {
|
|
|
7452
7573
|
* Do not edit the class manually.
|
|
7453
7574
|
*/
|
|
7454
7575
|
/**
|
|
7455
|
-
*
|
|
7576
|
+
*
|
|
7456
7577
|
* @export
|
|
7457
7578
|
* @interface SetupIntentResponseData
|
|
7458
7579
|
*/
|
|
@@ -6739,6 +6739,7 @@ var en_default = {
|
|
|
6739
6739
|
Expired: "Expired",
|
|
6740
6740
|
"Expires in X months": "Expires in {{months}} mo",
|
|
6741
6741
|
Expires: "Expires {{date}}",
|
|
6742
|
+
Free: "Free",
|
|
6742
6743
|
"Hide all": "Hide all",
|
|
6743
6744
|
"Hide balance details": "Hide balance details",
|
|
6744
6745
|
"Hide details": "Hide details",
|
|
@@ -7037,7 +7038,7 @@ import {
|
|
|
7037
7038
|
useState as useState2
|
|
7038
7039
|
} from "react";
|
|
7039
7040
|
|
|
7040
|
-
// node_modules/uuid/dist/
|
|
7041
|
+
// node_modules/uuid/dist/stringify.js
|
|
7041
7042
|
var byteToHex = [];
|
|
7042
7043
|
for (let i2 = 0; i2 < 256; ++i2) {
|
|
7043
7044
|
byteToHex.push((i2 + 256).toString(16).slice(1));
|
|
@@ -7046,7 +7047,7 @@ function unsafeStringify(arr, offset = 0) {
|
|
|
7046
7047
|
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
7047
7048
|
}
|
|
7048
7049
|
|
|
7049
|
-
// node_modules/uuid/dist/
|
|
7050
|
+
// node_modules/uuid/dist/rng.js
|
|
7050
7051
|
var getRandomValues;
|
|
7051
7052
|
var rnds8 = new Uint8Array(16);
|
|
7052
7053
|
function rng() {
|
|
@@ -7059,15 +7060,12 @@ function rng() {
|
|
|
7059
7060
|
return getRandomValues(rnds8);
|
|
7060
7061
|
}
|
|
7061
7062
|
|
|
7062
|
-
// node_modules/uuid/dist/
|
|
7063
|
+
// node_modules/uuid/dist/native.js
|
|
7063
7064
|
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
7064
7065
|
var native_default = { randomUUID };
|
|
7065
7066
|
|
|
7066
|
-
// node_modules/uuid/dist/
|
|
7067
|
-
function
|
|
7068
|
-
if (native_default.randomUUID && !buf && !options) {
|
|
7069
|
-
return native_default.randomUUID();
|
|
7070
|
-
}
|
|
7067
|
+
// node_modules/uuid/dist/v4.js
|
|
7068
|
+
function _v4(options, buf, offset) {
|
|
7071
7069
|
options = options || {};
|
|
7072
7070
|
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
7073
7071
|
if (rnds.length < 16) {
|
|
@@ -7087,6 +7085,12 @@ function v4(options, buf, offset) {
|
|
|
7087
7085
|
}
|
|
7088
7086
|
return unsafeStringify(rnds);
|
|
7089
7087
|
}
|
|
7088
|
+
function v4(options, buf, offset) {
|
|
7089
|
+
if (native_default.randomUUID && !buf && !options) {
|
|
7090
|
+
return native_default.randomUUID();
|
|
7091
|
+
}
|
|
7092
|
+
return _v4(options, buf, offset);
|
|
7093
|
+
}
|
|
7090
7094
|
var v4_default = v4;
|
|
7091
7095
|
|
|
7092
7096
|
// src/api/checkoutexternal/runtime.ts
|
|
@@ -7474,6 +7478,30 @@ function BillingCreditResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
7474
7478
|
};
|
|
7475
7479
|
}
|
|
7476
7480
|
|
|
7481
|
+
// src/api/checkoutexternal/models/BillingPlanCreditGrantResponseData.ts
|
|
7482
|
+
function BillingPlanCreditGrantResponseDataFromJSON(json) {
|
|
7483
|
+
return BillingPlanCreditGrantResponseDataFromJSONTyped(json, false);
|
|
7484
|
+
}
|
|
7485
|
+
function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
7486
|
+
if (json == null) {
|
|
7487
|
+
return json;
|
|
7488
|
+
}
|
|
7489
|
+
return {
|
|
7490
|
+
createdAt: new Date(json["created_at"]),
|
|
7491
|
+
creditAmount: json["credit_amount"],
|
|
7492
|
+
creditId: json["credit_id"],
|
|
7493
|
+
creditName: json["credit_name"],
|
|
7494
|
+
creditPluralName: json["credit_plural_name"] == null ? void 0 : json["credit_plural_name"],
|
|
7495
|
+
creditSingularName: json["credit_singular_name"] == null ? void 0 : json["credit_singular_name"],
|
|
7496
|
+
id: json["id"],
|
|
7497
|
+
planId: json["plan_id"],
|
|
7498
|
+
planName: json["plan_name"],
|
|
7499
|
+
resetCadence: json["reset_cadence"],
|
|
7500
|
+
resetStart: json["reset_start"],
|
|
7501
|
+
updatedAt: new Date(json["updated_at"])
|
|
7502
|
+
};
|
|
7503
|
+
}
|
|
7504
|
+
|
|
7477
7505
|
// src/api/checkoutexternal/models/BillingProductPriceTierResponseData.ts
|
|
7478
7506
|
function BillingProductPriceTierResponseDataFromJSON(json) {
|
|
7479
7507
|
return BillingProductPriceTierResponseDataFromJSONTyped(json, false);
|
|
@@ -8388,6 +8416,63 @@ function CustomPlanConfigFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8388
8416
|
};
|
|
8389
8417
|
}
|
|
8390
8418
|
|
|
8419
|
+
// src/api/checkoutexternal/models/CreditGrantDetail.ts
|
|
8420
|
+
function CreditGrantDetailFromJSON(json) {
|
|
8421
|
+
return CreditGrantDetailFromJSONTyped(json, false);
|
|
8422
|
+
}
|
|
8423
|
+
function CreditGrantDetailFromJSONTyped(json, ignoreDiscriminator) {
|
|
8424
|
+
if (json == null) {
|
|
8425
|
+
return json;
|
|
8426
|
+
}
|
|
8427
|
+
return {
|
|
8428
|
+
creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
|
|
8429
|
+
expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
|
|
8430
|
+
grantReason: json["grant_reason"],
|
|
8431
|
+
quantity: json["quantity"]
|
|
8432
|
+
};
|
|
8433
|
+
}
|
|
8434
|
+
|
|
8435
|
+
// src/api/checkoutexternal/models/FeatureUsageResponseData.ts
|
|
8436
|
+
function FeatureUsageResponseDataFromJSON(json) {
|
|
8437
|
+
return FeatureUsageResponseDataFromJSONTyped(json, false);
|
|
8438
|
+
}
|
|
8439
|
+
function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
8440
|
+
if (json == null) {
|
|
8441
|
+
return json;
|
|
8442
|
+
}
|
|
8443
|
+
return {
|
|
8444
|
+
access: json["access"],
|
|
8445
|
+
allocation: json["allocation"] == null ? void 0 : json["allocation"],
|
|
8446
|
+
allocationType: json["allocation_type"],
|
|
8447
|
+
companyOverride: json["company_override"] == null ? void 0 : CompanyOverrideResponseDataFromJSON(json["company_override"]),
|
|
8448
|
+
creditConsumptionRate: json["credit_consumption_rate"] == null ? void 0 : json["credit_consumption_rate"],
|
|
8449
|
+
creditGrantCounts: json["credit_grant_counts"] == null ? void 0 : json["credit_grant_counts"],
|
|
8450
|
+
creditGrantDetails: json["credit_grant_details"] == null ? void 0 : json["credit_grant_details"].map(
|
|
8451
|
+
CreditGrantDetailFromJSON
|
|
8452
|
+
),
|
|
8453
|
+
creditGrantReason: json["credit_grant_reason"] == null ? void 0 : json["credit_grant_reason"],
|
|
8454
|
+
creditRemaining: json["credit_remaining"] == null ? void 0 : json["credit_remaining"],
|
|
8455
|
+
creditTotal: json["credit_total"] == null ? void 0 : json["credit_total"],
|
|
8456
|
+
creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
|
|
8457
|
+
creditUsed: json["credit_used"] == null ? void 0 : json["credit_used"],
|
|
8458
|
+
entitlementExpirationDate: json["entitlement_expiration_date"] == null ? void 0 : new Date(json["entitlement_expiration_date"]),
|
|
8459
|
+
entitlementId: json["entitlement_id"],
|
|
8460
|
+
entitlementSource: json["entitlement_source"] == null ? void 0 : json["entitlement_source"],
|
|
8461
|
+
entitlementType: json["entitlement_type"],
|
|
8462
|
+
feature: json["feature"] == null ? void 0 : FeatureDetailResponseDataFromJSON(json["feature"]),
|
|
8463
|
+
metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
|
|
8464
|
+
monthReset: json["month_reset"] == null ? void 0 : json["month_reset"],
|
|
8465
|
+
monthlyUsageBasedPrice: json["monthly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_usage_based_price"]),
|
|
8466
|
+
period: json["period"] == null ? void 0 : json["period"],
|
|
8467
|
+
plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
|
|
8468
|
+
planEntitlement: json["plan_entitlement"] == null ? void 0 : PlanEntitlementResponseDataFromJSON(json["plan_entitlement"]),
|
|
8469
|
+
priceBehavior: json["price_behavior"] == null ? void 0 : json["price_behavior"],
|
|
8470
|
+
softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
|
|
8471
|
+
usage: json["usage"] == null ? void 0 : json["usage"],
|
|
8472
|
+
yearlyUsageBasedPrice: json["yearly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["yearly_usage_based_price"])
|
|
8473
|
+
};
|
|
8474
|
+
}
|
|
8475
|
+
|
|
8391
8476
|
// src/api/checkoutexternal/models/CompanyPlanDetailResponseData.ts
|
|
8392
8477
|
function CompanyPlanDetailResponseDataFromJSON(json) {
|
|
8393
8478
|
return CompanyPlanDetailResponseDataFromJSONTyped(json, false);
|
|
@@ -8430,6 +8515,9 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8430
8515
|
planType: json["plan_type"],
|
|
8431
8516
|
trialDays: json["trial_days"] == null ? void 0 : json["trial_days"],
|
|
8432
8517
|
updatedAt: new Date(json["updated_at"]),
|
|
8518
|
+
usageViolations: json["usage_violations"].map(
|
|
8519
|
+
FeatureUsageResponseDataFromJSON
|
|
8520
|
+
),
|
|
8433
8521
|
valid: json["valid"],
|
|
8434
8522
|
yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["yearly_price"])
|
|
8435
8523
|
};
|
|
@@ -8529,6 +8617,9 @@ function PlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8529
8617
|
),
|
|
8530
8618
|
icon: json["icon"],
|
|
8531
8619
|
id: json["id"],
|
|
8620
|
+
includedCreditGrants: json["included_credit_grants"] == null ? void 0 : json["included_credit_grants"].map(
|
|
8621
|
+
BillingPlanCreditGrantResponseDataFromJSON
|
|
8622
|
+
),
|
|
8532
8623
|
isDefault: json["is_default"],
|
|
8533
8624
|
isFree: json["is_free"],
|
|
8534
8625
|
isTrialable: json["is_trialable"],
|
|
@@ -8640,62 +8731,6 @@ function ComponentResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8640
8731
|
};
|
|
8641
8732
|
}
|
|
8642
8733
|
|
|
8643
|
-
// src/api/checkoutexternal/models/CreditGrantDetail.ts
|
|
8644
|
-
function CreditGrantDetailFromJSON(json) {
|
|
8645
|
-
return CreditGrantDetailFromJSONTyped(json, false);
|
|
8646
|
-
}
|
|
8647
|
-
function CreditGrantDetailFromJSONTyped(json, ignoreDiscriminator) {
|
|
8648
|
-
if (json == null) {
|
|
8649
|
-
return json;
|
|
8650
|
-
}
|
|
8651
|
-
return {
|
|
8652
|
-
creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
|
|
8653
|
-
expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
|
|
8654
|
-
grantReason: json["grant_reason"],
|
|
8655
|
-
quantity: json["quantity"]
|
|
8656
|
-
};
|
|
8657
|
-
}
|
|
8658
|
-
|
|
8659
|
-
// src/api/checkoutexternal/models/FeatureUsageResponseData.ts
|
|
8660
|
-
function FeatureUsageResponseDataFromJSON(json) {
|
|
8661
|
-
return FeatureUsageResponseDataFromJSONTyped(json, false);
|
|
8662
|
-
}
|
|
8663
|
-
function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
8664
|
-
if (json == null) {
|
|
8665
|
-
return json;
|
|
8666
|
-
}
|
|
8667
|
-
return {
|
|
8668
|
-
access: json["access"],
|
|
8669
|
-
allocation: json["allocation"] == null ? void 0 : json["allocation"],
|
|
8670
|
-
allocationType: json["allocation_type"],
|
|
8671
|
-
companyOverride: json["company_override"] == null ? void 0 : CompanyOverrideResponseDataFromJSON(json["company_override"]),
|
|
8672
|
-
creditGrantCounts: json["credit_grant_counts"] == null ? void 0 : json["credit_grant_counts"],
|
|
8673
|
-
creditGrantDetails: json["credit_grant_details"] == null ? void 0 : json["credit_grant_details"].map(
|
|
8674
|
-
CreditGrantDetailFromJSON
|
|
8675
|
-
),
|
|
8676
|
-
creditGrantReason: json["credit_grant_reason"] == null ? void 0 : json["credit_grant_reason"],
|
|
8677
|
-
creditRemaining: json["credit_remaining"] == null ? void 0 : json["credit_remaining"],
|
|
8678
|
-
creditTotal: json["credit_total"] == null ? void 0 : json["credit_total"],
|
|
8679
|
-
creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
|
|
8680
|
-
creditUsed: json["credit_used"] == null ? void 0 : json["credit_used"],
|
|
8681
|
-
entitlementExpirationDate: json["entitlement_expiration_date"] == null ? void 0 : new Date(json["entitlement_expiration_date"]),
|
|
8682
|
-
entitlementId: json["entitlement_id"],
|
|
8683
|
-
entitlementSource: json["entitlement_source"] == null ? void 0 : json["entitlement_source"],
|
|
8684
|
-
entitlementType: json["entitlement_type"],
|
|
8685
|
-
feature: json["feature"] == null ? void 0 : FeatureDetailResponseDataFromJSON(json["feature"]),
|
|
8686
|
-
metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
|
|
8687
|
-
monthReset: json["month_reset"] == null ? void 0 : json["month_reset"],
|
|
8688
|
-
monthlyUsageBasedPrice: json["monthly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_usage_based_price"]),
|
|
8689
|
-
period: json["period"] == null ? void 0 : json["period"],
|
|
8690
|
-
plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
|
|
8691
|
-
planEntitlement: json["plan_entitlement"] == null ? void 0 : PlanEntitlementResponseDataFromJSON(json["plan_entitlement"]),
|
|
8692
|
-
priceBehavior: json["price_behavior"] == null ? void 0 : json["price_behavior"],
|
|
8693
|
-
softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
|
|
8694
|
-
usage: json["usage"] == null ? void 0 : json["usage"],
|
|
8695
|
-
yearlyUsageBasedPrice: json["yearly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["yearly_usage_based_price"])
|
|
8696
|
-
};
|
|
8697
|
-
}
|
|
8698
|
-
|
|
8699
8734
|
// src/api/checkoutexternal/models/FeatureUsageDetailResponseData.ts
|
|
8700
8735
|
function FeatureUsageDetailResponseDataFromJSON(json) {
|
|
8701
8736
|
return FeatureUsageDetailResponseDataFromJSONTyped(json, false);
|
|
@@ -8745,6 +8780,7 @@ function ComponentHydrateResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8745
8780
|
defaultPlan: json["default_plan"] == null ? void 0 : PlanDetailResponseDataFromJSON(json["default_plan"]),
|
|
8746
8781
|
featureUsage: json["feature_usage"] == null ? void 0 : FeatureUsageDetailResponseDataFromJSON(json["feature_usage"]),
|
|
8747
8782
|
showPeriodToggle: json["show_period_toggle"],
|
|
8783
|
+
showZeroPriceAsFree: json["show_zero_price_as_free"],
|
|
8748
8784
|
stripeEmbed: json["stripe_embed"] == null ? void 0 : StripeEmbedInfoFromJSON(json["stripe_embed"]),
|
|
8749
8785
|
subscription: json["subscription"] == null ? void 0 : CompanySubscriptionResponseDataFromJSON(json["subscription"]),
|
|
8750
8786
|
trialPaymentMethodRequired: json["trial_payment_method_required"] == null ? void 0 : json["trial_payment_method_required"],
|
|
@@ -10297,7 +10333,8 @@ function PublicPlansResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10297
10333
|
CompatiblePlansFromJSON2
|
|
10298
10334
|
),
|
|
10299
10335
|
capabilities: json["capabilities"] == null ? void 0 : ComponentCapabilitiesFromJSON2(json["capabilities"]),
|
|
10300
|
-
showPeriodToggle: json["show_period_toggle"]
|
|
10336
|
+
showPeriodToggle: json["show_period_toggle"],
|
|
10337
|
+
showZeroPriceAsFree: json["show_zero_price_as_free"]
|
|
10301
10338
|
};
|
|
10302
10339
|
}
|
|
10303
10340
|
|
|
@@ -10495,7 +10532,7 @@ var EmbedProvider = ({
|
|
|
10495
10532
|
});
|
|
10496
10533
|
const customHeaders = useMemo3(
|
|
10497
10534
|
() => ({
|
|
10498
|
-
"X-Schematic-Components-Version": "1.
|
|
10535
|
+
"X-Schematic-Components-Version": "1.6.1",
|
|
10499
10536
|
"X-Schematic-Session-ID": sessionIdRef.current
|
|
10500
10537
|
}),
|
|
10501
10538
|
[]
|
|
@@ -10761,17 +10798,15 @@ var EmbedProvider = ({
|
|
|
10761
10798
|
const colorMode = darkModeQuery.matches ? "dark" : "light";
|
|
10762
10799
|
dispatch({
|
|
10763
10800
|
type: "UPDATE_SETTINGS",
|
|
10764
|
-
settings: {
|
|
10765
|
-
|
|
10766
|
-
colorMode
|
|
10767
|
-
}
|
|
10768
|
-
}
|
|
10801
|
+
settings: { theme: { colorMode } },
|
|
10802
|
+
update: true
|
|
10769
10803
|
});
|
|
10770
10804
|
function darkModeQueryHandler(event) {
|
|
10771
10805
|
const newColorMode = event.matches ? "dark" : "light";
|
|
10772
10806
|
dispatch({
|
|
10773
10807
|
type: "UPDATE_SETTINGS",
|
|
10774
|
-
settings: { theme: { colorMode: newColorMode } }
|
|
10808
|
+
settings: { theme: { colorMode: newColorMode } },
|
|
10809
|
+
update: true
|
|
10775
10810
|
});
|
|
10776
10811
|
}
|
|
10777
10812
|
darkModeQuery.addEventListener("change", darkModeQueryHandler);
|
|
@@ -10824,8 +10859,9 @@ var EmbedProvider = ({
|
|
|
10824
10859
|
}
|
|
10825
10860
|
}, [state.accessToken, apiConfig, customHeaders]);
|
|
10826
10861
|
useEffect2(() => {
|
|
10827
|
-
|
|
10828
|
-
|
|
10862
|
+
if (options.settings) {
|
|
10863
|
+
updateSettings(options.settings, { update: true });
|
|
10864
|
+
}
|
|
10829
10865
|
}, [options.settings, updateSettings]);
|
|
10830
10866
|
useEffect2(() => {
|
|
10831
10867
|
function planChangedHandler(event) {
|
|
@@ -12730,6 +12766,10 @@ var Sidebar = ({
|
|
|
12730
12766
|
() => creditBundles.filter((bundle) => bundle.count > 0),
|
|
12731
12767
|
[creditBundles]
|
|
12732
12768
|
);
|
|
12769
|
+
const discountApplied = useMemo7(
|
|
12770
|
+
() => promoCode && (amountOff > 0 || percentOff > 0),
|
|
12771
|
+
[promoCode, amountOff, percentOff]
|
|
12772
|
+
);
|
|
12733
12773
|
const handleCheckout = useCallback8(async () => {
|
|
12734
12774
|
const planId = selectedPlan?.id;
|
|
12735
12775
|
const priceId = (planPeriod === "year" ? selectedPlan?.yearlyPrice : selectedPlan?.monthlyPrice)?.id;
|
|
@@ -12796,7 +12836,7 @@ var Sidebar = ({
|
|
|
12796
12836
|
},
|
|
12797
12837
|
[]
|
|
12798
12838
|
),
|
|
12799
|
-
skipTrial: !
|
|
12839
|
+
skipTrial: !shouldTrial,
|
|
12800
12840
|
...paymentMethodId && { paymentMethodId },
|
|
12801
12841
|
...promoCode && { promoCode }
|
|
12802
12842
|
});
|
|
@@ -12822,7 +12862,7 @@ var Sidebar = ({
|
|
|
12822
12862
|
setLayout,
|
|
12823
12863
|
payInAdvanceEntitlements,
|
|
12824
12864
|
addOnUsageBasedEntitlements,
|
|
12825
|
-
|
|
12865
|
+
shouldTrial,
|
|
12826
12866
|
promoCode
|
|
12827
12867
|
]);
|
|
12828
12868
|
const handleUnsubscribe = useCallback8(async () => {
|
|
@@ -13199,7 +13239,7 @@ var Sidebar = ({
|
|
|
13199
13239
|
$width: "100%",
|
|
13200
13240
|
$padding: "1.5rem",
|
|
13201
13241
|
children: [
|
|
13202
|
-
|
|
13242
|
+
discountApplied && /* @__PURE__ */ jsxs9(
|
|
13203
13243
|
Flex,
|
|
13204
13244
|
{
|
|
13205
13245
|
$justifyContent: "space-between",
|
|
@@ -13871,10 +13911,18 @@ var Plan = ({
|
|
|
13871
13911
|
const [entitlementCounts, setEntitlementCounts] = useState8(
|
|
13872
13912
|
() => plans.reduce(entitlementCountsReducer, {})
|
|
13873
13913
|
);
|
|
13874
|
-
const isTrialing = useMemo8(
|
|
13875
|
-
(
|
|
13876
|
-
|
|
13877
|
-
|
|
13914
|
+
const { isTrialing, showZeroPriceAsFree } = useMemo8(() => {
|
|
13915
|
+
if (isCheckoutData(data)) {
|
|
13916
|
+
return {
|
|
13917
|
+
isTrialing: data.subscription?.status === "trialing",
|
|
13918
|
+
showZeroPriceAsFree: data.showZeroPriceAsFree
|
|
13919
|
+
};
|
|
13920
|
+
}
|
|
13921
|
+
return {
|
|
13922
|
+
isTrialing: false,
|
|
13923
|
+
showZeroPriceAsFree: false
|
|
13924
|
+
};
|
|
13925
|
+
}, [data]);
|
|
13878
13926
|
const handleToggleShowAll = (id) => {
|
|
13879
13927
|
setEntitlementCounts((prev2) => {
|
|
13880
13928
|
const count = prev2[id] ? { ...prev2[id] } : void 0;
|
|
@@ -13908,7 +13956,8 @@ var Plan = ({
|
|
|
13908
13956
|
const hasUsageBasedEntitlements = plan.entitlements.some(
|
|
13909
13957
|
(entitlement) => !!entitlement.priceBehavior
|
|
13910
13958
|
);
|
|
13911
|
-
const
|
|
13959
|
+
const isFreePlan = planPrice === 0;
|
|
13960
|
+
const isUsageBasedPlan = isFreePlan && hasUsageBasedEntitlements;
|
|
13912
13961
|
const headerPriceFontStyle = settings.theme.typography.heading2;
|
|
13913
13962
|
const count = entitlementCounts[plan.id];
|
|
13914
13963
|
const isExpanded = count && count.limit > VISIBLE_ENTITLEMENT_COUNT;
|
|
@@ -13953,10 +14002,10 @@ var Plan = ({
|
|
|
13953
14002
|
$size: headerPriceFontStyle.fontSize,
|
|
13954
14003
|
$weight: headerPriceFontStyle.fontWeight,
|
|
13955
14004
|
$color: headerPriceFontStyle.color,
|
|
13956
|
-
children: plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : formatCurrency(planPrice ?? 0, planCurrency)
|
|
14005
|
+
children: plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : isFreePlan && showZeroPriceAsFree ? t2("Free") : formatCurrency(planPrice ?? 0, planCurrency)
|
|
13957
14006
|
}
|
|
13958
14007
|
),
|
|
13959
|
-
!plan.custom && !
|
|
14008
|
+
!plan.custom && !isFreePlan && /* @__PURE__ */ jsxs14(
|
|
13960
14009
|
Text,
|
|
13961
14010
|
{
|
|
13962
14011
|
display: "heading2",
|
|
@@ -15162,7 +15211,7 @@ var Label = dt.label`
|
|
|
15162
15211
|
transition:
|
|
15163
15212
|
transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
|
|
15164
15213
|
opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
|
|
15165
|
-
color: #cdd6f4;
|
|
15214
|
+
color: ${({ theme }) => theme.colorMode === "dark" ? "#cdd6f4" : "#000000"};
|
|
15166
15215
|
touch-action: manipulation;
|
|
15167
15216
|
`;
|
|
15168
15217
|
var Input2 = dt.input`
|
|
@@ -16782,7 +16831,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16782
16831
|
)
|
|
16783
16832
|
);
|
|
16784
16833
|
}, []);
|
|
16785
|
-
const shouldShowFeatures = meteredFeatures.length > 0;
|
|
16834
|
+
const shouldShowFeatures = meteredFeatures.length > 0 || creditGroups.length > 0;
|
|
16786
16835
|
if (!shouldShowFeatures) {
|
|
16787
16836
|
return null;
|
|
16788
16837
|
}
|
|
@@ -17937,6 +17986,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17937
17986
|
canCheckout,
|
|
17938
17987
|
defaultPlan,
|
|
17939
17988
|
featureUsage,
|
|
17989
|
+
showZeroPriceAsFree,
|
|
17940
17990
|
trialPaymentMethodRequired
|
|
17941
17991
|
} = useMemo23(() => {
|
|
17942
17992
|
if (isCheckoutData(data)) {
|
|
@@ -17947,6 +17997,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17947
17997
|
capabilities,
|
|
17948
17998
|
defaultPlan: defaultPlan2,
|
|
17949
17999
|
featureUsage: featureUsage2,
|
|
18000
|
+
showZeroPriceAsFree: showZeroPriceAsFree2,
|
|
17950
18001
|
trialPaymentMethodRequired: trialPaymentMethodRequired2
|
|
17951
18002
|
} = data;
|
|
17952
18003
|
const creditGroups2 = groupCreditGrants(creditGrants, {
|
|
@@ -17976,6 +18027,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17976
18027
|
canCheckout: capabilities?.checkout ?? true,
|
|
17977
18028
|
defaultPlan: defaultPlan2,
|
|
17978
18029
|
featureUsage: featureUsage2?.features || [],
|
|
18030
|
+
showZeroPriceAsFree: showZeroPriceAsFree2,
|
|
17979
18031
|
trialPaymentMethodRequired: trialPaymentMethodRequired2
|
|
17980
18032
|
};
|
|
17981
18033
|
}
|
|
@@ -17988,6 +18040,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17988
18040
|
canCheckout: false,
|
|
17989
18041
|
defaultPlan: void 0,
|
|
17990
18042
|
featureUsage: [],
|
|
18043
|
+
showZeroPriceAsFree: false,
|
|
17991
18044
|
trialPaymentMethodRequired: false
|
|
17992
18045
|
};
|
|
17993
18046
|
}, [data]);
|
|
@@ -18012,7 +18065,8 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
18012
18065
|
willSubscriptionCancel: willSubscriptionCancel2
|
|
18013
18066
|
};
|
|
18014
18067
|
}, [billingSubscription]);
|
|
18015
|
-
const
|
|
18068
|
+
const isFreePlan = currentPlan?.planPrice === 0;
|
|
18069
|
+
const isUsageBasedPlan = isFreePlan && usageBasedEntitlements.length > 0;
|
|
18016
18070
|
return /* @__PURE__ */ jsxs34(Fragment20, { children: [
|
|
18017
18071
|
isTrialSubscription && !willSubscriptionCancel ? /* @__PURE__ */ jsxs34(
|
|
18018
18072
|
Notice,
|
|
@@ -18086,13 +18140,13 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
18086
18140
|
Text,
|
|
18087
18141
|
{
|
|
18088
18142
|
display: isUsageBasedPlan ? "heading3" : props.header.price.fontStyle,
|
|
18089
|
-
children: isUsageBasedPlan ? t2("Usage-based") : formatCurrency(
|
|
18143
|
+
children: isUsageBasedPlan ? t2("Usage-based") : isFreePlan && showZeroPriceAsFree ? t2("Free") : formatCurrency(
|
|
18090
18144
|
currentPlan.planPrice,
|
|
18091
18145
|
subscriptionCurrency
|
|
18092
18146
|
)
|
|
18093
18147
|
}
|
|
18094
18148
|
),
|
|
18095
|
-
!
|
|
18149
|
+
!isFreePlan && /* @__PURE__ */ jsx43(Text, { display: props.header.price.fontStyle, children: /* @__PURE__ */ jsxs34("sub", { children: [
|
|
18096
18150
|
"/",
|
|
18097
18151
|
shortenPeriod(currentPlan.planPeriod)
|
|
18098
18152
|
] }) })
|
|
@@ -18657,7 +18711,8 @@ var Plan2 = ({
|
|
|
18657
18711
|
isTrialSubscription,
|
|
18658
18712
|
willSubscriptionCancel,
|
|
18659
18713
|
isStandalone,
|
|
18660
|
-
showCallToAction
|
|
18714
|
+
showCallToAction,
|
|
18715
|
+
showZeroPriceAsFree
|
|
18661
18716
|
} = useMemo25(() => {
|
|
18662
18717
|
if (isCheckoutData(data)) {
|
|
18663
18718
|
const billingSubscription = data.company?.billingSubscription;
|
|
@@ -18669,7 +18724,8 @@ var Plan2 = ({
|
|
|
18669
18724
|
isTrialSubscription: isTrialSubscription2,
|
|
18670
18725
|
willSubscriptionCancel: willSubscriptionCancel2,
|
|
18671
18726
|
isStandalone: false,
|
|
18672
|
-
showCallToAction: true
|
|
18727
|
+
showCallToAction: true,
|
|
18728
|
+
showZeroPriceAsFree: data.showZeroPriceAsFree
|
|
18673
18729
|
};
|
|
18674
18730
|
}
|
|
18675
18731
|
return {
|
|
@@ -18678,7 +18734,8 @@ var Plan2 = ({
|
|
|
18678
18734
|
isTrialSubscription: false,
|
|
18679
18735
|
willSubscriptionCancel: false,
|
|
18680
18736
|
isStandalone: true,
|
|
18681
|
-
showCallToAction: typeof sharedProps.callToActionUrl === "string" || typeof sharedProps.onCallToAction === "function"
|
|
18737
|
+
showCallToAction: typeof sharedProps.callToActionUrl === "string" || typeof sharedProps.onCallToAction === "function",
|
|
18738
|
+
showZeroPriceAsFree: false
|
|
18682
18739
|
};
|
|
18683
18740
|
}, [data, sharedProps.callToActionUrl, sharedProps.onCallToAction]);
|
|
18684
18741
|
const callToActionTarget = useMemo25(() => {
|
|
@@ -18706,7 +18763,8 @@ var Plan2 = ({
|
|
|
18706
18763
|
const hasUsageBasedEntitlements = plan.entitlements.some(
|
|
18707
18764
|
(entitlement) => !!entitlement.priceBehavior
|
|
18708
18765
|
);
|
|
18709
|
-
const
|
|
18766
|
+
const isFreePlan = planPrice === 0;
|
|
18767
|
+
const isUsageBasedPlan = isFreePlan && hasUsageBasedEntitlements;
|
|
18710
18768
|
const headerPriceFontStyle = settings.theme.typography[layout.plans.name.fontStyle];
|
|
18711
18769
|
const count = entitlementCounts[plan.id];
|
|
18712
18770
|
const isExpanded = count && count.limit > VISIBLE_ENTITLEMENT_COUNT;
|
|
@@ -18748,8 +18806,8 @@ var Plan2 = ({
|
|
|
18748
18806
|
$weight: headerPriceFontStyle.fontWeight,
|
|
18749
18807
|
$color: headerPriceFontStyle.color,
|
|
18750
18808
|
children: [
|
|
18751
|
-
plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : formatCurrency(planPrice ?? 0, planCurrency),
|
|
18752
|
-
!plan.custom && !
|
|
18809
|
+
plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : isFreePlan && showZeroPriceAsFree ? t2("Free") : formatCurrency(planPrice ?? 0, planCurrency),
|
|
18810
|
+
!plan.custom && !isFreePlan && /* @__PURE__ */ jsxs37("sub", { children: [
|
|
18753
18811
|
"/",
|
|
18754
18812
|
selectedPeriod
|
|
18755
18813
|
] })
|
|
@@ -18970,14 +19028,14 @@ var resolveDesignProps8 = (props) => {
|
|
|
18970
19028
|
},
|
|
18971
19029
|
showInclusionText: props.plans?.showInclusionText ?? true,
|
|
18972
19030
|
showFeatureIcons: props.plans?.showFeatureIcons ?? true,
|
|
18973
|
-
showFeatureDescriptions: props.plans?.showFeatureDescriptions ??
|
|
19031
|
+
showFeatureDescriptions: props.plans?.showFeatureDescriptions ?? false,
|
|
18974
19032
|
showEntitlements: props.plans?.showEntitlements ?? true
|
|
18975
19033
|
},
|
|
18976
19034
|
addOns: {
|
|
18977
19035
|
isVisible: props.addOns?.isVisible ?? true,
|
|
18978
19036
|
showDescription: props.addOns?.showDescription ?? true,
|
|
18979
19037
|
showFeatureIcons: props.addOns?.showFeatureIcons ?? true,
|
|
18980
|
-
showFeatureDescriptions: props.plans?.showFeatureDescriptions ??
|
|
19038
|
+
showFeatureDescriptions: props.plans?.showFeatureDescriptions ?? false,
|
|
18981
19039
|
showEntitlements: props.addOns?.showEntitlements ?? true
|
|
18982
19040
|
},
|
|
18983
19041
|
upgrade: {
|
|
@@ -23819,7 +23877,10 @@ var SchematicEmbed = ({ id, accessToken }) => {
|
|
|
23819
23877
|
);
|
|
23820
23878
|
const ast = getEditorState(json);
|
|
23821
23879
|
if (ast) {
|
|
23822
|
-
|
|
23880
|
+
const settings = ast.ROOT.props.settings;
|
|
23881
|
+
const { colorMode, ...theme2 } = settings.theme;
|
|
23882
|
+
const updated = { mode: settings.mode, theme: theme2, badge: settings.badge };
|
|
23883
|
+
updateSettings(updated, { update: true });
|
|
23823
23884
|
nodes.push(...parseEditorState(ast));
|
|
23824
23885
|
setChildren(nodes.map(renderer));
|
|
23825
23886
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematichq/schematic-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"main": "dist/schematic-components.cjs.js",
|
|
5
5
|
"module": "dist/schematic-components.esm.js",
|
|
6
6
|
"types": "dist/schematic-components.d.ts",
|
|
@@ -34,32 +34,32 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@schematichq/schematic-icons": "^0.5.2",
|
|
36
36
|
"@stripe/stripe-js": "^7.9.0",
|
|
37
|
-
"i18next": "^25.5.
|
|
37
|
+
"i18next": "^25.5.2",
|
|
38
38
|
"lodash": "^4.17.21",
|
|
39
39
|
"pako": "^2.1.0",
|
|
40
40
|
"react-i18next": "^15.7.3",
|
|
41
41
|
"styled-components": "^6.1.19",
|
|
42
|
-
"uuid": "^
|
|
42
|
+
"uuid": "^13.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@eslint/js": "^9.
|
|
45
|
+
"@eslint/js": "^9.35.0",
|
|
46
46
|
"@eslint/json": "^0.13.2",
|
|
47
47
|
"@eslint/markdown": "^7.2.0",
|
|
48
|
-
"@microsoft/api-extractor": "^7.52.
|
|
48
|
+
"@microsoft/api-extractor": "^7.52.12",
|
|
49
49
|
"@openapitools/openapi-generator-cli": "^2.23.1",
|
|
50
|
-
"@stripe/react-stripe-js": "^4.0.
|
|
50
|
+
"@stripe/react-stripe-js": "^4.0.2",
|
|
51
51
|
"@types/jest": "^30.0.0",
|
|
52
52
|
"@types/lodash": "^4.17.20",
|
|
53
53
|
"@types/pako": "^2.0.4",
|
|
54
54
|
"@types/react": "^19.1.12",
|
|
55
55
|
"@types/react-dom": "^19.1.9",
|
|
56
56
|
"esbuild": "^0.25.9",
|
|
57
|
-
"eslint": "^9.
|
|
57
|
+
"eslint": "^9.35.0",
|
|
58
58
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
59
59
|
"eslint-plugin-import": "^2.32.0",
|
|
60
60
|
"eslint-plugin-react": "^7.37.5",
|
|
61
61
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
62
|
-
"globals": "^16.
|
|
62
|
+
"globals": "^16.4.0",
|
|
63
63
|
"jest": "^30.1.3",
|
|
64
64
|
"jest-environment-jsdom": "^30.1.2",
|
|
65
65
|
"jest-esbuild": "^0.4.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"react-dom": "^19.1.1",
|
|
70
70
|
"ts-jest": "^29.4.1",
|
|
71
71
|
"typescript": "^5.9.2",
|
|
72
|
-
"typescript-eslint": "^8.
|
|
72
|
+
"typescript-eslint": "^8.43.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@stripe/react-stripe-js": ">=3",
|