@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
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
5
|
+
import { renderHook, waitFor } from '@testing-library/react';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import request from 'wpcom-proxy-request';
|
|
8
|
+
import { useNewsletterCategories } from '../index';
|
|
9
|
+
|
|
10
|
+
jest.mock( 'wpcom-proxy-request', () => jest.fn() );
|
|
11
|
+
|
|
12
|
+
describe( 'useNewsletterCategories', () => {
|
|
13
|
+
let queryClient: QueryClient;
|
|
14
|
+
let wrapper: React.FC< { children: React.ReactNode } >;
|
|
15
|
+
|
|
16
|
+
beforeEach( () => {
|
|
17
|
+
jest.mocked( request ).mockReset();
|
|
18
|
+
|
|
19
|
+
queryClient = new QueryClient( {
|
|
20
|
+
defaultOptions: {
|
|
21
|
+
queries: {
|
|
22
|
+
retry: false,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
} );
|
|
26
|
+
|
|
27
|
+
wrapper = ( { children } ) => (
|
|
28
|
+
<QueryClientProvider client={ queryClient }>{ children }</QueryClientProvider>
|
|
29
|
+
);
|
|
30
|
+
} );
|
|
31
|
+
|
|
32
|
+
afterEach( () => {
|
|
33
|
+
jest.clearAllMocks();
|
|
34
|
+
} );
|
|
35
|
+
|
|
36
|
+
it( 'should return expected data when successful', async () => {
|
|
37
|
+
jest.mocked( request ).mockResolvedValue( {
|
|
38
|
+
enabled: true,
|
|
39
|
+
newsletter_categories: [
|
|
40
|
+
{ id: 1, name: 'Category 1', slug: 'Slug 1', description: 'Description 1', parent: 1 },
|
|
41
|
+
{ id: 2, name: 'Category 2', slug: 'Slug 2', description: 'Description 2', parent: 2 },
|
|
42
|
+
],
|
|
43
|
+
} );
|
|
44
|
+
|
|
45
|
+
const { result } = renderHook( () => useNewsletterCategories( { siteId: 123 } ), { wrapper } );
|
|
46
|
+
|
|
47
|
+
await waitFor( () => expect( result.current.isSuccess ).toBe( true ) );
|
|
48
|
+
|
|
49
|
+
expect( result.current.data ).toEqual( {
|
|
50
|
+
enabled: true,
|
|
51
|
+
newsletterCategories: [
|
|
52
|
+
{ id: 1, name: 'Category 1', slug: 'Slug 1', description: 'Description 1', parent: 1 },
|
|
53
|
+
{ id: 2, name: 'Category 2', slug: 'Slug 2', description: 'Description 2', parent: 2 },
|
|
54
|
+
],
|
|
55
|
+
} );
|
|
56
|
+
} );
|
|
57
|
+
|
|
58
|
+
it( 'should handle empty response', async () => {
|
|
59
|
+
jest.mocked( request ).mockResolvedValue( {
|
|
60
|
+
enabled: false,
|
|
61
|
+
newsletter_categories: [],
|
|
62
|
+
} );
|
|
63
|
+
|
|
64
|
+
const { result } = renderHook( () => useNewsletterCategories( { siteId: 123 } ), { wrapper } );
|
|
65
|
+
|
|
66
|
+
await waitFor( () => expect( result.current.isSuccess ).toBe( true ) );
|
|
67
|
+
|
|
68
|
+
expect( result.current.data ).toEqual( { enabled: false, newsletterCategories: [] } );
|
|
69
|
+
} );
|
|
70
|
+
|
|
71
|
+
it( 'should call request with correct arguments', async () => {
|
|
72
|
+
jest.mocked( request ).mockResolvedValue( {
|
|
73
|
+
enabled: true,
|
|
74
|
+
newsletter_categories: [],
|
|
75
|
+
} );
|
|
76
|
+
|
|
77
|
+
renderHook( () => useNewsletterCategories( { siteId: 123 } ), {
|
|
78
|
+
wrapper,
|
|
79
|
+
} );
|
|
80
|
+
|
|
81
|
+
await waitFor( () => expect( request ).toHaveBeenCalled() );
|
|
82
|
+
|
|
83
|
+
expect( request ).toHaveBeenCalledWith( {
|
|
84
|
+
path: '/sites/123/newsletter-categories',
|
|
85
|
+
apiNamespace: 'wpcom/v2',
|
|
86
|
+
} );
|
|
87
|
+
} );
|
|
88
|
+
|
|
89
|
+
it( 'should handle error response', async () => {
|
|
90
|
+
const errorMessage = 'API Error';
|
|
91
|
+
jest.mocked( request ).mockRejectedValue( new Error( errorMessage ) );
|
|
92
|
+
|
|
93
|
+
const { result } = renderHook( () => useNewsletterCategories( { siteId: 123 } ), { wrapper } );
|
|
94
|
+
|
|
95
|
+
await waitFor( () => expect( result.current.isSuccess ).toBe( true ) );
|
|
96
|
+
|
|
97
|
+
expect( result.current.data ).toEqual( {
|
|
98
|
+
enabled: false,
|
|
99
|
+
newsletterCategories: [],
|
|
100
|
+
error: errorMessage,
|
|
101
|
+
} );
|
|
102
|
+
} );
|
|
103
|
+
} );
|
package/src/onboard/actions.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import config from '@automattic/calypso-config';
|
|
2
1
|
import { guessTimezone, getLanguage } from '@automattic/i18n-utils';
|
|
3
2
|
import { dispatch, select } from '@wordpress/data-controls';
|
|
4
3
|
import { __ } from '@wordpress/i18n';
|
|
5
4
|
import { STORE_KEY as SITE_STORE } from '../site';
|
|
6
|
-
import {
|
|
5
|
+
import { Visibility, GlobalStyles } from '../site/types';
|
|
7
6
|
import { SiteGoal, STORE_KEY } from './constants';
|
|
8
7
|
import { ProfilerData, ReadymadeTemplate } from './types';
|
|
9
8
|
import type { DomainTransferData, State } from '.';
|
|
@@ -35,108 +34,6 @@ export const setSiteUrl = ( siteUrl: string ) => ( {
|
|
|
35
34
|
siteUrl,
|
|
36
35
|
} );
|
|
37
36
|
|
|
38
|
-
export interface CreateSiteBaseActionParameters {
|
|
39
|
-
username: string;
|
|
40
|
-
languageSlug: string;
|
|
41
|
-
visibility: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface CreateSiteActionParameters extends CreateSiteBaseActionParameters {
|
|
45
|
-
bearerToken?: string;
|
|
46
|
-
anchorFmPodcastId: string | null;
|
|
47
|
-
anchorFmEpisodeId: string | null;
|
|
48
|
-
anchorFmSpotifyUrl: string | null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function* createVideoPressSite( {
|
|
52
|
-
username,
|
|
53
|
-
languageSlug,
|
|
54
|
-
visibility = Visibility.PublicNotIndexed,
|
|
55
|
-
}: CreateSiteBaseActionParameters ) {
|
|
56
|
-
const { domain, selectedDesign, siteTitle, selectedFeatures }: State = yield select(
|
|
57
|
-
STORE_KEY,
|
|
58
|
-
'getState'
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const siteUrl = domain?.domain_name || siteTitle || username;
|
|
62
|
-
const lang_id = ( getLanguage( languageSlug ) as Language )?.value;
|
|
63
|
-
const isVideomakerTrial = config.isEnabled( 'videomaker-trial' );
|
|
64
|
-
const defaultTheme = selectedDesign?.theme || 'premium/videomaker';
|
|
65
|
-
const legacyVertical = 'premium/videomaker' === defaultTheme ? 'videomaker' : 'videomaker-white';
|
|
66
|
-
const siteVertical = isVideomakerTrial ? 'videomaker' : legacyVertical;
|
|
67
|
-
const blogTitle = siteTitle.trim() === '' ? __( 'Site Title' ) : siteTitle;
|
|
68
|
-
const themeSlug = isVideomakerTrial ? 'pub/videomaker' : 'pub/twentytwentytwo'; // NOTE: keep this a consistent, free theme so post ids during headstart re-run after premium theme switch remain consistent
|
|
69
|
-
|
|
70
|
-
const params: CreateSiteParams = {
|
|
71
|
-
blog_name: siteUrl?.split( '.wordpress' )[ 0 ],
|
|
72
|
-
blog_title: blogTitle,
|
|
73
|
-
public: visibility,
|
|
74
|
-
options: {
|
|
75
|
-
site_information: {
|
|
76
|
-
title: blogTitle,
|
|
77
|
-
},
|
|
78
|
-
lang_id: lang_id,
|
|
79
|
-
site_creation_flow: 'videopress',
|
|
80
|
-
enable_fse: true,
|
|
81
|
-
theme: themeSlug,
|
|
82
|
-
timezone_string: guessTimezone(),
|
|
83
|
-
use_patterns: true,
|
|
84
|
-
site_vertical_name: siteVertical,
|
|
85
|
-
selected_features: selectedFeatures,
|
|
86
|
-
wpcom_public_coming_soon: 1,
|
|
87
|
-
...( selectedDesign && { is_blank_canvas: isBlankCanvasDesign( selectedDesign ) } ),
|
|
88
|
-
is_videopress_initial_purchase: ! isVideomakerTrial,
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const success: NewSiteBlogDetails | undefined = yield dispatch(
|
|
93
|
-
SITE_STORE,
|
|
94
|
-
'createSite',
|
|
95
|
-
params
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
return success;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export function* createVideoPressTvSite( {
|
|
102
|
-
languageSlug,
|
|
103
|
-
visibility = Visibility.PublicNotIndexed,
|
|
104
|
-
}: CreateSiteBaseActionParameters ) {
|
|
105
|
-
const { selectedDesign, selectedFeatures }: State = yield select( STORE_KEY, 'getState' );
|
|
106
|
-
|
|
107
|
-
const lang_id = ( getLanguage( languageSlug ) as Language )?.value;
|
|
108
|
-
const blogTitle = 'VideoPress TV';
|
|
109
|
-
|
|
110
|
-
const params: CreateSiteParams = {
|
|
111
|
-
blog_name: '', // will be replaced on server with random domain
|
|
112
|
-
blog_title: blogTitle,
|
|
113
|
-
public: visibility,
|
|
114
|
-
options: {
|
|
115
|
-
site_information: {
|
|
116
|
-
title: blogTitle,
|
|
117
|
-
},
|
|
118
|
-
lang_id: lang_id,
|
|
119
|
-
site_creation_flow: 'videopress-tv',
|
|
120
|
-
enable_fse: true,
|
|
121
|
-
theme: 'pub/videopress-hq',
|
|
122
|
-
timezone_string: guessTimezone(),
|
|
123
|
-
use_patterns: true,
|
|
124
|
-
selected_features: selectedFeatures,
|
|
125
|
-
wpcom_public_coming_soon: 1,
|
|
126
|
-
...( selectedDesign && { is_blank_canvas: isBlankCanvasDesign( selectedDesign ) } ),
|
|
127
|
-
is_videopress_initial_purchase: true,
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const success: NewSiteBlogDetails | undefined = yield dispatch(
|
|
132
|
-
SITE_STORE,
|
|
133
|
-
'createSite',
|
|
134
|
-
params
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
return success;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
37
|
export function* createSenseiSite( {
|
|
141
38
|
username = '',
|
|
142
39
|
languageSlug = '',
|
|
@@ -261,6 +158,11 @@ export const setSelectedStyleVariation = (
|
|
|
261
158
|
selectedStyleVariation,
|
|
262
159
|
} );
|
|
263
160
|
|
|
161
|
+
export const setSelectedGlobalStyles = ( selectedGlobalStyles: GlobalStyles | undefined ) => ( {
|
|
162
|
+
type: 'SET_SELECTED_GLOBAL_STYLES' as const,
|
|
163
|
+
selectedGlobalStyles,
|
|
164
|
+
} );
|
|
165
|
+
|
|
264
166
|
export const setSelectedReadymadeTemplate = ( readymadeTemplate: ReadymadeTemplate ) => ( {
|
|
265
167
|
type: 'SET_READYMADE_TEMPLATE' as const,
|
|
266
168
|
readymadeTemplate,
|
|
@@ -370,16 +272,6 @@ export const resetSelectedDesign = () => ( {
|
|
|
370
272
|
type: 'RESET_SELECTED_DESIGN' as const,
|
|
371
273
|
} );
|
|
372
274
|
|
|
373
|
-
export const setVerticalId = ( verticalId: string ) => ( {
|
|
374
|
-
type: 'SET_VERTICAL_ID' as const,
|
|
375
|
-
verticalId,
|
|
376
|
-
} );
|
|
377
|
-
|
|
378
|
-
export const setStoreLocationCountryCode = ( storeLocationCountryCode: string ) => ( {
|
|
379
|
-
type: 'SET_STORE_LOCATION_COUNTRY_CODE' as const,
|
|
380
|
-
storeLocationCountryCode,
|
|
381
|
-
} );
|
|
382
|
-
|
|
383
275
|
export const setEcommerceFlowRecurType = ( ecommerceFlowRecurType: string ) => ( {
|
|
384
276
|
type: 'SET_ECOMMERCE_FLOW_RECUR_TYPE' as const,
|
|
385
277
|
ecommerceFlowRecurType,
|
|
@@ -451,11 +343,6 @@ export const setHidePlansFeatureComparison = ( hidePlansFeatureComparison: boole
|
|
|
451
343
|
hidePlansFeatureComparison,
|
|
452
344
|
} );
|
|
453
345
|
|
|
454
|
-
export const setIsMigrateFromWp = ( isMigrateFromWp: boolean ) => ( {
|
|
455
|
-
type: 'SET_IS_MIGRATE_FROM_WP' as const,
|
|
456
|
-
isMigrateFromWp,
|
|
457
|
-
} );
|
|
458
|
-
|
|
459
346
|
export const setPluginsToVerify = ( pluginSlugs: string[] ) => ( {
|
|
460
347
|
type: 'SET_PLUGIN_SLUGS_TO_VERIFY' as const,
|
|
461
348
|
pluginSlugs,
|
|
@@ -500,6 +387,7 @@ export type OnboardAction = ReturnType<
|
|
|
500
387
|
| typeof setRandomizedDesigns
|
|
501
388
|
| typeof setSelectedDesign
|
|
502
389
|
| typeof setSelectedStyleVariation
|
|
390
|
+
| typeof setSelectedGlobalStyles
|
|
503
391
|
| typeof setSelectedSite
|
|
504
392
|
| typeof setSelectedReadymadeTemplate
|
|
505
393
|
| typeof setShowSignupDialog
|
|
@@ -524,8 +412,6 @@ export type OnboardAction = ReturnType<
|
|
|
524
412
|
| typeof setSiteLogo
|
|
525
413
|
| typeof setSiteUrl
|
|
526
414
|
| typeof setSiteAccentColor
|
|
527
|
-
| typeof setVerticalId
|
|
528
|
-
| typeof setStoreLocationCountryCode
|
|
529
415
|
| typeof setEcommerceFlowRecurType
|
|
530
416
|
| typeof setCouponCode
|
|
531
417
|
| typeof setStorageAddonSlug
|
|
@@ -533,7 +419,6 @@ export type OnboardAction = ReturnType<
|
|
|
533
419
|
| typeof setHidePlansFeatureComparison
|
|
534
420
|
| typeof setProductCartItems
|
|
535
421
|
| typeof setPlanCartItem
|
|
536
|
-
| typeof setIsMigrateFromWp
|
|
537
422
|
| typeof setPaidSubscribers
|
|
538
423
|
| typeof setPartnerBundle
|
|
539
424
|
| typeof setSignupDomainOrigin
|
package/src/onboard/constants.ts
CHANGED
|
@@ -2,13 +2,27 @@ export const STORE_KEY = 'automattic/onboard';
|
|
|
2
2
|
|
|
3
3
|
export enum SiteGoal {
|
|
4
4
|
Write = 'write',
|
|
5
|
-
Sell = 'sell',
|
|
6
5
|
Promote = 'promote',
|
|
6
|
+
CollectDonations = 'collect-donations',
|
|
7
|
+
BuildNonprofit = 'build-nonprofit',
|
|
8
|
+
SellDigital = 'sell-digital',
|
|
9
|
+
ContactForm = 'contact-form',
|
|
10
|
+
PaidSubscribers = 'paid-subscribers',
|
|
11
|
+
Engagement = 'engagement',
|
|
12
|
+
Porfolio = 'portfolio',
|
|
13
|
+
Newsletter = 'newsletter',
|
|
14
|
+
SellPhysical = 'sell-physical',
|
|
15
|
+
Courses = 'courses',
|
|
16
|
+
Videos = 'videos',
|
|
17
|
+
AnnounceEvents = 'announce-events',
|
|
18
|
+
|
|
19
|
+
// The following goals are deprecated. They are no longer availabe in the goals
|
|
20
|
+
// signup step, but existing sites still use them.
|
|
21
|
+
Sell = 'sell',
|
|
7
22
|
DIFM = 'difm', // "Do It For Me"
|
|
8
23
|
Import = 'import',
|
|
9
|
-
ImportSubscribers = 'import-subscribers',
|
|
10
24
|
Other = 'other',
|
|
11
|
-
|
|
25
|
+
ImportSubscribers = 'import-subscribers',
|
|
12
26
|
}
|
|
13
27
|
|
|
14
28
|
export enum SiteIntent {
|
|
@@ -19,15 +33,13 @@ export enum SiteIntent {
|
|
|
19
33
|
DIFM = 'difm', // "Do It For Me"
|
|
20
34
|
WpAdmin = 'wpadmin',
|
|
21
35
|
Import = 'import', // deprecated
|
|
22
|
-
WithThemeAssembler = 'with-theme-assembler',
|
|
23
|
-
AssemblerFirst = 'assembler-first',
|
|
24
36
|
ReadyMadeTemplate = 'readymade-template',
|
|
25
37
|
AIAssembler = 'ai-assembler',
|
|
26
38
|
Newsletter = 'newsletter',
|
|
39
|
+
NewsletterGoal = 'intent-newsletter-goal',
|
|
40
|
+
CreateCourseGoal = 'create-course-goal',
|
|
27
41
|
FreePostSetup = 'free-post-setup', // non-signup flow
|
|
28
42
|
SiteMigration = 'site-migration',
|
|
29
|
-
LinkInBioPostSetup = 'link-in-bio-post-setup', // non-signup flow
|
|
30
|
-
NewsletterPostSetup = 'newsletter-post-setup', // non-signup flow
|
|
31
43
|
UpdateDesign = 'update-design', // non-signup flow
|
|
32
44
|
UpdateOptions = 'update-options', // non-signup flow
|
|
33
45
|
}
|
package/src/onboard/index.ts
CHANGED
|
@@ -46,6 +46,8 @@ export function register(): typeof STORE_KEY {
|
|
|
46
46
|
'planProductId',
|
|
47
47
|
'randomizedDesigns',
|
|
48
48
|
'selectedDesign',
|
|
49
|
+
'selectedStyleVariation',
|
|
50
|
+
'selectedGlobalStyles',
|
|
49
51
|
'selectedFeatures',
|
|
50
52
|
'selectedSite',
|
|
51
53
|
'readymadeTemplate',
|
|
@@ -54,14 +56,13 @@ export function register(): typeof STORE_KEY {
|
|
|
54
56
|
'siteLogo',
|
|
55
57
|
'siteAccentColor',
|
|
56
58
|
'storeType',
|
|
57
|
-
'verticalId',
|
|
58
|
-
'storeLocationCountryCode',
|
|
59
59
|
'ecommerceFlowRecurType',
|
|
60
60
|
'couponCode',
|
|
61
61
|
'storageAddonSlug',
|
|
62
62
|
'domainCartItem',
|
|
63
63
|
'planCartItem',
|
|
64
64
|
'productCartItems',
|
|
65
|
+
'partnerBundle',
|
|
65
66
|
],
|
|
66
67
|
} );
|
|
67
68
|
isRegistered = true;
|
package/src/onboard/reducer.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
} from './types';
|
|
11
11
|
import type { DomainSuggestion } from '../domain-suggestions';
|
|
12
12
|
import type { FeatureId } from '../shared-types';
|
|
13
|
+
import type { GlobalStyles } from '../site';
|
|
13
14
|
// somewhat hacky, but resolves the circular dependency issue
|
|
14
15
|
import type { Design, StyleVariation } from '@automattic/design-picker/src/types';
|
|
15
16
|
import type { MinimalRequestCartProduct } from '@automattic/shopping-cart';
|
|
@@ -111,6 +112,14 @@ const selectedDesign: Reducer< Design | undefined, OnboardAction > = ( state, ac
|
|
|
111
112
|
if ( action.type === 'SET_SELECTED_DESIGN' ) {
|
|
112
113
|
return action.selectedDesign;
|
|
113
114
|
}
|
|
115
|
+
|
|
116
|
+
if (
|
|
117
|
+
action.type === 'RESET_ONBOARD_STORE' &&
|
|
118
|
+
action?.skipFlags?.includes( 'skipSelectedDesign' )
|
|
119
|
+
) {
|
|
120
|
+
return state;
|
|
121
|
+
}
|
|
122
|
+
|
|
114
123
|
if ( [ 'RESET_SELECTED_DESIGN', 'RESET_ONBOARD_STORE' ].includes( action.type ) ) {
|
|
115
124
|
return undefined;
|
|
116
125
|
}
|
|
@@ -130,6 +139,22 @@ const selectedStyleVariation: Reducer< StyleVariation | undefined, OnboardAction
|
|
|
130
139
|
return state;
|
|
131
140
|
};
|
|
132
141
|
|
|
142
|
+
const selectedGlobalStyles: Reducer< GlobalStyles | undefined, OnboardAction > = (
|
|
143
|
+
state,
|
|
144
|
+
action
|
|
145
|
+
) => {
|
|
146
|
+
switch ( action.type ) {
|
|
147
|
+
case 'SET_SELECTED_GLOBAL_STYLES':
|
|
148
|
+
return action.selectedGlobalStyles;
|
|
149
|
+
|
|
150
|
+
case 'RESET_ONBOARD_STORE':
|
|
151
|
+
return undefined;
|
|
152
|
+
|
|
153
|
+
default:
|
|
154
|
+
return state;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
133
158
|
const readymadeTemplate: Reducer< ReadymadeTemplate | undefined, OnboardAction > = (
|
|
134
159
|
state = undefined, // Initial state is set to undefined
|
|
135
160
|
action
|
|
@@ -331,12 +356,12 @@ const pendingAction: Reducer< undefined | ( () => Promise< any > ), OnboardActio
|
|
|
331
356
|
return state;
|
|
332
357
|
};
|
|
333
358
|
|
|
334
|
-
const progress: Reducer< number, OnboardAction > = ( state
|
|
359
|
+
const progress: Reducer< number | undefined, OnboardAction > = ( state, action ) => {
|
|
335
360
|
if ( action.type === 'SET_PROGRESS' ) {
|
|
336
361
|
return action.progress;
|
|
337
362
|
}
|
|
338
363
|
if ( action.type === 'RESET_ONBOARD_STORE' ) {
|
|
339
|
-
return
|
|
364
|
+
return undefined;
|
|
340
365
|
}
|
|
341
366
|
return state;
|
|
342
367
|
};
|
|
@@ -353,7 +378,7 @@ const progressTitle: Reducer< string | undefined, OnboardAction > = ( state, act
|
|
|
353
378
|
|
|
354
379
|
const goals: Reducer< SiteGoal[], OnboardAction > = ( state = [], action ) => {
|
|
355
380
|
if ( action.type === 'SET_GOALS' ) {
|
|
356
|
-
return action.goals;
|
|
381
|
+
return [ ...action.goals ];
|
|
357
382
|
}
|
|
358
383
|
if ( action.type === 'CLEAR_IMPORT_GOAL' ) {
|
|
359
384
|
return state.filter( ( goal ) => goal !== SiteGoal.Import );
|
|
@@ -361,29 +386,14 @@ const goals: Reducer< SiteGoal[], OnboardAction > = ( state = [], action ) => {
|
|
|
361
386
|
if ( action.type === 'CLEAR_DIFM_GOAL' ) {
|
|
362
387
|
return state.filter( ( goal ) => goal !== SiteGoal.DIFM );
|
|
363
388
|
}
|
|
364
|
-
if (
|
|
365
|
-
return
|
|
389
|
+
if ( action.type === 'RESET_ONBOARD_STORE' && action?.skipFlags?.includes( 'skipGoals' ) ) {
|
|
390
|
+
return state;
|
|
366
391
|
}
|
|
367
|
-
return state;
|
|
368
|
-
};
|
|
369
392
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return action.verticalId;
|
|
373
|
-
}
|
|
374
|
-
if ( action.type === 'RESET_ONBOARD_STORE' ) {
|
|
375
|
-
return '';
|
|
393
|
+
if ( [ 'RESET_GOALS', 'RESET_ONBOARD_STORE' ].includes( action.type ) ) {
|
|
394
|
+
return [];
|
|
376
395
|
}
|
|
377
|
-
return state;
|
|
378
|
-
};
|
|
379
396
|
|
|
380
|
-
const storeLocationCountryCode: Reducer< string, OnboardAction > = ( state = '', action ) => {
|
|
381
|
-
if ( action.type === 'SET_STORE_LOCATION_COUNTRY_CODE' ) {
|
|
382
|
-
return action.storeLocationCountryCode;
|
|
383
|
-
}
|
|
384
|
-
if ( action.type === 'RESET_ONBOARD_STORE' ) {
|
|
385
|
-
return '';
|
|
386
|
-
}
|
|
387
397
|
return state;
|
|
388
398
|
};
|
|
389
399
|
|
|
@@ -479,16 +489,6 @@ const domainCartItems: Reducer< MinimalRequestCartProduct[] | undefined, Onboard
|
|
|
479
489
|
return state;
|
|
480
490
|
};
|
|
481
491
|
|
|
482
|
-
const isMigrateFromWp: Reducer< boolean, OnboardAction > = ( state = false, action ) => {
|
|
483
|
-
if ( action.type === 'SET_IS_MIGRATE_FROM_WP' ) {
|
|
484
|
-
return action.isMigrateFromWp;
|
|
485
|
-
}
|
|
486
|
-
if ( action.type === 'RESET_ONBOARD_STORE' ) {
|
|
487
|
-
return false;
|
|
488
|
-
}
|
|
489
|
-
return state;
|
|
490
|
-
};
|
|
491
|
-
|
|
492
492
|
const pluginsToVerify: Reducer< string[] | undefined, OnboardAction > = ( state, action ) => {
|
|
493
493
|
if ( action.type === 'SET_PLUGIN_SLUGS_TO_VERIFY' ) {
|
|
494
494
|
return action.pluginSlugs;
|
|
@@ -629,6 +629,7 @@ const reducer = combineReducers( {
|
|
|
629
629
|
storeType,
|
|
630
630
|
selectedDesign,
|
|
631
631
|
selectedStyleVariation,
|
|
632
|
+
selectedGlobalStyles,
|
|
632
633
|
selectedSite,
|
|
633
634
|
siteTitle,
|
|
634
635
|
showSignupDialog,
|
|
@@ -648,14 +649,11 @@ const reducer = combineReducers( {
|
|
|
648
649
|
siteLogo,
|
|
649
650
|
siteAccentColor,
|
|
650
651
|
readymadeTemplate,
|
|
651
|
-
verticalId,
|
|
652
|
-
storeLocationCountryCode,
|
|
653
652
|
ecommerceFlowRecurType,
|
|
654
653
|
couponCode,
|
|
655
654
|
storageAddonSlug,
|
|
656
655
|
planCartItem,
|
|
657
656
|
productCartItems,
|
|
658
|
-
isMigrateFromWp,
|
|
659
657
|
domainCartItems,
|
|
660
658
|
pluginsToVerify,
|
|
661
659
|
profilerData,
|
package/src/onboard/selectors.ts
CHANGED
|
@@ -33,6 +33,7 @@ export const getLastLocation = ( state: State ) => state.lastLocation;
|
|
|
33
33
|
export const getRandomizedDesigns = ( state: State ) => state.randomizedDesigns;
|
|
34
34
|
export const getSelectedDesign = ( state: State ) => state.selectedDesign;
|
|
35
35
|
export const getSelectedStyleVariation = ( state: State ) => state.selectedStyleVariation;
|
|
36
|
+
export const getSelectedGlobalStyles = ( state: State ) => state.selectedGlobalStyles;
|
|
36
37
|
export const getSelectedDomain = ( state: State ) => state.domain;
|
|
37
38
|
export const getSelectedFeatures = ( state: State ) => state.selectedFeatures;
|
|
38
39
|
export const getSelectedSite = ( state: State ) => state.selectedSite;
|
|
@@ -48,7 +49,6 @@ export const getPendingAction = ( state: State ) => state.pendingAction;
|
|
|
48
49
|
export const getProgress = ( state: State ) => state.progress;
|
|
49
50
|
export const getProgressTitle = ( state: State ) => state.progressTitle;
|
|
50
51
|
export const getGoals = ( state: State ) => state.goals;
|
|
51
|
-
export const getStoreLocationCountryCode = ( state: State ) => state.storeLocationCountryCode;
|
|
52
52
|
export const getEcommerceFlowRecurType = ( state: State ) => state.ecommerceFlowRecurType;
|
|
53
53
|
export const getCouponCode = ( state: State ) => state.couponCode;
|
|
54
54
|
export const getStorageAddonSlug = ( state: State ) => state.storageAddonSlug;
|
|
@@ -77,7 +77,6 @@ export const getSignupDomainOrigin = ( state: State ) => state.signupDomainOrigi
|
|
|
77
77
|
export const getSiteUrl = ( state: State ) => state.siteUrl;
|
|
78
78
|
export const getHideFreePlan = ( state: State ) => state.hideFreePlan;
|
|
79
79
|
export const getHidePlansFeatureComparison = ( state: State ) => state.hidePlansFeatureComparison;
|
|
80
|
-
export const getIsMigrateFromWp = ( state: State ) => state.isMigrateFromWp;
|
|
81
80
|
export const getPluginsToVerify = ( state: State ) => state.pluginsToVerify;
|
|
82
81
|
export const getProfilerData = ( state: State ) => state.profilerData;
|
|
83
82
|
export const getPaidSubscribers = ( state: State ) => state.paidSubscribers;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import config from '@automattic/calypso-config';
|
|
1
6
|
import { SiteGoal, SiteIntent } from '../constants';
|
|
2
7
|
import { goalsToIntent } from '../utils';
|
|
3
8
|
|
|
9
|
+
jest.mock( '@automattic/calypso-config' );
|
|
10
|
+
|
|
4
11
|
describe( 'Test onboard utils', () => {
|
|
12
|
+
beforeEach( () => {
|
|
13
|
+
( config.isEnabled as jest.Mock ).mockReset();
|
|
14
|
+
} );
|
|
15
|
+
|
|
5
16
|
it.each( [
|
|
6
17
|
{
|
|
7
18
|
goals: [],
|
|
@@ -23,7 +34,29 @@ describe( 'Test onboard utils', () => {
|
|
|
23
34
|
goals: [ SiteGoal.Promote, SiteGoal.Sell, SiteGoal.Write ],
|
|
24
35
|
expectedIntent: SiteIntent.Sell,
|
|
25
36
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
{
|
|
38
|
+
goals: [ SiteGoal.Write, SiteGoal.Engagement ],
|
|
39
|
+
expectedIntent: SiteIntent.Write,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
goals: [ SiteGoal.Write, SiteGoal.Newsletter ],
|
|
43
|
+
expectedIntent: SiteIntent.NewsletterGoal,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
goals: [ SiteGoal.Sell, SiteGoal.Courses ],
|
|
47
|
+
expectedIntent: SiteIntent.CreateCourseGoal,
|
|
48
|
+
featureFlags: {
|
|
49
|
+
isIntentCreateCourseGoalEnabled: true,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
goals: [ SiteGoal.Sell, SiteGoal.Newsletter ],
|
|
54
|
+
expectedIntent: SiteIntent.NewsletterGoal,
|
|
55
|
+
},
|
|
56
|
+
] )(
|
|
57
|
+
'Should map the $goals to $expectedIntent intent ($featureFlags)',
|
|
58
|
+
( { goals, expectedIntent, featureFlags } ) => {
|
|
59
|
+
expect( goalsToIntent( goals, featureFlags ) ).toBe( expectedIntent );
|
|
60
|
+
}
|
|
61
|
+
);
|
|
29
62
|
} );
|
package/src/onboard/utils.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { SiteGoal, SiteIntent } from './constants';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
interface Flags {
|
|
4
|
+
isIntentCreateCourseGoalEnabled?: boolean;
|
|
5
|
+
}
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
[ SiteGoal.Sell ]: SiteIntent.Sell,
|
|
9
|
-
[ SiteGoal.Promote ]: SiteIntent.Build,
|
|
10
|
-
};
|
|
7
|
+
export const goalsToIntent = ( goals: SiteGoal[], flags?: Flags ): SiteIntent => {
|
|
8
|
+
const { isIntentCreateCourseGoalEnabled } = flags ?? {};
|
|
11
9
|
|
|
12
|
-
export const goalsToIntent = ( goals: SiteGoal[] ): SiteIntent => {
|
|
13
10
|
// When DIFM and Import goals are selected together, DIFM Intent will have the priority and will be set.
|
|
14
11
|
if ( goals.includes( SiteGoal.DIFM ) ) {
|
|
15
12
|
return SiteIntent.DIFM;
|
|
@@ -19,8 +16,21 @@ export const goalsToIntent = ( goals: SiteGoal[] ): SiteIntent => {
|
|
|
19
16
|
return SiteIntent.Import;
|
|
20
17
|
}
|
|
21
18
|
|
|
19
|
+
if ( goals.includes( SiteGoal.Courses ) && isIntentCreateCourseGoalEnabled ) {
|
|
20
|
+
return SiteIntent.CreateCourseGoal;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Newsletter flow
|
|
24
|
+
if ( goals.includes( SiteGoal.Newsletter ) ) {
|
|
25
|
+
return SiteIntent.NewsletterGoal;
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
// Prioritize Sell over Build and Write
|
|
23
|
-
if (
|
|
29
|
+
if (
|
|
30
|
+
goals.some( ( goal ) =>
|
|
31
|
+
[ SiteGoal.Sell, SiteGoal.SellDigital, SiteGoal.SellPhysical ].includes( goal )
|
|
32
|
+
)
|
|
33
|
+
) {
|
|
24
34
|
return SiteIntent.Sell;
|
|
25
35
|
}
|
|
26
36
|
|
|
@@ -29,12 +39,8 @@ export const goalsToIntent = ( goals: SiteGoal[] ): SiteIntent => {
|
|
|
29
39
|
return SiteIntent.Build;
|
|
30
40
|
}
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
if ( intentDecidingGoal ) {
|
|
37
|
-
return GOAL_TO_INTENT_MAP[ intentDecidingGoal ];
|
|
42
|
+
if ( goals.includes( SiteGoal.Write ) ) {
|
|
43
|
+
return SiteIntent.Write;
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
return SiteIntent.Build;
|