2
0
reiji-h 1 жил өмнө
parent
commit
6323606791

+ 0 - 2
apps/app/src/components/Page/RevisionRenderer.tsx

@@ -4,11 +4,9 @@ import type { FallbackProps } from 'react-error-boundary';
 import { ErrorBoundary } from 'react-error-boundary';
 import { ErrorBoundary } from 'react-error-boundary';
 import ReactMarkdown from 'react-markdown';
 import ReactMarkdown from 'react-markdown';
 
 
-
 import type { RendererOptions } from '~/interfaces/renderer-options';
 import type { RendererOptions } from '~/interfaces/renderer-options';
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
 
 
-
 import 'katex/dist/katex.min.css';
 import 'katex/dist/katex.min.css';
 
 
 
 

+ 2 - 0
apps/app/src/components/PageEditor/Preview.tsx

@@ -1,6 +1,8 @@
 import type { CSSProperties } from 'react';
 import type { CSSProperties } from 'react';
 import React from 'react';
 import React from 'react';
 
 
+import { parseSlideFrontmatter } from '@growi/presentation';
+
 import type { RendererOptions } from '~/interfaces/renderer-options';
 import type { RendererOptions } from '~/interfaces/renderer-options';
 
 
 import RevisionRenderer from '../Page/RevisionRenderer';
 import RevisionRenderer from '../Page/RevisionRenderer';

+ 3 - 14
apps/app/src/components/Presentation/Presentation.tsx

@@ -1,18 +1,7 @@
-import { Presentation as PresentationSubstance, type PresentationProps as PresentationPropsSubstance } from '@growi/presentation';
-
-import { parseSlideFrontmatterInMarkdown } from '../Page/markdown-slide-util-for-view';
+import { Presentation as PresentationSubstance, type PresentationProps } from '@growi/presentation';
 
 
 import '@growi/presentation/dist/style.css';
 import '@growi/presentation/dist/style.css';
 
 
-type Props = Omit<PresentationPropsSubstance, 'hasMarpFlag'> & {
-  isEnabledMarp: boolean
-};
-
-export const Presentation = (props: Props): JSX.Element => {
-  const { options, isEnabledMarp, children } = props;
-
-  const [marp] = parseSlideFrontmatterInMarkdown(children ?? '');
-  const hasMarpFlag = isEnabledMarp && marp;
-
-  return <PresentationSubstance options={options} hasMarpFlag={hasMarpFlag}>{children}</PresentationSubstance>;
+export const Presentation = (props: PresentationProps): JSX.Element => {
+  return <PresentationSubstance {...props} />;
 };
 };

+ 1 - 0
packages/presentation/src/index.ts

@@ -1,2 +1,3 @@
 export * from './components/Presentation';
 export * from './components/Presentation';
 export * from './components/Slides';
 export * from './components/Slides';
+export * from './services/parse-slide-frontmatter';