Skip to content

Add EmailTemplateAdmin page component (list + chrome + ThemeProvider) #140

Description

@patoperpetua

Parent: #138
Depends on: #139

Goal

Export EmailTemplateAdmin as the primary embeddable admin page from @singleton-sd/post-kit-editor: template list, ported EmailBuilder MUI canvas, PostKit metadata/variables/preview/validation/save/send chrome, and an internal MUI ThemeProvider so hosts need no MUI setup.

Scope

Public API

<EmailTemplateAdmin
  templates={catalog}
  onSave={saveToConsumerApi}
  onSendTest={postSendTestToBff} // optional
/>
  • Absorb list/select behaviour from examples/admin-editor/App.tsx.
  • Reuse existing save/send/validation/preview logic from EmailTemplateEditor.
  • Mount ThemeProvider inside the component.
  • Keep EmailTemplateEditor / EmailBuilderCanvas exported for advanced hosts.

Layout

Full-page layout: template list + PostKit sidebar chrome + EmailBuilder inspector/samples/canvas + sandboxed preview.

Tests / Storybook

  • SSR smoke for admin shell with fixtures.
  • Storybook story for EmailTemplateAdmin.

Constraints

  • No credentials props; no disk/Git/network inside the package.
  • Do not rewrite examples/admin-editor docs beyond what is needed to compile against the new export (docs/example thinning is the next issue).

Acceptance criteria

  • EmailTemplateAdmin is exported from package index.
  • Mounting with templates + onSave shows list, MUI canvas/inspector/samples, and PostKit chrome.
  • Omit onSendTest hides Send-test; provide it shows Send-test.
  • Host does not need to install or wrap MUI ThemeProvider.
  • pnpm --filter @singleton-sd/post-kit-editor test and Storybook build succeed.

Agent implementation notes

Depends on the MUI canvas port. Branch: feat/<N>-email-template-admin.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions