@automattic/data-stores 3.1.0 → 3.1.2
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/README.md +10 -9
- package/dist/cjs/add-ons/add-ons-list.js +92 -0
- package/dist/cjs/add-ons/add-ons-list.js.map +1 -0
- package/dist/cjs/add-ons/constants.js +21 -3
- package/dist/cjs/add-ons/constants.js.map +1 -1
- package/dist/cjs/add-ons/hooks/use-add-on-prices.js +55 -54
- package/dist/cjs/add-ons/hooks/use-add-on-prices.js.map +1 -1
- package/dist/cjs/add-ons/hooks/use-add-on-purchase-status.js +14 -6
- package/dist/cjs/add-ons/hooks/use-add-on-purchase-status.js.map +1 -1
- package/dist/cjs/add-ons/hooks/use-add-ons.js +35 -193
- package/dist/cjs/add-ons/hooks/use-add-ons.js.map +1 -1
- package/dist/cjs/add-ons/hooks/use-available-storage-add-ons.js +19 -12
- package/dist/cjs/add-ons/hooks/use-available-storage-add-ons.js.map +1 -1
- package/dist/cjs/add-ons/hooks/use-get-purchased-storage-add-on.js +21 -0
- package/dist/cjs/add-ons/hooks/use-get-purchased-storage-add-on.js.map +1 -0
- package/dist/cjs/add-ons/hooks/use-storage-add-on-availability.js +30 -0
- package/dist/cjs/add-ons/hooks/use-storage-add-on-availability.js.map +1 -0
- package/dist/cjs/add-ons/icons/custom-design.js +1 -1
- package/dist/cjs/add-ons/icons/custom-design.js.map +1 -1
- package/dist/cjs/add-ons/icons/unlimited-themes.js +1 -1
- package/dist/cjs/add-ons/icons/unlimited-themes.js.map +1 -1
- package/dist/cjs/add-ons/index.js +6 -1
- package/dist/cjs/add-ons/index.js.map +1 -1
- package/dist/cjs/add-ons/mocks.js +31 -0
- package/dist/cjs/add-ons/mocks.js.map +1 -0
- package/dist/cjs/contextual-help/admin-sections.js +5 -6
- package/dist/cjs/contextual-help/admin-sections.js.map +1 -1
- package/dist/cjs/contextual-help/contextual-help.js +6 -4
- package/dist/cjs/contextual-help/contextual-help.js.map +1 -1
- package/dist/cjs/domain-suggestions/index.js +9 -16
- package/dist/cjs/domain-suggestions/index.js.map +1 -1
- package/dist/cjs/domain-suggestions/queries.js +3 -4
- package/dist/cjs/domain-suggestions/queries.js.map +1 -1
- package/dist/cjs/domain-suggestions/resolvers.js +3 -3
- package/dist/cjs/domain-suggestions/resolvers.js.map +1 -1
- package/dist/cjs/domain-suggestions/utils.js +5 -8
- package/dist/cjs/domain-suggestions/utils.js.map +1 -1
- package/dist/cjs/help-center/actions.js +115 -43
- package/dist/cjs/help-center/actions.js.map +1 -1
- package/dist/cjs/help-center/index.js +28 -2
- package/dist/cjs/help-center/index.js.map +1 -1
- package/dist/cjs/help-center/reducer.js +50 -5
- package/dist/cjs/help-center/reducer.js.map +1 -1
- package/dist/cjs/help-center/resolvers.js +32 -0
- package/dist/cjs/help-center/resolvers.js.map +1 -0
- package/dist/cjs/help-center/selectors.js +15 -3
- package/dist/cjs/help-center/selectors.js.map +1 -1
- package/dist/cjs/index.js +5 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mutations/use-domains-bulk-actions-mutation.js +1 -2
- package/dist/cjs/mutations/use-domains-bulk-actions-mutation.js.map +1 -1
- package/dist/cjs/newsletter-categories/index.js +36 -0
- package/dist/cjs/newsletter-categories/index.js.map +1 -0
- package/dist/cjs/onboard/actions.js +9 -84
- package/dist/cjs/onboard/actions.js.map +1 -1
- package/dist/cjs/onboard/constants.js +18 -7
- package/dist/cjs/onboard/constants.js.map +1 -1
- package/dist/cjs/onboard/index.js +5 -4
- package/dist/cjs/onboard/index.js.map +1 -1
- package/dist/cjs/onboard/reducer.js +21 -33
- package/dist/cjs/onboard/reducer.js.map +1 -1
- package/dist/cjs/onboard/selectors.js +3 -5
- package/dist/cjs/onboard/selectors.js.map +1 -1
- package/dist/cjs/onboard/utils.js +12 -11
- package/dist/cjs/onboard/utils.js.map +1 -1
- package/dist/cjs/plans/constants.js +1 -0
- package/dist/cjs/plans/constants.js.map +1 -1
- package/dist/cjs/plans/hooks/use-current-plan.js +1 -1
- package/dist/cjs/plans/hooks/use-current-plan.js.map +1 -1
- package/dist/cjs/plans/hooks/use-intro-offers.js +1 -1
- package/dist/cjs/plans/hooks/use-intro-offers.js.map +1 -1
- package/dist/cjs/plans/hooks/use-pricing-meta-for-grid-plans.js +52 -9
- package/dist/cjs/plans/hooks/use-pricing-meta-for-grid-plans.js.map +1 -1
- package/dist/cjs/plans/index.js +2 -2
- package/dist/cjs/plans/index.js.map +1 -1
- package/dist/cjs/plans/mock/next/store/plans.js +12 -6
- package/dist/cjs/plans/mock/next/store/plans.js.map +1 -1
- package/dist/cjs/plans/queries/lib/unpack-cost-overrides.js +1 -1
- package/dist/cjs/plans/queries/lib/unpack-cost-overrides.js.map +1 -1
- package/dist/cjs/plans/queries/lib/unpack-intro-offer.js +16 -3
- package/dist/cjs/plans/queries/lib/unpack-intro-offer.js.map +1 -1
- package/dist/cjs/plans/queries/lib/use-query-keys-factory.js +5 -1
- package/dist/cjs/plans/queries/lib/use-query-keys-factory.js.map +1 -1
- package/dist/cjs/plans/queries/use-plans.js +1 -1
- package/dist/cjs/plans/queries/use-site-plans.js +6 -2
- package/dist/cjs/plans/queries/use-site-plans.js.map +1 -1
- package/dist/cjs/plans/resolvers.js +5 -7
- package/dist/cjs/plans/resolvers.js.map +1 -1
- package/dist/cjs/products-list/queries/use-products.js +1 -1
- package/dist/cjs/purchases/lib/assembler.js +8 -3
- package/dist/cjs/purchases/lib/assembler.js.map +1 -1
- package/dist/cjs/purchases/queries/lib/use-query-keys-factory.js +1 -0
- package/dist/cjs/purchases/queries/lib/use-query-keys-factory.js.map +1 -1
- package/dist/cjs/purchases/queries/use-get-jetpack-transferred-license-purchases.js +33 -0
- package/dist/cjs/purchases/queries/use-get-jetpack-transferred-license-purchases.js.map +1 -0
- package/dist/cjs/purchases/queries/use-site-purchases.js +1 -2
- package/dist/cjs/purchases/queries/use-site-purchases.js.map +1 -1
- package/dist/cjs/queries/use-all-domains-query.js +2 -2
- package/dist/cjs/queries/use-all-domains-query.js.map +1 -1
- package/dist/cjs/queries/use-bulk-domain-update-status-query.js +7 -7
- package/dist/cjs/queries/use-bulk-domain-update-status-query.js.map +1 -1
- package/dist/cjs/queries/use-launchpad.js +16 -10
- package/dist/cjs/queries/use-launchpad.js.map +1 -1
- package/dist/cjs/queries/use-site-domains-query.js +3 -3
- package/dist/cjs/queries/use-site-domains-query.js.map +1 -1
- package/dist/cjs/queries/use-site-intent.js +1 -2
- package/dist/cjs/queries/use-site-intent.js.map +1 -1
- package/dist/cjs/queries/use-site-query.js +2 -3
- package/dist/cjs/queries/use-site-query.js.map +1 -1
- package/dist/cjs/reader/contexts/site-subscriptions-query-props.js +11 -10
- package/dist/cjs/reader/contexts/site-subscriptions-query-props.js.map +1 -1
- package/dist/cjs/reader/helpers/index.js +2 -2
- package/dist/cjs/reader/helpers/index.js.map +1 -1
- package/dist/cjs/reader/hooks/index.js +5 -4
- package/dist/cjs/reader/hooks/index.js.map +1 -1
- package/dist/cjs/reader/hooks/use-is-logged-in.js +10 -8
- package/dist/cjs/reader/hooks/use-is-logged-in.js.map +1 -1
- package/dist/cjs/reader/mutations/index.js +14 -13
- package/dist/cjs/reader/mutations/index.js.map +1 -1
- package/dist/cjs/reader/mutations/use-site-subscribe-mutation.js +1 -1
- package/dist/cjs/reader/mutations/use-site-subscribe-mutation.js.map +1 -1
- package/dist/cjs/reader/mutations/use-site-unsubscribe-mutation.js +4 -0
- package/dist/cjs/reader/mutations/use-site-unsubscribe-mutation.js.map +1 -1
- package/dist/cjs/reader/queries/index.js +11 -10
- package/dist/cjs/reader/queries/index.js.map +1 -1
- package/dist/cjs/reader/queries/use-read-feed-query.js +2 -2
- package/dist/cjs/reader/queries/use-read-feed-query.js.map +1 -1
- package/dist/cjs/reader/queries/use-read-feed-site-query.js +1 -1
- package/dist/cjs/reader/queries/use-read-feed-site-query.js.map +1 -1
- package/dist/cjs/site/actions.js +37 -11
- package/dist/cjs/site/actions.js.map +1 -1
- package/dist/cjs/site/constants.js +3 -5
- package/dist/cjs/site/constants.js.map +1 -1
- package/dist/cjs/site/index.js +2 -2
- package/dist/cjs/site/index.js.map +1 -1
- package/dist/cjs/site/queries/use-site-media-storage.js +1 -0
- package/dist/cjs/site/queries/use-site-media-storage.js.map +1 -1
- package/dist/cjs/site/queries/use-site-user-query.js +1 -2
- package/dist/cjs/site/queries/use-site-user-query.js.map +1 -1
- package/dist/cjs/site/selectors.js +2 -2
- package/dist/cjs/site/selectors.js.map +1 -1
- package/dist/cjs/site/types.js.map +1 -1
- package/dist/cjs/starter-designs-queries/use-starter-design-by-slug.js +1 -2
- package/dist/cjs/starter-designs-queries/use-starter-design-by-slug.js.map +1 -1
- package/dist/cjs/starter-designs-queries/use-starter-designs-query.js +3 -3
- package/dist/cjs/starter-designs-queries/use-starter-designs-query.js.map +1 -1
- package/dist/cjs/stepper-internal/index.js +1 -2
- package/dist/cjs/stepper-internal/index.js.map +1 -1
- package/dist/cjs/stepper-internal/reducer.js.map +1 -1
- package/dist/cjs/subscriber/actions.js +39 -31
- package/dist/cjs/subscriber/actions.js.map +1 -1
- package/dist/cjs/subscriber/index.js +0 -2
- package/dist/cjs/subscriber/index.js.map +1 -1
- package/dist/cjs/subscriber/selectors.js +5 -0
- package/dist/cjs/subscriber/selectors.js.map +1 -1
- package/dist/cjs/templates/index.js +2 -1
- package/dist/cjs/templates/index.js.map +1 -1
- package/dist/cjs/user/actions.js +1 -2
- package/dist/cjs/user/actions.js.map +1 -1
- package/dist/cjs/user/index.js +1 -2
- package/dist/cjs/user/index.js.map +1 -1
- package/dist/cjs/user/resolvers.js +1 -2
- package/dist/cjs/user/resolvers.js.map +1 -1
- package/dist/cjs/users/use-send-invites.js +2 -4
- package/dist/cjs/users/use-send-invites.js.map +1 -1
- package/dist/esm/add-ons/add-ons-list.js +86 -0
- package/dist/esm/add-ons/add-ons-list.js.map +1 -0
- package/dist/esm/add-ons/constants.js +20 -2
- package/dist/esm/add-ons/constants.js.map +1 -1
- package/dist/esm/add-ons/hooks/use-add-on-prices.js +51 -53
- package/dist/esm/add-ons/hooks/use-add-on-prices.js.map +1 -1
- package/dist/esm/add-ons/hooks/use-add-on-purchase-status.js +14 -6
- package/dist/esm/add-ons/hooks/use-add-on-purchase-status.js.map +1 -1
- package/dist/esm/add-ons/hooks/use-add-ons.js +36 -194
- package/dist/esm/add-ons/hooks/use-add-ons.js.map +1 -1
- package/dist/esm/add-ons/hooks/use-available-storage-add-ons.js +18 -12
- package/dist/esm/add-ons/hooks/use-available-storage-add-ons.js.map +1 -1
- package/dist/esm/add-ons/hooks/use-get-purchased-storage-add-on.js +17 -0
- package/dist/esm/add-ons/hooks/use-get-purchased-storage-add-on.js.map +1 -0
- package/dist/esm/add-ons/hooks/use-storage-add-on-availability.js +26 -0
- package/dist/esm/add-ons/hooks/use-storage-add-on-availability.js.map +1 -0
- package/dist/esm/add-ons/icons/custom-design.js +2 -2
- package/dist/esm/add-ons/icons/custom-design.js.map +1 -1
- package/dist/esm/add-ons/icons/unlimited-themes.js +2 -2
- package/dist/esm/add-ons/icons/unlimited-themes.js.map +1 -1
- package/dist/esm/add-ons/index.js +2 -0
- package/dist/esm/add-ons/index.js.map +1 -1
- package/dist/esm/add-ons/mocks.js +27 -0
- package/dist/esm/add-ons/mocks.js.map +1 -0
- package/dist/esm/contextual-help/admin-sections.js +4 -4
- package/dist/esm/contextual-help/admin-sections.js.map +1 -1
- package/dist/esm/contextual-help/contextual-help.js +3 -2
- package/dist/esm/contextual-help/contextual-help.js.map +1 -1
- package/dist/esm/domain-suggestions/index.js +9 -15
- package/dist/esm/domain-suggestions/index.js.map +1 -1
- package/dist/esm/domain-suggestions/utils.js +1 -4
- package/dist/esm/domain-suggestions/utils.js.map +1 -1
- package/dist/esm/help-center/actions.js +103 -38
- package/dist/esm/help-center/actions.js.map +1 -1
- package/dist/esm/help-center/index.js +24 -0
- package/dist/esm/help-center/index.js.map +1 -1
- package/dist/esm/help-center/reducer.js +50 -5
- package/dist/esm/help-center/reducer.js.map +1 -1
- package/dist/esm/help-center/resolvers.js +29 -0
- package/dist/esm/help-center/resolvers.js.map +1 -0
- package/dist/esm/help-center/selectors.js +7 -1
- package/dist/esm/help-center/selectors.js.map +1 -1
- package/dist/esm/index.js +3 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/newsletter-categories/index.js +31 -0
- package/dist/esm/newsletter-categories/index.js.map +1 -0
- package/dist/esm/onboard/actions.js +4 -74
- package/dist/esm/onboard/actions.js.map +1 -1
- package/dist/esm/onboard/constants.js +18 -7
- package/dist/esm/onboard/constants.js.map +1 -1
- package/dist/esm/onboard/index.js +3 -2
- package/dist/esm/onboard/index.js.map +1 -1
- package/dist/esm/onboard/reducer.js +21 -33
- package/dist/esm/onboard/reducer.js.map +1 -1
- package/dist/esm/onboard/selectors.js +1 -2
- package/dist/esm/onboard/selectors.js.map +1 -1
- package/dist/esm/onboard/utils.js +12 -11
- package/dist/esm/onboard/utils.js.map +1 -1
- package/dist/esm/plans/constants.js +1 -0
- package/dist/esm/plans/constants.js.map +1 -1
- package/dist/esm/plans/hooks/use-current-plan.js +1 -1
- package/dist/esm/plans/hooks/use-current-plan.js.map +1 -1
- package/dist/esm/plans/hooks/use-intro-offers.js +1 -1
- package/dist/esm/plans/hooks/use-intro-offers.js.map +1 -1
- package/dist/esm/plans/hooks/use-pricing-meta-for-grid-plans.js +52 -9
- package/dist/esm/plans/hooks/use-pricing-meta-for-grid-plans.js.map +1 -1
- package/dist/esm/plans/mock/next/store/plans.js +12 -6
- package/dist/esm/plans/mock/next/store/plans.js.map +1 -1
- package/dist/esm/plans/queries/lib/unpack-intro-offer.js +16 -3
- package/dist/esm/plans/queries/lib/unpack-intro-offer.js.map +1 -1
- package/dist/esm/plans/queries/lib/use-query-keys-factory.js +5 -1
- package/dist/esm/plans/queries/lib/use-query-keys-factory.js.map +1 -1
- package/dist/esm/plans/queries/use-plans.js +1 -1
- package/dist/esm/plans/queries/use-site-plans.js +6 -2
- package/dist/esm/plans/queries/use-site-plans.js.map +1 -1
- package/dist/esm/plans/resolvers.js +1 -1
- package/dist/esm/plans/resolvers.js.map +1 -1
- package/dist/esm/products-list/queries/use-products.js +1 -1
- package/dist/esm/purchases/lib/assembler.js +6 -0
- package/dist/esm/purchases/lib/assembler.js.map +1 -1
- package/dist/esm/purchases/queries/lib/use-query-keys-factory.js +1 -0
- package/dist/esm/purchases/queries/lib/use-query-keys-factory.js.map +1 -1
- package/dist/esm/purchases/queries/use-get-jetpack-transferred-license-purchases.js +29 -0
- package/dist/esm/purchases/queries/use-get-jetpack-transferred-license-purchases.js.map +1 -0
- package/dist/esm/queries/use-all-domains-query.js.map +1 -1
- package/dist/esm/queries/use-bulk-domain-update-status-query.js +5 -5
- package/dist/esm/queries/use-bulk-domain-update-status-query.js.map +1 -1
- package/dist/esm/queries/use-launchpad.js +13 -8
- package/dist/esm/queries/use-launchpad.js.map +1 -1
- package/dist/esm/queries/use-site-domains-query.js.map +1 -1
- package/dist/esm/queries/use-site-intent.js.map +1 -1
- package/dist/esm/reader/contexts/site-subscriptions-query-props.js +12 -11
- package/dist/esm/reader/contexts/site-subscriptions-query-props.js.map +1 -1
- package/dist/esm/reader/hooks/use-is-logged-in.js +9 -8
- package/dist/esm/reader/hooks/use-is-logged-in.js.map +1 -1
- package/dist/esm/reader/mutations/use-site-subscribe-mutation.js +1 -1
- package/dist/esm/reader/mutations/use-site-subscribe-mutation.js.map +1 -1
- package/dist/esm/reader/mutations/use-site-unsubscribe-mutation.js +4 -0
- package/dist/esm/reader/mutations/use-site-unsubscribe-mutation.js.map +1 -1
- package/dist/esm/reader/queries/use-read-feed-query.js +2 -2
- package/dist/esm/reader/queries/use-read-feed-query.js.map +1 -1
- package/dist/esm/reader/queries/use-read-feed-site-query.js +1 -1
- package/dist/esm/reader/queries/use-read-feed-site-query.js.map +1 -1
- package/dist/esm/site/actions.js +36 -9
- package/dist/esm/site/actions.js.map +1 -1
- package/dist/esm/site/constants.js +2 -4
- package/dist/esm/site/constants.js.map +1 -1
- package/dist/esm/site/queries/use-site-media-storage.js +1 -0
- package/dist/esm/site/queries/use-site-media-storage.js.map +1 -1
- package/dist/esm/site/types.js.map +1 -1
- package/dist/esm/starter-designs-queries/use-starter-designs-query.js +2 -1
- package/dist/esm/starter-designs-queries/use-starter-designs-query.js.map +1 -1
- package/dist/esm/stepper-internal/reducer.js.map +1 -1
- package/dist/esm/subscriber/actions.js +38 -29
- package/dist/esm/subscriber/actions.js.map +1 -1
- package/dist/esm/subscriber/index.js +0 -2
- package/dist/esm/subscriber/index.js.map +1 -1
- package/dist/esm/subscriber/selectors.js +4 -0
- package/dist/esm/subscriber/selectors.js.map +1 -1
- package/dist/esm/users/use-send-invites.js +1 -2
- package/dist/esm/users/use-send-invites.js.map +1 -1
- package/dist/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/add-ons/add-ons-list.d.ts +4 -0
- package/dist/types/add-ons/add-ons-list.d.ts.map +1 -0
- package/dist/types/add-ons/constants.d.ts +8 -3
- package/dist/types/add-ons/constants.d.ts.map +1 -1
- package/dist/types/add-ons/hooks/use-add-on-checkout-link.d.ts +1 -1
- package/dist/types/add-ons/hooks/use-add-on-checkout-link.d.ts.map +1 -1
- package/dist/types/add-ons/hooks/use-add-on-prices.d.ts +12 -7
- package/dist/types/add-ons/hooks/use-add-on-prices.d.ts.map +1 -1
- package/dist/types/add-ons/hooks/use-add-on-purchase-status.d.ts +7 -8
- package/dist/types/add-ons/hooks/use-add-on-purchase-status.d.ts.map +1 -1
- package/dist/types/add-ons/hooks/use-add-ons.d.ts +1 -2
- package/dist/types/add-ons/hooks/use-add-ons.d.ts.map +1 -1
- package/dist/types/add-ons/hooks/use-available-storage-add-ons.d.ts +9 -2
- package/dist/types/add-ons/hooks/use-available-storage-add-ons.d.ts.map +1 -1
- package/dist/types/add-ons/hooks/use-get-purchased-storage-add-on.d.ts +5 -0
- package/dist/types/add-ons/hooks/use-get-purchased-storage-add-on.d.ts.map +1 -0
- package/dist/types/add-ons/hooks/use-storage-add-on-availability.d.ts +17 -0
- package/dist/types/add-ons/hooks/use-storage-add-on-availability.d.ts.map +1 -0
- package/dist/types/add-ons/hooks/use-storage-add-ons.d.ts.map +1 -1
- package/dist/types/add-ons/icons/custom-design.d.ts.map +1 -1
- package/dist/types/add-ons/icons/unlimited-themes.d.ts.map +1 -1
- package/dist/types/add-ons/index.d.ts +2 -0
- package/dist/types/add-ons/index.d.ts.map +1 -1
- package/dist/types/add-ons/mocks.d.ts +4 -0
- package/dist/types/add-ons/mocks.d.ts.map +1 -0
- package/dist/types/add-ons/types.d.ts +6 -7
- package/dist/types/add-ons/types.d.ts.map +1 -1
- package/dist/types/contextual-help/contextual-help.d.ts.map +1 -1
- package/dist/types/domain-suggestions/actions.d.ts.map +1 -1
- package/dist/types/domain-suggestions/index.d.ts +3 -2
- package/dist/types/domain-suggestions/index.d.ts.map +1 -1
- package/dist/types/domain-suggestions/queries.d.ts +24 -24
- package/dist/types/domain-suggestions/reducer.d.ts +6 -2
- package/dist/types/domain-suggestions/reducer.d.ts.map +1 -1
- package/dist/types/domain-suggestions/resolvers.d.ts.map +1 -1
- package/dist/types/domain-suggestions/selectors.d.ts.map +1 -1
- package/dist/types/domain-suggestions/types.d.ts +0 -3
- package/dist/types/domain-suggestions/types.d.ts.map +1 -1
- package/dist/types/domain-suggestions/utils.d.ts +0 -3
- package/dist/types/domain-suggestions/utils.d.ts.map +1 -1
- package/dist/types/help-center/actions.d.ts +63 -61
- package/dist/types/help-center/actions.d.ts.map +1 -1
- package/dist/types/help-center/index.d.ts +2 -0
- package/dist/types/help-center/index.d.ts.map +1 -1
- package/dist/types/help-center/reducer.d.ts +36 -3
- package/dist/types/help-center/reducer.d.ts.map +1 -1
- package/dist/types/help-center/resolvers.d.ts +24 -0
- package/dist/types/help-center/resolvers.d.ts.map +1 -0
- package/dist/types/help-center/selectors.d.ts +10 -1
- package/dist/types/help-center/selectors.d.ts.map +1 -1
- package/dist/types/help-center/types.d.ts +9 -0
- package/dist/types/help-center/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +109 -112
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mutations/use-domains-bulk-actions-mutation.d.ts +4 -4
- package/dist/types/mutations/use-domains-bulk-actions-mutation.d.ts.map +1 -1
- package/dist/types/newsletter-categories/index.d.ts +21 -0
- package/dist/types/newsletter-categories/index.d.ts.map +1 -0
- package/dist/types/onboard/actions.d.ts +17 -94
- package/dist/types/onboard/actions.d.ts.map +1 -1
- package/dist/types/onboard/constants.d.ts +16 -7
- package/dist/types/onboard/constants.d.ts.map +1 -1
- package/dist/types/onboard/index.d.ts.map +1 -1
- package/dist/types/onboard/reducer.d.ts +53 -6
- package/dist/types/onboard/reducer.d.ts.map +1 -1
- package/dist/types/onboard/selectors.d.ts +6 -9
- package/dist/types/onboard/selectors.d.ts.map +1 -1
- package/dist/types/onboard/utils.d.ts +5 -1
- package/dist/types/onboard/utils.d.ts.map +1 -1
- package/dist/types/plans/actions.d.ts.map +1 -1
- package/dist/types/plans/constants.d.ts +1 -0
- package/dist/types/plans/constants.d.ts.map +1 -1
- package/dist/types/plans/hooks/use-current-plan-expiry-date.d.ts.map +1 -1
- package/dist/types/plans/hooks/use-current-plan-term.d.ts +1 -1
- package/dist/types/plans/hooks/use-current-plan-term.d.ts.map +1 -1
- package/dist/types/plans/hooks/use-current-plan.d.ts.map +1 -1
- package/dist/types/plans/hooks/use-intro-offers-for-woo-express.d.ts.map +1 -1
- package/dist/types/plans/hooks/use-intro-offers.d.ts.map +1 -1
- package/dist/types/plans/hooks/use-pricing-meta-for-grid-plans.d.ts +7 -6
- package/dist/types/plans/hooks/use-pricing-meta-for-grid-plans.d.ts.map +1 -1
- package/dist/types/plans/mock/next/store/plans.d.ts.map +1 -1
- package/dist/types/plans/queries/lib/unpack-intro-offer.d.ts.map +1 -1
- package/dist/types/plans/queries/lib/use-query-keys-factory.d.ts +1 -1
- package/dist/types/plans/queries/lib/use-query-keys-factory.d.ts.map +1 -1
- package/dist/types/plans/queries/use-site-plans.d.ts +6 -1
- package/dist/types/plans/queries/use-site-plans.d.ts.map +1 -1
- package/dist/types/plans/reducer.d.ts +7 -2
- package/dist/types/plans/reducer.d.ts.map +1 -1
- package/dist/types/plans/resolvers.d.ts +1 -1
- package/dist/types/plans/selectors.d.ts +1 -1
- package/dist/types/plans/selectors.d.ts.map +1 -1
- package/dist/types/plans/test-utils/index.d.ts.map +1 -1
- package/dist/types/plans/types.d.ts +24 -2
- package/dist/types/plans/types.d.ts.map +1 -1
- package/dist/types/products-list/actions.d.ts.map +1 -1
- package/dist/types/products-list/reducer.d.ts +5 -2
- package/dist/types/products-list/reducer.d.ts.map +1 -1
- package/dist/types/products-list/resolvers.d.ts.map +1 -1
- package/dist/types/products-list/selectors.d.ts +2 -2
- package/dist/types/products-list/selectors.d.ts.map +1 -1
- package/dist/types/products-list/types.d.ts +1 -0
- package/dist/types/products-list/types.d.ts.map +1 -1
- package/dist/types/purchases/hooks/use-site-purchase-by-id.d.ts.map +1 -1
- package/dist/types/purchases/hooks/use-site-purchases-by-product-slug.d.ts.map +1 -1
- package/dist/types/purchases/lib/assembler.d.ts.map +1 -1
- package/dist/types/purchases/queries/lib/use-query-keys-factory.d.ts +1 -0
- package/dist/types/purchases/queries/lib/use-query-keys-factory.d.ts.map +1 -1
- package/dist/types/purchases/queries/use-get-jetpack-transferred-license-purchases.d.ts +18 -0
- package/dist/types/purchases/queries/use-get-jetpack-transferred-license-purchases.d.ts.map +1 -0
- package/dist/types/purchases/queries/use-site-purchases.d.ts +1 -1
- package/dist/types/purchases/queries/use-site-purchases.d.ts.map +1 -1
- package/dist/types/purchases/types.d.ts +21 -0
- package/dist/types/purchases/types.d.ts.map +1 -1
- package/dist/types/queries/use-all-domains-query.d.ts +3 -2
- package/dist/types/queries/use-all-domains-query.d.ts.map +1 -1
- package/dist/types/queries/use-bulk-domain-update-status-query.d.ts +6 -1
- package/dist/types/queries/use-bulk-domain-update-status-query.d.ts.map +1 -1
- package/dist/types/queries/use-happiness-engineers-query.d.ts +1 -1
- package/dist/types/queries/use-launchpad.d.ts +4 -3
- package/dist/types/queries/use-launchpad.d.ts.map +1 -1
- package/dist/types/queries/use-site-domains-query.d.ts +9 -2
- package/dist/types/queries/use-site-domains-query.d.ts.map +1 -1
- package/dist/types/queries/use-site-intent.d.ts +3 -2
- package/dist/types/queries/use-site-intent.d.ts.map +1 -1
- package/dist/types/queries/use-site-query.d.ts +1 -1
- package/dist/types/queries/use-site-query.d.ts.map +1 -1
- package/dist/types/reader/contexts/site-subscriptions-query-props.d.ts +4 -2
- package/dist/types/reader/contexts/site-subscriptions-query-props.d.ts.map +1 -1
- package/dist/types/reader/helpers/index.d.ts +1 -1
- package/dist/types/reader/helpers/index.d.ts.map +1 -1
- package/dist/types/reader/helpers/optimistic-update.d.ts.map +1 -1
- package/dist/types/reader/helpers/query-key.d.ts.map +1 -1
- package/dist/types/reader/helpers/type-guards.d.ts.map +1 -1
- package/dist/types/reader/helpers/validators.d.ts +1 -1
- package/dist/types/reader/helpers/validators.d.ts.map +1 -1
- package/dist/types/reader/hooks/use-cache-key.d.ts.map +1 -1
- package/dist/types/reader/hooks/use-is-logged-in.d.ts +1 -2
- package/dist/types/reader/hooks/use-is-logged-in.d.ts.map +1 -1
- package/dist/types/reader/index.d.ts +105 -106
- package/dist/types/reader/index.d.ts.map +1 -1
- package/dist/types/reader/mutations/use-pending-post-confirm-mutation.d.ts +1 -1
- package/dist/types/reader/mutations/use-pending-post-delete-mutation.d.ts +1 -1
- package/dist/types/reader/mutations/use-pending-site-confirm-mutation.d.ts +1 -1
- package/dist/types/reader/mutations/use-pending-site-delete-mutation.d.ts +1 -1
- package/dist/types/reader/mutations/use-post-notify-me-of-new-comments-mutation.d.ts +1 -1
- package/dist/types/reader/mutations/use-post-unsubscribe-mutation.d.ts +1 -1
- package/dist/types/reader/mutations/use-site-delivery-frequency-mutation.d.ts +1 -1
- package/dist/types/reader/mutations/use-site-email-me-new-comments-mutation.d.ts +1 -1
- package/dist/types/reader/mutations/use-site-email-me-new-posts-mutation.d.ts +1 -1
- package/dist/types/reader/mutations/use-site-notify-me-of-new-posts-mutation.d.ts +1 -1
- package/dist/types/reader/mutations/use-site-subscribe-mutation.d.ts +2 -2
- package/dist/types/reader/mutations/use-site-subscribe-mutation.d.ts.map +1 -1
- package/dist/types/reader/mutations/use-site-unsubscribe-mutation.d.ts +3 -1
- package/dist/types/reader/mutations/use-site-unsubscribe-mutation.d.ts.map +1 -1
- package/dist/types/reader/mutations/use-user-settings-mutation.d.ts +1 -1
- package/dist/types/reader/queries/use-pending-post-subscriptions-query.d.ts +8 -8
- package/dist/types/reader/queries/use-pending-post-subscriptions-query.d.ts.map +1 -1
- package/dist/types/reader/queries/use-pending-site-subscriptions-query.d.ts +8 -8
- package/dist/types/reader/queries/use-pending-site-subscriptions-query.d.ts.map +1 -1
- package/dist/types/reader/queries/use-post-subscriptions-query.d.ts +16 -16
- package/dist/types/reader/queries/use-post-subscriptions-query.d.ts.map +1 -1
- package/dist/types/reader/queries/use-read-feed-query.d.ts +3 -1
- package/dist/types/reader/queries/use-read-feed-query.d.ts.map +1 -1
- package/dist/types/reader/queries/use-read-feed-search-query.d.ts +1 -1
- package/dist/types/reader/queries/use-read-feed-search-query.d.ts.map +1 -1
- package/dist/types/reader/queries/use-read-feed-site-query.d.ts +1 -1
- package/dist/types/reader/queries/use-read-feed-site-query.d.ts.map +1 -1
- package/dist/types/reader/queries/use-site-subscription-details-query.d.ts +1 -1
- package/dist/types/reader/queries/use-site-subscription-details-query.d.ts.map +1 -1
- package/dist/types/reader/queries/use-site-subscriptions-query.d.ts +12 -12
- package/dist/types/reader/queries/use-site-subscriptions-query.d.ts.map +1 -1
- package/dist/types/reader/queries/use-subscriptions-count-query.d.ts +1 -1
- package/dist/types/reader/queries/use-subscriptions-count-query.d.ts.map +1 -1
- package/dist/types/reader/queries/use-user-settings-query.d.ts +1 -1
- package/dist/types/site/actions.d.ts +11 -11
- package/dist/types/site/actions.d.ts.map +1 -1
- package/dist/types/site/constants.d.ts +2 -1
- package/dist/types/site/constants.d.ts.map +1 -1
- package/dist/types/site/queries/use-site-media-storage.d.ts.map +1 -1
- package/dist/types/site/queries/use-site-user-query.d.ts +1 -1
- package/dist/types/site/queries/use-site-user-query.d.ts.map +1 -1
- package/dist/types/site/reducer.d.ts +28 -9
- package/dist/types/site/reducer.d.ts.map +1 -1
- package/dist/types/site/resolvers.d.ts.map +1 -1
- package/dist/types/site/selectors.d.ts +8 -8
- package/dist/types/site/selectors.d.ts.map +1 -1
- package/dist/types/site/types.d.ts +26 -39
- package/dist/types/site/types.d.ts.map +1 -1
- package/dist/types/site/utils.d.ts.map +1 -1
- package/dist/types/site-reset/use-site-reset-content-summary-query.d.ts.map +1 -1
- package/dist/types/site-reset/use-site-reset-mutation.d.ts +4 -4
- package/dist/types/site-reset/use-site-reset-mutation.d.ts.map +1 -1
- package/dist/types/site-reset/use-site-reset-status-query.d.ts.map +1 -1
- package/dist/types/starter-designs-queries/types.d.ts +1 -10
- package/dist/types/starter-designs-queries/types.d.ts.map +1 -1
- package/dist/types/starter-designs-queries/use-starter-designs-query.d.ts +2 -0
- package/dist/types/starter-designs-queries/use-starter-designs-query.d.ts.map +1 -1
- package/dist/types/stepper-internal/actions.d.ts.map +1 -1
- package/dist/types/stepper-internal/reducer.d.ts +5 -2
- package/dist/types/stepper-internal/reducer.d.ts.map +1 -1
- package/dist/types/stepper-internal/selectors.d.ts +4 -2
- package/dist/types/stepper-internal/selectors.d.ts.map +1 -1
- package/dist/types/subscriber/actions.d.ts +11 -53
- package/dist/types/subscriber/actions.d.ts.map +1 -1
- package/dist/types/subscriber/index.d.ts +14 -52
- package/dist/types/subscriber/index.d.ts.map +1 -1
- package/dist/types/subscriber/reducers.d.ts +4 -2
- package/dist/types/subscriber/reducers.d.ts.map +1 -1
- package/dist/types/subscriber/selectors.d.ts +7 -5
- package/dist/types/subscriber/selectors.d.ts.map +1 -1
- package/dist/types/subscriber/types.d.ts +17 -1
- package/dist/types/subscriber/types.d.ts.map +1 -1
- package/dist/types/templates/use-template.d.ts +1 -1
- package/dist/types/templates/use-template.d.ts.map +1 -1
- package/dist/types/theme/utils.d.ts.map +1 -1
- package/dist/types/user/reducer.d.ts +4 -2
- package/dist/types/user/reducer.d.ts.map +1 -1
- package/dist/types/user/selectors.d.ts +2 -2
- package/dist/types/user/selectors.d.ts.map +1 -1
- package/dist/types/user/types.d.ts +4 -2
- package/dist/types/user/types.d.ts.map +1 -1
- package/dist/types/users/use-send-invites.d.ts +1 -1
- package/dist/types/users/use-send-invites.d.ts.map +1 -1
- package/dist/types/wpcom-plans-ui/actions.d.ts +2 -2
- package/dist/types/wpcom-plans-ui/actions.d.ts.map +1 -1
- package/dist/types/wpcom-plans-ui/reducer.d.ts +5 -2
- package/dist/types/wpcom-plans-ui/reducer.d.ts.map +1 -1
- package/dist/types/wpcom-plans-ui/selectors.d.ts.map +1 -1
- package/dist/types/wpcom-request-controls/index.d.ts +2 -2
- package/dist/types/wpcom-request-controls/index.d.ts.map +1 -1
- package/package.json +30 -20
- package/src/add-ons/add-ons-list.ts +109 -0
- package/src/add-ons/constants.ts +20 -2
- package/src/add-ons/hooks/use-add-on-prices.ts +67 -54
- package/src/add-ons/hooks/use-add-on-purchase-status.ts +21 -10
- package/src/add-ons/hooks/use-add-ons.ts +53 -251
- package/src/add-ons/hooks/use-available-storage-add-ons.ts +26 -16
- package/src/add-ons/hooks/use-get-purchased-storage-add-on.ts +24 -0
- package/src/add-ons/hooks/use-storage-add-on-availability.ts +38 -0
- package/src/add-ons/icons/custom-design.tsx +3 -11
- package/src/add-ons/icons/unlimited-themes.tsx +3 -12
- package/src/add-ons/index.ts +5 -0
- package/src/add-ons/mocks.ts +29 -0
- package/src/add-ons/types.ts +6 -6
- package/src/contextual-help/admin-sections.ts +4 -4
- package/src/contextual-help/contextual-help.tsx +4 -2
- package/src/domain-suggestions/index.ts +9 -16
- package/src/domain-suggestions/test/selectors.ts +12 -12
- package/src/domain-suggestions/types.ts +0 -4
- package/src/domain-suggestions/utils.ts +1 -4
- package/src/help-center/actions.ts +155 -47
- package/src/help-center/index.ts +34 -0
- package/src/help-center/reducer.ts +68 -5
- package/src/help-center/resolvers.ts +38 -0
- package/src/help-center/selectors.ts +8 -1
- package/src/help-center/types.ts +10 -1
- package/src/index.ts +7 -8
- package/src/newsletter-categories/index.ts +54 -0
- package/src/newsletter-categories/test/index.tsx +103 -0
- package/src/onboard/actions.ts +7 -122
- package/src/onboard/constants.ts +19 -7
- package/src/onboard/index.ts +3 -2
- package/src/onboard/reducer.ts +33 -35
- package/src/onboard/selectors.ts +1 -2
- package/src/onboard/test/utils.ts +36 -3
- package/src/onboard/utils.ts +21 -15
- package/src/plans/constants.ts +1 -0
- package/src/plans/hooks/test/use-pricing-meta-for-grid-plans.ts +241 -122
- package/src/plans/hooks/use-current-plan.ts +1 -1
- package/src/plans/hooks/use-intro-offers.ts +1 -1
- package/src/plans/hooks/use-pricing-meta-for-grid-plans.ts +69 -18
- package/src/plans/mock/next/store/plans.ts +12 -6
- package/src/plans/queries/lib/unpack-intro-offer.ts +23 -4
- package/src/plans/queries/lib/use-query-keys-factory.ts +5 -1
- package/src/plans/queries/use-plans.ts +1 -1
- package/src/plans/queries/use-site-plans.ts +11 -2
- package/src/plans/resolvers.ts +1 -1
- package/src/plans/types.ts +24 -2
- package/src/products-list/queries/use-products.ts +1 -1
- package/src/products-list/types.ts +1 -0
- package/src/purchases/lib/assembler.ts +7 -0
- package/src/purchases/queries/lib/use-query-keys-factory.ts +1 -0
- package/src/purchases/queries/use-get-jetpack-transferred-license-purchases.tsx +43 -0
- package/src/purchases/types.ts +25 -0
- package/src/queries/use-all-domains-query.ts +3 -0
- package/src/queries/use-bulk-domain-update-status-query.ts +10 -5
- package/src/queries/use-launchpad.ts +17 -10
- package/src/queries/use-site-domains-query.ts +8 -1
- package/src/queries/use-site-intent.ts +2 -1
- package/src/reader/contexts/site-subscriptions-query-props.tsx +23 -14
- package/src/reader/hooks/use-is-logged-in.ts +9 -16
- package/src/reader/mutations/use-site-subscribe-mutation.ts +2 -2
- package/src/reader/mutations/use-site-unsubscribe-mutation.ts +7 -0
- package/src/reader/queries/test/use-read-feed-search-query.tsx +1 -1
- package/src/reader/queries/use-read-feed-query.ts +4 -2
- package/src/reader/queries/use-read-feed-site-query.ts +2 -2
- package/src/site/actions.ts +44 -15
- package/src/site/constants.ts +2 -7
- package/src/site/queries/use-site-media-storage.ts +1 -0
- package/src/site/test/actions.ts +73 -7
- package/src/site/test/selectors.ts +0 -1
- package/src/site/types.ts +26 -43
- package/src/starter-designs-queries/types.ts +1 -12
- package/src/starter-designs-queries/use-starter-designs-query.ts +4 -0
- package/src/stepper-internal/reducer.ts +1 -0
- package/src/subscriber/actions.ts +111 -79
- package/src/subscriber/index.ts +0 -2
- package/src/subscriber/selectors.ts +6 -0
- package/src/subscriber/types.ts +18 -1
- package/src/user/types.ts +4 -2
- package/src/users/use-send-invites.ts +1 -2
- package/dist/cjs/add-ons/hooks/use-add-on-display-cost.js +0 -29
- package/dist/cjs/add-ons/hooks/use-add-on-display-cost.js.map +0 -1
- package/dist/cjs/add-ons/lib/is-storage-addon-enabled.js +0 -11
- package/dist/cjs/add-ons/lib/is-storage-addon-enabled.js.map +0 -1
- package/dist/cjs/analyzer/actions.js +0 -40
- package/dist/cjs/analyzer/actions.js.map +0 -1
- package/dist/cjs/analyzer/constants.js +0 -5
- package/dist/cjs/analyzer/constants.js.map +0 -1
- package/dist/cjs/analyzer/index.js +0 -19
- package/dist/cjs/analyzer/index.js.map +0 -1
- package/dist/cjs/analyzer/reducers.js +0 -27
- package/dist/cjs/analyzer/reducers.js.map +0 -1
- package/dist/cjs/analyzer/selectors.js +0 -15
- package/dist/cjs/analyzer/selectors.js.map +0 -1
- package/dist/cjs/analyzer/types.js +0 -3
- package/dist/cjs/analyzer/types.js.map +0 -1
- package/dist/cjs/automated-transfer-eligibility/actions.js +0 -10
- package/dist/cjs/automated-transfer-eligibility/actions.js.map +0 -1
- package/dist/cjs/automated-transfer-eligibility/constants.js +0 -43
- package/dist/cjs/automated-transfer-eligibility/constants.js.map +0 -1
- package/dist/cjs/automated-transfer-eligibility/index.js +0 -27
- package/dist/cjs/automated-transfer-eligibility/index.js.map +0 -1
- package/dist/cjs/automated-transfer-eligibility/reducer.js +0 -17
- package/dist/cjs/automated-transfer-eligibility/reducer.js.map +0 -1
- package/dist/cjs/automated-transfer-eligibility/resolvers.js +0 -18
- package/dist/cjs/automated-transfer-eligibility/resolvers.js.map +0 -1
- package/dist/cjs/automated-transfer-eligibility/selectors.js +0 -60
- package/dist/cjs/automated-transfer-eligibility/selectors.js.map +0 -1
- package/dist/cjs/automated-transfer-eligibility/types.js +0 -3
- package/dist/cjs/automated-transfer-eligibility/types.js.map +0 -1
- package/dist/cjs/launchpad-navigator/actions.js +0 -71
- package/dist/cjs/launchpad-navigator/actions.js.map +0 -1
- package/dist/cjs/launchpad-navigator/constants.js +0 -7
- package/dist/cjs/launchpad-navigator/constants.js.map +0 -1
- package/dist/cjs/launchpad-navigator/index.js +0 -19
- package/dist/cjs/launchpad-navigator/index.js.map +0 -1
- package/dist/cjs/launchpad-navigator/reducer.js +0 -24
- package/dist/cjs/launchpad-navigator/reducer.js.map +0 -1
- package/dist/cjs/launchpad-navigator/selectors.js +0 -8
- package/dist/cjs/launchpad-navigator/selectors.js.map +0 -1
- package/dist/cjs/queries/use-launchpad-navigator.js +0 -39
- package/dist/cjs/queries/use-launchpad-navigator.js.map +0 -1
- package/dist/esm/add-ons/hooks/use-add-on-display-cost.js +0 -26
- package/dist/esm/add-ons/hooks/use-add-on-display-cost.js.map +0 -1
- package/dist/esm/add-ons/lib/is-storage-addon-enabled.js +0 -8
- package/dist/esm/add-ons/lib/is-storage-addon-enabled.js.map +0 -1
- package/dist/esm/analyzer/actions.js +0 -36
- package/dist/esm/analyzer/actions.js.map +0 -1
- package/dist/esm/analyzer/constants.js +0 -2
- package/dist/esm/analyzer/constants.js.map +0 -1
- package/dist/esm/analyzer/index.js +0 -15
- package/dist/esm/analyzer/index.js.map +0 -1
- package/dist/esm/analyzer/reducers.js +0 -25
- package/dist/esm/analyzer/reducers.js.map +0 -1
- package/dist/esm/analyzer/selectors.js +0 -9
- package/dist/esm/analyzer/selectors.js.map +0 -1
- package/dist/esm/analyzer/types.js +0 -2
- package/dist/esm/analyzer/types.js.map +0 -1
- package/dist/esm/automated-transfer-eligibility/actions.js +0 -6
- package/dist/esm/automated-transfer-eligibility/actions.js.map +0 -1
- package/dist/esm/automated-transfer-eligibility/constants.js +0 -40
- package/dist/esm/automated-transfer-eligibility/constants.js.map +0 -1
- package/dist/esm/automated-transfer-eligibility/index.js +0 -22
- package/dist/esm/automated-transfer-eligibility/index.js.map +0 -1
- package/dist/esm/automated-transfer-eligibility/reducer.js +0 -13
- package/dist/esm/automated-transfer-eligibility/reducer.js.map +0 -1
- package/dist/esm/automated-transfer-eligibility/resolvers.js +0 -13
- package/dist/esm/automated-transfer-eligibility/resolvers.js.map +0 -1
- package/dist/esm/automated-transfer-eligibility/selectors.js +0 -56
- package/dist/esm/automated-transfer-eligibility/selectors.js.map +0 -1
- package/dist/esm/automated-transfer-eligibility/types.js +0 -2
- package/dist/esm/automated-transfer-eligibility/types.js.map +0 -1
- package/dist/esm/launchpad-navigator/actions.js +0 -63
- package/dist/esm/launchpad-navigator/actions.js.map +0 -1
- package/dist/esm/launchpad-navigator/constants.js +0 -4
- package/dist/esm/launchpad-navigator/constants.js.map +0 -1
- package/dist/esm/launchpad-navigator/index.js +0 -15
- package/dist/esm/launchpad-navigator/index.js.map +0 -1
- package/dist/esm/launchpad-navigator/reducer.js +0 -22
- package/dist/esm/launchpad-navigator/reducer.js.map +0 -1
- package/dist/esm/launchpad-navigator/selectors.js +0 -3
- package/dist/esm/launchpad-navigator/selectors.js.map +0 -1
- package/dist/esm/queries/use-launchpad-navigator.js +0 -33
- package/dist/esm/queries/use-launchpad-navigator.js.map +0 -1
- package/dist/types/add-ons/hooks/use-add-on-display-cost.d.ts +0 -5
- package/dist/types/add-ons/hooks/use-add-on-display-cost.d.ts.map +0 -1
- package/dist/types/add-ons/lib/is-storage-addon-enabled.d.ts +0 -7
- package/dist/types/add-ons/lib/is-storage-addon-enabled.d.ts.map +0 -1
- package/dist/types/analyzer/actions.d.ts +0 -37
- package/dist/types/analyzer/actions.d.ts.map +0 -1
- package/dist/types/analyzer/constants.d.ts +0 -2
- package/dist/types/analyzer/constants.d.ts.map +0 -1
- package/dist/types/analyzer/index.d.ts +0 -38
- package/dist/types/analyzer/index.d.ts.map +0 -1
- package/dist/types/analyzer/reducers.d.ts +0 -9
- package/dist/types/analyzer/reducers.d.ts.map +0 -1
- package/dist/types/analyzer/selectors.d.ts +0 -7
- package/dist/types/analyzer/selectors.d.ts.map +0 -1
- package/dist/types/analyzer/types.d.ts +0 -35
- package/dist/types/analyzer/types.d.ts.map +0 -1
- package/dist/types/automated-transfer-eligibility/actions.d.ts +0 -10
- package/dist/types/automated-transfer-eligibility/actions.d.ts.map +0 -1
- package/dist/types/automated-transfer-eligibility/constants.d.ts +0 -11
- package/dist/types/automated-transfer-eligibility/constants.d.ts.map +0 -1
- package/dist/types/automated-transfer-eligibility/index.d.ts +0 -7
- package/dist/types/automated-transfer-eligibility/index.d.ts.map +0 -1
- package/dist/types/automated-transfer-eligibility/reducer.d.ts +0 -6
- package/dist/types/automated-transfer-eligibility/reducer.d.ts.map +0 -1
- package/dist/types/automated-transfer-eligibility/resolvers.d.ts +0 -7
- package/dist/types/automated-transfer-eligibility/resolvers.d.ts.map +0 -1
- package/dist/types/automated-transfer-eligibility/selectors.d.ts +0 -7
- package/dist/types/automated-transfer-eligibility/selectors.d.ts.map +0 -1
- package/dist/types/automated-transfer-eligibility/types.d.ts +0 -36
- package/dist/types/automated-transfer-eligibility/types.d.ts.map +0 -1
- package/dist/types/launchpad-navigator/actions.d.ts +0 -22
- package/dist/types/launchpad-navigator/actions.d.ts.map +0 -1
- package/dist/types/launchpad-navigator/constants.d.ts +0 -4
- package/dist/types/launchpad-navigator/constants.d.ts.map +0 -1
- package/dist/types/launchpad-navigator/index.d.ts +0 -4
- package/dist/types/launchpad-navigator/index.d.ts.map +0 -1
- package/dist/types/launchpad-navigator/reducer.d.ts +0 -9
- package/dist/types/launchpad-navigator/reducer.d.ts.map +0 -1
- package/dist/types/launchpad-navigator/selectors.d.ts +0 -4
- package/dist/types/launchpad-navigator/selectors.d.ts.map +0 -1
- package/dist/types/queries/use-launchpad-navigator.d.ts +0 -15
- package/dist/types/queries/use-launchpad-navigator.d.ts.map +0 -1
- package/src/add-ons/hooks/use-add-on-display-cost.ts +0 -28
- package/src/add-ons/lib/is-storage-addon-enabled.ts +0 -9
- package/src/analyzer/actions.ts +0 -50
- package/src/analyzer/constants.ts +0 -1
- package/src/analyzer/index.ts +0 -17
- package/src/analyzer/reducers.ts +0 -36
- package/src/analyzer/selectors.ts +0 -11
- package/src/analyzer/types.ts +0 -37
- package/src/automated-transfer-eligibility/actions.ts +0 -15
- package/src/automated-transfer-eligibility/constants.ts +0 -44
- package/src/automated-transfer-eligibility/index.ts +0 -25
- package/src/automated-transfer-eligibility/reducer.ts +0 -18
- package/src/automated-transfer-eligibility/resolvers.ts +0 -16
- package/src/automated-transfer-eligibility/selectors.ts +0 -94
- package/src/automated-transfer-eligibility/test/reducer.ts +0 -60
- package/src/automated-transfer-eligibility/types.ts +0 -45
- package/src/launchpad-navigator/actions.ts +0 -85
- package/src/launchpad-navigator/constants.ts +0 -4
- package/src/launchpad-navigator/index.ts +0 -16
- package/src/launchpad-navigator/reducer.ts +0 -35
- package/src/launchpad-navigator/selectors.ts +0 -6
- package/src/queries/use-launchpad-navigator.ts +0 -56
|
@@ -28,9 +28,12 @@ export const NEXT_STORE_SITE_PLAN_BUSINESS: SitePlan = {
|
|
|
28
28
|
productId: 2,
|
|
29
29
|
pricing: {
|
|
30
30
|
introOffer: {
|
|
31
|
-
formattedPrice: '$
|
|
32
|
-
rawPrice:
|
|
33
|
-
|
|
31
|
+
formattedPrice: '$150.00',
|
|
32
|
+
rawPrice: {
|
|
33
|
+
monthly: 1250,
|
|
34
|
+
full: 15000,
|
|
35
|
+
},
|
|
36
|
+
intervalUnit: 'year',
|
|
34
37
|
intervalCount: 1,
|
|
35
38
|
isOfferComplete: false,
|
|
36
39
|
},
|
|
@@ -84,9 +87,12 @@ export const NEXT_STORE_PLAN_BUSINESS: PlanNext = {
|
|
|
84
87
|
billPeriod: 365,
|
|
85
88
|
currencyCode: 'USD',
|
|
86
89
|
introOffer: {
|
|
87
|
-
formattedPrice: '$
|
|
88
|
-
rawPrice:
|
|
89
|
-
|
|
90
|
+
formattedPrice: '$300.00',
|
|
91
|
+
rawPrice: {
|
|
92
|
+
monthly: 2500,
|
|
93
|
+
full: 30000,
|
|
94
|
+
},
|
|
95
|
+
intervalUnit: 'year',
|
|
90
96
|
intervalCount: 1,
|
|
91
97
|
isOfferComplete: false,
|
|
92
98
|
},
|
|
@@ -6,8 +6,11 @@ import type { PlanIntroductoryOffer, PricedAPIPlan, PricedAPISitePlan } from '..
|
|
|
6
6
|
const unpackIntroOffer = (
|
|
7
7
|
plan: PricedAPISitePlan | PricedAPIPlan
|
|
8
8
|
): PlanIntroductoryOffer | null => {
|
|
9
|
-
// these aren't grouped or separated. so no introductory offer if
|
|
10
|
-
if (
|
|
9
|
+
// these aren't grouped or separated. so no introductory offer if missing or malformed raw_price
|
|
10
|
+
if (
|
|
11
|
+
typeof plan.introductory_offer_raw_price_integer !== 'number' ||
|
|
12
|
+
! plan.introductory_offer_interval_count
|
|
13
|
+
) {
|
|
11
14
|
return null;
|
|
12
15
|
}
|
|
13
16
|
|
|
@@ -30,9 +33,25 @@ const unpackIntroOffer = (
|
|
|
30
33
|
|
|
31
34
|
return {
|
|
32
35
|
formattedPrice: plan.introductory_offer_formatted_price as string,
|
|
33
|
-
rawPrice:
|
|
36
|
+
rawPrice: {
|
|
37
|
+
monthly:
|
|
38
|
+
/**
|
|
39
|
+
* IMPORTANT:
|
|
40
|
+
* we make the raw assumption that the interval unit is either "year" or "month"
|
|
41
|
+
* to compute monthly/full price
|
|
42
|
+
*/
|
|
43
|
+
'year' === plan.introductory_offer_interval_unit
|
|
44
|
+
? parseFloat(
|
|
45
|
+
(
|
|
46
|
+
plan.introductory_offer_raw_price_integer /
|
|
47
|
+
( plan.introductory_offer_interval_count * 12 )
|
|
48
|
+
).toFixed( 2 )
|
|
49
|
+
)
|
|
50
|
+
: plan.introductory_offer_raw_price_integer,
|
|
51
|
+
full: plan.introductory_offer_raw_price_integer,
|
|
52
|
+
},
|
|
34
53
|
intervalUnit: plan.introductory_offer_interval_unit as string,
|
|
35
|
-
intervalCount: plan.introductory_offer_interval_count
|
|
54
|
+
intervalCount: plan.introductory_offer_interval_count,
|
|
36
55
|
isOfferComplete,
|
|
37
56
|
};
|
|
38
57
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
const useQueryKeysFactory = () => ( {
|
|
2
|
-
sitePlans: ( siteId?: string | number | null ) => [
|
|
2
|
+
sitePlans: ( coupon?: string, siteId?: string | number | null ) => [
|
|
3
|
+
'site-plans',
|
|
4
|
+
siteId,
|
|
5
|
+
coupon,
|
|
6
|
+
],
|
|
3
7
|
plans: ( coupon?: string ) => [ 'plans', coupon ],
|
|
4
8
|
} );
|
|
5
9
|
|
|
@@ -31,7 +31,7 @@ function usePlans( {
|
|
|
31
31
|
queryKey: queryKeys.plans( coupon ),
|
|
32
32
|
queryFn: async (): Promise< PlansIndex > => {
|
|
33
33
|
const data: PricedAPIPlan[] = await wpcomRequest( {
|
|
34
|
-
path:
|
|
34
|
+
path: '/plans',
|
|
35
35
|
apiVersion: '1.5',
|
|
36
36
|
query: params.toString(),
|
|
37
37
|
} );
|
|
@@ -14,6 +14,11 @@ interface PricedAPISitePlansIndex {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface Props {
|
|
17
|
+
/**
|
|
18
|
+
* To match the use-plans hook, `coupon` is required on purpose to mitigate risk of not passing
|
|
19
|
+
* something through when we should
|
|
20
|
+
*/
|
|
21
|
+
coupon: string | undefined;
|
|
17
22
|
siteId: string | number | null | undefined;
|
|
18
23
|
}
|
|
19
24
|
|
|
@@ -22,15 +27,18 @@ interface Props {
|
|
|
22
27
|
* - Plans from `/sites/[siteId]/plans`, unlike `/plans`, are returned indexed by product_id, and do not include that in the plan's payload.
|
|
23
28
|
* - UI works with product/plan slugs everywhere, so returned index is transformed to be keyed by product_slug
|
|
24
29
|
*/
|
|
25
|
-
function useSitePlans( { siteId }: Props ): UseQueryResult< SitePlansIndex > {
|
|
30
|
+
function useSitePlans( { coupon, siteId }: Props ): UseQueryResult< SitePlansIndex > {
|
|
26
31
|
const queryKeys = useQueryKeysFactory();
|
|
32
|
+
const params = new URLSearchParams();
|
|
33
|
+
coupon && params.append( 'coupon_code', coupon );
|
|
27
34
|
|
|
28
35
|
return useQuery( {
|
|
29
|
-
queryKey: queryKeys.sitePlans( siteId ),
|
|
36
|
+
queryKey: queryKeys.sitePlans( coupon, siteId ),
|
|
30
37
|
queryFn: async (): Promise< SitePlansIndex > => {
|
|
31
38
|
const data: PricedAPISitePlansIndex = await wpcomRequest( {
|
|
32
39
|
path: `/sites/${ encodeURIComponent( siteId as string ) }/plans`,
|
|
33
40
|
apiVersion: '1.3',
|
|
41
|
+
query: params.toString(),
|
|
34
42
|
} );
|
|
35
43
|
|
|
36
44
|
return Object.fromEntries(
|
|
@@ -52,6 +60,7 @@ function useSitePlans( { siteId }: Props ): UseQueryResult< SitePlansIndex > {
|
|
|
52
60
|
hasRedeemedDomainCredit: plan?.has_redeemed_domain_credit,
|
|
53
61
|
purchaseId: plan.id ? Number( plan.id ) : undefined,
|
|
54
62
|
pricing: {
|
|
63
|
+
hasSaleCoupon: plan.has_sale_coupon,
|
|
55
64
|
currencyCode: plan.currency_code,
|
|
56
65
|
introOffer: unpackIntroOffer( plan ),
|
|
57
66
|
costOverrides: unpackCostOverrides( plan ),
|
package/src/plans/resolvers.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import formatCurrency from '@automattic/
|
|
1
|
+
import { formatCurrency } from '@automattic/number-formatters';
|
|
2
2
|
import { stringify } from 'qs';
|
|
3
3
|
import { fetchAndParse, wpcomRequest } from '../wpcom-request-controls';
|
|
4
4
|
import { setFeatures, setFeaturesByType, setPlanProducts, setPlans } from './actions';
|
package/src/plans/types.ts
CHANGED
|
@@ -67,8 +67,19 @@ export interface PlanProduct {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export interface PlanIntroductoryOffer {
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated use `formatCurrency` call instead on the respective price (monthly/full)
|
|
72
|
+
*/
|
|
70
73
|
formattedPrice: string;
|
|
71
|
-
rawPrice:
|
|
74
|
+
rawPrice: {
|
|
75
|
+
monthly: number;
|
|
76
|
+
full: number;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* IMPORTANT:
|
|
80
|
+
* we make the raw assumption that the interval unit is either "year" or "month"
|
|
81
|
+
* to compute monthly/full price
|
|
82
|
+
*/
|
|
72
83
|
intervalUnit: string;
|
|
73
84
|
intervalCount: number;
|
|
74
85
|
isOfferComplete: boolean;
|
|
@@ -109,6 +120,7 @@ export interface PlanPricing {
|
|
|
109
120
|
}
|
|
110
121
|
|
|
111
122
|
export interface SitePlanPricing extends Omit< PlanPricing, 'billPeriod' > {
|
|
123
|
+
hasSaleCoupon?: boolean;
|
|
112
124
|
costOverrides?: CostOverride[];
|
|
113
125
|
}
|
|
114
126
|
|
|
@@ -173,8 +185,17 @@ export interface PlanNext {
|
|
|
173
185
|
}
|
|
174
186
|
|
|
175
187
|
export interface PricedAPIPlanIntroductoryOffer {
|
|
188
|
+
/**
|
|
189
|
+
* @deprecated use `formatCurrency` call instead on the respective price (monthly/full)
|
|
190
|
+
* - no need to pass this from the API at all
|
|
191
|
+
*/
|
|
176
192
|
introductory_offer_formatted_price?: string;
|
|
177
|
-
|
|
193
|
+
introductory_offer_raw_price_integer?: number;
|
|
194
|
+
/**
|
|
195
|
+
* IMPORTANT:
|
|
196
|
+
* we make the raw assumption that the interval unit is either "year" or "month"
|
|
197
|
+
* to compute monthly/full price
|
|
198
|
+
*/
|
|
178
199
|
introductory_offer_interval_unit?: string;
|
|
179
200
|
introductory_offer_interval_count?: number;
|
|
180
201
|
introductory_offer_end_date?: string;
|
|
@@ -249,6 +270,7 @@ export interface PricedAPIPlan extends PricedAPIPlanPricing, PricedAPIPlanIntrod
|
|
|
249
270
|
export interface PricedAPISitePlan
|
|
250
271
|
extends PricedAPISitePlanPricing,
|
|
251
272
|
PricedAPIPlanIntroductoryOffer {
|
|
273
|
+
has_sale_coupon?: boolean;
|
|
252
274
|
/* product_id: number; // not included in the plan's payload */
|
|
253
275
|
product_slug: StorePlanSlug;
|
|
254
276
|
current_plan?: boolean;
|
|
@@ -25,7 +25,7 @@ function useProducts(
|
|
|
25
25
|
queryKey: [ ...queryKeys.products(), product_slugs, locale ],
|
|
26
26
|
queryFn: async (): Promise< ProductsIndex > => {
|
|
27
27
|
const apiProducts: RawAPIProductsList = await wpcomRequest( {
|
|
28
|
-
path:
|
|
28
|
+
path: '/products',
|
|
29
29
|
apiVersion: '1.1',
|
|
30
30
|
...( product_slugs
|
|
31
31
|
? { query: new URLSearchParams( { product_slugs, locale } ).toString() }
|
|
@@ -12,6 +12,7 @@ export function createPurchaseObject( purchase: RawPurchase | RawPurchaseCreditC
|
|
|
12
12
|
billPeriodDays: Number( purchase.bill_period_days ),
|
|
13
13
|
billPeriodLabel: purchase.bill_period_label,
|
|
14
14
|
mostRecentRenewDate: purchase.most_recent_renew_date,
|
|
15
|
+
asyncPendingPaymentBlockIsSet: purchase.async_pending_payment_block_is_set,
|
|
15
16
|
canDisableAutoRenew: Boolean( purchase.can_disable_auto_renew ),
|
|
16
17
|
canReenableAutoRenewal: Boolean( purchase.can_reenable_auto_renewal ),
|
|
17
18
|
canExplicitRenew: Boolean( purchase.can_explicit_renew ),
|
|
@@ -58,6 +59,7 @@ export function createPurchaseObject( purchase: RawPurchase | RawPurchaseCreditC
|
|
|
58
59
|
isCancelable: Boolean( purchase.is_cancelable ),
|
|
59
60
|
isDomain: Boolean( purchase.is_domain ),
|
|
60
61
|
isDomainRegistration: Boolean( purchase.is_domain_registration ),
|
|
62
|
+
isHundredYearDomain: Boolean( purchase.is_hundred_year_domain ),
|
|
61
63
|
isLocked: Boolean( purchase.is_locked ),
|
|
62
64
|
isInAppPurchase: Boolean( purchase.is_iap_purchase ),
|
|
63
65
|
isRechargeable: Boolean( purchase.is_rechargable ),
|
|
@@ -112,6 +114,7 @@ export function createPurchaseObject( purchase: RawPurchase | RawPurchaseCreditC
|
|
|
112
114
|
saleAmountInteger: purchase.sale_amount_integer,
|
|
113
115
|
siteId: Number( purchase.blog_id ),
|
|
114
116
|
siteName: purchase.blogname,
|
|
117
|
+
siteSlug: purchase.site_slug,
|
|
115
118
|
subscribedDate: purchase.subscribed_date,
|
|
116
119
|
subscriptionStatus: purchase.subscription_status,
|
|
117
120
|
tagLine: purchase.tag_line,
|
|
@@ -122,6 +125,10 @@ export function createPurchaseObject( purchase: RawPurchase | RawPurchaseCreditC
|
|
|
122
125
|
isAutoRenewEnabled: parseInt( purchase.auto_renew ?? '' ) === 1,
|
|
123
126
|
};
|
|
124
127
|
|
|
128
|
+
if ( purchase.purchaser_id ) {
|
|
129
|
+
object.purchaserId = Number( purchase.purchaser_id );
|
|
130
|
+
}
|
|
131
|
+
|
|
125
132
|
if ( isCreditCardPurchase( purchase ) ) {
|
|
126
133
|
object.payment.creditCard = {
|
|
127
134
|
id: Number( purchase.payment_card_id ),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const useQueryKeysFactory = () => ( {
|
|
2
2
|
sitePurchases: ( siteId?: string | number | null ) => [ 'site-purchases', siteId ],
|
|
3
|
+
transferredPurchases: ( userId?: string | number | null ) => [ 'transferred-purchases', userId ],
|
|
3
4
|
} );
|
|
4
5
|
|
|
5
6
|
export default useQueryKeysFactory;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import wpcomRequest from 'wpcom-proxy-request';
|
|
3
|
+
import { createPurchaseObject } from '../lib/assembler';
|
|
4
|
+
import useQueryKeysFactory from './lib/use-query-keys-factory';
|
|
5
|
+
import type { RawPurchase, Purchase } from '../types';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
userId?: string | number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function getUseTransferredPurchasesOptions(
|
|
12
|
+
{ userId }: Props,
|
|
13
|
+
queryKey: ( string | number | null | undefined )[]
|
|
14
|
+
) {
|
|
15
|
+
return {
|
|
16
|
+
queryKey,
|
|
17
|
+
queryFn: async (): Promise< Purchase[] > => {
|
|
18
|
+
const purchases: RawPurchase[] = await wpcomRequest( {
|
|
19
|
+
path: '/me/purchases/transferred',
|
|
20
|
+
apiVersion: '1.1',
|
|
21
|
+
} );
|
|
22
|
+
|
|
23
|
+
return purchases.map( ( rawPurchase ) => createPurchaseObject( rawPurchase ) );
|
|
24
|
+
},
|
|
25
|
+
enabled: !! userId,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Fetches all purchases for a given site, transformed into a map of purchaseId => Purchase
|
|
31
|
+
* @param {Object} props - The properties for the function
|
|
32
|
+
* @param props.userId Site ID
|
|
33
|
+
* @returns Query result
|
|
34
|
+
*/
|
|
35
|
+
function useGetJetpackTransferredLicensePurchases( { userId }: Props ) {
|
|
36
|
+
const queryKeys = useQueryKeysFactory();
|
|
37
|
+
|
|
38
|
+
return useQuery< Purchase[] >(
|
|
39
|
+
getUseTransferredPurchasesOptions( { userId }, queryKeys.transferredPurchases( userId ) )
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default useGetJetpackTransferredLicensePurchases;
|
package/src/purchases/types.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface Purchase {
|
|
|
8
8
|
billPeriodLabel: string;
|
|
9
9
|
blogCreatedDate: string;
|
|
10
10
|
canDisableAutoRenew: boolean;
|
|
11
|
+
asyncPendingPaymentBlockIsSet: boolean;
|
|
11
12
|
canExplicitRenew: boolean;
|
|
12
13
|
canReenableAutoRenewal: boolean;
|
|
13
14
|
costToUnbundle: number;
|
|
@@ -15,7 +16,18 @@ export interface Purchase {
|
|
|
15
16
|
currencyCode: string;
|
|
16
17
|
currencySymbol: string;
|
|
17
18
|
description: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The domain name of the site associated with the purchase.
|
|
22
|
+
*
|
|
23
|
+
* IMPORTANT: this is not necessarily the primary domain of the site. This
|
|
24
|
+
* can cause issues for Atomic sites if you try to use it for things that
|
|
25
|
+
* expect the primary domain, like routing.
|
|
26
|
+
*
|
|
27
|
+
* To get the primary domain instead, use `siteSlug`.
|
|
28
|
+
*/
|
|
18
29
|
domain: string;
|
|
30
|
+
|
|
19
31
|
domainRegistrationAgreementUrl: string | null;
|
|
20
32
|
error: null;
|
|
21
33
|
expiryDate: string;
|
|
@@ -29,6 +41,7 @@ export interface Purchase {
|
|
|
29
41
|
isCancelable: boolean;
|
|
30
42
|
isDomain?: boolean;
|
|
31
43
|
isDomainRegistration?: boolean;
|
|
44
|
+
isHundredYearDomain?: boolean;
|
|
32
45
|
isInAppPurchase: boolean;
|
|
33
46
|
isLocked: boolean;
|
|
34
47
|
isRechargeable: boolean;
|
|
@@ -58,6 +71,7 @@ export interface Purchase {
|
|
|
58
71
|
productSlug: string;
|
|
59
72
|
productType: string;
|
|
60
73
|
purchaseRenewalQuantity: number | null;
|
|
74
|
+
purchaserId?: number;
|
|
61
75
|
|
|
62
76
|
/**
|
|
63
77
|
* The refund amount for the purchase, not including bundled domains, as a
|
|
@@ -104,6 +118,12 @@ export interface Purchase {
|
|
|
104
118
|
saleAmountInteger?: number;
|
|
105
119
|
siteId: number;
|
|
106
120
|
siteName: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The primary domain for the site that owns this purchase.
|
|
124
|
+
*/
|
|
125
|
+
siteSlug?: string;
|
|
126
|
+
|
|
107
127
|
subscribedDate: string;
|
|
108
128
|
subscriptionStatus: 'active' | 'inactive';
|
|
109
129
|
|
|
@@ -183,6 +203,7 @@ export interface RawPurchase {
|
|
|
183
203
|
most_recent_renew_date: string;
|
|
184
204
|
can_disable_auto_renew: boolean;
|
|
185
205
|
can_reenable_auto_renewal: boolean;
|
|
206
|
+
async_pending_payment_block_is_set: boolean;
|
|
186
207
|
can_explicit_renew: boolean;
|
|
187
208
|
cost_to_unbundle: undefined | number | string;
|
|
188
209
|
cost_to_unbundle_display: undefined | string;
|
|
@@ -203,6 +224,7 @@ export interface RawPurchase {
|
|
|
203
224
|
is_cancelable: boolean;
|
|
204
225
|
is_domain: boolean;
|
|
205
226
|
is_domain_registration: boolean;
|
|
227
|
+
is_hundred_year_domain: boolean;
|
|
206
228
|
is_locked: boolean;
|
|
207
229
|
is_iap_purchase: boolean;
|
|
208
230
|
is_rechargable: boolean;
|
|
@@ -235,6 +257,7 @@ export interface RawPurchase {
|
|
|
235
257
|
product_type: string;
|
|
236
258
|
product_display_price: string;
|
|
237
259
|
price_integer: number;
|
|
260
|
+
purchaser_id?: number;
|
|
238
261
|
total_refund_amount: number | undefined;
|
|
239
262
|
total_refund_currency: string;
|
|
240
263
|
total_refund_integer: number;
|
|
@@ -252,6 +275,7 @@ export interface RawPurchase {
|
|
|
252
275
|
sale_amount_integer: number | undefined;
|
|
253
276
|
blog_id: number | string;
|
|
254
277
|
blogname: string;
|
|
278
|
+
site_slug?: string;
|
|
255
279
|
subscribed_date: string;
|
|
256
280
|
subscription_status: 'active' | 'inactive';
|
|
257
281
|
tag_line: string;
|
|
@@ -316,6 +340,7 @@ export interface PurchasePayment {
|
|
|
316
340
|
storedDetailsId: string | number | undefined | null;
|
|
317
341
|
expiryDate?: string;
|
|
318
342
|
creditCard?: PurchasePaymentCreditCard;
|
|
343
|
+
paymentPartner?: string;
|
|
319
344
|
}
|
|
320
345
|
|
|
321
346
|
/**
|
|
@@ -17,11 +17,13 @@ export type PartialDomainData = Pick<
|
|
|
17
17
|
| 'google_apps_subscription'
|
|
18
18
|
| 'has_registration'
|
|
19
19
|
| 'is_wpcom_staging_domain'
|
|
20
|
+
| 'is_hundred_year_domain'
|
|
20
21
|
| 'registration_date'
|
|
21
22
|
| 'titan_mail_subscription'
|
|
22
23
|
| 'tld_maintenance_end_time'
|
|
23
24
|
| 'type'
|
|
24
25
|
| 'wpcom_domain'
|
|
26
|
+
| 'domain_status'
|
|
25
27
|
>;
|
|
26
28
|
|
|
27
29
|
export interface AllDomainsQueryFnData {
|
|
@@ -30,6 +32,7 @@ export interface AllDomainsQueryFnData {
|
|
|
30
32
|
|
|
31
33
|
export interface AllDomainsQueryArgs {
|
|
32
34
|
no_wpcom?: boolean;
|
|
35
|
+
resolve_status?: boolean;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
export const getAllDomainsQueryKey = ( queryArgs: AllDomainsQueryArgs = {} ) => [
|
|
@@ -24,6 +24,11 @@ export interface JobStatus {
|
|
|
24
24
|
failed: string[];
|
|
25
25
|
pending: string[];
|
|
26
26
|
complete: boolean;
|
|
27
|
+
params: {
|
|
28
|
+
auto_renew?: boolean;
|
|
29
|
+
whois?: unknown;
|
|
30
|
+
transfer_lock?: boolean;
|
|
31
|
+
};
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
interface DomainUpdateRemoteStatus {
|
|
@@ -64,17 +69,16 @@ export function useBulkDomainUpdateStatusQuery< TError = unknown >(
|
|
|
64
69
|
wpcomRequest< BulkDomainUpdateStatusQueryFnData >( {
|
|
65
70
|
path: '/domains/bulk-actions',
|
|
66
71
|
apiNamespace: 'wpcom/v2',
|
|
67
|
-
apiVersion: '2',
|
|
68
72
|
} ),
|
|
69
73
|
select: ( data ): BulkDomainUpdateStatusResult => {
|
|
70
74
|
// get top-level info about recent jobs
|
|
71
75
|
const allJobs: JobStatus[] = Object.keys( data ).map( ( jobId ) => {
|
|
72
|
-
const
|
|
76
|
+
const { action, created_at, results, ...rest } = data[ jobId ];
|
|
73
77
|
const success: string[] = [];
|
|
74
78
|
const failed: string[] = [];
|
|
75
79
|
const pending: string[] = [];
|
|
76
80
|
|
|
77
|
-
Object.entries(
|
|
81
|
+
Object.entries( results ).forEach( ( entry ) => {
|
|
78
82
|
if ( entry[ 1 ] === 'success' ) {
|
|
79
83
|
success.push( entry[ 0 ] );
|
|
80
84
|
} else if ( entry[ 1 ] === 'failed' ) {
|
|
@@ -86,12 +90,13 @@ export function useBulkDomainUpdateStatusQuery< TError = unknown >(
|
|
|
86
90
|
|
|
87
91
|
return {
|
|
88
92
|
id: jobId,
|
|
89
|
-
action:
|
|
90
|
-
created_at:
|
|
93
|
+
action: action,
|
|
94
|
+
created_at: created_at,
|
|
91
95
|
success,
|
|
92
96
|
failed,
|
|
93
97
|
pending,
|
|
94
98
|
complete: pending.length === 0,
|
|
99
|
+
params: rest,
|
|
95
100
|
};
|
|
96
101
|
} );
|
|
97
102
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { recordTracksEvent } from '@automattic/calypso-analytics';
|
|
2
|
+
import * as oauthToken from '@automattic/oauth-token';
|
|
2
3
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
3
4
|
import apiFetch from '@wordpress/api-fetch';
|
|
4
5
|
import { addQueryArgs } from '@wordpress/url';
|
|
@@ -70,21 +71,21 @@ export const fetchLaunchpad = (
|
|
|
70
71
|
const checklistSlugEncoded = checklistSlug ? encodeURIComponent( checklistSlug ) : null;
|
|
71
72
|
const launchpadContextEncoded = launchpadContext ? encodeURIComponent( launchpadContext ) : null;
|
|
72
73
|
const queryArgs = {
|
|
73
|
-
_locale: '
|
|
74
|
+
_locale: 'user',
|
|
74
75
|
...( checklistSlug && { checklist_slug: checklistSlugEncoded } ),
|
|
75
76
|
...( launchpadContext && { launchpad_context: launchpadContextEncoded } ),
|
|
76
77
|
};
|
|
77
|
-
|
|
78
|
+
const token = oauthToken.getToken();
|
|
78
79
|
return canAccessWpcomApis()
|
|
79
80
|
? wpcomRequest( {
|
|
80
81
|
path: addQueryArgs( `/sites/${ slug }/launchpad`, queryArgs ),
|
|
81
82
|
apiNamespace: 'wpcom/v2',
|
|
82
|
-
apiVersion: '2',
|
|
83
83
|
method: 'GET',
|
|
84
|
+
token: typeof token === 'string' ? token : undefined,
|
|
84
85
|
} )
|
|
85
86
|
: apiFetch( {
|
|
86
87
|
global: true,
|
|
87
|
-
path: addQueryArgs(
|
|
88
|
+
path: addQueryArgs( '/wpcom/v2/launchpad', queryArgs ),
|
|
88
89
|
} as APIFetchOptions );
|
|
89
90
|
};
|
|
90
91
|
|
|
@@ -105,12 +106,12 @@ export function sortLaunchpadTasksByCompletionStatus( response: LaunchpadRespons
|
|
|
105
106
|
return response;
|
|
106
107
|
}
|
|
107
108
|
|
|
108
|
-
|
|
109
|
+
export function defaultSuccessCallback( response: LaunchpadResponse ) {
|
|
109
110
|
const tasks = response.checklist || [];
|
|
110
111
|
response.checklist = tasks.map( addOrderToTask );
|
|
111
112
|
|
|
112
113
|
return response;
|
|
113
|
-
}
|
|
114
|
+
}
|
|
114
115
|
|
|
115
116
|
type SiteSlug = string | number | null;
|
|
116
117
|
|
|
@@ -138,6 +139,7 @@ export const useLaunchpad = (
|
|
|
138
139
|
is_dismissible: false,
|
|
139
140
|
title: null,
|
|
140
141
|
},
|
|
142
|
+
enabled: Boolean( siteSlug ),
|
|
141
143
|
} );
|
|
142
144
|
};
|
|
143
145
|
|
|
@@ -158,17 +160,18 @@ export const updateLaunchpadSettings = (
|
|
|
158
160
|
settings: LaunchpadUpdateSettings = {}
|
|
159
161
|
) => {
|
|
160
162
|
const slug = siteSlug ? encodeURIComponent( siteSlug ) : null;
|
|
161
|
-
|
|
163
|
+
const token = oauthToken.getToken();
|
|
162
164
|
return canAccessWpcomApis()
|
|
163
165
|
? wpcomRequest( {
|
|
164
166
|
path: `/sites/${ slug }/launchpad`,
|
|
165
167
|
apiNamespace: 'wpcom/v2',
|
|
166
168
|
method: 'PUT',
|
|
167
169
|
body: settings,
|
|
170
|
+
token: typeof token === 'string' ? token : undefined,
|
|
168
171
|
} )
|
|
169
172
|
: apiFetch( {
|
|
170
173
|
global: true,
|
|
171
|
-
path:
|
|
174
|
+
path: '/wpcom/v2/launchpad',
|
|
172
175
|
method: 'PUT',
|
|
173
176
|
data: settings,
|
|
174
177
|
} as APIFetchOptions );
|
|
@@ -203,7 +206,11 @@ const getDismissParams = ( settings: DismissSettings ) => {
|
|
|
203
206
|
}
|
|
204
207
|
};
|
|
205
208
|
|
|
206
|
-
export const useLaunchpadDismisser = (
|
|
209
|
+
export const useLaunchpadDismisser = (
|
|
210
|
+
siteSlug: SiteSlug,
|
|
211
|
+
checklistSlug: string,
|
|
212
|
+
launchpadContext: string
|
|
213
|
+
) => {
|
|
207
214
|
const queryClient = useQueryClient();
|
|
208
215
|
const key = getKey( siteSlug, checklistSlug );
|
|
209
216
|
|
|
@@ -230,7 +237,7 @@ export const useLaunchpadDismisser = ( siteSlug: SiteSlug, checklistSlug: string
|
|
|
230
237
|
onSuccess: () => {
|
|
231
238
|
recordTracksEvent( 'calypso_launchpad_dismiss_guide', {
|
|
232
239
|
checklist_slug: checklistSlug,
|
|
233
|
-
context:
|
|
240
|
+
context: launchpadContext,
|
|
234
241
|
} );
|
|
235
242
|
},
|
|
236
243
|
onError: ( _, _2, context ) => {
|
|
@@ -40,7 +40,6 @@ export interface DomainData {
|
|
|
40
40
|
expired: boolean;
|
|
41
41
|
auto_renewing: boolean;
|
|
42
42
|
pending_registration: boolean;
|
|
43
|
-
pending_registration_time: string;
|
|
44
43
|
has_registration: boolean;
|
|
45
44
|
has_email_forward_dns_records: unknown;
|
|
46
45
|
points_to_wpcom: boolean;
|
|
@@ -53,6 +52,8 @@ export interface DomainData {
|
|
|
53
52
|
is_dnssec_enabled: boolean;
|
|
54
53
|
is_dnssec_supported: boolean;
|
|
55
54
|
is_gravatar_domain: boolean;
|
|
55
|
+
is_gravatar_restricted_domain: boolean;
|
|
56
|
+
is_hundred_year_domain: boolean;
|
|
56
57
|
is_renewable: boolean;
|
|
57
58
|
is_redeemable: boolean;
|
|
58
59
|
is_subdomain: boolean;
|
|
@@ -105,6 +106,7 @@ export interface DomainData {
|
|
|
105
106
|
has_private_registration: boolean;
|
|
106
107
|
is_pending_icann_verification: boolean;
|
|
107
108
|
is_icann_verification_suspended: boolean;
|
|
109
|
+
is_root_domain_registered_with_automattic: boolean;
|
|
108
110
|
manual_transfer_required: boolean;
|
|
109
111
|
registrar: string;
|
|
110
112
|
domain_locking_available: boolean;
|
|
@@ -128,6 +130,11 @@ export interface DomainData {
|
|
|
128
130
|
pending_registration_at_registry_url: string;
|
|
129
131
|
registered_via_trustee: boolean;
|
|
130
132
|
registered_via_trustee_url: string;
|
|
133
|
+
domain_status?: {
|
|
134
|
+
status: string;
|
|
135
|
+
status_type: string;
|
|
136
|
+
status_weight: number;
|
|
137
|
+
};
|
|
131
138
|
}
|
|
132
139
|
|
|
133
140
|
export interface SiteDomainsQueryFnData {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import wpcomRequest from 'wpcom-proxy-request';
|
|
3
|
+
import { SiteIntent } from '../onboard';
|
|
3
4
|
|
|
4
5
|
export function useSiteIntent( siteId: string | number | undefined ) {
|
|
5
6
|
return useQuery< {
|
|
6
|
-
site_intent:
|
|
7
|
+
site_intent: SiteIntent;
|
|
7
8
|
} >( {
|
|
8
9
|
queryKey: [ 'site-intent', siteId ],
|
|
9
10
|
queryFn: async () =>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createContext, useState, useContext } from 'react';
|
|
1
|
+
import React, { createContext, useState, useContext, useMemo } from 'react';
|
|
2
2
|
import { SiteSubscriptionsFilterBy, SiteSubscriptionsSortBy } from '../constants';
|
|
3
3
|
|
|
4
4
|
type SiteSubscriptionsQueryPropsType = {
|
|
@@ -19,24 +19,33 @@ export const SiteSubscriptionsQueryProps = createContext< SiteSubscriptionsQuery
|
|
|
19
19
|
setFilterOption: () => undefined,
|
|
20
20
|
} );
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
type SiteSubscriptionsQueryPropsProviderProps = {
|
|
23
|
+
// initializer for `searchTerm` state, either a value or a callback, a standard initializer arg for `useState`
|
|
24
|
+
initialSearchTermState?: string | ( () => string );
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const SiteSubscriptionsQueryPropsProvider = ( {
|
|
29
|
+
initialSearchTermState = '',
|
|
23
30
|
children,
|
|
24
|
-
} ) => {
|
|
25
|
-
const [ searchTerm, setSearchTerm ] = useState(
|
|
31
|
+
}: SiteSubscriptionsQueryPropsProviderProps ) => {
|
|
32
|
+
const [ searchTerm, setSearchTerm ] = useState( initialSearchTermState );
|
|
26
33
|
const [ sortTerm, setSortTerm ] = useState( SiteSubscriptionsSortBy.DateSubscribed );
|
|
27
34
|
const [ filterOption, setFilterOption ] = useState( SiteSubscriptionsFilterBy.All );
|
|
28
35
|
|
|
36
|
+
const value = useMemo(
|
|
37
|
+
() => ( {
|
|
38
|
+
searchTerm,
|
|
39
|
+
setSearchTerm,
|
|
40
|
+
sortTerm,
|
|
41
|
+
setSortTerm,
|
|
42
|
+
filterOption,
|
|
43
|
+
setFilterOption,
|
|
44
|
+
} ),
|
|
45
|
+
[ searchTerm, setSearchTerm, sortTerm, setSortTerm, filterOption, setFilterOption ]
|
|
46
|
+
);
|
|
29
47
|
return (
|
|
30
|
-
<SiteSubscriptionsQueryProps.Provider
|
|
31
|
-
value={ {
|
|
32
|
-
searchTerm,
|
|
33
|
-
setSearchTerm,
|
|
34
|
-
sortTerm,
|
|
35
|
-
setSortTerm,
|
|
36
|
-
filterOption,
|
|
37
|
-
setFilterOption,
|
|
38
|
-
} }
|
|
39
|
-
>
|
|
48
|
+
<SiteSubscriptionsQueryProps.Provider value={ value }>
|
|
40
49
|
{ children }
|
|
41
50
|
</SiteSubscriptionsQueryProps.Provider>
|
|
42
51
|
);
|