Axismundi Dialogs

Описание

Axismundi Dialogs builds Material Design 3 dialogs and sheets, and the buttons
that open them, from native HTML and WordPress blocks.

Dialog surfaces

A dialog or sheet is not a block placed in a post. It is a template part in the
Dialog Surface area, managed in the Site Editor the way core manages a
Navigation Overlay: a button in a post or template names the part, and the part
is rendered once, at the end of the page.

The part’s root is the Dialog block, a native <dialog> element. Its
presentation is a choice of four:

  • Dialog — Basic — a centred dialog.
  • Dialog — Full screen — fills the window on compact screens and becomes a
    basic dialog from 600px up.
  • Sheets — Bottom — a bottom sheet with an optional drag handle. The handle
    moves the sheet between its initial and expanded heights by click, keyboard,
    drag or fling.
  • Sheets — Side — a side sheet on the start or end edge.

Sheets can be modal or standard. A standard side sheet stays open beside the
page and either resizes or moves the page to make room; on compact screens it
opens as a modal. Content goes in Header, Content and Actions groups, and only
Content scrolls.

Opening and closing are animated with Material 3 motion, and respect reduced
motion. The native dialog supplies the top layer, scrim, focus containment and
focus restoration; Escape and scrim dismissal follow the dialog’s settings.

When a part is created in the Dialog Surface area, the Site Editor offers seven
starting designs: basic dialog, basic dialog with icon, list dialog, full-screen
dialog, bottom sheet, modal side sheet and standard side sheet. The pattern is
only a start; the part made from it is yours to edit.

Buttons

A Dialog Button Group holds Dialog Button and Dialog Icon Button
blocks: a Material 3 standard button group. The group sets size, shape,
distribution and selection; each button carries its icon, toggle and disabled
state. The buttons render as WordPress buttons, so a theme’s button styles apply
to them, and they convert to and from core/button.

Each button’s Action decides what it does, and the markup and ARIA follow
from that choice: a command, a form submit or reset, opening or closing a
Dialog Surface, or opening or closing a Navigation Overlay template part.

A toggle, or a button whose surface is open, can swap to a selected icon, fill
a variable icon font, and move between the two with a fade, rotation or scale.
Preview on hover shows that state under the pointer and keyboard focus.

The Dialog Icon block draws an icon from the theme’s icon font or the
WordPress Icon Registry; the same renderer paints the icons inside the buttons.

Per-page hubs

Object Media Dialog and Post Quick View are single dialogs placed once
per page. Blocks in a feed open them with the selected item, so a feed never
renders one hidden dialog per post. Post Quick View fetches the post on demand
from this site’s REST API; its trigger currently links to the post’s comments.

Блоки

Этот плагин предоставляет 8 блоков.

  • Dialog Icon An icon from the theme's icon font or the WordPress Icon Registry. Also the leading icon of a basic dialog header.
  • Post Quick View A single per-page dialog that shows a selected post's quick view. Post Quick View Trigger blocks in a feed open it, and it fetches the post fragment on demand — so the page never renders one dialog per post. Place one per page (e.g. before the footer).
  • Dialog Button Group A standard group of action buttons for a dialog or sheet.
  • Object Media Dialog A single per-page dialog that shows an Object's attached media full size, with the post and the post it replies to beside it. Object Attachments blocks anywhere on the page open it, so a feed never renders one dialog per post. Place one per page (e.g. before the footer).
  • Post Quick View Trigger A microblog-style comments action for a post — a Material Symbols icon plus the comment count. In v0.1 it links to the post's comments; a later phase will open a shared quick-view dialog. Place it inside a Post Template.
  • Dialog The HTML dialog at the root of a Dialog Surface template part. Choose how it presents — a basic or full-screen dialog, a bottom or side sheet — and build its content inside.
  • Dialog Button An action button for a Dialog Button Group.
  • Dialog Icon Button An icon-only action button for a Dialog Button Group.

Установка

  1. Upload and activate the plugin. WordPress 7.1 or later is required.
  2. In the Site Editor, create a template part in the Dialog Surface area and
    pick a starting design.
  3. Insert a Dialog Button Group, set a button’s Action to open a Dialog
    Surface, and choose the part.

The buttons work with any block theme and carry their own fallbacks. Dialog
surfaces read the Material 3 colour, shape and motion tokens that Axismundi
Theme provides; on another theme, define those --md-sys-* tokens or the
surfaces render without their colours, corners and motion.

Часто задаваемые вопросы

Does this plugin contact an external service?

No. Everything runs in WordPress with the native <dialog> element and the
WordPress Interactivity API. Post Quick View requests only this site’s own REST
endpoint, which returns published, publicly viewable posts.

Where did the Sheets, Sheet and Dialog blocks from 0.2 go?

They were replaced by Dialog Surface template parts in 0.3.0. See the
changelog.

Отзывы

Нет отзывов об этом плагине.

Участники и разработчики

«Axismundi Dialogs» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

Перевести «Axismundi Dialogs» на ваш язык.

Заинтересованы в разработке?

Посмотрите код, проверьте SVN репозиторий, или подпишитесь на журнал разработки по RSS.

Журнал изменений

0.3.1

  • Distribution: Fill now fills on the page. The group widened each button’s
    slot, but the button kept its own width at the start of it, so a filled
    group looked scattered on the front end while it looked right in the editor.
  • Remove a development file (package-lock.json) that the 0.3.0 package on
    WordPress.org included by mistake, doubling the plugin’s installed size.

Earlier releases are listed in changelog.txt.