UNPKG

react-email-builder

Version:
1,164 lines (1,163 loc) 22.5 kB
.REB-vars { --reb-border-color: #e5e5e5; --reb-header-height: 48px; --reb-icon-dragged-bg-color: #eee; --reb-canvas-bg: #f5f5f5; --reb-link-color: #310af5; --reb-block-hover-outline-color: rgba(49, 10, 245, 0.3); --reb-block-selected-outline-color: #310af5; --reb-drop-area-border-color: #ddd; --reb-drop-area-active-border-color: #116ee0; --reb-drop-area-text-color: #fff; --reb-control-border-color: #d4d4d4; --reb-control-active-border-color: #444; --reb-control-hover-color: #f5f5f5; --reb-control-disabled-color: #f1f1f1; --reb-control-active-color: #eee; --reb-editor-font-family: Arial, Helvetica, sans-serif; color: #4a4a4a; font-size: 14px; font-family: Arial, helvetica, sans-serif; } .REB-EmailBuilder { display: flex; box-sizing: border-box; border: 1px solid var(--reb-border-color); } .REB-Sidebar { width: 300px; flex-grow: 0; flex-shrink: 0; min-width: 0; box-sizing: border-box; display: flex; flex-direction: column; } .REB-Sidebar-left { border-right: 1px solid var(--reb-border-color); } .REB-Sidebar-right { border-left: 1px solid var(--reb-border-color); } .REB-Sidebar-header { height: var(--reb-header-height); box-sizing: border-box; border-bottom: 1px solid var(--reb-border-color); flex-grow: 0; flex-shrink: 0; display: flex; } .REB-Sidebar-body { flex-grow: 1; flex-shrink: 1; min-height: 0; overflow: auto; position: relative; } .REB-Sidebar-tabs { margin: 0; padding: 0; list-style: none; display: flex; padding: 0 1px; } .REB-Sidebar-tab { margin: 0; padding: 0; display: flex; align-items: center; flex-grow: 0; flex-shrink: 0; padding: 0 13px; color: #666; cursor: pointer; border-bottom: 2px solid transparent; } .REB-Sidebar-tab-active { color: #000; border-bottom: 2px solid #000; } .REB-MainArea { flex-grow: 1; flex-shrink: 1; min-width: 0; display: flex; flex-direction: column; } .REB-MainArea-header { height: var(--reb-header-height); box-sizing: border-box; border-bottom: 1px solid var(--reb-border-color); flex-grow: 0; flex-shrink: 0; } .REB-MainArea-body { flex-grow: 1; flex-shrink: 1; min-height: 0; overflow: auto; background: var(--reb-canvas-bg); } .REB-MainArea-email-page { margin: 20px; min-height: calc(100% - 40px); box-sizing: border-box; min-width: 480px; } @keyframes reb-spinning { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .REB-Icon { width: 1em; height: 1em; } .REB-Icon-spinning { width: 1em; height: 1em; animation: reb-spinning 1s linear infinite; } .REB-BlockIcons { display: flex; padding: 16px; gap: 12px; flex-wrap: wrap; width: 264px; box-sizing: content-box; margin: 0 auto; } .REB-BlockIcons-body { cursor: grabbing; user-select: none; } .REB-BlockIcons-item { width: 80px; height: 80px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--reb-border-color); gap: 8px; flex-grow: 0; flex-shrink: 0; box-sizing: border-box; cursor: pointer; } .REB-BlockIcons-icon { font-size: 21px; display: flex; align-items: center; justify-content: center; } .REB-BlockIcons-name { text-align: center; line-height: 1.2; font-size: 14px; } .REB-BlockIcons-item-dragged { cursor: grabbing; opacity: 0.5; background: var(--reb-icon-dragged-bg-color); } .REB-BlockIcons-item-dragging { position: fixed; z-index: 2147483647; pointer-events: none; background: #fff; box-shadow: 0 1px 1px 5px rgba(0, 0, 0, 0.01); font-size: 14px; top: 0; left: 0; opacity: 0.9; } .REB-Columns-grid { display: grid; } .REB-Columns-grid-1 { grid-template-columns: 1fr; } .REB-Columns-grid-2 { grid-template-columns: repeat(2, 1fr); } .REB-Columns-grid-3 { grid-template-columns: repeat(3, 1fr); } .REB-Columns-grid-4 { grid-template-columns: repeat(4, 1fr); } .REB-Columns-grid-5 { grid-template-columns: repeat(5, 1fr); } .REB-Columns-grid-6 { grid-template-columns: repeat(6, 1fr); } .REB-Columns-not-allowed { position: relative; z-index: 1; } .REB-Columns-column { min-width: 0; min-height: 0; } .REB-Columns-column .REB-Block { z-index: 5; position: relative; } .REB-Columns-column .REB-Block-dragover, .REB-Columns-column .REB-Block-active { z-index: 6; } .REB-Block { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; word-break: break-word; } .REB-Block:hover { outline: 1px dashed var(--reb-block-hover-outline-color); } .REB-Block-selected:hover, .REB-Block-selected { outline: 2px solid var(--reb-block-selected-outline-color); } .REB-Block-section { max-width: 600px; margin: 0 auto; } .REB-Block-section-full { max-width: unset; } .REB-Block-active { z-index: 2; } .REB-Block-dragover { z-index: 2; } .REB-Block-drop-area { min-height: 10px; outline: none; } .REB-Block-drop-area:hover { outline: none; } .REB-Block-content { word-break: break-word; } .REB-Block-dragover .REB-Block-content { opacity: 0.5; } .REB-Block-drop-area .REB-Block-content { position: relative; z-index: 1; } .REB-Block-toolbar { position: absolute; top: 100%; left: -2px; right: -2px; z-index: 999; padding-top: 2px; overflow: auto; } .REB-Block-actions { background: #fff; border: 2px dashed #ddd; border-top: 0; padding: 5px 10px; display: flex; flex-wrap: nowrap; overflow: auto; gap: 4px; } .REB-Block-action { display: flex; flex-grow: 0; flex-shrink: 0; width: 24px; height: 24px; align-items: center; justify-content: center; cursor: pointer; border-radius: 4px; font-size: 14px; color: #333; } .REB-Block-action:hover { color: #000; background: var(--reb-control-hover-color); } .REB-Block-action-active, .REB-Block-action:active { background: var(--reb-control-active-color); } .REB-DropArea { --border-width: 2px; z-index: 2; position: absolute; top: 1px; right: 0; bottom: 1px; left: 0; } .REB-DropArea-dragover { z-index: 3; } .REB-DropArea-border { position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; left: 0; border: var(--border-width) dashed var(--reb-drop-area-border-color); } .REB-DropArea-active { border: var(--border-width) dashed var(--reb-drop-area-active-border-color); } .REB-DropArea-top { border-top-width: 4px; border-top-style: solid; } .REB-DropArea-bottom { border-bottom-width: 4px; border-bottom-style: solid; } .REB-DropArea-text { --offset: -8px; position: absolute; z-index: 2; display: none; height: 20px; background: transparent; left: 0; right: 0; text-align: center; font-size: 0; } .REB-DropArea-text span { display: inline-block; background: var(--reb-drop-area-active-border-color); color: var(--reb-drop-area-text-color); padding: 0 8px; font-size: 12px; line-height: 20px; border-radius: 10px; } .REB-DropArea-text-visible { display: block; } .REB-DropArea-text-top { top: var(--offset); } .REB-DropArea-text-bottom { bottom: var(--offset); } .REB-DropArea-text-center { top: 50%; transform: translateY(-10px); } .REB-Alert { padding: 8px 12px; border: 1px solid #f1aeb5; background: #f8d7da; border-radius: 4px; display: flex; gap: 8px; } .REB-Alert-body { flex-grow: 1; flex-shrink: 1; min-width: 0; } .REB-Alert-close { flex-grow: 0; flex-shrink: 0; } .REB-Alert-btn { font-size: 12px; line-height: 12px; color: #999; cursor: pointer; margin-top: 4px; } .REB-Alert-btn svg { display: block; } .REB-Alert-btn:hover { color: #000; } @keyframes reb-Button-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .REB-Button { padding: 10px; text-align: center; display: flex; gap: 8px; justify-content: center; cursor: pointer; line-height: 16px; background: #eee; color: #000; } .REB-Button-inline { display: inline-flex; padding: 10px 15px; } .REB-Button-small { padding: 5px 15px; font-size: 14px; } .REB-Button:hover { background: #ddd; } .REB-Button:active { background: #ccc; } .REB-Button-primary { background: #000; color: #fff; } .REB-Button-primary:hover { background: #222; } .REB-Button-primary:active { background: #444; } .REB-Button-loading { background: #444; cursor: not-allowed; } .REB-Button-loading:hover { background: #444; } .REB-Button-plain { padding: 0; background: inherit; color: inherit; gap: 4px; } .REB-Button-plain:hover, .REB-Button-plain:active { background: inherit; } .REB-Button-icon .REB-Icon { display: block; } .REB-Button-spin .REB-Icon { animation: reb-Button-spin 1s infinite linear; } .REB-Button-icon, .REB-Button-text { display: flex; flex-direction: column; justify-content: center; flex-grow: 0; flex-shrink: 0; } .REB-FileButton { position: relative; } .REB-FileButton-input { display: block; position: absolute; z-index: 2; opacity: 0; color: transparent; cursor: pointer; top: 0; bottom: 0; left: 0; right: 0; } .REB-FileButton-hidden { display: none; } .REB-Popover { position: absolute; top: 0; left: 0; z-index: 999; } .REB-Popover-arrow { --reb-arrow-color: #fff; --reb-arrow-border-color: var(--reb-control-border-color, #000); position: absolute; z-index: 1; width: 12px; height: 12px; box-sizing: border-box; border: 6px solid transparent; } .REB-Popover-arrow::before { content: ' '; display: block; width: 8px; height: 8px; box-sizing: border-box; border: 4px solid transparent; position: absolute; } .REB-Popover-arrow-top { border-bottom-color: var(--reb-arrow-border-color); top: -12px; } .REB-Popover-arrow-top::before { bottom: -6px; border-bottom-color: var(--reb-arrow-color); left: -4px; } .REB-Popover-arrow-bottom { border-top-color: var(--reb-arrow-border-color); bottom: -12px; } .REB-Popover-arrow-bottom::before { top: -6px; border-top-color: var(--reb-arrow-color); left: -4px; } .REB-Popover-arrow-left { left: -12px; border-right-color: var(--reb-arrow-border-color); } .REB-Popover-arrow-left::before { top: -4px; border-right-color: var(--reb-arrow-color); right: -6px; } .REB-Popover-arrow-right { right: -12px; border-left-color: var(--reb-arrow-border-color); } .REB-Popover-arrow-right::before { top: -4px; border-left-color: var(--reb-arrow-color); left: -6px; } .REB-Popover-body { position: relative; z-index: 2; } .REB-Popover-bg { background: #fff; border: 1px solid var(--reb-control-border-color); box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.1) 0px 4px 6px -4px; } .REB-Tooltip { background: rgba(0, 0, 0, 0.8); color: #fff; padding: 6px 10px; border-radius: 4px; } .REB-Tooltip .REB-Popover-arrow { --reb-arrow-color: rgba(0, 0, 0, 0.8); --reb-arrow-border-color: transparent; } .REB-ColorPalette { background: #000; width: 266px; } .REB-ColorPalette .react-colorful__saturation { border-radius: 0; border-bottom-width: 8px; } .REB-ColorPalette .react-colorful__hue { border-radius: 0; margin: 12px; margin-top: 8px; height: 16px; } .REB-ColorPalette .react-colorful__hue-pointer { border-radius: 3px; width: 12px; height: 20px; cursor: ew-resize; } .REB-ColorPalette .react-colorful__saturation-pointer { width: 20px; height: 20px; cursor: pointer; } .REB-ColorPalette-colors { gap: 5px; padding: 10px; display: grid; grid-template-columns: repeat(10, 1fr); background: #fff; } .REB-ColorPalette-color { cursor: pointer; width: 20px; height: 20px; border: 1px solid rgba(0, 0, 0, 0.15); box-sizing: border-box; padding: 1px; margin: 0 auto; } .REB-ColorPalette-color div { width: 16px; height: 16px; } .REB-ColorPalette-active { border: 1px solid rgba(0, 0, 0, 0.5); } .REB-ColorPalette-form { display: flex; padding: 2px 10px 10px 10px; background: #fff; gap: 6px; align-items: center; } .REB-ColorPalette-mode { flex-grow: 0; flex-shrink: 0; font-size: 13px; background: #eee; padding: 2px; border-radius: 4px; display: flex; gap: 4px; color: #666; } .REB-ColorPalette-mode div { line-height: 1; font-size: 12px; padding: 4px; border-radius: 4px; font-weight: bold; cursor: pointer; } .REB-ColorPalette-mode div:hover { color: #000; } .REB-ColorPalette-input { flex-grow: 1; flex-shrink: 1; } .REB-ColorPalette-input input { display: block; box-sizing: border-box; width: 100%; height: 24px; line-height: 22px; border: 1px solid var(--reb-control-border-color); border-radius: 4px; outline: 0; padding: 0 6px; font-size: 13px; } .REB-ColorPalette-input input:focus { border-color: var(--reb-control-active-border-color); } .REB-ColorPalette-preview { flex-grow: 0; flex-shrink: 0; width: 24px; height: 24px; box-sizing: border-box; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 2px; } .REB-ColorPalette-preview div { width: 20px; height: 20px; margin: 1px; border-radius: 2px; } .REB-ColorPalette-selected { background: #fff; color: #000; } .REB-ColorPicker { width: 32px; height: 32px; border: 1px solid var(--reb-control-border-color); display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; cursor: pointer; position: relative; } .REB-ColorPicker-color { width: 22px; height: 22px; line-height: 22px; text-align: center; color: #888; font-size: 16px; } .REB-ColorPicker-clear { position: absolute; display: block; width: 15px; height: 15px; top: -8px; right: -8px; font-size: 15px; } .REB-Field { display: flex; margin: 12px 0; padding-bottom: 5px; gap: 14px; } .REB-Field:first-child { margin-top: 0; } .REB-Field:last-child { margin-bottom: 0; padding-bottom: 0; } .REB-Field-label { flex-grow: 1; flex-shrink: 1; line-height: 32px; min-width: 0; } .REB-Field:hover .REB-Field-label { color: #000; } .REB-Field-input { flex-grow: 0; flex-shrink: 1; min-width: 0; } .REB-Field-vertical { display: block; } .REB-Field-vertical .REB-Field-label { line-height: 22px; margin-bottom: 8px; } .REB-Line { background: #eee; height: 1px; margin-top: 10px; margin-bottom: 16px; } .REB-FormSection-header { background: #f8f9fa; padding: 10px 16px; font-size: 12px; border-top: 1px solid #e5e6eb; cursor: pointer; display: flex; } .REB-FormSection-header:active { opacity: 0.8; } .REB-FormSection-header:last-child { border-bottom: 1px solid #e5e6eb; } .REB-FormSection-text { flex-grow: 1; flex-shrink: 1; } .REB-FormSection-icon { flex-grow: 0; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; font-size: 12px; color: #666; } .REB-FormSection-icon svg { display: block; } .REB-FormSection-section { border-top: 1px solid #e5e6eb; padding: 16px; } .REB-TextInput textarea, .REB-TextInput input { display: block; width: 100%; box-sizing: border-box; border-radius: 0; border: 1px solid var(--reb-control-border-color); padding: 5px 8px; resize: vertical; min-height: 34px; height: 34px; line-height: 22px; font-size: 14px; font-family: inherit; outline: none; } .REB-TextInput textarea:focus, .REB-TextInput input:focus { border-color: #000; } .REB-TextInput textarea { height: 56px; } .REB-SizeInput { display: flex; } .REB-SizeInput-input-box { display: flex; } .REB-SizeInput-input { position: relative; z-index: 2; } .REB-SizeInput-input input { height: 32px; box-sizing: border-box; border: 1px solid var(--reb-control-border-color); padding: 0 3px; width: 48px; text-align: center; } .REB-SizeInput-input input:focus { outline: 1px solid var(--reb-control-active-border-color); outline-offset: -1px; } .REB-SizeInput-unit { border: 1px solid var(--reb-control-border-color); line-height: 30px; height: 32px; border-left: 0; padding: 0 8px; box-sizing: border-box; background: var(--reb-control-disabled-color); } .REB-SizeInput-actions { display: flex; border: 1px solid var(--reb-control-border-color); line-height: 30px; height: 32px; box-sizing: border-box; margin-left: 5px; } .REB-SizeInput-action { width: 30px; text-align: center; cursor: pointer; user-select: none; } .REB-SizeInput-action:hover { background: var(--reb-control-hover-color); } .REB-SizeInput-action:active { background: var(--reb-control-active-color); } .REB-SizeInput-disabled, .REB-SizeInput-disabled input { cursor: not-allowed; background: var(--reb-control-disabled-color); color: #888; } .REB-SizeInput-disabled:hover, .REB-SizeInput-disabled input:hover, .REB-SizeInput-disabled:active, .REB-SizeInput-disabled input:active { background: var(--reb-control-disabled-color); } .REB-SizeInput-disabled input { color: #888; } .REB-SizeInput-sep { width: 1px; background-color: var(--reb-control-border-color); } .REB-Select { position: relative; z-index: 1; display: inline-block; border: 1px solid var(--reb-control-border-color); height: 32px; line-height: 30px; padding: 0 10px; box-sizing: border-box; display: flex; cursor: pointer; min-width: 1em; } .REB-Select:hover { background: var(--reb-control-hover-color); } .REB-Select:active { background: var(--reb-control-active-color); } .REB-Select-open { background: var(--reb-control-active-color); border-color: var(--reb-control-active-border-color); } .REB-Select-text { white-space: nowrap; flex-grow: 1; flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; } .REB-Select-icon { display: flex; flex-direction: column; justify-content: center; margin-left: 8px; } .REB-Select-caret, .REB-Select-clear { height: 14px; font-size: 14px; width: 14px; } .REB-Select-caret svg, .REB-Select-clear svg { display: block; } .REB-Select-clear { display: none; opacity: 0.65; } .REB-Select-clear:hover { opacity: 1; } .REB-Select-clearable:hover .REB-Select-caret { display: none; } .REB-Select-clearable:hover .REB-Select-clear { display: block; } .REB-Select-list { max-height: min(260px, 100vh); min-height: 30px; overflow: auto; } .REB-Select-option { padding: 10px 12px; display: flex; cursor: pointer; } .REB-Select-option:hover { background: var(--reb-control-hover-color); } .REB-Select-option:active { background: var(--reb-control-active-color); } .REB-Select-label { flex-grow: 1; flex-shrink: 1; white-space: nowrap; } .REB-Select-check { flex-grow: 0; flex-shrink: 0; display: flex; align-content: center; align-items: center; padding-left: 10px; min-width: 14px; box-sizing: content-box; } .REB-Placeholder { padding: 10px; border: 1px dashed var(--reb-border-color); text-align: center; } .REB-Placeholder-dragging { border-color: transparent; } .REB-Placeholder-dragover { opacity: 0.35; color: transparent; } .REB-TextBlock { position: relative; } .REB-TextBlock-wrapper { position: absolute; top: -39px; right: -2px; bottom: 28px; left: -2px; z-index: 2; pointer-events: none; background: transparent; } .REB-TextBlock-toolbar { background: #fff; border: 2px dashed #ddd; pointer-events: auto; position: sticky; z-index: 1; top: 0; } .REB-TextBlock-toolbar::after { display: block; content: ''; position: absolute; pointer-events: none; bottom: -2px; left: -2px; right: -2px; height: 2px; background: var(--reb-block-selected-outline-color); z-index: 2; } .REB-TextBlock-body { position: relative; z-index: 1; } .REB-Lexical-editor { font-family: var(--reb-editor-font-family); outline: none; min-height: 1em; position: relative; z-index: 2; background: transparent; line-height: 1.45; font-size: 14px; } .REB-Lexical-editor p { margin: 0; } .REB-Lexical-editor a { color: #0000ee; text-decoration: none; } .REB-Lexical-editor a:hover { text-decoration: underline; } .REB-Lexical-placeholder { position: absolute; line-height: 1.45; top: 0; left: 0; right: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; color: #aaa; z-index: 3; font-family: var(--reb-editor-font-family); font-size: 14px; } .REB-Lexical-text-underline { text-decoration: underline; } .REB-Lexical-text-strikethrough { text-decoration: line-through; } .REB-Lexical-text-underline-strikethrough { text-decoration: underline line-through; } .REB-Lexical-text-italic { font-style: italic; } .REB-VariableNode { background: #eee; padding: 4px 2px; border-radius: 4px; } .REB-ToolbarPlugin { display: flex; flex-wrap: nowrap; align-items: center; height: 36px; padding: 0 10px; gap: 2px; overflow: auto; } .REB-ToolbarPlugin-icon, .REB-ToolbarPlugin-dropdown { height: 28px; min-width: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 4px; color: #000; flex-grow: 0; flex-shrink: 0; } .REB-ToolbarPlugin-icon:hover, .REB-ToolbarPlugin-dropdown:hover { background: var(--reb-control-hover-color); } .REB-ToolbarPlugin-icon .REB-Icon, .REB-ToolbarPlugin-dropdown .REB-Icon { display: block; } .REB-ToolbarPlugin-active { color: #310af5; background: rgba(0, 0, 0, 0.03); } .REB-ToolbarPlugin-dropdown { padding: 0 6px; gap: 2px; } .REB-ToolbarPlugin-open { background: var(--reb-control-active-color); } .REB-ToolbarPlugin-input { min-width: 300px; padding: 20px; box-sizing: border-box; } .REB-ToolbarPlugin-label { display: flex; margin-bottom: 4px; } .REB-ToolbarPlugin-label > span { flex-grow: 1; } .REB-ToolbarPlugin-label > div { flex-grow: 0; flex-shrink: 0; color: var(--reb-link-color); } .REB-ToolbarPlugin-label > div:hover { opacity: 0.8; } .REB-ToolbarPlugin-options { max-height: 320px; overflow: auto; padding: 4px 0; } .REB-ToolbarPlugin-option { display: flex; align-items: center; gap: 8px; padding: 7px 20px; cursor: pointer; } .REB-ToolbarPlugin-option:hover { background: #f5f5f5; } .REB-ToolbarPlugin-option-text { max-width: calc(100vw - 40px); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .REB-ToolbarPlugin-selected { background: #eee; font-weight: bold; } .REB-TextEditor { border: 1px solid var(--reb-border-color); } .REB-TextEditor-toolbar { border-bottom: 1px solid var(--reb-border-color); } .REB-TextEditor-body { position: relative; }