PluginProbe
Extendify / 3.0.6
Extendify v3.0.6
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Agent / tours / site-assistant.js

site-assistant.js in Extendify 3.0.6, at src/Agent/tours/site-assistant.js

140 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __, isRTL } from '@wordpress/i18n';
2
3 export default {
4 id: 'site-assistant-tour',
5 title: __('Site Assistant', 'extendify-local'),
6 message: __('Tour the Site Assistant', 'extendify-local'),
7 settings: {
8 allowOverflow: false,
9 startFrom: [
10 `${window.extSharedData.adminUrl}admin.php?page=extendify-assist#dashboard`,
11 ],
12 },
13 steps: [
14 {
15 title: __('Tasks', 'extendify-local'),
16 text: __(
17 "Now that you've created your starter site, make it your own with these follow up tasks.",
18 'extendify-local',
19 ),
20 showOnlyIf: () => document.getElementById('assist-tasks-module'),
21 attachTo: {
22 element: '#assist-tasks-module',
23 offset: {
24 marginTop: window.innerWidth <= 1151 ? -15 : 2,
25 marginLeft: window.innerWidth <= 1151 ? -25 : 15,
26 },
27 position: {
28 x: isRTL() ? 'left' : 'right',
29 y: 'top',
30 },
31 hook: isRTL() ? 'top right' : 'top left',
32 },
33 events: {},
34 },
35 {
36 title: __('Quick Links', 'extendify-local'),
37 text: __(
38 'Easily access some of the most common items in WordPress with these quick links.',
39 'extendify-local',
40 ),
41 attachTo: {
42 element: '#assist-quick-links-module',
43 offset: {
44 marginTop: window.innerWidth <= 1151 ? -15 : 2,
45 marginLeft: window.innerWidth <= 1151 ? -25 : 15,
46 },
47 position: {
48 x: isRTL() ? 'left' : 'right',
49 y: 'top',
50 },
51 hook: isRTL() ? 'top right' : 'top left',
52 },
53 events: {
54 onAttach: () => {},
55 },
56 },
57 {
58 title: __('Website Tools & Plugins', 'extendify-local'),
59 text: __(
60 'See our personalized recommendations for you that will help you accomplish your goals.',
61 'extendify-local',
62 ),
63 showOnlyIf: () =>
64 document.querySelector('#assist-recommendations-module'),
65 attachTo: {
66 element: '#assist-recommendations-module',
67 offset: {
68 marginTop: window.innerWidth <= 1151 ? -15 : 2,
69 marginLeft: window.innerWidth <= 1151 ? -25 : 15,
70 },
71 position: {
72 x: isRTL() ? 'left' : 'right',
73 y: 'top',
74 },
75 hook: isRTL() ? 'top right' : 'top left',
76 },
77 events: {},
78 },
79 {
80 title: __('Visit your site', 'extendify-local'),
81 text: __(
82 'You can always visit your site by clicking this button.',
83 'extendify-local',
84 ),
85 attachTo: {
86 element: '#assist-menu-bar',
87 offset: {
88 marginTop: 20,
89 marginLeft: isRTL() ? 5 : -5,
90 },
91 position: {
92 x: isRTL() ? 'right' : 'left',
93 y: 'bottom',
94 },
95 hook: isRTL() ? 'top right' : 'top left',
96 boxPadding: {
97 top: 5,
98 bottom: 5,
99 left: 5,
100 right: 5,
101 },
102 },
103 events: {},
104 },
105 {
106 title: __('Site Assistant', 'extendify-local'),
107 text: __(
108 'Come back to the Site Assistant any time by clicking the menu item.',
109 'extendify-local',
110 ),
111 attachTo: {
112 element: '#toplevel_page_extendify-assist',
113 offset: {
114 marginTop: 0,
115 marginLeft: isRTL() ? -15 : 15,
116 },
117 position: {
118 x: isRTL() ? 'left' : 'right',
119 y: 'top',
120 },
121 hook: isRTL() ? 'top right' : 'top left',
122 },
123 events: {
124 onAttach: () => {
125 if (document.body.classList.contains('folded')) {
126 document.body.classList.remove('folded');
127 document.body.classList.add('temp-open');
128 }
129 },
130 onDetach: () => {
131 if (document.body.classList.contains('temp-open')) {
132 document.body.classList.remove('temp-open');
133 document.body.classList.add('folded');
134 }
135 },
136 },
137 },
138 ],
139 };
140