@@ -2,55 +2,71 @@ import { __ } from '@wordpress/i18n'
22import { i18n } from 'stackable'
33
44export const TOUR_STEPS = {
5- 'design-system-welcome' : [
6- {
7- title : '👋 ' + __ ( 'Welcome to Your Design System' , i18n ) ,
8- description : __ ( 'We\'re excited to have you here. Let\'s get you started by opening the Design Library. Click the button above to get started.' , i18n ) ,
9- size : 'medium' ,
10- anchor : '.interface-interface-skeleton__sidebar' ,
11- position : 'left' ,
12- // nextEventTarget: '.ugb-insert-library-button',
13- glowTarget : '.interface-interface-skeleton__sidebar' ,
5+ 'design-system-welcome' : {
6+ steps : [
7+ {
8+ title : '👋 ' + __ ( 'Welcome to Your Design System' , i18n ) ,
9+ description : __ ( 'We\'re excited to have you here. Let\'s get you started by opening the Design Library. Click the button above to get started.' , i18n ) ,
10+ size : 'medium' ,
11+ anchor : '.interface-interface-skeleton__sidebar' ,
12+ position : 'left' ,
13+ // nextEventTarget: '.ugb-insert-library-button',
14+ glowTarget : '.interface-interface-skeleton__sidebar' ,
1415 // showNext: false,
16+ } ,
17+ ] ,
18+ } ,
19+ 'editor-welcome' : {
20+ hasConfetti : false ,
21+ condition : ( ) => { // If provided, true will show the tour (even if it's already done), false will not show the tour, null will show the tour only once.
22+ // Do not show the tour if there is a GET parameter that shows another tour.
23+ return window ?. location ?. search ?. includes ( 'tour=' ) ? false : null
1524 } ,
16- ] ,
17- 'editor-welcome' : [
18- {
19- title : '👋 ' + __ ( 'Welcome to Stackable' , i18n ) ,
20- description : __ ( 'We\'re excited to have you here. Let\'s get you started by opening the Design Library. Click the button above to get started.' , i18n ) ,
21- // size: 'medium',
22- anchor : '.ugb-insert-library-button' ,
23- position : 'bottom' ,
24- nextEventTarget : '.ugb-insert-library-button' ,
25- glowTarget : '.ugb-insert-library-button' ,
26- showNext : false ,
25+ steps : [
26+ {
27+ title : '👋 ' + __ ( 'Welcome to Stackable' , i18n ) ,
28+ description : __ ( 'We\'re excited to have you here. Let\'s get you started by opening the Design Library. Click the button above to get started.' , i18n ) ,
29+ // size: 'medium',
30+ anchor : '.ugb-insert-library-button' ,
31+ position : 'bottom' ,
32+ nextEventTarget : '.ugb-insert-library-button' ,
33+ glowTarget : '.ugb-insert-library-button' ,
34+ showNext : false ,
35+ } ,
36+ ] ,
37+ } ,
38+ 'design-library-welcome' : {
39+ condition : ( ) => { // If provided, true will show the tour (even if it's already done), false will not show the tour, null will show the tour only once.
40+ // TODO: The new quick button in the getting started area should open the editor with `tour=design-library-welcome`
41+ // Force show the tour if there is a GET parameter tour=design-library-welcome
42+ return window ?. location ?. search ?. includes ( 'tour=design-library-welcome' ) ? true : null
2743 } ,
28- ] ,
29- 'design-library-welcome' : [
30- {
31- title : '👋 ' + __ ( 'Welcome to Your Design Library ', i18n ) ,
32- description : __ ( 'These are pre-built designs that are style-matched to your block theme. You can insert one or more patterns to quickly build your page.' , i18n ) ,
33- size : 'medium' ,
34- } ,
35- {
36- title : __ ( 'Pick Styling Options ' , i18n ) ,
37- description : __ ( 'Turn on backgrounds, change color schemes, to customize the library. Go ahead and click on "Section Background" and see your changes in real-time.' , i18n ) ,
38- anchor : '.ugb-modal-design-library__enable-background ' ,
39- position : 'right ' ,
40- nextEventTarget : '.ugb-modal-design-library__enable-background' ,
41- // ctaLabel: __( 'Enable Background', i18n ),
42- // ctaOnClick: () => {
43- // const element = document.querySelector( '.ugb-modal-design-library__enable-background .components-form-toggle__input' )
44- // element?.click()
45- // } ,
46- glowTarget : '.ugb-modal-design-library__enable-background' ,
47- // showNext: false ,
48- } ,
49- {
50- title : __ ( 'Patterns and Full-Pages ' , i18n ) ,
51- description : __ ( 'Click here to switch between patterns and full-page layouts.' , i18n ) ,
52- anchor : '.ugb-modal-design-library .components-modal__header ' ,
53- position : 'bottom' ,
54- } ,
55- ] ,
44+ steps : [
45+ {
46+ title : '👋 ' + __ ( 'Welcome to Your Design Library' , i18n ) ,
47+ description : __ ( 'These are pre-built designs that are style-matched to your block theme. You can insert one or more patterns to quickly build your page. ', i18n ) ,
48+ size : 'medium' ,
49+ } ,
50+ {
51+ title : __ ( 'Pick Styling Options' , i18n ) ,
52+ description : __ ( 'Turn on backgrounds, change color schemes, to customize the library. Go ahead and click on "Section Background" and see your changes in real-time. ' , i18n ) ,
53+ anchor : '.ugb-modal-design-library__enable-background' ,
54+ position : 'right ' ,
55+ nextEventTarget : '.ugb-modal-design-library__enable-background ' ,
56+ // ctaLabel: __( 'Enable Background', i18n ) ,
57+ // ctaOnClick: () => {
58+ // const element = document.querySelector( '.ugb-modal-design-library__enable-background .components-form-toggle__input' )
59+ // element?.click( )
60+ // },
61+ glowTarget : '.ugb-modal-design-library__enable-background' ,
62+ // showNext: false ,
63+ } ,
64+ {
65+ title : __ ( 'Patterns and Full-Pages' , i18n ) ,
66+ description : __ ( 'Click here to switch between patterns and full-page layouts. ' , i18n ) ,
67+ anchor : '.ugb-modal-design-library .components-modal__header' ,
68+ position : 'bottom ' ,
69+ } ,
70+ ] ,
71+ } ,
5672}
0 commit comments