@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,16 @@
|
|
|
1
|
+
/* stylelint-disable scss/load-no-partial-leading-underscore */
|
|
2
|
+
@import '@wordpress/base-styles/variables';
|
|
3
|
+
@import '@automattic/calypso-color-schemes';
|
|
4
|
+
|
|
5
|
+
// Calypso style needs these variables
|
|
6
|
+
@import '@automattic/typography/styles/variables';
|
|
7
|
+
|
|
8
|
+
@import 'calypso/assets/stylesheets/shared/mixins/_breakpoints';
|
|
9
|
+
|
|
10
|
+
@import '@wordpress/components/build-style/style';
|
|
11
|
+
|
|
12
|
+
@import '@automattic/typography';
|
|
13
|
+
|
|
14
|
+
html {
|
|
15
|
+
font-family: $default-font;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import storybookDefaultConfig from '@automattic/calypso-storybook';
|
|
2
|
+
const config = storybookDefaultConfig();
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...config,
|
|
6
|
+
typescript: {
|
|
7
|
+
...config.typescript,
|
|
8
|
+
reactDocgen: 'react-docgen-typescript',
|
|
9
|
+
},
|
|
10
|
+
core: {
|
|
11
|
+
...config.core,
|
|
12
|
+
disableTelemetry: true,
|
|
13
|
+
},
|
|
14
|
+
addons: [ ...( config.addons ?? [] ), '@storybook/addon-a11y' ],
|
|
15
|
+
};
|
package/CHANGELOG.md
ADDED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.NextButton = exports.BackButton = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const components_1 = require("@wordpress/components");
|
|
7
|
-
const icons_1 = require("@wordpress/icons");
|
|
8
7
|
const react_i18n_1 = require("@wordpress/react-i18n");
|
|
9
8
|
const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
10
9
|
require("./style.scss");
|
|
@@ -36,15 +35,4 @@ const NextButton = ({ className, children, ...buttonProps }) => {
|
|
|
36
35
|
__('Continue', __i18n_text_domain__) }));
|
|
37
36
|
};
|
|
38
37
|
exports.NextButton = NextButton;
|
|
39
|
-
const SkipButton = ({ className, children, ...buttonProps }) => {
|
|
40
|
-
const { __ } = (0, react_i18n_1.useI18n)();
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(components_1.Button, { className: (0, clsx_1.default)('action_buttons__button action-buttons__skip', className), ...buttonProps, children: children ||
|
|
42
|
-
/* translators: Button label for skipping a step in onboarding */
|
|
43
|
-
__('Skip for now', __i18n_text_domain__) }));
|
|
44
|
-
};
|
|
45
|
-
exports.SkipButton = SkipButton;
|
|
46
|
-
const ArrowButton = ({ className, children, arrow = 'right', ...buttonProps }) => {
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)(components_1.Button, { className: (0, clsx_1.default)(`action_buttons__button action-buttons__arrow action-buttons__arrow--${arrow}`, className), ...buttonProps, children: [arrow === 'left' && (0, jsx_runtime_1.jsx)(icons_1.Icon, { icon: icons_1.chevronLeft }), children, arrow === 'right' && (0, jsx_runtime_1.jsx)(icons_1.Icon, { icon: icons_1.chevronRight })] }));
|
|
48
|
-
};
|
|
49
|
-
exports.ArrowButton = ArrowButton;
|
|
50
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/action-buttons/index.tsx"],"names":[],"mappings":";;;;;AAAA,sDAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/action-buttons/index.tsx"],"names":[],"mappings":";;;;;AAAA,sDAA+C;AAC/C,sDAAgD;AAChD,wDAAwB;AAGxB,wBAAsB;AAQtB,MAAM,aAAa,GAAkD,CAAE,EACtE,SAAS,EACT,QAAQ,EACR,MAAM,GAAG,IAAI,GACb,EAAG,EAAE;IACL,0CAA0C;IAC1C,yBAAyB;IACzB,yBAAyB;IACzB,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,IAAK,MAAM,KAAK,IAAI,EAAG,CAAC;QACvB,WAAW,GAAG,WAAW,CAAC;IAC3B,CAAC;IACD,IAAK,MAAM,KAAK,KAAK,EAAG,CAAC;QACxB,WAAW,GAAG,WAAW,CAAC;IAC3B,CAAC;IAED,OAAO,gCAAK,SAAS,EAAG,IAAA,cAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,CAAE,YAAK,QAAQ,GAAQ,CAAC;AAC/F,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC;AAEtB,MAAM,UAAU,GAAqE,CAAE,EAC7F,SAAS,EACT,QAAQ,EACR,GAAG,WAAW,EACd,EAAG,EAAE;IACL,MAAM,EAAE,EAAE,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAC;IAEzB,OAAO,CACN,uBAAC,mBAAM,IACN,SAAS,EAAG,IAAA,cAAI,EAAE,6CAA6C,EAAE,SAAS,CAAE,EAC5E,OAAO,EAAC,MAAM,KACT,WAAW,YAEd,QAAQ;YACT,wEAAwE;YACxE,EAAE,CAAE,SAAS,EAAE,oBAAoB,CAAE,GAC9B,CACT,CAAC;AACH,CAAC,CAAC;AAlBW,QAAA,UAAU,cAkBrB;AAEK,MAAM,UAAU,GAAqE,CAAE,EAC7F,SAAS,EACT,QAAQ,EACR,GAAG,WAAW,EACd,EAAG,EAAE;IACL,MAAM,EAAE,EAAE,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAC;IAEzB,OAAO,CACN,uBAAC,mBAAM,IACN,SAAS,EAAG,IAAA,cAAI,EAAE,oDAAoD,EAAE,SAAS,CAAE,EACnF,OAAO,EAAC,SAAS,KACZ,WAAW,YAEd,QAAQ;YACT,wEAAwE;YACxE,EAAE,CAAE,UAAU,EAAE,oBAAoB,CAAE,GAC/B,CACT,CAAC;AACH,CAAC,CAAC;AAlBW,QAAA,UAAU,cAkBrB"}
|
|
@@ -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
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const shopping_cart_1 = require("@automattic/shopping-cart");
|
|
5
|
-
const
|
|
5
|
+
const wpcom_request_1 = tslib_1.__importDefault(require("../wpcom-request"));
|
|
6
6
|
const wpcomGetCart = (cartKey) => {
|
|
7
7
|
let source;
|
|
8
8
|
try {
|
|
@@ -11,13 +11,13 @@ const wpcomGetCart = (cartKey) => {
|
|
|
11
11
|
catch {
|
|
12
12
|
// Ignore failures here if window is not present.
|
|
13
13
|
}
|
|
14
|
-
return (0,
|
|
14
|
+
return (0, wpcom_request_1.default)({
|
|
15
15
|
path: `/me/shopping-cart/${cartKey}?source=${source ?? 'unknown'}`,
|
|
16
16
|
method: 'GET',
|
|
17
17
|
apiVersion: '1.1',
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
|
-
const wpcomSetCart = (cartKey, cartData) => (0,
|
|
20
|
+
const wpcomSetCart = (cartKey, cartData) => (0, wpcom_request_1.default)({
|
|
21
21
|
path: `/me/shopping-cart/${cartKey}`,
|
|
22
22
|
apiVersion: '1.1',
|
|
23
23
|
method: 'POST',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-manager-client.js","sourceRoot":"","sources":["../../../src/cart/create-cart-manager-client.ts"],"names":[],"mappings":";;;AAAA,6DAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"create-cart-manager-client.js","sourceRoot":"","sources":["../../../src/cart/create-cart-manager-client.ts"],"names":[],"mappings":";;;AAAA,6DAA4E;AAC5E,6EAA4C;AAQ5C,MAAM,YAAY,GAAG,CAAE,OAAgB,EAAG,EAAE;IAC3C,IAAI,MAAM,CAAC;IACX,IAAI,CAAC;QACJ,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACR,iDAAiD;IAClD,CAAC;IACD,OAAO,IAAA,uBAAY,EAAyC;QAC3D,IAAI,EAAE,qBAAsB,OAAQ,WAAY,MAAM,IAAI,SAAU,EAAE;QACtE,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,KAAK;KACjB,CAAE,CAAC;AACL,CAAC,CAAC;AACF,MAAM,YAAY,GAAG,CAAE,OAAgB,EAAE,QAAqB,EAAG,EAAE,CAClE,IAAA,uBAAY,EAAyC;IACpD,IAAI,EAAE,qBAAsB,OAAQ,EAAE;IACtC,UAAU,EAAE,KAAK;IACjB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,QAAQ;CACd,CAAE,CAAC;AAEL,kBAAe,IAAA,+CAA+B,EAAE;IAC/C,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;CACrB,CAAE,CAAC"}
|
package/dist/cjs/cart/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createSite = exports.getNewSiteParams = void 0;
|
|
4
|
+
exports.replaceProductsInCart = replaceProductsInCart;
|
|
5
|
+
exports.addProductsToCart = addProductsToCart;
|
|
6
|
+
exports.setThemeOnSite = setThemeOnSite;
|
|
4
7
|
const tslib_1 = require("tslib");
|
|
5
8
|
const calypso_config_1 = tslib_1.__importDefault(require("@automattic/calypso-config"));
|
|
6
9
|
const calypso_url_1 = require("@automattic/calypso-url");
|
|
10
|
+
const domain_search_1 = require("@automattic/domain-search");
|
|
7
11
|
const i18n_utils_1 = require("@automattic/i18n-utils");
|
|
8
12
|
const debug_1 = tslib_1.__importDefault(require("debug"));
|
|
9
13
|
const i18n_calypso_1 = require("i18n-calypso");
|
|
10
14
|
const lodash_1 = require("lodash");
|
|
11
|
-
const wpcom_proxy_request_1 = tslib_1.__importDefault(require("wpcom-proxy-request"));
|
|
12
15
|
const __1 = require("../");
|
|
16
|
+
const wpcom_request_1 = tslib_1.__importDefault(require("../wpcom-request"));
|
|
13
17
|
const create_cart_manager_client_1 = tslib_1.__importDefault(require("./create-cart-manager-client"));
|
|
14
18
|
const debug = (0, debug_1.default)('calypso:signup:step-actions');
|
|
15
|
-
const getBlogNameGenerationParams = ({ siteUrl, siteTitle, flowToCheck, username,
|
|
19
|
+
const getBlogNameGenerationParams = ({ siteUrl, siteTitle, flowToCheck, username, }) => {
|
|
16
20
|
if (siteUrl) {
|
|
17
|
-
const
|
|
18
|
-
if ((0, __1.isMigrationFlow)(flowToCheck)) {
|
|
19
|
-
return {
|
|
20
|
-
blog_name,
|
|
21
|
-
find_available_url: true,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
21
|
+
const blogName = siteUrl.replace('.wordpress.com', '');
|
|
24
22
|
return {
|
|
25
|
-
blog_name,
|
|
26
|
-
|
|
23
|
+
blog_name: blogName,
|
|
24
|
+
// Free subdomains (.wordpress.com and .blog) should use the exact URL.
|
|
25
|
+
// Only paid domains need find_available_url to generate a fallback free subdomain.
|
|
26
|
+
find_available_url: !(0, domain_search_1.isFreeSubdomainQuery)(siteUrl) && !!(0, domain_search_1.getTld)(blogName),
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
if (siteTitle) {
|
|
@@ -44,7 +44,7 @@ const getBlogNameGenerationParams = ({ siteUrl, siteTitle, flowToCheck, username
|
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
const getNewSiteParams = (params) => {
|
|
47
|
-
const { flowToCheck, themeSlugWithRepo, siteTitle, siteAccentColor, useThemeHeadstart = false, siteVisibility, sourceSlug, } = params;
|
|
47
|
+
const { flowToCheck, themeSlugWithRepo, siteTitle, siteAccentColor, useThemeHeadstart = false, siteVisibility, sourceSlug, siteIntent, partnerBundle, } = params;
|
|
48
48
|
// We will use the default annotation instead of theme annotation as fallback,
|
|
49
49
|
// when segment and vertical values are not sent. Check pbAok1-p2#comment-834.
|
|
50
50
|
const newSiteParams = {
|
|
@@ -65,18 +65,18 @@ const getNewSiteParams = (params) => {
|
|
|
65
65
|
...(sourceSlug && { site_source_slug: sourceSlug }),
|
|
66
66
|
...(siteAccentColor && { site_accent_color: siteAccentColor }),
|
|
67
67
|
...(themeSlugWithRepo && { theme: themeSlugWithRepo }),
|
|
68
|
+
...(siteIntent && { site_intent: siteIntent }),
|
|
69
|
+
...(partnerBundle && { site_partner_bundle: partnerBundle }),
|
|
68
70
|
},
|
|
69
71
|
validate: false,
|
|
70
72
|
};
|
|
71
73
|
return newSiteParams;
|
|
72
74
|
};
|
|
73
75
|
exports.getNewSiteParams = getNewSiteParams;
|
|
74
|
-
const
|
|
75
|
-
const siteUrl = domainItem?.domain_name;
|
|
76
|
-
const isFreeThemePreselected = (0, lodash_1.startsWith)(themeSlugWithRepo, 'pub');
|
|
76
|
+
const createSite = async (flowName, themeSlugWithRepo, siteVisibility, siteTitle, siteAccentColor, useThemeHeadstart, username, partnerBundle, storedSiteUrl, domainItem, sourceSlug, siteIntent, siteGoals, gardenName, gardenPartnerName, specId, ref) => {
|
|
77
|
+
const siteUrl = storedSiteUrl || domainItem?.domain_name;
|
|
77
78
|
const newSiteParams = (0, exports.getNewSiteParams)({
|
|
78
79
|
flowToCheck: flowName,
|
|
79
|
-
isPurchasingDomainItem,
|
|
80
80
|
themeSlugWithRepo,
|
|
81
81
|
siteUrl,
|
|
82
82
|
siteTitle,
|
|
@@ -85,6 +85,8 @@ const createSiteWithCart = async (flowName, userIsLoggedIn, isPurchasingDomainIt
|
|
|
85
85
|
siteVisibility,
|
|
86
86
|
username,
|
|
87
87
|
sourceSlug,
|
|
88
|
+
siteIntent,
|
|
89
|
+
partnerBundle,
|
|
88
90
|
});
|
|
89
91
|
// if ( isEmpty( bearerToken ) && 'onboarding-registrationless' === flowToCheck ) {
|
|
90
92
|
// saveToLocalStorageAndProceed( state, domainItem, themeItem, newSiteParams, callback );
|
|
@@ -94,7 +96,9 @@ const createSiteWithCart = async (flowName, userIsLoggedIn, isPurchasingDomainIt
|
|
|
94
96
|
const hasSegmentationSurvey = newSiteParams['options']['site_creation_flow'] === 'entrepreneur';
|
|
95
97
|
const segmentationSurveyAnswersAnonId = localStorage.getItem('ss-anon-id');
|
|
96
98
|
localStorage.removeItem('ss-anon-id');
|
|
97
|
-
|
|
99
|
+
// This is the parameter that will contain the internal referral, e.g. a landing page.
|
|
100
|
+
const refParam = new URLSearchParams(document.location.search).get('ref');
|
|
101
|
+
const siteCreationResponse = await (0, wpcom_request_1.default)({
|
|
98
102
|
path: '/sites/new',
|
|
99
103
|
apiVersion: '1.1',
|
|
100
104
|
method: 'POST',
|
|
@@ -104,12 +108,28 @@ const createSiteWithCart = async (flowName, userIsLoggedIn, isPurchasingDomainIt
|
|
|
104
108
|
lang_id: (0, i18n_utils_1.getLanguage)(locale)?.value,
|
|
105
109
|
client_id: (0, calypso_config_1.default)('wpcom_signup_id'),
|
|
106
110
|
client_secret: (0, calypso_config_1.default)('wpcom_signup_key'),
|
|
111
|
+
...(gardenName &&
|
|
112
|
+
gardenPartnerName && {
|
|
113
|
+
garden_name: gardenName,
|
|
114
|
+
garden_partner_name: gardenPartnerName,
|
|
115
|
+
}),
|
|
116
|
+
...(specId && {
|
|
117
|
+
spec_id: specId,
|
|
118
|
+
}),
|
|
107
119
|
options: {
|
|
108
120
|
...newSiteParams.options,
|
|
109
121
|
has_segmentation_survey: hasSegmentationSurvey,
|
|
110
122
|
...(hasSegmentationSurvey && segmentationSurveyAnswersAnonId
|
|
111
123
|
? { segmentation_survey_answers_anon_id: segmentationSurveyAnswersAnonId }
|
|
112
124
|
: {}),
|
|
125
|
+
...(siteGoals && { site_goals: siteGoals }),
|
|
126
|
+
...((ref ?? refParam) && { ref: ref ?? refParam }),
|
|
127
|
+
// Trigger backend build for ai-site-builder flow with commerce garden and spec_id
|
|
128
|
+
...(flowName === __1.AI_SITE_BUILDER_FLOW &&
|
|
129
|
+
gardenName === 'commerce' &&
|
|
130
|
+
specId && {
|
|
131
|
+
trigger_backend_build: false,
|
|
132
|
+
}),
|
|
113
133
|
},
|
|
114
134
|
},
|
|
115
135
|
});
|
|
@@ -117,6 +137,11 @@ const createSiteWithCart = async (flowName, userIsLoggedIn, isPurchasingDomainIt
|
|
|
117
137
|
// TODO ebuccelli: Manage siteCreationResponse.errors
|
|
118
138
|
return;
|
|
119
139
|
}
|
|
140
|
+
// TODO - This is a temporary fix to ensure garden site URLs use HTTPS.
|
|
141
|
+
// Ensure garden site URLs use HTTPS
|
|
142
|
+
if (gardenName && siteCreationResponse?.blog_details?.url) {
|
|
143
|
+
siteCreationResponse.blog_details.url = siteCreationResponse.blog_details.url.replace('http://', 'https://');
|
|
144
|
+
}
|
|
120
145
|
const parsedBlogURL = (0, calypso_url_1.getUrlParts)(siteCreationResponse?.blog_details.url);
|
|
121
146
|
const siteSlug = parsedBlogURL.hostname;
|
|
122
147
|
const siteId = siteCreationResponse?.blog_details.blogid;
|
|
@@ -128,10 +153,9 @@ const createSiteWithCart = async (flowName, userIsLoggedIn, isPurchasingDomainIt
|
|
|
128
153
|
if ((0, __1.isTailoredSignupFlow)(flowName) || __1.HUNDRED_YEAR_PLAN_FLOW === flowName) {
|
|
129
154
|
await (0, __1.setupSiteAfterCreation)({ siteId, flowName });
|
|
130
155
|
}
|
|
131
|
-
await processItemCart(siteSlug, isFreeThemePreselected, themeSlugWithRepo, flowName, userIsLoggedIn, domainCartItem);
|
|
132
156
|
return providedDependencies;
|
|
133
157
|
};
|
|
134
|
-
exports.
|
|
158
|
+
exports.createSite = createSite;
|
|
135
159
|
function prepareItemForAddingToCart(item, lastKnownFlow) {
|
|
136
160
|
return {
|
|
137
161
|
...item,
|
|
@@ -142,15 +166,6 @@ function prepareItemForAddingToCart(item, lastKnownFlow) {
|
|
|
142
166
|
},
|
|
143
167
|
};
|
|
144
168
|
}
|
|
145
|
-
async function addPlanToCart(siteSlug, flowName, userIsLoggedIn, themeSlugWithRepo, cartItem) {
|
|
146
|
-
if ((0, lodash_1.isEmpty)(cartItem)) {
|
|
147
|
-
// the user selected the free plan
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
const isFreeThemePreselected = (0, lodash_1.startsWith)(themeSlugWithRepo, 'pub');
|
|
151
|
-
await processItemCart(siteSlug, isFreeThemePreselected, themeSlugWithRepo, flowName, userIsLoggedIn, cartItem);
|
|
152
|
-
}
|
|
153
|
-
exports.addPlanToCart = addPlanToCart;
|
|
154
169
|
async function replaceProductsInCart(siteSlug, cartItems) {
|
|
155
170
|
const cartKey = await create_cart_manager_client_1.default.getCartKeyForSiteSlug(siteSlug);
|
|
156
171
|
try {
|
|
@@ -163,28 +178,6 @@ async function replaceProductsInCart(siteSlug, cartItems) {
|
|
|
163
178
|
debug('product replace request had an error', error);
|
|
164
179
|
}
|
|
165
180
|
}
|
|
166
|
-
exports.replaceProductsInCart = replaceProductsInCart;
|
|
167
|
-
const addToCartAndProceed = async (newCartItem, siteSlug, flowName) => {
|
|
168
|
-
const cartItem = prepareItemForAddingToCart(newCartItem, flowName);
|
|
169
|
-
if (cartItem) {
|
|
170
|
-
debug('adding products to cart', cartItem);
|
|
171
|
-
const cartKey = await create_cart_manager_client_1.default.getCartKeyForSiteSlug(siteSlug);
|
|
172
|
-
try {
|
|
173
|
-
const updatedCart = await create_cart_manager_client_1.default
|
|
174
|
-
.forCartKey(cartKey)
|
|
175
|
-
.actions.addProductsToCart([cartItem]);
|
|
176
|
-
debug('product add request complete', updatedCart);
|
|
177
|
-
}
|
|
178
|
-
catch (error) {
|
|
179
|
-
debug('product add request had an error', error);
|
|
180
|
-
//TODO Manage error
|
|
181
|
-
// reduxStore.dispatch( errorNotice( error.message ) );
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
debug('no cart items to add');
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
181
|
async function addProductsToCart(siteSlug, flowName, cartItems) {
|
|
189
182
|
if (Array.isArray(cartItems)) {
|
|
190
183
|
const cartItemsToAdd = cartItems.map((cartItem) => prepareItemForAddingToCart(cartItem, flowName));
|
|
@@ -201,14 +194,13 @@ async function addProductsToCart(siteSlug, flowName, cartItems) {
|
|
|
201
194
|
}
|
|
202
195
|
}
|
|
203
196
|
}
|
|
204
|
-
exports.addProductsToCart = addProductsToCart;
|
|
205
197
|
async function setThemeOnSite(siteSlug, themeSlugWithRepo, themeStyleVariation) {
|
|
206
198
|
if ((0, lodash_1.isEmpty)(themeSlugWithRepo)) {
|
|
207
199
|
return;
|
|
208
200
|
}
|
|
209
201
|
const theme = themeSlugWithRepo.split('/')[1];
|
|
210
202
|
try {
|
|
211
|
-
await (0,
|
|
203
|
+
await (0, wpcom_request_1.default)({
|
|
212
204
|
path: `/sites/${siteSlug}/themes/mine`,
|
|
213
205
|
method: 'POST',
|
|
214
206
|
apiVersion: '1.1',
|
|
@@ -222,18 +214,4 @@ async function setThemeOnSite(siteSlug, themeSlugWithRepo, themeStyleVariation)
|
|
|
222
214
|
//TODO: Manage error
|
|
223
215
|
}
|
|
224
216
|
}
|
|
225
|
-
exports.setThemeOnSite = setThemeOnSite;
|
|
226
|
-
async function processItemCart(siteSlug, isFreeThemePreselected, themeSlugWithRepo, lastKnownFlow, userIsLoggedIn, newCartItem) {
|
|
227
|
-
if (!userIsLoggedIn && isFreeThemePreselected) {
|
|
228
|
-
await setThemeOnSite(siteSlug, themeSlugWithRepo);
|
|
229
|
-
newCartItem && (await addToCartAndProceed(newCartItem, siteSlug, lastKnownFlow));
|
|
230
|
-
}
|
|
231
|
-
else if (userIsLoggedIn && isFreeThemePreselected) {
|
|
232
|
-
await setThemeOnSite(siteSlug, themeSlugWithRepo);
|
|
233
|
-
newCartItem && (await addToCartAndProceed(newCartItem, siteSlug, lastKnownFlow));
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
newCartItem && (await addToCartAndProceed(newCartItem, siteSlug, lastKnownFlow));
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
217
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cart/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cart/index.tsx"],"names":[],"mappings":";;;AAyQA,sDAeC;AAED,8CAuBC;AAED,wCAwBC;;AA3UD,wFAAgD;A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,cAAc,CAAE,CAAC;YAE9C,KAAK,CAAE,8BAA8B,EAAE,WAAW,CAAE,CAAC;QACtD,CAAC;QAAC,OAAQ,KAAK,EAAG,CAAC;YAClB,KAAK,CAAE,kCAAkC,EAAE,KAAK,CAAE,CAAC;QACpD,CAAC;IACF,CAAC;AACF,CAAC;AAEM,KAAK,UAAU,cAAc,CACnC,QAAgB,EAChB,iBAAyB,EACzB,mBAA4B;IAE5B,IAAK,IAAA,gBAAO,EAAE,iBAAiB,CAAE,EAAG,CAAC;QACpC,OAAO;IACR,CAAC;IAED,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,CAAE,GAAG,CAAE,CAAE,CAAC,CAAE,CAAC;IAElD,IAAI,CAAC;QACJ,MAAM,IAAA,uBAAY,EAAE;YACnB,IAAI,EAAE,UAAW,QAAS,cAAc;YACxC,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,KAAK;YACjB,IAAI,EAAE;gBACL,KAAK;gBACL,GAAG,CAAE,mBAAmB,IAAI,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAE;aAC3E;SACD,CAAE,CAAC;IACL,CAAC;IAAC,OAAQ,KAAK,EAAG,CAAC;QAClB,oBAAoB;IACrB,CAAC;AACF,CAAC"}
|
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
4
|
/* eslint-disable wpcalypso/jsx-classname-namespace */
|
|
5
5
|
const components_1 = require("@wordpress/components");
|
|
6
|
-
const Index = ({ className }) => ((0, jsx_runtime_1.jsxs)(components_1.SVG, { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 356 136", role: "presentation", className: className, children: [(0, jsx_runtime_1.jsx)(components_1.Rect, { x: "314.913", y: "59.963", width: "7", height: "22", rx: "3.5", transform: "rotate(-50 314.913 59.963)", fill: "#984A9C" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { y: "121.876", width: "5.091", height: "16", rx: "2.545", transform: "rotate(-50 0 121.876)", fill: "#64CA43" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { x: "21.447", y: "85.104", width: "7", height: "22", rx: "3.5", transform: "rotate(-120 21.447 85.104)", fill: "#37E788" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { x: "75", y: "61.64", width: "4", height: "12.571", rx: "2", transform: "rotate(130 75 61.64)", fill: "#FF2D55" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { x: "247.461", y: "63.86", width: "4.773", height: "15", rx: "2.386", transform: "rotate(118 247.461 63.86)", fill: "#E7C037" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { x: "97", y: "2.529", width: "4.773", height: "15", rx: "2.386", transform: "rotate(-32 97 2.53)", fill: "
|
|
6
|
+
const Index = ({ className }) => ((0, jsx_runtime_1.jsxs)(components_1.SVG, { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 356 136", role: "presentation", className: className, children: [(0, jsx_runtime_1.jsx)(components_1.Rect, { x: "314.913", y: "59.963", width: "7", height: "22", rx: "3.5", transform: "rotate(-50 314.913 59.963)", fill: "#984A9C" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { y: "121.876", width: "5.091", height: "16", rx: "2.545", transform: "rotate(-50 0 121.876)", fill: "#64CA43" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { x: "21.447", y: "85.104", width: "7", height: "22", rx: "3.5", transform: "rotate(-120 21.447 85.104)", fill: "#37E788" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { x: "75", y: "61.64", width: "4", height: "12.571", rx: "2", transform: "rotate(130 75 61.64)", fill: "#FF2D55" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { x: "247.461", y: "63.86", width: "4.773", height: "15", rx: "2.386", transform: "rotate(118 247.461 63.86)", fill: "#E7C037" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { x: "97", y: "2.529", width: "4.773", height: "15", rx: "2.386", transform: "rotate(-32 97 2.53)", fill: "var(--studio-blue-50)" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { x: "323.638", y: "110.513", width: "5.091", height: "16", rx: "2.545", transform: "rotate(40 323.638 110.513)", fill: "#3361CC" }), (0, jsx_runtime_1.jsx)(components_1.Rect, { x: "160.138", y: "27", width: "7", height: "22", rx: "3.5", transform: "rotate(40 160.138 27)", fill: "#FF8085" }), (0, jsx_runtime_1.jsx)(components_1.Circle, { cx: "40.5", cy: "101.095", r: "4.5", fill: "#F0B849" }), (0, jsx_runtime_1.jsx)(components_1.Circle, { cx: "20.928", cy: "47.751", r: "3", fill: "#BF5AF2" }), (0, jsx_runtime_1.jsx)(components_1.Circle, { cx: "341", cy: "134", r: "2", fill: "#F0C930" }), (0, jsx_runtime_1.jsx)(components_1.Circle, { cx: "131", cy: "83", r: "2", fill: "#3361CC" }), (0, jsx_runtime_1.jsx)(components_1.Circle, { cx: "214.5", cy: "13.5", r: "2.5", fill: "#37E688" }), (0, jsx_runtime_1.jsx)(components_1.Circle, { cx: "352.763", cy: "98.263", r: "3", fill: "#009E73" }), (0, jsx_runtime_1.jsx)(components_1.Circle, { cx: "285.181", cy: "60.541", r: "3", fill: "#FF3B30" })] }));
|
|
7
7
|
exports.default = Index;
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/confetti/index.tsx"],"names":[],"mappings":";;;AAAA,sDAAsD;AAEtD,sDAA0D;AAG1D,MAAM,KAAK,GAAsD,CAAE,EAAE,SAAS,EAAE,EAAG,EAAE,CAAC,CACrF,wBAAC,gBAAG,IACH,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,aAAa,EACrB,IAAI,EAAC,cAAc,EACnB,SAAS,EAAG,SAAS,aAErB,uBAAC,iBAAI,IACJ,CAAC,EAAC,SAAS,EACX,CAAC,EAAC,QAAQ,EACV,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,EAAE,EAAC,KAAK,EACR,SAAS,EAAC,4BAA4B,EACtC,IAAI,EAAC,SAAS,GACb,EACF,uBAAC,iBAAI,IACJ,CAAC,EAAC,SAAS,EACX,KAAK,EAAC,OAAO,EACb,MAAM,EAAC,IAAI,EACX,EAAE,EAAC,OAAO,EACV,SAAS,EAAC,uBAAuB,EACjC,IAAI,EAAC,SAAS,GACb,EACF,uBAAC,iBAAI,IACJ,CAAC,EAAC,QAAQ,EACV,CAAC,EAAC,QAAQ,EACV,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,EAAE,EAAC,KAAK,EACR,SAAS,EAAC,4BAA4B,EACtC,IAAI,EAAC,SAAS,GACb,EACF,uBAAC,iBAAI,IACJ,CAAC,EAAC,IAAI,EACN,CAAC,EAAC,OAAO,EACT,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,QAAQ,EACf,EAAE,EAAC,GAAG,EACN,SAAS,EAAC,sBAAsB,EAChC,IAAI,EAAC,SAAS,GACb,EACF,uBAAC,iBAAI,IACJ,CAAC,EAAC,SAAS,EACX,CAAC,EAAC,OAAO,EACT,KAAK,EAAC,OAAO,EACb,MAAM,EAAC,IAAI,EACX,EAAE,EAAC,OAAO,EACV,SAAS,EAAC,2BAA2B,EACrC,IAAI,EAAC,SAAS,GACb,EACF,uBAAC,iBAAI,IACJ,CAAC,EAAC,IAAI,EACN,CAAC,EAAC,OAAO,EACT,KAAK,EAAC,OAAO,EACb,MAAM,EAAC,IAAI,EACX,EAAE,EAAC,OAAO,EACV,SAAS,EAAC,qBAAqB,EAC/B,IAAI,EAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/confetti/index.tsx"],"names":[],"mappings":";;;AAAA,sDAAsD;AAEtD,sDAA0D;AAG1D,MAAM,KAAK,GAAsD,CAAE,EAAE,SAAS,EAAE,EAAG,EAAE,CAAC,CACrF,wBAAC,gBAAG,IACH,IAAI,EAAC,MAAM,E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,CACN,CAAC;AAEF,kBAAe,KAAK,CAAC"}
|
|
@@ -13,63 +13,6 @@ const flows = {
|
|
|
13
13
|
subscribers: 4,
|
|
14
14
|
launchpad: 5,
|
|
15
15
|
},
|
|
16
|
-
[flows_1.LINK_IN_BIO_FLOW]: {
|
|
17
|
-
intro: 0,
|
|
18
|
-
user: 0,
|
|
19
|
-
patterns: 1,
|
|
20
|
-
linkInBioSetup: 2,
|
|
21
|
-
domains: 3,
|
|
22
|
-
plans: 4,
|
|
23
|
-
launchpad: 5,
|
|
24
|
-
},
|
|
25
|
-
[flows_1.LINK_IN_BIO_TLD_FLOW]: {
|
|
26
|
-
domains: 0,
|
|
27
|
-
user: 1,
|
|
28
|
-
patterns: 2,
|
|
29
|
-
linkInBioSetup: 3,
|
|
30
|
-
plans: 4,
|
|
31
|
-
launchpad: 5,
|
|
32
|
-
},
|
|
33
|
-
[flows_1.FREE_FLOW]: {
|
|
34
|
-
user: 0,
|
|
35
|
-
freeSetup: 0,
|
|
36
|
-
designSetup: 1,
|
|
37
|
-
launchpad: 2,
|
|
38
|
-
},
|
|
39
|
-
videopress: {
|
|
40
|
-
intro: 0,
|
|
41
|
-
videomakerSetup: 1,
|
|
42
|
-
user: 2,
|
|
43
|
-
options: 3,
|
|
44
|
-
chooseADomain: 4,
|
|
45
|
-
processing: 5,
|
|
46
|
-
launchpad: 6,
|
|
47
|
-
},
|
|
48
|
-
[flows_1.VIDEOPRESS_TV_FLOW]: {
|
|
49
|
-
intro: 0,
|
|
50
|
-
processing: 1,
|
|
51
|
-
},
|
|
52
|
-
[flows_1.VIDEOPRESS_TV_PURCHASE_FLOW]: {
|
|
53
|
-
processing: 0,
|
|
54
|
-
},
|
|
55
|
-
sensei: {
|
|
56
|
-
senseiSetup: 1,
|
|
57
|
-
senseiDomain: 2,
|
|
58
|
-
senseiPlan: 3,
|
|
59
|
-
senseiPurpose: 4,
|
|
60
|
-
senseiLaunch: 5,
|
|
61
|
-
},
|
|
62
|
-
[flows_1.ECOMMERCE_FLOW]: {
|
|
63
|
-
intro: 0,
|
|
64
|
-
storeProfiler: 1,
|
|
65
|
-
designCarousel: 2,
|
|
66
|
-
domains: 3,
|
|
67
|
-
createSite: 4,
|
|
68
|
-
processing: 4,
|
|
69
|
-
waitForAtomic: 4,
|
|
70
|
-
checkPlan: 4,
|
|
71
|
-
storeAddress: 5,
|
|
72
|
-
},
|
|
73
16
|
[flows_1.COPY_SITE_FLOW]: {
|
|
74
17
|
domains: 0,
|
|
75
18
|
'create-site': 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-flow-progress.js","sourceRoot":"","sources":["../../../src/flow-progress/use-flow-progress.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"use-flow-progress.js","sourceRoot":"","sources":["../../../src/flow-progress/use-flow-progress.ts"],"names":[],"mappings":";;;AAAA,0CAAgD;AAShD,MAAM,KAAK,GAAmD;IAC7D,UAAU,EAAE;QACX,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,CAAC;QAClB,eAAe,EAAE,CAAC;QAClB,OAAO,EAAE,CAAC;QACV,kBAAkB,EAAE,CAAC;QACrB,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,CAAC;KACZ;IACD,CAAE,sBAAc,CAAE,EAAE;QACnB,OAAO,EAAE,CAAC;QACV,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,CAAC;QACb,gBAAgB,EAAE,CAAC;QACnB,iBAAiB,EAAE,CAAC;KACpB;CACD,CAAC;AAEK,MAAM,eAAe,GAAG,CAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,KAAmB,EAAE,EAAG,EAAE;IAC3F,IAAK,CAAE,QAAQ,IAAI,CAAE,QAAQ,EAAG,CAAC;QAChC,OAAO;IACR,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAE,WAAW,IAAI,QAAQ,CAAE,CAAC;IAE9C,OAAO,CACN,IAAI,IAAI;QACP,QAAQ,EAAE,IAAI,CAAE,QAAQ,CAAE;QAC1B,KAAK,EAAE,IAAI,CAAC,GAAG,CAAE,GAAG,MAAM,CAAC,MAAM,CAAE,IAAI,CAAE,CAAE;KAC3C,CACD,CAAC;AACH,CAAC,CAAC;AAbW,QAAA,eAAe,mBAa1B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearStepPersistedState = clearStepPersistedState;
|
|
4
|
+
exports.useStepPersistedState = useStepPersistedState;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_router_1 = require("react-router");
|
|
7
|
+
const TWENTY_MINUTES = 20 * 60 * 1000;
|
|
8
|
+
const VERSION = 1;
|
|
9
|
+
const KEY = '@automattic/persisted-state';
|
|
10
|
+
function setPersistedState(key, state, storage) {
|
|
11
|
+
storage.setItem(key, JSON.stringify(state));
|
|
12
|
+
storage.setItem(key + 'time', Date.now().toString());
|
|
13
|
+
}
|
|
14
|
+
function getPersistedState(key, storage, TTL) {
|
|
15
|
+
const state = storage.getItem(key);
|
|
16
|
+
if (state) {
|
|
17
|
+
const time = parseInt(storage.getItem(key + 'time') || '0');
|
|
18
|
+
if (Date.now() - time > TTL) {
|
|
19
|
+
storage.removeItem(key);
|
|
20
|
+
storage.removeItem(key + 'time');
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return JSON.parse(state);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function getPersistedStateKey(flow, step, lang, cacheKey) {
|
|
28
|
+
return [VERSION, KEY, flow, step, lang, cacheKey].filter(Boolean).join('-');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Clears all persisted state created by useStepPersistedState
|
|
32
|
+
* @param flow The desired flow to clear
|
|
33
|
+
* @param storage The storage to clear (defaults to localStorage)
|
|
34
|
+
*/
|
|
35
|
+
function clearStepPersistedState(flow, storage = localStorage) {
|
|
36
|
+
const keys = Object.keys(storage);
|
|
37
|
+
const persistedKeys = keys.filter((key) => key.startsWith(getPersistedStateKey(flow)));
|
|
38
|
+
persistedKeys.forEach((key) => {
|
|
39
|
+
storage.removeItem(key);
|
|
40
|
+
storage.removeItem(key + 'time');
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A hook similar to useState, but persists the state. Uses `flow`, `step` and `lang`, and the passed key in the tree as keys.
|
|
45
|
+
* @param cacheKey the cache key. It will be concatenated with the flow, step and lang.
|
|
46
|
+
* @param defaultValue the initial value of the state.
|
|
47
|
+
* @param options the options for the hook.
|
|
48
|
+
* @returns a tuple with the state and a function to update it.
|
|
49
|
+
*/
|
|
50
|
+
function useStepPersistedState(cacheKey, defaultValue, options = { storage: localStorage, TTL: TWENTY_MINUTES }) {
|
|
51
|
+
const match = (0, react_router_1.useMatch)('/:flow/:step?/:lang?');
|
|
52
|
+
const { flow = 'flow', step = 'step', lang = 'lang' } = match?.params || {};
|
|
53
|
+
const key = [VERSION, KEY, flow, step, lang, cacheKey].join('-');
|
|
54
|
+
const [state, _setState] = (0, react_1.useState)(getPersistedState(key, options.storage, options.TTL) || defaultValue);
|
|
55
|
+
const setState = (0, react_1.useCallback)((newState) => {
|
|
56
|
+
_setState(newState);
|
|
57
|
+
setPersistedState(key, newState, options.storage);
|
|
58
|
+
}, [_setState, key, options.storage]);
|
|
59
|
+
return [state, setState];
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=use-persisted-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-persisted-state.js","sourceRoot":"","sources":["../../../src/hooks/use-persisted-state.ts"],"names":[],"mappings":";;AAkCA,0DAQC;AAoBD,sDAsBC;AApFD,iCAA8C;AAC9C,+CAAwC;AAExC,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACtC,MAAM,OAAO,GAAG,CAAC,C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AAC,OAAO,CAAE,CACnC,CAAC;IAEF,OAAO,CAAE,KAAK,EAAE,QAAQ,CAAE,CAAC;AAC5B,CAAC"}
|
package/dist/cjs/hooray/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
|
6
6
|
const confetti_1 = tslib_1.__importDefault(require("../confetti"));
|
|
7
7
|
require("./style.scss");
|
|
8
8
|
const Hooray = ({ className, animate = false, children, ...additionalProps }) => {
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)(
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)('onboarding-hooray', { 'onboarding-hooray__animate': animate }, className), ...additionalProps, children: [(0, jsx_runtime_1.jsx)(confetti_1.default, {}), children] }));
|
|
10
10
|
};
|
|
11
11
|
exports.default = Hooray;
|
|
12
12
|
//# sourceMappingURL=index.js.map
|