@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
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
import { useMemo } from '@wordpress/element';
|
|
2
|
-
import { useSiteMediaStorage } from '../../site';
|
|
2
|
+
import { SiteMediaStorage, useSiteMediaStorage } from '../../site';
|
|
3
3
|
import { STORAGE_LIMIT } from '../constants';
|
|
4
|
+
import { AddOnMeta } from '../types';
|
|
4
5
|
import useStorageAddOns from './use-storage-add-ons';
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
7
8
|
siteId?: number | null;
|
|
8
9
|
}
|
|
9
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Check if the quantity for a storage add-on is available for purchase.
|
|
13
|
+
* @param quantity The number of gigabytes the given add-on adds to the site's storage
|
|
14
|
+
* @param storage Data returned from
|
|
15
|
+
*/
|
|
16
|
+
export function isStorageQuantityAvailable( quantity: number, storage: SiteMediaStorage ): boolean {
|
|
17
|
+
const existingAddOnStorage = storage.maxStorageBytesFromAddOns / Math.pow( 1024, 3 );
|
|
18
|
+
const currentMaxStorage = storage.maxStorageBytes / Math.pow( 1024, 3 );
|
|
19
|
+
const isWithinStorageLimit = STORAGE_LIMIT >= currentMaxStorage - existingAddOnStorage + quantity;
|
|
20
|
+
|
|
21
|
+
return existingAddOnStorage < quantity && isWithinStorageLimit;
|
|
22
|
+
}
|
|
23
|
+
|
|
10
24
|
/**
|
|
11
25
|
* Returns the storage add-ons that are available for purchase considering the current site when present.
|
|
12
26
|
* Conditions:
|
|
13
|
-
* - If the user has not purchased the storage add-on.
|
|
14
27
|
* - If the storage add-on does not exceed the site storage limits.
|
|
15
28
|
* - If the quantity of the storage add-on is less than or equal to the available storage upgrade.
|
|
16
29
|
*/
|
|
17
|
-
const useAvailableStorageAddOns = ( { siteId }: Props ) => {
|
|
30
|
+
const useAvailableStorageAddOns = ( { siteId }: Props ): AddOnMeta[] => {
|
|
18
31
|
const storageAddOns = useStorageAddOns( { siteId } );
|
|
19
32
|
const siteMediaStorage = useSiteMediaStorage( { siteIdOrSlug: siteId } );
|
|
20
|
-
const currentMaxStorage = siteMediaStorage.data?.maxStorageBytes
|
|
21
|
-
? siteMediaStorage.data.maxStorageBytes / Math.pow( 1024, 3 )
|
|
22
|
-
: 0;
|
|
23
|
-
const availableStorageUpgrade = STORAGE_LIMIT - currentMaxStorage;
|
|
24
33
|
|
|
25
34
|
return useMemo( () => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
? ! addOn.purchased &&
|
|
29
|
-
! addOn.exceedsSiteStorageLimits &&
|
|
30
|
-
( addOn.quantity ?? 0 ) <= availableStorageUpgrade
|
|
31
|
-
: false
|
|
32
|
-
);
|
|
35
|
+
const nonNullAddOns = storageAddOns.filter( ( addOn ): addOn is AddOnMeta => addOn !== null );
|
|
36
|
+
const siteMediaStorageData = siteMediaStorage.data;
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
if ( ! siteMediaStorageData ) {
|
|
39
|
+
return nonNullAddOns;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return nonNullAddOns.filter( ( addOn ) =>
|
|
43
|
+
isStorageQuantityAvailable( addOn?.quantity ?? 0, siteMediaStorageData )
|
|
44
|
+
);
|
|
45
|
+
}, [ siteMediaStorage.data, storageAddOns ] );
|
|
36
46
|
};
|
|
37
47
|
|
|
38
48
|
export default useAvailableStorageAddOns;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PRODUCT_1GB_SPACE } from '@automattic/calypso-products';
|
|
2
|
+
import * as Purchases from '../../purchases';
|
|
3
|
+
import useStorageAddOns from './use-storage-add-ons';
|
|
4
|
+
import type { AddOnMeta } from '../..';
|
|
5
|
+
|
|
6
|
+
export default function useGetPurchasedStorageAddOn( {
|
|
7
|
+
siteId,
|
|
8
|
+
}: {
|
|
9
|
+
siteId?: number | null;
|
|
10
|
+
} ): AddOnMeta | null {
|
|
11
|
+
const storageAddOns = useStorageAddOns( { siteId } );
|
|
12
|
+
const matchingPurchases = Purchases.useSitePurchasesByProductSlug( {
|
|
13
|
+
siteId,
|
|
14
|
+
productSlug: PRODUCT_1GB_SPACE,
|
|
15
|
+
} );
|
|
16
|
+
|
|
17
|
+
if ( ! matchingPurchases ) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const purchase: Purchases.Purchase = Object.values( matchingPurchases )[ 0 ];
|
|
22
|
+
const storageAddOnQuantity = purchase.purchaseRenewalQuantity;
|
|
23
|
+
return storageAddOns.find( ( addOn ) => addOn?.quantity === storageAddOnQuantity ) ?? null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PRODUCT_1GB_SPACE } from '@automattic/calypso-products';
|
|
2
|
+
import { useSiteMediaStorage } from '../../site';
|
|
3
|
+
import { AddOnMeta } from '../types';
|
|
4
|
+
import { isStorageQuantityAvailable } from './use-available-storage-add-ons';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
addOnMeta: AddOnMeta;
|
|
8
|
+
selectedSiteId?: number | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum StorageAddOnAvailability {
|
|
12
|
+
NotAStorageAddOn,
|
|
13
|
+
DataLoading,
|
|
14
|
+
Unavailable,
|
|
15
|
+
Available,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Check if an add-on is a storage add-on, and if so, if the quantity is available for purchase.
|
|
20
|
+
*/
|
|
21
|
+
export default function useStorageAddOnAvailability( {
|
|
22
|
+
addOnMeta,
|
|
23
|
+
selectedSiteId,
|
|
24
|
+
}: Props ): StorageAddOnAvailability {
|
|
25
|
+
const mediaStorage = useSiteMediaStorage( { siteIdOrSlug: selectedSiteId } );
|
|
26
|
+
|
|
27
|
+
if ( addOnMeta.productSlug !== PRODUCT_1GB_SPACE ) {
|
|
28
|
+
return StorageAddOnAvailability.NotAStorageAddOn;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if ( ! mediaStorage.data ) {
|
|
32
|
+
return StorageAddOnAvailability.DataLoading;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return isStorageQuantityAvailable( addOnMeta.quantity ?? 0, mediaStorage.data )
|
|
36
|
+
? StorageAddOnAvailability.Available
|
|
37
|
+
: StorageAddOnAvailability.Unavailable;
|
|
38
|
+
}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { SVG, Path } from '@wordpress/primitives';
|
|
2
2
|
|
|
3
3
|
const customDesign = (
|
|
4
|
-
<SVG width="
|
|
4
|
+
<SVG width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
5
|
<Path
|
|
6
|
-
d="
|
|
7
|
-
fill="#
|
|
8
|
-
/>
|
|
9
|
-
<Path
|
|
10
|
-
d="M26 27L30.2942 22.6902C30.684 22.299 30.6828 21.6658 30.2916 21.276L26 17"
|
|
11
|
-
fill="#0675C4"
|
|
12
|
-
/>
|
|
13
|
-
<Path
|
|
14
|
-
d="M18 27L13.7058 22.6902C13.316 22.299 13.3172 21.6658 13.7084 21.276L18 17"
|
|
15
|
-
fill="#0675C4"
|
|
6
|
+
d="M20.8008 11.2004L16.5008 6.90039L15.4008 8.00039L19.7008 12.3004C19.8008 12.4004 19.8008 12.6004 19.7008 12.7004L15.4008 17.0004L16.5008 18.1004L20.8008 13.8004C21.5008 13.0004 21.5008 11.9004 20.8008 11.2004ZM4.20078 12.3004L8.50078 8.00039L7.50078 7.00039L3.20078 11.3004C2.50078 12.0004 2.50078 13.1004 3.20078 13.8004L7.50078 18.1004L8.60078 17.0004L4.30078 12.7004C4.10078 12.6004 4.10078 12.4004 4.20078 12.3004Z"
|
|
7
|
+
fill="#3858E9"
|
|
16
8
|
/>
|
|
17
9
|
</SVG>
|
|
18
10
|
);
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { SVG, Path } from '@wordpress/primitives';
|
|
2
2
|
|
|
3
3
|
const unlimitedThemes = (
|
|
4
|
-
<SVG width="
|
|
4
|
+
<SVG width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
5
|
<Path
|
|
6
|
-
d="
|
|
7
|
-
fill="#
|
|
8
|
-
/>
|
|
9
|
-
<Path d="M11.3333 31.9167, L21.9999 31.9167" stroke="#0675C4" strokeWidth="1.5" />
|
|
10
|
-
<Path
|
|
11
|
-
d="M21.1243 23.8018L31.2452 13.5665C32.0278 12.7751 32.0064 11.4899 31.2066 10.7159C30.419 9.95372 29.1574 9.96042 28.3866 10.7396L17.8223 21.4193L21.1243 23.8018Z"
|
|
12
|
-
fill="#0675C4"
|
|
13
|
-
/>
|
|
14
|
-
<Path
|
|
15
|
-
d="M14 28L13.3428 27.6386L12.7315 28.75H14V28ZM14.6572 28.3615C14.771 28.1544 14.8833 27.9815 15.0277 27.7486C15.1684 27.5213 15.323 27.2624 15.4873 26.9291C15.8158 26.2625 16.1642 25.3375 16.5622 23.7804L15.109 23.4088C14.7269 24.9034 14.4098 25.7222 14.1418 26.2659C14.0078 26.5378 13.8813 26.7507 13.7525 26.9587C13.6272 27.1609 13.4814 27.3867 13.3428 27.6386L14.6572 28.3615ZM16.5622 23.7804C16.7297 23.1254 16.9851 22.7308 17.2391 22.4943C17.4901 22.2605 17.7797 22.1436 18.0867 22.1083C18.7444 22.0326 19.4388 22.3387 19.7566 22.6565L20.8172 21.5958C20.1943 20.9728 19.0531 20.4873 17.9153 20.6181C17.3246 20.6861 16.7265 20.9219 16.2168 21.3966C15.71 21.8685 15.3316 22.5379 15.109 23.4088L16.5622 23.7804ZM19.7566 22.6565C20.33 23.2298 20.4426 24.7912 19.1458 25.773L20.0513 26.9689C21.9669 25.5185 22.1253 22.9039 20.8172 21.5958L19.7566 22.6565ZM19.1458 25.773C17.712 26.8586 16.1012 27.25 14 27.25V28.75C16.3042 28.75 18.2728 28.3154 20.0513 26.9689L19.1458 25.773Z"
|
|
16
|
-
fill="#0675C4"
|
|
6
|
+
d="M4 20.5008H12V19.0008H4V20.5008ZM18.9 4.00078C18.3 3.40078 17.4 3.40078 16.8 4.00078L9.6 11.2008C9.2 11.1008 8.9 11.2008 8.5 11.3008C8 11.5008 7 12.0008 6.6 13.5008C6.2 15.2008 5.8 15.7008 5.5 16.2008C5.4 16.3008 5.3 16.5008 5.2 16.6008L4.6 17.7008H6C8 17.7008 9.4 17.3008 10.7 16.3008C11.5 15.7008 11.9 14.9008 12 14.0008C12 13.7008 12 13.5008 11.9 13.3008L19 6.20078C19.5 5.60078 19.5 4.60078 18.9 4.00078ZM9.7 15.2008C9 15.7008 8.2 16.0008 7.3 16.2008C7.5 15.7008 7.8 15.0008 8.1 13.9008C8.3 13.3008 8.5 12.9008 8.9 12.8008C9.4 12.7008 9.9 12.9008 10.2 13.1008C10.4 13.3008 10.5 13.6008 10.4 13.9008C10.4 14.2008 10.3 14.8008 9.7 15.2008Z"
|
|
7
|
+
fill="#3858E9"
|
|
17
8
|
/>
|
|
18
9
|
</SVG>
|
|
19
10
|
);
|
package/src/add-ons/index.ts
CHANGED
|
@@ -4,6 +4,11 @@ export { default as useAddOnCheckoutLink } from './hooks/use-add-on-checkout-lin
|
|
|
4
4
|
export { default as useAddOnPurchaseStatus } from './hooks/use-add-on-purchase-status';
|
|
5
5
|
export { default as useStorageAddOns } from './hooks/use-storage-add-ons';
|
|
6
6
|
export { default as useAvailableStorageAddOns } from './hooks/use-available-storage-add-ons';
|
|
7
|
+
export {
|
|
8
|
+
default as useStorageAddOnAvailability,
|
|
9
|
+
StorageAddOnAvailability,
|
|
10
|
+
} from './hooks/use-storage-add-on-availability';
|
|
11
|
+
export { default as useGetPurchasedStorageAddOn } from './hooks/use-get-purchased-storage-add-on';
|
|
7
12
|
export * from './constants';
|
|
8
13
|
|
|
9
14
|
/** Types */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PRODUCT_1GB_SPACE } from '@automattic/calypso-products';
|
|
2
|
+
import { ADD_ON_50GB_STORAGE } from './constants';
|
|
3
|
+
import spaceUpgradeIcon from './icons/space-upgrade';
|
|
4
|
+
import type { AddOnMeta } from './types';
|
|
5
|
+
|
|
6
|
+
const STORAGE_ADD_ONS_MOCK: AddOnMeta[] = [
|
|
7
|
+
{
|
|
8
|
+
addOnSlug: ADD_ON_50GB_STORAGE,
|
|
9
|
+
productSlug: PRODUCT_1GB_SPACE,
|
|
10
|
+
featureSlugs: null,
|
|
11
|
+
icon: spaceUpgradeIcon,
|
|
12
|
+
quantity: 50,
|
|
13
|
+
name: '50 GB Storage',
|
|
14
|
+
displayCost: '50',
|
|
15
|
+
prices: {
|
|
16
|
+
monthlyPrice: 10,
|
|
17
|
+
yearlyPrice: 120,
|
|
18
|
+
formattedMonthlyPrice: 'USD10',
|
|
19
|
+
formattedYearlyPrice: 'USD120',
|
|
20
|
+
currencyCode: 'USD',
|
|
21
|
+
},
|
|
22
|
+
description: 'Make more space for high-quality photos, videos, and other media. ',
|
|
23
|
+
featured: false,
|
|
24
|
+
purchased: false,
|
|
25
|
+
checkoutLink: 'checkout:storage-50gb',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
export { STORAGE_ADD_ONS_MOCK };
|
package/src/add-ons/types.ts
CHANGED
|
@@ -6,12 +6,11 @@ export interface AddOnMeta {
|
|
|
6
6
|
addOnSlug: AddOnSlug;
|
|
7
7
|
productSlug: StoreProductSlug;
|
|
8
8
|
featureSlugs?: string[] | null;
|
|
9
|
-
icon
|
|
9
|
+
icon?: JSX.Element;
|
|
10
10
|
featured?: boolean; // used to display the popular badge in the add-ons grid
|
|
11
|
-
name
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
displayCost: TranslateResult | null;
|
|
11
|
+
name?: TranslateResult; // when the name is optional, it will be filled by the product list data
|
|
12
|
+
description?: TranslateResult; // same as the above.
|
|
13
|
+
displayCost?: TranslateResult;
|
|
15
14
|
purchased?: boolean;
|
|
16
15
|
isLoading?: boolean;
|
|
17
16
|
prices?: {
|
|
@@ -19,9 +18,10 @@ export interface AddOnMeta {
|
|
|
19
18
|
yearlyPrice: number;
|
|
20
19
|
formattedMonthlyPrice: string;
|
|
21
20
|
formattedYearlyPrice: string;
|
|
21
|
+
currencyCode: string;
|
|
22
22
|
} | null;
|
|
23
|
+
quantity?: number; // used for determining checkout costs for quantity based products
|
|
23
24
|
checkoutLink?: string;
|
|
24
|
-
exceedsSiteStorageLimits?: boolean;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export type AddOnSlug = ( typeof ADD_ONS )[ number ];
|
|
@@ -91,7 +91,7 @@ export function generateAdminSections(
|
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
title: __( 'Cancel my plan', __i18n_text_domain__ ),
|
|
94
|
-
link:
|
|
94
|
+
link: '/me/purchases',
|
|
95
95
|
synonyms: [ 'upgrade', 'business', 'professional', 'personal' ],
|
|
96
96
|
icon: 'plans',
|
|
97
97
|
},
|
|
@@ -104,7 +104,7 @@ export function generateAdminSections(
|
|
|
104
104
|
{
|
|
105
105
|
/* translators: %(googleMailService)s can be either "G Suite" or "Google Workspace */
|
|
106
106
|
title: sprintf( __( 'Cancel %s', __i18n_text_domain__ ), googleMailService ),
|
|
107
|
-
link:
|
|
107
|
+
link: '/me/purchases',
|
|
108
108
|
synonyms: [ 'upgrade', 'business', 'professional', 'personal', 'google' ],
|
|
109
109
|
icon: 'plans',
|
|
110
110
|
},
|
|
@@ -353,7 +353,7 @@ export function generateAdminSections(
|
|
|
353
353
|
},
|
|
354
354
|
{
|
|
355
355
|
title: __( 'New post', __i18n_text_domain__ ),
|
|
356
|
-
description: __(
|
|
356
|
+
description: __( 'Create a new blog post on your site.' ),
|
|
357
357
|
link: `/post/${ siteSlug }`,
|
|
358
358
|
synonyms: [ 'lists', 'posts' ],
|
|
359
359
|
icon: 'my-sites',
|
|
@@ -390,7 +390,7 @@ export function generateAdminSections(
|
|
|
390
390
|
},
|
|
391
391
|
{
|
|
392
392
|
title: __( 'View contact form messages', __i18n_text_domain__ ),
|
|
393
|
-
link: `https://${ siteSlug }/wp-admin/
|
|
393
|
+
link: `https://${ siteSlug }/wp-admin/admin.php?page=jetpack-forms-admin`,
|
|
394
394
|
synonyms: [ 'contact', 'form' ],
|
|
395
395
|
icon: 'cog',
|
|
396
396
|
},
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
+
import debugFactory from 'debug';
|
|
2
3
|
import { RESULT_TOUR, RESULT_VIDEO } from './constants';
|
|
3
4
|
|
|
5
|
+
const debug = debugFactory( 'calypso:data-stores:contextual-help' );
|
|
6
|
+
|
|
4
7
|
export type LinksForSection = {
|
|
5
8
|
readonly link: string;
|
|
6
9
|
post_id?: number;
|
|
@@ -611,8 +614,7 @@ export function getContextResults( section: string, siteIntent: string ) {
|
|
|
611
614
|
}
|
|
612
615
|
|
|
613
616
|
if ( siteIntent ) {
|
|
614
|
-
|
|
615
|
-
console.warn( 'Site intent is', siteIntent );
|
|
617
|
+
debug( `Site intent: ${ siteIntent }` );
|
|
616
618
|
}
|
|
617
619
|
|
|
618
620
|
// make sure editorially to show at most one tour and one video at once
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { register, createReduxStore } from '@wordpress/data';
|
|
2
2
|
import { controls } from '../wpcom-request-controls';
|
|
3
3
|
import * as actions from './actions';
|
|
4
4
|
import { STORE_KEY } from './constants';
|
|
@@ -12,18 +12,11 @@ export * from './queries';
|
|
|
12
12
|
export { getFormattedPrice } from './utils';
|
|
13
13
|
export type { State };
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
reducer,
|
|
24
|
-
resolvers,
|
|
25
|
-
selectors,
|
|
26
|
-
} );
|
|
27
|
-
}
|
|
28
|
-
return STORE_KEY;
|
|
29
|
-
}
|
|
15
|
+
export const store = createReduxStore( STORE_KEY, {
|
|
16
|
+
actions,
|
|
17
|
+
controls,
|
|
18
|
+
reducer,
|
|
19
|
+
resolvers,
|
|
20
|
+
selectors,
|
|
21
|
+
} );
|
|
22
|
+
register( store );
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { select, subscribe } from '@wordpress/data';
|
|
2
2
|
import wpcomRequest from 'wpcom-proxy-request';
|
|
3
|
-
import {
|
|
3
|
+
import { store } from '..';
|
|
4
4
|
import { DataStatus } from '../constants';
|
|
5
5
|
|
|
6
6
|
jest.mock( 'wpcom-proxy-request', () => ( {
|
|
@@ -9,8 +9,6 @@ jest.mock( 'wpcom-proxy-request', () => ( {
|
|
|
9
9
|
requestAllBlogsAccess: jest.fn( () => Promise.resolve() ),
|
|
10
10
|
} ) );
|
|
11
11
|
|
|
12
|
-
let store: ReturnType< typeof register >;
|
|
13
|
-
|
|
14
12
|
const options = {
|
|
15
13
|
category_slug: undefined,
|
|
16
14
|
include_dotblogsubdomain: false,
|
|
@@ -27,7 +25,10 @@ const apiResponse = [
|
|
|
27
25
|
match_reasons: [ 'tld-common', 'tld-exact' ],
|
|
28
26
|
product_id: 78,
|
|
29
27
|
product_slug: 'dotsite_domain',
|
|
30
|
-
cost: '$25
|
|
28
|
+
cost: '$25',
|
|
29
|
+
raw_price: 25,
|
|
30
|
+
currency_code: 'USD',
|
|
31
|
+
unavailable: false,
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
34
|
domain_name: 'hot-test-site.com',
|
|
@@ -37,14 +38,13 @@ const apiResponse = [
|
|
|
37
38
|
match_reasons: [ 'tld-common' ],
|
|
38
39
|
product_id: 6,
|
|
39
40
|
product_slug: 'domain_reg',
|
|
40
|
-
cost: '$18
|
|
41
|
+
cost: '$18',
|
|
42
|
+
raw_price: 18,
|
|
43
|
+
currency_code: 'USD',
|
|
44
|
+
unavailable: false,
|
|
41
45
|
},
|
|
42
46
|
];
|
|
43
47
|
|
|
44
|
-
beforeAll( () => {
|
|
45
|
-
store = register();
|
|
46
|
-
} );
|
|
47
|
-
|
|
48
48
|
beforeEach( () => {
|
|
49
49
|
( wpcomRequest as jest.Mock ).mockReset();
|
|
50
50
|
} );
|
|
@@ -55,7 +55,7 @@ describe( 'getDomainSuggestions', () => {
|
|
|
55
55
|
|
|
56
56
|
const query = 'test query one';
|
|
57
57
|
const listenForStateUpdate = () => {
|
|
58
|
-
return new Promise( ( resolve ) => {
|
|
58
|
+
return new Promise< void >( ( resolve ) => {
|
|
59
59
|
const unsubscribe = subscribe( () => {
|
|
60
60
|
unsubscribe();
|
|
61
61
|
resolve();
|
|
@@ -88,7 +88,7 @@ describe( 'getDomainSuggestions', () => {
|
|
|
88
88
|
|
|
89
89
|
expect(
|
|
90
90
|
select( 'core/data' ).isResolving( store, 'getDomainSuggestions', [ query, options ] )
|
|
91
|
-
).
|
|
91
|
+
).toEqual( false );
|
|
92
92
|
} );
|
|
93
93
|
} );
|
|
94
94
|
|
|
@@ -102,7 +102,7 @@ describe( 'getDomainErrorMessage', () => {
|
|
|
102
102
|
|
|
103
103
|
const query = 'test query two';
|
|
104
104
|
const listenForStateUpdate = () => {
|
|
105
|
-
return new Promise( ( resolve ) => {
|
|
105
|
+
return new Promise< void >( ( resolve ) => {
|
|
106
106
|
const unsubscribe = subscribe( () => {
|
|
107
107
|
unsubscribe();
|
|
108
108
|
resolve();
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import * as selectors from './selectors';
|
|
2
1
|
import type { DataStatus } from './constants';
|
|
3
|
-
import type { SelectFromMap } from '../mapped-types';
|
|
4
2
|
|
|
5
3
|
export interface DomainSuggestionQuery {
|
|
6
4
|
/**
|
|
@@ -254,5 +252,3 @@ export interface DomainSuggestionState {
|
|
|
254
252
|
export type DomainAvailabilities = Record< string, DomainAvailability | undefined >;
|
|
255
253
|
|
|
256
254
|
export type DomainSuggestionSelectorOptions = Partial< Exclude< DomainSuggestionQuery, 'query' > >;
|
|
257
|
-
|
|
258
|
-
export type DomainSuggestionsSelect = SelectFromMap< typeof selectors >;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import formatCurrency from '@automattic/
|
|
1
|
+
import { formatCurrency } from '@automattic/number-formatters';
|
|
2
2
|
import deterministicStringify from 'fast-json-stable-stringify';
|
|
3
3
|
import type { DomainSuggestionQuery, DomainSuggestionSelectorOptions } from './types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Stable transform to an object key for storage and access.
|
|
7
|
-
* @see client/state/domains/suggestions/utils.js
|
|
8
7
|
*/
|
|
9
8
|
export const stringifyDomainQueryObject: ( q: DomainSuggestionQuery ) => string =
|
|
10
9
|
deterministicStringify;
|
|
@@ -26,8 +25,6 @@ export function getFormattedPrice( price: number, currencyCode: string ): string
|
|
|
26
25
|
*
|
|
27
26
|
* It's important to have a consistent, reproduceable representation of a domains query so that the result can be
|
|
28
27
|
* stored and retrieved.
|
|
29
|
-
* @see client/state/domains/suggestions/utils.js
|
|
30
|
-
* @see client/components/data/query-domains-suggestions/index.jsx
|
|
31
28
|
* @param search Domain search string
|
|
32
29
|
* @param queryOptions Optional paramaters for the query
|
|
33
30
|
* @returns Normalized query object
|