|
@@ -2,7 +2,9 @@ import React, { FC, useEffect, useState } from 'react';
|
|
|
|
|
|
|
|
import { pagePathUtils } from '@growi/core';
|
|
import { pagePathUtils } from '@growi/core';
|
|
|
|
|
|
|
|
|
|
+import { CustomWindow } from '~/interfaces/global';
|
|
|
import { IUserUISettings } from '~/interfaces/user-ui-settings';
|
|
import { IUserUISettings } from '~/interfaces/user-ui-settings';
|
|
|
|
|
+import { generatePreviewRenderer } from '~/services/renderer/growi-renderer';
|
|
|
import { useRendererSettings } from '~/stores/renderer';
|
|
import { useRendererSettings } from '~/stores/renderer';
|
|
|
import {
|
|
import {
|
|
|
useIsDeviceSmallerThanMd, useIsDeviceSmallerThanLg,
|
|
useIsDeviceSmallerThanMd, useIsDeviceSmallerThanLg,
|
|
@@ -200,6 +202,23 @@ const ContextExtractorOnce: FC = () => {
|
|
|
const shouldInitAdminSock = !!currentUser?.isAdmin;
|
|
const shouldInitAdminSock = !!currentUser?.isAdmin;
|
|
|
useSetupGlobalAdminSocket(shouldInitAdminSock);
|
|
useSetupGlobalAdminSocket(shouldInitAdminSock);
|
|
|
|
|
|
|
|
|
|
+ // TODO: Remove this code when reveal.js is omitted. see: https://github.com/weseek/growi/pull/6223
|
|
|
|
|
+ // Do not access this property from other than reveal.js plugins.
|
|
|
|
|
+ (window as CustomWindow).previewRenderer = generatePreviewRenderer(
|
|
|
|
|
+ {
|
|
|
|
|
+ isEnabledXssPrevention: configByContextHydrate.isEnabledXssPrevention,
|
|
|
|
|
+ attrWhiteList: configByContextHydrate.attrWhiteList,
|
|
|
|
|
+ tagWhiteList: configByContextHydrate.tagWhiteList,
|
|
|
|
|
+ highlightJsStyleBorder: configByContextHydrate.highlightJsStyleBorder,
|
|
|
|
|
+ env: {
|
|
|
|
|
+ MATHJAX: configByContextHydrate.env.MATHJAX,
|
|
|
|
|
+ PLANTUML_URI: configByContextHydrate.env.PLANTUML_URI,
|
|
|
|
|
+ BLOCKDIAG_URI: configByContextHydrate.env.BLOCKDIAG_URI,
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ path,
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
return null;
|
|
return null;
|
|
|
};
|
|
};
|
|
|
|
|
|