UNPKG

payload-plugin-newsletter

Version:

Complete newsletter management plugin for Payload CMS with subscriber management, magic link authentication, and email service integration

80 lines (78 loc) 2.67 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/exports/fields.ts var fields_exports = {}; __export(fields_exports, { createEmailContentField: () => createEmailContentField, emailSafeFeatures: () => emailSafeFeatures }); module.exports = __toCommonJS(fields_exports); // src/fields/emailContent.ts var import_richtext_lexical = require("@payloadcms/richtext-lexical"); var emailSafeFeatures = [ // Basic text formatting (0, import_richtext_lexical.BoldFeature)(), (0, import_richtext_lexical.ItalicFeature)(), (0, import_richtext_lexical.UnderlineFeature)(), (0, import_richtext_lexical.StrikethroughFeature)(), // Links with simple configuration (0, import_richtext_lexical.LinkFeature)({ fields: [{ name: "url", type: "text", required: true, admin: { description: "Enter the full URL (including https://)" } }] }), // Lists (0, import_richtext_lexical.OrderedListFeature)(), (0, import_richtext_lexical.UnorderedListFeature)(), // Headings - limited to h1, h2, h3 for email compatibility (0, import_richtext_lexical.HeadingFeature)({ enabledHeadingSizes: ["h1", "h2", "h3"] }), // Basic paragraph and alignment (0, import_richtext_lexical.ParagraphFeature)(), (0, import_richtext_lexical.AlignFeature)(), // Blockquotes (0, import_richtext_lexical.BlockquoteFeature)() ]; var createEmailContentField = (overrides) => { return { name: "content", type: "richText", required: true, editor: (0, import_richtext_lexical.lexicalEditor)({ features: emailSafeFeatures }), admin: { description: "Email content with limited formatting for compatibility", ...overrides?.admin }, ...overrides }; }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { createEmailContentField, emailSafeFeatures }); //# sourceMappingURL=fields.cjs.map