\r\n \r\n \r\n ${values.content}\r\n \r\n \r\n \x3c!--[if mso]>`;\r\n \r\n return buttonHTML;\r\n }\r\n\r\n function generateNBIText(values) {\r\n const style = `\r\n ${cssAttr('color', values.textColor)}\r\n ${cssAttr('background-color', values.backgroundColor)}\r\n ${cssAttr('font-family', values.fontFamily?.value)}\r\n ${cssAttr('font-size', values.fontSize + 'px')}`;\r\n\r\n return `\r\n
${values.content}
\r\n
`;\r\n }\r\n\r\n\r\n function calculateButtonSize(values) {\r\n // Create a temp element for measuring the button size\r\n const tempDiv = document.createElement(\"div\");\r\n tempDiv.style.visibility = \"hidden\";\r\n tempDiv.style.position = \"absolute\";\r\n tempDiv.style.top = \"-9999px\";\r\n \r\n const buttonStyle = getNBIButtonStyle(values);\r\n const buttonHTML =\r\n `\r\n \r\n ${values.content}\r\n \r\n `;\r\n\r\n tempDiv.innerHTML = buttonHTML;\r\n const targetDiv = document.querySelector('#u_body');\r\n \r\n if (targetDiv) {\r\n targetDiv.appendChild(tempDiv);\r\n }\r\n else {\r\n document.body.appendChild(tempDiv);\r\n }\r\n\r\n // Get the width and height\r\n const buttonElement = tempDiv.querySelector(\"a\");\r\n const buttonWidth = buttonElement.offsetWidth;\r\n const buttonHeight = buttonElement.offsetHeight;\r\n\r\n tempDiv.remove();\r\n\r\n return { width: buttonWidth, height: buttonHeight };\r\n }\n\n /**\r\n * Note: after any changes to this file you must run `yarn unlayer-custom-tools` to create a bundle file\r\n */\r\n\r\n nbiTextConfig.enabled = nbiButtonConfig.enabled = false;\r\n\r\n\r\n nbiTextConfig.options.text.options.content = {\r\n label: 'Content',\r\n defaultValue: 'NBI Text',\r\n widget: 'rich_text',\r\n };\r\n\r\n nbiButtonConfig.options.text.options.content = {\r\n label: 'Title',\r\n defaultValue: 'NBI Button',\r\n widget: 'text',\r\n };\r\n\r\n nbiButtonConfig.options.text.options.actionType = {\r\n label: 'Action Type',\r\n defaultValue: {\r\n url: '',\r\n target: '_blank'\r\n },\r\n widget: 'link'\r\n };\r\n\r\n nbiTextConfig.enabled = nbiButtonConfig.enabled = true;\r\n\r\n unlayer.registerTool(nbiTextConfig);\r\n unlayer.registerTool(nbiButtonConfig);\n\n}());\n",VENUE_CUSTOM_TOOL="(function () {\n 'use strict';\n\n /**\r\n * Note: after any changes to this file you must run `yarn unlayer-custom-tools` to create a bundle file\r\n */\r\n\r\n const nbiTextConfig = {\r\n name: 'nbi_text',\r\n label: 'NBI Text',\r\n icon: 'fa-font-case',\r\n supportedDisplayModes: ['email'],\r\n options: {\r\n text: {\r\n title: 'Text Options',\r\n position: 1,\r\n options: {\r\n textColor: {\r\n label: 'Text Color',\r\n defaultValue: '',\r\n widget: 'color_picker',\r\n },\r\n backgroundColor: {\r\n label: 'Background Color',\r\n defaultValue: '',\r\n widget: 'color_picker',\r\n },\r\n fontFamily: {\r\n label: 'Font Family',\r\n defaultValue: {\r\n label: 'Lato',\r\n value: \"'Lato',sans-serif\"\r\n },\r\n widget: 'font_family',\r\n },\r\n fontSize: {\r\n label: 'Font Size',\r\n defaultValue: '14',\r\n widget: 'counter',\r\n },\r\n alignment: {\r\n label: 'Alignment',\r\n defaultValue: 'center',\r\n widget: 'alignment'\r\n }\r\n }\r\n }\r\n },\r\n values: {},\r\n renderer: {\r\n Viewer: unlayer.createViewer({\r\n render(values) {\r\n let hightlightContent = replaceTags(values.content);\r\n const style = `\r\n ${cssAttr('color', values.textColor)}\r\n ${cssAttr('background-color', values.backgroundColor)}\r\n ${cssAttr('font-family', values.fontFamily?.value)}\r\n ${cssAttr('font-size', values.fontSize + 'px')}`;\r\n\r\n return `\r\n
${hightlightContent}
\r\n
`;\r\n },\r\n }),\r\n exporters: {\r\n web: generateNBIText,\r\n email: generateNBIText,\r\n },\r\n head: {\r\n css: function (values) {},\r\n js: function (values) {},\r\n },\r\n }\r\n };\r\n\r\n\r\n const nbiButtonConfig = {\r\n name: 'nbi_button',\r\n label: 'NBI Button',\r\n icon: 'fa-rectangle-wide',\r\n supportedDisplayModes: ['email'],\r\n options: {\r\n text: {\r\n title: 'Options',\r\n position: 1,\r\n options: {\r\n textColor: {\r\n label: 'Text Color',\r\n defaultValue: '#fff',\r\n widget: 'color_picker',\r\n },\r\n backgroundColor: {\r\n label: 'Background Color',\r\n defaultValue: '#34495E',\r\n widget: 'color_picker',\r\n },\r\n fontFamily: {\r\n label: 'Font Family',\r\n defaultValue: {\r\n label: 'Lato',\r\n value: \"'Lato',sans-serif\"\r\n },\r\n widget: 'font_family',\r\n },\r\n fontWeight: {\r\n label: 'Font Weight',\r\n defaultValue: 'normal',\r\n widget: 'font_weight',\r\n },\r\n fontSize: {\r\n label: 'Font Size',\r\n defaultValue: '14',\r\n widget: 'counter',\r\n },\r\n alignment: {\r\n label: 'Alignment',\r\n defaultValue: 'center',\r\n widget: 'alignment'\r\n }\r\n },\r\n },\r\n },\r\n values: {},\r\n renderer: {\r\n Viewer: unlayer.createViewer({\r\n render(values) {\r\n return generateNBIButton(values);\r\n },\r\n }),\r\n exporters: {\r\n web: generateNBIButton,\r\n email: generateNBIButton\r\n },\r\n head: {\r\n css: function (values) {},\r\n js: function (values) {},\r\n },\r\n }\r\n };\r\n\r\n function replaceTags(str) {\r\n const regex = /(?');\r\n }\r\n\r\n function cssAttr(property, value) {\r\n return (value !== '') ? `${property}: ${value};` : '';\r\n }\r\n\r\n function tagAttr(attribute, value) {\r\n return (value) ? `${attribute}=\"${value}\"` : '';\r\n }\r\n\r\n function getNBIButtonStyle(values) {\r\n return `box-sizing:border-box; display:inline-block; text-decoration:none;\r\n -webkit-text-size-adjust:none; text-align:center; border-radius:4px;\r\n -webkit-border-radius:4px; -moz-border-radius:4px; width: auto;\r\n max-width:100%; overflow-wrap:break-word; word-break:break-word;\r\n word-wrap:break-word; mso-border-alt:none;\r\n ${cssAttr('color', values.textColor)} ${cssAttr('background-color', values.backgroundColor)}\r\n ${cssAttr('font-size', values.fontSize + 'px')} ${cssAttr('font-family', values.fontFamily?.value)} ${cssAttr('font-weight', values.fontWeight)}`;\r\n }\r\n\r\n function generateNBIButton(values) {\r\n const buttonSize = calculateButtonSize(values);\r\n const buttonStyle = getNBIButtonStyle(values);\r\n\r\n let url = values.actionType?.url == undefined ? values.actionType?.values?.href : values.actionType?.url;\r\n let target = values.actionType?.target == undefined ? values.actionType?.values?.target : values.actionType?.target;\r\n\r\n const buttonHTML = `\r\n \x3c!--[if mso]>\r\n \x3c!--[if mso]>\r\n \r\n \r\n \r\n \r\n ${values.content}\r\n \r\n \r\n \x3c!--[if mso]>`;\r\n \r\n return buttonHTML;\r\n }\r\n\r\n function generateNBIText(values) {\r\n const style = `\r\n ${cssAttr('color', values.textColor)}\r\n ${cssAttr('background-color', values.backgroundColor)}\r\n ${cssAttr('font-family', values.fontFamily?.value)}\r\n ${cssAttr('font-size', values.fontSize + 'px')}`;\r\n\r\n return `\r\n
${values.content}
\r\n
`;\r\n }\r\n\r\n\r\n function calculateButtonSize(values) {\r\n // Create a temp element for measuring the button size\r\n const tempDiv = document.createElement(\"div\");\r\n tempDiv.style.visibility = \"hidden\";\r\n tempDiv.style.position = \"absolute\";\r\n tempDiv.style.top = \"-9999px\";\r\n \r\n const buttonStyle = getNBIButtonStyle(values);\r\n const buttonHTML =\r\n `\r\n \r\n ${values.content}\r\n \r\n `;\r\n\r\n tempDiv.innerHTML = buttonHTML;\r\n const targetDiv = document.querySelector('#u_body');\r\n \r\n if (targetDiv) {\r\n targetDiv.appendChild(tempDiv);\r\n }\r\n else {\r\n document.body.appendChild(tempDiv);\r\n }\r\n\r\n // Get the width and height\r\n const buttonElement = tempDiv.querySelector(\"a\");\r\n const buttonWidth = buttonElement.offsetWidth;\r\n const buttonHeight = buttonElement.offsetHeight;\r\n\r\n tempDiv.remove();\r\n\r\n return { width: buttonWidth, height: buttonHeight };\r\n }\n\n /**\r\n * Note: after any changes to this file you must run `yarn unlayer-custom-tools` to create a bundle file\r\n */\r\n\r\n nbiTextConfig.enabled = nbiButtonConfig.enabled = false;\r\n\r\n unlayer.registerTool(nbiTextConfig);\r\n unlayer.registerTool(nbiButtonConfig);\n\n}());\n"