@automattic/onboarding 1.0.0 → 1.0.1
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/.storybook/index.scss +16 -0
- package/.storybook/main.ts +15 -0
- package/.storybook/preview.ts +5 -0
- package/CHANGELOG.md +5 -0
- package/dist/cjs/action-buttons/index.js +1 -13
- package/dist/cjs/action-buttons/index.js.map +1 -1
- package/dist/cjs/action-buttons/style.scss +4 -40
- package/dist/cjs/cart/create-cart-manager-client.js +3 -3
- package/dist/cjs/cart/create-cart-manager-client.js.map +1 -1
- package/dist/cjs/cart/index.js +45 -67
- package/dist/cjs/cart/index.js.map +1 -1
- package/dist/cjs/confetti/index.js +1 -1
- package/dist/cjs/confetti/index.js.map +1 -1
- package/dist/cjs/flow-progress/use-flow-progress.js +0 -57
- package/dist/cjs/flow-progress/use-flow-progress.js.map +1 -1
- package/dist/cjs/hooks/use-persisted-state.js +61 -0
- package/dist/cjs/hooks/use-persisted-state.js.map +1 -0
- package/dist/cjs/hooray/index.js +1 -1
- package/dist/cjs/index.js +11 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mshots-image/index.js +34 -15
- package/dist/cjs/mshots-image/index.js.map +1 -1
- package/dist/cjs/mshots-image/style.scss +1 -0
- package/dist/cjs/navigator/hooks/index.js +2 -1
- package/dist/cjs/navigator/hooks/index.js.map +1 -1
- package/dist/cjs/navigator/navigator-buttons/index.js +2 -2
- package/dist/cjs/navigator/navigator-buttons/index.js.map +1 -1
- package/dist/cjs/navigator/navigator-header/index.js.map +1 -1
- package/dist/cjs/navigator/navigator-screens/hooks/index.js +3 -2
- package/dist/cjs/navigator/navigator-screens/hooks/index.js.map +1 -1
- package/dist/cjs/navigator/navigator-screens/hooks/use-navigator-screens.js +1 -1
- package/dist/cjs/navigator/navigator-screens/hooks/use-navigator-screens.js.map +1 -1
- package/dist/cjs/navigator/navigator-screens/navigator-screens.js +7 -2
- package/dist/cjs/navigator/navigator-screens/navigator-screens.js.map +1 -1
- package/dist/cjs/select-card-checkbox/index.js +4 -3
- package/dist/cjs/select-card-checkbox/index.js.map +1 -1
- package/dist/cjs/select-card-checkbox/style.scss +11 -14
- package/dist/cjs/select-card-checkbox-v2/index.js +15 -0
- package/dist/cjs/select-card-checkbox-v2/index.js.map +1 -0
- package/dist/cjs/select-card-checkbox-v2/style.scss +25 -0
- package/dist/cjs/select-items/index.js +2 -1
- package/dist/cjs/select-items/index.js.map +1 -1
- package/dist/cjs/select-items/style.scss +2 -1
- package/dist/cjs/setup-tailored-site-after-creation.js +9 -37
- package/dist/cjs/setup-tailored-site-after-creation.js.map +1 -1
- package/dist/cjs/step-container/index.js +10 -12
- package/dist/cjs/step-container/index.js.map +1 -1
- package/dist/cjs/step-container/style.scss +35 -77
- package/dist/cjs/step-container-v2/components/ContentRow/ContentRow.js +14 -0
- package/dist/cjs/step-container-v2/components/ContentRow/ContentRow.js.map +1 -0
- package/dist/cjs/step-container-v2/components/ContentRow/style.scss +26 -0
- package/dist/cjs/step-container-v2/components/ContentWrapper/ContentWrapper.js +19 -0
- package/dist/cjs/step-container-v2/components/ContentWrapper/ContentWrapper.js.map +1 -0
- package/dist/cjs/step-container-v2/components/ContentWrapper/style.scss +70 -0
- package/dist/cjs/step-container-v2/components/Heading/Heading.js +17 -0
- package/dist/cjs/step-container-v2/components/Heading/Heading.js.map +1 -0
- package/dist/cjs/step-container-v2/components/Heading/style.scss +47 -0
- package/dist/cjs/step-container-v2/components/StepContainerV2/StepContainerV2.js +36 -0
- package/dist/cjs/step-container-v2/components/StepContainerV2/StepContainerV2.js.map +1 -0
- package/dist/cjs/step-container-v2/components/StepContainerV2/context.js +13 -0
- package/dist/cjs/step-container-v2/components/StepContainerV2/context.js.map +1 -0
- package/dist/cjs/step-container-v2/components/StepContainerV2/style.scss +21 -0
- package/dist/cjs/step-container-v2/components/StepCounter/StepCounter.js +17 -0
- package/dist/cjs/step-container-v2/components/StepCounter/StepCounter.js.map +1 -0
- package/dist/cjs/step-container-v2/components/StepCounter/style.scss +4 -0
- package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBar.js +17 -0
- package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBar.js.map +1 -0
- package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js +31 -0
- package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js.map +1 -0
- package/dist/cjs/step-container-v2/components/StickyBottomBar/style.scss +56 -0
- package/dist/cjs/step-container-v2/components/TopBar/TopBar.js +55 -0
- package/dist/cjs/step-container-v2/components/TopBar/TopBar.js.map +1 -0
- package/dist/cjs/step-container-v2/components/TopBar/TopBarRenderer.js +32 -0
- package/dist/cjs/step-container-v2/components/TopBar/TopBarRenderer.js.map +1 -0
- package/dist/cjs/step-container-v2/components/TopBar/style.scss +75 -0
- package/dist/cjs/step-container-v2/components/buttons/BackButton/BackButton.js +29 -0
- package/dist/cjs/step-container-v2/components/buttons/BackButton/BackButton.js.map +1 -0
- package/dist/cjs/step-container-v2/components/buttons/BackButton/style.scss +16 -0
- package/dist/cjs/step-container-v2/components/buttons/LinkButton/LinkButton.js +18 -0
- package/dist/cjs/step-container-v2/components/buttons/LinkButton/LinkButton.js.map +1 -0
- package/dist/cjs/step-container-v2/components/buttons/LinkButton/style.scss +6 -0
- package/dist/cjs/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js +18 -0
- package/dist/cjs/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js.map +1 -0
- package/dist/cjs/step-container-v2/components/buttons/PrimaryButton/style.scss +6 -0
- package/dist/cjs/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js +18 -0
- package/dist/cjs/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js.map +1 -0
- package/dist/cjs/step-container-v2/components/buttons/SecondaryButton/style.scss +6 -0
- package/dist/cjs/step-container-v2/components/buttons/SkipButton/SkipButton.js +28 -0
- package/dist/cjs/step-container-v2/components/buttons/SkipButton/SkipButton.js.map +1 -0
- package/dist/cjs/step-container-v2/contexts/StepContainerV2Context.js +17 -0
- package/dist/cjs/step-container-v2/contexts/StepContainerV2Context.js.map +1 -0
- package/dist/cjs/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js +18 -0
- package/dist/cjs/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js.map +1 -0
- package/dist/cjs/step-container-v2/helpers/normalizeButtonProps.js +13 -0
- package/dist/cjs/step-container-v2/helpers/normalizeButtonProps.js.map +1 -0
- package/dist/cjs/step-container-v2/helpers/wireframe-placeholder.js +18 -0
- package/dist/cjs/step-container-v2/helpers/wireframe-placeholder.js.map +1 -0
- package/dist/cjs/step-container-v2/helpers/withStepContainerV2ContextDecorator.js +15 -0
- package/dist/cjs/step-container-v2/helpers/withStepContainerV2ContextDecorator.js.map +1 -0
- package/dist/cjs/step-container-v2/index.js +41 -0
- package/dist/cjs/step-container-v2/index.js.map +1 -0
- package/dist/cjs/step-container-v2/types.js +3 -0
- package/dist/cjs/step-container-v2/types.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js +26 -0
- package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js +52 -0
- package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js +26 -0
- package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js +25 -0
- package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/style.scss +14 -0
- package/dist/cjs/step-container-v2/wireframes/Loading/Loading.js +30 -0
- package/dist/cjs/step-container-v2/wireframes/Loading/Loading.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/Loading/Loading.stories.js +29 -0
- package/dist/cjs/step-container-v2/wireframes/Loading/Loading.stories.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/Loading/style.scss +22 -0
- package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js +17 -0
- package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js +17 -0
- package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/style.scss +5 -0
- package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js +38 -0
- package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js +28 -0
- package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/style.scss +15 -0
- package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.js +17 -0
- package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.stories.js +41 -0
- package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.stories.js.map +1 -0
- package/dist/cjs/step-navigation-link/index.js +2 -2
- package/dist/cjs/step-navigation-link/index.js.map +1 -1
- package/dist/cjs/step-navigation-link/style.scss +5 -3
- package/dist/cjs/titles/styles.scss +2 -2
- package/dist/cjs/upload-and-set-site-logo.js +4 -5
- package/dist/cjs/upload-and-set-site-logo.js.map +1 -1
- package/dist/cjs/utils/contrastChecker.js +1 -22
- package/dist/cjs/utils/contrastChecker.js.map +1 -1
- package/dist/cjs/utils/flows.js +73 -117
- package/dist/cjs/utils/flows.js.map +1 -1
- package/dist/cjs/utils/is-domain.js +1 -2
- package/dist/cjs/utils/is-domain.js.map +1 -1
- package/dist/cjs/utils/use-data-loss-warning.js +1 -2
- package/dist/cjs/utils/use-data-loss-warning.js.map +1 -1
- package/dist/cjs/wpcom-request.js +24 -0
- package/dist/cjs/wpcom-request.js.map +1 -0
- package/dist/esm/action-buttons/index.js +1 -11
- package/dist/esm/action-buttons/index.js.map +1 -1
- package/dist/esm/action-buttons/style.scss +4 -40
- package/dist/esm/cart/create-cart-manager-client.js +1 -1
- package/dist/esm/cart/create-cart-manager-client.js.map +1 -1
- package/dist/esm/cart/index.js +40 -61
- package/dist/esm/cart/index.js.map +1 -1
- package/dist/esm/confetti/index.js +1 -1
- package/dist/esm/confetti/index.js.map +1 -1
- package/dist/esm/flow-progress/use-flow-progress.js +1 -58
- package/dist/esm/flow-progress/use-flow-progress.js.map +1 -1
- package/dist/esm/hooks/use-persisted-state.js +57 -0
- package/dist/esm/hooks/use-persisted-state.js.map +1 -0
- package/dist/esm/hooray/index.js +1 -1
- package/dist/esm/index.js +6 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/mshots-image/index.js +33 -13
- package/dist/esm/mshots-image/index.js.map +1 -1
- package/dist/esm/mshots-image/style.scss +1 -0
- package/dist/esm/navigator/navigator-buttons/index.js.map +1 -1
- package/dist/esm/navigator/navigator-header/index.js.map +1 -1
- package/dist/esm/navigator/navigator-screens/hooks/use-navigator-screens.js +1 -1
- package/dist/esm/navigator/navigator-screens/hooks/use-navigator-screens.js.map +1 -1
- package/dist/esm/navigator/navigator-screens/navigator-screens.js +8 -3
- package/dist/esm/navigator/navigator-screens/navigator-screens.js.map +1 -1
- package/dist/esm/select-card-checkbox/index.js +4 -3
- package/dist/esm/select-card-checkbox/index.js.map +1 -1
- package/dist/esm/select-card-checkbox/style.scss +11 -14
- package/dist/esm/select-card-checkbox-v2/index.js +12 -0
- package/dist/esm/select-card-checkbox-v2/index.js.map +1 -0
- package/dist/esm/select-card-checkbox-v2/style.scss +25 -0
- package/dist/esm/select-items/index.js +3 -2
- package/dist/esm/select-items/index.js.map +1 -1
- package/dist/esm/select-items/style.scss +2 -1
- package/dist/esm/setup-tailored-site-after-creation.js +9 -37
- package/dist/esm/setup-tailored-site-after-creation.js.map +1 -1
- package/dist/esm/step-container/index.js +11 -13
- package/dist/esm/step-container/index.js.map +1 -1
- package/dist/esm/step-container/style.scss +35 -77
- package/dist/esm/step-container-v2/components/ContentRow/ContentRow.js +9 -0
- package/dist/esm/step-container-v2/components/ContentRow/ContentRow.js.map +1 -0
- package/dist/esm/step-container-v2/components/ContentRow/style.scss +26 -0
- package/dist/esm/step-container-v2/components/ContentWrapper/ContentWrapper.js +14 -0
- package/dist/esm/step-container-v2/components/ContentWrapper/ContentWrapper.js.map +1 -0
- package/dist/esm/step-container-v2/components/ContentWrapper/style.scss +70 -0
- package/dist/esm/step-container-v2/components/Heading/Heading.js +12 -0
- package/dist/esm/step-container-v2/components/Heading/Heading.js.map +1 -0
- package/dist/esm/step-container-v2/components/Heading/style.scss +47 -0
- package/dist/esm/step-container-v2/components/StepContainerV2/StepContainerV2.js +32 -0
- package/dist/esm/step-container-v2/components/StepContainerV2/StepContainerV2.js.map +1 -0
- package/dist/esm/step-container-v2/components/StepContainerV2/context.js +10 -0
- package/dist/esm/step-container-v2/components/StepContainerV2/context.js.map +1 -0
- package/dist/esm/step-container-v2/components/StepContainerV2/style.scss +21 -0
- package/dist/esm/step-container-v2/components/StepCounter/StepCounter.js +13 -0
- package/dist/esm/step-container-v2/components/StepCounter/StepCounter.js.map +1 -0
- package/dist/esm/step-container-v2/components/StepCounter/style.scss +4 -0
- package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBar.js +12 -0
- package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBar.js.map +1 -0
- package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js +27 -0
- package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js.map +1 -0
- package/dist/esm/step-container-v2/components/StickyBottomBar/style.scss +56 -0
- package/dist/esm/step-container-v2/components/TopBar/TopBar.js +49 -0
- package/dist/esm/step-container-v2/components/TopBar/TopBar.js.map +1 -0
- package/dist/esm/step-container-v2/components/TopBar/TopBarRenderer.js +27 -0
- package/dist/esm/step-container-v2/components/TopBar/TopBarRenderer.js.map +1 -0
- package/dist/esm/step-container-v2/components/TopBar/style.scss +75 -0
- package/dist/esm/step-container-v2/components/buttons/BackButton/BackButton.js +25 -0
- package/dist/esm/step-container-v2/components/buttons/BackButton/BackButton.js.map +1 -0
- package/dist/esm/step-container-v2/components/buttons/BackButton/style.scss +16 -0
- package/dist/esm/step-container-v2/components/buttons/LinkButton/LinkButton.js +14 -0
- package/dist/esm/step-container-v2/components/buttons/LinkButton/LinkButton.js.map +1 -0
- package/dist/esm/step-container-v2/components/buttons/LinkButton/style.scss +6 -0
- package/dist/esm/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js +14 -0
- package/dist/esm/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js.map +1 -0
- package/dist/esm/step-container-v2/components/buttons/PrimaryButton/style.scss +6 -0
- package/dist/esm/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js +14 -0
- package/dist/esm/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js.map +1 -0
- package/dist/esm/step-container-v2/components/buttons/SecondaryButton/style.scss +6 -0
- package/dist/esm/step-container-v2/components/buttons/SkipButton/SkipButton.js +24 -0
- package/dist/esm/step-container-v2/components/buttons/SkipButton/SkipButton.js.map +1 -0
- package/dist/esm/step-container-v2/contexts/StepContainerV2Context.js +13 -0
- package/dist/esm/step-container-v2/contexts/StepContainerV2Context.js.map +1 -0
- package/dist/esm/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js +14 -0
- package/dist/esm/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js.map +1 -0
- package/dist/esm/step-container-v2/helpers/normalizeButtonProps.js +8 -0
- package/dist/esm/step-container-v2/helpers/normalizeButtonProps.js.map +1 -0
- package/dist/esm/step-container-v2/helpers/wireframe-placeholder.js +15 -0
- package/dist/esm/step-container-v2/helpers/wireframe-placeholder.js.map +1 -0
- package/dist/esm/step-container-v2/helpers/withStepContainerV2ContextDecorator.js +11 -0
- package/dist/esm/step-container-v2/helpers/withStepContainerV2ContextDecorator.js.map +1 -0
- package/dist/esm/step-container-v2/index.js +22 -0
- package/dist/esm/step-container-v2/index.js.map +1 -0
- package/dist/esm/step-container-v2/types.js +2 -0
- package/dist/esm/step-container-v2/types.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js +22 -0
- package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js +45 -0
- package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js +23 -0
- package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js +21 -0
- package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/style.scss +14 -0
- package/dist/esm/step-container-v2/wireframes/Loading/Loading.js +26 -0
- package/dist/esm/step-container-v2/wireframes/Loading/Loading.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/Loading/Loading.stories.js +22 -0
- package/dist/esm/step-container-v2/wireframes/Loading/Loading.stories.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/Loading/style.scss +22 -0
- package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js +12 -0
- package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js +13 -0
- package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/style.scss +5 -0
- package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js +33 -0
- package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js +22 -0
- package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/style.scss +15 -0
- package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.js +13 -0
- package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.stories.js +36 -0
- package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.stories.js.map +1 -0
- package/dist/esm/step-navigation-link/index.js +2 -2
- package/dist/esm/step-navigation-link/index.js.map +1 -1
- package/dist/esm/step-navigation-link/style.scss +5 -3
- package/dist/esm/titles/styles.scss +2 -2
- package/dist/esm/upload-and-set-site-logo.js +1 -1
- package/dist/esm/upload-and-set-site-logo.js.map +1 -1
- package/dist/esm/utils/contrastChecker.js +0 -20
- package/dist/esm/utils/contrastChecker.js.map +1 -1
- package/dist/esm/utils/flows.js +57 -96
- package/dist/esm/utils/flows.js.map +1 -1
- package/dist/esm/wpcom-request.js +18 -0
- package/dist/esm/wpcom-request.js.map +1 -0
- package/dist/styles/mixins.scss +4 -4
- package/dist/styles/variables.scss +2 -2
- package/dist/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/action-buttons/index.d.ts +0 -4
- package/dist/types/action-buttons/index.d.ts.map +1 -1
- package/dist/types/cart/index.d.ts +7 -4
- package/dist/types/cart/index.d.ts.map +1 -1
- package/dist/types/flow-progress/use-flow-progress.d.ts.map +1 -1
- package/dist/types/hooks/use-persisted-state.d.ts +26 -0
- package/dist/types/hooks/use-persisted-state.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/intent-screen/index.d.ts.map +1 -1
- package/dist/types/mshots-image/index.d.ts +2 -1
- package/dist/types/mshots-image/index.d.ts.map +1 -1
- package/dist/types/navigator/hooks/use-navigator-listener.d.ts.map +1 -1
- package/dist/types/navigator/navigator-buttons/index.d.ts +1 -1
- package/dist/types/navigator/navigator-buttons/index.d.ts.map +1 -1
- package/dist/types/navigator/navigator-header/index.d.ts +1 -1
- package/dist/types/navigator/navigator-header/index.d.ts.map +1 -1
- package/dist/types/navigator/navigator-item-group/index.d.ts +0 -1
- package/dist/types/navigator/navigator-item-group/index.d.ts.map +1 -1
- package/dist/types/navigator/navigator-listener/index.d.ts.map +1 -1
- package/dist/types/navigator/navigator-screen/index.d.ts.map +1 -1
- package/dist/types/navigator/navigator-screens/hooks/use-navigator-buttons.d.ts.map +1 -1
- package/dist/types/navigator/navigator-screens/hooks/use-navigator-screens.d.ts.map +1 -1
- package/dist/types/navigator/navigator-screens/navigator-screens.d.ts +4 -2
- package/dist/types/navigator/navigator-screens/navigator-screens.d.ts.map +1 -1
- package/dist/types/navigator/navigator-screens/types.d.ts +1 -1
- package/dist/types/navigator/navigator-screens/types.d.ts.map +1 -1
- package/dist/types/progress/index.d.ts.map +1 -1
- package/dist/types/select-card-checkbox/index.d.ts +3 -1
- package/dist/types/select-card-checkbox/index.d.ts.map +1 -1
- package/dist/types/select-card-checkbox-v2/index.d.ts +12 -0
- package/dist/types/select-card-checkbox-v2/index.d.ts.map +1 -0
- package/dist/types/select-items/index.d.ts +1 -1
- package/dist/types/select-items/index.d.ts.map +1 -1
- package/dist/types/setup-tailored-site-after-creation.d.ts +1 -1
- package/dist/types/setup-tailored-site-after-creation.d.ts.map +1 -1
- package/dist/types/step-container/index.d.ts +3 -4
- package/dist/types/step-container/index.d.ts.map +1 -1
- package/dist/types/step-container-v2/components/ContentRow/ContentRow.d.ts +9 -0
- package/dist/types/step-container-v2/components/ContentRow/ContentRow.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/ContentWrapper/ContentWrapper.d.ts +15 -0
- package/dist/types/step-container-v2/components/ContentWrapper/ContentWrapper.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/Heading/Heading.d.ts +11 -0
- package/dist/types/step-container-v2/components/Heading/Heading.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/StepContainerV2/StepContainerV2.d.ts +7 -0
- package/dist/types/step-container-v2/components/StepContainerV2/StepContainerV2.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/StepContainerV2/context.d.ts +12 -0
- package/dist/types/step-container-v2/components/StepContainerV2/context.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/StepCounter/StepCounter.d.ts +7 -0
- package/dist/types/step-container-v2/components/StepCounter/StepCounter.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBar.d.ts +14 -0
- package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBar.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.d.ts +5 -0
- package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/TopBar/TopBar.d.ts +25 -0
- package/dist/types/step-container-v2/components/TopBar/TopBar.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/TopBar/TopBarRenderer.d.ts +6 -0
- package/dist/types/step-container-v2/components/TopBar/TopBarRenderer.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/buttons/BackButton/BackButton.d.ts +6 -0
- package/dist/types/step-container-v2/components/buttons/BackButton/BackButton.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/buttons/LinkButton/LinkButton.d.ts +4 -0
- package/dist/types/step-container-v2/components/buttons/LinkButton/LinkButton.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.d.ts +4 -0
- package/dist/types/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.d.ts +4 -0
- package/dist/types/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/buttons/SkipButton/SkipButton.d.ts +9 -0
- package/dist/types/step-container-v2/components/buttons/SkipButton/SkipButton.d.ts.map +1 -0
- package/dist/types/step-container-v2/contexts/StepContainerV2Context.d.ts +10 -0
- package/dist/types/step-container-v2/contexts/StepContainerV2Context.d.ts.map +1 -0
- package/dist/types/step-container-v2/helpers/decorateButtonWithTracksEventRecording.d.ts +8 -0
- package/dist/types/step-container-v2/helpers/decorateButtonWithTracksEventRecording.d.ts.map +1 -0
- package/dist/types/step-container-v2/helpers/normalizeButtonProps.d.ts +5 -0
- package/dist/types/step-container-v2/helpers/normalizeButtonProps.d.ts.map +1 -0
- package/dist/types/step-container-v2/helpers/wireframe-placeholder.d.ts +7 -0
- package/dist/types/step-container-v2/helpers/wireframe-placeholder.d.ts.map +1 -0
- package/dist/types/step-container-v2/helpers/withStepContainerV2ContextDecorator.d.ts +2 -0
- package/dist/types/step-container-v2/helpers/withStepContainerV2ContextDecorator.d.ts.map +1 -0
- package/dist/types/step-container-v2/index.d.ts +22 -0
- package/dist/types/step-container-v2/index.d.ts.map +1 -0
- package/dist/types/step-container-v2/types.d.ts +4 -0
- package/dist/types/step-container-v2/types.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.d.ts +16 -0
- package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.d.ts +9 -0
- package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.d.ts +18 -0
- package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.d.ts +6 -0
- package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/Loading/Loading.d.ts +12 -0
- package/dist/types/step-container-v2/wireframes/Loading/Loading.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/Loading/Loading.stories.d.ts +9 -0
- package/dist/types/step-container-v2/wireframes/Loading/Loading.stories.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.d.ts +10 -0
- package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.d.ts +6 -0
- package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.d.ts +20 -0
- package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.d.ts +8 -0
- package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.d.ts +13 -0
- package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.stories.d.ts +9 -0
- package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.stories.d.ts.map +1 -0
- package/dist/types/step-navigation-link/index.d.ts +1 -1
- package/dist/types/step-navigation-link/index.d.ts.map +1 -1
- package/dist/types/upload-and-set-site-logo.d.ts +1 -1
- package/dist/types/upload-and-set-site-logo.d.ts.map +1 -1
- package/dist/types/utils/contrastChecker.d.ts +0 -10
- package/dist/types/utils/contrastChecker.d.ts.map +1 -1
- package/dist/types/utils/domain-suggester.d.ts.map +1 -1
- package/dist/types/utils/flows.d.ts +37 -46
- package/dist/types/utils/flows.d.ts.map +1 -1
- package/dist/types/wpcom-request.d.ts +7 -0
- package/dist/types/wpcom-request.d.ts.map +1 -0
- package/jest.config.js +0 -1
- package/package.json +44 -23
- package/src/action-buttons/index.tsx +0 -40
- package/src/action-buttons/style.scss +4 -40
- package/src/cart/create-cart-manager-client.ts +1 -1
- package/src/cart/index.tsx +60 -103
- package/src/cart/test/index.ts +14 -14
- package/src/confetti/index.tsx +1 -1
- package/src/flow-progress/use-flow-progress.ts +1 -66
- package/src/hooks/test/index.ts +54 -0
- package/src/hooks/use-persisted-state.ts +85 -0
- package/src/hooray/index.tsx +1 -1
- package/src/index.ts +7 -12
- package/src/intent-screen/test/index.tsx +10 -7
- package/src/mshots-image/index.tsx +52 -21
- package/src/mshots-image/style.scss +1 -0
- package/src/navigator/navigator-buttons/index.tsx +1 -0
- package/src/navigator/navigator-header/index.tsx +1 -0
- package/src/navigator/navigator-screens/hooks/use-navigator-screens.tsx +5 -1
- package/src/navigator/navigator-screens/navigator-screens.tsx +17 -0
- package/src/navigator/navigator-screens/types.ts +1 -0
- package/src/select-card-checkbox/index.tsx +10 -4
- package/src/select-card-checkbox/style.scss +11 -14
- package/src/select-card-checkbox-v2/index.tsx +51 -0
- package/src/select-card-checkbox-v2/style.scss +25 -0
- package/src/select-card-checkbox-v2/test/index.test.tsx +49 -0
- package/src/select-items/index.tsx +10 -4
- package/src/select-items/style.scss +2 -1
- package/src/setup-tailored-site-after-creation.ts +16 -60
- package/src/step-container/index.tsx +21 -42
- package/src/step-container/style.scss +35 -77
- package/src/step-container-v2/README.md +235 -0
- package/src/step-container-v2/components/ContentRow/ContentRow.tsx +27 -0
- package/src/step-container-v2/components/ContentRow/style.scss +26 -0
- package/src/step-container-v2/components/ContentWrapper/ContentWrapper.tsx +41 -0
- package/src/step-container-v2/components/ContentWrapper/style.scss +70 -0
- package/src/step-container-v2/components/Heading/Heading.tsx +31 -0
- package/src/step-container-v2/components/Heading/style.scss +47 -0
- package/src/step-container-v2/components/StepContainerV2/StepContainerV2.tsx +55 -0
- package/src/step-container-v2/components/StepContainerV2/context.ts +25 -0
- package/src/step-container-v2/components/StepContainerV2/style.scss +21 -0
- package/src/step-container-v2/components/StepCounter/StepCounter.tsx +32 -0
- package/src/step-container-v2/components/StepCounter/style.scss +4 -0
- package/src/step-container-v2/components/StickyBottomBar/StickyBottomBar.tsx +46 -0
- package/src/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.tsx +41 -0
- package/src/step-container-v2/components/StickyBottomBar/style.scss +56 -0
- package/src/step-container-v2/components/TopBar/TopBar.tsx +116 -0
- package/src/step-container-v2/components/TopBar/TopBarRenderer.tsx +43 -0
- package/src/step-container-v2/components/TopBar/style.scss +75 -0
- package/src/step-container-v2/components/buttons/BackButton/BackButton.tsx +32 -0
- package/src/step-container-v2/components/buttons/BackButton/style.scss +16 -0
- package/src/step-container-v2/components/buttons/LinkButton/LinkButton.tsx +17 -0
- package/src/step-container-v2/components/buttons/LinkButton/style.scss +6 -0
- package/src/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.tsx +17 -0
- package/src/step-container-v2/components/buttons/PrimaryButton/style.scss +6 -0
- package/src/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.tsx +17 -0
- package/src/step-container-v2/components/buttons/SecondaryButton/style.scss +6 -0
- package/src/step-container-v2/components/buttons/SkipButton/SkipButton.tsx +30 -0
- package/src/step-container-v2/contexts/StepContainerV2Context.ts +23 -0
- package/src/step-container-v2/helpers/decorateButtonWithTracksEventRecording.ts +28 -0
- package/src/step-container-v2/helpers/normalizeButtonProps.ts +14 -0
- package/src/step-container-v2/helpers/wireframe-placeholder.tsx +28 -0
- package/src/step-container-v2/helpers/withStepContainerV2ContextDecorator.tsx +16 -0
- package/src/step-container-v2/index.tsx +24 -0
- package/src/step-container-v2/types.ts +4 -0
- package/src/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.tsx +122 -0
- package/src/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.tsx +66 -0
- package/src/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.tsx +51 -0
- package/src/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.tsx +69 -0
- package/src/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/style.scss +14 -0
- package/src/step-container-v2/wireframes/Loading/Loading.stories.tsx +27 -0
- package/src/step-container-v2/wireframes/Loading/Loading.tsx +52 -0
- package/src/step-container-v2/wireframes/Loading/style.scss +22 -0
- package/src/step-container-v2/wireframes/Loading/test/Loading.test.tsx +42 -0
- package/src/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.tsx +21 -0
- package/src/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.tsx +31 -0
- package/src/step-container-v2/wireframes/PlaygroundLayout/style.scss +5 -0
- package/src/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.tsx +93 -0
- package/src/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.tsx +93 -0
- package/src/step-container-v2/wireframes/TwoColumnLayout/style.scss +15 -0
- package/src/step-container-v2/wireframes/WideLayout/WideLayout.stories.tsx +83 -0
- package/src/step-container-v2/wireframes/WideLayout/WideLayout.tsx +44 -0
- package/src/step-navigation-link/index.tsx +3 -0
- package/src/step-navigation-link/style.scss +5 -3
- package/src/style-imports.d.ts +3 -0
- package/src/titles/styles.scss +2 -2
- package/src/upload-and-set-site-logo.ts +1 -1
- package/src/utils/contrastChecker.ts +0 -35
- package/src/utils/flows.ts +67 -123
- package/src/wpcom-request.ts +26 -0
- package/styles/mixins.scss +4 -4
- package/styles/variables.scss +2 -2
- package/tsconfig.json +1 -0
- package/dist/cjs/feature-icon/index.js +0 -19
- package/dist/cjs/feature-icon/index.js.map +0 -1
- package/dist/cjs/flow-progress/index.js +0 -14
- package/dist/cjs/flow-progress/index.js.map +0 -1
- package/dist/cjs/flow-progress/style.scss +0 -5
- package/dist/cjs/notice/index.js +0 -12
- package/dist/cjs/notice/index.js.map +0 -1
- package/dist/cjs/notice/style.scss +0 -19
- package/dist/cjs/select-card-radio/index.js +0 -21
- package/dist/cjs/select-card-radio/index.js.map +0 -1
- package/dist/cjs/select-card-radio/style.scss +0 -44
- package/dist/cjs/sensei-logo/index.js +0 -8
- package/dist/cjs/sensei-logo/index.js.map +0 -1
- package/dist/cjs/videopress-logo/index.js +0 -8
- package/dist/cjs/videopress-logo/index.js.map +0 -1
- package/dist/esm/feature-icon/index.js +0 -16
- package/dist/esm/feature-icon/index.js.map +0 -1
- package/dist/esm/flow-progress/index.js +0 -12
- package/dist/esm/flow-progress/index.js.map +0 -1
- package/dist/esm/flow-progress/style.scss +0 -5
- package/dist/esm/notice/index.js +0 -9
- package/dist/esm/notice/index.js.map +0 -1
- package/dist/esm/notice/style.scss +0 -19
- package/dist/esm/select-card-radio/index.js +0 -15
- package/dist/esm/select-card-radio/index.js.map +0 -1
- package/dist/esm/select-card-radio/style.scss +0 -44
- package/dist/esm/sensei-logo/index.js +0 -6
- package/dist/esm/sensei-logo/index.js.map +0 -1
- package/dist/esm/videopress-logo/index.js +0 -6
- package/dist/esm/videopress-logo/index.js.map +0 -1
- package/dist/types/feature-icon/index.d.ts +0 -9
- package/dist/types/feature-icon/index.d.ts.map +0 -1
- package/dist/types/flow-progress/index.d.ts +0 -9
- package/dist/types/flow-progress/index.d.ts.map +0 -1
- package/dist/types/notice/index.d.ts +0 -7
- package/dist/types/notice/index.d.ts.map +0 -1
- package/dist/types/select-card-radio/index.d.ts +0 -22
- package/dist/types/select-card-radio/index.d.ts.map +0 -1
- package/dist/types/sensei-logo/index.d.ts +0 -8
- package/dist/types/sensei-logo/index.d.ts.map +0 -1
- package/dist/types/videopress-logo/index.d.ts +0 -8
- package/dist/types/videopress-logo/index.d.ts.map +0 -1
- package/src/feature-icon/index.tsx +0 -102
- package/src/flow-progress/index.tsx +0 -22
- package/src/flow-progress/style.scss +0 -5
- package/src/notice/index.tsx +0 -16
- package/src/notice/style.scss +0 -19
- package/src/select-card-radio/index.tsx +0 -64
- package/src/select-card-radio/style.scss +0 -44
- package/src/select-card-radio/test/index.tsx +0 -50
- package/src/sensei-logo/index.tsx +0 -30
- package/src/videopress-logo/index.tsx +0 -36
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type WpcomRequestParams } from 'wpcom-proxy-request';
|
|
2
|
+
type WpcomRequester = <T>(params: WpcomRequestParams) => Promise<T>;
|
|
3
|
+
export declare function setRequester(requester: WpcomRequester): void;
|
|
4
|
+
export default function wpcomRequest<T>(params: WpcomRequestParams): Promise<T>;
|
|
5
|
+
export declare function canAccessWpcomApis(): boolean;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=wpcom-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wpcom-request.d.ts","sourceRoot":"","sources":["../../src/wpcom-request.ts"],"names":[],"mappings":"AAAA,OAA0B,EACzB,KAAK,kBAAkB,EAEvB,MAAM,qBAAqB,CAAC;AAE7B,KAAK,cAAc,GAAG,CAAE,CAAC,EAAI,MAAM,EAAE,kBAAkB,KAAM,OAAO,CAAE,CAAC,CAAE,CAAC;AAI1E,wBAAgB,YAAY,CAAE,SAAS,EAAE,cAAc,GAAI,IAAI,CAE9D;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,CAAC,EAAI,MAAM,EAAE,kBAAkB,GAAI,OAAO,CAAE,CAAC,CAAE,CAKpF;AAED,wBAAgB,kBAAkB,IAAI,OAAO,CAK5C"}
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/onboarding",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Onboarding components for WordPress.com.",
|
|
5
5
|
"homepage": "https://github.com/Automattic/wp-calypso",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -8,6 +8,20 @@
|
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"module": "dist/esm/index.js",
|
|
10
10
|
"calypso:src": "src/index.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"calypso:src": "./src/index.ts",
|
|
14
|
+
"types": "./dist/types/index.d.ts",
|
|
15
|
+
"import": "./dist/esm/index.js",
|
|
16
|
+
"require": "./dist/cjs/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./src/*": {
|
|
19
|
+
"calypso:src": "./src/*"
|
|
20
|
+
},
|
|
21
|
+
"./styles/*": {
|
|
22
|
+
"calypso:src": "./styles/*"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
11
25
|
"sideEffects": [
|
|
12
26
|
"*.css",
|
|
13
27
|
"*.scss"
|
|
@@ -26,38 +40,45 @@
|
|
|
26
40
|
"clean": "tsc --build ./tsconfig.json ./tsconfig-cjs.json --clean && rm -rf dist",
|
|
27
41
|
"build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json && yarn run -T copy-assets && npx copyfiles ./styles/** dist",
|
|
28
42
|
"prepack": "yarn run clean && yarn run build",
|
|
29
|
-
"watch": "tsc --build ./tsconfig.json --watch"
|
|
43
|
+
"watch": "tsc --build ./tsconfig.json --watch",
|
|
44
|
+
"storybook:start": "storybook dev"
|
|
30
45
|
},
|
|
31
46
|
"dependencies": {
|
|
32
47
|
"@automattic/calypso-config": "^1.0.0-alpha.0",
|
|
33
|
-
"@automattic/components": "^
|
|
34
|
-
"@automattic/data-stores": "^3.
|
|
35
|
-
"@
|
|
36
|
-
"@wordpress/
|
|
37
|
-
"@wordpress/
|
|
38
|
-
"@wordpress/
|
|
48
|
+
"@automattic/components": "^3.0.4",
|
|
49
|
+
"@automattic/data-stores": "^3.2.1",
|
|
50
|
+
"@automattic/domain-search": "^1.0.1",
|
|
51
|
+
"@wordpress/components": "^35.0.0",
|
|
52
|
+
"@wordpress/data": "^10.48.0",
|
|
53
|
+
"@wordpress/icons": "^13.3.0",
|
|
54
|
+
"@wordpress/react-i18n": "^4.48.0",
|
|
39
55
|
"clsx": "^2.1.1",
|
|
40
|
-
"react-router-dom": "
|
|
41
|
-
"tslib": "^2.
|
|
42
|
-
"wpcom-proxy-request": "^7.0.
|
|
56
|
+
"react-router-dom": "6.30.4",
|
|
57
|
+
"tslib": "^2.8.1",
|
|
58
|
+
"wpcom-proxy-request": "^7.0.7"
|
|
43
59
|
},
|
|
44
60
|
"devDependencies": {
|
|
61
|
+
"@automattic/calypso-storybook": "^1.0.1",
|
|
45
62
|
"@automattic/calypso-typescript-config": "^1.0.0",
|
|
46
63
|
"@automattic/typography": "^1.0.0",
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
64
|
+
"@automattic/viewport": "^1.1.1",
|
|
65
|
+
"@storybook/addon-a11y": "^9.1.20",
|
|
66
|
+
"@testing-library/dom": "^10.4.1",
|
|
67
|
+
"@testing-library/react": "^16.3.2",
|
|
68
|
+
"@wordpress/base-styles": "^9.1.0",
|
|
69
|
+
"copyfiles": "^2.4.1",
|
|
70
|
+
"css-loader": "^6.11.0",
|
|
71
|
+
"react": "^18.3.1",
|
|
72
|
+
"react-dom": "^18.3.1",
|
|
73
|
+
"redux": "^5.0.1",
|
|
74
|
+
"sass-loader": "^14.2.1",
|
|
75
|
+
"storybook": "^9.1.20",
|
|
55
76
|
"style-loader": "^1.3.0",
|
|
56
|
-
"typescript": "^
|
|
57
|
-
"webpack": "^5.
|
|
77
|
+
"typescript": "^6.0.3",
|
|
78
|
+
"webpack": "^5.99.8"
|
|
58
79
|
},
|
|
59
80
|
"peerDependencies": {
|
|
60
|
-
"@wordpress/i18n": "^
|
|
61
|
-
"react": "^18.
|
|
81
|
+
"@wordpress/i18n": "^6.21.0",
|
|
82
|
+
"react": "^18.3.1 || ^19.0.0"
|
|
62
83
|
}
|
|
63
84
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Button } from '@wordpress/components';
|
|
2
|
-
import { Icon, chevronRight, chevronLeft } from '@wordpress/icons';
|
|
3
2
|
import { useI18n } from '@wordpress/react-i18n';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
4
|
import * as React from 'react';
|
|
@@ -72,42 +71,3 @@ export const NextButton: React.FunctionComponent< React.ComponentProps< typeof B
|
|
|
72
71
|
</Button>
|
|
73
72
|
);
|
|
74
73
|
};
|
|
75
|
-
|
|
76
|
-
export const SkipButton: React.FunctionComponent< React.ComponentProps< typeof Button > > = ( {
|
|
77
|
-
className,
|
|
78
|
-
children,
|
|
79
|
-
...buttonProps
|
|
80
|
-
} ) => {
|
|
81
|
-
const { __ } = useI18n();
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<Button
|
|
85
|
-
className={ clsx( 'action_buttons__button action-buttons__skip', className ) }
|
|
86
|
-
{ ...buttonProps }
|
|
87
|
-
>
|
|
88
|
-
{ children ||
|
|
89
|
-
/* translators: Button label for skipping a step in onboarding */
|
|
90
|
-
__( 'Skip for now', __i18n_text_domain__ ) }
|
|
91
|
-
</Button>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
export const ArrowButton: React.FunctionComponent<
|
|
96
|
-
React.ComponentProps< typeof Button > & {
|
|
97
|
-
arrow: 'left' | 'right';
|
|
98
|
-
}
|
|
99
|
-
> = ( { className, children, arrow = 'right', ...buttonProps } ) => {
|
|
100
|
-
return (
|
|
101
|
-
<Button
|
|
102
|
-
className={ clsx(
|
|
103
|
-
`action_buttons__button action-buttons__arrow action-buttons__arrow--${ arrow }`,
|
|
104
|
-
className
|
|
105
|
-
) }
|
|
106
|
-
{ ...buttonProps }
|
|
107
|
-
>
|
|
108
|
-
{ arrow === 'left' && <Icon icon={ chevronLeft } /> }
|
|
109
|
-
{ children }
|
|
110
|
-
{ arrow === 'right' && <Icon icon={ chevronRight } /> }
|
|
111
|
-
</Button>
|
|
112
|
-
);
|
|
113
|
-
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@import "../../styles/variables
|
|
2
|
-
@import "../../styles/mixins
|
|
3
|
-
@import "../../styles/z-index
|
|
1
|
+
@import "../../styles/variables";
|
|
2
|
+
@import "../../styles/mixins";
|
|
3
|
+
@import "../../styles/z-index";
|
|
4
4
|
|
|
5
5
|
.action-buttons {
|
|
6
6
|
padding: 0 20px;
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
margin-left: 20px;
|
|
22
22
|
position: static;
|
|
23
23
|
border: none;
|
|
24
|
+
z-index: initial;
|
|
24
25
|
|
|
25
26
|
.action_buttons__button {
|
|
26
27
|
margin-left: 20px;
|
|
@@ -65,43 +66,6 @@ button.action_buttons__button.components-button {
|
|
|
65
66
|
height: auto;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
&.action-buttons__skip {
|
|
69
|
-
color: var(--studio-gray-50);
|
|
70
|
-
box-shadow: inset 0 0 0 1px var(--studio-gray-50);
|
|
71
|
-
|
|
72
|
-
&:active,
|
|
73
|
-
&:hover {
|
|
74
|
-
color: var(--studio-gray-60);
|
|
75
|
-
box-shadow: inset 0 0 0 1px var(--studio-gray-60);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&:focus {
|
|
79
|
-
color: var(--studio-gray-60);
|
|
80
|
-
box-shadow: inset 0 0 0 1px #fff, 0 0 0 1.5px var(--highlightColor);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
&.action-buttons__arrow {
|
|
85
|
-
justify-content: flex-start;
|
|
86
|
-
|
|
87
|
-
text-decoration: underline;
|
|
88
|
-
font-weight: 600;
|
|
89
|
-
color: var(--mainColor);
|
|
90
|
-
|
|
91
|
-
// @TODO: We have to revisit the ArrowButton's padding when we pick up #48568 (https://github.com/Automattic/wp-calypso/issues/48568)
|
|
92
|
-
padding: 0;
|
|
93
|
-
margin-right: 0;
|
|
94
|
-
|
|
95
|
-
@include break-medium {
|
|
96
|
-
justify-content: flex-end;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
svg {
|
|
100
|
-
// The viewbox has a 5px margin and we have to crop it to align it with the ArrowButton's copy properly.
|
|
101
|
-
margin: 0 -5px -4px;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
69
|
@include break-small {
|
|
106
70
|
min-width: 160px;
|
|
107
71
|
}
|
package/src/cart/index.tsx
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import config from '@automattic/calypso-config';
|
|
2
2
|
import { getUrlParts } from '@automattic/calypso-url';
|
|
3
|
-
import {
|
|
3
|
+
import { NewSiteSuccessResponse, Site } from '@automattic/data-stores';
|
|
4
|
+
import { SiteGoal } from '@automattic/data-stores/src/onboard';
|
|
5
|
+
import { getTld, isFreeSubdomainQuery } from '@automattic/domain-search';
|
|
4
6
|
import { guessTimezone, getLanguage } from '@automattic/i18n-utils';
|
|
5
7
|
import debugFactory from 'debug';
|
|
6
8
|
import { getLocaleSlug } from 'i18n-calypso';
|
|
7
|
-
import {
|
|
8
|
-
import wpcomRequest from 'wpcom-proxy-request';
|
|
9
|
+
import { isEmpty } from 'lodash';
|
|
9
10
|
import {
|
|
10
11
|
setupSiteAfterCreation,
|
|
11
12
|
isTailoredSignupFlow,
|
|
12
|
-
isMigrationFlow,
|
|
13
13
|
HUNDRED_YEAR_PLAN_FLOW,
|
|
14
14
|
isAnyHostingFlow,
|
|
15
|
+
AI_SITE_BUILDER_FLOW,
|
|
15
16
|
} from '../';
|
|
17
|
+
import wpcomRequest from '../wpcom-request';
|
|
16
18
|
import cartManagerClient from './create-cart-manager-client';
|
|
19
|
+
import type { DomainSuggestion } from '@automattic/api-core';
|
|
17
20
|
import type { MinimalRequestCartProduct } from '@automattic/shopping-cart';
|
|
18
21
|
|
|
19
22
|
const debug = debugFactory( 'calypso:signup:step-actions' );
|
|
20
23
|
|
|
21
24
|
interface GetNewSiteParams {
|
|
22
25
|
flowToCheck: string;
|
|
23
|
-
isPurchasingDomainItem: boolean;
|
|
24
26
|
themeSlugWithRepo: string;
|
|
25
27
|
siteUrl?: string;
|
|
26
28
|
siteTitle: string;
|
|
@@ -28,7 +30,9 @@ interface GetNewSiteParams {
|
|
|
28
30
|
useThemeHeadstart: boolean;
|
|
29
31
|
siteVisibility: Site.Visibility;
|
|
30
32
|
username: string;
|
|
33
|
+
partnerBundle: string | null;
|
|
31
34
|
sourceSlug?: string;
|
|
35
|
+
siteIntent?: string;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
type NewSiteParams = {
|
|
@@ -49,6 +53,7 @@ type NewSiteParams = {
|
|
|
49
53
|
timezone_string?: string;
|
|
50
54
|
wpcom_public_coming_soon: 0 | 1;
|
|
51
55
|
site_accent_color?: string;
|
|
56
|
+
site_intent?: string;
|
|
52
57
|
};
|
|
53
58
|
validate: boolean;
|
|
54
59
|
};
|
|
@@ -58,21 +63,15 @@ const getBlogNameGenerationParams = ( {
|
|
|
58
63
|
siteTitle,
|
|
59
64
|
flowToCheck,
|
|
60
65
|
username,
|
|
61
|
-
isPurchasingDomainItem,
|
|
62
66
|
}: GetNewSiteParams ) => {
|
|
63
67
|
if ( siteUrl ) {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
if ( isMigrationFlow( flowToCheck ) ) {
|
|
67
|
-
return {
|
|
68
|
-
blog_name,
|
|
69
|
-
find_available_url: true,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
68
|
+
const blogName = siteUrl.replace( '.wordpress.com', '' );
|
|
72
69
|
|
|
73
70
|
return {
|
|
74
|
-
blog_name,
|
|
75
|
-
|
|
71
|
+
blog_name: blogName,
|
|
72
|
+
// Free subdomains (.wordpress.com and .blog) should use the exact URL.
|
|
73
|
+
// Only paid domains need find_available_url to generate a fallback free subdomain.
|
|
74
|
+
find_available_url: ! isFreeSubdomainQuery( siteUrl ) && !! getTld( blogName ),
|
|
76
75
|
};
|
|
77
76
|
}
|
|
78
77
|
|
|
@@ -105,6 +104,8 @@ export const getNewSiteParams = ( params: GetNewSiteParams ) => {
|
|
|
105
104
|
useThemeHeadstart = false,
|
|
106
105
|
siteVisibility,
|
|
107
106
|
sourceSlug,
|
|
107
|
+
siteIntent,
|
|
108
|
+
partnerBundle,
|
|
108
109
|
} = params;
|
|
109
110
|
|
|
110
111
|
// We will use the default annotation instead of theme annotation as fallback,
|
|
@@ -127,6 +128,8 @@ export const getNewSiteParams = ( params: GetNewSiteParams ) => {
|
|
|
127
128
|
...( sourceSlug && { site_source_slug: sourceSlug } ),
|
|
128
129
|
...( siteAccentColor && { site_accent_color: siteAccentColor } ),
|
|
129
130
|
...( themeSlugWithRepo && { theme: themeSlugWithRepo } ),
|
|
131
|
+
...( siteIntent && { site_intent: siteIntent } ),
|
|
132
|
+
...( partnerBundle && { site_partner_bundle: partnerBundle } ),
|
|
130
133
|
},
|
|
131
134
|
validate: false,
|
|
132
135
|
};
|
|
@@ -134,26 +137,29 @@ export const getNewSiteParams = ( params: GetNewSiteParams ) => {
|
|
|
134
137
|
return newSiteParams;
|
|
135
138
|
};
|
|
136
139
|
|
|
137
|
-
export const
|
|
140
|
+
export const createSite = async (
|
|
138
141
|
flowName: string,
|
|
139
|
-
userIsLoggedIn: boolean,
|
|
140
|
-
isPurchasingDomainItem: boolean,
|
|
141
142
|
themeSlugWithRepo: string,
|
|
142
143
|
siteVisibility: Site.Visibility,
|
|
143
144
|
siteTitle: string,
|
|
144
145
|
siteAccentColor: string,
|
|
145
146
|
useThemeHeadstart: boolean,
|
|
146
147
|
username: string,
|
|
148
|
+
partnerBundle: string | null,
|
|
149
|
+
storedSiteUrl?: string,
|
|
147
150
|
domainItem?: DomainSuggestion,
|
|
148
|
-
|
|
149
|
-
|
|
151
|
+
sourceSlug?: string,
|
|
152
|
+
siteIntent?: string,
|
|
153
|
+
siteGoals?: SiteGoal[],
|
|
154
|
+
gardenName?: string | null,
|
|
155
|
+
gardenPartnerName?: string | null,
|
|
156
|
+
specId?: string | null,
|
|
157
|
+
ref?: string
|
|
150
158
|
) => {
|
|
151
|
-
const siteUrl = domainItem?.domain_name;
|
|
152
|
-
const isFreeThemePreselected = startsWith( themeSlugWithRepo, 'pub' );
|
|
159
|
+
const siteUrl = storedSiteUrl || domainItem?.domain_name;
|
|
153
160
|
|
|
154
161
|
const newSiteParams = getNewSiteParams( {
|
|
155
162
|
flowToCheck: flowName,
|
|
156
|
-
isPurchasingDomainItem,
|
|
157
163
|
themeSlugWithRepo,
|
|
158
164
|
siteUrl,
|
|
159
165
|
siteTitle,
|
|
@@ -162,6 +168,8 @@ export const createSiteWithCart = async (
|
|
|
162
168
|
siteVisibility,
|
|
163
169
|
username,
|
|
164
170
|
sourceSlug,
|
|
171
|
+
siteIntent,
|
|
172
|
+
partnerBundle,
|
|
165
173
|
} );
|
|
166
174
|
|
|
167
175
|
// if ( isEmpty( bearerToken ) && 'onboarding-registrationless' === flowToCheck ) {
|
|
@@ -175,6 +183,9 @@ export const createSiteWithCart = async (
|
|
|
175
183
|
const segmentationSurveyAnswersAnonId = localStorage.getItem( 'ss-anon-id' );
|
|
176
184
|
localStorage.removeItem( 'ss-anon-id' );
|
|
177
185
|
|
|
186
|
+
// This is the parameter that will contain the internal referral, e.g. a landing page.
|
|
187
|
+
const refParam = new URLSearchParams( document.location.search ).get( 'ref' );
|
|
188
|
+
|
|
178
189
|
const siteCreationResponse: NewSiteSuccessResponse = await wpcomRequest( {
|
|
179
190
|
path: '/sites/new',
|
|
180
191
|
apiVersion: '1.1',
|
|
@@ -185,12 +196,28 @@ export const createSiteWithCart = async (
|
|
|
185
196
|
lang_id: getLanguage( locale as string )?.value,
|
|
186
197
|
client_id: config( 'wpcom_signup_id' ),
|
|
187
198
|
client_secret: config( 'wpcom_signup_key' ),
|
|
199
|
+
...( gardenName &&
|
|
200
|
+
gardenPartnerName && {
|
|
201
|
+
garden_name: gardenName,
|
|
202
|
+
garden_partner_name: gardenPartnerName,
|
|
203
|
+
} ),
|
|
204
|
+
...( specId && {
|
|
205
|
+
spec_id: specId,
|
|
206
|
+
} ),
|
|
188
207
|
options: {
|
|
189
208
|
...newSiteParams.options,
|
|
190
209
|
has_segmentation_survey: hasSegmentationSurvey,
|
|
191
210
|
...( hasSegmentationSurvey && segmentationSurveyAnswersAnonId
|
|
192
211
|
? { segmentation_survey_answers_anon_id: segmentationSurveyAnswersAnonId }
|
|
193
212
|
: {} ),
|
|
213
|
+
...( siteGoals && { site_goals: siteGoals } ),
|
|
214
|
+
...( ( ref ?? refParam ) && { ref: ref ?? refParam } ),
|
|
215
|
+
// Trigger backend build for ai-site-builder flow with commerce garden and spec_id
|
|
216
|
+
...( flowName === AI_SITE_BUILDER_FLOW &&
|
|
217
|
+
gardenName === 'commerce' &&
|
|
218
|
+
specId && {
|
|
219
|
+
trigger_backend_build: false,
|
|
220
|
+
} ),
|
|
194
221
|
},
|
|
195
222
|
},
|
|
196
223
|
} );
|
|
@@ -200,6 +227,15 @@ export const createSiteWithCart = async (
|
|
|
200
227
|
return;
|
|
201
228
|
}
|
|
202
229
|
|
|
230
|
+
// TODO - This is a temporary fix to ensure garden site URLs use HTTPS.
|
|
231
|
+
// Ensure garden site URLs use HTTPS
|
|
232
|
+
if ( gardenName && siteCreationResponse?.blog_details?.url ) {
|
|
233
|
+
siteCreationResponse.blog_details.url = siteCreationResponse.blog_details.url.replace(
|
|
234
|
+
'http://',
|
|
235
|
+
'https://'
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
203
239
|
const parsedBlogURL = getUrlParts( siteCreationResponse?.blog_details.url );
|
|
204
240
|
const siteSlug = parsedBlogURL.hostname;
|
|
205
241
|
const siteId = siteCreationResponse?.blog_details.blogid;
|
|
@@ -213,15 +249,6 @@ export const createSiteWithCart = async (
|
|
|
213
249
|
await setupSiteAfterCreation( { siteId, flowName } );
|
|
214
250
|
}
|
|
215
251
|
|
|
216
|
-
await processItemCart(
|
|
217
|
-
siteSlug,
|
|
218
|
-
isFreeThemePreselected,
|
|
219
|
-
themeSlugWithRepo,
|
|
220
|
-
flowName,
|
|
221
|
-
userIsLoggedIn,
|
|
222
|
-
domainCartItem
|
|
223
|
-
);
|
|
224
|
-
|
|
225
252
|
return providedDependencies;
|
|
226
253
|
};
|
|
227
254
|
|
|
@@ -236,30 +263,6 @@ function prepareItemForAddingToCart( item: MinimalRequestCartProduct, lastKnownF
|
|
|
236
263
|
};
|
|
237
264
|
}
|
|
238
265
|
|
|
239
|
-
export async function addPlanToCart(
|
|
240
|
-
siteSlug: string,
|
|
241
|
-
flowName: string,
|
|
242
|
-
userIsLoggedIn: boolean,
|
|
243
|
-
themeSlugWithRepo: string,
|
|
244
|
-
cartItem: MinimalRequestCartProduct
|
|
245
|
-
) {
|
|
246
|
-
if ( isEmpty( cartItem ) ) {
|
|
247
|
-
// the user selected the free plan
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
const isFreeThemePreselected = startsWith( themeSlugWithRepo, 'pub' );
|
|
252
|
-
|
|
253
|
-
await processItemCart(
|
|
254
|
-
siteSlug,
|
|
255
|
-
isFreeThemePreselected,
|
|
256
|
-
themeSlugWithRepo,
|
|
257
|
-
flowName,
|
|
258
|
-
userIsLoggedIn,
|
|
259
|
-
cartItem
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
266
|
export async function replaceProductsInCart(
|
|
264
267
|
siteSlug: string,
|
|
265
268
|
cartItems: MinimalRequestCartProduct[]
|
|
@@ -277,33 +280,6 @@ export async function replaceProductsInCart(
|
|
|
277
280
|
}
|
|
278
281
|
}
|
|
279
282
|
|
|
280
|
-
const addToCartAndProceed = async (
|
|
281
|
-
newCartItem: MinimalRequestCartProduct,
|
|
282
|
-
siteSlug: string,
|
|
283
|
-
flowName: string
|
|
284
|
-
) => {
|
|
285
|
-
const cartItem = prepareItemForAddingToCart( newCartItem, flowName );
|
|
286
|
-
|
|
287
|
-
if ( cartItem ) {
|
|
288
|
-
debug( 'adding products to cart', cartItem );
|
|
289
|
-
const cartKey = await cartManagerClient.getCartKeyForSiteSlug( siteSlug );
|
|
290
|
-
|
|
291
|
-
try {
|
|
292
|
-
const updatedCart = await cartManagerClient
|
|
293
|
-
.forCartKey( cartKey )
|
|
294
|
-
.actions.addProductsToCart( [ cartItem ] );
|
|
295
|
-
|
|
296
|
-
debug( 'product add request complete', updatedCart );
|
|
297
|
-
} catch ( error ) {
|
|
298
|
-
debug( 'product add request had an error', error );
|
|
299
|
-
//TODO Manage error
|
|
300
|
-
// reduxStore.dispatch( errorNotice( error.message ) );
|
|
301
|
-
}
|
|
302
|
-
} else {
|
|
303
|
-
debug( 'no cart items to add' );
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
|
|
307
283
|
export async function addProductsToCart(
|
|
308
284
|
siteSlug: string,
|
|
309
285
|
flowName: string,
|
|
@@ -354,22 +330,3 @@ export async function setThemeOnSite(
|
|
|
354
330
|
//TODO: Manage error
|
|
355
331
|
}
|
|
356
332
|
}
|
|
357
|
-
|
|
358
|
-
async function processItemCart(
|
|
359
|
-
siteSlug: string,
|
|
360
|
-
isFreeThemePreselected: boolean,
|
|
361
|
-
themeSlugWithRepo: string,
|
|
362
|
-
lastKnownFlow: string,
|
|
363
|
-
userIsLoggedIn: boolean,
|
|
364
|
-
newCartItem?: MinimalRequestCartProduct
|
|
365
|
-
) {
|
|
366
|
-
if ( ! userIsLoggedIn && isFreeThemePreselected ) {
|
|
367
|
-
await setThemeOnSite( siteSlug, themeSlugWithRepo );
|
|
368
|
-
newCartItem && ( await addToCartAndProceed( newCartItem, siteSlug, lastKnownFlow ) );
|
|
369
|
-
} else if ( userIsLoggedIn && isFreeThemePreselected ) {
|
|
370
|
-
await setThemeOnSite( siteSlug, themeSlugWithRepo );
|
|
371
|
-
newCartItem && ( await addToCartAndProceed( newCartItem, siteSlug, lastKnownFlow ) );
|
|
372
|
-
} else {
|
|
373
|
-
newCartItem && ( await addToCartAndProceed( newCartItem, siteSlug, lastKnownFlow ) );
|
|
374
|
-
}
|
|
375
|
-
}
|
package/src/cart/test/index.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Visibility } from '@automattic/data-stores';
|
|
2
2
|
import { getNewSiteParams } from '..';
|
|
3
|
-
import { HOSTING_LP_FLOW
|
|
3
|
+
import { HOSTING_LP_FLOW } from '../../utils/flows';
|
|
4
4
|
|
|
5
5
|
describe( 'getNewSiteParams', () => {
|
|
6
6
|
function testParams( partialParams: Partial< Parameters< typeof getNewSiteParams >[ 0 ] > = {} ) {
|
|
7
7
|
return {
|
|
8
8
|
flowToCheck: 'test-flow',
|
|
9
|
-
isPurchasingDomainItem: false,
|
|
10
9
|
themeSlugWithRepo: 'pub/test-theme',
|
|
11
10
|
siteTitle: 'test site title',
|
|
12
11
|
siteAccentColor: '#deface',
|
|
@@ -14,6 +13,7 @@ describe( 'getNewSiteParams', () => {
|
|
|
14
13
|
siteVisibility: Visibility.Private,
|
|
15
14
|
username: 'testuser',
|
|
16
15
|
...partialParams,
|
|
16
|
+
partnerBundle: partialParams.partnerBundle ?? null,
|
|
17
17
|
} satisfies Parameters< typeof getNewSiteParams >[ 0 ];
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -126,46 +126,46 @@ describe( 'getNewSiteParams', () => {
|
|
|
126
126
|
siteUrl: 'testing123.wordpress.com',
|
|
127
127
|
siteTitle: 'Testing Inc.',
|
|
128
128
|
username: 'janedoe',
|
|
129
|
-
isPurchasingDomainItem: true,
|
|
130
129
|
} )
|
|
131
130
|
)
|
|
132
131
|
).toEqual(
|
|
133
132
|
expect.objectContaining( {
|
|
134
133
|
blog_name: 'testing123',
|
|
135
|
-
find_available_url:
|
|
134
|
+
find_available_url: false,
|
|
136
135
|
} )
|
|
137
136
|
);
|
|
137
|
+
} );
|
|
138
138
|
|
|
139
|
+
test( 'find_available_url is true when siteUrl is a custom domain', () => {
|
|
139
140
|
expect(
|
|
140
141
|
getNewSiteParams(
|
|
141
142
|
testParams( {
|
|
142
|
-
siteUrl: '
|
|
143
|
+
siteUrl: 'example.com',
|
|
143
144
|
siteTitle: 'Testing Inc.',
|
|
144
145
|
username: 'janedoe',
|
|
145
|
-
isPurchasingDomainItem: false,
|
|
146
146
|
} )
|
|
147
147
|
)
|
|
148
148
|
).toEqual(
|
|
149
149
|
expect.objectContaining( {
|
|
150
|
-
blog_name: '
|
|
151
|
-
find_available_url:
|
|
150
|
+
blog_name: 'example.com',
|
|
151
|
+
find_available_url: true,
|
|
152
152
|
} )
|
|
153
153
|
);
|
|
154
154
|
} );
|
|
155
155
|
|
|
156
|
-
test( '
|
|
156
|
+
test( 'find_available_url is false when siteUrl is a free .blog subdomain', () => {
|
|
157
157
|
expect(
|
|
158
158
|
getNewSiteParams(
|
|
159
159
|
testParams( {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
siteUrl: 'mysite.tech.blog',
|
|
161
|
+
siteTitle: 'Testing Inc.',
|
|
162
|
+
username: 'janedoe',
|
|
163
163
|
} )
|
|
164
164
|
)
|
|
165
165
|
).toEqual(
|
|
166
166
|
expect.objectContaining( {
|
|
167
|
-
blog_name: '
|
|
168
|
-
find_available_url:
|
|
167
|
+
blog_name: 'mysite.tech.blog',
|
|
168
|
+
find_available_url: false,
|
|
169
169
|
} )
|
|
170
170
|
);
|
|
171
171
|
} );
|
package/src/confetti/index.tsx
CHANGED