2023-03-22 13:48:50 +00:00
|
|
|
import {GristDoc} from 'app/client/components/GristDoc';
|
2024-07-22 15:10:57 +00:00
|
|
|
import {makeT} from 'app/client/lib/localization';
|
2023-07-04 21:21:34 +00:00
|
|
|
import {logTelemetryEvent} from 'app/client/lib/telemetry';
|
2023-05-01 18:24:23 +00:00
|
|
|
import {getWelcomeHomeUrl, urlState} from 'app/client/models/gristUrlState';
|
2023-03-22 13:48:50 +00:00
|
|
|
import {renderer} from 'app/client/ui/DocTutorialRenderer';
|
2023-07-13 14:00:56 +00:00
|
|
|
import {cssPopupBody, FLOATING_POPUP_TOOLTIP_KEY, FloatingPopup} from 'app/client/ui/FloatingPopup';
|
2024-08-23 03:51:09 +00:00
|
|
|
import {sanitizeTutorialHTML} from 'app/client/ui/sanitizeHTML';
|
2023-04-20 13:07:45 +00:00
|
|
|
import {hoverTooltip, setHoverTooltip} from 'app/client/ui/tooltips';
|
2024-07-22 15:10:57 +00:00
|
|
|
import {basicButton, primaryButton, textButton} from 'app/client/ui2018/buttons';
|
2023-04-20 13:07:45 +00:00
|
|
|
import {mediaXSmall, theme, vars} from 'app/client/ui2018/cssVars';
|
2023-03-22 13:48:50 +00:00
|
|
|
import {icon} from 'app/client/ui2018/icons';
|
|
|
|
import {loadingSpinner} from 'app/client/ui2018/loaders';
|
|
|
|
import {confirmModal, modal} from 'app/client/ui2018/modals';
|
|
|
|
import {parseUrlId} from 'app/common/gristUrls';
|
2023-03-23 18:22:28 +00:00
|
|
|
import {dom, makeTestId, Observable, styled} from 'grainjs';
|
2024-08-23 03:51:09 +00:00
|
|
|
import {marked, Token} from 'marked';
|
2023-03-22 13:48:50 +00:00
|
|
|
import debounce = require('lodash/debounce');
|
|
|
|
import range = require('lodash/range');
|
|
|
|
import sortBy = require('lodash/sortBy');
|
|
|
|
|
|
|
|
interface DocTutorialSlide {
|
|
|
|
slideContent: string;
|
|
|
|
boxContent?: string;
|
|
|
|
slideTitle?: string;
|
|
|
|
imageUrls: string[];
|
|
|
|
}
|
|
|
|
|
2024-07-22 15:10:57 +00:00
|
|
|
const t = makeT('DocTutorial');
|
|
|
|
|
2023-03-22 13:48:50 +00:00
|
|
|
const testId = makeTestId('test-doc-tutorial-');
|
|
|
|
|
2023-03-23 18:22:28 +00:00
|
|
|
export class DocTutorial extends FloatingPopup {
|
2023-03-22 13:48:50 +00:00
|
|
|
private _appModel = this._gristDoc.docPageModel.appModel;
|
|
|
|
private _currentDoc = this._gristDoc.docPageModel.currentDoc.get();
|
2023-07-04 21:21:34 +00:00
|
|
|
private _currentFork = this._currentDoc?.forks?.[0];
|
2023-03-22 13:48:50 +00:00
|
|
|
private _docComm = this._gristDoc.docComm;
|
|
|
|
private _docData = this._gristDoc.docData;
|
|
|
|
private _docId = this._gristDoc.docId();
|
|
|
|
private _slides: Observable<DocTutorialSlide[] | null> = Observable.create(this, null);
|
2023-07-04 21:21:34 +00:00
|
|
|
private _currentSlideIndex = Observable.create(this, this._currentFork?.options?.tutorial?.lastSlideIndex ?? 0);
|
2024-07-22 15:10:57 +00:00
|
|
|
private _percentComplete = this._currentFork?.options?.tutorial?.percentComplete;
|
2023-03-22 13:48:50 +00:00
|
|
|
|
2024-07-22 15:10:57 +00:00
|
|
|
private _saveProgressDebounced = debounce(this._saveProgress, 1000, {
|
|
|
|
// Save progress immediately if at least 1 second has passed since the last change.
|
2023-03-22 13:48:50 +00:00
|
|
|
leading: true,
|
2024-07-22 15:10:57 +00:00
|
|
|
// Otherwise, wait 1 second before saving.
|
2023-03-22 13:48:50 +00:00
|
|
|
trailing: true
|
|
|
|
});
|
|
|
|
|
|
|
|
constructor(private _gristDoc: GristDoc) {
|
2023-07-13 14:00:56 +00:00
|
|
|
super({
|
|
|
|
minimizable: true,
|
|
|
|
stopClickPropagationOnMove: true,
|
|
|
|
});
|
2024-07-22 15:10:57 +00:00
|
|
|
|
|
|
|
this.autoDispose(this._currentSlideIndex.addListener((slideIndex) => {
|
|
|
|
const numSlides = this._slides.get()?.length ?? 0;
|
|
|
|
if (numSlides > 0) {
|
|
|
|
this._percentComplete = Math.max(
|
|
|
|
Math.floor((slideIndex / numSlides) * 100),
|
|
|
|
this._percentComplete ?? 0
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
this._percentComplete = undefined;
|
|
|
|
}
|
|
|
|
}));
|
2023-03-23 18:22:28 +00:00
|
|
|
}
|
2023-03-22 13:48:50 +00:00
|
|
|
|
2023-03-23 18:22:28 +00:00
|
|
|
public async start() {
|
|
|
|
this.showPopup();
|
|
|
|
await this._loadSlides();
|
2023-06-22 13:31:29 +00:00
|
|
|
|
|
|
|
const tableData = this._docData.getTable('GristDocTutorial');
|
|
|
|
if (tableData) {
|
|
|
|
this.autoDispose(tableData.tableActionEmitter.addListener(() => this._reloadSlides()));
|
|
|
|
}
|
2023-11-01 13:54:19 +00:00
|
|
|
|
|
|
|
this._logTelemetryEvent('tutorialOpened');
|
2023-03-23 18:22:28 +00:00
|
|
|
}
|
2023-03-22 13:48:50 +00:00
|
|
|
|
2023-03-23 18:22:28 +00:00
|
|
|
protected _buildTitle() {
|
|
|
|
return dom('span', dom.text(this._gristDoc.docPageModel.currentDocTitle), testId('popup-header'));
|
|
|
|
}
|
2023-03-22 13:48:50 +00:00
|
|
|
|
2023-03-23 18:22:28 +00:00
|
|
|
protected _buildContent() {
|
|
|
|
return [
|
|
|
|
dom.domComputed(use => {
|
|
|
|
const slides = use(this._slides);
|
|
|
|
const slideIndex = use(this._currentSlideIndex);
|
|
|
|
const slide = slides?.[slideIndex];
|
|
|
|
return cssPopupBody(
|
|
|
|
!slide ? cssSpinner(loadingSpinner()) : [
|
|
|
|
dom('div', elem => {
|
|
|
|
elem.innerHTML = slide.slideContent;
|
|
|
|
}),
|
|
|
|
!slide.boxContent ? null : cssTryItOutBox(
|
|
|
|
dom('div', elem => { elem.innerHTML = slide.boxContent!; }),
|
|
|
|
),
|
|
|
|
dom.on('click', (ev) => {
|
|
|
|
if((ev.target as HTMLElement).tagName !== 'IMG') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this._openLightbox((ev.target as HTMLImageElement).src);
|
|
|
|
}),
|
2023-04-20 13:07:45 +00:00
|
|
|
this._initializeImages(),
|
2023-03-23 18:22:28 +00:00
|
|
|
],
|
|
|
|
testId('popup-body'),
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
cssPopupFooter(
|
|
|
|
dom.domComputed(use => {
|
|
|
|
const slides = use(this._slides);
|
|
|
|
if (!slides) { return null; }
|
|
|
|
|
|
|
|
const slideIndex = use(this._currentSlideIndex);
|
|
|
|
const numSlides = slides.length;
|
|
|
|
const isFirstSlide = slideIndex === 0;
|
|
|
|
const isLastSlide = slideIndex === numSlides - 1;
|
|
|
|
return [
|
|
|
|
cssProgressBar(
|
|
|
|
range(slides.length).map((i) => cssProgressBarDot(
|
2023-04-20 13:07:45 +00:00
|
|
|
hoverTooltip(slides[i].slideTitle, {
|
|
|
|
closeOnClick: false,
|
2023-07-13 14:00:56 +00:00
|
|
|
key: FLOATING_POPUP_TOOLTIP_KEY,
|
2023-04-20 13:07:45 +00:00
|
|
|
}),
|
2023-03-23 18:22:28 +00:00
|
|
|
cssProgressBarDot.cls('-current', i === slideIndex),
|
|
|
|
i === slideIndex ? null : dom.on('click', () => this._changeSlide(i)),
|
|
|
|
testId(`popup-slide-${i + 1}`),
|
|
|
|
)),
|
|
|
|
),
|
2024-07-22 15:10:57 +00:00
|
|
|
cssFooterButtons(
|
|
|
|
basicButton(t('Previous'),
|
2023-03-23 18:22:28 +00:00
|
|
|
dom.on('click', async () => {
|
|
|
|
await this._previousSlide();
|
|
|
|
}),
|
|
|
|
{style: `visibility: ${isFirstSlide ? 'hidden' : 'visible'}`},
|
|
|
|
testId('popup-previous'),
|
|
|
|
),
|
2024-07-22 15:10:57 +00:00
|
|
|
primaryButton(isLastSlide ? t('Finish'): t('Next'),
|
2023-03-23 18:22:28 +00:00
|
|
|
isLastSlide
|
2024-07-22 15:10:57 +00:00
|
|
|
? dom.on('click', async () => await this._exitTutorial(true))
|
2023-03-23 18:22:28 +00:00
|
|
|
: dom.on('click', async () => await this._nextSlide()),
|
|
|
|
testId('popup-next'),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
];
|
|
|
|
}),
|
|
|
|
testId('popup-footer'),
|
|
|
|
),
|
2024-07-22 15:10:57 +00:00
|
|
|
cssTutorialControls(
|
|
|
|
cssTextButton(
|
|
|
|
cssRestartIcon('Undo'),
|
|
|
|
t('Restart'),
|
|
|
|
dom.on('click', () => this._restartTutorial()),
|
|
|
|
testId('popup-restart'),
|
|
|
|
),
|
|
|
|
cssButtonsSeparator(),
|
|
|
|
cssTextButton(
|
|
|
|
cssSkipIcon('Skip'),
|
|
|
|
t('End tutorial'),
|
|
|
|
dom.on('click', () => this._exitTutorial()),
|
|
|
|
testId('popup-end-tutorial'),
|
|
|
|
),
|
|
|
|
),
|
2023-03-23 18:22:28 +00:00
|
|
|
];
|
2023-03-22 13:48:50 +00:00
|
|
|
}
|
|
|
|
|
2023-03-23 18:22:28 +00:00
|
|
|
protected _buildArgs() {
|
|
|
|
return [
|
|
|
|
dom.cls('doc-tutorial-popup'),
|
|
|
|
testId('popup'),
|
|
|
|
// Pre-fetch images from all slides and store them in a hidden div.
|
|
|
|
dom.maybe(this._slides, slides =>
|
|
|
|
dom('div',
|
|
|
|
{style: 'display: none;'},
|
|
|
|
dom.forEach(slides, slide => {
|
|
|
|
if (slide.imageUrls.length === 0) { return null; }
|
|
|
|
return dom('div', slide.imageUrls.map(src => dom('img', {src})));
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
];
|
2023-03-22 13:48:50 +00:00
|
|
|
}
|
|
|
|
|
2023-11-01 13:54:19 +00:00
|
|
|
private _logTelemetryEvent(event: 'tutorialOpened' | 'tutorialProgressChanged') {
|
|
|
|
logTelemetryEvent(event, {
|
|
|
|
full: {
|
|
|
|
tutorialForkIdDigest: this._currentFork?.id,
|
|
|
|
tutorialTrunkIdDigest: this._currentFork?.trunkId,
|
2024-07-22 15:10:57 +00:00
|
|
|
lastSlideIndex: this._currentSlideIndex.get(),
|
|
|
|
numSlides: this._slides.get()?.length,
|
|
|
|
percentComplete: this._percentComplete,
|
2023-11-01 13:54:19 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-03-22 13:48:50 +00:00
|
|
|
private async _loadSlides() {
|
|
|
|
const tableId = 'GristDocTutorial';
|
|
|
|
if (!this._docData.getTable(tableId)) {
|
|
|
|
throw new Error('DocTutorial failed to find table GristDocTutorial');
|
|
|
|
}
|
|
|
|
|
|
|
|
await this._docComm.waitForInitialization();
|
|
|
|
if (this.isDisposed()) { return; }
|
|
|
|
|
|
|
|
await this._docData.fetchTable(tableId);
|
|
|
|
if (this.isDisposed()) { return; }
|
|
|
|
|
|
|
|
const tableData = this._docData.getTable(tableId)!;
|
|
|
|
const slides = (await Promise.all(
|
|
|
|
sortBy(tableData.getRowIds(), tableData.getRowPropFunc('manualSort') as any)
|
|
|
|
.map(async rowId => {
|
|
|
|
let slideTitle: string | undefined;
|
|
|
|
const imageUrls: string[] = [];
|
|
|
|
|
|
|
|
const getValue = (colId: string): string | undefined => {
|
|
|
|
const value = tableData.getValue(rowId, colId);
|
|
|
|
return value ? String(value) : undefined;
|
|
|
|
};
|
|
|
|
|
2024-08-23 03:51:09 +00:00
|
|
|
const walkTokens = (token: Token) => {
|
2023-03-22 13:48:50 +00:00
|
|
|
if (token.type === 'image') {
|
|
|
|
imageUrls.push(token.href);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!slideTitle && token.type === 'heading' && token.depth === 1) {
|
|
|
|
slideTitle = token.text;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
let slideContent = getValue('slide_content');
|
|
|
|
if (!slideContent) { return null; }
|
2024-08-23 03:51:09 +00:00
|
|
|
slideContent = sanitizeTutorialHTML(await marked.parse(slideContent, {
|
2023-03-22 13:48:50 +00:00
|
|
|
async: true, renderer, walkTokens
|
|
|
|
}));
|
|
|
|
|
|
|
|
let boxContent = getValue('box_content');
|
|
|
|
if (boxContent) {
|
2024-08-23 03:51:09 +00:00
|
|
|
boxContent = sanitizeTutorialHTML(await marked.parse(boxContent, {
|
2023-03-22 13:48:50 +00:00
|
|
|
async: true, renderer, walkTokens
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
slideContent,
|
|
|
|
boxContent,
|
|
|
|
slideTitle,
|
|
|
|
imageUrls,
|
|
|
|
};
|
|
|
|
})
|
|
|
|
)).filter(slide => slide !== null) as DocTutorialSlide[];
|
|
|
|
if (this.isDisposed()) { return; }
|
|
|
|
|
|
|
|
if (slides.length === 0) {
|
|
|
|
throw new Error('DocTutorial failed to find slides in table GristDocTutorial');
|
|
|
|
}
|
|
|
|
|
|
|
|
this._slides.set(slides);
|
|
|
|
}
|
|
|
|
|
2023-06-22 13:31:29 +00:00
|
|
|
private async _reloadSlides() {
|
|
|
|
await this._loadSlides();
|
|
|
|
const slides = this._slides.get();
|
|
|
|
if (!slides) { return; }
|
|
|
|
|
|
|
|
if (this._currentSlideIndex.get() > slides.length - 1) {
|
|
|
|
this._currentSlideIndex.set(slides.length - 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-22 15:10:57 +00:00
|
|
|
private async _saveProgress() {
|
2023-03-22 13:48:50 +00:00
|
|
|
await this._appModel.api.updateDoc(this._docId, {
|
|
|
|
options: {
|
2024-07-22 15:10:57 +00:00
|
|
|
...this._currentFork?.options,
|
2023-03-22 13:48:50 +00:00
|
|
|
tutorial: {
|
2024-07-22 15:10:57 +00:00
|
|
|
lastSlideIndex: this._currentSlideIndex.get(),
|
|
|
|
percentComplete: this._percentComplete,
|
2023-03-22 13:48:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2023-11-01 13:54:19 +00:00
|
|
|
this._logTelemetryEvent('tutorialProgressChanged');
|
2023-03-22 13:48:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private async _changeSlide(slideIndex: number) {
|
|
|
|
this._currentSlideIndex.set(slideIndex);
|
2024-07-22 15:10:57 +00:00
|
|
|
await this._saveProgressDebounced();
|
2023-03-22 13:48:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private async _previousSlide() {
|
|
|
|
await this._changeSlide(this._currentSlideIndex.get() - 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
private async _nextSlide() {
|
|
|
|
await this._changeSlide(this._currentSlideIndex.get() + 1);
|
|
|
|
}
|
|
|
|
|
2024-07-22 15:10:57 +00:00
|
|
|
private async _exitTutorial(markAsComplete = false) {
|
|
|
|
this._saveProgressDebounced.cancel();
|
|
|
|
if (markAsComplete) { this._percentComplete = 100; }
|
|
|
|
await this._saveProgressDebounced();
|
2023-05-01 18:24:23 +00:00
|
|
|
const lastVisitedOrg = this._appModel.lastVisitedOrgDomain.get();
|
|
|
|
if (lastVisitedOrg) {
|
|
|
|
await urlState().pushUrl({org: lastVisitedOrg});
|
|
|
|
} else {
|
|
|
|
window.location.assign(getWelcomeHomeUrl());
|
|
|
|
}
|
2023-03-22 13:48:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private async _restartTutorial() {
|
|
|
|
const doRestart = async () => {
|
|
|
|
const urlId = this._currentDoc!.id;
|
|
|
|
const {trunkId} = parseUrlId(urlId);
|
|
|
|
const docApi = this._appModel.api.getDocAPI(urlId);
|
|
|
|
await docApi.replace({sourceDocId: trunkId, resetTutorialMetadata: true});
|
|
|
|
};
|
|
|
|
|
|
|
|
confirmModal(
|
2024-07-22 15:10:57 +00:00
|
|
|
t('Do you want to restart the tutorial? All progress will be lost.'),
|
|
|
|
t('Restart'),
|
2023-04-20 13:07:45 +00:00
|
|
|
doRestart,
|
|
|
|
{
|
|
|
|
modalOptions: {
|
|
|
|
backerDomArgs: [
|
|
|
|
// Stack modal above the tutorial popup.
|
|
|
|
dom.style('z-index', vars.tutorialModalZIndex.toString()),
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}
|
2023-03-22 13:48:50 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-20 13:07:45 +00:00
|
|
|
private _initializeImages() {
|
2023-03-22 13:48:50 +00:00
|
|
|
return (element: HTMLElement) => {
|
|
|
|
setTimeout(() => {
|
|
|
|
const imgs = element.querySelectorAll('img');
|
|
|
|
for (const img of imgs) {
|
|
|
|
// Re-assigning src to itself is a neat way to restart a GIF.
|
|
|
|
// eslint-disable-next-line no-self-assign
|
|
|
|
img.src = img.src;
|
2023-04-20 13:07:45 +00:00
|
|
|
|
2024-07-22 15:10:57 +00:00
|
|
|
setHoverTooltip(img, t('Click to expand'), {
|
2023-07-13 14:00:56 +00:00
|
|
|
key: FLOATING_POPUP_TOOLTIP_KEY,
|
2023-04-20 13:07:45 +00:00
|
|
|
modifiers: {
|
|
|
|
flip: {
|
|
|
|
boundariesElement: 'scrollParent',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
placement: 'bottom',
|
|
|
|
});
|
2023-03-22 13:48:50 +00:00
|
|
|
}
|
|
|
|
}, 0);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
private _openLightbox(src: string) {
|
|
|
|
modal((ctl) => {
|
|
|
|
this.onDispose(ctl.close);
|
|
|
|
return [
|
|
|
|
cssFullScreenModal.cls(''),
|
|
|
|
cssModalCloseButton('CrossBig',
|
|
|
|
dom.on('click', () => ctl.close()),
|
|
|
|
testId('lightbox-close'),
|
|
|
|
),
|
|
|
|
cssModalContent(cssModalImage({src}, testId('lightbox-image'))),
|
|
|
|
dom.on('click', (ev, elem) => void (ev.target === elem ? ctl.close() : null)),
|
|
|
|
testId('lightbox'),
|
|
|
|
];
|
2023-04-20 13:07:45 +00:00
|
|
|
}, {
|
|
|
|
backerDomArgs: [
|
|
|
|
// Stack modal above the tutorial popup.
|
|
|
|
dom.style('z-index', vars.tutorialModalZIndex.toString()),
|
|
|
|
],
|
2023-03-22 13:48:50 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const cssPopupFooter = styled('div', `
|
|
|
|
display: flex;
|
|
|
|
column-gap: 24px;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
flex-shrink: 0;
|
2024-07-22 15:10:57 +00:00
|
|
|
padding: 16px;
|
2023-03-22 13:48:50 +00:00
|
|
|
border-top: 1px solid ${theme.tutorialsPopupBorder};
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssTryItOutBox = styled('div', `
|
|
|
|
margin-top: 16px;
|
|
|
|
padding: 24px;
|
|
|
|
border-radius: 4px;
|
|
|
|
background-color: ${theme.tutorialsPopupBoxBg};
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssProgressBar = styled('div', `
|
|
|
|
display: flex;
|
|
|
|
gap: 8px;
|
|
|
|
flex-grow: 1;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssProgressBarDot = styled('div', `
|
|
|
|
width: 10px;
|
|
|
|
height: 10px;
|
|
|
|
border-radius: 5px;
|
|
|
|
align-self: center;
|
|
|
|
cursor: pointer;
|
|
|
|
background-color: ${theme.progressBarBg};
|
|
|
|
|
|
|
|
&-current {
|
|
|
|
cursor: default;
|
|
|
|
background-color: ${theme.progressBarFg};
|
|
|
|
}
|
|
|
|
`);
|
|
|
|
|
2024-07-22 15:10:57 +00:00
|
|
|
const cssFooterButtons = styled('div', `
|
2023-03-22 13:48:50 +00:00
|
|
|
display: flex;
|
|
|
|
justify-content: flex-end;
|
|
|
|
column-gap: 8px;
|
|
|
|
flex-shrink: 0;
|
|
|
|
min-width: 140px;
|
|
|
|
|
|
|
|
@media ${mediaXSmall} {
|
|
|
|
& {
|
|
|
|
flex-direction: column;
|
|
|
|
row-gap: 8px;
|
|
|
|
column-gap: 0px;
|
|
|
|
min-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssFullScreenModal = styled('div', `
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
row-gap: 8px;
|
|
|
|
background-color: initial;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
border: none;
|
|
|
|
border-radius: 0px;
|
|
|
|
box-shadow: none;
|
|
|
|
padding: 0px;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssModalCloseButton = styled(icon, `
|
|
|
|
align-self: flex-end;
|
|
|
|
flex-shrink: 0;
|
|
|
|
height: 24px;
|
|
|
|
width: 24px;
|
|
|
|
cursor: pointer;
|
|
|
|
--icon-color: ${theme.modalBackdropCloseButtonFg};
|
|
|
|
&:hover {
|
|
|
|
--icon-color: ${theme.modalBackdropCloseButtonHoverFg};
|
|
|
|
}
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssModalContent = styled('div', `
|
|
|
|
align-self: center;
|
|
|
|
min-height: 0;
|
|
|
|
margin-top: auto;
|
|
|
|
margin-bottom: auto;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssModalImage = styled('img', `
|
|
|
|
height: 100%;
|
|
|
|
max-width: min(100%, 1200px);
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssSpinner = styled('div', `
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
height: 100%;
|
|
|
|
`);
|
2024-07-22 15:10:57 +00:00
|
|
|
|
|
|
|
const cssTutorialControls = styled('div', `
|
|
|
|
background-color: ${theme.notificationsPanelHeaderBg};
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
padding: 8px;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssTextButton = styled(textButton, `
|
|
|
|
font-weight: 500;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
column-gap: 4px;
|
|
|
|
padding: 0 16px;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssRestartIcon = styled(icon, `
|
|
|
|
width: 14px;
|
|
|
|
height: 14px;
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssButtonsSeparator = styled('div', `
|
|
|
|
width: 0;
|
|
|
|
border-right: 1px solid ${theme.controlFg};
|
|
|
|
`);
|
|
|
|
|
|
|
|
const cssSkipIcon = styled(icon, `
|
|
|
|
width: 20px;
|
|
|
|
height: 20px;
|
|
|
|
margin: 0px -3px;
|
|
|
|
`);
|