Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the demo post content using the keyboard only #10682

Merged
merged 6 commits into from
Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added test/e2e/assets/cover-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/e2e/assets/gallery-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/e2e/assets/gallery-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/e2e/assets/gallery-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/e2e/assets/gallery-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/e2e/assets/gallery-5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/e2e/assets/image-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/e2e/assets/image-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions test/e2e/specs/__snapshots__/demo-content-with-keyboard.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Demo content post should be created with keyboard 1`] = `
"<!-- wp:cover-image {\\"url\\":\\"http://localhost:8889/wp-content/uploads/2018/10/5879e569-c21f-4eef-b80d-60003b387e64.jpg\\",\\"align\\":\\"center\\",\\"id\\":278} -->
<div class=\\"wp-block-cover-image has-background-dim aligncenter\\" style=\\"background-image:url(http://localhost:8889/wp-content/uploads/2018/10/5879e569-c21f-4eef-b80d-60003b387e64.jpg)\\"><p class=\\"wp-block-cover-image-text\\">Of Mountains &amp; Printing Presses</p></div>
<!-- /wp:cover-image -->

<!-- wp:paragraph -->
<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>—</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>What you are reading now is a <strong>text block</strong> </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {\\"align\\":\\"right\\"} -->
<p style=\\"text-align:right\\">... like this one, which is right aligned.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Headings are separate blocks as well, which helps with the outline and organization of your content.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>A Picture is Worth a Thousand Words</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Handling images and media with the utmost care is a primary focus of the new editor. Hopefully, you’ll find aspects of adding captions or going full-width with your pictures much easier and robust than before.</p>
<!-- /wp:paragraph -->

<!-- wp:image {\\"id\\":279} -->
<figure class=\\"wp-block-image\\"><img src=\\"http://localhost:8889/wp-content/uploads/2018/10/cda80801-7478-4eb3-a77e-0ce1bd366d3c.jpg\\" alt=\\"\\" class=\\"wp-image-279\\"/><figcaption>If your theme supports it, you’ll see the \\"wide\\" button on the image toolbar. Give it a try.</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<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:paragraph -->

<!-- wp:heading -->
<h2>The <em>Inserter</em> </h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<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 add 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>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Go give it a try, you may discover things WordPress can already add into your posts that you didn’t know about. Here’s a short list of what you can currently find there:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Text &amp; Headings</li><li>Images &amp; 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 Lists like this one of course :)</li></ul>
<!-- /wp:list -->

<!-- wp:separator -->
<hr class=\\"wp-block-separator\\"/>
<!-- /wp:separator -->

<!-- wp:heading -->
<h2>Visual Editing</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>A huge benefit of blocks is that you can edit them in place and manipulate your 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:paragraph -->

<!-- wp:quote -->
<blockquote class=\\"wp-block-quote\\"><p>The editor will endeavor 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><cite>Matt Mullenweg, 2017</cite></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<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:paragraph -->

<!-- wp:paragraph -->
<p>Blocks can be anything you need. For instance, you may want to add 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:paragraph -->

<!-- wp:gallery {\\"columns\\":2} -->
<ul class=\\"wp-block-gallery columns-2 is-cropped\\"><li class=\\"blocks-gallery-item\\"><figure><img src=\\"http://localhost:8889/wp-content/uploads/2018/10/85929735-71ec-4e44-a969-29c252732c1b.jpg\\" alt=\\"\\" data-id=\\"280\\" data-link=\\"http://localhost:8889/?attachment_id=280\\" class=\\"wp-image-280\\"/></figure></li><li class=\\"blocks-gallery-item\\"><figure><img src=\\"http://localhost:8889/wp-content/uploads/2018/10/b19f8ff0-e9c9-4816-a287-c95dd2598d4c.jpg\\" alt=\\"\\" data-id=\\"281\\" data-link=\\"http://localhost:8889/?attachment_id=281\\" class=\\"wp-image-281\\"/></figure></li><li class=\\"blocks-gallery-item\\"><figure><img src=\\"http://localhost:8889/wp-content/uploads/2018/10/f6bf6a36-5434-45ac-afbb-5292c9813386.jpg\\" alt=\\"\\" data-id=\\"282\\" data-link=\\"http://localhost:8889/?attachment_id=282\\" class=\\"wp-image-282\\"/></figure></li></ul>
<!-- /wp:gallery -->

<!-- wp:paragraph -->
<p>You can change the amount of columns in your galleries by dragging a slider in the block inspector in the sidebar.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Media Rich</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>If you combine the new <strong>wide</strong> and <strong>full</strong> </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Sure, the full-wide image can be pretty big. But sometimes the image is worth it.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The above is a gallery with just two images. It’s an easier way to create visually appealing layouts, without having to deal with floats. You can also easily convert the gallery back to individual images again, by using the block switcher.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Any block can opt into these alignments. The embed block has them also, and is responsive out of the box:</p>
<!-- /wp:paragraph -->

<!-- wp:core-embed/vimeo {\\"url\\":\\"https://vimeo.com/22439234\\",\\"type\\":\\"video\\",\\"providerNameSlug\\":\\"vimeo\\",\\"className\\":\\"wp-embed-aspect-16-9 wp-has-aspect-ratio\\"} -->
<figure class=\\"wp-block-embed-vimeo wp-block-embed is-type-video is-provider-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\\"><div class=\\"wp-block-embed__wrapper\\">
https://vimeo.com/22439234
</div></figure>
<!-- /wp:core-embed/vimeo -->

<!-- wp:paragraph -->
<p>You can build any block you like, static or dynamic, decorative or plain. Here’s a pullquote block:</p>
<!-- /wp:paragraph -->

<!-- wp:pullquote -->
<figure class=\\"wp-block-pullquote\\"><blockquote><p>Code is Poetry</p><cite>THE WORDPRESS COMMUNITY</cite></blockquote></figure>
<!-- /wp:pullquote -->

<!-- wp:paragraph {\\"align\\":\\"center\\"} -->
<p style=\\"text-align:center\\"><em>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>.</em></p>
<!-- /wp:paragraph -->

<!-- wp:button {\\"align\\":\\"center\\"} -->
<div class=\\"wp-block-button aligncenter\\"><a class=\\"wp-block-button__link\\" href=\\"https://github.com/WordPress/gutenberg\\">Help build Gutenberg</a></div>
<!-- /wp:button -->

<!-- wp:separator -->
<hr class=\\"wp-block-separator\\"/>
<!-- /wp:separator -->

<!-- wp:paragraph -->
<p>Thanks for testing Gutenberg!</p>
<!-- /wp:paragraph -->"
`;
Loading