@lab2view/vue-email-editor 0.1.0
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/LICENSE +21 -0
- package/README.md +386 -0
- package/dist/CodeEditor-DMG_wAzo.js +14076 -0
- package/dist/email-editor.css +1 -0
- package/dist/email-editor.d.ts +540 -0
- package/dist/email-editor.js +32 -0
- package/dist/index-CJIiXHwY.js +60121 -0
- package/package.json +72 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ebb-toolbar{display:flex;align-items:center;justify-content:space-between;height:48px;padding:0 12px;background:#fff;border-bottom:1px solid #e5e7eb;flex-shrink:0}html[data-theme=dark] .ebb-toolbar{background:#1f2937;border-bottom-color:#374151}.ebb-toolbar__left{display:flex;align-items:center;gap:4px}.ebb-toolbar__group{display:flex;align-items:center;gap:2px}.ebb-toolbar__device-group{display:flex;align-items:center;gap:1px;background:#f3f4f6;border-radius:8px;padding:3px}html[data-theme=dark] .ebb-toolbar__device-group{background:#111827}.ebb-toolbar__device-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:30px;padding:0 10px;border-radius:6px;border:none;background:transparent;color:#6b7280;cursor:pointer;transition:all .15s ease}.ebb-toolbar__device-label{font-size:11px;font-weight:500}.ebb-toolbar__device-btn:hover{color:#374151;background:#0000000a}html[data-theme=dark] .ebb-toolbar__device-btn:hover{color:#e5e7eb;background:#ffffff0f}.ebb-toolbar__device-btn--active{background:#fff;color:var(--ee-primary);box-shadow:0 1px 3px #0000001a}html[data-theme=dark] .ebb-toolbar__device-btn--active{background:#374151;color:var(--ee-primary)}.ebb-toolbar__title{font-size:13px;font-weight:600;color:#374151;letter-spacing:-.01em}html[data-theme=dark] .ebb-toolbar__title{color:#d1d5db}.ebb-toolbar__action-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;border:none;background:transparent;color:#6b7280;cursor:pointer;transition:all .15s ease}.ebb-toolbar__action-btn:hover{background:#f3f4f6;color:#111827}html[data-theme=dark] .ebb-toolbar__action-btn:hover{background:#374151;color:#f3f4f6}.ebb-toolbar__action-btn--active{background:#01a8ab1f;color:var(--ee-primary)}.ebb-toolbar__action-btn--disabled{opacity:.35;cursor:default;pointer-events:none}.ebb-toolbar__divider{width:1px;height:20px;background:#e5e7eb;margin:0 6px}html[data-theme=dark] .ebb-toolbar__divider{background:#374151}.ebb-overlay{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:5}.ebb-overlay__hover{position:absolute;border:1px dashed color-mix(in srgb,var(--ee-hover) 40%,transparent);pointer-events:none;transition:all .1s ease}.ebb-overlay__selection{position:absolute;border:2px solid var(--ee-selection);pointer-events:none}.ebb-overlay__toolbar{position:absolute;top:-28px;left:0;display:flex;align-items:center;gap:2px;background:var(--ee-primary);border-radius:4px;padding:2px 4px;pointer-events:auto;box-shadow:0 2px 6px #00000026}.ebb-overlay__label{font-size:10px;font-weight:600;color:#fff;padding:0 4px;white-space:nowrap}.ebb-overlay__btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:none;background:transparent;color:#fffc;cursor:pointer;border-radius:3px;transition:all .1s ease}.ebb-overlay__btn:hover{background:#fff3;color:#fff}.ebb-overlay__btn--danger:hover{background:#ff00004d}.ebb-overlay__sep{width:1px;height:12px;background:#ffffff40;margin:0 2px}.ebb-overlay__drop-indicator{position:absolute;background:var(--ee-drop-indicator);pointer-events:none;z-index:10;transition:top .08s ease,left .08s ease,width .08s ease;box-shadow:0 0 8px #01a8ab66}.ebb-overlay__drop-indicator-dot{position:absolute;width:8px;height:8px;background:var(--ee-drop-indicator);border:2px solid #ffffff;border-radius:50%;top:50%;transform:translateY(-50%);box-shadow:0 1px 3px #0003}.ebb-overlay__drop-indicator-dot--left{left:-4px}.ebb-overlay__drop-indicator-dot--right{right:-4px}.ebb-overlay__drag-active{position:absolute;top:0;right:0;bottom:0;left:0;border:2px dashed rgba(1,168,171,.25);border-radius:4px;pointer-events:none;animation:ebb-drag-pulse 1.5s ease-in-out infinite}@keyframes ebb-drag-pulse{0%,to{border-color:#01a8ab26}50%{border-color:#01a8ab59}}.ebb-inline-toolbar{display:flex;align-items:center;gap:2px;padding:4px 6px;background:#1f2937;border-radius:8px;box-shadow:0 4px 16px #00000040;-webkit-user-select:none;user-select:none}.ebb-inline-toolbar__btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;background:transparent;color:#d1d5db;cursor:pointer;border-radius:4px;transition:all .1s ease}.ebb-inline-toolbar__btn:hover{background:#ffffff1a;color:#fff}.ebb-inline-toolbar__btn--active{background:#01a8ab4d;color:var(--ee-primary)}.ebb-inline-toolbar__sep{width:1px;height:18px;background:#374151;margin:0 2px}.ebb-inline-toolbar__color{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;cursor:pointer;color:#d1d5db;position:relative}.ebb-inline-toolbar__color:hover{color:#fff}.ebb-inline-toolbar__color input[type=color]{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;cursor:pointer;width:100%;height:100%}.ebb-inline-editor-wrapper{position:absolute;top:0;right:0;bottom:0;left:0;z-index:20}.ebb-inline-editor__backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0}.ebb-inline-editor__toolbar-pos{position:absolute;z-index:2;display:flex;justify-content:center}.ebb-inline-editor{position:absolute;z-index:1;background:#fff;border:2px solid var(--ee-primary);border-radius:4px;overflow:auto;box-shadow:0 4px 16px #00000026}.ebb-inline-editor__content{outline:none;padding:4px 8px;min-height:24px;font-family:Helvetica,Arial,sans-serif;font-size:14px;color:#333;line-height:1.5}.ebb-inline-editor__content p{margin:0}.ebb-inline-editor__content a{color:var(--ee-primary);text-decoration:underline}.ebb-inline-editor__content h1,.ebb-inline-editor__content h2,.ebb-inline-editor__content h3,.ebb-inline-editor__content h4{margin:0;line-height:1.3}.ebb-canvas{flex:1;position:relative;background:#e5e7eb;background-image:radial-gradient(circle,#d1d5db .5px,transparent .5px);background-size:16px 16px;overflow:auto;display:flex;justify-content:center;padding:24px 0}html[data-theme=dark] .ebb-canvas{background-color:#1a1f2e;background-image:radial-gradient(circle,#2d3348 .5px,transparent .5px)}.ebb-canvas__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#f9fafb;color:#6b7280;font-size:13px}html[data-theme=dark] .ebb-canvas__loading{background:#111827;color:#9ca3af}.ebb-canvas__spinner{width:32px;height:32px;border:3px solid #e5e7eb;border-top-color:var(--ee-primary);border-radius:50%;animation:ebb-spin .8s linear infinite}@keyframes ebb-spin{to{transform:rotate(360deg)}}.ebb-canvas__iframe-wrapper{position:relative;min-height:200px;max-width:100%;flex-shrink:0;transition:width .3s ease;box-shadow:0 1px 4px #00000014,0 4px 16px #0000000f;border-radius:4px;overflow:hidden}html[data-theme=dark] .ebb-canvas__iframe-wrapper{box-shadow:0 1px 4px #0003,0 4px 16px #00000026}.ebb-canvas__iframe{width:100%;height:100%;border:none;background:#fff;display:block}.ebb-canvas__drag-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:5;cursor:copy;background:#01a8ab05}.ebb-block-preview{width:100%;height:auto;display:block}.ebb-block-card{display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px 4px 5px;border:1px solid #e5e7eb;border-radius:8px;cursor:grab;transition:all .15s ease;background:#fff}html[data-theme=dark] .ebb-block-card{border-color:#374151;background:#1f2937}.ebb-block-card:hover{border-color:var(--ee-primary);background:#f0fdfd;box-shadow:0 2px 8px #01a8ab1a}html[data-theme=dark] .ebb-block-card:hover{background:#0d3d3e}.ebb-block-card:active{cursor:grabbing;transform:scale(.96)}.ebb-block-card--dragging{opacity:.4;border-color:var(--ee-primary);background:#01a8ab0d;transform:scale(.95)}.ebb-block-card__preview{width:100%;border-radius:4px;overflow:hidden;background:#f9fafb}html[data-theme=dark] .ebb-block-card__preview{background:#111827}.ebb-block-card__label{font-size:10px;font-weight:500;color:#374151;text-align:center;line-height:1.2;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}html[data-theme=dark] .ebb-block-card__label{color:#d1d5db}.ebb-block-category{border-bottom:1px solid #e5e7eb}html[data-theme=dark] .ebb-block-category{border-color:#374151}.ebb-block-category__header{display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;border:none;background:#fafafa;cursor:pointer;font-size:12px;font-weight:600;color:#374151;transition:background .1s ease}html[data-theme=dark] .ebb-block-category__header{color:#d1d5db;background:#111827}.ebb-block-category__header:hover{background:#f3f4f6}html[data-theme=dark] .ebb-block-category__header:hover{background:#1f2937}.ebb-block-category__label{flex:1;text-align:left}.ebb-block-category__count{font-size:10px;font-weight:500;color:#9ca3af;background:#f3f4f6;border-radius:10px;padding:1px 7px}html[data-theme=dark] .ebb-block-category__count{background:#1f2937}.ebb-block-category__chevron{color:#9ca3af}.ebb-block-category__grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:8px 10px 10px}.ebb-block-category__grid--2col{grid-template-columns:repeat(2,1fr)}.ebb-templates-panel{padding:12px}.ebb-templates-panel__header{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:#374151;margin-bottom:6px}html[data-theme=dark] .ebb-templates-panel__header{color:#d1d5db}.ebb-templates-panel__hint{font-size:11px;color:#9ca3af;margin:0 0 12px;line-height:1.4}.ebb-templates-panel__grid{display:flex;flex-direction:column;gap:6px}.ebb-template-card{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;cursor:pointer;text-align:left;transition:all .15s ease}html[data-theme=dark] .ebb-template-card{border-color:#374151;background:#1f2937}.ebb-template-card:hover{border-color:var(--ee-primary);background:#f0fdfd;box-shadow:0 2px 8px #01a8ab1a}html[data-theme=dark] .ebb-template-card:hover{background:#0d3d3e;border-color:var(--ee-primary)}.ebb-template-card__icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:8px;flex-shrink:0}.ebb-template-card__info{display:flex;flex-direction:column;gap:1px;min-width:0}.ebb-template-card__label{font-size:13px;font-weight:600;color:#333}html[data-theme=dark] .ebb-template-card__label{color:#e5e7eb}.ebb-template-card__desc{font-size:11px;color:#9ca3af}.ebb-confirm-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:10000;background:#00000080;display:flex;align-items:center;justify-content:center;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.ebb-confirm-dialog{background:#fff;border-radius:16px;padding:28px 32px 24px;max-width:380px;width:90%;text-align:center;box-shadow:0 20px 60px #0003}html[data-theme=dark] .ebb-confirm-dialog{background:#1f2937;box-shadow:0 20px 60px #00000080}.ebb-confirm-dialog__icon{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:14px;margin-bottom:16px}.ebb-confirm-dialog__title{font-size:16px;font-weight:700;color:#111827;margin:0 0 8px}html[data-theme=dark] .ebb-confirm-dialog__title{color:#f3f4f6}.ebb-confirm-dialog__text{font-size:13px;color:#6b7280;margin:0 0 24px;line-height:1.5}.ebb-confirm-dialog__actions{display:flex;gap:10px;justify-content:center}.ebb-confirm-dialog__btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:38px;padding:0 20px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:none;transition:all .15s ease}.ebb-confirm-dialog__btn--cancel{background:#f3f4f6;color:#374151}html[data-theme=dark] .ebb-confirm-dialog__btn--cancel{background:#374151;color:#d1d5db}.ebb-confirm-dialog__btn--cancel:hover{background:#e5e7eb}html[data-theme=dark] .ebb-confirm-dialog__btn--cancel:hover{background:#4b5563}.ebb-confirm-dialog__btn--confirm{background:var(--ee-primary, #01A8AB);color:#fff}.ebb-confirm-dialog__btn--confirm:hover{background:var(--ee-primary-hover, #019193)}.ebb-confirm-fade-enter-active,.ebb-confirm-fade-leave-active{transition:opacity .2s ease}.ebb-confirm-fade-enter-active .ebb-confirm-dialog,.ebb-confirm-fade-leave-active .ebb-confirm-dialog{transition:transform .2s ease}.ebb-confirm-fade-enter-from,.ebb-confirm-fade-leave-to{opacity:0}.ebb-confirm-fade-enter-from .ebb-confirm-dialog,.ebb-confirm-fade-leave-to .ebb-confirm-dialog{transform:scale(.95)}.ebb-blocks-panel{display:flex;flex-direction:column;height:100%}.ebb-blocks-panel__search{display:flex;align-items:center;gap:8px;padding:8px 12px;margin:8px 12px;background:#f3f4f6;border-radius:8px;color:#9ca3af;flex-shrink:0}html[data-theme=dark] .ebb-blocks-panel__search{background:#111827}.ebb-blocks-panel__search-input{flex:1;border:none;background:transparent;font-size:12px;color:#374151;outline:none}html[data-theme=dark] .ebb-blocks-panel__search-input{color:#d1d5db}.ebb-blocks-panel__search-input::placeholder{color:#9ca3af}.ebb-blocks-panel__search-clear{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:none;background:#d1d5db;color:#fff;border-radius:50%;cursor:pointer;padding:0}html[data-theme=dark] .ebb-blocks-panel__search-clear{background:#4b5563}.ebb-blocks-panel__list{flex:1;overflow-y:auto;mask-image:linear-gradient(to bottom,black calc(100% - 24px),transparent 100%);-webkit-mask-image:linear-gradient(to bottom,black calc(100% - 24px),transparent 100%)}.ebb-blocks-panel__list::-webkit-scrollbar{width:4px}.ebb-blocks-panel__list::-webkit-scrollbar-track{background:transparent}.ebb-blocks-panel__list::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:2px}html[data-theme=dark] .ebb-blocks-panel__list::-webkit-scrollbar-thumb{background:#4b5563}.ebb-blocks-panel__empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:40px 20px;color:#9ca3af;text-align:center}.ebb-blocks-panel__empty p{font-size:12px;margin:0}.ebb-blocks-panel__templates{border-bottom:1px solid #e5e7eb;margin-bottom:4px}html[data-theme=dark] .ebb-blocks-panel__templates{border-bottom-color:#374151}.ebb-blocks-panel__templates-toggle{display:flex;align-items:center;gap:6px;width:100%;padding:10px 12px;font-size:12px;font-weight:600;color:#374151;background:transparent;border:none;cursor:pointer;text-align:left}html[data-theme=dark] .ebb-blocks-panel__templates-toggle{color:#d1d5db}.ebb-blocks-panel__templates-toggle:hover{background:#f9fafb}html[data-theme=dark] .ebb-blocks-panel__templates-toggle:hover{background:#111827}.ebb-prop-group{border-bottom:1px solid #f3f4f6}html[data-theme=dark] .ebb-prop-group{border-bottom-color:#374151}.ebb-prop-group__header{display:flex;align-items:center;justify-content:space-between;width:100%;padding:10px 16px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:#9ca3af;background:transparent;border:none;cursor:pointer;transition:color .15s}.ebb-prop-group__header:hover{color:#374151}html[data-theme=dark] .ebb-prop-group__header:hover{color:#d1d5db}.ebb-prop-group__body{padding:0 16px 12px;display:flex;flex-direction:column;gap:10px}.ebb-prop-group__field{display:flex;flex-direction:column;gap:4px}.ebb-prop-group__label{font-size:11px;font-weight:500;color:#6b7280}html[data-theme=dark] .ebb-prop-group__label{color:#9ca3af}.ebb-prop-group__text-input{width:100%;padding:6px 8px;font-size:12px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#374151;box-sizing:border-box;transition:border-color .15s}html[data-theme=dark] .ebb-prop-group__text-input{background:#1f2937;border-color:#374151;color:#d1d5db}.ebb-prop-group__text-input:focus{outline:none;border-color:var(--ee-primary);box-shadow:0 0 0 2px #01a8ab1a}.ebb-prop-group__select{width:100%;padding:6px 8px;font-size:12px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#374151;box-sizing:border-box;cursor:pointer}html[data-theme=dark] .ebb-prop-group__select{background:#1f2937;border-color:#374151;color:#d1d5db}.ebb-prop-group__select:focus{outline:none;border-color:var(--ee-primary)}.ebb-prop-group__color{display:flex;gap:6px;align-items:center}.ebb-prop-group__color-input{width:32px;height:32px;padding:2px;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;background:none;flex-shrink:0}.ebb-prop-group__number{display:flex;align-items:center;gap:4px}.ebb-prop-group__unit{font-size:11px;color:#9ca3af;flex-shrink:0}.ebb-prop-group__alignment{display:flex;gap:2px}.ebb-prop-group__align-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:28px;border:1px solid #e5e7eb;background:#fff;color:#9ca3af;cursor:pointer;transition:all .15s}.ebb-prop-group__align-btn:first-child{border-radius:6px 0 0 6px}.ebb-prop-group__align-btn:last-child{border-radius:0 6px 6px 0}.ebb-prop-group__align-btn--active{background:#01a8ab1a;border-color:var(--ee-primary);color:var(--ee-primary)}html[data-theme=dark] .ebb-prop-group__align-btn{background:#1f2937;border-color:#374151}html[data-theme=dark] .ebb-prop-group__align-btn--active{background:#01a8ab26;border-color:var(--ee-primary);color:var(--ee-primary)}.ebb-prop-group__toggle-btn{padding:4px 12px;font-size:12px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#6b7280;cursor:pointer;transition:all .15s}.ebb-prop-group__toggle-btn--active{background:#01a8ab1a;border-color:var(--ee-primary);color:var(--ee-primary)}.ebb-properties{padding:0}.ebb-properties__header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #e5e7eb;background:#f9fafb}html[data-theme=dark] .ebb-properties__header{background:#111827;border-bottom-color:#374151}.ebb-properties__type{font-size:13px;font-weight:600;color:var(--ee-primary)}.ebb-properties__close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;background:transparent;color:#9ca3af;cursor:pointer;border-radius:4px}.ebb-properties__close:hover{background:#f3f4f6;color:#374151}.ebb-properties__content-group{padding:12px 16px;border-bottom:1px solid #f3f4f6}html[data-theme=dark] .ebb-properties__content-group{border-bottom-color:#374151}.ebb-properties__label{display:block;font-size:11px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:.05em;margin-bottom:6px}html[data-theme=dark] .ebb-properties__label{color:#9ca3af}.ebb-properties__textarea{width:100%;padding:8px;font-size:12px;font-family:monospace;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#374151;resize:vertical;box-sizing:border-box}html[data-theme=dark] .ebb-properties__textarea{background:#1f2937;border-color:#374151;color:#d1d5db}.ebb-properties__textarea:focus{outline:none;border-color:var(--ee-primary);box-shadow:0 0 0 2px #01a8ab1a}.ebb-global-styles{padding:0}.ebb-global-styles__header{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid #e5e7eb;background:#f9fafb;font-size:13px;font-weight:600;color:var(--ee-primary)}html[data-theme=dark] .ebb-global-styles__header{background:#111827;border-bottom-color:#374151}.ebb-global-styles__section{border-bottom:1px solid #f3f4f6;padding:0}html[data-theme=dark] .ebb-global-styles__section{border-bottom-color:#1f2937}.ebb-global-styles__section-title{display:flex;align-items:center;gap:6px;padding:10px 16px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#6b7280;background:#fafafa}html[data-theme=dark] .ebb-global-styles__section-title{background:#111827;color:#9ca3af}.ebb-global-styles__field{padding:8px 16px 12px}.ebb-global-styles__label{display:block;font-size:11px;font-weight:600;color:#6b7280;margin-bottom:4px}html[data-theme=dark] .ebb-global-styles__label{color:#9ca3af}.ebb-global-styles__hint{font-size:10px;color:#9ca3af;margin:4px 0 0;line-height:1.4}.ebb-global-styles__input{width:100%;padding:7px 10px;font-size:12px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#374151;box-sizing:border-box;outline:none;transition:border-color .15s ease}html[data-theme=dark] .ebb-global-styles__input{background:#1f2937;border-color:#374151;color:#d1d5db}.ebb-global-styles__input:focus{border-color:var(--ee-primary);box-shadow:0 0 0 2px #01a8ab1a}.ebb-global-styles__input--short{flex:1}.ebb-global-styles__select{width:100%;padding:7px 10px;font-size:12px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#374151;box-sizing:border-box;outline:none;cursor:pointer}html[data-theme=dark] .ebb-global-styles__select{background:#1f2937;border-color:#374151;color:#d1d5db}.ebb-global-styles__select:focus{border-color:var(--ee-primary)}.ebb-global-styles__color-row{display:flex;align-items:center;gap:8px;margin-top:4px}.ebb-global-styles__color-input{width:36px;height:36px;border:2px solid #e5e7eb;border-radius:8px;padding:2px;cursor:pointer;background:transparent;flex-shrink:0}html[data-theme=dark] .ebb-global-styles__color-input{border-color:#374151}.ebb-global-styles__color-input::-webkit-color-swatch-wrapper{padding:0}.ebb-global-styles__color-input::-webkit-color-swatch{border:none;border-radius:4px}.ebb-global-styles__tip{display:flex;align-items:center;gap:8px;padding:16px;color:#9ca3af;font-size:11px;line-height:1.4}.ebb-properties__breadcrumb{display:flex;align-items:center;flex-wrap:wrap;gap:2px;padding:6px 16px;border-bottom:1px solid #f3f4f6}html[data-theme=dark] .ebb-properties__breadcrumb{border-bottom-color:#374151}.ebb-properties__breadcrumb-sep{font-size:10px;color:#d1d5db}html[data-theme=dark] .ebb-properties__breadcrumb-sep{color:#4b5563}.ebb-properties__breadcrumb-item{font-size:11px;color:#6b7280;background:none;border:none;padding:2px 6px;border-radius:3px;cursor:pointer;transition:all .1s ease}.ebb-properties__breadcrumb-item:hover{background:#f3f4f6;color:#111827}html[data-theme=dark] .ebb-properties__breadcrumb-item:hover{background:#374151;color:#f3f4f6}.ebb-properties__breadcrumb-item--active{color:var(--ee-primary);font-weight:600}.ebb-layers{padding:0}.ebb-layers__header{display:flex;align-items:center;gap:8px;padding:12px 16px;font-size:13px;font-weight:600;color:var(--ee-primary);border-bottom:1px solid var(--ee-border);background:var(--ee-panel-header-bg)}html[data-theme=dark] .ebb-layers__header{background:#111827;border-bottom-color:#374151}.ebb-layers__count{font-size:10px;font-weight:500;color:#9ca3af;background:#f3f4f6;border-radius:10px;padding:1px 7px;margin-left:auto}html[data-theme=dark] .ebb-layers__count{background:#1f2937}.ebb-layers__tree{padding:4px 0}.ebb-layers__node{display:flex;align-items:center;gap:4px;padding:5px 12px 5px 8px;font-size:12px;font-weight:500;color:#374151;cursor:pointer;transition:background .1s ease;-webkit-user-select:none;user-select:none;border-left:2px solid transparent}html[data-theme=dark] .ebb-layers__node{color:#d1d5db}.ebb-layers__node:hover{background:#f9fafb}html[data-theme=dark] .ebb-layers__node:hover{background:#111827}.ebb-layers__node--hovered{background:#01a8ab0a}.ebb-layers__node--selected{background:#01a8ab14;border-left-color:var(--ee-primary);color:var(--ee-primary)}.ebb-layers__node--selected:hover{background:#01a8ab1f}.ebb-layers__node--indent-1{padding-left:24px}.ebb-layers__node--indent-2{padding-left:40px}.ebb-layers__toggle{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border:none;background:transparent;color:#9ca3af;cursor:pointer;border-radius:3px;padding:0;flex-shrink:0}.ebb-layers__toggle:hover{background:#e5e7eb;color:#374151}html[data-theme=dark] .ebb-layers__toggle:hover{background:#374151;color:#d1d5db}.ebb-layers__toggle-spacer{width:16px;flex-shrink:0}.ebb-layers__icon{display:inline-flex;align-items:center;flex-shrink:0}.ebb-layers__label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.ebb-layers__actions{display:none;align-items:center;gap:1px;margin-left:auto;flex-shrink:0}.ebb-layers__node:hover .ebb-layers__actions{display:flex}.ebb-layers__action-btn{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:none;background:transparent;color:#9ca3af;cursor:pointer;border-radius:3px;padding:0}.ebb-layers__action-btn:hover{background:#e5e7eb;color:#374151}html[data-theme=dark] .ebb-layers__action-btn:hover{background:#374151;color:#d1d5db}.ebb-layers__action-btn--danger:hover{background:#fee2e2;color:#dc2626}html[data-theme=dark] .ebb-layers__action-btn--danger:hover{background:#450a0a;color:#f87171}.ebb-layers__empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:40px 20px;text-align:center;color:#9ca3af}.ebb-layers__empty p{font-size:12px;margin:0;line-height:1.5}.ebb-sidebar{width:300px;flex-shrink:0;display:flex;flex-direction:column;background:#fff;border-left:1px solid #e5e7eb}html[data-theme=dark] .ebb-sidebar{background:#1f2937;border-left-color:#374151}.ebb-sidebar__tabs{display:flex;border-bottom:1px solid #e5e7eb;flex-shrink:0}html[data-theme=dark] .ebb-sidebar__tabs{border-bottom-color:#374151}.ebb-sidebar__tab{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:10px 0;font-size:12px;font-weight:500;color:#9ca3af;background:transparent;border:none;border-bottom:2px solid transparent;cursor:pointer;transition:all .15s ease}.ebb-sidebar__tab:hover{color:#374151;background:#f9fafb}html[data-theme=dark] .ebb-sidebar__tab:hover{color:#d1d5db;background:#111827}.ebb-sidebar__tab--active{color:var(--ee-primary);border-bottom-color:var(--ee-primary)}.ebb-sidebar__tab--active:hover{color:var(--ee-primary)}.ebb-sidebar__content{flex:1;overflow-y:auto;overflow-x:hidden}.ebb-sidebar__content::-webkit-scrollbar{width:4px}.ebb-sidebar__content::-webkit-scrollbar-track{background:transparent}.ebb-sidebar__content::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:2px}.ebb-label{display:block;font-size:14px;font-weight:500;color:var(--ee-text-primary, #374151);margin-bottom:8px}.ebb-label__required{color:var(--ee-error, #ef4444)}.ebb-alert{display:flex;align-items:flex-start;gap:10px;padding:12px 16px;border:1px solid #fca5a5;border-radius:8px;background:#fef2f2;color:#991b1b;font-size:13px;margin-bottom:12px}html[data-theme=dark] .ebb-alert{background:#450a0a;border-color:#7f1d1d;color:#fca5a5}.ebb-alert p{margin:4px 0 0;font-size:12px}.ebb-shell{border:1px solid var(--ee-border, #e5e7eb);border-radius:12px;overflow:hidden;background:var(--ee-panel-header-bg, #f9fafb);box-shadow:0 1px 3px #0000000f,0 1px 2px #0000000a;display:flex;flex-direction:column;height:calc(100vh - 180px);min-height:500px;font-family:var(--ee-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);font-size:var(--ee-font-size, 13px)}.ebb-shell--fullscreen{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;height:100vh;border-radius:0;border:none}.ebb-main{display:flex;flex:1;min-height:0;overflow:hidden}.ebb-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ebb-sr-only--focusable:focus{position:static;width:auto;height:auto;padding:8px 16px;margin:0;overflow:visible;clip:auto;white-space:normal;background:var(--ee-primary);color:#fff;font-size:13px;font-weight:600;z-index:100}.ebb-code-editor{flex:1;overflow:hidden;background:#282c34}.ebb-code-editor .cm-editor{height:100%}
|
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
3
|
+
import { ComponentProvideOptions } from 'vue';
|
|
4
|
+
import { DefineComponent } from 'vue';
|
|
5
|
+
import { PublicProps } from 'vue';
|
|
6
|
+
import { Ref } from 'vue';
|
|
7
|
+
|
|
8
|
+
declare type __VLS_Props = {
|
|
9
|
+
modelValue: string;
|
|
10
|
+
designJson?: Record<string, unknown> | null;
|
|
11
|
+
variables?: string[];
|
|
12
|
+
labels?: Partial<EditorLabels>;
|
|
13
|
+
label?: string;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
theme?: Partial<ThemeConfig>;
|
|
16
|
+
plugins?: Plugin_2[];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export declare type BlockCategory = string;
|
|
20
|
+
|
|
21
|
+
export declare interface BlockCategoryDefinition {
|
|
22
|
+
id: string;
|
|
23
|
+
/** Label key (resolved via EditorLabels) or raw display string */
|
|
24
|
+
label: string;
|
|
25
|
+
/** Lucide icon name */
|
|
26
|
+
icon: string;
|
|
27
|
+
/** Sort order (lower = first) */
|
|
28
|
+
order?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare interface BlockDefinition {
|
|
32
|
+
id: string;
|
|
33
|
+
/** Label key (resolved via EditorLabels) or raw display string */
|
|
34
|
+
label: string;
|
|
35
|
+
category: BlockCategory;
|
|
36
|
+
/** Lucide icon name */
|
|
37
|
+
icon: string;
|
|
38
|
+
/** Factory returning node(s) to insert */
|
|
39
|
+
factory: () => EmailNode | EmailNode[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Deep clone a subtree, generating fresh IDs for every node. */
|
|
43
|
+
export declare function cloneSubtree(node: EmailNode): EmailNode;
|
|
44
|
+
|
|
45
|
+
export declare function compileMjml(source: string): Promise<MjmlCompilationResult>;
|
|
46
|
+
|
|
47
|
+
/** Node types that are structural containers */
|
|
48
|
+
export declare const CONTAINER_NODE_TYPES: EmailNodeType[];
|
|
49
|
+
|
|
50
|
+
/** Node types that can contain rich HTML content */
|
|
51
|
+
export declare const CONTENT_NODE_TYPES: EmailNodeType[];
|
|
52
|
+
|
|
53
|
+
export declare function createButton(text?: string, attributes?: Record<string, string>): EmailNode;
|
|
54
|
+
|
|
55
|
+
export declare function createColumn(children?: EmailNode[], attributes?: Record<string, string>): EmailNode;
|
|
56
|
+
|
|
57
|
+
/** Create the default starter document */
|
|
58
|
+
export declare function createDefaultDocument(): EmailDocument;
|
|
59
|
+
|
|
60
|
+
export declare function createDivider(attributes?: Record<string, string>): EmailNode;
|
|
61
|
+
|
|
62
|
+
export declare function createHero(children?: EmailNode[], attributes?: Record<string, string>): EmailNode;
|
|
63
|
+
|
|
64
|
+
export declare function createImage(attributes?: Record<string, string>): EmailNode;
|
|
65
|
+
|
|
66
|
+
export declare function createSection(children?: EmailNode[], attributes?: Record<string, string>): EmailNode;
|
|
67
|
+
|
|
68
|
+
export declare function createSocial(elements?: EmailNode[], attributes?: Record<string, string>): EmailNode;
|
|
69
|
+
|
|
70
|
+
export declare function createSpacer(attributes?: Record<string, string>): EmailNode;
|
|
71
|
+
|
|
72
|
+
export declare function createText(htmlContent?: string, attributes?: Record<string, string>): EmailNode;
|
|
73
|
+
|
|
74
|
+
export declare function createWrapper(children?: EmailNode[], attributes?: Record<string, string>): EmailNode;
|
|
75
|
+
|
|
76
|
+
export declare const DEFAULT_LABELS: EditorLabels;
|
|
77
|
+
|
|
78
|
+
export declare const DEFAULT_THEME: Required<ThemeConfig>;
|
|
79
|
+
|
|
80
|
+
export declare function documentToMjml(doc: EmailDocument): string;
|
|
81
|
+
|
|
82
|
+
export declare interface EditorEventMap {
|
|
83
|
+
'editor:ready': {
|
|
84
|
+
document: EmailDocument;
|
|
85
|
+
};
|
|
86
|
+
'editor:change': {
|
|
87
|
+
document: EmailDocument;
|
|
88
|
+
};
|
|
89
|
+
'node:selected': {
|
|
90
|
+
nodeId: NodeId;
|
|
91
|
+
node: EmailNode;
|
|
92
|
+
};
|
|
93
|
+
'node:deselected': {
|
|
94
|
+
nodeId: NodeId;
|
|
95
|
+
};
|
|
96
|
+
'node:deleted': {
|
|
97
|
+
nodeId: NodeId;
|
|
98
|
+
};
|
|
99
|
+
'node:moved': {
|
|
100
|
+
nodeId: NodeId;
|
|
101
|
+
fromParentId: NodeId;
|
|
102
|
+
toParentId: NodeId;
|
|
103
|
+
};
|
|
104
|
+
'node:duplicated': {
|
|
105
|
+
originalId: NodeId;
|
|
106
|
+
newId: NodeId;
|
|
107
|
+
};
|
|
108
|
+
'block:dropped': {
|
|
109
|
+
blockId: string;
|
|
110
|
+
parentId: NodeId;
|
|
111
|
+
};
|
|
112
|
+
'history:undo': {
|
|
113
|
+
canUndo: boolean;
|
|
114
|
+
canRedo: boolean;
|
|
115
|
+
};
|
|
116
|
+
'history:redo': {
|
|
117
|
+
canUndo: boolean;
|
|
118
|
+
canRedo: boolean;
|
|
119
|
+
};
|
|
120
|
+
'property:changed': {
|
|
121
|
+
nodeId: NodeId;
|
|
122
|
+
key: string;
|
|
123
|
+
value: string;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export declare interface EditorLabels {
|
|
128
|
+
blocks: string;
|
|
129
|
+
styles: string;
|
|
130
|
+
layers: string;
|
|
131
|
+
search_blocks: string;
|
|
132
|
+
undo: string;
|
|
133
|
+
redo: string;
|
|
134
|
+
editor_title: string;
|
|
135
|
+
code: string;
|
|
136
|
+
fullscreen: string;
|
|
137
|
+
desktop: string;
|
|
138
|
+
tablet: string;
|
|
139
|
+
mobile: string;
|
|
140
|
+
init_error: string;
|
|
141
|
+
templates: string;
|
|
142
|
+
starter_templates: string;
|
|
143
|
+
no_blocks_found: string;
|
|
144
|
+
category_layout: string;
|
|
145
|
+
category_content: string;
|
|
146
|
+
category_composite: string;
|
|
147
|
+
category_variable: string;
|
|
148
|
+
block_layout_1_col: string;
|
|
149
|
+
block_layout_2_col: string;
|
|
150
|
+
block_layout_3_col: string;
|
|
151
|
+
block_layout_4_col: string;
|
|
152
|
+
block_layout_sidebar_left: string;
|
|
153
|
+
block_layout_sidebar_right: string;
|
|
154
|
+
block_content_text: string;
|
|
155
|
+
block_content_image: string;
|
|
156
|
+
block_content_button: string;
|
|
157
|
+
block_content_divider: string;
|
|
158
|
+
block_content_spacer: string;
|
|
159
|
+
block_content_social: string;
|
|
160
|
+
block_content_hero: string;
|
|
161
|
+
block_comp_header: string;
|
|
162
|
+
block_comp_header_nav: string;
|
|
163
|
+
block_comp_hero_banner: string;
|
|
164
|
+
block_comp_hero_gradient: string;
|
|
165
|
+
block_comp_image_text: string;
|
|
166
|
+
block_comp_text_image: string;
|
|
167
|
+
block_comp_cta: string;
|
|
168
|
+
block_comp_image_grid: string;
|
|
169
|
+
block_comp_features: string;
|
|
170
|
+
block_comp_testimonial: string;
|
|
171
|
+
block_comp_pricing: string;
|
|
172
|
+
block_comp_promo_code: string;
|
|
173
|
+
block_comp_video: string;
|
|
174
|
+
block_comp_social: string;
|
|
175
|
+
block_comp_footer: string;
|
|
176
|
+
block_comp_footer_simple: string;
|
|
177
|
+
block_comp_separator: string;
|
|
178
|
+
block_comp_product_card: string;
|
|
179
|
+
block_comp_notification: string;
|
|
180
|
+
block_comp_stats: string;
|
|
181
|
+
block_comp_announcement: string;
|
|
182
|
+
block_comp_steps: string;
|
|
183
|
+
block_comp_order: string;
|
|
184
|
+
block_comp_faq: string;
|
|
185
|
+
block_comp_team: string;
|
|
186
|
+
block_comp_countdown: string;
|
|
187
|
+
block_comp_review: string;
|
|
188
|
+
block_comp_mobile_app: string;
|
|
189
|
+
node_mj_body: string;
|
|
190
|
+
node_mj_section: string;
|
|
191
|
+
node_mj_column: string;
|
|
192
|
+
node_mj_text: string;
|
|
193
|
+
node_mj_image: string;
|
|
194
|
+
node_mj_button: string;
|
|
195
|
+
node_mj_divider: string;
|
|
196
|
+
node_mj_spacer: string;
|
|
197
|
+
node_mj_social: string;
|
|
198
|
+
node_mj_social_element: string;
|
|
199
|
+
node_mj_hero: string;
|
|
200
|
+
node_mj_raw: string;
|
|
201
|
+
node_mj_wrapper: string;
|
|
202
|
+
group_background: string;
|
|
203
|
+
group_spacing: string;
|
|
204
|
+
group_border: string;
|
|
205
|
+
group_text: string;
|
|
206
|
+
group_dimensions: string;
|
|
207
|
+
group_layout: string;
|
|
208
|
+
group_image: string;
|
|
209
|
+
group_link: string;
|
|
210
|
+
group_style: string;
|
|
211
|
+
group_network: string;
|
|
212
|
+
prop_background_color: string;
|
|
213
|
+
prop_background_url: string;
|
|
214
|
+
prop_background_size: string;
|
|
215
|
+
prop_background_repeat: string;
|
|
216
|
+
prop_background_height: string;
|
|
217
|
+
prop_background_width: string;
|
|
218
|
+
prop_padding: string;
|
|
219
|
+
prop_border: string;
|
|
220
|
+
prop_border_radius: string;
|
|
221
|
+
prop_border_color: string;
|
|
222
|
+
prop_border_width: string;
|
|
223
|
+
prop_border_style: string;
|
|
224
|
+
prop_full_width: string;
|
|
225
|
+
prop_direction: string;
|
|
226
|
+
prop_width: string;
|
|
227
|
+
prop_height: string;
|
|
228
|
+
prop_color: string;
|
|
229
|
+
prop_font_family: string;
|
|
230
|
+
prop_font_size: string;
|
|
231
|
+
prop_font_weight: string;
|
|
232
|
+
prop_line_height: string;
|
|
233
|
+
prop_letter_spacing: string;
|
|
234
|
+
prop_align: string;
|
|
235
|
+
prop_vertical_align: string;
|
|
236
|
+
prop_src: string;
|
|
237
|
+
prop_alt: string;
|
|
238
|
+
prop_href: string;
|
|
239
|
+
prop_inner_padding: string;
|
|
240
|
+
prop_outer_padding: string;
|
|
241
|
+
prop_text_transform: string;
|
|
242
|
+
prop_inner_background_color: string;
|
|
243
|
+
prop_icon_size: string;
|
|
244
|
+
prop_mode: string;
|
|
245
|
+
prop_social_name: string;
|
|
246
|
+
prop_custom_icon: string;
|
|
247
|
+
align_left: string;
|
|
248
|
+
align_center: string;
|
|
249
|
+
align_right: string;
|
|
250
|
+
vertical_top: string;
|
|
251
|
+
vertical_middle: string;
|
|
252
|
+
vertical_bottom: string;
|
|
253
|
+
border_solid: string;
|
|
254
|
+
border_dashed: string;
|
|
255
|
+
border_dotted: string;
|
|
256
|
+
bg_size_auto: string;
|
|
257
|
+
bg_size_cover: string;
|
|
258
|
+
bg_size_contain: string;
|
|
259
|
+
bg_repeat_none: string;
|
|
260
|
+
bg_repeat_repeat: string;
|
|
261
|
+
bg_repeat_x: string;
|
|
262
|
+
bg_repeat_y: string;
|
|
263
|
+
direction_ltr: string;
|
|
264
|
+
direction_rtl: string;
|
|
265
|
+
mode_horizontal: string;
|
|
266
|
+
mode_vertical: string;
|
|
267
|
+
mode_fixed: string;
|
|
268
|
+
mode_fluid: string;
|
|
269
|
+
transform_none: string;
|
|
270
|
+
transform_uppercase: string;
|
|
271
|
+
transform_lowercase: string;
|
|
272
|
+
transform_capitalize: string;
|
|
273
|
+
font_default: string;
|
|
274
|
+
toggle_yes: string;
|
|
275
|
+
toggle_no: string;
|
|
276
|
+
delete_node: string;
|
|
277
|
+
duplicate_node: string;
|
|
278
|
+
move_up: string;
|
|
279
|
+
move_down: string;
|
|
280
|
+
select_parent: string;
|
|
281
|
+
content_label: string;
|
|
282
|
+
close: string;
|
|
283
|
+
global_styles: string;
|
|
284
|
+
inbox_preview: string;
|
|
285
|
+
preview_text: string;
|
|
286
|
+
preview_text_placeholder: string;
|
|
287
|
+
preview_text_hint: string;
|
|
288
|
+
colors: string;
|
|
289
|
+
email_background: string;
|
|
290
|
+
text_color: string;
|
|
291
|
+
typography: string;
|
|
292
|
+
default_font: string;
|
|
293
|
+
select_element_hint: string;
|
|
294
|
+
section_label: string;
|
|
295
|
+
column_label: string;
|
|
296
|
+
empty_canvas_hint: string;
|
|
297
|
+
loading: string;
|
|
298
|
+
bold: string;
|
|
299
|
+
italic: string;
|
|
300
|
+
underline: string;
|
|
301
|
+
strikethrough: string;
|
|
302
|
+
link: string;
|
|
303
|
+
unlink: string;
|
|
304
|
+
align_text_left: string;
|
|
305
|
+
align_text_center: string;
|
|
306
|
+
align_text_right: string;
|
|
307
|
+
text_color_label: string;
|
|
308
|
+
link_url_prompt: string;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** The shape of designJson emitted and received by the editor */
|
|
312
|
+
export declare interface EmailDesignJson {
|
|
313
|
+
/** Discriminator to distinguish from old GrapesJS data */
|
|
314
|
+
_editor: 'mesagoo-email-editor';
|
|
315
|
+
_version: 1;
|
|
316
|
+
document: EmailDocument;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export declare interface EmailDocument {
|
|
320
|
+
/** Schema version for future migrations */
|
|
321
|
+
version: 1;
|
|
322
|
+
/** Global styles applied to <mj-head> */
|
|
323
|
+
headAttributes: EmailHeadAttributes;
|
|
324
|
+
/** The mj-body root node */
|
|
325
|
+
body: EmailNode;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export declare const EmailEditor: DefineComponent<__VLS_Props, {
|
|
329
|
+
getDocument: () => EmailDocument;
|
|
330
|
+
setDocument: (doc: EmailDocument) => void;
|
|
331
|
+
getMjml: () => string;
|
|
332
|
+
getHtml: () => string;
|
|
333
|
+
getDesignJson: () => EmailDesignJson;
|
|
334
|
+
undo: () => void;
|
|
335
|
+
redo: () => void;
|
|
336
|
+
canUndo: () => boolean;
|
|
337
|
+
canRedo: () => boolean;
|
|
338
|
+
selectNode: (nodeId: NodeId) => void;
|
|
339
|
+
getSelectedNode: () => EmailNode | null;
|
|
340
|
+
clearSelection: () => void;
|
|
341
|
+
deleteNode: (nodeId: NodeId) => void;
|
|
342
|
+
duplicateNode: (nodeId: NodeId) => NodeId | null;
|
|
343
|
+
insertBlock: (block: BlockDefinition, parentId: NodeId, index?: number) => NodeId | null;
|
|
344
|
+
updateNodeAttribute: (nodeId: NodeId, key: string, value: string) => void;
|
|
345
|
+
loadTemplate: (template: EmailDocument) => void;
|
|
346
|
+
on: <K extends keyof EditorEventMap>(event: K, handler: (payload: EditorEventMap[K]) => void) => void;
|
|
347
|
+
off: <K extends keyof EditorEventMap>(event: K, handler: (payload: EditorEventMap[K]) => void) => void;
|
|
348
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
349
|
+
"update:modelValue": (value: string) => any;
|
|
350
|
+
"update:compiledHtml": (html: string) => any;
|
|
351
|
+
"update:designJson": (data: Record<string, unknown>) => any;
|
|
352
|
+
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
353
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
354
|
+
"onUpdate:compiledHtml"?: ((html: string) => any) | undefined;
|
|
355
|
+
"onUpdate:designJson"?: ((data: Record<string, unknown>) => any) | undefined;
|
|
356
|
+
}>, {
|
|
357
|
+
label: string;
|
|
358
|
+
required: boolean;
|
|
359
|
+
theme: Partial<ThemeConfig>;
|
|
360
|
+
designJson: Record<string, unknown> | null;
|
|
361
|
+
variables: string[];
|
|
362
|
+
plugins: Plugin_2[];
|
|
363
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
364
|
+
|
|
365
|
+
export declare interface EmailEditorAPI {
|
|
366
|
+
getDocument: () => EmailDocument;
|
|
367
|
+
setDocument: (doc: EmailDocument) => void;
|
|
368
|
+
getMjml: () => string;
|
|
369
|
+
getHtml: () => string;
|
|
370
|
+
getDesignJson: () => EmailDesignJson;
|
|
371
|
+
undo: () => void;
|
|
372
|
+
redo: () => void;
|
|
373
|
+
canUndo: () => boolean;
|
|
374
|
+
canRedo: () => boolean;
|
|
375
|
+
selectNode: (nodeId: NodeId) => void;
|
|
376
|
+
getSelectedNode: () => EmailNode | null;
|
|
377
|
+
clearSelection: () => void;
|
|
378
|
+
deleteNode: (nodeId: NodeId) => void;
|
|
379
|
+
duplicateNode: (nodeId: NodeId) => NodeId | null;
|
|
380
|
+
insertBlock: (block: BlockDefinition, parentId: NodeId, index?: number) => NodeId | null;
|
|
381
|
+
updateNodeAttribute: (nodeId: NodeId, key: string, value: string) => void;
|
|
382
|
+
loadTemplate: (template: EmailDocument) => void;
|
|
383
|
+
on: <K extends keyof EditorEventMap>(event: K, handler: (payload: EditorEventMap[K]) => void) => void;
|
|
384
|
+
off: <K extends keyof EditorEventMap>(event: K, handler: (payload: EditorEventMap[K]) => void) => void;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export declare interface EmailHeadAttributes {
|
|
388
|
+
/** <mj-attributes> default styles per tag */
|
|
389
|
+
defaultStyles: Record<string, Record<string, string>>;
|
|
390
|
+
/** <mj-font> declarations */
|
|
391
|
+
fonts: Array<{
|
|
392
|
+
name: string;
|
|
393
|
+
href: string;
|
|
394
|
+
}>;
|
|
395
|
+
/** <mj-preview> text */
|
|
396
|
+
previewText: string;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export declare interface EmailNode {
|
|
400
|
+
id: NodeId;
|
|
401
|
+
type: EmailNodeType;
|
|
402
|
+
/** MJML attributes as string key-value pairs */
|
|
403
|
+
attributes: Record<string, string>;
|
|
404
|
+
/** Child nodes (sections in body, columns in section, etc.) */
|
|
405
|
+
children: EmailNode[];
|
|
406
|
+
/** Inner HTML content — only for mj-text and mj-button */
|
|
407
|
+
htmlContent?: string;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export declare type EmailNodeType = 'mj-body' | 'mj-section' | 'mj-column' | 'mj-text' | 'mj-image' | 'mj-button' | 'mj-divider' | 'mj-spacer' | 'mj-social' | 'mj-social-element' | 'mj-hero' | 'mj-raw' | 'mj-wrapper';
|
|
411
|
+
|
|
412
|
+
/** Find a node by ID in the tree. Returns null if not found. */
|
|
413
|
+
export declare function findNode(root: EmailNode, nodeId: NodeId): EmailNode | null;
|
|
414
|
+
|
|
415
|
+
/** Find the parent of a node by ID. Returns null if not found or if nodeId is root. */
|
|
416
|
+
export declare function findParent(root: EmailNode, nodeId: NodeId): EmailNode | null;
|
|
417
|
+
|
|
418
|
+
export declare const FR_LABELS: EditorLabels;
|
|
419
|
+
|
|
420
|
+
/** Type guard for detecting new editor format vs old GrapesJS */
|
|
421
|
+
export declare function isNewEditorJson(data: unknown): data is EmailDesignJson;
|
|
422
|
+
|
|
423
|
+
export declare interface MjmlCompilationResult {
|
|
424
|
+
html: string;
|
|
425
|
+
errors: MjmlError[];
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* MJML compiler — lazy-loads mjml-browser and compiles MJML to HTML.
|
|
430
|
+
*/
|
|
431
|
+
declare interface MjmlError {
|
|
432
|
+
line: number;
|
|
433
|
+
message: string;
|
|
434
|
+
tagName?: string;
|
|
435
|
+
formattedMessage?: string;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export declare function mjmlToDocument(mjmlSource: string): EmailDocument;
|
|
439
|
+
|
|
440
|
+
/** Move a node to a new parent at a specific index. */
|
|
441
|
+
export declare function moveNode(root: EmailNode, nodeId: NodeId, newParentId: NodeId, newIndex: number): boolean;
|
|
442
|
+
|
|
443
|
+
/** Unique identifier for each node in the document tree (nanoid 8 chars) */
|
|
444
|
+
export declare type NodeId = string;
|
|
445
|
+
|
|
446
|
+
declare type Plugin_2 = (context: PluginContext) => void | Promise<void>;
|
|
447
|
+
export { Plugin_2 as Plugin }
|
|
448
|
+
|
|
449
|
+
export declare interface PluginContext {
|
|
450
|
+
registerBlock: (block: BlockDefinition) => void;
|
|
451
|
+
registerBlockCategory: (category: BlockCategoryDefinition) => void;
|
|
452
|
+
registerPropertyEditor: (type: string, component: Component) => void;
|
|
453
|
+
registerToolbarAction: (action: ToolbarAction) => void;
|
|
454
|
+
registerSidebarPanel: (panel: SidebarPanel) => void;
|
|
455
|
+
on: <K extends keyof EditorEventMap>(event: K, handler: (payload: EditorEventMap[K]) => void) => void;
|
|
456
|
+
off: <K extends keyof EditorEventMap>(event: K, handler: (payload: EditorEventMap[K]) => void) => void;
|
|
457
|
+
labels: Ref<EditorLabels>;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
declare interface PropertyDefinition_2 {
|
|
461
|
+
/** The MJML attribute name */
|
|
462
|
+
key: string;
|
|
463
|
+
/** Display label (i18n key) */
|
|
464
|
+
label: string;
|
|
465
|
+
type: PropertyType;
|
|
466
|
+
defaultValue?: string;
|
|
467
|
+
/** For 'select' type */
|
|
468
|
+
options?: Array<{
|
|
469
|
+
label: string;
|
|
470
|
+
value: string;
|
|
471
|
+
}>;
|
|
472
|
+
/** For 'number' type */
|
|
473
|
+
min?: number;
|
|
474
|
+
max?: number;
|
|
475
|
+
step?: number;
|
|
476
|
+
unit?: string;
|
|
477
|
+
/** Group heading in the panel */
|
|
478
|
+
group: string;
|
|
479
|
+
}
|
|
480
|
+
export { PropertyDefinition_2 as PropertyDefinition }
|
|
481
|
+
|
|
482
|
+
export declare type PropertyType = 'text' | 'number' | 'color' | 'select' | 'padding' | 'alignment' | 'url' | 'image' | 'toggle';
|
|
483
|
+
|
|
484
|
+
/** Remove a node from the tree by ID. Returns true if removed. */
|
|
485
|
+
export declare function removeNode(root: EmailNode, nodeId: NodeId): boolean;
|
|
486
|
+
|
|
487
|
+
/** Node types that are self-closing (no children, no htmlContent) */
|
|
488
|
+
export declare const SELF_CLOSING_NODE_TYPES: EmailNodeType[];
|
|
489
|
+
|
|
490
|
+
export declare interface SidebarPanel {
|
|
491
|
+
id: string;
|
|
492
|
+
label: string;
|
|
493
|
+
icon: string;
|
|
494
|
+
component: Component;
|
|
495
|
+
order?: number;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** All static blocks (layout + content + composite) */
|
|
499
|
+
export declare const STATIC_BLOCKS: BlockDefinition[];
|
|
500
|
+
|
|
501
|
+
export declare interface ThemeConfig {
|
|
502
|
+
primaryColor?: string;
|
|
503
|
+
primaryHover?: string;
|
|
504
|
+
primaryActive?: string;
|
|
505
|
+
borderColor?: string;
|
|
506
|
+
borderColorHover?: string;
|
|
507
|
+
backgroundColor?: string;
|
|
508
|
+
backgroundHover?: string;
|
|
509
|
+
backgroundActive?: string;
|
|
510
|
+
textPrimary?: string;
|
|
511
|
+
textSecondary?: string;
|
|
512
|
+
textMuted?: string;
|
|
513
|
+
canvasBg?: string;
|
|
514
|
+
canvasBorder?: string;
|
|
515
|
+
selectionColor?: string;
|
|
516
|
+
hoverColor?: string;
|
|
517
|
+
dropIndicatorColor?: string;
|
|
518
|
+
sidebarBg?: string;
|
|
519
|
+
sidebarBorder?: string;
|
|
520
|
+
panelHeaderBg?: string;
|
|
521
|
+
toolbarBg?: string;
|
|
522
|
+
toolbarBorder?: string;
|
|
523
|
+
successColor?: string;
|
|
524
|
+
warningColor?: string;
|
|
525
|
+
errorColor?: string;
|
|
526
|
+
fontFamily?: string;
|
|
527
|
+
fontSize?: string;
|
|
528
|
+
borderRadius?: string;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export declare interface ToolbarAction {
|
|
532
|
+
id: string;
|
|
533
|
+
label: string;
|
|
534
|
+
icon: string;
|
|
535
|
+
handler: () => void;
|
|
536
|
+
position?: 'left' | 'right';
|
|
537
|
+
order?: number;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export { }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { C as s, a as t, D as r, c as o, _ as c, F as E, S as m, e as S, f as T, g as i, h as n, i as N, j as _, l as d, n as l, o as D, p as L, q as u, r as C, t as O, u as p, d as A, v as f, w as F, x as j, m as v, y as B, z as I } from "./index-CJIiXHwY.js";
|
|
2
|
+
export {
|
|
3
|
+
s as CONTAINER_NODE_TYPES,
|
|
4
|
+
t as CONTENT_NODE_TYPES,
|
|
5
|
+
r as DEFAULT_LABELS,
|
|
6
|
+
o as DEFAULT_THEME,
|
|
7
|
+
c as EmailEditor,
|
|
8
|
+
E as FR_LABELS,
|
|
9
|
+
m as SELF_CLOSING_NODE_TYPES,
|
|
10
|
+
S as STATIC_BLOCKS,
|
|
11
|
+
T as cloneSubtree,
|
|
12
|
+
i as compileMjml,
|
|
13
|
+
n as createButton,
|
|
14
|
+
N as createColumn,
|
|
15
|
+
_ as createDefaultDocument,
|
|
16
|
+
d as createDivider,
|
|
17
|
+
l as createHero,
|
|
18
|
+
D as createImage,
|
|
19
|
+
L as createSection,
|
|
20
|
+
u as createSocial,
|
|
21
|
+
C as createSpacer,
|
|
22
|
+
O as createText,
|
|
23
|
+
p as createWrapper,
|
|
24
|
+
A as documentToMjml,
|
|
25
|
+
f as findNode,
|
|
26
|
+
F as findParent,
|
|
27
|
+
j as isNewEditorJson,
|
|
28
|
+
v as mjmlToDocument,
|
|
29
|
+
B as moveNode,
|
|
30
|
+
I as removeNode
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=email-editor.js.map
|