preview.tsx 990 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. /* eslint-disable import/no-unresolved */
  6. import editorCode from '@flowgram.ai/demo-playground/src/editor.tsx?raw';
  7. import toolCode from '@flowgram.ai/demo-playground/src/components/playground-tools.tsx?raw';
  8. import cardCode from '@flowgram.ai/demo-playground/src/components/card.tsx?raw';
  9. import { InfiniteCanvas } from './infinite-canvas.tsx';
  10. import { PreviewEditor } from '../preview-editor';
  11. export const InfiniteCanvasPreview = () => {
  12. const files = {
  13. 'editor.tsx': {
  14. active: true,
  15. code: editorCode,
  16. },
  17. 'playground-tools.tsx': {
  18. code: toolCode,
  19. },
  20. 'card.tsx': {
  21. code: cardCode,
  22. },
  23. };
  24. return (
  25. <PreviewEditor
  26. files={files}
  27. previewStyle={{ height: 500, position: 'relative' }}
  28. editorStyle={{ height: 500 }}
  29. >
  30. <InfiniteCanvas className="doc-infinite-canvas-preview" />
  31. </PreviewEditor>
  32. );
  33. };