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

Support users choosing how to handle URLs for sites that do not exist #2059

Merged
merged 22 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
af4fa76
Add function to derive site name from slug
brandonpayton Dec 4, 2024
3910c15
Add modal to prompt user to save for site slugs without a persisted site
brandonpayton Dec 4, 2024
2c46968
Prompt user to consider saving when site with specified slug does not…
brandonpayton Dec 4, 2024
bb554fa
Multiple tweaks to prompt modal
brandonpayton Dec 5, 2024
bbb99d5
Fix wait until playground ready
brandonpayton Dec 5, 2024
95e891d
Add TODO
brandonpayton Dec 5, 2024
d70b1a2
Improve modal text
brandonpayton Dec 5, 2024
d12cffb
Adjust name of query param
brandonpayton Dec 5, 2024
7eb7900
Avoid modal being accidentally dismissed without making a choice
brandonpayton Dec 5, 2024
0986c6b
Try to improve modal language
brandonpayton Dec 5, 2024
b148c56
Display modal after Playground loads
brandonpayton Dec 5, 2024
3e03aa5
Disable use-temp button when saving to OPFS
brandonpayton Dec 5, 2024
f5719b9
Update packages/playground/website/src/components/missing-site-modal/…
adamziel Dec 5, 2024
3636f00
Update packages/playground/website/src/components/missing-site-modal/…
adamziel Dec 5, 2024
2fbcfe0
Update packages/playground/website/src/components/ensure-playground-s…
adamziel Dec 5, 2024
c8dc49b
Prefer row orientation for buttons to follow Modal style recommendations
brandonpayton Dec 5, 2024
651c1d5
Allow PersistSiteButton to save to single storage type
brandonpayton Dec 5, 2024
621ddd5
Only save to OPFS
brandonpayton Dec 5, 2024
59f7723
Remove redundant ARIA label
brandonpayton Dec 5, 2024
0455285
Increase space between buttons
brandonpayton Dec 5, 2024
f3ac3a3
Make Playground name visually distinguished from surrounding modal text
brandonpayton Dec 5, 2024
fb16872
Document if-stored-site-missing query param
brandonpayton Dec 5, 2024
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
39 changes: 20 additions & 19 deletions packages/docs/site/docs/developers/06-apis/query-api/01-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,26 @@ You can go ahead and try it out. The Playground will automatically install the t

## Available options

| Option | Default Value | Description |
| --------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `php` | `8.0` | Loads the specified PHP version. Accepts `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2`, `8.3`, or `latest`. |
| `wp` | `latest` | Loads the specified WordPress version. Accepts the last three major WordPress versions. As of June 1, 2024, that's `6.3`, `6.4`, or `6.5`. You can also use the generic values `latest`, `nightly`, or `beta`. |
| `blueprint-url` | | The URL of the Blueprint that will be used to configure this Playground instance. |
| `networking` | `no` | Enables or disables the networking support for Playground. Accepts `yes` or `no`. |
| `plugin` | | Installs the specified plugin. Use the plugin name from the WordPress Plugins Directory URL. For example, if the URL is `https://wordpress.org/plugins/wp-lazy-loading/`, the plugin name would be `wp-lazy-loading`. You can pre-install multiple plugins by saying `plugin=coblocks&plugin=wp-lazy-loading&…`. Installing a plugin automatically logs the user in as an admin. |
| `theme` | | Installs the specified theme. Use the theme name from the WordPress Themes Directory URL. For example, if the URL is `https://wordpress.org/themes/disco/`, the theme name would be `disco`. Installing a theme automatically logs the user in as an admin. |
| `url` | `/wp-admin/` | Load the specified initial WordPress page in this Playground instance. |
| `mode` | `browser-full-screen` | Determines how the WordPress instance is displayed. Either wrapped in a browser UI or full width as a seamless experience. Accepts `browser-full-screen`, or `seamless`. |
| `lazy` | | Defer loading the Playground assets until someone clicks on the "Run" button. Does not accept any values. If `lazy` is added as a URL parameter, loading will be deferred. |
| `login` | `yes` | Log the user in as an admin. Accepts `yes` or `no`. |
| `multisite` | `no` | Enables the WordPress multisite mode. Accepts `yes` or `no`. |
| `import-site` | | Imports site files and database from a ZIP file specified by a URL. |
| `import-wxr` | | Imports site content from a WXR file specified by a URL. It uses the WordPress Importer plugin, so the default admin user must be logged in. |
| `site-slug` | | Selects which site to load from browser storage. |
| `language` | `en_US` | Sets the locale for the WordPress instance. This must be used in combination with `networking=yes` otherwise WordPress won't be able to download translations. |
| `core-pr` | | Installs a specific https://github.com/WordPress/wordpress-develop core PR. Accepts the PR number. For example, `core-pr=6883`. |
| `gutenberg-pr` | | Installs a specific https://github.com/WordPress/gutenberg PR. Accepts the PR number. For example, `gutenberg-pr=65337`. |
| Option | Default Value | Description |
| ------------------------ | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `php` | `8.0` | Loads the specified PHP version. Accepts `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2`, `8.3`, or `latest`. |
| `wp` | `latest` | Loads the specified WordPress version. Accepts the last three major WordPress versions. As of June 1, 2024, that's `6.3`, `6.4`, or `6.5`. You can also use the generic values `latest`, `nightly`, or `beta`. |
| `blueprint-url` | | The URL of the Blueprint that will be used to configure this Playground instance. |
| `networking` | `no` | Enables or disables the networking support for Playground. Accepts `yes` or `no`. |
| `plugin` | | Installs the specified plugin. Use the plugin name from the WordPress Plugins Directory URL. For example, if the URL is `https://wordpress.org/plugins/wp-lazy-loading/`, the plugin name would be `wp-lazy-loading`. You can pre-install multiple plugins by saying `plugin=coblocks&plugin=wp-lazy-loading&…`. Installing a plugin automatically logs the user in as an admin. |
| `theme` | | Installs the specified theme. Use the theme name from the WordPress Themes Directory URL. For example, if the URL is `https://wordpress.org/themes/disco/`, the theme name would be `disco`. Installing a theme automatically logs the user in as an admin. |
| `url` | `/wp-admin/` | Load the specified initial WordPress page in this Playground instance. |
| `mode` | `browser-full-screen` | Determines how the WordPress instance is displayed. Either wrapped in a browser UI or full width as a seamless experience. Accepts `browser-full-screen`, or `seamless`. |
| `lazy` | | Defer loading the Playground assets until someone clicks on the "Run" button. Does not accept any values. If `lazy` is added as a URL parameter, loading will be deferred. |
| `login` | `yes` | Log the user in as an admin. Accepts `yes` or `no`. |
| `multisite` | `no` | Enables the WordPress multisite mode. Accepts `yes` or `no`. |
| `import-site` | | Imports site files and database from a ZIP file specified by a URL. |
| `import-wxr` | | Imports site content from a WXR file specified by a URL. It uses the WordPress Importer plugin, so the default admin user must be logged in. |
| `site-slug` | | Selects which site to load from browser storage. |
| `language` | `en_US` | Sets the locale for the WordPress instance. This must be used in combination with `networking=yes` otherwise WordPress won't be able to download translations. |
| `core-pr` | | Installs a specific https://github.com/WordPress/wordpress-develop core PR. Accepts the PR number. For example, `core-pr=6883`. |
| `gutenberg-pr` | | Installs a specific https://github.com/WordPress/gutenberg PR. Accepts the PR number. For example, `gutenberg-pr=65337`. |
| `if-stored-site-missing` | | Indicates how to handle the scenario where the `site-slug` parameter identifies a site that does not exist. Use `if-stored-site-missing=prompt` to indicate that the user should be asked whether they would like to save a new site with the specified `site-slug`. |

For example, the following code embeds a Playground with a preinstalled Gutenberg plugin and opens the post editor:

Expand Down
Loading
Loading