@zuplo/zudoku-plugin-monetization 0.0.42 → 0.0.44

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.
@@ -142,6 +142,13 @@ declare const FeatureItem: ({
142
142
  }) => import("react/jsx-runtime").JSX.Element;
143
143
  //#endregion
144
144
  //#region src/pricing-ui/PlanEntitlements.d.ts
145
+ /**
146
+ * A plan's entitlements, phase by phase. Multi-phase plans whose phases all
147
+ * resolve to the same entitlements collapse into a single list (the phases
148
+ * only differ in price, which the price schedule already tells); phases with
149
+ * genuinely different entitlements render as separate sections headed by the
150
+ * phase name, duration, and that phase's own price.
151
+ */
145
152
  declare const PlanEntitlements: ({
146
153
  phases,
147
154
  currency,
@@ -174,6 +181,52 @@ type PlanPriceLabel = {
174
181
  */
175
182
  declare const formatPlanPrice: (plan: Plan) => PlanPriceLabel;
176
183
  //#endregion
184
+ //#region src/utils/getPlanPriceSchedule.d.ts
185
+ type PlanPriceScheduleRow = {
186
+ /** Stable row key — the phase key, falling back to the phase index. */key: string; /** Left-column label, e.g. "First 3 months" / "Next 2 months" / "After that". */
187
+ label: string; /** The phase's own price, derived from its rate cards alone. */
188
+ price: PlanPriceLabel;
189
+ };
190
+ /**
191
+ * A stacked price schedule for a multi-phase plan: one row per phase, each
192
+ * priced from its own rate cards (e.g. "First 3 months — Free" then
193
+ * "After that — $750/month"). This is how an intro/ramp phase's price gets
194
+ * surfaced instead of only the steady-state price from {@link getPlanPrice}.
195
+ *
196
+ * Returns `undefined` when there is nothing to stack — fewer than two phases,
197
+ * or every phase resolving to the same price label (a free trial into a free
198
+ * plan, two identically-priced phases, …) — so callers fall back to the
199
+ * single-headline rendering.
200
+ */
201
+ declare const getPlanPriceSchedule: (plan: Plan) => PlanPriceScheduleRow[] | undefined;
202
+ //#endregion
203
+ //#region src/pricing-ui/PlanPriceSchedule.d.ts
204
+ /**
205
+ * Stacked per-phase price rows for a multi-phase plan, replacing the single
206
+ * headline price (which only reflects the steady-state phase): each row pairs
207
+ * a phase label ("First 3 months", "After that") with that phase's own price.
208
+ * Every row gets equal visual weight — the intro price is part of the plan's
209
+ * price, not a footnote.
210
+ *
211
+ * Callers derive the rows via {@link getPlanPriceSchedule} and fall back to
212
+ * the single-price rendering when it returns `undefined`. `size` picks the
213
+ * typographic treatment: `"lg"` for a card's headline area, `"sm"` for
214
+ * compact contexts (plan-change rows, summary cards).
215
+ */
216
+ declare const PlanPriceSchedule: ({
217
+ schedule,
218
+ currency,
219
+ billingCadence,
220
+ size,
221
+ className
222
+ }: {
223
+ schedule: PlanPriceScheduleRow[];
224
+ currency?: string; /** Render each priced row with the `/cadence` suffix (the plan's billing cadence). */
225
+ billingCadence?: string;
226
+ size?: "sm" | "lg";
227
+ className?: string;
228
+ }) => import("react/jsx-runtime").JSX.Element;
229
+ //#endregion
177
230
  //#region src/pricing-ui/PlanPriceTag.d.ts
178
231
  /**
179
232
  * Headline price for a plan/subscription: `$X/cadence`, "Pay as you go", or
@@ -320,6 +373,19 @@ declare const formatTieredPriceBreakdown: (opts: {
320
373
  includedLabel: string;
321
374
  }) => string[] | undefined;
322
375
  //#endregion
376
+ //#region src/utils/getPhasePriceLabel.d.ts
377
+ /**
378
+ * Headline price for a SINGLE phase, derived only from that phase's own rate
379
+ * cards. Mirrors {@link formatPlanPrice}'s rules, but scoped to the phase:
380
+ * a positive recurring flat-fee total is `priced`; otherwise a priced
381
+ * `usage_based` card in this phase makes it `payg`; otherwise it's `free`.
382
+ *
383
+ * Like {@link getPlanPrice}, one-time fees (`flat_fee` with
384
+ * `billingCadence: null`) and `price: null` rate cards contribute nothing —
385
+ * an intro phase whose fees all have `price: null` derives as `free`.
386
+ */
387
+ declare const getPhasePriceLabel: (phase: PlanPhase) => PlanPriceLabel;
388
+ //#endregion
323
389
  //#region src/utils/getPlanPrice.d.ts
324
390
  /**
325
391
  * The plan's headline recurring price: the sum of every recurring `flat_fee`
@@ -346,4 +412,4 @@ declare const collectDefaultTaxBehaviors: (plan: Plan) => CanonicalTaxBehavior;
346
412
  declare const taxBehaviorLegendSentence: (behavior: string) => string | undefined;
347
413
  declare const subscriptionTaxLegendSentence: (behavior: string) => string | undefined;
348
414
  //#endregion
349
- export { type Alignment, type BooleanEntitlementTemplate, type DynamicPrice, type EntitlementTemplate, type Feature, FeatureItem, type FlatFeeRateCard, type FlatPrice, type MeteredEntitlementTemplate, type PackagePrice, type Plan, type PlanDefaultTaxConfig, PlanEntitlements, type PlanPhase, type PlanPriceLabel, PlanPriceTag, type Price, type PriceTier, PricingCard, type PricingCardProps, PricingTable, type PricingTableProps, type ProRatingConfig, type Quota, QuotaItem, type RateCard, type StaticEntitlementTemplate, type TieredPrice, type TieredPriceBreakdownTier, type UnitPrice, type UsageBasedRateCard, type ValidationError, categorizeRateCards, collectDefaultTaxBehaviors, formatDuration, formatDurationAdjective, formatDurationInterval, formatMinorCurrencyAmount, formatPlanPrice, formatPrice, formatStaticEntitlementConfig, formatTieredPriceBreakdown, getPlanPrice, planHasDefaultTaxBehavior, subscriptionTaxLegendSentence, taxBehaviorLegendSentence };
415
+ export { type Alignment, type BooleanEntitlementTemplate, type DynamicPrice, type EntitlementTemplate, type Feature, FeatureItem, type FlatFeeRateCard, type FlatPrice, type MeteredEntitlementTemplate, type PackagePrice, type Plan, type PlanDefaultTaxConfig, PlanEntitlements, type PlanPhase, type PlanPriceLabel, PlanPriceSchedule, type PlanPriceScheduleRow, PlanPriceTag, type Price, type PriceTier, PricingCard, type PricingCardProps, PricingTable, type PricingTableProps, type ProRatingConfig, type Quota, QuotaItem, type RateCard, type StaticEntitlementTemplate, type TieredPrice, type TieredPriceBreakdownTier, type UnitPrice, type UsageBasedRateCard, type ValidationError, categorizeRateCards, collectDefaultTaxBehaviors, formatDuration, formatDurationAdjective, formatDurationInterval, formatMinorCurrencyAmount, formatPlanPrice, formatPrice, formatStaticEntitlementConfig, formatTieredPriceBreakdown, getPhasePriceLabel, getPlanPrice, getPlanPriceSchedule, planHasDefaultTaxBehavior, subscriptionTaxLegendSentence, taxBehaviorLegendSentence };
@@ -1,2 +1,2 @@
1
- import { S as formatDurationInterval, _ as formatStaticEntitlementConfig, a as planHasDefaultTaxBehavior, b as formatDuration, c as formatPlanPrice, d as PlanEntitlements, g as formatTieredPriceBreakdown, h as categorizeRateCards, i as collectDefaultTaxBehaviors, l as getPlanPrice, m as FeatureItem, n as PricingCard, o as subscriptionTaxLegendSentence, p as QuotaItem, s as taxBehaviorLegendSentence, t as PricingTable, u as PlanPriceTag, v as formatMinorCurrencyAmount, x as formatDurationAdjective, y as formatPrice } from "./PricingTable-BlcXx4-5.mjs";
2
- export { FeatureItem, PlanEntitlements, PlanPriceTag, PricingCard, PricingTable, QuotaItem, categorizeRateCards, collectDefaultTaxBehaviors, formatDuration, formatDurationAdjective, formatDurationInterval, formatMinorCurrencyAmount, formatPlanPrice, formatPrice, formatStaticEntitlementConfig, formatTieredPriceBreakdown, getPlanPrice, planHasDefaultTaxBehavior, subscriptionTaxLegendSentence, taxBehaviorLegendSentence };
1
+ import { C as formatStaticEntitlementConfig, D as formatDurationAdjective, E as formatDuration, O as formatDurationInterval, S as formatTieredPriceBreakdown, T as formatPrice, _ as formatPlanPrice, a as planHasDefaultTaxBehavior, c as getPlanPriceSchedule, d as PlanEntitlements, g as getPhasePriceLabel, h as FeatureItem, i as collectDefaultTaxBehaviors, l as PlanPriceTag, m as QuotaItem, n as PricingCard, o as subscriptionTaxLegendSentence, s as taxBehaviorLegendSentence, t as PricingTable, u as PlanPriceSchedule, v as getPlanPrice, w as formatMinorCurrencyAmount, x as categorizeRateCards } from "./PricingTable-WkG2n7V-.mjs";
2
+ export { FeatureItem, PlanEntitlements, PlanPriceSchedule, PlanPriceTag, PricingCard, PricingTable, QuotaItem, categorizeRateCards, collectDefaultTaxBehaviors, formatDuration, formatDurationAdjective, formatDurationInterval, formatMinorCurrencyAmount, formatPlanPrice, formatPrice, formatStaticEntitlementConfig, formatTieredPriceBreakdown, getPhasePriceLabel, getPlanPrice, getPlanPriceSchedule, planHasDefaultTaxBehavior, subscriptionTaxLegendSentence, taxBehaviorLegendSentence };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/zudoku-plugin-monetization",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/zuplo/zudoku",