2021-07-30 15:16:33 +00:00
|
|
|
import * as commands from 'app/client/components/commands';
|
|
|
|
import { urlState } from 'app/client/models/gristUrlState';
|
2021-07-19 08:49:44 +00:00
|
|
|
import { IOnBoardingMsg, startOnBoarding } from "app/client/ui/OnBoardingPopups";
|
|
|
|
import { colors } from 'app/client/ui2018/cssVars';
|
|
|
|
import { icon } from "app/client/ui2018/icons";
|
2021-07-30 15:16:33 +00:00
|
|
|
import { cssLink } from "app/client/ui2018/links";
|
2021-07-19 08:49:44 +00:00
|
|
|
import { dom, styled } from "grainjs";
|
|
|
|
|
|
|
|
export const welcomeTour: IOnBoardingMsg[] = [
|
|
|
|
{
|
|
|
|
title: 'Editing Data',
|
|
|
|
body: () => [
|
|
|
|
dom('p',
|
|
|
|
'Double-click or hit ', Key(KeyContent('Enter')), ' on a cell to edit it. ',
|
|
|
|
'Start with ', Key(KeyStrong('=')), ' to enter a formula.'
|
|
|
|
)
|
|
|
|
],
|
|
|
|
selector: '.field_clip',
|
|
|
|
placement: 'bottom',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-creator-panel',
|
|
|
|
title: 'Configuring your document',
|
|
|
|
body: () => [
|
|
|
|
dom('p',
|
|
|
|
'Toggle the ', dom('em', 'creator panel'), ' to format columns, ',
|
|
|
|
'convert to card view, select data, and more.'
|
|
|
|
)
|
|
|
|
],
|
|
|
|
placement: 'left',
|
|
|
|
cropPadding: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-type-selector',
|
|
|
|
title: 'Customizing columns',
|
|
|
|
body: () => [
|
|
|
|
dom('p',
|
|
|
|
'Set formatting options, formulas, or column types, such as dates, choices, or attachments. '),
|
|
|
|
dom('p',
|
|
|
|
'Make it relational! Use the ', Key('Reference'), ' type to link tables. '
|
|
|
|
)
|
|
|
|
],
|
|
|
|
placement: 'right',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-add-new',
|
|
|
|
title: 'Building up',
|
|
|
|
body: () => [
|
|
|
|
dom('p', 'Use ', Key('Add New'), ' to add widgets, pages, or import more data. ')
|
|
|
|
],
|
|
|
|
placement: 'right',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-share-icon',
|
|
|
|
title: 'Sharing',
|
|
|
|
body: () => [
|
|
|
|
dom('p', 'Use the Share button (', Icon('Share'), ') to share the document or export data.')
|
|
|
|
],
|
|
|
|
placement: 'bottom',
|
|
|
|
cropPadding: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-help-center',
|
2021-07-30 15:16:33 +00:00
|
|
|
title: 'Flying higher',
|
2021-07-19 08:49:44 +00:00
|
|
|
body: () => [
|
2021-07-30 15:16:33 +00:00
|
|
|
dom('p', 'Use ', Key(GreyIcon('Help'), 'Help Center'), ' for documentation, videos, and tutorials.'),
|
|
|
|
dom('p', 'Use ', Key(GreyIcon('Feedback'), 'Give Feedback'), ' for issues or questions.'),
|
2021-07-19 08:49:44 +00:00
|
|
|
],
|
|
|
|
placement: 'right',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-welcome',
|
|
|
|
title: 'Welcome to Grist!',
|
2021-07-30 15:16:33 +00:00
|
|
|
body: () => [
|
|
|
|
dom('p', 'Browse our ',
|
|
|
|
cssLink({target: '_blank', href: urlState().makeUrl({homePage: "templates"})},
|
|
|
|
'template library', cssInlineIcon('FieldLink')),
|
|
|
|
"to discover what's possible and get inspired."
|
|
|
|
),
|
|
|
|
],
|
2021-07-19 08:49:44 +00:00
|
|
|
showHasModal: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
export function startWelcomeTour(onFinishCB: () => void) {
|
2021-07-30 15:16:33 +00:00
|
|
|
commands.allCommands.fieldTabOpen.run();
|
2021-07-19 08:49:44 +00:00
|
|
|
startOnBoarding(welcomeTour, onFinishCB);
|
|
|
|
}
|
|
|
|
|
|
|
|
const KeyContent = styled('span', `
|
|
|
|
font-style: normal;
|
|
|
|
font-family: inherit;
|
|
|
|
color: ${colors.darkGreen};
|
|
|
|
`);
|
|
|
|
|
|
|
|
const KeyStrong = styled(KeyContent, `
|
|
|
|
font-weight: 700;
|
|
|
|
`);
|
|
|
|
|
2021-07-30 15:16:33 +00:00
|
|
|
const Key = styled('div', `
|
|
|
|
display: inline-block;
|
2021-07-19 08:49:44 +00:00
|
|
|
padding: 2px 5px;
|
|
|
|
border-radius: 4px;
|
|
|
|
margin: 0px 2px;
|
|
|
|
border: 1px solid ${colors.slate};
|
|
|
|
color: black;
|
|
|
|
background-color: white;
|
|
|
|
font-family: inherit;
|
|
|
|
font-style: normal;
|
|
|
|
white-space: nowrap;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const Icon = styled(icon, `
|
|
|
|
--icon-color: ${colors.lightGreen};
|
|
|
|
`);
|
2021-07-30 15:16:33 +00:00
|
|
|
|
|
|
|
const GreyIcon = styled(icon, `
|
|
|
|
--icon-color: ${colors.slate};
|
|
|
|
margin-right: 8px;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssInlineIcon = styled(icon, `
|
|
|
|
margin: -3px 8px 0 4px;
|
|
|
|
`);
|