|
|
@@ -1,6 +1,7 @@
|
|
|
import assert from 'assert';
|
|
|
|
|
|
import { isClient } from '@growi/core/dist/utils/browser-utils';
|
|
|
+import * as slides from '@growi/presentation';
|
|
|
import * as refsGrowiDirective from '@growi/remark-attachment-refs/dist/client/index.mjs';
|
|
|
import * as drawio from '@growi/remark-drawio';
|
|
|
// eslint-disable-next-line import/extensions
|
|
|
@@ -18,6 +19,8 @@ import { DrawioViewerWithEditButton } from '~/components/ReactMarkdownComponents
|
|
|
import { Header } from '~/components/ReactMarkdownComponents/Header';
|
|
|
import { LightBox } from '~/components/ReactMarkdownComponents/LightBox';
|
|
|
import { RichAttachment } from '~/components/ReactMarkdownComponents/RichAttachment';
|
|
|
+// eslint-disable-next-line import/no-cycle
|
|
|
+import { SlideViewer } from '~/components/ReactMarkdownComponents/SlideViewer';
|
|
|
import { TableWithEditButton } from '~/components/ReactMarkdownComponents/TableWithEditButton';
|
|
|
import * as mermaid from '~/features/mermaid';
|
|
|
import { RehypeSanitizeOption } from '~/interfaces/rehype';
|
|
|
@@ -64,6 +67,7 @@ export const generateViewOptions = (
|
|
|
mermaid.remarkPlugin,
|
|
|
xsvToTable.remarkPlugin,
|
|
|
attachment.remarkPlugin,
|
|
|
+ slides.remarkPlugin,
|
|
|
lsxGrowiDirective.remarkPlugin,
|
|
|
refsGrowiDirective.remarkPlugin,
|
|
|
);
|
|
|
@@ -81,6 +85,7 @@ export const generateViewOptions = (
|
|
|
drawio.sanitizeOption,
|
|
|
mermaid.sanitizeOption,
|
|
|
attachment.sanitizeOption,
|
|
|
+ slides.sanitizeOption,
|
|
|
lsxGrowiDirective.sanitizeOption,
|
|
|
refsGrowiDirective.sanitizeOption,
|
|
|
)]
|
|
|
@@ -115,6 +120,7 @@ export const generateViewOptions = (
|
|
|
components.mermaid = mermaid.MermaidViewer;
|
|
|
components.attachment = RichAttachment;
|
|
|
components.img = LightBox;
|
|
|
+ components.slide = SlideViewer;
|
|
|
}
|
|
|
|
|
|
if (config.isEnabledXssPrevention) {
|
|
|
@@ -257,6 +263,7 @@ export const generatePreviewOptions = (config: RendererConfig, pagePath: string)
|
|
|
attachment.remarkPlugin,
|
|
|
lsxGrowiDirective.remarkPlugin,
|
|
|
refsGrowiDirective.remarkPlugin,
|
|
|
+ slides.remarkPlugin,
|
|
|
);
|
|
|
if (config.isEnabledLinebreaks) {
|
|
|
remarkPlugins.push(breaks);
|
|
|
@@ -275,6 +282,7 @@ export const generatePreviewOptions = (config: RendererConfig, pagePath: string)
|
|
|
lsxGrowiDirective.sanitizeOption,
|
|
|
refsGrowiDirective.sanitizeOption,
|
|
|
addLineNumberAttribute.sanitizeOption,
|
|
|
+ slides.sanitizeOption,
|
|
|
)]
|
|
|
: () => {};
|
|
|
|
|
|
@@ -299,6 +307,7 @@ export const generatePreviewOptions = (config: RendererConfig, pagePath: string)
|
|
|
components.mermaid = mermaid.MermaidViewer;
|
|
|
components.attachment = RichAttachment;
|
|
|
components.img = LightBox;
|
|
|
+ components.slide = SlideViewer;
|
|
|
}
|
|
|
|
|
|
if (config.isEnabledXssPrevention) {
|