|
@@ -16,6 +16,7 @@ import { useTranslation } from 'next-i18next';
|
|
|
import { useRouter } from 'next/router';
|
|
import { useRouter } from 'next/router';
|
|
|
import { throttle, debounce } from 'throttle-debounce';
|
|
import { throttle, debounce } from 'throttle-debounce';
|
|
|
|
|
|
|
|
|
|
+import { useShouldExpandContent } from '~/client/services/layout';
|
|
|
import { useUpdateStateAfterSave, useSaveOrUpdate } from '~/client/services/page-operation';
|
|
import { useUpdateStateAfterSave, useSaveOrUpdate } from '~/client/services/page-operation';
|
|
|
import { apiGet, apiPostForm } from '~/client/util/apiv1-client';
|
|
import { apiGet, apiPostForm } from '~/client/util/apiv1-client';
|
|
|
import { toastError, toastSuccess } from '~/client/util/toastr';
|
|
import { toastError, toastSuccess } from '~/client/util/toastr';
|
|
@@ -57,11 +58,11 @@ import loggerFactory from '~/utils/logger';
|
|
|
// import { ConflictDiffModal } from './PageEditor/ConflictDiffModal';
|
|
// import { ConflictDiffModal } from './PageEditor/ConflictDiffModal';
|
|
|
// import { ConflictDiffModal } from './ConflictDiffModal';
|
|
// import { ConflictDiffModal } from './ConflictDiffModal';
|
|
|
// import Editor from './Editor';
|
|
// import Editor from './Editor';
|
|
|
|
|
+import EditorNavbarBottom from './EditorNavbarBottom';
|
|
|
import Preview from './Preview';
|
|
import Preview from './Preview';
|
|
|
import scrollSyncHelper from './ScrollSyncHelper';
|
|
import scrollSyncHelper from './ScrollSyncHelper';
|
|
|
|
|
|
|
|
import '@growi/editor/dist/style.css';
|
|
import '@growi/editor/dist/style.css';
|
|
|
-import EditorNavbarBottom from './EditorNavbarBottom';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const logger = loggerFactory('growi:PageEditor');
|
|
const logger = loggerFactory('growi:PageEditor');
|
|
@@ -127,6 +128,8 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
|
|
|
|
|
|
|
|
const { mutate: mutateResolvedTheme } = useResolvedThemeForEditor();
|
|
const { mutate: mutateResolvedTheme } = useResolvedThemeForEditor();
|
|
|
|
|
|
|
|
|
|
+ const shouldExpandContent = useShouldExpandContent(currentPage);
|
|
|
|
|
+
|
|
|
const saveOrUpdate = useSaveOrUpdate();
|
|
const saveOrUpdate = useSaveOrUpdate();
|
|
|
const updateStateAfterSave = useUpdateStateAfterSave(pageId, { supressEditingMarkdownMutation: true });
|
|
const updateStateAfterSave = useUpdateStateAfterSave(pageId, { supressEditingMarkdownMutation: true });
|
|
|
|
|
|
|
@@ -597,6 +600,7 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
|
|
|
rendererOptions={rendererOptions}
|
|
rendererOptions={rendererOptions}
|
|
|
markdown={markdownToPreview}
|
|
markdown={markdownToPreview}
|
|
|
pagePath={currentPagePath}
|
|
pagePath={currentPagePath}
|
|
|
|
|
+ expandContentWidth={shouldExpandContent}
|
|
|
// TODO: implement
|
|
// TODO: implement
|
|
|
// refs: https://redmine.weseek.co.jp/issues/126519
|
|
// refs: https://redmine.weseek.co.jp/issues/126519
|
|
|
// onScroll={offset => scrollEditorByPreviewScrollWithThrottle(offset)}
|
|
// onScroll={offset => scrollEditorByPreviewScrollWithThrottle(offset)}
|