Update @automattic/tour-kit to 1.1.3 and @automattic/components to 2.1.1 (#47129)

* Use @automattic/tour-kit@1.1.3

* Update onPreviousStep and onNextStep callback

* Add changelog

* Add changelog

* Update @automattic/components

* Update package.json

* Fix pnpm-lock.yaml

* Update changelog

* Add changelog

* Enable autoScroll for shipping tour
This commit is contained in:
Chi-Hsuan Huang 2024-05-09 08:56:08 +08:00 committed by GitHub
parent 875d1a7f8e
commit f2cf6b56aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 650 additions and 427 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Update @automattic/tour-kit to 1.1.3

View File

@ -63,7 +63,7 @@
"dependencies": {
"@automattic/calypso-color-schemes": "^2.1.1",
"@automattic/interpolate-components": "^1.2.1",
"@automattic/tour-kit": "^1.1.1",
"@automattic/tour-kit": "^1.1.3",
"@types/wordpress__block-editor": "7.0.0",
"@types/wordpress__block-library": "2.6.1",
"@types/wordpress__blocks": "11.0.7",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Use @automattic/tour-kit@1.1.3

View File

@ -68,7 +68,7 @@
"watch:build:project:wp-scripts": "wireit"
},
"dependencies": {
"@automattic/tour-kit": "^1.1.1",
"@automattic/tour-kit": "^1.1.3",
"@emotion/react": "^11.11.1",
"@types/prop-types": "^15.7.11",
"@types/react-outside-click-handler": "^1.3.3",
@ -133,6 +133,7 @@
"node_modules/@woocommerce/eslint-plugin/rules",
"node_modules/@woocommerce/eslint-plugin/index.js",
"node_modules/@woocommerce/dependency-extraction-webpack-plugin/src/",
"node_modules/@woocommerce/dependency-extraction-webpack-plugin/assets/",
"node_modules/@woocommerce/tracks/build",
"node_modules/@woocommerce/tracks/build-module",
"node_modules/@woocommerce/tracks/build-types",

View File

@ -287,8 +287,8 @@ export const ProductTour = () => {
} );
}
},
onNextStepHandler: ( stepIndex ) => {
const stepName = tourConfig.steps[ stepIndex ].meta.name;
onNextStepHandler: ( newStepIndex ) => {
const stepName = tourConfig.steps[ newStepIndex - 1 ].meta.name;
// This records all "next" steps and ignores the final "publish" step.
recordEvent( 'walkthrough_product_step_completed', {

View File

@ -232,20 +232,21 @@ export const ShippingTour: React.FC< {
mutation: true,
resize: true,
},
autoScroll: true,
},
callbacks: {
onNextStep: ( currentStepIndex ) => {
setStepNumber( currentStepIndex + 1 );
onNextStep: ( newStepIndex ) => {
setStepNumber( newStepIndex );
recordEvent( 'walkthrough_settings_shipping_next_click', {
step_name:
tourConfig.steps[ currentStepIndex ].meta.name,
tourConfig.steps[ newStepIndex - 1 ].meta.name,
} );
},
onPreviousStep: ( currentStepIndex ) => {
setStepNumber( currentStepIndex - 1 );
onPreviousStep: ( newStepIndex ) => {
setStepNumber( newStepIndex );
recordEvent( 'walkthrough_settings_shipping_back_click', {
step_name:
tourConfig.steps[ currentStepIndex ].meta.name,
tourConfig.steps[ newStepIndex + 1 ].meta.name,
} );
},
},

View File

@ -101,8 +101,8 @@ const WCAddonsTour = () => {
}
};
const onNextStepHandler = ( previousStepIndex: number ) => {
const stepName = steps[ previousStepIndex + 1 ]?.meta?.name || '';
const onNextStepHandler = ( newStepIndex: number ) => {
const stepName = steps[ newStepIndex ]?.meta?.name || '';
recordEvent( 'in_app_marketplace_tour_step_viewed', {
step: stepName,
} );

View File

@ -42,7 +42,7 @@
]
},
"dependencies": {
"@automattic/components": "^2.0.1",
"@automattic/components": "^2.1.1",
"@automattic/explat-client": "^0.0.5",
"@automattic/explat-client-react-helpers": "^0.0.6",
"@automattic/interpolate-components": "^1.2.1",
@ -335,6 +335,7 @@
"node_modules/@woocommerce/eslint-plugin/rules",
"node_modules/@woocommerce/eslint-plugin/index.js",
"node_modules/@woocommerce/dependency-extraction-webpack-plugin/src/",
"node_modules/@woocommerce/dependency-extraction-webpack-plugin/assets/",
"node_modules/@woocommerce/date/build",
"node_modules/@woocommerce/date/build-module",
"node_modules/@woocommerce/date/build-types",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Update @automattic/tour-kit to 1.1.3 and @automattic/components to 2.1.1

File diff suppressed because it is too large Load Diff