Introduce component mocks in Workbench
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3579801. --> Reported by: [balintbrews](https://www.drupal.org/user/613760) Related to !759 !740 >>> <h3 id="overview">Overview</h3> <p>Canvas Workbench (working name, see <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3576829" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3576829</a></span>) is a local developer tool, similar to Storybook, but focused on Drupal Canvas Code Components and Canvas pages. The initial version was introduced in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3573867" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3573867</a></span>, which renders all components with their first example prop values. The next step is allowing component authors to preview the same component with multiple named prop and slot configurations. We'll refer to those configurations as mocks.</p> <h3 id="proposed-resolution">Proposed resolution</h3> <p>Discover <code>[component-name].mocks.json</code> files and come up with convenient formats that we can normalize into a <code>@json-render/react</code>-compatible spec shape, then implement the rendering.</p> <h3 id="ui-changes">User interface changes</h3> <p>Tabs displayed in Workbench.</p> > Related issue: [Issue #3573867](https://www.drupal.org/node/3573867)
issue