@schematichq/schematic-components 2.32.0 → 2.33.0
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-elements.cjs.js +838 -258
- package/dist/schematic-components-elements.d.ts +174 -10
- package/dist/schematic-components-elements.esm.js +805 -220
- package/dist/schematic-components.browser.cjs.js +247 -32
- package/dist/schematic-components.browser.esm.js +247 -32
- package/dist/schematic-components.cjs.js +247 -32
- package/dist/schematic-components.d.ts +127 -0
- package/dist/schematic-components.esm.js +247 -32
- package/package.json +6 -6
|
@@ -5440,6 +5440,132 @@ function CompanyBillingProfileResponseDataFromJSONTyped(json, ignoreDiscriminato
|
|
|
5440
5440
|
};
|
|
5441
5441
|
}
|
|
5442
5442
|
|
|
5443
|
+
// src/api/checkoutexternal/models/CustomPlanActivationStrategy.ts
|
|
5444
|
+
var CustomPlanActivationStrategy = {
|
|
5445
|
+
Payment: "on_payment",
|
|
5446
|
+
Publish: "on_publish"
|
|
5447
|
+
};
|
|
5448
|
+
function CustomPlanActivationStrategyFromJSON(json) {
|
|
5449
|
+
return CustomPlanActivationStrategyFromJSONTyped(json, false);
|
|
5450
|
+
}
|
|
5451
|
+
function CustomPlanActivationStrategyFromJSONTyped(json, ignoreDiscriminator) {
|
|
5452
|
+
return json;
|
|
5453
|
+
}
|
|
5454
|
+
|
|
5455
|
+
// src/api/checkoutexternal/models/CompanyContextCustomPlanBillingResponseData.ts
|
|
5456
|
+
function CompanyContextCustomPlanBillingResponseDataFromJSON(json) {
|
|
5457
|
+
return CompanyContextCustomPlanBillingResponseDataFromJSONTyped(json, false);
|
|
5458
|
+
}
|
|
5459
|
+
function CompanyContextCustomPlanBillingResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
5460
|
+
if (json == null) {
|
|
5461
|
+
return json;
|
|
5462
|
+
}
|
|
5463
|
+
return {
|
|
5464
|
+
activationStrategy: CustomPlanActivationStrategyFromJSON(
|
|
5465
|
+
json["activation_strategy"]
|
|
5466
|
+
),
|
|
5467
|
+
dueAt: new Date(json["due_at"]),
|
|
5468
|
+
invoiceUrl: json["invoice_url"] == null ? void 0 : json["invoice_url"],
|
|
5469
|
+
planId: json["plan_id"],
|
|
5470
|
+
planName: json["plan_name"] == null ? void 0 : json["plan_name"]
|
|
5471
|
+
};
|
|
5472
|
+
}
|
|
5473
|
+
|
|
5474
|
+
// src/api/checkoutexternal/models/CompanyContextPlanResponseData.ts
|
|
5475
|
+
function CompanyContextPlanResponseDataFromJSON(json) {
|
|
5476
|
+
return CompanyContextPlanResponseDataFromJSONTyped(json, false);
|
|
5477
|
+
}
|
|
5478
|
+
function CompanyContextPlanResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
5479
|
+
if (json == null) {
|
|
5480
|
+
return json;
|
|
5481
|
+
}
|
|
5482
|
+
return {
|
|
5483
|
+
description: json["description"] == null ? void 0 : json["description"],
|
|
5484
|
+
id: json["id"],
|
|
5485
|
+
includedCreditIds: json["included_credit_ids"],
|
|
5486
|
+
name: json["name"],
|
|
5487
|
+
period: json["period"] == null ? void 0 : json["period"],
|
|
5488
|
+
price: json["price"] == null ? void 0 : json["price"]
|
|
5489
|
+
};
|
|
5490
|
+
}
|
|
5491
|
+
|
|
5492
|
+
// src/api/checkoutexternal/models/CompanyContextScheduledDowngradeResponseData.ts
|
|
5493
|
+
function CompanyContextScheduledDowngradeResponseDataFromJSON(json) {
|
|
5494
|
+
return CompanyContextScheduledDowngradeResponseDataFromJSONTyped(json, false);
|
|
5495
|
+
}
|
|
5496
|
+
function CompanyContextScheduledDowngradeResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
5497
|
+
if (json == null) {
|
|
5498
|
+
return json;
|
|
5499
|
+
}
|
|
5500
|
+
return {
|
|
5501
|
+
fromPlanId: json["from_plan_id"],
|
|
5502
|
+
fromPlanName: json["from_plan_name"],
|
|
5503
|
+
toPlanId: json["to_plan_id"],
|
|
5504
|
+
toPlanName: json["to_plan_name"]
|
|
5505
|
+
};
|
|
5506
|
+
}
|
|
5507
|
+
|
|
5508
|
+
// src/api/checkoutexternal/models/CompanyContextSubscriptionResponseData.ts
|
|
5509
|
+
function CompanyContextSubscriptionResponseDataFromJSON(json) {
|
|
5510
|
+
return CompanyContextSubscriptionResponseDataFromJSONTyped(json, false);
|
|
5511
|
+
}
|
|
5512
|
+
function CompanyContextSubscriptionResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
5513
|
+
if (json == null) {
|
|
5514
|
+
return json;
|
|
5515
|
+
}
|
|
5516
|
+
return {
|
|
5517
|
+
cancelAt: json["cancel_at"] == null ? void 0 : new Date(json["cancel_at"]),
|
|
5518
|
+
cancelAtPeriodEnd: json["cancel_at_period_end"],
|
|
5519
|
+
currency: CurrencyFromJSON(json["currency"]),
|
|
5520
|
+
nextBillAt: json["next_bill_at"] == null ? void 0 : new Date(json["next_bill_at"]),
|
|
5521
|
+
period: json["period"] == null ? void 0 : json["period"],
|
|
5522
|
+
periodEnd: json["period_end"] == null ? void 0 : new Date(json["period_end"]),
|
|
5523
|
+
status: json["status"],
|
|
5524
|
+
trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"])
|
|
5525
|
+
};
|
|
5526
|
+
}
|
|
5527
|
+
|
|
5528
|
+
// src/api/checkoutexternal/models/CompanyContextResponseData.ts
|
|
5529
|
+
function CompanyContextResponseDataFromJSON(json) {
|
|
5530
|
+
return CompanyContextResponseDataFromJSONTyped(json, false);
|
|
5531
|
+
}
|
|
5532
|
+
function CompanyContextResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
5533
|
+
if (json == null) {
|
|
5534
|
+
return json;
|
|
5535
|
+
}
|
|
5536
|
+
return {
|
|
5537
|
+
addOns: json["add_ons"].map(
|
|
5538
|
+
CompanyContextPlanResponseDataFromJSON
|
|
5539
|
+
),
|
|
5540
|
+
customPlanBilling: json["custom_plan_billing"] == null ? void 0 : CompanyContextCustomPlanBillingResponseDataFromJSON(
|
|
5541
|
+
json["custom_plan_billing"]
|
|
5542
|
+
),
|
|
5543
|
+
id: json["id"],
|
|
5544
|
+
name: json["name"],
|
|
5545
|
+
plan: json["plan"] == null ? void 0 : CompanyContextPlanResponseDataFromJSON(json["plan"]),
|
|
5546
|
+
scheduledDowngrade: json["scheduled_downgrade"] == null ? void 0 : CompanyContextScheduledDowngradeResponseDataFromJSON(
|
|
5547
|
+
json["scheduled_downgrade"]
|
|
5548
|
+
),
|
|
5549
|
+
subscription: json["subscription"] == null ? void 0 : CompanyContextSubscriptionResponseDataFromJSON(json["subscription"])
|
|
5550
|
+
};
|
|
5551
|
+
}
|
|
5552
|
+
|
|
5553
|
+
// src/api/checkoutexternal/models/CompanyCreditAutoTopupResponseData.ts
|
|
5554
|
+
function CompanyCreditAutoTopupResponseDataFromJSON(json) {
|
|
5555
|
+
return CompanyCreditAutoTopupResponseDataFromJSONTyped(json, false);
|
|
5556
|
+
}
|
|
5557
|
+
function CompanyCreditAutoTopupResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
5558
|
+
if (json == null) {
|
|
5559
|
+
return json;
|
|
5560
|
+
}
|
|
5561
|
+
return {
|
|
5562
|
+
amount: json["amount"] == null ? void 0 : json["amount"],
|
|
5563
|
+
enabled: json["enabled"],
|
|
5564
|
+
selfService: json["self_service"],
|
|
5565
|
+
thresholdCredits: json["threshold_credits"] == null ? void 0 : json["threshold_credits"]
|
|
5566
|
+
};
|
|
5567
|
+
}
|
|
5568
|
+
|
|
5443
5569
|
// src/api/checkoutexternal/models/CompanyCreditGrantResponseData.ts
|
|
5444
5570
|
function CompanyCreditGrantResponseDataFromJSON(json) {
|
|
5445
5571
|
return CompanyCreditGrantResponseDataFromJSONTyped(json, false);
|
|
@@ -5497,6 +5623,7 @@ function CompanyCreditBalanceResponseDataFromJSONTyped(json, ignoreDiscriminator
|
|
|
5497
5623
|
return json;
|
|
5498
5624
|
}
|
|
5499
5625
|
return {
|
|
5626
|
+
autoTopup: json["auto_topup"] == null ? void 0 : CompanyCreditAutoTopupResponseDataFromJSON(json["auto_topup"]),
|
|
5500
5627
|
composition: json["composition"] == null ? void 0 : CompanyCreditCompositionResponseDataFromJSON(json["composition"]),
|
|
5501
5628
|
creditDescription: json["credit_description"],
|
|
5502
5629
|
creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
|
|
@@ -5773,6 +5900,7 @@ function FeatureEntitlementFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
5773
5900
|
metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON(json["metric_period"]),
|
|
5774
5901
|
metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
|
|
5775
5902
|
monthReset: json["month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["month_reset"]),
|
|
5903
|
+
quantityRates: json["quantity_rates"] == null ? void 0 : json["quantity_rates"],
|
|
5776
5904
|
softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
|
|
5777
5905
|
usage: json["usage"] == null ? void 0 : json["usage"],
|
|
5778
5906
|
valueType: EntitlementValueTypeFromJSON(json["value_type"]),
|
|
@@ -5857,18 +5985,6 @@ function EntityTraitDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
5857
5985
|
};
|
|
5858
5986
|
}
|
|
5859
5987
|
|
|
5860
|
-
// src/api/checkoutexternal/models/CustomPlanActivationStrategy.ts
|
|
5861
|
-
var CustomPlanActivationStrategy = {
|
|
5862
|
-
Payment: "on_payment",
|
|
5863
|
-
Publish: "on_publish"
|
|
5864
|
-
};
|
|
5865
|
-
function CustomPlanActivationStrategyFromJSON(json) {
|
|
5866
|
-
return CustomPlanActivationStrategyFromJSONTyped(json, false);
|
|
5867
|
-
}
|
|
5868
|
-
function CustomPlanActivationStrategyFromJSONTyped(json, ignoreDiscriminator) {
|
|
5869
|
-
return json;
|
|
5870
|
-
}
|
|
5871
|
-
|
|
5872
5988
|
// src/api/checkoutexternal/models/CustomPlanBillingStatus.ts
|
|
5873
5989
|
var CustomPlanBillingStatus = {
|
|
5874
5990
|
Active: "active",
|
|
@@ -5905,6 +6021,7 @@ function CustomPlanBillingResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
5905
6021
|
),
|
|
5906
6022
|
billingCycleAnchor: json["billing_cycle_anchor"] == null ? void 0 : new Date(json["billing_cycle_anchor"]),
|
|
5907
6023
|
billingStartDate: json["billing_start_date"] == null ? void 0 : new Date(json["billing_start_date"]),
|
|
6024
|
+
checkoutId: json["checkout_id"] == null ? void 0 : json["checkout_id"],
|
|
5908
6025
|
companyId: json["company_id"],
|
|
5909
6026
|
createdAt: new Date(json["created_at"]),
|
|
5910
6027
|
daysUntilDue: json["days_until_due"],
|
|
@@ -5914,6 +6031,9 @@ function CustomPlanBillingResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
5914
6031
|
paidAt: json["paid_at"] == null ? void 0 : new Date(json["paid_at"]),
|
|
5915
6032
|
planBillingSource: PlanBillingSourceFromJSON(json["plan_billing_source"]),
|
|
5916
6033
|
planId: json["plan_id"],
|
|
6034
|
+
problems: json["problems"].map(
|
|
6035
|
+
CheckoutProblemResponseDataFromJSON
|
|
6036
|
+
),
|
|
5917
6037
|
prorateFirstPeriod: json["prorate_first_period"] == null ? void 0 : json["prorate_first_period"],
|
|
5918
6038
|
publishedAt: json["published_at"] == null ? void 0 : new Date(json["published_at"]),
|
|
5919
6039
|
sendInvoice: json["send_invoice"],
|
|
@@ -6074,6 +6194,7 @@ function ConditionFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
6074
6194
|
metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["metric_period_month_reset"]),
|
|
6075
6195
|
metricValue: json["metric_value"] == null ? void 0 : json["metric_value"],
|
|
6076
6196
|
operator: ComparableOperatorFromJSON(json["operator"]),
|
|
6197
|
+
quantityRates: json["quantity_rates"] == null ? void 0 : json["quantity_rates"],
|
|
6077
6198
|
resourceIds: json["resource_ids"],
|
|
6078
6199
|
traitDefinition: json["trait_definition"] == null ? void 0 : TraitDefinitionFromJSON(json["trait_definition"]),
|
|
6079
6200
|
traitValue: json["trait_value"]
|
|
@@ -7011,6 +7132,20 @@ function PlanVersionResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
7011
7132
|
};
|
|
7012
7133
|
}
|
|
7013
7134
|
|
|
7135
|
+
// src/api/checkoutexternal/models/PlanCreditVisibility.ts
|
|
7136
|
+
function PlanCreditVisibilityFromJSON(json) {
|
|
7137
|
+
return PlanCreditVisibilityFromJSONTyped(json, false);
|
|
7138
|
+
}
|
|
7139
|
+
function PlanCreditVisibilityFromJSONTyped(json, ignoreDiscriminator) {
|
|
7140
|
+
if (json == null) {
|
|
7141
|
+
return json;
|
|
7142
|
+
}
|
|
7143
|
+
return {
|
|
7144
|
+
creditId: json["credit_id"],
|
|
7145
|
+
visible: json["visible"]
|
|
7146
|
+
};
|
|
7147
|
+
}
|
|
7148
|
+
|
|
7014
7149
|
// src/api/checkoutexternal/models/CreditUsageAggregation.ts
|
|
7015
7150
|
function CreditUsageAggregationFromJSON(json) {
|
|
7016
7151
|
return CreditUsageAggregationFromJSONTyped(json, false);
|
|
@@ -7124,6 +7259,9 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
7124
7259
|
controlledBy: BillingProviderTypeFromJSON(json["controlled_by"]),
|
|
7125
7260
|
copiedFromPlanId: json["copied_from_plan_id"] == null ? void 0 : json["copied_from_plan_id"],
|
|
7126
7261
|
createdAt: new Date(json["created_at"]),
|
|
7262
|
+
creditVisibility: json["credit_visibility"] == null ? void 0 : json["credit_visibility"].map(
|
|
7263
|
+
PlanCreditVisibilityFromJSON
|
|
7264
|
+
),
|
|
7127
7265
|
credits: json["credits"].map(
|
|
7128
7266
|
BillingCreditResponseDataFromJSON
|
|
7129
7267
|
),
|
|
@@ -8011,6 +8149,20 @@ function GetCompanyPaymentMethodsResponseFromJSONTyped(json, ignoreDiscriminator
|
|
|
8011
8149
|
};
|
|
8012
8150
|
}
|
|
8013
8151
|
|
|
8152
|
+
// src/api/checkoutexternal/models/GetCompanyResponse.ts
|
|
8153
|
+
function GetCompanyResponseFromJSON(json) {
|
|
8154
|
+
return GetCompanyResponseFromJSONTyped(json, false);
|
|
8155
|
+
}
|
|
8156
|
+
function GetCompanyResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
8157
|
+
if (json == null) {
|
|
8158
|
+
return json;
|
|
8159
|
+
}
|
|
8160
|
+
return {
|
|
8161
|
+
data: CompanyContextResponseDataFromJSON(json["data"]),
|
|
8162
|
+
params: json["params"]
|
|
8163
|
+
};
|
|
8164
|
+
}
|
|
8165
|
+
|
|
8014
8166
|
// src/api/checkoutexternal/models/GetCompanyUpcomingInvoiceResponse.ts
|
|
8015
8167
|
function GetCompanyUpcomingInvoiceResponseFromJSON(json) {
|
|
8016
8168
|
return GetCompanyUpcomingInvoiceResponseFromJSONTyped(json, false);
|
|
@@ -8865,6 +9017,38 @@ var CheckoutexternalApi = class extends BaseAPI {
|
|
|
8865
9017
|
const response = await this.getCheckoutTaxIDRaw(initOverrides);
|
|
8866
9018
|
return await response.value();
|
|
8867
9019
|
}
|
|
9020
|
+
/**
|
|
9021
|
+
* Get company
|
|
9022
|
+
*/
|
|
9023
|
+
async getCompanyRaw(initOverrides) {
|
|
9024
|
+
const queryParameters = {};
|
|
9025
|
+
const headerParameters = {};
|
|
9026
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
9027
|
+
headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
|
|
9028
|
+
"X-Schematic-Api-Key"
|
|
9029
|
+
);
|
|
9030
|
+
}
|
|
9031
|
+
const response = await this.request(
|
|
9032
|
+
{
|
|
9033
|
+
path: `/company`,
|
|
9034
|
+
method: "GET",
|
|
9035
|
+
headers: headerParameters,
|
|
9036
|
+
query: queryParameters
|
|
9037
|
+
},
|
|
9038
|
+
initOverrides
|
|
9039
|
+
);
|
|
9040
|
+
return new JSONApiResponse(
|
|
9041
|
+
response,
|
|
9042
|
+
(jsonValue) => GetCompanyResponseFromJSON(jsonValue)
|
|
9043
|
+
);
|
|
9044
|
+
}
|
|
9045
|
+
/**
|
|
9046
|
+
* Get company
|
|
9047
|
+
*/
|
|
9048
|
+
async getCompany(initOverrides) {
|
|
9049
|
+
const response = await this.getCompanyRaw(initOverrides);
|
|
9050
|
+
return await response.value();
|
|
9051
|
+
}
|
|
8868
9052
|
/**
|
|
8869
9053
|
* Get company credit balances
|
|
8870
9054
|
*/
|
|
@@ -10055,9 +10239,9 @@ function BillingCreditLedgerAuthorityFromJSONTyped4(json, ignoreDiscriminator) {
|
|
|
10055
10239
|
|
|
10056
10240
|
// src/api/componentspublic/models/Currency.ts
|
|
10057
10241
|
function CurrencyFromJSON2(json) {
|
|
10058
|
-
return
|
|
10242
|
+
return CurrencyFromJSONTyped34(json, false);
|
|
10059
10243
|
}
|
|
10060
|
-
function
|
|
10244
|
+
function CurrencyFromJSONTyped34(json, ignoreDiscriminator) {
|
|
10061
10245
|
return json;
|
|
10062
10246
|
}
|
|
10063
10247
|
|
|
@@ -11132,6 +11316,20 @@ function PlanVersionResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
|
|
|
11132
11316
|
};
|
|
11133
11317
|
}
|
|
11134
11318
|
|
|
11319
|
+
// src/api/componentspublic/models/PlanCreditVisibility.ts
|
|
11320
|
+
function PlanCreditVisibilityFromJSON2(json) {
|
|
11321
|
+
return PlanCreditVisibilityFromJSONTyped3(json, false);
|
|
11322
|
+
}
|
|
11323
|
+
function PlanCreditVisibilityFromJSONTyped3(json, ignoreDiscriminator) {
|
|
11324
|
+
if (json == null) {
|
|
11325
|
+
return json;
|
|
11326
|
+
}
|
|
11327
|
+
return {
|
|
11328
|
+
creditId: json["credit_id"],
|
|
11329
|
+
visible: json["visible"]
|
|
11330
|
+
};
|
|
11331
|
+
}
|
|
11332
|
+
|
|
11135
11333
|
// src/api/componentspublic/models/PlanViewPublicResponseData.ts
|
|
11136
11334
|
function PlanViewPublicResponseDataFromJSON(json) {
|
|
11137
11335
|
return PlanViewPublicResponseDataFromJSONTyped(json, false);
|
|
@@ -11163,6 +11361,9 @@ function PlanViewPublicResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
11163
11361
|
controlledBy: BillingProviderTypeFromJSON2(json["controlled_by"]),
|
|
11164
11362
|
copiedFromPlanId: json["copied_from_plan_id"] == null ? void 0 : json["copied_from_plan_id"],
|
|
11165
11363
|
createdAt: new Date(json["created_at"]),
|
|
11364
|
+
creditVisibility: json["credit_visibility"] == null ? void 0 : json["credit_visibility"].map(
|
|
11365
|
+
PlanCreditVisibilityFromJSON2
|
|
11366
|
+
),
|
|
11166
11367
|
credits: json["credits"].map(
|
|
11167
11368
|
BillingCreditResponseDataFromJSON2
|
|
11168
11369
|
),
|
|
@@ -15048,6 +15249,17 @@ function getResetCadencePeriod(cadence) {
|
|
|
15048
15249
|
function isPerLicenseGrant(grant) {
|
|
15049
15250
|
return grant.scaling === PlanCreditGrantScaling.PerLicense;
|
|
15050
15251
|
}
|
|
15252
|
+
function getDisplayedPlanCreditGrants(plan) {
|
|
15253
|
+
if (!plan) {
|
|
15254
|
+
return [];
|
|
15255
|
+
}
|
|
15256
|
+
const hidden = new Set(
|
|
15257
|
+
(plan.creditVisibility ?? []).filter((override) => !override.visible).map((override) => override.creditId)
|
|
15258
|
+
);
|
|
15259
|
+
return plan.includedCreditGrants.filter(
|
|
15260
|
+
(grant) => !hidden.has(grant.creditId)
|
|
15261
|
+
);
|
|
15262
|
+
}
|
|
15051
15263
|
function groupPlanCreditGrants(creditGrants) {
|
|
15052
15264
|
const map = creditGrants.reduce(
|
|
15053
15265
|
(acc, grant) => {
|
|
@@ -16692,7 +16904,7 @@ var reducer = (state, action) => {
|
|
|
16692
16904
|
// src/context/EmbedProvider.tsx
|
|
16693
16905
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
16694
16906
|
var getCustomHeaders = (sessionId) => ({
|
|
16695
|
-
"X-Schematic-Components-Version": "2.
|
|
16907
|
+
"X-Schematic-Components-Version": "2.33.0",
|
|
16696
16908
|
"X-Schematic-Session-ID": sessionId
|
|
16697
16909
|
});
|
|
16698
16910
|
var normalizeCurrencyFilter = (filter2) => {
|
|
@@ -19531,7 +19743,9 @@ var Plan = ({
|
|
|
19531
19743
|
{ useSelectedPeriod: true },
|
|
19532
19744
|
currency
|
|
19533
19745
|
) || {};
|
|
19534
|
-
const credits = groupPlanCreditGrants(
|
|
19746
|
+
const credits = groupPlanCreditGrants(
|
|
19747
|
+
getDisplayedPlanCreditGrants(plan)
|
|
19748
|
+
);
|
|
19535
19749
|
const hasUsageBasedEntitlements = (plan.entitlements ?? []).some(
|
|
19536
19750
|
(entitlement) => !!entitlement.priceBehavior
|
|
19537
19751
|
);
|
|
@@ -19909,8 +20123,8 @@ var Quantity = ({
|
|
|
19909
20123
|
const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
|
|
19910
20124
|
const unitPriceFontSize = 0.875 * settings.theme.typography.text.fontSize;
|
|
19911
20125
|
const planCredits = useMemo14(
|
|
19912
|
-
() => groupPlanCreditGrants(selectedPlan
|
|
19913
|
-
[selectedPlan
|
|
20126
|
+
() => groupPlanCreditGrants(getDisplayedPlanCreditGrants(selectedPlan)),
|
|
20127
|
+
[selectedPlan]
|
|
19914
20128
|
);
|
|
19915
20129
|
const prorationBehavior = data?.checkoutSettings?.prorationBehavior;
|
|
19916
20130
|
const { billDate: renewalDate } = useNextBillDate();
|
|
@@ -21166,16 +21380,17 @@ var CheckoutDialog = ({ top }) => {
|
|
|
21166
21380
|
);
|
|
21167
21381
|
}, [availablePlans, checkoutState, selectedPlanId]);
|
|
21168
21382
|
const [shouldTrial, setShouldTrial] = useState8(false);
|
|
21169
|
-
const
|
|
21170
|
-
|
|
21171
|
-
|
|
21383
|
+
const displayedPlanCreditGrants = useMemo16(
|
|
21384
|
+
() => getDisplayedPlanCreditGrants(selectedPlan),
|
|
21385
|
+
[selectedPlan]
|
|
21386
|
+
);
|
|
21387
|
+
const planCreditGrants = useMemo16(
|
|
21388
|
+
() => mergeCompanyGrants(
|
|
21389
|
+
displayedPlanCreditGrants,
|
|
21172
21390
|
data?.company?.plan?.includedCreditGrants
|
|
21173
|
-
)
|
|
21174
|
-
|
|
21175
|
-
|
|
21176
|
-
selectedPlan?.includedCreditGrants,
|
|
21177
|
-
data?.company?.plan?.includedCreditGrants
|
|
21178
|
-
]);
|
|
21391
|
+
),
|
|
21392
|
+
[displayedPlanCreditGrants, data?.company?.plan?.includedCreditGrants]
|
|
21393
|
+
);
|
|
21179
21394
|
const [autoTopupConfigs, setAutoTopupConfigs] = useState8(() => {
|
|
21180
21395
|
const initialConfigs = data?.company?.plan?.includedCreditGrants.reduce(
|
|
21181
21396
|
(acc, companyGrant) => {
|
|
@@ -21415,7 +21630,7 @@ var CheckoutDialog = ({ top }) => {
|
|
|
21415
21630
|
description: t3("Choose your base plan")
|
|
21416
21631
|
});
|
|
21417
21632
|
}
|
|
21418
|
-
const hasSelfServiceAutoTopup =
|
|
21633
|
+
const hasSelfServiceAutoTopup = displayedPlanCreditGrants.some(
|
|
21419
21634
|
(grant) => isSelfServiceAutoTopupAvailable(grant)
|
|
21420
21635
|
);
|
|
21421
21636
|
if (hasSelfServiceAutoTopup) {
|
|
@@ -21475,7 +21690,7 @@ var CheckoutDialog = ({ top }) => {
|
|
|
21475
21690
|
data?.customCheckoutFields,
|
|
21476
21691
|
collectTaxId,
|
|
21477
21692
|
availablePlans,
|
|
21478
|
-
|
|
21693
|
+
displayedPlanCreditGrants,
|
|
21479
21694
|
willTrialWithoutPaymentMethod,
|
|
21480
21695
|
payInAdvanceEntitlements,
|
|
21481
21696
|
addOns,
|
|
@@ -24127,8 +24342,8 @@ var SubscriptionSidebar = forwardRef7(
|
|
|
24127
24342
|
data?.company?.plan?.includedCreditGrants
|
|
24128
24343
|
]);
|
|
24129
24344
|
const planCredits = useMemo22(
|
|
24130
|
-
() => groupPlanCreditGrants(selectedPlan
|
|
24131
|
-
[selectedPlan
|
|
24345
|
+
() => groupPlanCreditGrants(getDisplayedPlanCreditGrants(selectedPlan)),
|
|
24346
|
+
[selectedPlan]
|
|
24132
24347
|
);
|
|
24133
24348
|
const { payInAdvanceEntitlements } = useMemo22(() => {
|
|
24134
24349
|
const payAsYouGoEntitlements = [];
|
|
@@ -29676,7 +29891,7 @@ var Plan2 = ({
|
|
|
29676
29891
|
const currentPlanIndex = plans.findIndex((plan2) => plan2.current);
|
|
29677
29892
|
const isActivePlan = plan.current && currentPeriod === selectedPeriod;
|
|
29678
29893
|
const { price: planPrice, currency: planCurrency } = getPlanPrice(plan, selectedPeriod, { useSelectedPeriod: true }, currency) || {};
|
|
29679
|
-
const credits = groupPlanCreditGrants(plan
|
|
29894
|
+
const credits = groupPlanCreditGrants(getDisplayedPlanCreditGrants(plan));
|
|
29680
29895
|
const hasUsageBasedEntitlements = (plan.entitlements ?? []).some(
|
|
29681
29896
|
(entitlement) => !!entitlement.priceBehavior
|
|
29682
29897
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematichq/schematic-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.33.0",
|
|
4
4
|
"main": "dist/schematic-components.cjs.js",
|
|
5
5
|
"module": "dist/schematic-components.esm.js",
|
|
6
6
|
"types": "dist/schematic-components.d.ts",
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
"@eslint/js": "^10.0.1",
|
|
82
82
|
"@eslint/json": "^2.1.0",
|
|
83
83
|
"@eslint/markdown": "^8.0.3",
|
|
84
|
-
"@microsoft/api-extractor": "^7.59.
|
|
84
|
+
"@microsoft/api-extractor": "^7.59.4",
|
|
85
85
|
"@openapitools/openapi-generator-cli": "^2.41.0",
|
|
86
|
-
"@schematichq/schematic-js": "^1.
|
|
87
|
-
"@schematichq/schematic-react": "^1.
|
|
86
|
+
"@schematichq/schematic-js": "^1.12.0",
|
|
87
|
+
"@schematichq/schematic-react": "^1.12.0",
|
|
88
88
|
"@stripe/react-stripe-js": "^6.12.0",
|
|
89
89
|
"@swc/core": "^1.16.13",
|
|
90
90
|
"@testing-library/dom": "^10.4.2",
|
|
@@ -109,11 +109,11 @@
|
|
|
109
109
|
"react": "^19.3.0",
|
|
110
110
|
"react-dom": "^19.3.0",
|
|
111
111
|
"typescript": "^6.0.3",
|
|
112
|
-
"typescript-eslint": "^8.71.
|
|
112
|
+
"typescript-eslint": "^8.71.1",
|
|
113
113
|
"vitest": "^5.0.3"
|
|
114
114
|
},
|
|
115
115
|
"peerDependencies": {
|
|
116
|
-
"@schematichq/schematic-react": "^1.
|
|
116
|
+
"@schematichq/schematic-react": "^1.12.0",
|
|
117
117
|
"@stripe/react-stripe-js": ">=3",
|
|
118
118
|
"@stripe/stripe-js": ">=4",
|
|
119
119
|
"react": ">=18",
|