@automattic/plans-grid-next 1.0.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/CHANGELOG.md +4 -0
- package/README.md +3 -0
- package/dist/cjs/__mocks__/wpcom-proxy-request.js +17 -0
- package/dist/cjs/__mocks__/wpcom-proxy-request.js.map +1 -0
- package/dist/cjs/_media-queries.scss +14 -0
- package/dist/cjs/_mixins.scss +15 -0
- package/dist/cjs/_shared.scss +174 -0
- package/dist/cjs/components/comparison-grid/index.js +527 -0
- package/dist/cjs/components/comparison-grid/index.js.map +1 -0
- package/dist/cjs/components/comparison-grid/index.stories.js +74 -0
- package/dist/cjs/components/comparison-grid/index.stories.js.map +1 -0
- package/dist/cjs/components/comparison-grid/style.scss +318 -0
- package/dist/cjs/components/dropdown-option.js +33 -0
- package/dist/cjs/components/dropdown-option.js.map +1 -0
- package/dist/cjs/components/features-grid/billing-timeframes.js +15 -0
- package/dist/cjs/components/features-grid/billing-timeframes.js.map +1 -0
- package/dist/cjs/components/features-grid/client-logo-list/client-list.js +106 -0
- package/dist/cjs/components/features-grid/client-logo-list/client-list.js.map +1 -0
- package/dist/cjs/components/features-grid/client-logo-list/index.js +17 -0
- package/dist/cjs/components/features-grid/client-logo-list/index.js.map +1 -0
- package/dist/cjs/components/features-grid/client-logo-list/style.scss +52 -0
- package/dist/cjs/components/features-grid/enterprise-features.js +41 -0
- package/dist/cjs/components/features-grid/enterprise-features.js.map +1 -0
- package/dist/cjs/components/features-grid/index.js +130 -0
- package/dist/cjs/components/features-grid/index.js.map +1 -0
- package/dist/cjs/components/features-grid/index.stories.js +112 -0
- package/dist/cjs/components/features-grid/index.stories.js.map +1 -0
- package/dist/cjs/components/features-grid/mobile-free-domain.js +25 -0
- package/dist/cjs/components/features-grid/mobile-free-domain.js.map +1 -0
- package/dist/cjs/components/features-grid/plan-features-list.js +56 -0
- package/dist/cjs/components/features-grid/plan-features-list.js.map +1 -0
- package/dist/cjs/components/features-grid/plan-headers.js +15 -0
- package/dist/cjs/components/features-grid/plan-headers.js.map +1 -0
- package/dist/cjs/components/features-grid/plan-logos.js +12 -0
- package/dist/cjs/components/features-grid/plan-logos.js.map +1 -0
- package/dist/cjs/components/features-grid/plan-prices.js +14 -0
- package/dist/cjs/components/features-grid/plan-prices.js.map +1 -0
- package/dist/cjs/components/features-grid/plan-tagline.js +12 -0
- package/dist/cjs/components/features-grid/plan-tagline.js.map +1 -0
- package/dist/cjs/components/features-grid/previous-features-included-title.js +36 -0
- package/dist/cjs/components/features-grid/previous-features-included-title.js.map +1 -0
- package/dist/cjs/components/features-grid/spotlight-plan.js +24 -0
- package/dist/cjs/components/features-grid/spotlight-plan.js.map +1 -0
- package/dist/cjs/components/features-grid/spotlight-plan.scss +5 -0
- package/dist/cjs/components/features-grid/style.scss +630 -0
- package/dist/cjs/components/features-grid/table.js +38 -0
- package/dist/cjs/components/features-grid/table.js.map +1 -0
- package/dist/cjs/components/features-grid/top-buttons.js +15 -0
- package/dist/cjs/components/features-grid/top-buttons.js.map +1 -0
- package/dist/cjs/components/features.js +72 -0
- package/dist/cjs/components/features.js.map +1 -0
- package/dist/cjs/components/item.js +9 -0
- package/dist/cjs/components/item.js.map +1 -0
- package/dist/cjs/components/plan-button/index.js +21 -0
- package/dist/cjs/components/plan-button/index.js.map +1 -0
- package/dist/cjs/components/plan-button/style.scss +179 -0
- package/dist/cjs/components/plan-div-td-container.js +9 -0
- package/dist/cjs/components/plan-div-td-container.js.map +1 -0
- package/dist/cjs/components/plan-logo.js +45 -0
- package/dist/cjs/components/plan-logo.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-dropdown.js +39 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-dropdown.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-selector.js +12 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-selector.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-toggle.js +55 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-toggle.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/components/popup-messages.js +108 -0
- package/dist/cjs/components/plan-type-selector/components/popup-messages.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-interval-options.js +56 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-interval-options.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discount.js +45 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discount.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js +68 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/index.js +27 -0
- package/dist/cjs/components/plan-type-selector/index.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/style.scss +196 -0
- package/dist/cjs/components/plans-2023-tooltip.js +46 -0
- package/dist/cjs/components/plans-2023-tooltip.js.map +1 -0
- package/dist/cjs/components/popular-badge.js +16 -0
- package/dist/cjs/components/popular-badge.js.map +1 -0
- package/dist/cjs/components/shared/action-button/index.js +91 -0
- package/dist/cjs/components/shared/action-button/index.js.map +1 -0
- package/dist/cjs/components/shared/action-button/style.scss +12 -0
- package/dist/cjs/components/shared/billing-timeframe/index.js +58 -0
- package/dist/cjs/components/shared/billing-timeframe/index.js.map +1 -0
- package/dist/cjs/components/shared/header-price/header-price-context.js +14 -0
- package/dist/cjs/components/shared/header-price/header-price-context.js.map +1 -0
- package/dist/cjs/components/shared/header-price/index.js +102 -0
- package/dist/cjs/components/shared/header-price/index.js.map +1 -0
- package/dist/cjs/components/shared/header-price/style.scss +112 -0
- package/dist/cjs/components/shared/plan-pill/index.js +6 -0
- package/dist/cjs/components/shared/plan-pill/index.js.map +1 -0
- package/dist/cjs/components/shared/plan-pill/style.scss +30 -0
- package/dist/cjs/components/shared/storage/components/plan-storage.js +28 -0
- package/dist/cjs/components/shared/storage/components/plan-storage.js.map +1 -0
- package/dist/cjs/components/shared/storage/components/storage-dropdown.js +96 -0
- package/dist/cjs/components/shared/storage/components/storage-dropdown.js.map +1 -0
- package/dist/cjs/components/shared/storage/components/storage-feature-label.js +40 -0
- package/dist/cjs/components/shared/storage/components/storage-feature-label.js.map +1 -0
- package/dist/cjs/components/shared/storage/constants.js +6 -0
- package/dist/cjs/components/shared/storage/constants.js.map +1 -0
- package/dist/cjs/components/shared/storage/hooks/use-default-storage-option.js +26 -0
- package/dist/cjs/components/shared/storage/hooks/use-default-storage-option.js.map +1 -0
- package/dist/cjs/components/shared/storage/hooks/use-plan-storage.js +29 -0
- package/dist/cjs/components/shared/storage/hooks/use-plan-storage.js.map +1 -0
- package/dist/cjs/components/shared/storage/hooks/use-purchased-storage-add-on.js +51 -0
- package/dist/cjs/components/shared/storage/hooks/use-purchased-storage-add-on.js.map +1 -0
- package/dist/cjs/components/shared/storage/hooks/use-storage-string.js +13 -0
- package/dist/cjs/components/shared/storage/hooks/use-storage-string.js.map +1 -0
- package/dist/cjs/components/shared/storage/index.js +14 -0
- package/dist/cjs/components/shared/storage/index.js.map +1 -0
- package/dist/cjs/components/sticky-container.js +74 -0
- package/dist/cjs/components/sticky-container.js.map +1 -0
- package/dist/cjs/constants.js +11 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/css-mixins.js +14 -0
- package/dist/cjs/css-mixins.js.map +1 -0
- package/dist/cjs/fixtures/plans.js +1542 -0
- package/dist/cjs/fixtures/plans.js.map +1 -0
- package/dist/cjs/fixtures/sites-plans.js +458 -0
- package/dist/cjs/fixtures/sites-plans.js.map +1 -0
- package/dist/cjs/fixtures/sites-purchases.js +133 -0
- package/dist/cjs/fixtures/sites-purchases.js.map +1 -0
- package/dist/cjs/grid-context.js +40 -0
- package/dist/cjs/grid-context.js.map +1 -0
- package/dist/cjs/hooks/data-store/is-popular-plan.js +9 -0
- package/dist/cjs/hooks/data-store/is-popular-plan.js.map +1 -0
- package/dist/cjs/hooks/data-store/types.js +3 -0
- package/dist/cjs/hooks/data-store/types.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-grid-plan-for-spotlight.js +18 -0
- package/dist/cjs/hooks/data-store/use-grid-plan-for-spotlight.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-grid-plans-for-comparison-grid.js +55 -0
- package/dist/cjs/hooks/data-store/use-grid-plans-for-comparison-grid.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-grid-plans-for-features-grid.js +56 -0
- package/dist/cjs/hooks/data-store/use-grid-plans-for-features-grid.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-grid-plans.js +254 -0
- package/dist/cjs/hooks/data-store/use-grid-plans.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-highlight-labels.js +60 -0
- package/dist/cjs/hooks/data-store/use-highlight-labels.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-highlighted-features.js +35 -0
- package/dist/cjs/hooks/data-store/use-highlighted-features.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-plan-billing-description.js +216 -0
- package/dist/cjs/hooks/data-store/use-plan-billing-description.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-plan-features-for-grid-plans.js +133 -0
- package/dist/cjs/hooks/data-store/use-plan-features-for-grid-plans.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-plans-from-types.js +30 -0
- package/dist/cjs/hooks/data-store/use-plans-from-types.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js +90 -0
- package/dist/cjs/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js.map +1 -0
- package/dist/cjs/hooks/use-grid-size.js +33 -0
- package/dist/cjs/hooks/use-grid-size.js.map +1 -0
- package/dist/cjs/hooks/use-highlight-adjacency-matrix.js +31 -0
- package/dist/cjs/hooks/use-highlight-adjacency-matrix.js.map +1 -0
- package/dist/cjs/hooks/use-is-large-currency.js +69 -0
- package/dist/cjs/hooks/use-is-large-currency.js.map +1 -0
- package/dist/cjs/hooks/use-manage-tooltip-toggle.js +29 -0
- package/dist/cjs/hooks/use-manage-tooltip-toggle.js.map +1 -0
- package/dist/cjs/hooks/use-plan-pricing-info-from-grid-plans.js +17 -0
- package/dist/cjs/hooks/use-plan-pricing-info-from-grid-plans.js.map +1 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/filter-unused-features-object.js +19 -0
- package/dist/cjs/lib/filter-unused-features-object.js.map +1 -0
- package/dist/cjs/lib/get-plan-features-object.js +11 -0
- package/dist/cjs/lib/get-plan-features-object.js.map +1 -0
- package/dist/cjs/lib/get-plan-pricing-info-from-grid-plans.js +16 -0
- package/dist/cjs/lib/get-plan-pricing-info-from-grid-plans.js.map +1 -0
- package/dist/cjs/lib/is-same-plan.js +12 -0
- package/dist/cjs/lib/is-same-plan.js.map +1 -0
- package/dist/cjs/lib/sort-plan-properties.js +39 -0
- package/dist/cjs/lib/sort-plan-properties.js.map +1 -0
- package/dist/cjs/lib/touch-detect/index.js +20 -0
- package/dist/cjs/lib/touch-detect/index.js.map +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/__mocks__/wpcom-proxy-request.js +11 -0
- package/dist/esm/__mocks__/wpcom-proxy-request.js.map +1 -0
- package/dist/esm/_media-queries.scss +14 -0
- package/dist/esm/_mixins.scss +15 -0
- package/dist/esm/_shared.scss +174 -0
- package/dist/esm/components/comparison-grid/index.js +524 -0
- package/dist/esm/components/comparison-grid/index.js.map +1 -0
- package/dist/esm/components/comparison-grid/index.stories.js +71 -0
- package/dist/esm/components/comparison-grid/index.stories.js.map +1 -0
- package/dist/esm/components/comparison-grid/style.scss +318 -0
- package/dist/esm/components/dropdown-option.js +30 -0
- package/dist/esm/components/dropdown-option.js.map +1 -0
- package/dist/esm/components/features-grid/billing-timeframes.js +12 -0
- package/dist/esm/components/features-grid/billing-timeframes.js.map +1 -0
- package/dist/esm/components/features-grid/client-logo-list/client-list.js +104 -0
- package/dist/esm/components/features-grid/client-logo-list/client-list.js.map +1 -0
- package/dist/esm/components/features-grid/client-logo-list/index.js +14 -0
- package/dist/esm/components/features-grid/client-logo-list/index.js.map +1 -0
- package/dist/esm/components/features-grid/client-logo-list/style.scss +52 -0
- package/dist/esm/components/features-grid/enterprise-features.js +38 -0
- package/dist/esm/components/features-grid/enterprise-features.js.map +1 -0
- package/dist/esm/components/features-grid/index.js +127 -0
- package/dist/esm/components/features-grid/index.js.map +1 -0
- package/dist/esm/components/features-grid/index.stories.js +109 -0
- package/dist/esm/components/features-grid/index.stories.js.map +1 -0
- package/dist/esm/components/features-grid/mobile-free-domain.js +23 -0
- package/dist/esm/components/features-grid/mobile-free-domain.js.map +1 -0
- package/dist/esm/components/features-grid/plan-features-list.js +53 -0
- package/dist/esm/components/features-grid/plan-features-list.js.map +1 -0
- package/dist/esm/components/features-grid/plan-headers.js +12 -0
- package/dist/esm/components/features-grid/plan-headers.js.map +1 -0
- package/dist/esm/components/features-grid/plan-logos.js +9 -0
- package/dist/esm/components/features-grid/plan-logos.js.map +1 -0
- package/dist/esm/components/features-grid/plan-prices.js +11 -0
- package/dist/esm/components/features-grid/plan-prices.js.map +1 -0
- package/dist/esm/components/features-grid/plan-tagline.js +9 -0
- package/dist/esm/components/features-grid/plan-tagline.js.map +1 -0
- package/dist/esm/components/features-grid/previous-features-included-title.js +33 -0
- package/dist/esm/components/features-grid/previous-features-included-title.js.map +1 -0
- package/dist/esm/components/features-grid/spotlight-plan.js +21 -0
- package/dist/esm/components/features-grid/spotlight-plan.js.map +1 -0
- package/dist/esm/components/features-grid/spotlight-plan.scss +5 -0
- package/dist/esm/components/features-grid/style.scss +630 -0
- package/dist/esm/components/features-grid/table.js +35 -0
- package/dist/esm/components/features-grid/table.js.map +1 -0
- package/dist/esm/components/features-grid/top-buttons.js +12 -0
- package/dist/esm/components/features-grid/top-buttons.js.map +1 -0
- package/dist/esm/components/features.js +69 -0
- package/dist/esm/components/features.js.map +1 -0
- package/dist/esm/components/item.js +5 -0
- package/dist/esm/components/item.js.map +1 -0
- package/dist/esm/components/plan-button/index.js +18 -0
- package/dist/esm/components/plan-button/index.js.map +1 -0
- package/dist/esm/components/plan-button/style.scss +179 -0
- package/dist/esm/components/plan-div-td-container.js +7 -0
- package/dist/esm/components/plan-div-td-container.js.map +1 -0
- package/dist/esm/components/plan-logo.js +42 -0
- package/dist/esm/components/plan-logo.js.map +1 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-dropdown.js +34 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-dropdown.js.map +1 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-selector.js +8 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-selector.js.map +1 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-toggle.js +50 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-toggle.js.map +1 -0
- package/dist/esm/components/plan-type-selector/components/popup-messages.js +105 -0
- package/dist/esm/components/plan-type-selector/components/popup-messages.js.map +1 -0
- package/dist/esm/components/plan-type-selector/hooks/use-interval-options.js +52 -0
- package/dist/esm/components/plan-type-selector/hooks/use-interval-options.js.map +1 -0
- package/dist/esm/components/plan-type-selector/hooks/use-max-discount.js +42 -0
- package/dist/esm/components/plan-type-selector/hooks/use-max-discount.js.map +1 -0
- package/dist/esm/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js +65 -0
- package/dist/esm/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js.map +1 -0
- package/dist/esm/components/plan-type-selector/index.js +24 -0
- package/dist/esm/components/plan-type-selector/index.js.map +1 -0
- package/dist/esm/components/plan-type-selector/style.scss +196 -0
- package/dist/esm/components/plans-2023-tooltip.js +41 -0
- package/dist/esm/components/plans-2023-tooltip.js.map +1 -0
- package/dist/esm/components/popular-badge.js +13 -0
- package/dist/esm/components/popular-badge.js.map +1 -0
- package/dist/esm/components/shared/action-button/index.js +88 -0
- package/dist/esm/components/shared/action-button/index.js.map +1 -0
- package/dist/esm/components/shared/action-button/style.scss +12 -0
- package/dist/esm/components/shared/billing-timeframe/index.js +55 -0
- package/dist/esm/components/shared/billing-timeframe/index.js.map +1 -0
- package/dist/esm/components/shared/header-price/header-price-context.js +10 -0
- package/dist/esm/components/shared/header-price/header-price-context.js.map +1 -0
- package/dist/esm/components/shared/header-price/index.js +99 -0
- package/dist/esm/components/shared/header-price/index.js.map +1 -0
- package/dist/esm/components/shared/header-price/style.scss +112 -0
- package/dist/esm/components/shared/plan-pill/index.js +4 -0
- package/dist/esm/components/shared/plan-pill/index.js.map +1 -0
- package/dist/esm/components/shared/plan-pill/style.scss +30 -0
- package/dist/esm/components/shared/storage/components/plan-storage.js +25 -0
- package/dist/esm/components/shared/storage/components/plan-storage.js.map +1 -0
- package/dist/esm/components/shared/storage/components/storage-dropdown.js +93 -0
- package/dist/esm/components/shared/storage/components/storage-dropdown.js.map +1 -0
- package/dist/esm/components/shared/storage/components/storage-feature-label.js +37 -0
- package/dist/esm/components/shared/storage/components/storage-feature-label.js.map +1 -0
- package/dist/esm/components/shared/storage/constants.js +3 -0
- package/dist/esm/components/shared/storage/constants.js.map +1 -0
- package/dist/esm/components/shared/storage/hooks/use-default-storage-option.js +22 -0
- package/dist/esm/components/shared/storage/hooks/use-default-storage-option.js.map +1 -0
- package/dist/esm/components/shared/storage/hooks/use-plan-storage.js +27 -0
- package/dist/esm/components/shared/storage/hooks/use-plan-storage.js.map +1 -0
- package/dist/esm/components/shared/storage/hooks/use-purchased-storage-add-on.js +48 -0
- package/dist/esm/components/shared/storage/hooks/use-purchased-storage-add-on.js.map +1 -0
- package/dist/esm/components/shared/storage/hooks/use-storage-string.js +11 -0
- package/dist/esm/components/shared/storage/hooks/use-storage-string.js.map +1 -0
- package/dist/esm/components/shared/storage/index.js +9 -0
- package/dist/esm/components/shared/storage/index.js.map +1 -0
- package/dist/esm/components/sticky-container.js +69 -0
- package/dist/esm/components/sticky-container.js.map +1 -0
- package/dist/esm/constants.js +8 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/css-mixins.js +10 -0
- package/dist/esm/css-mixins.js.map +1 -0
- package/dist/esm/fixtures/plans.js +1540 -0
- package/dist/esm/fixtures/plans.js.map +1 -0
- package/dist/esm/fixtures/sites-plans.js +456 -0
- package/dist/esm/fixtures/sites-plans.js.map +1 -0
- package/dist/esm/fixtures/sites-purchases.js +131 -0
- package/dist/esm/fixtures/sites-purchases.js.map +1 -0
- package/dist/esm/grid-context.js +36 -0
- package/dist/esm/grid-context.js.map +1 -0
- package/dist/esm/hooks/data-store/is-popular-plan.js +5 -0
- package/dist/esm/hooks/data-store/is-popular-plan.js.map +1 -0
- package/dist/esm/hooks/data-store/types.js +2 -0
- package/dist/esm/hooks/data-store/types.js.map +1 -0
- package/dist/esm/hooks/data-store/use-grid-plan-for-spotlight.js +16 -0
- package/dist/esm/hooks/data-store/use-grid-plan-for-spotlight.js.map +1 -0
- package/dist/esm/hooks/data-store/use-grid-plans-for-comparison-grid.js +52 -0
- package/dist/esm/hooks/data-store/use-grid-plans-for-comparison-grid.js.map +1 -0
- package/dist/esm/hooks/data-store/use-grid-plans-for-features-grid.js +53 -0
- package/dist/esm/hooks/data-store/use-grid-plans-for-features-grid.js.map +1 -0
- package/dist/esm/hooks/data-store/use-grid-plans.js +249 -0
- package/dist/esm/hooks/data-store/use-grid-plans.js.map +1 -0
- package/dist/esm/hooks/data-store/use-highlight-labels.js +58 -0
- package/dist/esm/hooks/data-store/use-highlight-labels.js.map +1 -0
- package/dist/esm/hooks/data-store/use-highlighted-features.js +33 -0
- package/dist/esm/hooks/data-store/use-highlighted-features.js.map +1 -0
- package/dist/esm/hooks/data-store/use-plan-billing-description.js +213 -0
- package/dist/esm/hooks/data-store/use-plan-billing-description.js.map +1 -0
- package/dist/esm/hooks/data-store/use-plan-features-for-grid-plans.js +130 -0
- package/dist/esm/hooks/data-store/use-plan-features-for-grid-plans.js.map +1 -0
- package/dist/esm/hooks/data-store/use-plans-from-types.js +27 -0
- package/dist/esm/hooks/data-store/use-plans-from-types.js.map +1 -0
- package/dist/esm/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js +87 -0
- package/dist/esm/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js.map +1 -0
- package/dist/esm/hooks/use-grid-size.js +29 -0
- package/dist/esm/hooks/use-grid-size.js.map +1 -0
- package/dist/esm/hooks/use-highlight-adjacency-matrix.js +29 -0
- package/dist/esm/hooks/use-highlight-adjacency-matrix.js.map +1 -0
- package/dist/esm/hooks/use-is-large-currency.js +66 -0
- package/dist/esm/hooks/use-is-large-currency.js.map +1 -0
- package/dist/esm/hooks/use-manage-tooltip-toggle.js +25 -0
- package/dist/esm/hooks/use-manage-tooltip-toggle.js.map +1 -0
- package/dist/esm/hooks/use-plan-pricing-info-from-grid-plans.js +13 -0
- package/dist/esm/hooks/use-plan-pricing-info-from-grid-plans.js.map +1 -0
- package/dist/esm/index.js +28 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/filter-unused-features-object.js +17 -0
- package/dist/esm/lib/filter-unused-features-object.js.map +1 -0
- package/dist/esm/lib/get-plan-features-object.js +9 -0
- package/dist/esm/lib/get-plan-features-object.js.map +1 -0
- package/dist/esm/lib/get-plan-pricing-info-from-grid-plans.js +12 -0
- package/dist/esm/lib/get-plan-pricing-info-from-grid-plans.js.map +1 -0
- package/dist/esm/lib/is-same-plan.js +8 -0
- package/dist/esm/lib/is-same-plan.js.map +1 -0
- package/dist/esm/lib/sort-plan-properties.js +35 -0
- package/dist/esm/lib/sort-plan-properties.js.map +1 -0
- package/dist/esm/lib/touch-detect/index.js +16 -0
- package/dist/esm/lib/touch-detect/index.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/tsconfig-cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/__mocks__/wpcom-proxy-request.d.ts +8 -0
- package/dist/types/__mocks__/wpcom-proxy-request.d.ts.map +1 -0
- package/dist/types/components/comparison-grid/index.d.ts +5 -0
- package/dist/types/components/comparison-grid/index.d.ts.map +1 -0
- package/dist/types/components/comparison-grid/index.stories.d.ts +66 -0
- package/dist/types/components/comparison-grid/index.stories.d.ts.map +1 -0
- package/dist/types/components/dropdown-option.d.ts +10 -0
- package/dist/types/components/dropdown-option.d.ts.map +1 -0
- package/dist/types/components/features-grid/billing-timeframes.d.ts +11 -0
- package/dist/types/components/features-grid/billing-timeframes.d.ts.map +1 -0
- package/dist/types/components/features-grid/client-logo-list/client-list.d.ts +11 -0
- package/dist/types/components/features-grid/client-logo-list/client-list.d.ts.map +1 -0
- package/dist/types/components/features-grid/client-logo-list/index.d.ts +4 -0
- package/dist/types/components/features-grid/client-logo-list/index.d.ts.map +1 -0
- package/dist/types/components/features-grid/enterprise-features.d.ts +11 -0
- package/dist/types/components/features-grid/enterprise-features.d.ts.map +1 -0
- package/dist/types/components/features-grid/index.d.ts +5 -0
- package/dist/types/components/features-grid/index.d.ts.map +1 -0
- package/dist/types/components/features-grid/index.stories.d.ts +173 -0
- package/dist/types/components/features-grid/index.stories.d.ts.map +1 -0
- package/dist/types/components/features-grid/mobile-free-domain.d.ts +8 -0
- package/dist/types/components/features-grid/mobile-free-domain.d.ts.map +1 -0
- package/dist/types/components/features-grid/plan-features-list.d.ts +31 -0
- package/dist/types/components/features-grid/plan-features-list.d.ts.map +1 -0
- package/dist/types/components/features-grid/plan-headers.d.ts +10 -0
- package/dist/types/components/features-grid/plan-headers.d.ts.map +1 -0
- package/dist/types/components/features-grid/plan-logos.d.ts +11 -0
- package/dist/types/components/features-grid/plan-logos.d.ts.map +1 -0
- package/dist/types/components/features-grid/plan-prices.d.ts +11 -0
- package/dist/types/components/features-grid/plan-prices.d.ts.map +1 -0
- package/dist/types/components/features-grid/plan-tagline.d.ts +10 -0
- package/dist/types/components/features-grid/plan-tagline.d.ts.map +1 -0
- package/dist/types/components/features-grid/previous-features-included-title.d.ts +10 -0
- package/dist/types/components/features-grid/previous-features-included-title.d.ts.map +1 -0
- package/dist/types/components/features-grid/spotlight-plan.d.ts +17 -0
- package/dist/types/components/features-grid/spotlight-plan.d.ts.map +1 -0
- package/dist/types/components/features-grid/table.d.ts +26 -0
- package/dist/types/components/features-grid/table.d.ts.map +1 -0
- package/dist/types/components/features-grid/top-buttons.d.ts +14 -0
- package/dist/types/components/features-grid/top-buttons.d.ts.map +1 -0
- package/dist/types/components/features.d.ts +17 -0
- package/dist/types/components/features.d.ts.map +1 -0
- package/dist/types/components/item.d.ts +5 -0
- package/dist/types/components/item.d.ts.map +1 -0
- package/dist/types/components/plan-button/index.d.ts +17 -0
- package/dist/types/components/plan-button/index.d.ts.map +1 -0
- package/dist/types/components/plan-div-td-container.d.ts +7 -0
- package/dist/types/components/plan-div-td-container.d.ts.map +1 -0
- package/dist/types/components/plan-logo.d.ts +12 -0
- package/dist/types/components/plan-logo.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/components/interval-type-dropdown.d.ts +4 -0
- package/dist/types/components/plan-type-selector/components/interval-type-dropdown.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/components/interval-type-selector.d.ts +4 -0
- package/dist/types/components/plan-type-selector/components/interval-type-selector.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/components/interval-type-toggle.d.ts +4 -0
- package/dist/types/components/plan-type-selector/components/interval-type-toggle.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/components/popup-messages.d.ts +9 -0
- package/dist/types/components/plan-type-selector/components/popup-messages.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/hooks/use-interval-options.d.ts +11 -0
- package/dist/types/components/plan-type-selector/hooks/use-interval-options.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/hooks/use-max-discount.d.ts +4 -0
- package/dist/types/components/plan-type-selector/hooks/use-max-discount.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.d.ts +10 -0
- package/dist/types/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/index.d.ts +6 -0
- package/dist/types/components/plan-type-selector/index.d.ts.map +1 -0
- package/dist/types/components/plans-2023-tooltip.d.ts +11 -0
- package/dist/types/components/plans-2023-tooltip.d.ts.map +1 -0
- package/dist/types/components/popular-badge.d.ts +9 -0
- package/dist/types/components/popular-badge.d.ts.map +1 -0
- package/dist/types/components/shared/action-button/index.d.ts +19 -0
- package/dist/types/components/shared/action-button/index.d.ts.map +1 -0
- package/dist/types/components/shared/billing-timeframe/index.d.ts +8 -0
- package/dist/types/components/shared/billing-timeframe/index.d.ts.map +1 -0
- package/dist/types/components/shared/header-price/header-price-context.d.ts +12 -0
- package/dist/types/components/shared/header-price/header-price-context.d.ts.map +1 -0
- package/dist/types/components/shared/header-price/index.d.ts +11 -0
- package/dist/types/components/shared/header-price/index.d.ts.map +1 -0
- package/dist/types/components/shared/plan-pill/index.d.ts +3 -0
- package/dist/types/components/shared/plan-pill/index.d.ts.map +1 -0
- package/dist/types/components/shared/storage/components/plan-storage.d.ts +13 -0
- package/dist/types/components/shared/storage/components/plan-storage.d.ts.map +1 -0
- package/dist/types/components/shared/storage/components/storage-dropdown.d.ts +9 -0
- package/dist/types/components/shared/storage/components/storage-dropdown.d.ts.map +1 -0
- package/dist/types/components/shared/storage/components/storage-feature-label.d.ts +7 -0
- package/dist/types/components/shared/storage/components/storage-feature-label.d.ts.map +1 -0
- package/dist/types/components/shared/storage/constants.d.ts +2 -0
- package/dist/types/components/shared/storage/constants.d.ts.map +1 -0
- package/dist/types/components/shared/storage/hooks/use-default-storage-option.d.ts +14 -0
- package/dist/types/components/shared/storage/hooks/use-default-storage-option.d.ts.map +1 -0
- package/dist/types/components/shared/storage/hooks/use-plan-storage.d.ts +4 -0
- package/dist/types/components/shared/storage/hooks/use-plan-storage.d.ts.map +1 -0
- package/dist/types/components/shared/storage/hooks/use-purchased-storage-add-on.d.ts +3 -0
- package/dist/types/components/shared/storage/hooks/use-purchased-storage-add-on.d.ts.map +1 -0
- package/dist/types/components/shared/storage/hooks/use-storage-string.d.ts +4 -0
- package/dist/types/components/shared/storage/hooks/use-storage-string.d.ts.map +1 -0
- package/dist/types/components/shared/storage/index.d.ts +9 -0
- package/dist/types/components/shared/storage/index.d.ts.map +1 -0
- package/dist/types/components/sticky-container.d.ts +33 -0
- package/dist/types/components/sticky-container.d.ts.map +1 -0
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/css-mixins.d.ts +3 -0
- package/dist/types/css-mixins.d.ts.map +1 -0
- package/dist/types/fixtures/plans.d.ts +201 -0
- package/dist/types/fixtures/plans.d.ts.map +1 -0
- package/dist/types/fixtures/sites-plans.d.ts +457 -0
- package/dist/types/fixtures/sites-plans.d.ts.map +1 -0
- package/dist/types/fixtures/sites-purchases.d.ts +96 -0
- package/dist/types/fixtures/sites-purchases.d.ts.map +1 -0
- package/dist/types/grid-context.d.ts +40 -0
- package/dist/types/grid-context.d.ts.map +1 -0
- package/dist/types/hooks/data-store/is-popular-plan.d.ts +2 -0
- package/dist/types/hooks/data-store/is-popular-plan.d.ts.map +1 -0
- package/dist/types/hooks/data-store/types.d.ts +40 -0
- package/dist/types/hooks/data-store/types.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-grid-plan-for-spotlight.d.ts +10 -0
- package/dist/types/hooks/data-store/use-grid-plan-for-spotlight.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-grid-plans-for-comparison-grid.d.ts +5 -0
- package/dist/types/hooks/data-store/use-grid-plans-for-comparison-grid.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-grid-plans-for-features-grid.d.ts +5 -0
- package/dist/types/hooks/data-store/use-grid-plans-for-features-grid.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-grid-plans.d.ts +13 -0
- package/dist/types/hooks/data-store/use-grid-plans.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-highlight-labels.d.ts +20 -0
- package/dist/types/hooks/data-store/use-highlight-labels.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-highlighted-features.d.ts +22 -0
- package/dist/types/hooks/data-store/use-highlighted-features.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-plan-billing-description.d.ts +16 -0
- package/dist/types/hooks/data-store/use-plan-billing-description.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-plan-features-for-grid-plans.d.ts +21 -0
- package/dist/types/hooks/data-store/use-plan-features-for-grid-plans.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-plans-from-types.d.ts +10 -0
- package/dist/types/hooks/data-store/use-plans-from-types.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-restructured-plan-features-for-comparison-grid.d.ts +15 -0
- package/dist/types/hooks/data-store/use-restructured-plan-features-for-comparison-grid.d.ts.map +1 -0
- package/dist/types/hooks/use-grid-size.d.ts +18 -0
- package/dist/types/hooks/use-grid-size.d.ts.map +1 -0
- package/dist/types/hooks/use-highlight-adjacency-matrix.d.ts +15 -0
- package/dist/types/hooks/use-highlight-adjacency-matrix.d.ts.map +1 -0
- package/dist/types/hooks/use-is-large-currency.d.ts +16 -0
- package/dist/types/hooks/use-is-large-currency.d.ts.map +1 -0
- package/dist/types/hooks/use-manage-tooltip-toggle.d.ts +3 -0
- package/dist/types/hooks/use-manage-tooltip-toggle.d.ts.map +1 -0
- package/dist/types/hooks/use-plan-pricing-info-from-grid-plans.d.ts +11 -0
- package/dist/types/hooks/use-plan-pricing-info-from-grid-plans.d.ts.map +1 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/filter-unused-features-object.d.ts +8 -0
- package/dist/types/lib/filter-unused-features-object.d.ts.map +1 -0
- package/dist/types/lib/get-plan-features-object.d.ts +4 -0
- package/dist/types/lib/get-plan-features-object.d.ts.map +1 -0
- package/dist/types/lib/get-plan-pricing-info-from-grid-plans.d.ts +9 -0
- package/dist/types/lib/get-plan-pricing-info-from-grid-plans.d.ts.map +1 -0
- package/dist/types/lib/is-same-plan.d.ts +3 -0
- package/dist/types/lib/is-same-plan.d.ts.map +1 -0
- package/dist/types/lib/sort-plan-properties.d.ts +3 -0
- package/dist/types/lib/sort-plan-properties.d.ts.map +1 -0
- package/dist/types/lib/touch-detect/index.d.ts +11 -0
- package/dist/types/lib/touch-detect/index.d.ts.map +1 -0
- package/dist/types/types.d.ts +225 -0
- package/dist/types/types.d.ts.map +1 -0
- package/package.json +83 -0
- package/src/__mocks__/wpcom-proxy-request.js +13 -0
- package/src/_media-queries.scss +14 -0
- package/src/_mixins.scss +15 -0
- package/src/_shared.scss +174 -0
- package/src/components/comparison-grid/README.md +3 -0
- package/src/components/comparison-grid/index.stories.tsx +91 -0
- package/src/components/comparison-grid/index.tsx +1215 -0
- package/src/components/comparison-grid/style.scss +318 -0
- package/src/components/dropdown-option.tsx +44 -0
- package/src/components/features-grid/README.md +3 -0
- package/src/components/features-grid/billing-timeframes.tsx +37 -0
- package/src/components/features-grid/client-logo-list/client-list.tsx +199 -0
- package/src/components/features-grid/client-logo-list/index.tsx +24 -0
- package/src/components/features-grid/client-logo-list/style.scss +52 -0
- package/src/components/features-grid/enterprise-features.tsx +101 -0
- package/src/components/features-grid/index.stories.tsx +143 -0
- package/src/components/features-grid/index.tsx +442 -0
- package/src/components/features-grid/mobile-free-domain.tsx +51 -0
- package/src/components/features-grid/plan-features-list.tsx +187 -0
- package/src/components/features-grid/plan-headers.tsx +31 -0
- package/src/components/features-grid/plan-logos.tsx +27 -0
- package/src/components/features-grid/plan-prices.tsx +37 -0
- package/src/components/features-grid/plan-tagline.tsx +25 -0
- package/src/components/features-grid/previous-features-included-title.tsx +66 -0
- package/src/components/features-grid/spotlight-plan.scss +5 -0
- package/src/components/features-grid/spotlight-plan.tsx +77 -0
- package/src/components/features-grid/style.scss +630 -0
- package/src/components/features-grid/table.tsx +185 -0
- package/src/components/features-grid/top-buttons.tsx +49 -0
- package/src/components/features.tsx +168 -0
- package/src/components/item.tsx +9 -0
- package/src/components/plan-button/index.tsx +59 -0
- package/src/components/plan-button/style.scss +179 -0
- package/src/components/plan-div-td-container.tsx +15 -0
- package/src/components/plan-logo.tsx +111 -0
- package/src/components/plan-type-selector/components/interval-type-dropdown.tsx +70 -0
- package/src/components/plan-type-selector/components/interval-type-selector.tsx +13 -0
- package/src/components/plan-type-selector/components/interval-type-toggle.tsx +100 -0
- package/src/components/plan-type-selector/components/popup-messages.tsx +128 -0
- package/src/components/plan-type-selector/hooks/use-interval-options.tsx +89 -0
- package/src/components/plan-type-selector/hooks/use-max-discount.ts +64 -0
- package/src/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.ts +99 -0
- package/src/components/plan-type-selector/index.tsx +50 -0
- package/src/components/plan-type-selector/style.scss +196 -0
- package/src/components/plans-2023-tooltip.tsx +85 -0
- package/src/components/popular-badge.tsx +30 -0
- package/src/components/shared/README.md +1 -0
- package/src/components/shared/action-button/index.tsx +205 -0
- package/src/components/shared/action-button/style.scss +12 -0
- package/src/components/shared/billing-timeframe/index.tsx +106 -0
- package/src/components/shared/header-price/header-price-context.tsx +24 -0
- package/src/components/shared/header-price/index.tsx +278 -0
- package/src/components/shared/header-price/style.scss +112 -0
- package/src/components/shared/plan-pill/index.jsx +7 -0
- package/src/components/shared/plan-pill/style.scss +30 -0
- package/src/components/shared/storage/components/plan-storage.tsx +51 -0
- package/src/components/shared/storage/components/storage-dropdown.tsx +187 -0
- package/src/components/shared/storage/components/storage-feature-label.tsx +68 -0
- package/src/components/shared/storage/constants.ts +3 -0
- package/src/components/shared/storage/hooks/use-default-storage-option.ts +34 -0
- package/src/components/shared/storage/hooks/use-plan-storage.ts +41 -0
- package/src/components/shared/storage/hooks/use-purchased-storage-add-on.ts +53 -0
- package/src/components/shared/storage/hooks/use-storage-string.ts +13 -0
- package/src/components/shared/storage/index.ts +9 -0
- package/src/components/sticky-container.tsx +146 -0
- package/src/components/test/actions-button.tsx +397 -0
- package/src/components/test/billing-timeframe.tsx +341 -0
- package/src/components/test/header-price.tsx +189 -0
- package/src/components/test/plan-type-selector.tsx +44 -0
- package/src/constants.ts +13 -0
- package/src/css-mixins.tsx +11 -0
- package/src/fixtures/plans.ts +1539 -0
- package/src/fixtures/sites-plans.ts +455 -0
- package/src/fixtures/sites-purchases.ts +130 -0
- package/src/grid-context.tsx +104 -0
- package/src/hooks/data-store/is-popular-plan.ts +5 -0
- package/src/hooks/data-store/types.ts +41 -0
- package/src/hooks/data-store/use-grid-plan-for-spotlight.ts +35 -0
- package/src/hooks/data-store/use-grid-plans-for-comparison-grid.ts +81 -0
- package/src/hooks/data-store/use-grid-plans-for-features-grid.ts +79 -0
- package/src/hooks/data-store/use-grid-plans.tsx +360 -0
- package/src/hooks/data-store/use-highlight-labels.ts +88 -0
- package/src/hooks/data-store/use-highlighted-features.ts +51 -0
- package/src/hooks/data-store/use-plan-billing-description.tsx +309 -0
- package/src/hooks/data-store/use-plan-features-for-grid-plans.ts +219 -0
- package/src/hooks/data-store/use-plans-from-types.ts +51 -0
- package/src/hooks/data-store/use-restructured-plan-features-for-comparison-grid.ts +158 -0
- package/src/hooks/test/use-is-large-currency.ts +69 -0
- package/src/hooks/use-grid-size.ts +46 -0
- package/src/hooks/use-highlight-adjacency-matrix.ts +48 -0
- package/src/hooks/use-is-large-currency.ts +91 -0
- package/src/hooks/use-manage-tooltip-toggle.ts +30 -0
- package/src/hooks/use-plan-pricing-info-from-grid-plans.ts +36 -0
- package/src/index.tsx +46 -0
- package/src/lib/filter-unused-features-object.ts +31 -0
- package/src/lib/get-plan-features-object.ts +12 -0
- package/src/lib/get-plan-pricing-info-from-grid-plans.ts +31 -0
- package/src/lib/is-same-plan.ts +8 -0
- package/src/lib/sort-plan-properties.ts +46 -0
- package/src/lib/test/filter-plan-features-object.ts +65 -0
- package/src/lib/test/sort-plan-properties.ts +104 -0
- package/src/lib/touch-detect/README.md +11 -0
- package/src/lib/touch-detect/index.js +17 -0
- package/src/types.ts +340 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const calypso_products_1 = require("@automattic/calypso-products");
|
|
4
|
+
const i18n_calypso_1 = require("i18n-calypso");
|
|
5
|
+
const is_same_plan_1 = require("../../lib/is-same-plan");
|
|
6
|
+
const is_popular_plan_1 = require("./is-popular-plan");
|
|
7
|
+
// TODO clk: move to plans data store
|
|
8
|
+
const useHighlightLabels = ({ intent, planSlugs, currentSitePlanSlug, selectedPlan, plansAvailabilityForPurchase, highlightLabelOverrides, isDomainOnlySite, }) => {
|
|
9
|
+
const translate = (0, i18n_calypso_1.useTranslate)();
|
|
10
|
+
return planSlugs.reduce((acc, planSlug) => {
|
|
11
|
+
if (highlightLabelOverrides?.[planSlug]) {
|
|
12
|
+
return {
|
|
13
|
+
...acc,
|
|
14
|
+
[planSlug]: highlightLabelOverrides[planSlug],
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const isCurrentPlan = currentSitePlanSlug
|
|
18
|
+
? (0, is_same_plan_1.isSamePlan)(currentSitePlanSlug, planSlug) && !isDomainOnlySite
|
|
19
|
+
: false;
|
|
20
|
+
const isPlanAvailableForPurchase = plansAvailabilityForPurchase?.[planSlug];
|
|
21
|
+
const isSuggestedPlan = selectedPlan && (0, calypso_products_1.planLevelsMatch)(planSlug, selectedPlan) && isPlanAvailableForPurchase;
|
|
22
|
+
let label;
|
|
23
|
+
if (isCurrentPlan) {
|
|
24
|
+
label = translate('Your plan');
|
|
25
|
+
}
|
|
26
|
+
else if (!isPlanAvailableForPurchase) {
|
|
27
|
+
label = null;
|
|
28
|
+
}
|
|
29
|
+
else if (isSuggestedPlan) {
|
|
30
|
+
label = translate('Suggested');
|
|
31
|
+
}
|
|
32
|
+
else if ('plans-newsletter' === intent) {
|
|
33
|
+
if ((0, calypso_products_1.isPersonalPlan)(planSlug)) {
|
|
34
|
+
label = translate('Best for Newsletter');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else if ('plans-videopress' === intent) {
|
|
38
|
+
if ((0, calypso_products_1.isBusinessPlan)(planSlug)) {
|
|
39
|
+
label = translate('Best for Video');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else if ('plans-blog-onboarding' === intent) {
|
|
43
|
+
if ((0, calypso_products_1.isPremiumPlan)(planSlug)) {
|
|
44
|
+
label = translate('Best for Blog');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else if ((0, calypso_products_1.isBusinessPlan)(planSlug) && !selectedPlan) {
|
|
48
|
+
label = translate('Best for devs');
|
|
49
|
+
}
|
|
50
|
+
else if ((0, is_popular_plan_1.isPopularPlan)(planSlug) && !selectedPlan) {
|
|
51
|
+
label = translate('Popular');
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
...acc,
|
|
55
|
+
[planSlug]: label ?? null,
|
|
56
|
+
};
|
|
57
|
+
}, {});
|
|
58
|
+
};
|
|
59
|
+
exports.default = useHighlightLabels;
|
|
60
|
+
//# sourceMappingURL=use-highlight-labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-highlight-labels.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-highlight-labels.ts"],"names":[],"mappings":";;AAAA,mEAMsC;AACtC,+CAA4C;AAC5C,yDAAoD;AACpD,uDAAkD;AAgBlD,qCAAqC;AACrC,MAAM,kBAAkB,GAAG,CAAE,EAC5B,MAAM,EACN,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,4BAA4B,EAC5B,uBAAuB,EACvB,gBAAgB,GACT,EAAG,EAAE;IACZ,MAAM,SAAS,GAAG,IAAA,2BAAY,GAAE,CAAC;IAEjC,OAAO,SAAS,CAAC,MAAM,CACtB,CAAE,GAAG,EAAE,QAAQ,EAAG,EAAE;QACnB,IAAK,uBAAuB,EAAE,CAAE,QAAQ,CAAE,EAAG,CAAC;YAC7C,OAAO;gBACN,GAAG,GAAG;gBACN,CAAE,QAAQ,CAAE,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AI,CAAE,YAAY,EAAG,CAAC;YAC3D,KAAK,GAAG,SAAS,CAAE,eAAe,CAAE,CAAC;QACtC,CAAC;aAAM,IAAK,IAAA,+BAAa,EAAE,QAAQ,CAAE,IAAI,CAAE,YAAY,EAAG,CAAC;YAC1D,KAAK,GAAG,SAAS,CAAE,SAAS,CAAE,CAAC;QAChC,CAAC;QAED,OAAO;YACN,GAAG,GAAG;YACN,CAAE,QAAQ,CAAE,EAAE,KAAK,IAAI,IAAI;SAC3B,CAAC;IACH,CAAC,EACD,EAAgD,CAChD,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const calypso_products_1 = require("@automattic/calypso-products");
|
|
4
|
+
const element_1 = require("@wordpress/element");
|
|
5
|
+
/**
|
|
6
|
+
* Returns an array of features that, if they exist for a
|
|
7
|
+
* particular Plan on a pricing table, will be highlighted
|
|
8
|
+
* (ie, moved to the top of the list, and bolded).
|
|
9
|
+
*
|
|
10
|
+
* Will only affect wpcomeFeatures, not jetpackFeatures. And
|
|
11
|
+
* if the specified features don't exist for a particular
|
|
12
|
+
* Plan, they will be ignored.
|
|
13
|
+
*
|
|
14
|
+
* The Logic for processing the highlightedFeatures
|
|
15
|
+
* lives in the adjacent usePlanFeaturesForGridPlans hook.
|
|
16
|
+
*
|
|
17
|
+
* TODO clk: move to plans data store
|
|
18
|
+
*/
|
|
19
|
+
const useHighlightedFeatures = ({ intent, isInSignup }) => {
|
|
20
|
+
return (0, element_1.useMemo)(() => {
|
|
21
|
+
if (isInSignup && intent && 'plans-newsletter' === intent) {
|
|
22
|
+
return [
|
|
23
|
+
calypso_products_1.FEATURE_CUSTOM_DOMAIN,
|
|
24
|
+
calypso_products_1.FEATURE_NEWSLETTER_IMPORT_SUBSCRIBERS_FREE,
|
|
25
|
+
calypso_products_1.FEATURE_UNLIMITED_SUBSCRIBERS,
|
|
26
|
+
calypso_products_1.FEATURE_PAYMENT_TRANSACTION_FEES_10,
|
|
27
|
+
calypso_products_1.FEATURE_PAYMENT_TRANSACTION_FEES_8,
|
|
28
|
+
calypso_products_1.FEATURE_PAYMENT_TRANSACTION_FEES_4,
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}, [intent, isInSignup]);
|
|
33
|
+
};
|
|
34
|
+
exports.default = useHighlightedFeatures;
|
|
35
|
+
//# sourceMappingURL=use-highlighted-features.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-highlighted-features.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-highlighted-features.ts"],"names":[],"mappings":";;AAAA,mEAOsC;AACtC,gDAA6C;AAW7C;;;;;;;;;;;;;GAaG;AACH,MAAM,sBAAsB,GAA2B,CAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAAG,EAAE;IACnF,OAAO,IAAA,iBAAO,EAAE,GAAG,EAAE;QACpB,IAAK,UAAU,IAAI,MAAM,IAAI,kBAAkB,KAAK,MAAM,EAAG,CAAC;YAC7D,OAAO;gBACN,wCAAqB;gBACrB,6DAA0C;gBAC1C,gDAA6B;gBAC7B,sDAAmC;gBACnC,qDAAkC;gBAClC,qDAAkC;aAClC,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC,EAAE,CAAE,MAAM,EAAE,UAAU,CAAE,CAAE,CAAC;AAC7B,CAAC,CAAC;AAEF,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const calypso_products_1 = require("@automattic/calypso-products");
|
|
5
|
+
const data_stores_1 = require("@automattic/data-stores");
|
|
6
|
+
const i18n_calypso_1 = require("i18n-calypso");
|
|
7
|
+
const grid_context_1 = require("../../grid-context");
|
|
8
|
+
function usePlanBillingDescription({ siteId, planSlug, pricing, isMonthlyPlan, coupon, useCheckPlanAvailabilityForPurchase, }) {
|
|
9
|
+
const translate = (0, i18n_calypso_1.useTranslate)();
|
|
10
|
+
const { currencyCode, originalPrice, discountedPrice, billingPeriod, introOffer } = pricing || {};
|
|
11
|
+
const { reflectStorageSelectionInPlanPrices } = (0, grid_context_1.usePlansGridContext)();
|
|
12
|
+
const yearlyVariantPlanSlug = (0, calypso_products_1.getPlanSlugForTermVariant)(planSlug, calypso_products_1.TERM_ANNUALLY);
|
|
13
|
+
const yearlyVariantPricing = data_stores_1.Plans.usePricingMetaForGridPlans({
|
|
14
|
+
planSlugs: yearlyVariantPlanSlug ? [yearlyVariantPlanSlug] : [],
|
|
15
|
+
coupon,
|
|
16
|
+
siteId,
|
|
17
|
+
useCheckPlanAvailabilityForPurchase,
|
|
18
|
+
reflectStorageSelectionInPlanPrices,
|
|
19
|
+
})?.[yearlyVariantPlanSlug ?? ''];
|
|
20
|
+
if (!pricing) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if ((0, calypso_products_1.isWpComFreePlan)(planSlug) ||
|
|
24
|
+
(0, calypso_products_1.isWpcomEnterpriseGridPlan)(planSlug) ||
|
|
25
|
+
planSlug === calypso_products_1.PLAN_HOSTING_TRIAL_MONTHLY) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
if (isMonthlyPlan &&
|
|
29
|
+
originalPrice?.monthly &&
|
|
30
|
+
yearlyVariantPricing &&
|
|
31
|
+
(!introOffer || introOffer.isOfferComplete)) {
|
|
32
|
+
const yearlyVariantMaybeDiscountedPrice = Number.isFinite(yearlyVariantPricing.discountedPrice?.monthly)
|
|
33
|
+
? yearlyVariantPricing.discountedPrice?.monthly
|
|
34
|
+
: yearlyVariantPricing.originalPrice?.monthly;
|
|
35
|
+
if (yearlyVariantMaybeDiscountedPrice &&
|
|
36
|
+
yearlyVariantMaybeDiscountedPrice < originalPrice.monthly) {
|
|
37
|
+
return translate(`Save %(discountRate)s%% by paying annually`, {
|
|
38
|
+
args: {
|
|
39
|
+
discountRate: Math.floor((100 * (originalPrice.monthly - yearlyVariantMaybeDiscountedPrice)) /
|
|
40
|
+
originalPrice.monthly),
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const discountedPriceFullTermText = currencyCode && typeof discountedPrice?.full === 'number'
|
|
47
|
+
? (0, i18n_calypso_1.formatCurrency)(discountedPrice.full, currencyCode, {
|
|
48
|
+
stripZeros: true,
|
|
49
|
+
isSmallestUnit: true,
|
|
50
|
+
})
|
|
51
|
+
: null;
|
|
52
|
+
const originalPriceFullTermText = currencyCode && originalPrice?.full
|
|
53
|
+
? (0, i18n_calypso_1.formatCurrency)(originalPrice.full, currencyCode, {
|
|
54
|
+
stripZeros: true,
|
|
55
|
+
isSmallestUnit: true,
|
|
56
|
+
})
|
|
57
|
+
: null;
|
|
58
|
+
/*
|
|
59
|
+
* The introOffer billing should fall below into the next block once experiment with Woo plans is finalized.
|
|
60
|
+
* 1. We only expose introOffers to monthly & yearly plans for now (so no need to introduce more translations just yet)
|
|
61
|
+
* 2. We only expose month & year based intervals for now (so no need to introduce more translations just yet)
|
|
62
|
+
*/
|
|
63
|
+
if (introOffer?.intervalCount && introOffer.intervalUnit && !introOffer.isOfferComplete) {
|
|
64
|
+
const discountedPriceFull = typeof discountedPrice?.full === 'number' ? discountedPrice.full : introOffer?.rawPrice?.full;
|
|
65
|
+
const introOfferFullTermText = currencyCode && typeof discountedPriceFull === 'number'
|
|
66
|
+
? (0, i18n_calypso_1.formatCurrency)(discountedPriceFull, currencyCode, {
|
|
67
|
+
stripZeros: true,
|
|
68
|
+
isSmallestUnit: true,
|
|
69
|
+
})
|
|
70
|
+
: null;
|
|
71
|
+
if (originalPriceFullTermText && introOfferFullTermText) {
|
|
72
|
+
/* Introductory offers for monthly plans */
|
|
73
|
+
if (isMonthlyPlan) {
|
|
74
|
+
/* If the offer is for X months */
|
|
75
|
+
if ('month' === introOffer.intervalUnit) {
|
|
76
|
+
if (1 === introOffer.intervalCount) {
|
|
77
|
+
return translate('for your first month,{{br/}}' + 'then %(rawPrice)s billed monthly, excl. taxes', {
|
|
78
|
+
args: {
|
|
79
|
+
rawPrice: originalPriceFullTermText,
|
|
80
|
+
},
|
|
81
|
+
components: { br: (0, jsx_runtime_1.jsx)("br", {}) },
|
|
82
|
+
comment: 'excl. taxes is short for excluding taxes',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return translate('for your first %(introOfferIntervalCount)s months,{{br/}}' +
|
|
86
|
+
'then %(rawPrice)s billed monthly, excl. taxes', {
|
|
87
|
+
args: {
|
|
88
|
+
rawPrice: originalPriceFullTermText,
|
|
89
|
+
introOfferIntervalCount: introOffer.intervalCount,
|
|
90
|
+
},
|
|
91
|
+
components: { br: (0, jsx_runtime_1.jsx)("br", {}) },
|
|
92
|
+
comment: 'excl. taxes is short for excluding taxes',
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/* If the offer is for X years of monthly intervals */
|
|
96
|
+
if ('year' === introOffer.intervalUnit) {
|
|
97
|
+
if (1 === introOffer.intervalCount) {
|
|
98
|
+
return translate('for your first year,{{br/}}' + 'then %(rawPrice)s billed monthly, excl. taxes', {
|
|
99
|
+
args: {
|
|
100
|
+
rawPrice: originalPriceFullTermText,
|
|
101
|
+
},
|
|
102
|
+
components: { br: (0, jsx_runtime_1.jsx)("br", {}) },
|
|
103
|
+
comment: 'excl. taxes is short for excluding taxes',
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return translate('per month, for your first %(introOfferIntervalCount)s years,{{br/}}' +
|
|
107
|
+
'then %(rawPrice)s billed monthly, excl. taxes', {
|
|
108
|
+
args: {
|
|
109
|
+
rawPrice: originalPriceFullTermText,
|
|
110
|
+
introOfferIntervalCount: introOffer.intervalCount,
|
|
111
|
+
},
|
|
112
|
+
components: { br: (0, jsx_runtime_1.jsx)("br", {}) },
|
|
113
|
+
comment: 'excl. taxes is short for excluding taxes',
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/* Introductory offers for yearly plans */
|
|
118
|
+
if (calypso_products_1.PLAN_ANNUAL_PERIOD === billingPeriod) {
|
|
119
|
+
/* If the offer is for X months of a yearly plan */
|
|
120
|
+
if ('month' === introOffer.intervalUnit) {
|
|
121
|
+
if (1 === introOffer.intervalCount) {
|
|
122
|
+
return translate('for your first month,{{br/}}' + 'then %(rawPrice)s billed annually, excl. taxes', {
|
|
123
|
+
args: {
|
|
124
|
+
rawPrice: originalPriceFullTermText,
|
|
125
|
+
introOfferIntervalUnit: introOffer.intervalUnit,
|
|
126
|
+
},
|
|
127
|
+
components: { br: (0, jsx_runtime_1.jsx)("br", {}) },
|
|
128
|
+
comment: 'excl. taxes is short for excluding taxes',
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return translate('for your first %(introOfferIntervalCount)s months,{{br/}}' +
|
|
132
|
+
'then %(rawPrice)s billed annually, excl. taxes', {
|
|
133
|
+
args: {
|
|
134
|
+
rawPrice: originalPriceFullTermText,
|
|
135
|
+
introOfferIntervalCount: introOffer.intervalCount,
|
|
136
|
+
},
|
|
137
|
+
components: { br: (0, jsx_runtime_1.jsx)("br", {}) },
|
|
138
|
+
comment: 'excl. taxes is short for excluding taxes',
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/* If the offer is for X years of a yearly plan */
|
|
142
|
+
if ('year' === introOffer.intervalUnit) {
|
|
143
|
+
if (1 === introOffer.intervalCount) {
|
|
144
|
+
return translate('per month, %(introOfferFormattedPrice)s for your first year,{{br/}}' +
|
|
145
|
+
'then %(rawPrice)s billed annually, excl. taxes', {
|
|
146
|
+
args: {
|
|
147
|
+
introOfferFormattedPrice: introOfferFullTermText,
|
|
148
|
+
rawPrice: originalPriceFullTermText,
|
|
149
|
+
},
|
|
150
|
+
components: { br: (0, jsx_runtime_1.jsx)("br", {}) },
|
|
151
|
+
comment: 'excl. taxes is short for excluding taxes',
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return translate('per month, %(introOfferFormattedPrice)s for your first %(introOfferIntervalCount)s years,{{br/}}' +
|
|
155
|
+
'then %(rawPrice)s billed annually, excl. taxes', {
|
|
156
|
+
args: {
|
|
157
|
+
introOfferFormattedPrice: introOfferFullTermText,
|
|
158
|
+
rawPrice: originalPriceFullTermText,
|
|
159
|
+
introOfferIntervalCount: introOffer.intervalCount,
|
|
160
|
+
},
|
|
161
|
+
components: { br: (0, jsx_runtime_1.jsx)("br", {}) },
|
|
162
|
+
comment: 'excl. taxes is short for excluding taxes',
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/*
|
|
168
|
+
* Early return here is for sanity. We don't want to show regular billing descriptions
|
|
169
|
+
* if there is an introOffer (despite that will not be the case, unless some API-level bug happens)
|
|
170
|
+
*/
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
if (discountedPriceFullTermText) {
|
|
174
|
+
if (calypso_products_1.PLAN_ANNUAL_PERIOD === billingPeriod) {
|
|
175
|
+
return translate('per month, %(fullTermDiscountedPriceText)s for the first year, excl. taxes', {
|
|
176
|
+
args: { fullTermDiscountedPriceText: discountedPriceFullTermText },
|
|
177
|
+
comment: 'Excl. Taxes is short for excluding taxes',
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
if (calypso_products_1.PLAN_BIENNIAL_PERIOD === billingPeriod) {
|
|
181
|
+
return translate('per month, %(fullTermDiscountedPriceText)s for the first two years, excl. taxes', {
|
|
182
|
+
args: { fullTermDiscountedPriceText: discountedPriceFullTermText },
|
|
183
|
+
comment: 'Excl. Taxes is short for excluding taxes',
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (calypso_products_1.PLAN_TRIENNIAL_PERIOD === billingPeriod) {
|
|
187
|
+
return translate('per month, %(fullTermDiscountedPriceText)s for the first three years, excl. taxes', {
|
|
188
|
+
args: { fullTermDiscountedPriceText: discountedPriceFullTermText },
|
|
189
|
+
comment: 'Excl. Taxes is short for excluding taxes',
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else if (originalPriceFullTermText) {
|
|
194
|
+
if (calypso_products_1.PLAN_ANNUAL_PERIOD === billingPeriod) {
|
|
195
|
+
return translate('per month, %(rawPrice)s billed annually, excl. taxes', {
|
|
196
|
+
args: { rawPrice: originalPriceFullTermText },
|
|
197
|
+
comment: 'Excl. Taxes is short for excluding taxes',
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
if (calypso_products_1.PLAN_BIENNIAL_PERIOD === billingPeriod) {
|
|
201
|
+
return translate('per month, %(rawPrice)s billed every two years, excl. taxes', {
|
|
202
|
+
args: { rawPrice: originalPriceFullTermText },
|
|
203
|
+
comment: 'Excl. Taxes is short for excluding taxes',
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
if (calypso_products_1.PLAN_TRIENNIAL_PERIOD === billingPeriod) {
|
|
207
|
+
return translate('per month, %(rawPrice)s billed every three years, excl. taxes', {
|
|
208
|
+
args: { rawPrice: originalPriceFullTermText },
|
|
209
|
+
comment: 'Excl. Taxes is short for excluding taxes',
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
exports.default = usePlanBillingDescription;
|
|
216
|
+
//# sourceMappingURL=use-plan-billing-description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-plan-billing-description.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-plan-billing-description.tsx"],"names":[],"mappings":";;;AAAA,mEAUsC;AACtC,yDAAgD;AAChD,+CAA4D;AAC5D,qDAAyD;AAazD,SAAwB,yBAAyB,CAAE,EAClD,MAAM,EACN,QAAQ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aACnD,CAAE,CAAC;QACL,CAAC;QAED,IAAK,wCAAqB,KAAK,aAAa,EAAG,CAAC;YAC/C,OAAO,SAAS,CAAE,+DAA+D,EAAE;gBAClF,IAAI,EAAE,EAAE,QAAQ,EAAE,yBAAyB,EAAE;gBAC7C,OAAO,EAAE,0CAA0C;aACnD,CAAE,CAAC;QACL,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AA1RD,4CA0RC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const calypso_products_1 = require("@automattic/calypso-products");
|
|
5
|
+
const element_1 = require("@wordpress/element");
|
|
6
|
+
const get_plan_features_object_1 = tslib_1.__importDefault(require("../../lib/get-plan-features-object"));
|
|
7
|
+
const use_highlighted_features_1 = tslib_1.__importDefault(require("./use-highlighted-features"));
|
|
8
|
+
/**
|
|
9
|
+
* usePlanFeaturesForGridPlans:
|
|
10
|
+
* - these plan features are mainly relevant to FeaturesGrid and Spotlight components
|
|
11
|
+
* - this hook can migrate to data store once features definitions migrate to calypso-products
|
|
12
|
+
*/
|
|
13
|
+
const usePlanFeaturesForGridPlans = ({ gridPlans, allFeaturesList, hasRedeemedDomainCredit, intent, selectedFeature, showLegacyStorageFeature, isInSignup, }) => {
|
|
14
|
+
const highlightedFeatures = (0, use_highlighted_features_1.default)({ intent: intent ?? null, isInSignup });
|
|
15
|
+
return (0, element_1.useMemo)(() => {
|
|
16
|
+
return gridPlans.reduce((acc, gridPlan) => {
|
|
17
|
+
const planSlug = gridPlan.planSlug;
|
|
18
|
+
const planConstantObj = (0, calypso_products_1.applyTestFiltersToPlansList)(planSlug, undefined);
|
|
19
|
+
const isMonthlyPlan = (0, calypso_products_1.isMonthly)(planSlug);
|
|
20
|
+
let wpcomFeatures = [];
|
|
21
|
+
let jetpackFeatures = [];
|
|
22
|
+
if ('plans-newsletter' === intent) {
|
|
23
|
+
wpcomFeatures = (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj?.getNewsletterSignupFeatures?.() ?? []);
|
|
24
|
+
}
|
|
25
|
+
else if ('plans-p2' === intent) {
|
|
26
|
+
wpcomFeatures = (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj?.get2023PricingGridSignupWpcomFeatures?.() ?? []);
|
|
27
|
+
}
|
|
28
|
+
else if ('plans-blog-onboarding' === intent) {
|
|
29
|
+
wpcomFeatures = (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj?.getBlogOnboardingSignupFeatures?.() ?? []);
|
|
30
|
+
jetpackFeatures = (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj.getBlogOnboardingSignupJetpackFeatures?.() ?? []);
|
|
31
|
+
}
|
|
32
|
+
else if ('plans-woocommerce' === intent) {
|
|
33
|
+
wpcomFeatures = (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj?.get2023PricingGridSignupWpcomFeatures?.() ?? []);
|
|
34
|
+
jetpackFeatures = (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj.get2023PricingGridSignupJetpackFeatures?.() ?? []);
|
|
35
|
+
/*
|
|
36
|
+
* Woo Express plans with an introductory offer need some features removed:
|
|
37
|
+
* - custom domain feature removed for all Woo Express plans
|
|
38
|
+
*/
|
|
39
|
+
if (gridPlan.pricing.introOffer) {
|
|
40
|
+
wpcomFeatures = wpcomFeatures.filter((feature) => {
|
|
41
|
+
// Remove the custom domain feature for Woo Express plans with an introductory offer.
|
|
42
|
+
if (calypso_products_1.FEATURE_CUSTOM_DOMAIN === feature.getSlug()) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
wpcomFeatures = (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj?.get2023PricingGridSignupWpcomFeatures?.() ?? []);
|
|
51
|
+
jetpackFeatures = (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj.get2023PricingGridSignupJetpackFeatures?.() ?? []);
|
|
52
|
+
}
|
|
53
|
+
const annualPlansOnlyFeatures = planConstantObj.getAnnualPlansOnlyFeatures?.() || [];
|
|
54
|
+
const wpcomFeaturesTransformed = [];
|
|
55
|
+
const jetpackFeaturesTransformed = jetpackFeatures.map((feature) => {
|
|
56
|
+
const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(feature.getSlug());
|
|
57
|
+
return {
|
|
58
|
+
...feature,
|
|
59
|
+
availableOnlyForAnnualPlans,
|
|
60
|
+
availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
if (highlightedFeatures) {
|
|
64
|
+
// slice() and reverse() are needed to the preserve order of features
|
|
65
|
+
highlightedFeatures
|
|
66
|
+
.slice()
|
|
67
|
+
.reverse()
|
|
68
|
+
.forEach((slug) => {
|
|
69
|
+
const feature = wpcomFeatures.find((feature) => feature.getSlug() === slug);
|
|
70
|
+
if (feature) {
|
|
71
|
+
const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(feature.getSlug());
|
|
72
|
+
wpcomFeaturesTransformed.unshift({
|
|
73
|
+
...feature,
|
|
74
|
+
availableOnlyForAnnualPlans,
|
|
75
|
+
availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
|
|
76
|
+
isHighlighted: true,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const topFeature = selectedFeature
|
|
82
|
+
? wpcomFeatures.find((feature) => feature.getSlug() === selectedFeature)
|
|
83
|
+
: undefined;
|
|
84
|
+
if (topFeature) {
|
|
85
|
+
const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(topFeature.getSlug());
|
|
86
|
+
wpcomFeaturesTransformed.unshift({
|
|
87
|
+
...topFeature,
|
|
88
|
+
availableOnlyForAnnualPlans,
|
|
89
|
+
availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (annualPlansOnlyFeatures.length > 0) {
|
|
93
|
+
wpcomFeatures.forEach((feature) => {
|
|
94
|
+
// topFeature and highlightedFeatures are already added to the list above
|
|
95
|
+
const isHighlightedFeature = highlightedFeatures && highlightedFeatures.includes(feature.getSlug());
|
|
96
|
+
if (feature === topFeature || isHighlightedFeature) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (hasRedeemedDomainCredit && feature.getSlug() === calypso_products_1.FEATURE_CUSTOM_DOMAIN) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(feature.getSlug());
|
|
103
|
+
wpcomFeaturesTransformed.push({
|
|
104
|
+
...feature,
|
|
105
|
+
availableOnlyForAnnualPlans,
|
|
106
|
+
availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
const storageFeature = planConstantObj.getStorageFeature?.(showLegacyStorageFeature, gridPlan.current);
|
|
111
|
+
return {
|
|
112
|
+
...acc,
|
|
113
|
+
[planSlug]: {
|
|
114
|
+
wpcomFeatures: wpcomFeaturesTransformed,
|
|
115
|
+
jetpackFeatures: jetpackFeaturesTransformed,
|
|
116
|
+
...(storageFeature && {
|
|
117
|
+
storageFeature: (0, get_plan_features_object_1.default)(allFeaturesList, [storageFeature])?.[0],
|
|
118
|
+
}),
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}, {});
|
|
122
|
+
}, [
|
|
123
|
+
gridPlans,
|
|
124
|
+
intent,
|
|
125
|
+
highlightedFeatures,
|
|
126
|
+
selectedFeature,
|
|
127
|
+
showLegacyStorageFeature,
|
|
128
|
+
allFeaturesList,
|
|
129
|
+
hasRedeemedDomainCredit,
|
|
130
|
+
]);
|
|
131
|
+
};
|
|
132
|
+
exports.default = usePlanFeaturesForGridPlans;
|
|
133
|
+
//# sourceMappingURL=use-plan-features-for-grid-plans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-plan-features-for-grid-plans.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-plan-features-for-grid-plans.ts"],"names":[],"mappings":";;;AAAA,mEAIsC;AACtC,gDAA6C;AAC7C,0GAAuE;AACvE,kGAAgE;AA4BhE;;;;GAIG;AACH,MAAM,2BAA2B,GAAgC,CAAE,EAClE,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,MAAM,EACN,eAAe,EACf,wBAAwB,EACxB,UAAU,GACV,EAAG,EAAE;IACL,MAAM,mBAAmB,GAAG,IAAA,kCAAsB,EAAE,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI,EAAE,UAAU,EAAE,CAAE,CAAC;IAC7F,OAAO,IAAA,iBAAO,EAAE,GAAG,EAAE;QACpB,OAAO,SAAS,CAAC,MAAM,CACtB,CAAE,GAAG,EAAE,QAAQ,EAAG,EAAE;YACnB,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;YACnC,MAAM,eAAe,GAAG,IAAA,8CAA2B,EAAE,QAAQ,EAAE,SAAS,CAAE,CAAC;YAC3E,MAAM,aAAa,GAAG,IAAA,4BAAS,EAAE,QAAQ,CAAE,CAAC;YAE5C,IAAI,aAAa,GAAoB,EAAE,CAAC;YACxC,IAAI,eAAe,GAAoB,EAAE,CAAC;YAE1C,IAAK,kBAAkB,KAAK,MAAM,EAAG,CAAC;gBACrC,aAAa,GAAG,IAAA,kCAAqB,EACpC,eAAe,EACf,eAAe,EAAE,2BAA2B,EAAE,EAAE,IAAI,EAAE,CACtD,CAAC;YACH,CAAC;iBAAM,IAAK,UAAU,KAAK,MAAM,EAAG,CAAC;gBACpC,aAAa,GAAG,IAAA,kCAAqB,EACpC,eAAe,EACf,eAAe,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D,CAAC;QACH,CAAC,EACD,EAAuD,CACvD,CAAC;IACH,CAAC,EAAE;QACF,SAAS;QACT,MAAM;QACN,mBAAmB;QACnB,eAAe;QACf,wBAAwB;QACxB,eAAe;QACf,uBAAuB;KACvB,CAAE,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const calypso_products_1 = require("@automattic/calypso-products");
|
|
5
|
+
const warning_1 = tslib_1.__importDefault(require("@wordpress/warning"));
|
|
6
|
+
const usePlansFromTypes = ({ planTypes, term, intent }) => {
|
|
7
|
+
const plans = planTypes.reduce((accum, type) => {
|
|
8
|
+
// These plans don't have a term.
|
|
9
|
+
// We may consider to move this logic into the underlying `planMatches` function, but that would have wider implication so it's TBD
|
|
10
|
+
const planQuery = [
|
|
11
|
+
calypso_products_1.TYPE_FREE,
|
|
12
|
+
calypso_products_1.TYPE_ENTERPRISE_GRID_WPCOM,
|
|
13
|
+
calypso_products_1.TYPE_WOO_EXPRESS_PLUS,
|
|
14
|
+
calypso_products_1.TYPE_P2_PLUS,
|
|
15
|
+
].includes(type)
|
|
16
|
+
? { type }
|
|
17
|
+
: { type, term };
|
|
18
|
+
if (intent === 'plans-p2') {
|
|
19
|
+
planQuery['group'] = calypso_products_1.GROUP_P2;
|
|
20
|
+
}
|
|
21
|
+
const plan = (0, calypso_products_1.findPlansKeys)(planQuery)[0];
|
|
22
|
+
if (!plan) {
|
|
23
|
+
(0, warning_1.default)(`Invalid plan type, \`${type}\`, provided to \`PlansFeaturesMain\` component. See plans constants for valid plan types.`);
|
|
24
|
+
}
|
|
25
|
+
return plan ? [...accum, plan] : accum;
|
|
26
|
+
}, []);
|
|
27
|
+
return plans;
|
|
28
|
+
};
|
|
29
|
+
exports.default = usePlansFromTypes;
|
|
30
|
+
//# sourceMappingURL=use-plans-from-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-plans-from-types.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-plans-from-types.ts"],"names":[],"mappings":";;;AAAA,mEASsC;AACtC,yEAAsC;AAStC,MAAM,iBAAiB,GAAG,CAAE,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAS,EAAe,EAAE;IAC9E,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAE,CAAE,KAAiB,EAAE,IAAI,EAAG,EAAE;QAC7D,iCAAiC;QACjC,mIAAmI;QACnI,MAAM,SAAS,GAAoD;YAClE,4BAAS;YACT,6CAA0B;YAC1B,wCAAqB;YACrB,+BAAY;SACZ,CAAC,QAAQ,CAAE,IAAI,CAAE;YACjB,CAAC,CAAC,EAAE,IAAI,EAAE;YACV,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAElB,IAAK,MAAM,KAAK,UAAU,EAAG,CAAC;YAC7B,SAAS,CAAE,OAAO,CAAE,GAAG,2BAAQ,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,GAAG,IAAA,gCAAa,EAAE,SAAS,CAAE,CAAE,CAAC,CAAE,CAAC;QAE7C,IAAK,CAAE,IAAI,EAAG,CAAC;YACd,IAAA,iBAAI,EACH,wBAAyB,IAAK,4FAA4F,CAC1H,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC,CAAC,CAAC,CAAE,GAAG,KAAK,EAAE,IAAgB,CAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACtD,CAAC,EAAE,EAAE,CAAE,CAAC;IAER,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEF,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const calypso_products_1 = require("@automattic/calypso-products");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const get_plan_features_object_1 = tslib_1.__importDefault(require("../../lib/get-plan-features-object"));
|
|
7
|
+
const use_plan_features_for_grid_plans_1 = tslib_1.__importDefault(require("./use-plan-features-for-grid-plans"));
|
|
8
|
+
const useRestructuredPlanFeaturesForComparisonGrid = ({ gridPlans, allFeaturesList, hasRedeemedDomainCredit, intent, selectedFeature, showLegacyStorageFeature, }) => {
|
|
9
|
+
const planFeaturesForGridPlans = (0, use_plan_features_for_grid_plans_1.default)({
|
|
10
|
+
gridPlans,
|
|
11
|
+
allFeaturesList,
|
|
12
|
+
intent,
|
|
13
|
+
selectedFeature,
|
|
14
|
+
showLegacyStorageFeature,
|
|
15
|
+
});
|
|
16
|
+
return (0, react_1.useMemo)(() => {
|
|
17
|
+
let previousPlan = null;
|
|
18
|
+
const planFeatureMap = {};
|
|
19
|
+
for (const gridPlan of gridPlans) {
|
|
20
|
+
const planSlug = gridPlan.planSlug;
|
|
21
|
+
const planConstantObj = (0, calypso_products_1.applyTestFiltersToPlansList)(planSlug, undefined);
|
|
22
|
+
const annualPlansOnlyFeatures = planConstantObj.getAnnualPlansOnlyFeatures?.();
|
|
23
|
+
const isMonthlyPlan = (0, calypso_products_1.isMonthly)(planSlug);
|
|
24
|
+
const wpcomFeatures = planConstantObj.get2023PlanComparisonFeatureOverride?.().length
|
|
25
|
+
? (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj.get2023PlanComparisonFeatureOverride().slice())
|
|
26
|
+
: (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj.get2023PricingGridSignupWpcomFeatures?.().slice());
|
|
27
|
+
const jetpackFeatures = planConstantObj.get2023PlanComparisonJetpackFeatureOverride?.()
|
|
28
|
+
.length
|
|
29
|
+
? (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj.get2023PlanComparisonJetpackFeatureOverride().slice())
|
|
30
|
+
: (0, get_plan_features_object_1.default)(allFeaturesList, planConstantObj.get2023PricingGridSignupJetpackFeatures?.().slice());
|
|
31
|
+
const wpcomFeaturesTransformed = annualPlansOnlyFeatures
|
|
32
|
+
? wpcomFeatures?.map((feature) => {
|
|
33
|
+
const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(feature.getSlug());
|
|
34
|
+
return {
|
|
35
|
+
...feature,
|
|
36
|
+
availableOnlyForAnnualPlans,
|
|
37
|
+
availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
|
|
38
|
+
};
|
|
39
|
+
})
|
|
40
|
+
: null;
|
|
41
|
+
const jetpackFeaturesTransformed = annualPlansOnlyFeatures
|
|
42
|
+
? jetpackFeatures?.map((feature) => {
|
|
43
|
+
const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(feature.getSlug());
|
|
44
|
+
return {
|
|
45
|
+
...feature,
|
|
46
|
+
availableOnlyForAnnualPlans,
|
|
47
|
+
availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
|
|
48
|
+
};
|
|
49
|
+
})
|
|
50
|
+
: null;
|
|
51
|
+
const featuresAvailable = (0, calypso_products_1.isWooExpressPlan)(planSlug)
|
|
52
|
+
? {
|
|
53
|
+
wpcomFeatures: wpcomFeaturesTransformed ?? [],
|
|
54
|
+
jetpackFeatures: [],
|
|
55
|
+
}
|
|
56
|
+
: {
|
|
57
|
+
wpcomFeatures: wpcomFeaturesTransformed ?? [],
|
|
58
|
+
jetpackFeatures: jetpackFeaturesTransformed ?? [],
|
|
59
|
+
};
|
|
60
|
+
const previousPlanFeatures = {
|
|
61
|
+
wpcomFeatures: previousPlan !== null ? planFeatureMap[previousPlan].wpcomFeatures : [],
|
|
62
|
+
jetpackFeatures: previousPlan !== null ? planFeatureMap[previousPlan].jetpackFeatures : [],
|
|
63
|
+
};
|
|
64
|
+
planFeatureMap[planSlug] = {
|
|
65
|
+
wpcomFeatures: [
|
|
66
|
+
...featuresAvailable.wpcomFeatures,
|
|
67
|
+
...previousPlanFeatures.wpcomFeatures,
|
|
68
|
+
].filter((feature) => {
|
|
69
|
+
// Remove the custom domain feature if custom domain has been redeemed or for Woo Express plans with an introductory offer.
|
|
70
|
+
if ((('plans-woocommerce' === intent && gridPlan.pricing.introOffer) ||
|
|
71
|
+
hasRedeemedDomainCredit) &&
|
|
72
|
+
calypso_products_1.FEATURE_CUSTOM_DOMAIN === feature.getSlug()) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}),
|
|
77
|
+
jetpackFeatures: [
|
|
78
|
+
...featuresAvailable.jetpackFeatures,
|
|
79
|
+
...previousPlanFeatures.jetpackFeatures,
|
|
80
|
+
],
|
|
81
|
+
storageFeature: planFeaturesForGridPlans[planSlug].storageFeature,
|
|
82
|
+
comparisonGridFeatureLabels: planConstantObj.getPlanComparisonFeatureLabels?.(),
|
|
83
|
+
};
|
|
84
|
+
previousPlan = planSlug;
|
|
85
|
+
}
|
|
86
|
+
return planFeatureMap;
|
|
87
|
+
}, [gridPlans, allFeaturesList, planFeaturesForGridPlans, intent, hasRedeemedDomainCredit]);
|
|
88
|
+
};
|
|
89
|
+
exports.default = useRestructuredPlanFeaturesForComparisonGrid;
|
|
90
|
+
//# sourceMappingURL=use-restructured-plan-features-for-comparison-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-restructured-plan-features-for-comparison-grid.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-restructured-plan-features-for-comparison-grid.ts"],"names":[],"mappings":";;;AAAA,mEAMsC;AACtC,iCAAgC;AAChC,0GAAuE;AACvE,kHAA6E;AAwB7E,MAAM,4CAA4C,GACjD,CAAE,EACD,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,MAAM,EACN,eAAe,EACf,wBAAwB,GACxB,EAAG,EAAE;IACL,MAAM,wBAAwB,GAAG,IAAA,0CAA2B,EAAE;QAC7D,SAAS;QACT,eAAe;QACf,MAAM;QACN,eAAe;QACf,wBAAwB;K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