-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Drawio not available with GROWI slides #8725
Merged
yuki-takei
merged 44 commits into
master
from
fix/144087-144091-use-drawio-in-slide-view
May 13, 2024
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
d9eb941
dont use slideviewer and renderers
reiji-h eaa7374
remove slide in renderer
reiji-h 15f3bdc
slide presentation
reiji-h 01d574a
add to switch slide type
reiji-h 955f61b
global regexp
reiji-h cfda00d
use hook
reiji-h 2129a1e
fix export problem
reiji-h 1a20fd0
clean code export
reiji-h 323d425
use presentation view options directly
reiji-h be5b1fd
fix typo
reiji-h cee266b
enable slide
reiji-h b606736
clean code
reiji-h 9a2652d
Merge branch 'master' into fix/144087-144091-use-drawio-in-slide-view
reiji-h 5bdbb4b
Merge branch 'master' into fix/144087-144091-use-drawio-in-slide-view
reiji-h ba9326f
use until now
reiji-h bfde8a9
fix import
reiji-h 3906352
fix code
reiji-h b3e66b3
dont use parseFrontmatter
reiji-h 83a0f2c
use from apps/app
reiji-h 9b7abce
clean code
reiji-h 092f4c0
fix code to use marp presentation
reiji-h 72452bc
remove slideviewer switch in revisionrenderer
reiji-h d48b394
change to parse.ts path
reiji-h 6323606
clean code
reiji-h 6c0d128
switch slide or reactmarkdown
reiji-h b29832c
clean code
reiji-h 2589ef1
clean code
reiji-h 35bff91
clean code
reiji-h 2ce8e5d
clean code
reiji-h 4eec933
use dynamic
reiji-h 7361a8b
Merge branch 'master' into fix/144087-144091-use-drawio-in-slide-view
reiji-h 11b84ec
update SlideViewer path
reiji-h de93c14
Rename renderer
reiji-h 555b450
use RevisionRenderer in pageviews
reiji-h 7e1587a
Merge branch 'master' into fix/144087-144091-use-drawio-in-slide-view
reiji-h d6eff20
can render ssr
reiji-h a5a6d0a
Revert "can render ssr"
reiji-h d54f72f
wip: avoid ssr
reiji-h 745fd8f
re-organize packages
yuki-takei 4e3ea33
re-organize exports
yuki-takei bec2809
refactor SlideRenderer
yuki-takei 0a4b382
fix lint error
yuki-takei 074ef5a
implement as a hook
yuki-takei ce9679f
import packages dynamically
yuki-takei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 0 additions & 90 deletions
90
apps/app/src/client/services/renderer/slide-viewer-renderer.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { ReactMarkdownOptions } from 'react-markdown/lib/react-markdown'; | ||
|
||
import { usePresentationViewOptions } from '~/stores/renderer'; | ||
|
||
import { Slides } from '../Presentation/Slides'; | ||
|
||
type SlideRendererProps = { | ||
markdown: string, | ||
marp?: boolean, | ||
}; | ||
|
||
export const SlideRenderer = (props: SlideRendererProps): JSX.Element => { | ||
|
||
const { markdown, marp = false } = props; | ||
|
||
const { data: rendererOptions } = usePresentationViewOptions(); | ||
|
||
return ( | ||
<Slides | ||
hasMarpFlag={marp} | ||
options={{ rendererOptions: rendererOptions as ReactMarkdownOptions }} | ||
> | ||
{markdown} | ||
</Slides> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RevisionRenderer は Comment や CustomSidebar からも使われているので、このコンポーネントに SlideViewer との切り替え機能を持たせるのは不適切
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちらの対応として現在次の方法を考えています。
PageEditor, PageView 等は RevisionRenderer を使用しているが、スライドを使用できるため、これらに切り替えの機能をもたせる。Comment 等はそのまま SlideViewer を用いる。どちらの方が良い or それ以外の方法の方が良い等教えていただければ幸いです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2がよいです
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 で実装しました。
もともとスライドが使用可能だった rendererOptions は useViewOpitons と usePreviewOptions が返すものであり、前者は PageView.tsx と ShareLinkPageView.tsx が使用、後者は最終的に Preview.tsx のみにおいて使用されていました。よってこれら3つのファイルで切り替えをするようにしました。
ですが、PageView.tsx と ShareLinkPageView.tsx についてはこれらから直接 @growi/presentation を使用するとサーバーサイドからの import になるのかエラーが起こるので、dynamic import するコンポーネント ViewRenderer を噛ます形にしています。