2023-01-11 17:57:42 +00:00
|
|
|
import { makeT } from 'app/client/lib/localization';
|
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";
|
2022-09-06 01:51:57 +00:00
|
|
|
import { theme } from 'app/client/ui2018/cssVars';
|
2021-07-19 08:49:44 +00:00
|
|
|
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";
|
|
|
|
|
2023-01-11 17:57:42 +00:00
|
|
|
const t = makeT('WelcomeTour');
|
|
|
|
|
2021-07-19 08:49:44 +00:00
|
|
|
export const welcomeTour: IOnBoardingMsg[] = [
|
|
|
|
{
|
2023-01-11 17:57:42 +00:00
|
|
|
title: t('Editing Data'),
|
2021-07-19 08:49:44 +00:00
|
|
|
body: () => [
|
|
|
|
dom('p',
|
2023-01-11 17:57:42 +00:00
|
|
|
t('Double-click or hit {{enter}} on a cell to edit it. ', {enter: Key(KeyContent(t('Enter')))}),
|
|
|
|
t('Start with {{equal}} to enter a formula.', { equal: Key(KeyStrong('=')) }))
|
2021-07-19 08:49:44 +00:00
|
|
|
],
|
|
|
|
selector: '.field_clip',
|
|
|
|
placement: 'bottom',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-creator-panel',
|
2023-01-11 17:57:42 +00:00
|
|
|
title: t('Configuring your document'),
|
2021-07-19 08:49:44 +00:00
|
|
|
body: () => [
|
|
|
|
dom('p',
|
2023-01-11 17:57:42 +00:00
|
|
|
t('Toggle the {{creatorPanel}} to format columns, ', {creatorPanel: dom('em', t('creator panel'))}),
|
|
|
|
t('convert to card view, select data, and more.')
|
2021-07-19 08:49:44 +00:00
|
|
|
)
|
|
|
|
],
|
|
|
|
placement: 'left',
|
|
|
|
cropPadding: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-type-selector',
|
2023-01-11 17:57:42 +00:00
|
|
|
title: t('Customizing columns'),
|
2021-07-19 08:49:44 +00:00
|
|
|
body: () => [
|
|
|
|
dom('p',
|
2023-01-11 17:57:42 +00:00
|
|
|
t('Set formatting options, formulas, or column types, such as dates, choices, or attachments. ')),
|
2021-07-19 08:49:44 +00:00
|
|
|
dom('p',
|
2023-01-11 17:57:42 +00:00
|
|
|
t('Make it relational! Use the {{ref}} type to link tables. ', {ref: Key(t('Reference'))}),
|
2021-07-19 08:49:44 +00:00
|
|
|
)
|
|
|
|
],
|
|
|
|
placement: 'right',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-add-new',
|
2023-01-11 17:57:42 +00:00
|
|
|
title: t('Building up'),
|
2021-07-19 08:49:44 +00:00
|
|
|
body: () => [
|
2023-01-11 17:57:42 +00:00
|
|
|
dom('p', t('Use {{addNew}} to add widgets, pages, or import more data. ', {addNew: Key(t('Add New'))}))
|
2021-07-19 08:49:44 +00:00
|
|
|
],
|
|
|
|
placement: 'right',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-share-icon',
|
2023-01-11 17:57:42 +00:00
|
|
|
title: t('Sharing'),
|
2021-07-19 08:49:44 +00:00
|
|
|
body: () => [
|
2023-01-11 17:57:42 +00:00
|
|
|
dom('p', t('Use the Share button ({{share}}) to share the document or export data.',
|
2023-01-24 12:51:53 +00:00
|
|
|
{share: TopBarButtonIcon(t('Share'))}))
|
2021-07-19 08:49:44 +00:00
|
|
|
],
|
|
|
|
placement: 'bottom',
|
|
|
|
cropPadding: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-help-center',
|
2023-01-11 17:57:42 +00:00
|
|
|
title: t('Flying higher'),
|
2021-07-19 08:49:44 +00:00
|
|
|
body: () => [
|
2023-01-19 13:25:44 +00:00
|
|
|
dom('p', t('Use {{helpCenter}} for documentation or questions.',
|
2023-01-18 09:38:24 +00:00
|
|
|
{helpCenter: Key(GreyIcon('Help'), t('Help Center'))})),
|
2021-07-19 08:49:44 +00:00
|
|
|
],
|
|
|
|
placement: 'right',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
selector: '.tour-welcome',
|
2023-01-11 17:57:42 +00:00
|
|
|
title: t('Welcome to Grist!'),
|
2021-07-30 15:16:33 +00:00
|
|
|
body: () => [
|
2023-01-11 17:57:42 +00:00
|
|
|
dom('p', t("Browse our {{templateLibrary}} to discover what's possible and get inspired.",
|
|
|
|
{
|
|
|
|
templateLibrary: cssLink({ target: '_blank', href: urlState().makeUrl({ homePage: "templates" }) },
|
|
|
|
t('template library'), cssInlineIcon('FieldLink'))
|
|
|
|
}
|
|
|
|
)),
|
2021-07-30 15:16:33 +00:00
|
|
|
],
|
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;
|
2022-09-06 01:51:57 +00:00
|
|
|
color: ${theme.shortcutKeyPrimaryFg};
|
2021-07-19 08:49:44 +00:00
|
|
|
`);
|
|
|
|
|
|
|
|
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;
|
2022-09-06 01:51:57 +00:00
|
|
|
border: 1px solid ${theme.shortcutKeyBorder};
|
|
|
|
color: ${theme.shortcutKeyFg};
|
|
|
|
background-color: ${theme.shortcutKeyBg};
|
2021-07-19 08:49:44 +00:00
|
|
|
font-family: inherit;
|
|
|
|
font-style: normal;
|
|
|
|
white-space: nowrap;
|
|
|
|
`);
|
|
|
|
|
2022-09-06 01:51:57 +00:00
|
|
|
const TopBarButtonIcon = styled(icon, `
|
|
|
|
--icon-color: ${theme.topBarButtonPrimaryFg};
|
2021-07-19 08:49:44 +00:00
|
|
|
`);
|
2021-07-30 15:16:33 +00:00
|
|
|
|
|
|
|
const GreyIcon = styled(icon, `
|
2022-09-06 01:51:57 +00:00
|
|
|
--icon-color: ${theme.shortcutKeySecondaryFg};
|
2021-07-30 15:16:33 +00:00
|
|
|
margin-right: 8px;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssInlineIcon = styled(icon, `
|
|
|
|
margin: -3px 8px 0 4px;
|
|
|
|
`);
|