-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
Copy pathpost-content.js
172 lines (134 loc) · 10.3 KB
/
post-content.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/**
* Temporary test post content
*/
window._wpGutenbergPost = {
title: {
raw: 'Welcome to the Gutenberg Editor',
},
// TODO `status` and any other initial attributes other than content and
// title need to move somewhere else when this file goes away. See:
// https://github.com/WordPress/gutenberg/pull/848#issuecomment-302836177
status: 'draft',
content: {
raw: [
'<!-- wp:core/text -->',
'<p>The goal of this new editor is to make adding rich content to WordPress simple and enjoyable. This whole post is composed of <em>pieces of content</em>—somewhat similar to LEGO bricks—that you can move around and interact with. Move your cursor around and you\'ll notice the different blocks light up with outlines and arrows. Press the arrows to reposition blocks quickly, without fearing about losing things in the process of copying and pasting.</p>',
'<p>What you are reading now is a <strong>text block</strong>, the most basic block of all. A text block can have multiple paragraphs, if that\'s how you prefer to write your posts. But you can also split it by hitting enter twice. Once blocks are split they get their own controls to be moved freely around the post...</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/text -->',
'<p style="text-align:right;">... like this one, which is separate from the above and right aligned.</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/text -->',
'<p>Headings are separate blocks as well, which helps with the outline and organization of your content.</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/heading -->',
'<h2>A picture is worth a thousand words, or so the saying goes</h2>',
'<!-- /wp:core/heading -->',
'<!-- wp:core/text -->',
'<p>Handling images and media with the utmost care is a primary focus of the new editor. Hopefully you\'ll find aspects like adding captions or going full-width with your pictures much easier and robust than before.</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/image align="center" -->',
'<figure><img src="https://cldup.com/YLYhpou2oq.jpg" class="aligncenter"/><figcaption>Give it a try. Press the "really wide" button on the image toolbar.</figcaption></figure>',
'<!-- /wp:core/image -->',
'<!-- wp:core/text -->',
'<p>Try selecting and removing or editing the caption, now you don\'t have to be careful about selecting the image or other text by mistake and ruining the presentation.</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/heading -->',
'<h2>The <em>Inserter</em> Tool</h2>',
'<!-- /wp:core/heading -->',
'<!-- wp:core/text -->',
'<p>Imagine everything that WordPress can do is available to you quickly and in the same place on the interface. No need to figure out HTML tags, classes, or remember complicated shortcode syntax. That\'s the spirit behind the inserter—the <code>(+)</code> button you\'ll see around the editor—which allows you to browse all available content blocks and insert them into your post. Plugins and themes are able to register their own, opening up all sort of possibilities for rich editing and publishing.<p>Go give it a try, you may discover things WordPress can already insert into your posts that you didn\'t know about. Here\'s a short list of what you can currently find there:</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/list -->',
'<ul><li>Text & Headings</li><li>Images & Videos</li><li>Galleries</li><li>Embeds, like YouTube, Tweets, or other WordPress posts.</li><li>Layout blocks, like Buttons, Hero Images, Separators, etc.</li><li>And <em>Lists</em> like this one of course :)</li></ul>',
'<!-- /wp:core/list -->',
'<!-- wp:core/text -->',
'<p>If you want to learn more about how to build additional blocks, or if you are interested in helping with the project, head over to the <a href="https://github.com/WordPress/gutenberg">GitHub repository</a>.</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/button align="center" -->',
'<div class="aligncenter"><a href="https://github.com/WordPress/gutenberg"><span>Help build Gutenberg</span></a></div>',
'<!-- /wp:core/button -->',
'<!-- wp:core/separator -->',
'<hr/>',
'<!-- /wp:core/separator -->',
'<!-- wp:core/heading -->',
'<h2>Visual Editing</h2>',
'<!-- /wp:core/heading -->',
'<!-- wp:core/text -->',
'<p>A huge benefit of blocks is that you can edit them in place and manipulate you content directly. Instead of having fields for editing things like the source of a quote, or the text of a button, you can directly change the content. Try editing the following quote:</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/quote style="1" -->',
'<blockquote class="blocks-quote-style-1"><p>The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.</p><footer>Matt Mullenweg, 2017</footer></blockquote>',
'<!-- /wp:core/quote -->',
'<!-- wp:core/text -->',
'<p>The information corresponding to the source of the quote is a separate text field, similar to captions under images, so the structure of the quote is protected even if you select, modify, or remove the source. It\'s always easy to add it back.</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/text -->',
'<p>Blocks can be anything you need. For instance, you may want to insert a subdued quote as part of the composition of your text, or you may prefer to display a giant stylized one. All of these options are available in the inserter.</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/quote style="2" -->',
'<blockquote class="blocks-quote-style-2"><p>There is no greater agony than bearing an untold story inside you.</p><footer>Maya Angelou</footer></blockquote>',
'<!-- /wp:core/quote -->',
'<!-- wp:core/separator -->',
'<hr/>',
'<!-- /wp:core/separator -->',
'<!-- wp:core/heading -->',
'<h2>Sea id autem nominavi deseruisse</h2>',
'<!-- /wp:core/heading -->',
'<!-- wp:core/text -->',
'<p>Ea veniam homero eam. Ex inimicus molestiae cum, debet scaevola at eos. Vis assum veritus ut, has ea nostrud accusata, offendit appareat comprehensam ea pro. Ad quo quem veritus appellantur, te est quas phaedrum, eum alia habeo ad. Ei est erroribus imperdiet, omnis dicam propriae sed no. His vitae oratio fierent ne, cu duo tota eligendi, electram rationibus in qui.</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/image -->',
'<figure><img src="https://cldup.com/uuUqE_dXzy.jpg" /></figure>',
'<!-- /wp:core/image -->',
'<!-- wp:core/text -->',
'<p>Est quis reque cetero ad. Sea id autem nominavi deseruisse. <strong>Veniam qualisque definitionem pri id</strong>, ea autem feugiat delenit ius, mei at loem affert accumsan. Dicat eruditi cu est, te pro dicant pericula conclusionemque, ei vim detracto euripidis intellegam. Eius postea volumus mei ad.</p>',
'<p>Prima ridens denique his te, ferri illum volumus an his. Eu vel dicat homero qualisqu, vitae regione deserunt vis ei. Graeci incorrupte liberavisse no mea, saepe voluptaria usu ex, vis dicant euismod id. At dolor reprimique eos, quo altera detraxit moderatius id. Quo iudico utinam eu, ad alia munere mel.</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/code -->',
'<pre><code>export default function MyButton() {\n\
return <Button>Click Me!</Button>;\n\
}</code></pre>',
'<!-- /wp:core/code -->',
'<!-- wp:core/image -->',
'<figure><img src="https://cldup.com/GCwahb3aOb.jpg" /></figure>',
'<!-- /wp:core/image -->',
'<!-- wp:core/image -->',
'<figure><img src="https://cldup.com/lUUQPv6w9c.jpg" /></figure>',
'<!-- /wp:core/image -->',
'<!-- wp:core/preformatted -->',
'<pre>An old silent pond...<br>A frog jumps into the pond,<br>splash! Silence again.</pre>',
'<!-- /wp:core/preformatted -->',
'<!-- wp:core/text -->',
'<p>Eu integre accusata prodesset est, <em>sed te impetus gubergren conceptam</em>, ex sed wisi nostrum ocurreret. Esse velit omittantur ius te, alii dissentias ei vis. At sed unum veritus fabellas. Te volutpat appellantur duo. Ad natum fuisset intellegebat eam, causae invidunt usu id, et vis impetus appetere.</p>',
'<!-- /wp:core/text -->',
'<!-- wp:core/heading -->',
'<h6>Nominavi deseruisse</h6>',
'<!-- /wp:core/heading -->',
'<!-- wp:core/list -->',
'<ul><li>Est quis reque cetero ad</li><li>Sea id autem nominavi deseruisse</li><li>Veniam qualisque definitionem pri id, ea autem feugiat delenit ius, mei at loem affert accumsan</li><li>Dicat eruditi cu est, te pro dicant pericula conclusionemque</li><li>Eius postea volumus mei ad</li></ul>',
'<!-- /wp:core/list -->',
'<!-- wp:core/pullquote -->',
'<blockquote class="blocks-pullquote"><p>Code is Poetry</p><footer>The WordPress community</footer></blockquote>',
'<!-- /wp:core/pullquote -->',
'<!-- wp:core/separator -->',
'<hr/>',
'<!-- /wp:core/separator -->',
'<!-- wp:core/table -->',
'<table class="widefat"><thead><tr><th>Version</th><th>Musician</th><th>Date</th></tr></thead><tbody><tr><th><a href="https://wordpress.org/news/2015/12/clifford/">4.4</a></th><td>Clifford Brown</td><td>December 8, 2015</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2016/04/coleman/">4.5</a></th><td>Coleman Hawkins</td><td>April 12, 2016</td></tr><tr><th><a href="https://wordpress.org/news/2016/08/pepper/">4.6</a></th><td>Pepper Adams</td><td>August 16, 2016</td></tr><tr class="alt"><th><a href="https://wordpress.org/news/2016/12/vaughan/">4.7</a></th><td>Sarah Vaughan</td><td>December 6, 2016</td></tr></tbody></table>',
'<!-- /wp:core/table -->',
'<!-- wp:core/heading -->',
'<h2>All that you can embed!</h2>',
'<!-- /wp:core/heading -->',
'<!-- wp:core/embed url="https://www.youtube.com/watch?v=Nl6U7UotA-M" -->',
'<figure>https://www.youtube.com/watch?v=Nl6U7UotA-M<figcaption>State of the Word 2016</figcaption></figure>',
'<!-- /wp:core/embed -->',
'<!-- wp:core/embed url="https://twitter.com/photomatt/status/868657763970404352" -->',
'https://twitter.com/photomatt/status/868657763970404352',
'<!-- /wp:core/embed -->',
'<!-- wp:core/embed url="https://make.wordpress.org/core/2017/01/17/editor-technical-overview/" -->',
'https://make.wordpress.org/core/2017/01/17/editor-technical-overview/',
'<!-- /wp:core/embed -->',
].join( '' ),
},
};