Download react-page/docs/examples/slate-plugin-src/plugins/links/anchor.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 574 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-page/docs/examples/slate-plugin-src/plugins/links/anchor.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-page/docs/examples/slate-plugin-src/plugins/links/anchor.tsx
-
curl -L -o anchor.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-page/docs/examples/slate-plugin-src/plugins/links/anchor.tsx
574 Bytes
| import React from 'react'; | |
| import createDataPlugin from '../../pluginFactories/createDataPlugin'; | |
| const anchor = createDataPlugin<{ id: string }>({ | |
| addHoverButton: false, | |
| addToolbarButton: true, | |
| object: 'block', | |
| label: 'Id for Link Anchor', | |
| icon: <span>#</span>, | |
| properties: ['id'], | |
| dataMatches: (data) => { | |
| return Boolean(data?.id); | |
| }, | |
| controls: { | |
| type: 'autoform', | |
| schema: { | |
| type: 'object', | |
| required: ['id'], | |
| properties: { | |
| id: { | |
| type: 'string', | |
| }, | |
| }, | |
| }, | |
| }, | |
| }); | |
| export default anchor; | |