@maildeno/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 +426 -0
- package/dist/RowPreviewLegacyComponent-CXsY4P-R.js +439 -0
- package/dist/RowPreviewLegacyComponent-osWbuByc.js +439 -0
- package/dist/RowPreviewRow-D-U1mV4v.js +107 -0
- package/dist/RowPreviewRow-MSc_unf3.js +107 -0
- package/dist/adapters/index.d.ts +7 -0
- package/dist/adapters/localStorageAdapter.d.ts +6 -0
- package/dist/adapters/types.d.ts +83 -0
- package/dist/baseStyles.d.ts +13 -0
- package/dist/blocks/canvasStyleHelpers.d.ts +17 -0
- package/dist/blocks/definitions/anchor.d.ts +2 -0
- package/dist/blocks/definitions/button.d.ts +2 -0
- package/dist/blocks/definitions/divider.d.ts +2 -0
- package/dist/blocks/definitions/heading.d.ts +2 -0
- package/dist/blocks/definitions/image.d.ts +2 -0
- package/dist/blocks/definitions/list.d.ts +2 -0
- package/dist/blocks/definitions/menu.d.ts +2 -0
- package/dist/blocks/definitions/paragraph.d.ts +2 -0
- package/dist/blocks/definitions/socials.d.ts +2 -0
- package/dist/blocks/definitions/spacer.d.ts +2 -0
- package/dist/blocks/definitions/video.d.ts +2 -0
- package/dist/blocks/index.d.ts +8 -0
- package/dist/blocks/registry.d.ts +23 -0
- package/dist/blocks/types.d.ts +73 -0
- package/dist/composables/emailBuilder/components/useComponentStyleEditor.d.ts +72 -0
- package/dist/composables/emailBuilder/components/useProductRowActions.d.ts +3 -0
- package/dist/composables/emailBuilder/components/useProductRows.d.ts +59 -0
- package/dist/composables/emailBuilder/core/config/componentConfig.d.ts +29 -0
- package/dist/composables/emailBuilder/core/link-tags/useLinkTagInsert.d.ts +13 -0
- package/dist/composables/emailBuilder/core/merge-tags/mergeTagDefinitions.d.ts +64 -0
- package/dist/composables/emailBuilder/core/merge-tags/resolveMergeTags.d.ts +27 -0
- package/dist/composables/emailBuilder/core/ui/useLayerHoverScroll.d.ts +20 -0
- package/dist/composables/emailBuilder/core/ui/useLayoutDrag.d.ts +85 -0
- package/dist/composables/emailBuilder/core/ui/useRichTextEditors.d.ts +6 -0
- package/dist/composables/emailBuilder/core/ui/visibilityBadgeHelpers.d.ts +22 -0
- package/dist/composables/emailBuilder/core/useEmailBuilder.d.ts +274 -0
- package/dist/composables/emailBuilder/core/useEmailBuilderDefault.d.ts +507 -0
- package/dist/composables/emailBuilder/core/useEmailBuilderOperations.d.ts +31 -0
- package/dist/composables/emailBuilder/core/useEmailBuilderVisibility.d.ts +31 -0
- package/dist/composables/emailBuilder/export/actions/download.d.ts +24 -0
- package/dist/composables/emailBuilder/export/generators/html.d.ts +3 -0
- package/dist/composables/emailBuilder/export/generators/mjml.d.ts +6 -0
- package/dist/composables/emailBuilder/export/generators/react-email.d.ts +61 -0
- package/dist/composables/emailBuilder/export/helpers/generatorHelpers.d.ts +53 -0
- package/dist/composables/emailBuilder/export/logic/espLogicWrapper.d.ts +76 -0
- package/dist/composables/emailBuilder/export/logic/reactLogicWrapper.d.ts +31 -0
- package/dist/composables/emailBuilder/export/merge-tags/mergeTagMapper.d.ts +42 -0
- package/dist/composables/emailBuilder/export/merge-tags/reactMergeTagMapper.d.ts +26 -0
- package/dist/composables/emailBuilder/export/shared/containers.d.ts +18 -0
- package/dist/composables/emailBuilder/export/shared/styles.d.ts +12 -0
- package/dist/composables/emailBuilder/export/shared/tagIdentifier.d.ts +1 -0
- package/dist/composables/emailBuilder/export/targets/htmlExport.d.ts +20 -0
- package/dist/composables/emailBuilder/export/targets/jsonExport.d.ts +28 -0
- package/dist/composables/emailBuilder/export/targets/mjmlExport.d.ts +19 -0
- package/dist/composables/emailBuilder/export/targets/reactEmailExport.d.ts +20 -0
- package/dist/composables/emailBuilder/export/transformers/espWrapper.d.ts +2 -0
- package/dist/composables/emailBuilder/export/transformers/formatting.d.ts +3 -0
- package/dist/composables/emailBuilder/export/transformers/minify.d.ts +33 -0
- package/dist/composables/emailBuilder/export/transformers/tagMapper.d.ts +29 -0
- package/dist/composables/emailBuilder/export/types/export.d.ts +24 -0
- package/dist/composables/emailBuilder/export/useEmailExportEngine.d.ts +63 -0
- package/dist/composables/emailBuilder/export/useEmailExportMobileStyles.d.ts +3 -0
- package/dist/composables/emailBuilder/export/useExportSettings.d.ts +5 -0
- package/dist/composables/emailBuilder/health/accessibilityChecker.d.ts +64 -0
- package/dist/composables/emailBuilder/health/healthIndicator.d.ts +19 -0
- package/dist/composables/emailBuilder/history/useEmailBuilderHistory.d.ts +26 -0
- package/dist/composables/emailBuilder/history/useHistory.d.ts +16 -0
- package/dist/composables/emailBuilder/persistence/useEmailBuilderPersistence.d.ts +38 -0
- package/dist/composables/emailBuilder/preview/useClientPreview.d.ts +127 -0
- package/dist/composables/emailBuilder/transform/pipeline/hydrate.d.ts +54 -0
- package/dist/composables/emailBuilder/transform/pipeline/optimize.d.ts +101 -0
- package/dist/composables/emailBuilder/transform/pipeline/optimizeAI.d.ts +125 -0
- package/dist/composables/emailBuilder/types/emailBuilder.d.ts +79 -0
- package/dist/composables/system/useColor.d.ts +26 -0
- package/dist/composables/system/useDeviceDetection.d.ts +5 -0
- package/dist/composables/system/useGoogleFonts.d.ts +11 -0
- package/dist/composables/system/useImageUpload.d.ts +23 -0
- package/dist/composables/system/useSavedRowsPanel.d.ts +35 -0
- package/dist/composables/ui/useConfirm.d.ts +33 -0
- package/dist/composables/ui/useInfoDialog.d.ts +22 -0
- package/dist/composables/ui/useTeleportTarget.d.ts +49 -0
- package/dist/composables/ui/useToast.d.ts +32 -0
- package/dist/devStyleMirror.d.ts +20 -0
- package/dist/documentScopedStyles.d.ts +39 -0
- package/dist/editor.css +2411 -0
- package/dist/element-DN22fZmQ.js +72000 -0
- package/dist/element-scoped-styles.css +2411 -0
- package/dist/element.d.ts +6 -0
- package/dist/element.js +2 -0
- package/dist/esp/registry.d.ts +33 -0
- package/dist/estree-C12ASyI-.js +7993 -0
- package/dist/html-DGrfikay.js +7353 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +71955 -0
- package/dist/init.d.ts +85 -0
- package/dist/init.js +130 -0
- package/dist/lightDom.d.ts +30 -0
- package/dist/merge-tags/registry.d.ts +33 -0
- package/dist/shadowStyles.d.ts +8 -0
- package/dist/standalone-Bd2oQFm3.js +3639 -0
- package/dist/theme.d.ts +132 -0
- package/dist/typescript-D-z2dDu9.js +23190 -0
- package/dist/utils/generateId.d.ts +1 -0
- package/dist/utils/shadowDom.d.ts +30 -0
- package/dist/vue.runtime.esm-bundler-DwQEK7WO.js +9028 -0
- package/package.json +99 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* same provide/inject conversion — called from SidebarBlockButton.vue
|
|
3
|
+
* and useEmailExportEngine.ts (via useEmailBuilder), both needing to open the
|
|
4
|
+
* same dialog that presumably renders once near the EmailEditor root.
|
|
5
|
+
*/
|
|
6
|
+
type InfoDialogInstance = ReturnType<typeof createInfoDialogInstance>;
|
|
7
|
+
/** Called once, at the EmailEditor root. */
|
|
8
|
+
export declare function provideInfoDialog(): {
|
|
9
|
+
visible: import('vue').Ref<boolean, boolean>;
|
|
10
|
+
header: import('vue').Ref<string, string>;
|
|
11
|
+
message: import('vue').Ref<string, string>;
|
|
12
|
+
open: (msg: string, h?: string) => void;
|
|
13
|
+
};
|
|
14
|
+
/** Every other file calls this exactly as before. */
|
|
15
|
+
export declare const useInfoDialog: () => InfoDialogInstance;
|
|
16
|
+
declare function createInfoDialogInstance(): {
|
|
17
|
+
visible: import('vue').Ref<boolean, boolean>;
|
|
18
|
+
header: import('vue').Ref<string, string>;
|
|
19
|
+
message: import('vue').Ref<string, string>;
|
|
20
|
+
open: (msg: string, h?: string) => void;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Fixes a real, confirmed bug: every <Teleport to="body"> throughout this
|
|
4
|
+
* package (7 separate files — color pickers, the merge-tag picker, loading
|
|
5
|
+
* overlay, canvas action bar, preview client picker/screen) was hardcoded
|
|
6
|
+
* to the literal string "body". Vue resolves a string `to` target via
|
|
7
|
+
* document.querySelector() internally, which cannot see past a shadow
|
|
8
|
+
* root boundary at all — so for the custom-element usage path, every one
|
|
9
|
+
* of these was teleporting its content to the actual page body, entirely
|
|
10
|
+
* outside the shadow root where all of this package's CSS lives. The teleported content still
|
|
11
|
+
* rendered, just completely unstyled, and this doubles as the mechanism
|
|
12
|
+
* behind a second, related bug: click-outside handlers elsewhere in this
|
|
13
|
+
* package querying document.querySelector('[data-color-panel]') for that
|
|
14
|
+
* same teleported content could never find it either, for the identical
|
|
15
|
+
* reason.
|
|
16
|
+
*
|
|
17
|
+
* The fix has to be an actual DOM element reference, not a selector
|
|
18
|
+
* string — a string target re-triggers the exact document.querySelector
|
|
19
|
+
* problem this exists to solve. EmailEditor.vue provides this once, at
|
|
20
|
+
* its own root, pointing at a dedicated element it renders for exactly
|
|
21
|
+
* this purpose — every other file across the package just injects it and
|
|
22
|
+
* hands it straight to :to, with zero per-file conditional logic for
|
|
23
|
+
* which usage path (Vue component vs custom element) is active.
|
|
24
|
+
*
|
|
25
|
+
* A Ref, not a plain value: the target element is a template ref inside
|
|
26
|
+
* EmailEditor.vue, so it doesn't exist yet at the moment provide() runs
|
|
27
|
+
* during setup() — only after mount. Providing the Ref object itself
|
|
28
|
+
* (not .value) means every injecting component's own :to="target" template
|
|
29
|
+
* binding re-evaluates automatically once it populates, with no extra
|
|
30
|
+
* wiring needed anywhere else.
|
|
31
|
+
*/
|
|
32
|
+
export type TeleportTarget = Ref<HTMLElement | null>;
|
|
33
|
+
/** Called once, at the EmailEditor root, with the ref it renders a container element into. */
|
|
34
|
+
export declare function provideTeleportTarget(target: TeleportTarget): void;
|
|
35
|
+
/**
|
|
36
|
+
* Every other file calls this and hands the result straight to
|
|
37
|
+
* <Teleport :to="...">. Falls back to "body" (Vue's own default) rather
|
|
38
|
+
* than throwing — matches useInfoDialog/useStorageAdapter's reasoning. A
|
|
39
|
+
* component used in isolation, outside EmailEditor.vue's tree entirely,
|
|
40
|
+
* should still degrade to Vue's normal behavior rather than crash.
|
|
41
|
+
*/
|
|
42
|
+
export declare function useTeleportTarget(): TeleportTarget | "body";
|
|
43
|
+
/**
|
|
44
|
+
* The same target, typed for the `to` prop of Reka UI's portal components
|
|
45
|
+
* (and Vue's own Teleport), which accept `string | HTMLElement` but not
|
|
46
|
+
* `null`. Normalises the not-yet-mounted case to undefined so the portal
|
|
47
|
+
* falls back to its own default instead of erroring on a null target.
|
|
48
|
+
*/
|
|
49
|
+
export declare function usePortalTarget(): ComputedRef<string | HTMLElement | undefined>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast notification store.
|
|
3
|
+
*
|
|
4
|
+
* Module-level store for the same reasons as useConfirm — no injection
|
|
5
|
+
* key, no service registration, and no dependency on where in the
|
|
6
|
+
* component tree the caller sits.
|
|
7
|
+
*/
|
|
8
|
+
export interface ToastMessage {
|
|
9
|
+
id: number;
|
|
10
|
+
severity?: "success" | "info" | "warn" | "error" | string;
|
|
11
|
+
summary?: string;
|
|
12
|
+
detail?: string;
|
|
13
|
+
life?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const toasts: import('vue').Ref<{
|
|
16
|
+
id: number;
|
|
17
|
+
severity?: "success" | "info" | "warn" | "error" | string | undefined;
|
|
18
|
+
summary?: string | undefined;
|
|
19
|
+
detail?: string | undefined;
|
|
20
|
+
life?: number | undefined;
|
|
21
|
+
}[], ToastMessage[] | {
|
|
22
|
+
id: number;
|
|
23
|
+
severity?: "success" | "info" | "warn" | "error" | string | undefined;
|
|
24
|
+
summary?: string | undefined;
|
|
25
|
+
detail?: string | undefined;
|
|
26
|
+
life?: number | undefined;
|
|
27
|
+
}[]>;
|
|
28
|
+
export declare function removeToast(id: number): void;
|
|
29
|
+
export declare function useToast(): {
|
|
30
|
+
add(message: Omit<ToastMessage, "id">): void;
|
|
31
|
+
removeAll(): void;
|
|
32
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mirrors `document.head` <style> tags into a shadow root.
|
|
3
|
+
*
|
|
4
|
+
* Only needed when running the editor from source (the playground and its
|
|
5
|
+
* element-demo page). In a built bundle, every component's scoped CSS is
|
|
6
|
+
* substituted into shadowStyles.ts at build time, so the shadow root is
|
|
7
|
+
* self-contained and this does nothing.
|
|
8
|
+
*
|
|
9
|
+
* From source there is no build step, so Vite injects each `.vue` file's
|
|
10
|
+
* scoped styles into `document.head` as it serves them — and a shadow root
|
|
11
|
+
* does not inherit page styles. The result is a shadow root with the base
|
|
12
|
+
* stylesheet but none of the component CSS: unsized icons, dialogs without
|
|
13
|
+
* chrome, panels without layout. It looks like the editor is broken when in
|
|
14
|
+
* fact only this one delivery path is missing.
|
|
15
|
+
*
|
|
16
|
+
* Gated on whether the extracted CSS actually arrived rather than on
|
|
17
|
+
* `import.meta.env.DEV`, so it switches itself off the moment the real
|
|
18
|
+
* styles are present — including in a dev build that does run the plugin.
|
|
19
|
+
*/
|
|
20
|
+
export declare function mirrorHeadStylesInto(shadowRoot: ShadowRoot): () => void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixes a real, browser-level Shadow DOM limitation that no amount of
|
|
3
|
+
* getting the CSS *into* the shadow root can solve: `@font-face`,
|
|
4
|
+
* `@property`, and `@import` are **document-scoped at-rules**. Declared
|
|
5
|
+
* inside a shadow root, browsers silently ignore them. The rules are
|
|
6
|
+
* present, the CSS is valid, nothing errors — they just do nothing.
|
|
7
|
+
*
|
|
8
|
+
* Two very visible symptoms this causes, both confirmed from real
|
|
9
|
+
* browser behavior rather than automated tests (jsdom checks DOM
|
|
10
|
+
* structure, never font loading or the real CSS cascade, so this class of
|
|
11
|
+
* bug is invisible to it):
|
|
12
|
+
*
|
|
13
|
+
* 1. Icon fonts render blank. A rule like `.icon:before{content:"\ue001"}`
|
|
14
|
+
* applies correctly, but the `@font-face` defining the family is
|
|
15
|
+
* dropped — so the glyph has no font to come from, while inline SVG
|
|
16
|
+
* icons are unaffected. That asymmetry makes it look like "only some
|
|
17
|
+
* icons broke". The Satoshi brand font, pulled in via `@import`, hits
|
|
18
|
+
* the same wall.
|
|
19
|
+
*
|
|
20
|
+
* 2. Tailwind v4 looks broken/scattered. It emits `@property` rules
|
|
21
|
+
* (`--tw-border-style`, `--tw-shadow`, the transform variables, and
|
|
22
|
+
* so on) purely to give those custom properties their initial
|
|
23
|
+
* values. Dropped inside a shadow root, every
|
|
24
|
+
* `var(--tw-border-style)` resolves to nothing, so borders, shadows,
|
|
25
|
+
* and transforms silently stop applying while plain utilities like
|
|
26
|
+
* flex/padding keep working.
|
|
27
|
+
*
|
|
28
|
+
* The fix is simply to also place these specific rules in document.head,
|
|
29
|
+
* where they're valid — the rest of the CSS stays in the shadow root,
|
|
30
|
+
* where it still provides the isolation the custom element exists for.
|
|
31
|
+
* Fonts and registered custom properties are global by nature; there's
|
|
32
|
+
* no isolation to lose by hoisting them.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Extracts every document-scoped rule from the given stylesheets and adds
|
|
36
|
+
* them to document.head. Idempotent — safe to call on every mount, and on
|
|
37
|
+
* every element instance if several exist on one page.
|
|
38
|
+
*/
|
|
39
|
+
export declare function injectDocumentScopedRules(cssStrings: string[]): void;
|