@emabuild/core 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{form-tool-BucdYK9Z.js → form-tool-C9ccGMTE.js} +2 -2
- package/dist/{form-tool-BucdYK9Z.js.map → form-tool-C9ccGMTE.js.map} +1 -1
- package/dist/{html-tool-CDX3fL-9.js → html-tool-Dx0bJnRa.js} +2 -2
- package/dist/{html-tool-CDX3fL-9.js.map → html-tool-Dx0bJnRa.js.map} +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{mail-editor-DNPaJKo3.js → mail-editor-D3QbvBKs.js} +9 -8
- package/dist/{mail-editor-DNPaJKo3.js.map → mail-editor-D3QbvBKs.js.map} +1 -1
- package/dist/mail-editor.d.ts.map +1 -1
- package/dist/mail-editor.js +1 -1
- package/dist/{menu-tool-BrT6-Pvh.js → menu-tool-D34uGd81.js} +2 -2
- package/dist/{menu-tool-BrT6-Pvh.js.map → menu-tool-D34uGd81.js.map} +1 -1
- package/dist/{social-tool-B4BUlJ2I.js → social-tool-_2fRc5-k.js} +2 -2
- package/dist/{social-tool-B4BUlJ2I.js.map → social-tool-_2fRc5-k.js.map} +1 -1
- package/dist/{table-tool-Bo_g3Un_.js → table-tool-B_MVWfF5.js} +2 -2
- package/dist/{table-tool-Bo_g3Un_.js.map → table-tool-B_MVWfF5.js.map} +1 -1
- package/dist/{timer-tool-3mF08efm.js → timer-tool-BUl5TiH0.js} +2 -2
- package/dist/{timer-tool-3mF08efm.js.map → timer-tool-BUl5TiH0.js.map} +1 -1
- package/dist/{video-tool-CwWMKobZ.js → video-tool-HOA8TCla.js} +2 -2
- package/dist/{video-tool-CwWMKobZ.js.map → video-tool-HOA8TCla.js.map} +1 -1
- package/package.json +7 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mail-editor.d.ts","sourceRoot":"","sources":["../src/mail-editor.ts"],"names":[],"mapp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AG,IAAI;IAIzD,UAAU,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAuBnF,OAAO,CAAC,QAAQ;IAQV,eAAe,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAIrE,YAAY,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAKjD,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,GAAG,IAAI;IAI9E,WAAW,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI;IAI5C,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAIxD,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI;IAIpC,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;IAIZ,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAQpD;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,YAAY;IAMpB,MAAM;CAgBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,iBAAiB,CAAC;KAClC;CACF"}
|
package/dist/mail-editor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html as d } from "lit";
|
|
2
|
-
import { s as e, j as x, e as m } from "./mail-editor-
|
|
2
|
+
import { s as e, j as x, e as m } from "./mail-editor-D3QbvBKs.js";
|
|
3
3
|
const i = [
|
|
4
4
|
{ text: "Home", href: "#" },
|
|
5
5
|
{ text: "About", href: "#" },
|
|
@@ -58,4 +58,4 @@ const i = [
|
|
|
58
58
|
export {
|
|
59
59
|
h as menuTool
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=menu-tool-
|
|
61
|
+
//# sourceMappingURL=menu-tool-D34uGd81.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-tool-
|
|
1
|
+
{"version":3,"file":"menu-tool-D34uGd81.js","sources":["../src/tools/built-in/menu-tool.ts"],"sourcesContent":["/**\n * @module menu-tool\n *\n * Horizontal navigation menu with separator characters.\n *\n * Email compatibility: Uses inline `<a>` tags with text separators.\n * All styles are inline for cross-client rendering.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport type { ContentValues } from '@emabuild/types';\nimport type { LitToolDefinition } from '../tool-registry.js';\nimport { str, jsonParse } from '../helpers/value-extractor.js';\nimport { emailTableCell } from '../helpers/email-html.js';\nimport type { MenuItem } from '../helpers/types.js';\n\nconst DEFAULT_ITEMS: MenuItem[] = [\n { text: 'Home', href: '#' },\n { text: 'About', href: '#' },\n { text: 'Contact', href: '#' },\n];\n\nexport const menuTool: LitToolDefinition = {\n name: 'menu',\n label: 'Menu',\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><line x1=\"4\" y1=\"6\" x2=\"20\" y2=\"6\"/><line x1=\"4\" y1=\"12\" x2=\"20\" y2=\"12\"/><line x1=\"4\" y1=\"18\" x2=\"20\" y2=\"18\"/></svg>`,\n supportedDisplayModes: ['email', 'web'],\n position: 9,\n options: {\n menu: {\n title: 'Menu',\n options: { items: { label: 'Items (JSON)', defaultValue: JSON.stringify(DEFAULT_ITEMS), widget: 'rich_text' } },\n },\n style: {\n title: 'Style',\n options: {\n textAlign: { label: 'Align', defaultValue: 'center', widget: 'alignment' },\n fontSize: { label: 'Font Size', defaultValue: '14px', widget: 'text' },\n color: { label: 'Text Color', defaultValue: '#333333', widget: 'color_picker' },\n separator: { label: 'Separator', defaultValue: '|', widget: 'text' },\n separatorColor: { label: 'Separator Color', defaultValue: '#cccccc', widget: 'color_picker' },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'padding' } },\n },\n },\n defaultValues: {\n items: JSON.stringify(DEFAULT_ITEMS), textAlign: 'center', fontSize: '14px',\n color: '#333333', separator: '|', separatorColor: '#cccccc', containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n const padding = str(values, 'containerPadding', '10px');\n const align = str(values, 'textAlign', 'center');\n const fontSize = str(values, 'fontSize', '14px');\n const color = str(values, 'color', '#333333');\n const sep = str(values, 'separator', '|');\n const sepColor = str(values, 'separatorColor', '#cccccc');\n const items = jsonParse<MenuItem[]>(values.items, DEFAULT_ITEMS);\n\n return html`\n <div style=\"padding:${padding};text-align:${align};font-size:${fontSize};font-family:arial,sans-serif;\">\n ${items.map((item, i) => html`${i > 0 ? html`<span style=\"color:${sepColor};padding:0 8px;\">${sep}</span>` : ''}\n <a href=${item.href} style=\"color:${color};text-decoration:none;\">${item.text}</a>`)}\n </div>\n `;\n },\n renderHtml(values: ContentValues): string {\n const padding = str(values, 'containerPadding', '10px');\n const align = str(values, 'textAlign', 'center');\n const fontSize = str(values, 'fontSize', '14px');\n const color = str(values, 'color', '#333333');\n const sep = str(values, 'separator', '|');\n const sepColor = str(values, 'separatorColor', '#cccccc');\n const items = jsonParse<MenuItem[]>(values.items, DEFAULT_ITEMS);\n\n const links = items.map((item, i) => {\n const prefix = i > 0 ? `<span style=\"color:${sepColor};padding:0 8px;\">${sep}</span>` : '';\n return `${prefix}<a href=\"${item.href}\" target=\"_blank\" style=\"color:${color};text-decoration:none;font-family:arial,helvetica,sans-serif;font-size:${fontSize};\">${item.text}</a>`;\n }).join('');\n\n return emailTableCell(`<div style=\"text-align:${align};\">${links}</div>`, { padding, align });\n },\n },\n};\n"],"names":["DEFAULT_ITEMS","menuTool","values","padding","str","align","fontSize","color","sep","sepColor","items","jsonParse","html","item","i","links","emailTableCell"],"mappings":";;AAgBA,MAAM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
|
-
import { s as t, j as g, e as x } from "./mail-editor-
|
|
2
|
+
import { s as t, j as g, e as x } from "./mail-editor-D3QbvBKs.js";
|
|
3
3
|
const l = [
|
|
4
4
|
{ name: "Facebook", url: "https://facebook.com/", icon: "f", color: "#1877F2" },
|
|
5
5
|
{ name: "Twitter", url: "https://twitter.com/", icon: "𝕏", color: "#000000" },
|
|
@@ -59,4 +59,4 @@ const l = [
|
|
|
59
59
|
export {
|
|
60
60
|
h as socialTool
|
|
61
61
|
};
|
|
62
|
-
//# sourceMappingURL=social-tool-
|
|
62
|
+
//# sourceMappingURL=social-tool-_2fRc5-k.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-tool-
|
|
1
|
+
{"version":3,"file":"social-tool-_2fRc5-k.js","sources":["../src/tools/built-in/social-tool.ts"],"sourcesContent":["/**\n * @module social-tool\n *\n * Social media icon links (Facebook, Twitter, Instagram, LinkedIn, etc.).\n *\n * Email compatibility: Uses nested tables for icon layout.\n * Each icon is a colored circle with centered text, rendered\n * as a table cell for cross-client consistency.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport type { ContentValues } from '@emabuild/types';\nimport type { LitToolDefinition } from '../tool-registry.js';\nimport { str, jsonParse } from '../helpers/value-extractor.js';\nimport { emailTableCell } from '../helpers/email-html.js';\nimport type { SocialIcon } from '../helpers/types.js';\n\nconst DEFAULT_ICONS: SocialIcon[] = [\n { name: 'Facebook', url: 'https://facebook.com/', icon: 'f', color: '#1877F2' },\n { name: 'Twitter', url: 'https://twitter.com/', icon: '𝕏', color: '#000000' },\n { name: 'Instagram', url: 'https://instagram.com/', icon: '📷', color: '#E4405F' },\n { name: 'LinkedIn', url: 'https://linkedin.com/', icon: 'in', color: '#0A66C2' },\n];\n\nexport const socialTool: LitToolDefinition = {\n name: 'social',\n label: 'Social',\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"18\" cy=\"5\" r=\"3\"/><circle cx=\"6\" cy=\"12\" r=\"3\"/><circle cx=\"18\" cy=\"19\" r=\"3\"/><line x1=\"8.59\" y1=\"13.51\" x2=\"15.42\" y2=\"17.49\"/><line x1=\"15.41\" y1=\"6.51\" x2=\"8.59\" y2=\"10.49\"/></svg>`,\n supportedDisplayModes: ['email', 'web'],\n position: 8,\n options: {\n icons: {\n title: 'Social Icons',\n options: {\n icons: { label: 'Icons (JSON)', defaultValue: JSON.stringify(DEFAULT_ICONS), widget: 'rich_text' },\n iconSize: { label: 'Icon Size', defaultValue: '32px', widget: 'text' },\n iconSpacing: { label: 'Spacing', defaultValue: '8px', widget: 'text' },\n },\n },\n style: {\n title: 'Style',\n options: { textAlign: { label: 'Align', defaultValue: 'center', widget: 'alignment' } },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'padding' } },\n },\n },\n defaultValues: {\n icons: JSON.stringify(DEFAULT_ICONS), iconSize: '32px', iconSpacing: '8px',\n textAlign: 'center', containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n const padding = str(values, 'containerPadding', '10px');\n const align = str(values, 'textAlign', 'center');\n const iconSize = str(values, 'iconSize', '32px');\n const spacing = str(values, 'iconSpacing', '8px');\n const icons = jsonParse<SocialIcon[]>(values.icons, DEFAULT_ICONS);\n\n return html`\n <div style=\"padding:${padding};text-align:${align};\">\n ${icons.map((s) => html`\n <a href=${s.url} target=\"_blank\" style=\"display:inline-block;width:${iconSize};height:${iconSize};line-height:${iconSize};text-align:center;background:${s.color};color:white;border-radius:50%;text-decoration:none;font-size:14px;font-weight:bold;margin:0 ${spacing};font-family:arial,sans-serif;vertical-align:middle;\">${s.icon}</a>\n `)}\n </div>\n `;\n },\n renderHtml(values: ContentValues): string {\n const padding = str(values, 'containerPadding', '10px');\n const align = str(values, 'textAlign', 'center');\n const iconSize = str(values, 'iconSize', '32');\n const spacing = str(values, 'iconSpacing', '8px');\n const icons = jsonParse<SocialIcon[]>(values.icons, DEFAULT_ICONS);\n\n const cells = icons.map((s) =>\n `<td align=\"center\" valign=\"middle\" style=\"padding:0 ${spacing};\"><a href=\"${s.url}\" target=\"_blank\" style=\"text-decoration:none;\"><table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td width=\"${iconSize}\" height=\"${iconSize}\" align=\"center\" valign=\"middle\" style=\"width:${iconSize}px;height:${iconSize}px;background:${s.color};border-radius:50%;color:#fff;font-size:14px;font-weight:bold;font-family:arial,sans-serif;\">${s.icon}</td></tr></table></a></td>`\n ).join('\\n');\n\n const inner = `<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"${align}\"><tr>${cells}</tr></table>`;\n return emailTableCell(inner, { padding, align });\n },\n },\n};\n"],"names":["DEFAULT_ICONS","socialTool","values","padding","str","align","iconSize","spacing","icons","jsonParse","html","s","cells","inner","emailTableCell"],"mappings":";;AAiBA,MAAMA,IAA8B;AAAA,EAClC,EAAE,MAAM,YAAY,KAAK,yBAAyB,MAAM,KAAK,OAAO,UAAA;AAAA,EACpE,EAAE,MAAM,WAAW,KAAK,wBAAwB,MAAM,MAAM,OAAO,UAAA;AAAA,EACnE,EAAE,MAAM,aAAa,KAAK,0BAA0B,MAAM,MAAM,OAAO,UAAA;AAAA,EACvE,EAAE,MAAM,YAAY,KAAK,yBAAyB,MAAM,MAAM,OAAO,UAAA;AACvE,GAEaC,IAAgC;AAAA,EAC3C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,uBAAuB,CAAC,SAAS,KAAK;AAAA,EACtC,UAAU;AAAA,EACV,SAAS;AAAA,IACP,OAAO;AAAA,MACL,OAAO;AAAA,MACP,SAAS;AAAA,QACP,OAAO,EAAE,OAAO,gBAAgB,cAAc,KAAK,UAAUD,CAAa,GAAG,QAAQ,YAAA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AY,IAAI,GACvCK,IAAUH,EAAIF,GAAQ,eAAe,KAAK,GAG1CU,IAFQH,EAAwBP,EAAO,OAAOF,CAAa,EAE7C;AAAA,QAAI,CAACW,MACvB,uDAAuDJ,CAAO,eAAeI,EAAE,GAAG,wIAAwIL,CAAQ,aAAaA,CAAQ,iDAAiDA,CAAQ,aAAaA,CAAQ,iBAAiBK,EAAE,KAAK,gGAAgGA,EAAE,IAAI;AAAA,MAAA,EACnc,KAAK;AAAA,CAAI,GAELE,IAAQ,gFAAgFR,CAAK,SAASO,CAAK;AACjH,aAAOE,EAAeD,GAAO,EAAE,SAAAV,GAAS,OAAAE,GAAO;AAAA,IACjD;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html as i } from "lit";
|
|
2
|
-
import { s as t, j as f, e as C } from "./mail-editor-
|
|
2
|
+
import { s as t, j as f, e as C } from "./mail-editor-D3QbvBKs.js";
|
|
3
3
|
const n = [
|
|
4
4
|
["Header 1", "Header 2", "Header 3"],
|
|
5
5
|
["Cell 1", "Cell 2", "Cell 3"],
|
|
@@ -60,4 +60,4 @@ const n = [
|
|
|
60
60
|
export {
|
|
61
61
|
m as tableTool
|
|
62
62
|
};
|
|
63
|
-
//# sourceMappingURL=table-tool-
|
|
63
|
+
//# sourceMappingURL=table-tool-B_MVWfF5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-tool-
|
|
1
|
+
{"version":3,"file":"table-tool-B_MVWfF5.js","sources":["../src/tools/built-in/table-tool.ts"],"sourcesContent":["/**\n * @module table-tool\n *\n * Data table with configurable header styling and borders.\n *\n * Email compatibility: Uses standard HTML `<table>` with inline styles.\n * All borders, padding, and colors are inline for cross-client support.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport type { ContentValues } from '@emabuild/types';\nimport type { LitToolDefinition } from '../tool-registry.js';\nimport { str, jsonParse } from '../helpers/value-extractor.js';\nimport { emailTableCell } from '../helpers/email-html.js';\n\nconst DEFAULT_DATA = [\n ['Header 1', 'Header 2', 'Header 3'],\n ['Cell 1', 'Cell 2', 'Cell 3'],\n ['Cell 4', 'Cell 5', 'Cell 6'],\n];\n\nexport const tableTool: LitToolDefinition = {\n name: 'table',\n label: 'Table',\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M3 9h18\"/><path d=\"M3 15h18\"/><path d=\"M9 3v18\"/><path d=\"M15 3v18\"/></svg>`,\n supportedDisplayModes: ['email', 'web'],\n position: 12,\n options: {\n table: {\n title: 'Table',\n options: { tableData: { label: 'Table Data (JSON)', defaultValue: JSON.stringify(DEFAULT_DATA), widget: 'rich_text' } },\n },\n style: {\n title: 'Style',\n options: {\n headerBg: { label: 'Header Background', defaultValue: '#f3f4f6', widget: 'color_picker' },\n headerColor: { label: 'Header Text Color', defaultValue: '#111827', widget: 'color_picker' },\n borderColor: { label: 'Border Color', defaultValue: '#e5e7eb', widget: 'color_picker' },\n cellPadding: { label: 'Cell Padding', defaultValue: '8px 12px', widget: 'text' },\n fontSize: { label: 'Font Size', defaultValue: '14px', widget: 'text' },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'padding' } },\n },\n },\n defaultValues: {\n tableData: JSON.stringify(DEFAULT_DATA), headerBg: '#f3f4f6', headerColor: '#111827',\n borderColor: '#e5e7eb', cellPadding: '8px 12px', fontSize: '14px', containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n const padding = str(values, 'containerPadding', '10px');\n const hBg = str(values, 'headerBg', '#f3f4f6');\n const hColor = str(values, 'headerColor', '#111827');\n const bColor = str(values, 'borderColor', '#e5e7eb');\n const cPad = str(values, 'cellPadding', '8px 12px');\n const fSize = str(values, 'fontSize', '14px');\n const data = jsonParse<string[][]>(values.tableData, DEFAULT_DATA);\n\n return html`\n <div style=\"padding:${padding};overflow-x:auto;\">\n <table style=\"width:100%;border-collapse:collapse;font-size:${fSize};font-family:arial,sans-serif;\">\n <thead><tr>${data[0]?.map((c) => html`<th style=\"padding:${cPad};background:${hBg};color:${hColor};border:1px solid ${bColor};text-align:left;font-weight:600;\">${c}</th>`)}</tr></thead>\n <tbody>${data.slice(1).map((row) => html`<tr>${row.map((c) => html`<td style=\"padding:${cPad};border:1px solid ${bColor};\">${c}</td>`)}</tr>`)}</tbody>\n </table>\n </div>\n `;\n },\n renderHtml(values: ContentValues): string {\n const padding = str(values, 'containerPadding', '10px');\n const hBg = str(values, 'headerBg', '#f3f4f6');\n const hColor = str(values, 'headerColor', '#111827');\n const bColor = str(values, 'borderColor', '#e5e7eb');\n const cPad = str(values, 'cellPadding', '8px 12px');\n const fSize = str(values, 'fontSize', '14px');\n const data = jsonParse<string[][]>(values.tableData, DEFAULT_DATA);\n const font = 'font-family:arial,helvetica,sans-serif;';\n\n const hCells = (data[0] || []).map((c) => `<th style=\"padding:${cPad};background-color:${hBg};color:${hColor};border:1px solid ${bColor};text-align:left;font-weight:600;${font}font-size:${fSize};\">${c}</th>`).join('');\n const bRows = data.slice(1).map((row) => `<tr>${row.map((c) => `<td style=\"padding:${cPad};border:1px solid ${bColor};${font}font-size:${fSize};\">${c}</td>`).join('')}</tr>`).join('');\n const inner = `<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" style=\"border-collapse:collapse;\"><thead><tr>${hCells}</tr></thead><tbody>${bRows}</tbody></table>`;\n return emailTableCell(inner, { padding });\n },\n },\n};\n"],"names":["DEFAULT_DATA","tableTool","values","padding","str","hBg","hColor","bColor","cPad","fSize","data","jsonParse","html","c","row","font","hCells","bRows","inner","emailTableCell"],"mappings":";;AAeA,MAAMA,IAAe;AAAA,EACnB,CAAC,YAAY,YAAY,UAAU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,CAAI,aAAaN,CAAK,MAAMI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,GAChLK,IAAQ,+GAA+GF,CAAM,uBAAuBC,CAAK;AAC/J,aAAOE,EAAeD,GAAO,EAAE,SAAAf,GAAS;AAAA,IAC1C;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html as a } from "lit";
|
|
2
|
-
import { s as t, e as p } from "./mail-editor-
|
|
2
|
+
import { s as t, e as p } from "./mail-editor-D3QbvBKs.js";
|
|
3
3
|
const g = {
|
|
4
4
|
name: "timer",
|
|
5
5
|
label: "Timer",
|
|
@@ -51,4 +51,4 @@ const g = {
|
|
|
51
51
|
export {
|
|
52
52
|
g as timerTool
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=timer-tool-
|
|
54
|
+
//# sourceMappingURL=timer-tool-BUl5TiH0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer-tool-
|
|
1
|
+
{"version":3,"file":"timer-tool-BUl5TiH0.js","sources":["../src/tools/built-in/timer-tool.ts"],"sourcesContent":["/**\n * @module timer-tool\n *\n * Countdown timer display block.\n *\n * Email compatibility: Renders as a static styled block.\n * For live countdowns, integrate with a third-party countdown\n * image service (e.g. CountdownMail) in the `endDate` property.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport type { ContentValues } from '@emabuild/types';\nimport type { LitToolDefinition } from '../tool-registry.js';\nimport { str } from '../helpers/value-extractor.js';\nimport { emailTableCell } from '../helpers/email-html.js';\n\nexport const timerTool: LitToolDefinition = {\n name: 'timer',\n label: 'Timer',\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><polyline points=\"12 6 12 12 16 14\"/></svg>`,\n supportedDisplayModes: ['email', 'web'],\n position: 11,\n options: {\n timer: {\n title: 'Timer',\n options: {\n endDate: { label: 'End Date (ISO)', defaultValue: new Date(Date.now() + 7 * 86400000).toISOString().split('T')[0], widget: 'text' },\n expiredMessage: { label: 'Expired Message', defaultValue: 'This offer has expired', widget: 'text' },\n },\n },\n style: {\n title: 'Style',\n options: {\n textAlign: { label: 'Align', defaultValue: 'center', widget: 'alignment' },\n backgroundColor: { label: 'Background', defaultValue: '#1f2937', widget: 'color_picker' },\n textColor: { label: 'Text Color', defaultValue: '#ffffff', widget: 'color_picker' },\n fontSize: { label: 'Font Size', defaultValue: '32px', widget: 'text' },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'padding' } },\n },\n },\n defaultValues: {\n endDate: new Date(Date.now() + 7 * 86400000).toISOString().split('T')[0],\n expiredMessage: 'This offer has expired', textAlign: 'center',\n backgroundColor: '#1f2937', textColor: '#ffffff', fontSize: '32px', containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n const padding = str(values, 'containerPadding', '10px');\n const bg = str(values, 'backgroundColor', '#1f2937');\n const color = str(values, 'textColor', '#ffffff');\n const fontSize = str(values, 'fontSize', '32px');\n const align = str(values, 'textAlign', 'center');\n\n return html`<div style=\"padding:${padding};\"><div style=\"background:${bg};color:${color};font-size:${fontSize};text-align:${align};padding:20px;border-radius:4px;font-family:monospace;font-weight:bold;letter-spacing:4px;\">00 : 00 : 00 : 00<div style=\"font-size:11px;letter-spacing:8px;opacity:0.6;margin-top:4px;\">DAYS HRS MIN SEC</div></div></div>`;\n },\n renderHtml(values: ContentValues): string {\n const padding = str(values, 'containerPadding', '10px');\n const bg = str(values, 'backgroundColor', '#1f2937');\n const color = str(values, 'textColor', '#ffffff');\n const fontSize = str(values, 'fontSize', '32px');\n const align = str(values, 'textAlign', 'center');\n\n const inner = `<div style=\"background-color:${bg};color:${color};font-size:${fontSize};text-align:${align};padding:20px;border-radius:4px;font-family:'Courier New',monospace;font-weight:bold;letter-spacing:4px;\"><div>00 : 00 : 00 : 00</div><div style=\"font-size:11px;letter-spacing:8px;opacity:0.6;margin-top:4px;\">DAYS HRS MIN SEC</div></div>`;\n return emailTableCell(inner, { padding, align });\n },\n },\n};\n"],"names":["timerTool","values","padding","str","bg","color","fontSize","align","html","inner","emailTableCell"],"mappings":";;AAgBO,MAAMA,IAA+B;AAAA,EAC1C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,uBAAuB,CAAC,SAAS,KAAK;AAAA,EACtC,UAAU;AAAA,EACV,SAAS;AAAA,IACP,OAAO;AAAA,MACL,OAAO;AAAA,MACP,SAAS;AAAA,QACP,SAAS,EAAE,OAAO,kBAAkB,cAAc,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAQ,EAAE,cAAc,MAAM,GAAG,EAAE,CAAC,GAAG,QAAQ,OAAA;AAAA,QAC3H,gBAAgB,EAAE,OAAO,mBAAmB,cAAc,0BAA0B,QAAQ,OAAA;AAAA,MAAO;AAAA,IACrG;AAAA,IAEF,OAAO;AAAA,MACL,OAAO;AAAA,MACP,SAAS;AAAA,QACP,WAAW,EAAE,OAAO,SAAS,cAAc,UAAU,QAAQ,YAAA;AAAA,QAC7D,iBAAiB,EAAE,OAAO,cAAc,cAAc,WAAW,QAAQ,eAAA;AAAA,QACzE,WAAW,EAAE,OAAO,cAAc,cAAc,WAAW,QAAQ,eAAA;AAAA,QACnE,UAAU,EAAE,OAAO,aAAa,cAAc,QAAQ,QAAQ,OAAA;AAAA,MAAO;AAAA,IACvE;AAAA,IAEF,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS,EAAE,kBAAkB,EAAE,OAAO,WAAW,cAAc,QAAQ,QAAQ,UAAA,EAAU;AAAA,IAAE;AAAA,EAC7F;AAAA,EAEF,eAAe;AAAA,IACb,SAAS,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAQ,EAAE,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC;AAAA,IACvE,gBAAgB;AAAA,IAA0B,WAAW;AAAA,IACrD,iBAAiB;AAAA,IAAW,WAAW;AAAA,IAAW,UAAU;AAAA,IAAQ,kBAAkB;AAAA,EAAA;AAAA,EAExF,UAAU;AAAA,IACR,aAAaC,GAAuC;AAClD,YAAMC,IAAUC,EAAIF,GAAQ,oBAAoB,MAAM,GAChDG,IAAKD,EAAIF,GAAQ,mBAAmB,SAAS,GAC7CI,IAAQF,EAAIF,GAAQ,aAAa,SAAS,GAC1CK,IAAWH,EAAIF,GAAQ,YAAY,MAAM,GACzCM,IAAQJ,EAAIF,GAAQ,aAAa,QAAQ;AAE/C,aAAOO,wBAA2BN,CAAO,6BAA6BE,CAAE,UAAUC,CAAK,cAAcC,CAAQ,eAAeC,CAAK;AAAA,IACnI;AAAA,IACA,WAAWN,GAA+B;AACxC,YAAMC,IAAUC,EAAIF,GAAQ,oBAAoB,MAAM,GAChDG,IAAKD,EAAIF,GAAQ,mBAAmB,SAAS,GAC7CI,IAAQF,EAAIF,GAAQ,aAAa,SAAS,GAC1CK,IAAWH,EAAIF,GAAQ,YAAY,MAAM,GACzCM,IAAQJ,EAAIF,GAAQ,aAAa,QAAQ,GAEzCQ,IAAQ,gCAAgCL,CAAE,UAAUC,CAAK,cAAcC,CAAQ,eAAeC,CAAK;AACzG,aAAOG,EAAeD,GAAO,EAAE,SAAAP,GAAS,OAAAK,GAAO;AAAA,IACjD;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html as a } from "lit";
|
|
2
|
-
import { s as e, e as u } from "./mail-editor-
|
|
2
|
+
import { s as e, e as u } from "./mail-editor-D3QbvBKs.js";
|
|
3
3
|
function d(t) {
|
|
4
4
|
const i = t.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/);
|
|
5
5
|
return i ? `https://img.youtube.com/vi/${i[1]}/maxresdefault.jpg` : null;
|
|
@@ -49,4 +49,4 @@ const m = {
|
|
|
49
49
|
export {
|
|
50
50
|
m as videoTool
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=video-tool-
|
|
52
|
+
//# sourceMappingURL=video-tool-HOA8TCla.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-tool-
|
|
1
|
+
{"version":3,"file":"video-tool-HOA8TCla.js","sources":["../src/tools/built-in/video-tool.ts"],"sourcesContent":["/**\n * @module video-tool\n *\n * Video embed block with thumbnail and play button overlay.\n * Supports YouTube and Vimeo URLs with auto-thumbnail detection.\n *\n * Email compatibility: Video cannot play in email — renders as\n * a linked thumbnail image with a play button overlay.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport type { ContentValues, ExportRenderContext } from '@emabuild/types';\nimport type { LitToolDefinition } from '../tool-registry.js';\nimport { str } from '../helpers/value-extractor.js';\nimport { emailTableCell } from '../helpers/email-html.js';\n\n/** Extract YouTube video ID and return thumbnail URL */\nfunction getYouTubeThumbnail(url: string): string | null {\n const match = url.match(/(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/|youtube\\.com\\/embed\\/)([a-zA-Z0-9_-]{11})/);\n return match ? `https://img.youtube.com/vi/${match[1]}/maxresdefault.jpg` : null;\n}\n\nexport const videoTool: LitToolDefinition = {\n name: 'video',\n label: 'Video',\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"5 3 19 12 5 21 5 3\"/></svg>`,\n supportedDisplayModes: ['email', 'web'],\n position: 10,\n options: {\n video: {\n title: 'Video',\n options: {\n url: { label: 'Video URL', defaultValue: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', widget: 'text' },\n thumbnailUrl: { label: 'Thumbnail URL (auto)', defaultValue: '', widget: 'text' },\n alt: { label: 'Alt Text', defaultValue: 'Video', widget: 'text' },\n },\n },\n style: {\n title: 'Style',\n options: { textAlign: { label: 'Align', defaultValue: 'center', widget: 'alignment' } },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'padding' } },\n },\n },\n defaultValues: {\n url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',\n thumbnailUrl: '', alt: 'Video', textAlign: 'center', containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n const padding = str(values, 'containerPadding', '10px');\n const url = str(values, 'url');\n const thumbnail = str(values, 'thumbnailUrl') || getYouTubeThumbnail(url) || '';\n const align = str(values, 'textAlign', 'center');\n\n if (!thumbnail) {\n return html`<div style=\"padding:${padding};text-align:${align};\"><div style=\"background:#0f172a;border-radius:8px;padding:40px;text-align:center;color:white;font-family:sans-serif;\"><div style=\"font-size:48px;opacity:0.8;\">▶</div><div style=\"font-size:12px;margin-top:8px;opacity:0.6;\">${url || 'Enter video URL'}</div></div></div>`;\n }\n return html`<div style=\"padding:${padding};text-align:${align};\"><div style=\"position:relative;display:inline-block;max-width:100%;cursor:pointer;\"><img src=${thumbnail} alt=\"Video thumbnail\" style=\"display:block;max-width:100%;border-radius:4px;\" /><div style=\"position:absolute;inset:0;display:flex;align-items:center;justify-content:center;\"><div style=\"width:60px;height:60px;background:rgba(0,0,0,0.7);border-radius:50%;display:flex;align-items:center;justify-content:center;color:white;font-size:24px;\">▶</div></div></div></div>`;\n },\n renderHtml(values: ContentValues, ctx: ExportRenderContext): string {\n const padding = str(values, 'containerPadding', '10px');\n const url = str(values, 'url', '#');\n const thumbnail = str(values, 'thumbnailUrl') || getYouTubeThumbnail(url) || '';\n const alt = str(values, 'alt', 'Video');\n const align = str(values, 'textAlign', 'center');\n\n const imgTag = thumbnail\n ? `<img src=\"${thumbnail}\" alt=\"${alt}\" width=\"${ctx.columnWidth}\" style=\"display:block;max-width:100%;width:${ctx.columnWidth}px;border:0;\" />`\n : `<div style=\"background:#0f172a;padding:40px;text-align:center;color:white;font-family:arial,sans-serif;font-size:16px;\">▶ Watch Video</div>`;\n return emailTableCell(`<a href=\"${url}\" target=\"_blank\" style=\"text-decoration:none;\">${imgTag}</a>`, { padding, align });\n },\n },\n};\n"],"names":["getYouTubeThumbnail","url","match","videoTool","values","padding","str","thumbnail","align","html","ctx","alt","imgTag","emailTableCell"],"mappings":";;AAiBA,SAASA,EAAoBC,GAA4B;AACvD,QAAMC,IAAQD,EAAI,MAAM,kFAAkF;AAC1G,SAAOC,IAAQ,8BAA8BA,EAAM,CAAC,CAAC,uBAAuB;AAC9E;AAEO,MAAMC,IAA+B;AAAA,EAC1C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,uBAAuB,CAAC,SAAS,KAAK;AAAA,EACtC,UAAU;AAAA,EACV,SAAS;AAAA,IACP,OAAO;AAAA,MACL,OAAO;AAAA,MACP,SAAS;AAAA,QACP,KAAK,EAAE,OAAO,aAAa,cAAc,+CAA+C,QAAQ,OAAA;AAAA,QAChG,cAAc,EAAE,OAAO,wBAAwB,cAAc,IAAI,QAAQ,OAAA;AAAA,QACzE,KAAK,EAAE,OAAO,YAAY,cAAc,SAAS,QAAQ,OAAA;AAAA,MAAO;AAAA,IAClE;AAAA,IAEF,OAAO;AAAA,MACL,OAAO;AAAA,MACP,SAAS,EAAE,WAAW,EAAE,OAAO,SAAS,cAAc,UAAU,QAAQ,YAAA,EAAY;AAAA,IAAE;AAAA,IAExF,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS,EAAE,kBAAkB,EAAE,OAAO,WAAW,cAAc,QAAQ,QAAQ,UAAA,EAAU;AAAA,IAAE;AAAA,EAC7F;AAAA,EAEF,eAAe;AAAA,IACb,KAAK;AAAA,IACL,cAAc;AAAA,IAAI,KAAK;AAAA,IAAS,WAAW;AAAA,IAAU,kBAAkB;AAAA,EAAA;AAAA,EAEzE,UAAU;AAAA,IACR,aAAaC,GAAuC;AAClD,YAAMC,IAAUC,EAAIF,GAAQ,oBAAoB,MAAM,GAChDH,IAAMK,EAAIF,GAAQ,KAAK,GACvBG,IAAYD,EAAIF,GAAQ,cAAc,KAAKJ,EAAoBC,CAAG,KAAK,IACvEO,IAAQF,EAAIF,GAAQ,aAAa,QAAQ;AAE/C,aAAKG,IAGEE,wBAA2BJ,CAAO,eAAeG,CAAK,kGAAkGD,CAAS,kXAF/JE,wBAA2BJ,CAAO,eAAeG,CAAK,mOAAmOP,KAAO,iBAAiB;AAAA,IAG5T;AAAA,IACA,WAAWG,GAAuBM,GAAkC;AAClE,YAAML,IAAUC,EAAIF,GAAQ,oBAAoB,MAAM,GAChDH,IAAMK,EAAIF,GAAQ,OAAO,GAAG,GAC5BG,IAAYD,EAAIF,GAAQ,cAAc,KAAKJ,EAAoBC,CAAG,KAAK,IACvEU,IAAML,EAAIF,GAAQ,OAAO,OAAO,GAChCI,IAAQF,EAAIF,GAAQ,aAAa,QAAQ,GAEzCQ,IAASL,IACX,aAAaA,CAAS,UAAUI,CAAG,YAAYD,EAAI,WAAW,+CAA+CA,EAAI,WAAW,qBAC5H;AACJ,aAAOG,EAAe,YAAYZ,CAAG,mDAAmDW,CAAM,QAAQ,EAAE,SAAAP,GAAS,OAAAG,GAAO;AAAA,IAC1H;AAAA,EAAA;AAEJ;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emabuild/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Drag & drop email editor Web Component — embeddable anywhere",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"customElements": "custom-elements.json",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"lit": "^3.2.0",
|
|
27
|
-
"@emabuild/types": "0.0.
|
|
28
|
-
"@emabuild/email-renderer": "0.0.
|
|
27
|
+
"@emabuild/types": "0.0.8",
|
|
28
|
+
"@emabuild/email-renderer": "0.0.8"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"vite": "^6.2.0",
|
|
@@ -47,7 +47,10 @@
|
|
|
47
47
|
"email-template"
|
|
48
48
|
],
|
|
49
49
|
"license": "MIT",
|
|
50
|
-
"sideEffects":
|
|
50
|
+
"sideEffects": [
|
|
51
|
+
"./dist/index.js",
|
|
52
|
+
"./dist/mail-editor*.js"
|
|
53
|
+
],
|
|
51
54
|
"scripts": {
|
|
52
55
|
"build": "vite build",
|
|
53
56
|
"dev": "vite build --watch",
|