Download slate/packages/slate-history/test/undo/insert_fragment/basic.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 689 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/packages/slate-history/test/undo/insert_fragment/basic.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/slate/packages/slate-history/test/undo/insert_fragment/basic.tsx
-
curl -L -o basic.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/packages/slate-history/test/undo/insert_fragment/basic.tsx
689 Bytes
| /** @jsx jsx */ | |
| import { jsx } from '../..' | |
| import { cloneDeep } from 'lodash' | |
| const fragment = ( | |
| <block type="d"> | |
| <block>A</block> | |
| <block type="c"> | |
| <block type="d"> | |
| <block>B</block> | |
| <block> | |
| <block type="d"> | |
| <block>C</block> | |
| </block> | |
| </block> | |
| </block> | |
| <block type="d"> | |
| <block>D</block> | |
| </block> | |
| </block> | |
| </block> | |
| ) | |
| export const run = editor => { | |
| editor.insertFragment(fragment) | |
| } | |
| export const input = ( | |
| <editor> | |
| <block type="d"> | |
| <block> | |
| <text> | |
| <cursor /> | |
| </text> | |
| </block> | |
| </block> | |
| </editor> | |
| ) | |
| export const output = cloneDeep(input) | |