@emabuild/core 0.0.7 → 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.
@@ -1,5 +1,5 @@
1
1
  import { html as b } from "lit";
2
- import { s as o, j as f, e as u } from "./mail-editor-DNPaJKo3.js";
2
+ import { s as o, j as f, e as u } from "./mail-editor-D3QbvBKs.js";
3
3
  const n = [
4
4
  { label: "Name", name: "name", type: "text", placeholder: "Your name" },
5
5
  { label: "Email", name: "email", type: "email", placeholder: "your@email.com" }
@@ -66,4 +66,4 @@ const n = [
66
66
  export {
67
67
  y as formTool
68
68
  };
69
- //# sourceMappingURL=form-tool-BucdYK9Z.js.map
69
+ //# sourceMappingURL=form-tool-C9ccGMTE.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-tool-BucdYK9Z.js","sources":["../src/tools/built-in/form-tool.ts"],"sourcesContent":["/**\n * @module form-tool\n *\n * Input form with configurable fields and submit button.\n * Only available in \"web\" display mode (forms don't work in email).\n *\n * Email compatibility: N/A — this tool is for web/popup display mode only.\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 { FormField } from '../helpers/types.js';\n\nconst DEFAULT_FIELDS: FormField[] = [\n { label: 'Name', name: 'name', type: 'text', placeholder: 'Your name' },\n { label: 'Email', name: 'email', type: 'email', placeholder: 'your@email.com' },\n];\n\nexport const formTool: LitToolDefinition = {\n name: 'form',\n label: 'Form',\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=\"M7 7h10\"/><path d=\"M7 12h10\"/><path d=\"M7 17h6\"/></svg>`,\n supportedDisplayModes: ['web'],\n position: 13,\n options: {\n form: {\n title: 'Form',\n options: {\n actionUrl: { label: 'Action URL', defaultValue: '#', widget: 'text' },\n method: { label: 'Method', defaultValue: 'POST', widget: 'text' },\n submitText: { label: 'Submit Text', defaultValue: 'Submit', widget: 'text' },\n fields: { label: 'Fields (JSON)', defaultValue: JSON.stringify(DEFAULT_FIELDS), widget: 'rich_text' },\n },\n },\n style: {\n title: 'Style',\n options: {\n buttonBg: { label: 'Button Color', defaultValue: '#3b82f6', widget: 'color_picker' },\n buttonColor: { label: 'Button Text', defaultValue: '#ffffff', widget: 'color_picker' },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'padding' } },\n },\n },\n defaultValues: {\n actionUrl: '#', method: 'POST', submitText: 'Submit',\n fields: JSON.stringify(DEFAULT_FIELDS), buttonBg: '#3b82f6',\n buttonColor: '#ffffff', containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n const padding = str(values, 'containerPadding', '10px');\n const submitText = str(values, 'submitText', 'Submit');\n const btnBg = str(values, 'buttonBg', '#3b82f6');\n const btnColor = str(values, 'buttonColor', '#ffffff');\n const fields = jsonParse<FormField[]>(values.fields, DEFAULT_FIELDS);\n\n return html`\n <div style=\"padding:${padding};font-family:arial,sans-serif;\">\n ${fields.map((f) => html`\n <div style=\"margin-bottom:12px;\">\n <label style=\"display:block;font-size:13px;color:#374151;margin-bottom:4px;font-weight:500;\">${f.label}</label>\n <input type=${f.type || 'text'} placeholder=${f.placeholder || ''} style=\"width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px;box-sizing:border-box;\" />\n </div>\n `)}\n <button style=\"background:${btnBg};color:${btnColor};border:none;padding:10px 24px;border-radius:4px;font-size:14px;font-weight:600;cursor:pointer;\">${submitText}</button>\n </div>\n `;\n },\n renderHtml(values: ContentValues): string {\n const padding = str(values, 'containerPadding', '10px');\n const actionUrl = str(values, 'actionUrl', '#');\n const method = str(values, 'method', 'POST');\n const submitText = str(values, 'submitText', 'Submit');\n const btnBg = str(values, 'buttonBg', '#3b82f6');\n const btnColor = str(values, 'buttonColor', '#ffffff');\n const fields = jsonParse<FormField[]>(values.fields, DEFAULT_FIELDS);\n const font = 'font-family:arial,helvetica,sans-serif;';\n\n const fieldsHtml = fields.map((f) =>\n `<div style=\"margin-bottom:12px;\"><label style=\"display:block;font-size:13px;color:#374151;margin-bottom:4px;font-weight:500;${font}\">${f.label}</label><input type=\"${f.type || 'text'}\" name=\"${f.name}\" placeholder=\"${f.placeholder || ''}\" style=\"width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px;box-sizing:border-box;${font}\" /></div>`\n ).join('');\n\n const inner = `<form action=\"${actionUrl}\" method=\"${method}\">${fieldsHtml}<button type=\"submit\" style=\"background-color:${btnBg};color:${btnColor};border:none;padding:10px 24px;border-radius:4px;font-size:14px;font-weight:600;cursor:pointer;${font}\">${submitText}</button></form>`;\n return emailTableCell(inner, { padding });\n },\n },\n};\n"],"names":["DEFAULT_FIELDS","formTool","values","padding","str","submitText","btnBg","btnColor","fields","jsonParse","html","f","actionUrl","method","font","fieldsHtml","inner","emailTableCell"],"mappings":";;AAgBA,MAAMA,IAA8B;AAAA,EAClC,EAAE,OAAO,QAAQ,MAAM,QAAQ,MAAM,QAAQ,aAAa,YAAA;AAAA,EAC1D,EAAE,OAAO,SAAS,MAAM,SAAS,MAAM,SAAS,aAAa,iBAAA;AAC/D,GAEaC,IAA8B;AAAA,EACzC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,uBAAuB,CAAC,KAAK;AAAA,EAC7B,UAAU;AAAA,EACV,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,SAAS;AAAA,QACP,WAAW,EAAE,OAAO,cAAc,cAAc,KAAK,QAAQ,OAAA;AAAA,QAC7D,QAA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oGAAoGF,CAAU;AAAA;AAAA;AAAA,IAGvK;AAAA,IACA,WAAWH,GAA+B;AACxC,YAAMC,IAAUC,EAAIF,GAAQ,oBAAoB,MAAM,GAChDU,IAAYR,EAAIF,GAAQ,aAAa,GAAG,GACxCW,IAAST,EAAIF,GAAQ,UAAU,MAAM,GACrCG,IAAaD,EAAIF,GAAQ,cAAc,QAAQ,GAC/CI,IAAQF,EAAIF,GAAQ,YAAY,SAAS,GACzCK,IAAWH,EAAIF,GAAQ,eAAe,SAAS,GAC/CM,IAASC,EAAuBP,EAAO,QAAQF,CAAc,GAC7Dc,IAAO,2CAEPC,IAAaP,EAAO;AAAA,QAAI,CAACG,MAC7B,+HAA+HG,CAAI,KAAKH,EAAE,KAAK,wBAAwBA,EAAE,QAAQ,MAAM,WAAWA,EAAE,IAAI,kBAAkBA,EAAE,eAAe,EAAE,wHAAwHG,CAAI;AAAA,MAAA,EACzW,KAAK,EAAE,GAEHE,IAAQ,iBAAiBJ,CAAS,aAAaC,CAAM,KAAKE,CAAU,iDAAiDT,CAAK,UAAUC,CAAQ,kGAAkGO,CAAI,KAAKT,CAAU;AACvQ,aAAOY,EAAeD,GAAO,EAAE,SAAAb,GAAS;AAAA,IAC1C;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"form-tool-C9ccGMTE.js","sources":["../src/tools/built-in/form-tool.ts"],"sourcesContent":["/**\n * @module form-tool\n *\n * Input form with configurable fields and submit button.\n * Only available in \"web\" display mode (forms don't work in email).\n *\n * Email compatibility: N/A — this tool is for web/popup display mode only.\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 { FormField } from '../helpers/types.js';\n\nconst DEFAULT_FIELDS: FormField[] = [\n { label: 'Name', name: 'name', type: 'text', placeholder: 'Your name' },\n { label: 'Email', name: 'email', type: 'email', placeholder: 'your@email.com' },\n];\n\nexport const formTool: LitToolDefinition = {\n name: 'form',\n label: 'Form',\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=\"M7 7h10\"/><path d=\"M7 12h10\"/><path d=\"M7 17h6\"/></svg>`,\n supportedDisplayModes: ['web'],\n position: 13,\n options: {\n form: {\n title: 'Form',\n options: {\n actionUrl: { label: 'Action URL', defaultValue: '#', widget: 'text' },\n method: { label: 'Method', defaultValue: 'POST', widget: 'text' },\n submitText: { label: 'Submit Text', defaultValue: 'Submit', widget: 'text' },\n fields: { label: 'Fields (JSON)', defaultValue: JSON.stringify(DEFAULT_FIELDS), widget: 'rich_text' },\n },\n },\n style: {\n title: 'Style',\n options: {\n buttonBg: { label: 'Button Color', defaultValue: '#3b82f6', widget: 'color_picker' },\n buttonColor: { label: 'Button Text', defaultValue: '#ffffff', widget: 'color_picker' },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'padding' } },\n },\n },\n defaultValues: {\n actionUrl: '#', method: 'POST', submitText: 'Submit',\n fields: JSON.stringify(DEFAULT_FIELDS), buttonBg: '#3b82f6',\n buttonColor: '#ffffff', containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n const padding = str(values, 'containerPadding', '10px');\n const submitText = str(values, 'submitText', 'Submit');\n const btnBg = str(values, 'buttonBg', '#3b82f6');\n const btnColor = str(values, 'buttonColor', '#ffffff');\n const fields = jsonParse<FormField[]>(values.fields, DEFAULT_FIELDS);\n\n return html`\n <div style=\"padding:${padding};font-family:arial,sans-serif;\">\n ${fields.map((f) => html`\n <div style=\"margin-bottom:12px;\">\n <label style=\"display:block;font-size:13px;color:#374151;margin-bottom:4px;font-weight:500;\">${f.label}</label>\n <input type=${f.type || 'text'} placeholder=${f.placeholder || ''} style=\"width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px;box-sizing:border-box;\" />\n </div>\n `)}\n <button style=\"background:${btnBg};color:${btnColor};border:none;padding:10px 24px;border-radius:4px;font-size:14px;font-weight:600;cursor:pointer;\">${submitText}</button>\n </div>\n `;\n },\n renderHtml(values: ContentValues): string {\n const padding = str(values, 'containerPadding', '10px');\n const actionUrl = str(values, 'actionUrl', '#');\n const method = str(values, 'method', 'POST');\n const submitText = str(values, 'submitText', 'Submit');\n const btnBg = str(values, 'buttonBg', '#3b82f6');\n const btnColor = str(values, 'buttonColor', '#ffffff');\n const fields = jsonParse<FormField[]>(values.fields, DEFAULT_FIELDS);\n const font = 'font-family:arial,helvetica,sans-serif;';\n\n const fieldsHtml = fields.map((f) =>\n `<div style=\"margin-bottom:12px;\"><label style=\"display:block;font-size:13px;color:#374151;margin-bottom:4px;font-weight:500;${font}\">${f.label}</label><input type=\"${f.type || 'text'}\" name=\"${f.name}\" placeholder=\"${f.placeholder || ''}\" style=\"width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px;box-sizing:border-box;${font}\" /></div>`\n ).join('');\n\n const inner = `<form action=\"${actionUrl}\" method=\"${method}\">${fieldsHtml}<button type=\"submit\" style=\"background-color:${btnBg};color:${btnColor};border:none;padding:10px 24px;border-radius:4px;font-size:14px;font-weight:600;cursor:pointer;${font}\">${submitText}</button></form>`;\n return emailTableCell(inner, { padding });\n },\n },\n};\n"],"names":["DEFAULT_FIELDS","formTool","values","padding","str","submitText","btnBg","btnColor","fields","jsonParse","html","f","actionUrl","method","font","fieldsHtml","inner","emailTableCell"],"mappings":";;AAgBA,MAAMA,IAA8B;AAAA,EAClC,EAAE,OAAO,QAAQ,MAAM,QAAQ,MAAM,QAAQ,aAAa,YAAA;AAAA,EAC1D,EAAE,OAAO,SAAS,MAAM,SAAS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AIF,GAAQ,eAAe,SAAS,GAC/CM,IAASC,EAAuBP,EAAO,QAAQF,CAAc;AAEnE,aAAOU;AAAA,8BACiBP,CAAO;AAAA,YACzBK,EAAO,IAAI,CAACG,MAAMD;AAAA;AAAA,6GAE+EC,EAAE,KAAK;AAAA,4BACxFA,EAAE,QAAQ,MAAM,gBAAgBA,EAAE,eAAe,EAAE;AAAA;AAAA,WAEpE,CAAC;AAAA,sCAC0BL,CAAK,UAAUC,CAAQ,oGAAoGF,CAAU;AAAA;AAAA;AAAA,IAGvK;AAAA,IACA,WAAWH,GAA+B;AACxC,YAAMC,IAAUC,EAAIF,GAAQ,oBAAoB,MAAM,GAChDU,IAAYR,EAAIF,GAAQ,aAAa,GAAG,GACxCW,IAAST,EAAIF,GAAQ,UAAU,MAAM,GACrCG,IAAaD,EAAIF,GAAQ,cAAc,QAAQ,GAC/CI,IAAQF,EAAIF,GAAQ,YAAY,SAAS,GACzCK,IAAWH,EAAIF,GAAQ,eAAe,SAAS,GAC/CM,IAASC,EAAuBP,EAAO,QAAQF,CAAc,GAC7Dc,IAAO,2CAEPC,IAAaP,EAAO;AAAA,QAAI,CAACG,MAC7B,+HAA+HG,CAAI,KAAKH,EAAE,KAAK,wBAAwBA,EAAE,QAAQ,MAAM,WAAWA,EAAE,IAAI,kBAAkBA,EAAE,eAAe,EAAE,wHAAwHG,CAAI;AAAA,MAAA,EACzW,KAAK,EAAE,GAEHE,IAAQ,iBAAiBJ,CAAS,aAAaC,CAAM,KAAKE,CAAU,iDAAiDT,CAAK,UAAUC,CAAQ,kGAAkGO,CAAI,KAAKT,CAAU;AACvQ,aAAOY,EAAeD,GAAO,EAAE,SAAAb,GAAS;AAAA,IAC1C;AAAA,EAAA;AAEJ;"}
@@ -1,6 +1,6 @@
1
1
  import { html as l } from "lit";
2
2
  import { unsafeHTML as i } from "lit/directives/unsafe-html.js";
3
- import { e as o, s as t } from "./mail-editor-DNPaJKo3.js";
3
+ import { e as o, s as t } from "./mail-editor-D3QbvBKs.js";
4
4
  const r = {
5
5
  name: "html",
6
6
  label: "HTML",
@@ -46,4 +46,4 @@ const r = {
46
46
  export {
47
47
  r as htmlTool
48
48
  };
49
- //# sourceMappingURL=html-tool-CDX3fL-9.js.map
49
+ //# sourceMappingURL=html-tool-Dx0bJnRa.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"html-tool-CDX3fL-9.js","sources":["../src/tools/built-in/html-tool.ts"],"sourcesContent":["/**\n * @module html-tool\n *\n * Raw HTML content block for custom code injection.\n *\n * Email compatibility: Content is inserted as-is inside a table cell.\n * The user is responsible for email-safe HTML in this block.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\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 htmlTool: LitToolDefinition = {\n name: 'html',\n label: 'HTML',\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\"><polyline points=\"16 18 22 12 16 6\"/><polyline points=\"8 6 2 12 8 18\"/></svg>`,\n supportedDisplayModes: ['email', 'web'],\n position: 6,\n options: {\n html: {\n title: 'HTML',\n options: {\n html: {\n label: 'Custom HTML',\n defaultValue: '<div style=\"padding:20px;text-align:center;color:#999;\">Custom HTML Block</div>',\n widget: 'rich_text',\n },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'text' } },\n },\n general: {\n title: 'General',\n options: {\n hideDesktop: { label: 'Hide on Desktop', defaultValue: false, widget: 'toggle' },\n hideMobile: { label: 'Hide on Mobile', defaultValue: false, widget: 'toggle' },\n },\n },\n },\n defaultValues: {\n html: '<div style=\"padding:20px;text-align:center;color:#999;\">Custom HTML Block</div>',\n containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n return html`<div style=\"padding:${str(values, 'containerPadding', '10px')};\">${unsafeHTML(str(values, 'html'))}</div>`;\n },\n renderHtml(values: ContentValues): string {\n return emailTableCell(str(values, 'html'), { padding: str(values, 'containerPadding', '10px') });\n },\n },\n};\n"],"names":["htmlTool","values","html","str","unsafeHTML","emailTableCell"],"mappings":";;;AAgBO,MAAMA,IAA8B;AAAA,EACzC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,uBAAuB,CAAC,SAAS,KAAK;AAAA,EACtC,UAAU;AAAA,EACV,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,SAAS;AAAA,QACP,MAAM;AAAA,UACJ,OAAO;AAAA,UACP,cAAc;AAAA,UACd,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IACF;AAAA,IAEF,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS,EAAE,kBAAkB,EAAE,OAAO,WAAW,cAAc,QAAQ,QAAQ,OAAA,EAAO;AAAA,IAAE;AAAA,IAE1F,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS;AAAA,QACP,aAAa,EAAE,OAAO,mBAAmB,cAAc,IAAO,QAAQ,SAAA;AAAA,QACtE,YAAY,EAAE,OAAO,kBAAkB,cAAc,IAAO,QAAQ,SAAA;AAAA,MAAS;AAAA,IAC/E;AAAA,EACF;AAAA,EAEF,eAAe;AAAA,IACb,MAAM;AAAA,IACN,kBAAkB;AAAA,EAAA;AAAA,EAEpB,UAAU;AAAA,IACR,aAAaC,GAAuC;AAClD,aAAOC,wBAA2BC,EAAIF,GAAQ,oBAAoB,MAAM,CAAC,MAAMG,EAAWD,EAAIF,GAAQ,MAAM,CAAC,CAAC;AAAA,IAChH;AAAA,IACA,WAAWA,GAA+B;AACxC,aAAOI,EAAeF,EAAIF,GAAQ,MAAM,GAAG,EAAE,SAASE,EAAIF,GAAQ,oBAAoB,MAAM,EAAA,CAAG;AAAA,IACjG;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"html-tool-Dx0bJnRa.js","sources":["../src/tools/built-in/html-tool.ts"],"sourcesContent":["/**\n * @module html-tool\n *\n * Raw HTML content block for custom code injection.\n *\n * Email compatibility: Content is inserted as-is inside a table cell.\n * The user is responsible for email-safe HTML in this block.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\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 htmlTool: LitToolDefinition = {\n name: 'html',\n label: 'HTML',\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\"><polyline points=\"16 18 22 12 16 6\"/><polyline points=\"8 6 2 12 8 18\"/></svg>`,\n supportedDisplayModes: ['email', 'web'],\n position: 6,\n options: {\n html: {\n title: 'HTML',\n options: {\n html: {\n label: 'Custom HTML',\n defaultValue: '<div style=\"padding:20px;text-align:center;color:#999;\">Custom HTML Block</div>',\n widget: 'rich_text',\n },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'text' } },\n },\n general: {\n title: 'General',\n options: {\n hideDesktop: { label: 'Hide on Desktop', defaultValue: false, widget: 'toggle' },\n hideMobile: { label: 'Hide on Mobile', defaultValue: false, widget: 'toggle' },\n },\n },\n },\n defaultValues: {\n html: '<div style=\"padding:20px;text-align:center;color:#999;\">Custom HTML Block</div>',\n containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n return html`<div style=\"padding:${str(values, 'containerPadding', '10px')};\">${unsafeHTML(str(values, 'html'))}</div>`;\n },\n renderHtml(values: ContentValues): string {\n return emailTableCell(str(values, 'html'), { padding: str(values, 'containerPadding', '10px') });\n },\n },\n};\n"],"names":["htmlTool","values","html","str","unsafeHTML","emailTableCell"],"mappings":";;;AAgBO,MAAMA,IAA8B;AAAA,EACzC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,uBAAuB,CAAC,SAAS,KAAK;AAAA,EACtC,UAAU;AAAA,EACV,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,SAAS;AAAA,QACP,MAAM;AAAA,UACJ,OAAO;AAAA,UACP,cAAc;AAAA,UACd,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IACF;AAAA,IAEF,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS,EAAE,kBAAkB,EAAE,OAAO,WAAW,cAAc,QAAQ,QAAQ,OAAA,EAAO;AAAA,IAAE;AAAA,IAE1F,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS;AAAA,QACP,aAAa,EAAE,OAAO,mBAAmB,cAAc,IAAO,QAAQ,SAAA;AAAA,QACtE,YAAY,EAAE,OAAO,kBAAkB,cAAc,IAAO,QAAQ,SAAA;AAAA,MAAS;AAAA,IAC/E;AAAA,EACF;AAAA,EAEF,eAAe;AAAA,IACb,MAAM;AAAA,IACN,kBAAkB;AAAA,EAAA;AAAA,EAEpB,UAAU;AAAA,IACR,aAAaC,GAAuC;AAClD,aAAOC,wBAA2BC,EAAIF,GAAQ,oBAAoB,MAAM,CAAC,MAAMG,EAAWD,EAAIF,GAAQ,MAAM,CAAC,CAAC;AAAA,IAChH;AAAA,IACA,WAAWA,GAA+B;AACxC,aAAOI,EAAeF,EAAIF,GAAQ,MAAM,GAAG,EAAE,SAASE,EAAIF,GAAQ,oBAAoB,MAAM,EAAA,CAAG;AAAA,IACjG;AAAA,EAAA;AAEJ;"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as t, M as e, T as a } from "./mail-editor-DNPaJKo3.js";
1
+ import { E as t, M as e, T as a } from "./mail-editor-D3QbvBKs.js";
2
2
  export {
3
3
  t as EditorStore,
4
4
  e as MailEditorElement,
@@ -1215,31 +1215,31 @@ const tt = {
1215
1215
  ], P = [
1216
1216
  {
1217
1217
  meta: { name: "html", label: "HTML", 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"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>', position: 6 },
1218
- loader: () => import("./html-tool-CDX3fL-9.js").then((e) => e.htmlTool)
1218
+ loader: () => import("./html-tool-Dx0bJnRa.js").then((e) => e.htmlTool)
1219
1219
  },
1220
1220
  {
1221
1221
  meta: { name: "social", label: "Social", 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>', position: 8 },
1222
- loader: () => import("./social-tool-B4BUlJ2I.js").then((e) => e.socialTool)
1222
+ loader: () => import("./social-tool-_2fRc5-k.js").then((e) => e.socialTool)
1223
1223
  },
1224
1224
  {
1225
1225
  meta: { name: "menu", label: "Menu", 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>', position: 9 },
1226
- loader: () => import("./menu-tool-BrT6-Pvh.js").then((e) => e.menuTool)
1226
+ loader: () => import("./menu-tool-D34uGd81.js").then((e) => e.menuTool)
1227
1227
  },
1228
1228
  {
1229
1229
  meta: { name: "video", label: "Video", 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>', position: 10 },
1230
- loader: () => import("./video-tool-CwWMKobZ.js").then((e) => e.videoTool)
1230
+ loader: () => import("./video-tool-HOA8TCla.js").then((e) => e.videoTool)
1231
1231
  },
1232
1232
  {
1233
1233
  meta: { name: "timer", label: "Timer", 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>', position: 11 },
1234
- loader: () => import("./timer-tool-3mF08efm.js").then((e) => e.timerTool)
1234
+ loader: () => import("./timer-tool-BUl5TiH0.js").then((e) => e.timerTool)
1235
1235
  },
1236
1236
  {
1237
1237
  meta: { name: "table", label: "Table", 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>', position: 12 },
1238
- loader: () => import("./table-tool-Bo_g3Un_.js").then((e) => e.tableTool)
1238
+ loader: () => import("./table-tool-B_MVWfF5.js").then((e) => e.tableTool)
1239
1239
  },
1240
1240
  {
1241
1241
  meta: { name: "form", label: "Form", 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="M7 7h10"/><path d="M7 12h10"/><path d="M7 17h6"/></svg>', position: 13 },
1242
- loader: () => import("./form-tool-BucdYK9Z.js").then((e) => e.formTool)
1242
+ loader: () => import("./form-tool-C9ccGMTE.js").then((e) => e.formTool)
1243
1243
  }
1244
1244
  ];
1245
1245
  function lt(e, t, o) {
@@ -1542,6 +1542,7 @@ _.styles = z`
1542
1542
  display: flex;
1543
1543
  width: 100%;
1544
1544
  height: 100%;
1545
+ flex: 1;
1545
1546
  min-height: 500px;
1546
1547
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
1547
1548
  color: #111827;
@@ -1565,4 +1566,4 @@ export {
1565
1566
  bt as j,
1566
1567
  s
1567
1568
  };
1568
- //# sourceMappingURL=mail-editor-DNPaJKo3.js.map
1569
+ //# sourceMappingURL=mail-editor-D3QbvBKs.js.map