@planningcenter/core-email-editors
v1.0.1
Published
Shared components for rendering email editor form fields across products
Downloads
713
Keywords
Readme
@planningcenter/core-email-editors
Shared React components for rendering email editor form fields across Planning Center products.
Background
People, Groups, and Registrations each maintain their own email_form component directories for building and editing email content. This package centralizes those components as TypeScript so they can be shared and maintained in one place.
Usage
Install the package in your product and import the components you need from @planningcenter/core-email-editors. You'll also need to import this package's stylesheet once, plus @planningcenter/sweetest-alert's stylesheet (a peer dependency used by Editor.ImageButton's error dialog):
import "@planningcenter/core-email-editors/style.css"
import "@planningcenter/sweetest-alert/style.css"This package also expects trix and @planningcenter/sweetest-alert to be installed directly by the consuming product (both are peer dependencies), since Trix registers global custom elements and shouldn't be duplicated across bundles.
Local Development
This package uses yalc to test local changes against a consuming product before publishing a release.
Install
yalcglobally:yarn global add yalcFrom this package's root, watch for changes and publish them to the local
yalcregistry:yarn devFrom the consuming product, pull in the local version:
yalc add @planningcenter/core-email-editors && yarn installIf the consuming product's Vite dev setup uses
autoBuild(e.g. People'sconfig/vite.json), it decides whether to rebuild based on a digest of its own watched source paths and lockfiles — ayalcpublish only touches files insidenode_modules, which isn't watched, so the app can keep silently serving a stale bundle after you publish a new local version. Force a rebuild after each publish, e.g. in People:devbox run -- bin/vite build --mode development --forcePlain
bin/vite buildisn't enough on its own either — without--mode developmentit builds the production output (public/assets/vite) instead of the dev one (public/vite-dev) that the dev server actually serves.
Testing
yarn testyarn test:watchStorybook
yarn storybook