Skip to content

Instantly share code, notes, and snippets.

@nemrosim
Created January 8, 2024 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemrosim/e9d59b02ff2f841aa757c74ce2525079 to your computer and use it in GitHub Desktop.
Save nemrosim/e9d59b02ff2f841aa757c74ce2525079 to your computer and use it in GitHub Desktop.
export const JSONContentMock: JSONContent = {
doc: {
type: 'doc',
content: [
{
type: 'heading',
attrs: { level: 1 },
content: [{ type: 'text', text: 'Title' }],
},
{
type: 'heading',
attrs: { level: 2 },
content: [{ type: 'text', text: 'Hi there,' }],
},
{
type: 'heading',
attrs: { level: 3 },
content: [{ type: 'text', text: 'Hi there,' }],
},
{ type: 'imagePlaceholder', attrs: { count: 0 } },
{
type: 'image',
attrs: {
src: 'https://buffer.com/cdn-cgi/image/w=1000,fit=contain,q=90,f=auto/library/content/images/size/w1200/2023/10/free-images.jpg',
alt: 'Hello world',
title: null,
},
},
{
type: 'image',
attrs: {
src: 'https://prosemirror.net/docs/ref/#transform.StepMap',
alt: 'Hello world',
title: null,
},
},
{
type: 'image',
attrs: {
src: 'https://images.unsplash.com/photo-1515787366009-7cbdd2dc587b?q=80&w=1470&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
alt: null,
title: null,
},
},
{
type: 'paragraph',
content: [
{ type: 'text', text: 'this is a basic ' },
{ type: 'text', marks: [{ type: 'italic' }], text: 'basic' },
{ type: 'text', text: ' example of ' },
{ type: 'text', marks: [{ type: 'bold' }], text: 'tiptap' },
{
type: 'text',
text: '. Sure, there are all kind of basic text styles you’d probably expect from a text editor. But wait until you see the lists:',
},
],
},
{
type: 'bulletList',
content: [
{
type: 'listItem',
content: [
{
type: 'paragraph',
content: [{ type: 'text', text: 'That’s a bullet list with one …' }],
},
],
},
{
type: 'listItem',
content: [
{
type: 'paragraph',
content: [{ type: 'text', text: '… or two list items.' }],
},
],
},
],
},
{
type: 'orderedList',
attrs: { start: 1 },
content: [
{
type: 'listItem',
content: [
{
type: 'paragraph',
content: [{ type: 'text', text: 'That’s a bullet list with one …' }],
},
],
},
{
type: 'listItem',
content: [
{
type: 'paragraph',
content: [{ type: 'text', text: '… or two list items.' }],
},
],
},
],
},
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Isn’t that great? And all of that is editable. But wait, there’s more. Let’s try a code block:',
},
],
},
{
type: 'codeBlock',
attrs: { language: 'css' },
content: [{ type: 'text', text: 'body {\n display: none;\n}' }],
},
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'I know, I know, this is impressive. It’s only the tip of the iceberg though. Give it a try and click a little bit around. Don’t forget to check the other examples too.',
},
],
},
{
type: 'blockquote',
content: [
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Wow, that’s amazing. Good work, boy! 👏 ',
},
{ type: 'hardBreak' },
{ type: 'text', text: '— Mom' },
],
},
],
},
],
},
selection: { type: 'text', anchor: 1, head: 1 },
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment