| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- /**
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
- * SPDX-License-Identifier: MIT
- */
- /* eslint-disable import/no-unresolved */
- import tryCatch from '@flowgram.ai/demo-fixed-layout-simple/src/data/tryCatch.ts?raw';
- import slot from '@flowgram.ai/demo-fixed-layout-simple/src/data/slot.ts?raw';
- import multiOutputs from '@flowgram.ai/demo-fixed-layout-simple/src/data/multiOutputs.ts?raw';
- import multiInputs from '@flowgram.ai/demo-fixed-layout-simple/src/data/multiInputs.ts?raw';
- import loop from '@flowgram.ai/demo-fixed-layout-simple/src/data/loop.ts?raw';
- import dynamicSplit from '@flowgram.ai/demo-fixed-layout-simple/src/data/dynamicSplit.ts?raw';
- import { PreviewEditor } from '../preview-editor.tsx';
- import { FixedLayoutSimple } from './fixed-layout-simple.tsx';
- export function CompositeNodesPreview(props: { cellHeight?: number }) {
- const previewWidth = '50%';
- const editorWidth = '50%';
- const cellHeight = props.cellHeight || 300;
- return (
- <table
- className=""
- style={{
- width: '100%',
- border: '1px solid var(--rp-c-divider-light)',
- zIndex: 1,
- position: 'relative',
- }}
- >
- <tr>
- <td style={{ textAlign: 'center' }}>dynamicSplit</td>
- <td>
- <PreviewEditor
- codeInRight
- files={{
- 'index.tsx': {
- code: dynamicSplit,
- active: true,
- },
- }}
- previewStyle={{
- width: previewWidth,
- height: cellHeight,
- position: 'relative',
- }}
- editorStyle={{
- width: editorWidth,
- height: cellHeight,
- }}
- >
- <FixedLayoutSimple hideTools demo="dynamicSplit" />
- </PreviewEditor>
- </td>
- </tr>
- <tr>
- <td style={{ textAlign: 'center' }}>loop</td>
- <td>
- <PreviewEditor
- codeInRight
- files={{
- 'index.tsx': {
- code: loop,
- active: true,
- },
- }}
- previewStyle={{
- width: previewWidth,
- height: cellHeight,
- position: 'relative',
- }}
- editorStyle={{
- height: cellHeight,
- width: editorWidth,
- }}
- >
- <FixedLayoutSimple hideTools demo="loop" />
- </PreviewEditor>
- </td>
- </tr>
- <tr>
- <td style={{ textAlign: 'center' }}>tryCatch</td>
- <td>
- <PreviewEditor
- codeInRight
- files={{
- 'index.tsx': {
- code: tryCatch,
- active: true,
- },
- }}
- previewStyle={{
- width: previewWidth,
- height: cellHeight,
- position: 'relative',
- }}
- editorStyle={{
- height: cellHeight,
- width: editorWidth,
- }}
- >
- <FixedLayoutSimple hideTools demo="tryCatch" />
- </PreviewEditor>
- </td>
- </tr>
- <tr>
- <td style={{ textAlign: 'center' }}>multiInputs</td>
- <td>
- <PreviewEditor
- codeInRight
- files={{
- 'index.tsx': {
- code: multiInputs,
- active: true,
- },
- }}
- previewStyle={{
- width: previewWidth,
- height: cellHeight,
- position: 'relative',
- }}
- editorStyle={{
- height: cellHeight,
- width: editorWidth,
- }}
- >
- <FixedLayoutSimple hideTools demo="multiInputs" />
- </PreviewEditor>
- </td>
- </tr>
- <tr>
- <td style={{ textAlign: 'center' }}>multiOutputs</td>
- <td>
- <PreviewEditor
- codeInRight
- files={{
- 'index.tsx': {
- code: multiOutputs,
- active: true,
- },
- }}
- previewStyle={{
- width: previewWidth,
- height: cellHeight,
- position: 'relative',
- }}
- editorStyle={{
- height: cellHeight,
- width: editorWidth,
- }}
- >
- <FixedLayoutSimple hideTools demo="multiOutputs" />
- </PreviewEditor>
- </td>
- </tr>
- <tr>
- <td style={{ textAlign: 'center' }}>slot</td>
- <td>
- <PreviewEditor
- codeInRight
- files={{
- 'index.tsx': {
- code: slot,
- active: true,
- },
- }}
- previewStyle={{
- width: previewWidth,
- height: cellHeight,
- position: 'relative',
- }}
- editorStyle={{
- height: cellHeight,
- width: editorWidth,
- }}
- >
- <FixedLayoutSimple hideTools demo="slot" />
- </PreviewEditor>
- </td>
- </tr>
- </table>
- );
- }
|