(0)
-
- const nextPage = useCallback(() => {
- setCurrentPage(cur => clamp(cur + 1))
- sendMB('table-generator-promotion-next-page')
- }, [])
-
- const page = PROMOTION_PAGES[clamp(currentPage)]
- const PageComponent = page.body
- const pageTitle = page.title
- const isAtLastPage = currentPage >= PROMOTION_PAGES.length - 1
-
- const hideBecauseOfGrammarly =
- grammarlyExtensionPresent() && NOW_TIME < GRAMMARLY_CUTOFF_TIME
-
- if (
- !timeoutExpired ||
- !ref ||
- typeof ref === 'function' ||
- !ref.current ||
- hideBecauseOfGrammarly
- ) {
- return null
- }
-
- return (
-
-
- {pageTitle}
-
-
- }
- className="dark-themed"
- >
-
-
-
-
-
-
- )
- })
-)
-
-const PromotionBody: FC = function PromotionBody({ children }) {
- useEffect(() => {
- sendMB('table-generator-promotion-prompt')
- }, [])
- return {children}
-}
-
-const Footer = memo<{
- isAtLastPage: boolean
- onComplete: () => void
- onNext: () => void
-}>(function Footer({ isAtLastPage, onComplete, onNext }) {
- return (
-
- {!isAtLastPage ? (
-
- ) : (
-
- )}
-
- )
-})
-
-const TablePromotionPage: FC = memo(function TablePromotionPage() {
- return (
- <>
-
- You can now insert tables with just a few clicks and edit them without
- code in Visual Editor. And there’s more…
-
-
- >
- )
-})
-
-const PastingPromotionPage: FC = memo(function PastingPromotionPage() {
- return (
- <>
-
- You can also paste tables (and formatted text!) straight into{' '}
- Visual Editor without losing the formatting.
-
-
- >
- )
-})
-
-const PROMOTION_PAGES: { title: string; body: FC }[] = [
- {
- title: 'Big news! Insert tables from the toolbar',
- body: TablePromotionPage,
- },
- {
- title: 'Paste a table straight into Visual Editor',
- body: PastingPromotionPage,
- },
-]
-
-const clamp = (num: number) =>
- Math.min(Math.max(num, 0), PROMOTION_PAGES.length - 1)
-
-interface VideoProps extends React.VideoHTMLAttributes {
- src: string
-}
-const Video = memo(function Video({ src, ...props }: VideoProps) {
- return (
-
- )
-})
diff --git a/services/web/frontend/stories/source-editor/source-editor.stories.tsx b/services/web/frontend/stories/source-editor/source-editor.stories.tsx
index 6c6466ccfd..1729947e85 100644
--- a/services/web/frontend/stories/source-editor/source-editor.stories.tsx
+++ b/services/web/frontend/stories/source-editor/source-editor.stories.tsx
@@ -145,7 +145,6 @@ export const Visual = (args: any, { globals: { theme } }: any) => {
useMeta({
'ol-showSymbolPalette': true,
'ol-mathJaxPath': 'https://unpkg.com/mathjax@3.2.2/es5/tex-svg-full.js',
- 'ol-inactiveTutorials': ['table-generator-promotion'],
'ol-project_id': '63e21c07946dd8c76505f85a',
})
diff --git a/services/web/test/frontend/features/source-editor/components/codemirror-editor-table-generator.spec.tsx b/services/web/test/frontend/features/source-editor/components/codemirror-editor-table-generator.spec.tsx
index a002f2d289..ec7b1a0f28 100644
--- a/services/web/test/frontend/features/source-editor/components/codemirror-editor-table-generator.spec.tsx
+++ b/services/web/test/frontend/features/source-editor/components/codemirror-editor-table-generator.spec.tsx
@@ -110,9 +110,6 @@ describe(' Table editor', function () {
cy.interceptMathJax()
cy.interceptCompile('compile', Number.MAX_SAFE_INTEGER)
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
- window.metaAttributesCache.set('ol-inactiveTutorials', [
- 'table-generator-promotion',
- ])
})
describe('Table rendering', function () {