mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add initial tutorials implementation
Summary: Documents can now be flagged as tutorials, which causes them to display Markdown-formatted slides from a special GristDocTutorial table. Tutorial documents are forked on open, and remember the last slide a user was on. They can be restarted too, which prepares a new fork of the tutorial. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3813
This commit is contained in:
@@ -79,8 +79,10 @@ export type IconName = "ChartArea" |
|
||||
"Lock" |
|
||||
"Log" |
|
||||
"Mail" |
|
||||
"Maximize" |
|
||||
"Memo" |
|
||||
"Message" |
|
||||
"Minimize" |
|
||||
"Minus" |
|
||||
"MobileChat" |
|
||||
"MobileChat2" |
|
||||
@@ -214,8 +216,10 @@ export const IconList: IconName[] = ["ChartArea",
|
||||
"Lock",
|
||||
"Log",
|
||||
"Mail",
|
||||
"Maximize",
|
||||
"Memo",
|
||||
"Message",
|
||||
"Minimize",
|
||||
"Minus",
|
||||
"MobileChat",
|
||||
"MobileChat2",
|
||||
|
||||
@@ -94,6 +94,7 @@ export function docBreadcrumbs(
|
||||
isDocNameReadOnly?: BindableValue<boolean>,
|
||||
isPageNameReadOnly?: BindableValue<boolean>,
|
||||
isFork: Observable<boolean>,
|
||||
isTutorialFork: Observable<boolean>,
|
||||
isBareFork: Observable<boolean>,
|
||||
isFiddle: Observable<boolean>,
|
||||
isRecoveryMode: Observable<boolean>,
|
||||
@@ -140,7 +141,7 @@ export function docBreadcrumbs(
|
||||
if (options.isSnapshot && use(options.isSnapshot)) {
|
||||
return cssTag(t("snapshot"), testId('snapshot-tag'));
|
||||
}
|
||||
if (use(options.isFork)) {
|
||||
if (use(options.isFork) && !use(options.isTutorialFork)) {
|
||||
return cssTag(t("unsaved"), testId('unsaved-tag'));
|
||||
}
|
||||
if (use(options.isRecoveryMode)) {
|
||||
|
||||
@@ -694,6 +694,13 @@ export const theme = {
|
||||
colors.mediumGreyOpaque),
|
||||
datePickerRangeBgHover: new CustomProp('theme-date-picker-range-bg-hover', undefined,
|
||||
colors.darkGrey),
|
||||
|
||||
/* Tutorials */
|
||||
tutorialsPopupBorder: new CustomProp('theme-tutorials-popup-border', undefined,
|
||||
colors.darkGrey),
|
||||
tutorialsPopupHeaderFg: new CustomProp('theme-tutorials-popup-header-fg', undefined,
|
||||
colors.lightGreen),
|
||||
tutorialsPopupBoxBg: new CustomProp('theme-tutorials-popup-box-bg', undefined, '#F5F5F5'),
|
||||
};
|
||||
|
||||
const cssColors = values(colors).map(v => v.decl()).join('\n');
|
||||
|
||||
Reference in New Issue
Block a user