@react-email/editor 0.0.0-experimental.42 → 0.0.0-experimental.44
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/dist/core/index.cjs +4 -3
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +3 -3
- package/dist/{create-paste-handler-CGR738bC.d.mts → create-paste-handler-DsJYKisA.d.mts} +1 -1
- package/dist/{create-paste-handler-CGR738bC.d.mts.map → create-paste-handler-DsJYKisA.d.mts.map} +1 -1
- package/dist/{event-bus-CHEzOS_O.mjs → event-bus-BFzKTuhV.mjs} +34 -3
- package/dist/event-bus-BFzKTuhV.mjs.map +1 -0
- package/dist/{event-bus-fb8U7hrl.cjs → event-bus-D-uahiao.cjs} +58 -3
- package/dist/{extension-BZsTEb_s.mjs → extension-B_ImOuII.mjs} +298 -11
- package/dist/extension-B_ImOuII.mjs.map +1 -0
- package/dist/{extension-D23sh0Nj.cjs → extension-DHsEsAaO.cjs} +298 -35
- package/dist/extensions/index.cjs +3 -3
- package/dist/extensions/index.d.cts +3 -1
- package/dist/extensions/index.d.cts.map +1 -1
- package/dist/extensions/index.d.mts +4 -2
- package/dist/extensions/index.d.mts.map +1 -1
- package/dist/extensions/index.mjs +3 -3
- package/dist/{extensions-D-VkzZTa.mjs → extensions-CLBkYvzM.mjs} +76 -45
- package/dist/extensions-CLBkYvzM.mjs.map +1 -0
- package/dist/{extensions-wGY7l1wH.cjs → extensions-ZVX3PUnH.cjs} +83 -52
- package/dist/{styles-C-cCyJCn.cjs → global-content-6jVh6L0b.mjs} +87 -17
- package/dist/global-content-6jVh6L0b.mjs.map +1 -0
- package/dist/{styles-_TMw3YxC.mjs → global-content-D3TNgSN6.cjs} +130 -2
- package/dist/{index-CxX7W63O.d.mts → index-BL2rehV8.d.mts} +68 -4
- package/dist/index-BL2rehV8.d.mts.map +1 -0
- package/dist/{index-C4KcMQ0R.d.cts → index-DJgMqa5C.d.cts} +67 -3
- package/dist/index-DJgMqa5C.d.cts.map +1 -0
- package/dist/index.cjs +5 -10
- package/dist/index.css +339 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +8 -13
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/index.cjs +1 -5
- package/dist/plugins/index.d.cts +5 -123
- package/dist/plugins/index.d.cts.map +1 -1
- package/dist/plugins/index.d.mts +5 -123
- package/dist/plugins/index.d.mts.map +1 -1
- package/dist/plugins/index.mjs +2 -2
- package/dist/{root-Jq1R3tkX.cjs → root-CEAehvsX.cjs} +75 -88
- package/dist/{root-pS4l8bVZ.mjs → root-CJuwiIRn.mjs} +83 -84
- package/dist/root-CJuwiIRn.mjs.map +1 -0
- package/dist/{set-text-alignment-OA8IMWmO.mjs → set-text-alignment-GMXOPMlJ.mjs} +1 -1
- package/dist/{set-text-alignment-OA8IMWmO.mjs.map → set-text-alignment-GMXOPMlJ.mjs.map} +1 -1
- package/dist/types-BNEbRz-a.d.cts +47 -0
- package/dist/types-BNEbRz-a.d.cts.map +1 -0
- package/dist/types-C8k-blF7.d.mts +47 -0
- package/dist/types-C8k-blF7.d.mts.map +1 -0
- package/dist/ui/index.cjs +2970 -20
- package/dist/ui/index.d.cts +472 -160
- package/dist/ui/index.d.cts.map +1 -1
- package/dist/ui/index.d.mts +514 -202
- package/dist/ui/index.d.mts.map +1 -1
- package/dist/ui/index.mjs +2929 -3
- package/dist/ui/index.mjs.map +1 -1
- package/dist/ui/inspector/inspector.css +338 -0
- package/dist/ui/themes/default.css +339 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +6 -4
- package/readme.md +69 -0
- package/dist/event-bus-CHEzOS_O.mjs.map +0 -1
- package/dist/extension-BZsTEb_s.mjs.map +0 -1
- package/dist/extensions-D-VkzZTa.mjs.map +0 -1
- package/dist/global-content-D_WYaFgX.mjs +0 -78
- package/dist/global-content-D_WYaFgX.mjs.map +0 -1
- package/dist/global-content-bJgotqmA.cjs +0 -89
- package/dist/index-C4KcMQ0R.d.cts.map +0 -1
- package/dist/index-CxX7W63O.d.mts.map +0 -1
- package/dist/root-pS4l8bVZ.mjs.map +0 -1
- package/dist/styles-_TMw3YxC.mjs.map +0 -1
- /package/dist/{set-text-alignment-Cv72txmv.cjs → set-text-alignment-aNb7Ml9N.cjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as UploadImageHandler, t as PasteHandler } from "./create-paste-handler-
|
|
1
|
+
import { n as UploadImageHandler, t as PasteHandler } from "./create-paste-handler-DsJYKisA.mjs";
|
|
2
2
|
import { UseEditorOptions } from "@tiptap/react";
|
|
3
3
|
import { Content, Editor, Extensions, JSONContent, Mark, MarkConfig, MarkType, Node, NodeConfig, NodeType } from "@tiptap/core";
|
|
4
|
-
import { Node as Node$1 } from "@tiptap/pm/model";
|
|
4
|
+
import { Attrs, Node as Node$1 } from "@tiptap/pm/model";
|
|
5
5
|
|
|
6
6
|
//#region src/core/event-bus.d.ts
|
|
7
7
|
|
|
@@ -19,7 +19,16 @@ import { Node as Node$1 } from "@tiptap/pm/model";
|
|
|
19
19
|
*/
|
|
20
20
|
interface EditorEventMap {
|
|
21
21
|
'bubble-menu:add-link': undefined;
|
|
22
|
+
'node-clicked': NodeClickedEvent$1;
|
|
22
23
|
}
|
|
24
|
+
type NodeClickedEvent$1 = {
|
|
25
|
+
nodeType: string;
|
|
26
|
+
nodeAttrs: Attrs;
|
|
27
|
+
nodePos: {
|
|
28
|
+
pos: number;
|
|
29
|
+
inside: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
23
32
|
type EditorEventName = keyof EditorEventMap;
|
|
24
33
|
type EditorEventHandler<T extends EditorEventName> = (payload: EditorEventMap[T]) => void | Promise<void>;
|
|
25
34
|
interface EditorEventSubscription {
|
|
@@ -35,6 +44,9 @@ declare class EditorEventBus {
|
|
|
35
44
|
}): EditorEventSubscription;
|
|
36
45
|
}
|
|
37
46
|
declare const editorEventBus: EditorEventBus;
|
|
47
|
+
declare function useEditorEvent<T extends EditorEventName>(eventName: T, handler: EditorEventHandler<T>, options?: AddEventListenerOptions & {
|
|
48
|
+
target?: EventTarget;
|
|
49
|
+
}): void;
|
|
38
50
|
//#endregion
|
|
39
51
|
//#region src/core/is-document-visually-empty.d.ts
|
|
40
52
|
declare function isDocumentVisuallyEmpty(doc: Node$1): boolean;
|
|
@@ -128,6 +140,58 @@ declare class EmailNode<Options = Record<string, never>, Storage = Record<string
|
|
|
128
140
|
}>)): EmailNode<ExtendedOptions, ExtendedStorage>;
|
|
129
141
|
}
|
|
130
142
|
//#endregion
|
|
143
|
+
//#region src/core/types.d.ts
|
|
144
|
+
/**
|
|
145
|
+
* A single placeholder item with all metadata needed for rendering.
|
|
146
|
+
* Used by the event bus and placeholder plugin.
|
|
147
|
+
*/
|
|
148
|
+
interface PlaceholderItem {
|
|
149
|
+
/** Full placeholder string, e.g., '{{{contact.email}}}' */
|
|
150
|
+
id: string;
|
|
151
|
+
/** Display text shown in the dropdown, e.g., 'contact.email' */
|
|
152
|
+
displayKey: string;
|
|
153
|
+
/** Base key used for updates, e.g., 'contact' or the placeholder name */
|
|
154
|
+
placeholderKey: string;
|
|
155
|
+
/** Fallback value for the variable */
|
|
156
|
+
fallbackValue: string | null;
|
|
157
|
+
/** Category ID this variable belongs to */
|
|
158
|
+
category: string;
|
|
159
|
+
/** Placeholder type (string, number, boolean, object, list) - needed for loop item computation */
|
|
160
|
+
type?: string;
|
|
161
|
+
/** Override fallback warning for this specific item */
|
|
162
|
+
skipFallbackWarning?: boolean;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Custom placeholder definition used in the placeholders plugin.
|
|
166
|
+
*/
|
|
167
|
+
type CustomPlaceholder = {
|
|
168
|
+
id: string;
|
|
169
|
+
key: string;
|
|
170
|
+
type: string;
|
|
171
|
+
fallback_value?: string | null;
|
|
172
|
+
};
|
|
173
|
+
declare module './event-bus' {
|
|
174
|
+
interface EditorEventMap {
|
|
175
|
+
'node-clicked': NodeClickedEvent;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Event handler function type.
|
|
180
|
+
*/
|
|
181
|
+
type EventHandler<T extends EditorEventName> = (payload: EditorEventMap[T]) => void | Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Subscription handle returned when subscribing to events.
|
|
184
|
+
*/
|
|
185
|
+
interface EventSubscription {
|
|
186
|
+
unsubscribe: () => void;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Options for dispatching events.
|
|
190
|
+
*/
|
|
191
|
+
interface DispatchOptions {
|
|
192
|
+
target?: EventTarget;
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
131
195
|
//#region src/core/use-editor.d.ts
|
|
132
196
|
type Merge<A, B> = A & Omit<B, keyof A>;
|
|
133
197
|
declare function useEditor$1({
|
|
@@ -157,5 +221,5 @@ declare function useEditor$1({
|
|
|
157
221
|
isCollaborative: boolean;
|
|
158
222
|
};
|
|
159
223
|
//#endregion
|
|
160
|
-
export {
|
|
161
|
-
//# sourceMappingURL=index-
|
|
224
|
+
export { useEditorEvent as S, EditorEventMap as _, EventSubscription as a, NodeClickedEvent$1 as b, EmailNodeConfig as c, EmailMarkConfig as d, MarkRendererComponent as f, EditorEventHandler as g, isDocumentVisuallyEmpty as h, EventHandler as i, NodeRendererComponent as l, composeReactEmail as m, CustomPlaceholder as n, PlaceholderItem as o, SerializedMark as p, DispatchOptions as r, EmailNode as s, useEditor$1 as t, EmailMark as u, EditorEventName as v, editorEventBus as x, EditorEventSubscription as y };
|
|
225
|
+
//# sourceMappingURL=index-BL2rehV8.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BL2rehV8.d.mts","names":[],"sources":["../src/core/event-bus.ts","../src/core/is-document-visually-empty.ts","../src/core/serializer/compose-react-email.tsx","../src/core/serializer/email-mark.ts","../src/core/serializer/email-node.ts","../src/core/types.ts","../src/core/use-editor.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;AAiBA;AAKA;AAMA;AAEA;;;;AAEY,UAfK,cAAA,CAeL;EAAO,sBAAA,EAAA,SAAA;EAEF,cAAA,EAfC,kBAesB;AAEvC;AAOoB,KArBT,kBAAA,GAqBS;EACN,QAAA,EAAA,MAAA;EACF,SAAA,EArBA,KAqBA;EAAe,OAAA,EAAA;IACH,GAAA,EAAA,MAAA;IAYV,MAAA,EAAA,MAAA;EACA,CAAA;CACiB;AAAnB,KAhCD,eAAA,GAgCC,MAhCuB,cAgCvB;AACC,KA/BF,kBA+BE,CAAA,UA/B2B,eA+B3B,CAAA,GAAA,CAAA,OAAA,EA9BH,cA8BG,CA9BY,CA8BZ,CAAA,EAAA,GAAA,IAAA,GA7BF,OA6BE,CAAA,IAAA,CAAA;AAAqC,UA3BlC,uBAAA,CA2BkC;EAC9C,WAAA,EAAA,GAAA,GAAA,IAAA;;AAgCL,cAxDM,cAAA,CAwD4C;EAElC,QAAA,eAAc;EAAW,QAAA,CAAA,UArDpB,eAqDoB,CAAA,CAAA,SAAA,EApD1B,CAoD0B,EAAA,OAAA,EAnD5B,cAmD4B,CAnDb,CAmDa,CAAA,EAAA,OAEX,CAFW,EAAA;IAC5B,MAAA,CAAA,EAnDY,WAmDZ;EACiB,CAAA,CAAA,EAAA,IAAA;EAAnB,EAAA,CAAA,UAxCI,eAwCJ,CAAA,CAAA,SAAA,EAvCI,CAuCJ,EAAA,OAAA,EAtCE,kBAsCF,CAtCqB,CAsCrB,CAAA,EAAA,OACsC,CADtC,EArCG,uBAqCH,GAAA;IACC,MAAA,CAAA,EAtCuC,WAsCvC;EAAqC,CAAA,CAAA,EArC5C,uBAqC4C;;cALpC,gBAAc;iBAEX,yBAAyB,4BAC5B,YACF,mBAAmB,WChG9B,GDiGY;WAAqC;ACj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IAAA;CAC5B;eACiB,aAAA,CAAA;EAAnB,UAAA,cAAA,CAAA;IACC,cAAA,EK1DQ,gBL0DR;EAAqC;;;;;ACjGjC,KI8CJ,YJ9CI,CAAA,UI8CmB,eJ9Cc,CAAA,GAAA,CAAA,OAAA,EI+CtC,cJ/CsC,CI+CvB,CJ/CuB,CAAA,EAAA,GAAA,IAAA,GIgDrC,OJhDqC,CAAA,IAAA,CAAA;;;;ACiCvC,UGoBO,iBAAA,CHpBgB;EAKpB,WAAA,EAAA,GAAA,GAAA,IAiHZ;;;;;AA3GG,UGgBa,eAAA,CHhBb;EAAO,MAAA,CAAA,EGiBA,WHjBA;;;;KI5BN,cAAc,IAAI,KAAK,SAAS;iBAErB,WAAA;;;;;;;;;ANYG,GMHhB;WAEU;ENdI,UAAA,CAAA,EMeA,UNfc;EAKnB,QAAA,CAAA,EAAA,CAAA,MAAA,EMYE,MNZc,EAEf,WAAK,EAAA;IAIN,OAAA,EAAA,CAAA,GAAA,EAAe,MAAA,EAAA,GAAS,OAAA;EAExB,CAAA,EAAA,GAAA,IAAA;EAA6B,OAAA,CAAA,EMO3B,YNP2B;EAC9B,aAAA,CAAA,EMOS,kBNPT;EAAe,OAAA,CAAA,EAAA,CAAA,MAAA,EMQH,MNRG,GAAA,IAAA,EAAA,GAAA,IAAA;EACd,QAAA,CAAA,EAAA,OAAA;CAAO,EMUjB,gBNViB,CAAA,CAAA,EAAA;EAEF,MAAA,QAAA;EAIX,aAAA,EAAA,OAAc;EAKC,UAAA,YAAA;EACN,YAAA,OAAA,GAAA,IAAA;EACF,eAAA,EAAA,OAAA;CAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as UploadImageHandler, t as PasteHandler } from "./create-paste-handler-B8BtjBk3.cjs";
|
|
2
|
-
import { Node } from "@tiptap/pm/model";
|
|
2
|
+
import { Attrs, Node } from "@tiptap/pm/model";
|
|
3
3
|
import { Content, Editor, Extensions, JSONContent, Mark, MarkConfig, MarkType, Node as Node$1, NodeConfig, NodeType } from "@tiptap/core";
|
|
4
4
|
import { UseEditorOptions } from "@tiptap/react";
|
|
5
5
|
|
|
@@ -19,7 +19,16 @@ import { UseEditorOptions } from "@tiptap/react";
|
|
|
19
19
|
*/
|
|
20
20
|
interface EditorEventMap {
|
|
21
21
|
'bubble-menu:add-link': undefined;
|
|
22
|
+
'node-clicked': NodeClickedEvent$1;
|
|
22
23
|
}
|
|
24
|
+
type NodeClickedEvent$1 = {
|
|
25
|
+
nodeType: string;
|
|
26
|
+
nodeAttrs: Attrs;
|
|
27
|
+
nodePos: {
|
|
28
|
+
pos: number;
|
|
29
|
+
inside: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
23
32
|
type EditorEventName = keyof EditorEventMap;
|
|
24
33
|
type EditorEventHandler<T extends EditorEventName> = (payload: EditorEventMap[T]) => void | Promise<void>;
|
|
25
34
|
interface EditorEventSubscription {
|
|
@@ -35,6 +44,9 @@ declare class EditorEventBus {
|
|
|
35
44
|
}): EditorEventSubscription;
|
|
36
45
|
}
|
|
37
46
|
declare const editorEventBus: EditorEventBus;
|
|
47
|
+
declare function useEditorEvent<T extends EditorEventName>(eventName: T, handler: EditorEventHandler<T>, options?: AddEventListenerOptions & {
|
|
48
|
+
target?: EventTarget;
|
|
49
|
+
}): void;
|
|
38
50
|
//#endregion
|
|
39
51
|
//#region src/core/is-document-visually-empty.d.ts
|
|
40
52
|
declare function isDocumentVisuallyEmpty(doc: Node): boolean;
|
|
@@ -128,6 +140,58 @@ declare class EmailNode<Options = Record<string, never>, Storage = Record<string
|
|
|
128
140
|
}>)): EmailNode<ExtendedOptions, ExtendedStorage>;
|
|
129
141
|
}
|
|
130
142
|
//#endregion
|
|
143
|
+
//#region src/core/types.d.ts
|
|
144
|
+
/**
|
|
145
|
+
* A single placeholder item with all metadata needed for rendering.
|
|
146
|
+
* Used by the event bus and placeholder plugin.
|
|
147
|
+
*/
|
|
148
|
+
interface PlaceholderItem {
|
|
149
|
+
/** Full placeholder string, e.g., '{{{contact.email}}}' */
|
|
150
|
+
id: string;
|
|
151
|
+
/** Display text shown in the dropdown, e.g., 'contact.email' */
|
|
152
|
+
displayKey: string;
|
|
153
|
+
/** Base key used for updates, e.g., 'contact' or the placeholder name */
|
|
154
|
+
placeholderKey: string;
|
|
155
|
+
/** Fallback value for the variable */
|
|
156
|
+
fallbackValue: string | null;
|
|
157
|
+
/** Category ID this variable belongs to */
|
|
158
|
+
category: string;
|
|
159
|
+
/** Placeholder type (string, number, boolean, object, list) - needed for loop item computation */
|
|
160
|
+
type?: string;
|
|
161
|
+
/** Override fallback warning for this specific item */
|
|
162
|
+
skipFallbackWarning?: boolean;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Custom placeholder definition used in the placeholders plugin.
|
|
166
|
+
*/
|
|
167
|
+
type CustomPlaceholder = {
|
|
168
|
+
id: string;
|
|
169
|
+
key: string;
|
|
170
|
+
type: string;
|
|
171
|
+
fallback_value?: string | null;
|
|
172
|
+
};
|
|
173
|
+
declare module './event-bus' {
|
|
174
|
+
interface EditorEventMap {
|
|
175
|
+
'node-clicked': NodeClickedEvent;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Event handler function type.
|
|
180
|
+
*/
|
|
181
|
+
type EventHandler<T extends EditorEventName> = (payload: EditorEventMap[T]) => void | Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Subscription handle returned when subscribing to events.
|
|
184
|
+
*/
|
|
185
|
+
interface EventSubscription {
|
|
186
|
+
unsubscribe: () => void;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Options for dispatching events.
|
|
190
|
+
*/
|
|
191
|
+
interface DispatchOptions {
|
|
192
|
+
target?: EventTarget;
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
131
195
|
//#region src/core/use-editor.d.ts
|
|
132
196
|
type Merge<A, B> = A & Omit<B, keyof A>;
|
|
133
197
|
declare function useEditor({
|
|
@@ -157,5 +221,5 @@ declare function useEditor({
|
|
|
157
221
|
isCollaborative: boolean;
|
|
158
222
|
};
|
|
159
223
|
//#endregion
|
|
160
|
-
export {
|
|
161
|
-
//# sourceMappingURL=index-
|
|
224
|
+
export { useEditorEvent as S, EditorEventMap as _, EventSubscription as a, NodeClickedEvent$1 as b, EmailNodeConfig as c, EmailMarkConfig as d, MarkRendererComponent as f, EditorEventHandler as g, isDocumentVisuallyEmpty as h, EventHandler as i, NodeRendererComponent as l, composeReactEmail as m, CustomPlaceholder as n, PlaceholderItem as o, SerializedMark as p, DispatchOptions as r, EmailNode as s, useEditor as t, EmailMark as u, EditorEventName as v, editorEventBus as x, EditorEventSubscription as y };
|
|
225
|
+
//# sourceMappingURL=index-DJgMqa5C.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DJgMqa5C.d.cts","names":[],"sources":["../src/core/event-bus.ts","../src/core/is-document-visually-empty.ts","../src/core/serializer/compose-react-email.tsx","../src/core/serializer/email-mark.ts","../src/core/serializer/email-node.ts","../src/core/types.ts","../src/core/use-editor.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;AAiBA;AAKA;AAMA;AAEA;;;;AAEY,UAfK,cAAA,CAeL;EAAO,sBAAA,EAAA,SAAA;EAEF,cAAA,EAfC,kBAesB;AAEvC;AAOoB,KArBT,kBAAA,GAqBS;EACN,QAAA,EAAA,MAAA;EACF,SAAA,EArBA,KAqBA;EAAe,OAAA,EAAA;IACH,GAAA,EAAA,MAAA;IAYV,MAAA,EAAA,MAAA;EACA,CAAA;CACiB;AAAnB,KAhCD,eAAA,GAgCC,MAhCuB,cAgCvB;AACC,KA/BF,kBA+BE,CAAA,UA/B2B,eA+B3B,CAAA,GAAA,CAAA,OAAA,EA9BH,cA8BG,CA9BY,CA8BZ,CAAA,EAAA,GAAA,IAAA,GA7BF,OA6BE,CAAA,IAAA,CAAA;AAAqC,UA3BlC,uBAAA,CA2BkC;EAC9C,WAAA,EAAA,GAA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AA,IAAA;EAA6B,OAAA,CAAA,EMO3B,YNP2B;EAC9B,aAAA,CAAA,EMOS,kBNPT;EAAe,OAAA,CAAA,EAAA,CAAA,MAAA,EMQH,MNRG,GAAA,IAAA,EAAA,GAAA,IAAA;EACd,QAAA,CAAA,EAAA,OAAA;CAAO,EMUjB,gBNViB,CAAA,CAAA,EAAA;EAEF,MAAA,QAAA;EAIX,aAAA,EAAA,OAAc;EAKC,UAAA,YAAA;EACN,YAAA,OAAA,GAAA,IAAA;EACF,eAAA,EAAA,OAAA;CAAe"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
const require_event_bus = require('./event-bus-
|
|
2
|
-
const require_extensions = require('./extensions-
|
|
3
|
-
const require_extension = require('./extension-
|
|
4
|
-
const require_root = require('./root-
|
|
5
|
-
let _tiptap_extensions = require("@tiptap/extensions");
|
|
1
|
+
const require_event_bus = require('./event-bus-D-uahiao.cjs');
|
|
2
|
+
const require_extensions = require('./extensions-ZVX3PUnH.cjs');
|
|
3
|
+
const require_extension = require('./extension-DHsEsAaO.cjs');
|
|
4
|
+
const require_root = require('./root-CEAehvsX.cjs');
|
|
6
5
|
let _tiptap_react = require("@tiptap/react");
|
|
7
6
|
let react = require("react");
|
|
8
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -30,11 +29,7 @@ function RefBridge({ editorRef }) {
|
|
|
30
29
|
const EmailEditor = (0, react.forwardRef)(({ content, onChange, onUploadImage, onReady, theme = "basic", editable = true, placeholder, bubbleMenu, extensions: extensionsProp, className }, ref) => {
|
|
31
30
|
const extensions = (0, react.useMemo)(() => {
|
|
32
31
|
if (extensionsProp) return extensionsProp;
|
|
33
|
-
return [
|
|
34
|
-
require_extensions.StarterKit.configure({ Placeholder: placeholder ? { placeholder } : void 0 }),
|
|
35
|
-
_tiptap_extensions.UndoRedo,
|
|
36
|
-
require_extension.EmailTheming.configure({ theme })
|
|
37
|
-
];
|
|
32
|
+
return [require_extensions.StarterKit.configure({ Placeholder: placeholder ? { placeholder } : void 0 }), require_extension.EmailTheming.configure({ theme })];
|
|
38
33
|
}, [
|
|
39
34
|
extensionsProp,
|
|
40
35
|
theme,
|
package/dist/index.css
CHANGED
|
@@ -329,6 +329,345 @@ a[data-re-link-bm-item] {
|
|
|
329
329
|
text-align: center;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
+
/* Minimal functional styles for Inspector compound components.
|
|
333
|
+
* This file handles layout only - no visual design.
|
|
334
|
+
* Import this optionally: import '@react-email/editor/styles/inspector.css';
|
|
335
|
+
*/
|
|
336
|
+
|
|
337
|
+
[data-re-inspector-field] {
|
|
338
|
+
display: flex;
|
|
339
|
+
align-items: center;
|
|
340
|
+
justify-content: space-between;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
[data-re-inspector-field] > label {
|
|
344
|
+
font-size: 0.75rem;
|
|
345
|
+
overflow: hidden;
|
|
346
|
+
text-overflow: ellipsis;
|
|
347
|
+
white-space: nowrap;
|
|
348
|
+
min-width: 0;
|
|
349
|
+
flex-shrink: 0;
|
|
350
|
+
width: 40%;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/* ----------------------------------------------------------------
|
|
354
|
+
* Text / number / textarea inputs
|
|
355
|
+
* ---------------------------------------------------------------- */
|
|
356
|
+
|
|
357
|
+
[data-re-inspector-input] {
|
|
358
|
+
font-size: 0.75rem;
|
|
359
|
+
padding: 0.25rem 0.375rem;
|
|
360
|
+
border: 1px solid var(--re-border, #e5e5e5);
|
|
361
|
+
border-radius: 0.25rem;
|
|
362
|
+
background: transparent;
|
|
363
|
+
color: inherit;
|
|
364
|
+
min-width: 0;
|
|
365
|
+
flex: 1;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
[data-re-inspector-input]:focus {
|
|
369
|
+
outline: none;
|
|
370
|
+
border-color: var(--re-text-muted, #6b6b6b);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
[data-re-inspector-input][data-type="number"] {
|
|
374
|
+
font-family: monospace;
|
|
375
|
+
width: 3.5rem;
|
|
376
|
+
flex: 0 0 auto;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
[data-re-inspector-input][data-type="textarea"] {
|
|
380
|
+
height: 100px;
|
|
381
|
+
max-height: 200px;
|
|
382
|
+
resize: vertical;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/* ----------------------------------------------------------------
|
|
386
|
+
* Number field wrapper (input + unit label)
|
|
387
|
+
* ---------------------------------------------------------------- */
|
|
388
|
+
|
|
389
|
+
[data-re-inspector-number] {
|
|
390
|
+
display: inline-flex;
|
|
391
|
+
align-items: center;
|
|
392
|
+
gap: 0.25rem;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
[data-re-inspector-unit] {
|
|
396
|
+
font-size: 0.6875rem;
|
|
397
|
+
font-family: monospace;
|
|
398
|
+
color: var(--re-text-muted, #6b6b6b);
|
|
399
|
+
cursor: ew-resize;
|
|
400
|
+
user-select: none;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* ----------------------------------------------------------------
|
|
404
|
+
* Select
|
|
405
|
+
* ---------------------------------------------------------------- */
|
|
406
|
+
|
|
407
|
+
[data-re-inspector-select] {
|
|
408
|
+
font-size: 0.75rem;
|
|
409
|
+
padding: 0.25rem 0.375rem;
|
|
410
|
+
border: 1px solid var(--re-border, #e5e5e5);
|
|
411
|
+
border-radius: 0.25rem;
|
|
412
|
+
background: transparent;
|
|
413
|
+
color: inherit;
|
|
414
|
+
min-width: 0;
|
|
415
|
+
flex: 1;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
[data-re-inspector-select]:focus {
|
|
419
|
+
outline: none;
|
|
420
|
+
border-color: var(--re-text-muted, #6b6b6b);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/* ----------------------------------------------------------------
|
|
424
|
+
* Color picker
|
|
425
|
+
* ---------------------------------------------------------------- */
|
|
426
|
+
|
|
427
|
+
[data-re-inspector-color-control] {
|
|
428
|
+
display: inline-flex;
|
|
429
|
+
align-items: center;
|
|
430
|
+
gap: 0.375rem;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
[data-re-inspector-color-trigger] {
|
|
434
|
+
width: 1.25rem;
|
|
435
|
+
height: 1.25rem;
|
|
436
|
+
border-radius: 0.25rem;
|
|
437
|
+
border: 1px solid var(--re-border, #e5e5e5);
|
|
438
|
+
cursor: pointer;
|
|
439
|
+
padding: 0;
|
|
440
|
+
flex-shrink: 0;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
[data-re-inspector-color-hex] {
|
|
444
|
+
width: 4.5rem;
|
|
445
|
+
font-size: 0.75rem;
|
|
446
|
+
font-family: monospace;
|
|
447
|
+
padding: 0.25rem 0.375rem;
|
|
448
|
+
border: 1px solid var(--re-border, #e5e5e5);
|
|
449
|
+
border-radius: 0.25rem;
|
|
450
|
+
background: transparent;
|
|
451
|
+
color: inherit;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
[data-re-inspector-color-hex]:focus {
|
|
455
|
+
outline: none;
|
|
456
|
+
border-color: var(--re-text-muted, #6b6b6b);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/* ----------------------------------------------------------------
|
|
460
|
+
* Toggle group
|
|
461
|
+
* ---------------------------------------------------------------- */
|
|
462
|
+
|
|
463
|
+
[data-re-inspector-toggle-group] {
|
|
464
|
+
display: inline-flex;
|
|
465
|
+
border: 1px solid var(--re-border, #e5e5e5);
|
|
466
|
+
border-radius: 0.25rem;
|
|
467
|
+
overflow: hidden;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
[data-re-inspector-toggle-item] {
|
|
471
|
+
display: inline-flex;
|
|
472
|
+
align-items: center;
|
|
473
|
+
justify-content: center;
|
|
474
|
+
padding: 0.25rem 0.375rem;
|
|
475
|
+
border: none;
|
|
476
|
+
background: transparent;
|
|
477
|
+
color: inherit;
|
|
478
|
+
cursor: pointer;
|
|
479
|
+
font-size: 0.75rem;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
[data-re-inspector-toggle-item] + [data-re-inspector-toggle-item] {
|
|
483
|
+
border-left: 1px solid var(--re-border, #e5e5e5);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
[data-re-inspector-toggle-item][data-active] {
|
|
487
|
+
background: var(--re-bg-active, #f0f0f0);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/* ----------------------------------------------------------------
|
|
491
|
+
* Tooltip
|
|
492
|
+
* ---------------------------------------------------------------- */
|
|
493
|
+
|
|
494
|
+
[data-re-inspector-tooltip] {
|
|
495
|
+
position: relative;
|
|
496
|
+
display: inline-flex;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
[data-re-inspector-tooltip-content] {
|
|
500
|
+
display: none;
|
|
501
|
+
position: absolute;
|
|
502
|
+
bottom: 100%;
|
|
503
|
+
left: 50%;
|
|
504
|
+
transform: translateX(-50%);
|
|
505
|
+
padding: 0.25rem 0.5rem;
|
|
506
|
+
border-radius: 0.25rem;
|
|
507
|
+
background: var(--re-tooltip-bg, #1a1a1a);
|
|
508
|
+
color: var(--re-tooltip-text, #fff);
|
|
509
|
+
font-size: 0.6875rem;
|
|
510
|
+
white-space: nowrap;
|
|
511
|
+
pointer-events: none;
|
|
512
|
+
z-index: 10;
|
|
513
|
+
margin-bottom: 0.25rem;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
[data-re-inspector-tooltip]:hover [data-re-inspector-tooltip-content] {
|
|
517
|
+
display: block;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/* ----------------------------------------------------------------
|
|
521
|
+
* Buttons
|
|
522
|
+
* ---------------------------------------------------------------- */
|
|
523
|
+
|
|
524
|
+
[data-re-inspector-button] {
|
|
525
|
+
display: inline-flex;
|
|
526
|
+
align-items: center;
|
|
527
|
+
justify-content: center;
|
|
528
|
+
gap: 0.25rem;
|
|
529
|
+
padding: 0.375rem 0.75rem;
|
|
530
|
+
border: 1px solid var(--re-border, #e5e5e5);
|
|
531
|
+
border-radius: 0.25rem;
|
|
532
|
+
background: transparent;
|
|
533
|
+
color: inherit;
|
|
534
|
+
font-size: 0.75rem;
|
|
535
|
+
cursor: pointer;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
[data-re-inspector-button]:hover {
|
|
539
|
+
background: var(--re-bg-hover, #f5f5f5);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
[data-re-inspector-icon-button] {
|
|
543
|
+
display: inline-flex;
|
|
544
|
+
align-items: center;
|
|
545
|
+
justify-content: center;
|
|
546
|
+
padding: 0.25rem;
|
|
547
|
+
border: none;
|
|
548
|
+
background: transparent;
|
|
549
|
+
color: inherit;
|
|
550
|
+
cursor: pointer;
|
|
551
|
+
border-radius: 0.25rem;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
[data-re-inspector-icon-button]:hover {
|
|
555
|
+
background: var(--re-bg-hover, #f5f5f5);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/* ----------------------------------------------------------------
|
|
559
|
+
* Label & Text
|
|
560
|
+
* ---------------------------------------------------------------- */
|
|
561
|
+
|
|
562
|
+
[data-re-inspector-label] {
|
|
563
|
+
font-size: 0.75rem;
|
|
564
|
+
color: var(--re-text-muted, #6b6b6b);
|
|
565
|
+
white-space: nowrap;
|
|
566
|
+
flex-shrink: 0;
|
|
567
|
+
min-width: 4rem;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
[data-re-inspector-text][data-color="muted"] {
|
|
571
|
+
color: var(--re-text-muted, #6b6b6b);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/* ----------------------------------------------------------------
|
|
575
|
+
* Prop row
|
|
576
|
+
* ---------------------------------------------------------------- */
|
|
577
|
+
|
|
578
|
+
[data-re-inspector-prop-row] {
|
|
579
|
+
display: flex;
|
|
580
|
+
align-items: center;
|
|
581
|
+
justify-content: space-between;
|
|
582
|
+
gap: 0.5rem;
|
|
583
|
+
font-size: 0.75rem;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/* ----------------------------------------------------------------
|
|
587
|
+
* Section
|
|
588
|
+
* ---------------------------------------------------------------- */
|
|
589
|
+
|
|
590
|
+
[data-re-inspector-section] {
|
|
591
|
+
display: flex;
|
|
592
|
+
flex-direction: column;
|
|
593
|
+
gap: 0.5rem;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
[data-re-inspector-section] + [data-re-inspector-section] {
|
|
597
|
+
padding-top: 0.75rem;
|
|
598
|
+
border-top: 1px solid var(--re-border, #e5e5e5);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
[data-re-inspector-section-header] {
|
|
602
|
+
display: flex;
|
|
603
|
+
align-items: center;
|
|
604
|
+
justify-content: space-between;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
[data-re-inspector-section-toggle] {
|
|
608
|
+
background: none;
|
|
609
|
+
border: none;
|
|
610
|
+
padding: 0;
|
|
611
|
+
cursor: pointer;
|
|
612
|
+
color: inherit;
|
|
613
|
+
font: inherit;
|
|
614
|
+
font-weight: 600;
|
|
615
|
+
font-size: 0.75rem;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
[data-re-inspector-section-body] {
|
|
619
|
+
display: flex;
|
|
620
|
+
flex-direction: column;
|
|
621
|
+
gap: 0.5rem;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/* ----------------------------------------------------------------
|
|
625
|
+
* Breadcrumb
|
|
626
|
+
* ---------------------------------------------------------------- */
|
|
627
|
+
|
|
628
|
+
[data-re-inspector-breadcrumb-list] {
|
|
629
|
+
display: flex;
|
|
630
|
+
align-items: center;
|
|
631
|
+
gap: 0.25rem;
|
|
632
|
+
list-style: none;
|
|
633
|
+
margin: 0;
|
|
634
|
+
padding: 0;
|
|
635
|
+
font-size: 0.75rem;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
[data-re-inspector-breadcrumb-item] {
|
|
639
|
+
display: flex;
|
|
640
|
+
align-items: center;
|
|
641
|
+
gap: 0.25rem;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
[data-re-inspector-breadcrumb-separator] {
|
|
645
|
+
color: var(--re-text-muted, #6b6b6b);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
[data-re-inspector-breadcrumb-button] {
|
|
649
|
+
background: none;
|
|
650
|
+
border: none;
|
|
651
|
+
padding: 0;
|
|
652
|
+
color: var(--re-text, #1c1c1c);
|
|
653
|
+
font: inherit;
|
|
654
|
+
font-size: 0.75rem;
|
|
655
|
+
cursor: default;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
[data-re-inspector-breadcrumb-button][data-clickable] {
|
|
659
|
+
cursor: pointer;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
[data-re-inspector-breadcrumb-button][data-clickable]:hover {
|
|
663
|
+
text-decoration: underline;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
[data-re-inspector-breadcrumb-ellipsis] {
|
|
667
|
+
color: var(--re-text-muted, #6b6b6b);
|
|
668
|
+
font-size: 0.75rem;
|
|
669
|
+
}
|
|
670
|
+
|
|
332
671
|
/* Default theme for @react-email/editor bubble menu primitives.
|
|
333
672
|
*
|
|
334
673
|
* Opt-in: import '@react-email/editor/themes/default.css';
|