@boxcc/maildeno-editor 0.0.0-stage → 0.4.13
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/CHANGELOG.md +479 -0
- package/README.md +441 -2
- package/dist/DatePicker-AdfGW0Tw.js +5347 -0
- package/dist/DatePicker-aNFlsoOb.js +5347 -0
- package/dist/Dialog-By0JLN8s.js +6294 -0
- package/dist/HealthIndicator-4Iw6N-g_.js +1216 -0
- package/dist/HealthIndicator-ZohgzF2_.js +1217 -0
- package/dist/PopperContent-N2nAEFeH.js +2538 -0
- package/dist/PopperContent-eLmz1Gjd.js +2578 -0
- package/dist/PreviewCanvas-DzpLghCo.js +534 -0
- package/dist/PreviewCanvas-QN4C68KA.js +534 -0
- package/dist/RichTextEditor-CmM4XRFC.js +12218 -0
- package/dist/RichTextEditor-Cz1-_ZtA.js +12217 -0
- package/dist/RowPreviewChildren-BYaMZID3.js +4 -0
- package/dist/RowPreviewChildren-_A9gPQCs.js +4 -0
- package/dist/RowPreviewLegacyComponent-Df_1HTly.js +403 -0
- package/dist/RowPreviewLegacyComponent-NECG3wpn.js +403 -0
- package/dist/RowPreviewRow-DPaSbxmB.js +81 -0
- package/dist/RowPreviewRow-Dx4ExtSN.js +81 -0
- package/dist/SavedRowsPanel-DqSHB6Jk.js +492 -0
- package/dist/SavedRowsPanel-DyXjSOEt.js +493 -0
- package/dist/_plugin-vue_export-helper-Dj7HTbfw.js +8 -0
- package/dist/adapters/errors.d.ts +59 -0
- package/dist/adapters/localStorageAdapter.d.ts +6 -0
- package/dist/adapters/types.d.ts +151 -0
- package/dist/babel-DV7WPQI0.js +10043 -0
- package/dist/blocks/registry.d.ts +23 -0
- package/dist/blocks/types.d.ts +73 -0
- package/dist/borderRadius-CkSa1lQ9.js +75 -0
- package/dist/components/features/emailBuilder/EmailEditor.vue.d.ts +182 -0
- package/dist/composables/emailBuilder/export/logic/espLogicWrapper.d.ts +76 -0
- package/dist/composables/emailBuilder/persistence/useEmailBuilderPersistence.d.ts +38 -0
- package/dist/composables/emailBuilder/transform/pipeline/optimize.d.ts +100 -0
- package/dist/composables/system/useColorScheme.d.ts +16 -0
- package/dist/element-B3gq8Xvd.js +21500 -0
- package/dist/element.d.ts +6 -0
- package/dist/element.js +5 -0
- package/dist/esp/registry.d.ts +33 -0
- package/dist/estree-DY9POgc0.js +8195 -0
- package/dist/html-wb0gSX1o.js +7273 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +14992 -0
- package/dist/init.d.ts +178 -0
- package/dist/init.js +137 -0
- package/dist/maildeno-editor.css +2 -0
- package/dist/merge-tags/registry.d.ts +33 -0
- package/dist/mergeTagDefinitions-Cler19nv.js +27 -0
- package/dist/standalone-DHvJ30Td.js +3554 -0
- package/dist/theme.d.ts +206 -0
- package/dist/types/assistant.d.ts +56 -0
- package/dist/useEmailBuilder-B19p-2yp.js +4924 -0
- package/dist/useEmailBuilder-BR4wfai1.js +4924 -0
- package/dist/useToast-DD11IxqP.js +194 -0
- package/dist/utils/border.d.ts +15 -0
- package/dist/utils/borderRadius.d.ts +10 -0
- package/dist/vue.runtime.esm-bundler-D2AjRP90.js +6117 -0
- package/package.json +100 -4
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { W as g } from "./useEmailBuilder-B19p-2yp.js";
|
|
2
|
+
import { inject as w, provide as y, ref as u } from "vue";
|
|
3
|
+
var R = /* @__PURE__ */ Symbol("maildeno-editor:saved-rows-panel");
|
|
4
|
+
function j() {
|
|
5
|
+
const e = P();
|
|
6
|
+
return y(R, e), e;
|
|
7
|
+
}
|
|
8
|
+
var x = () => {
|
|
9
|
+
const e = w(R);
|
|
10
|
+
if (!e) throw new Error("[maildeno-editor] useSavedRowsPanel() was called outside an EmailEditor instance.");
|
|
11
|
+
return e;
|
|
12
|
+
};
|
|
13
|
+
function P() {
|
|
14
|
+
const e = u(!1), t = u("user");
|
|
15
|
+
function a(r) {
|
|
16
|
+
r && (t.value = r), e.value = !0;
|
|
17
|
+
}
|
|
18
|
+
function s() {
|
|
19
|
+
e.value = !1;
|
|
20
|
+
}
|
|
21
|
+
function o(r) {
|
|
22
|
+
if (r && e.value && t.value !== r) {
|
|
23
|
+
t.value = r;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
e.value = !e.value, e.value && r && (t.value = r);
|
|
27
|
+
}
|
|
28
|
+
function n(r) {
|
|
29
|
+
t.value = r;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
isOpen: e,
|
|
33
|
+
activeTab: t,
|
|
34
|
+
open: a,
|
|
35
|
+
close: s,
|
|
36
|
+
toggle: o,
|
|
37
|
+
setTab: n
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
var S = /* @__PURE__ */ Symbol("maildeno-editor:layout-drag");
|
|
41
|
+
function A() {
|
|
42
|
+
const e = E();
|
|
43
|
+
return y(S, e), e;
|
|
44
|
+
}
|
|
45
|
+
var K = () => {
|
|
46
|
+
const e = w(S);
|
|
47
|
+
if (!e) throw new Error("[maildeno-editor] useLayoutDrag() was called outside an EmailEditor instance.");
|
|
48
|
+
return e;
|
|
49
|
+
};
|
|
50
|
+
function E() {
|
|
51
|
+
const e = u(!1), t = u(null);
|
|
52
|
+
return {
|
|
53
|
+
isLayoutDragActive: e,
|
|
54
|
+
layoutDragPayload: t,
|
|
55
|
+
startLayoutDrag: (o, n) => {
|
|
56
|
+
e.value = !0, t.value = n, o.dataTransfer && (o.dataTransfer.effectAllowed = "copy", o.dataTransfer.setData("layoutDragType", n.type), (n.type === "row" || n.type === "nested-row") && o.dataTransfer.setData("layoutDragColumns", JSON.stringify(n.columns)), n.type === "product-row" && o.dataTransfer.setData("layoutDragEntryId", n.entryId), n.type === "nested-row" && (o.dataTransfer.setData("layoutDragTargetColumnId", n.targetColumnId), o.dataTransfer.setData("layoutDragTargetIndex", String(n.targetIndex))));
|
|
57
|
+
},
|
|
58
|
+
endLayoutDrag: () => {
|
|
59
|
+
e.value = !1, t.value = null;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function L(e) {
|
|
64
|
+
const t = e ?? g(), a = u([]), s = u(!1);
|
|
65
|
+
let o = !1;
|
|
66
|
+
async function n() {
|
|
67
|
+
if (!o) {
|
|
68
|
+
o = !0, s.value = !0;
|
|
69
|
+
try {
|
|
70
|
+
a.value = await t.listSavedRows();
|
|
71
|
+
} finally {
|
|
72
|
+
s.value = !1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async function r(i, c) {
|
|
77
|
+
const l = await t.saveSavedRow(i, c);
|
|
78
|
+
return l && (a.value = [l, ...a.value]), l;
|
|
79
|
+
}
|
|
80
|
+
async function m(i) {
|
|
81
|
+
await t.deleteSavedRow(i), a.value = a.value.filter((c) => c.id !== i);
|
|
82
|
+
}
|
|
83
|
+
async function d(i, c) {
|
|
84
|
+
return await t.renameSavedRow(i, c), a.value = a.value.map((l) => l.id === i ? {
|
|
85
|
+
...l,
|
|
86
|
+
name: c.trim() || l.name
|
|
87
|
+
} : l), a.value;
|
|
88
|
+
}
|
|
89
|
+
function T(i) {
|
|
90
|
+
return t.cloneSavedRowForCanvas(i);
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
productRows: a,
|
|
94
|
+
isFetching: s,
|
|
95
|
+
fetchRows: n,
|
|
96
|
+
saveProductRow: r,
|
|
97
|
+
deleteProductRow: m,
|
|
98
|
+
renameProductRow: d,
|
|
99
|
+
cloneRowForCanvas: T
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
var p = /* @__PURE__ */ Symbol("maildeno-editor:product-rows");
|
|
103
|
+
function O(e) {
|
|
104
|
+
const t = L(e);
|
|
105
|
+
return y(p, t), t;
|
|
106
|
+
}
|
|
107
|
+
var H = () => {
|
|
108
|
+
const e = w(p);
|
|
109
|
+
if (!e) throw new Error("[maildeno-editor] useProductRows() was called outside an EmailEditor instance.");
|
|
110
|
+
return e;
|
|
111
|
+
};
|
|
112
|
+
function D(e) {
|
|
113
|
+
const t = e ?? g(), a = u([]), s = u(!1), o = u(typeof t.listSystemSavedRows == "function");
|
|
114
|
+
let n = !1;
|
|
115
|
+
async function r() {
|
|
116
|
+
if (!(n || !o.value)) {
|
|
117
|
+
n = !0, s.value = !0;
|
|
118
|
+
try {
|
|
119
|
+
a.value = await t.listSystemSavedRows();
|
|
120
|
+
} catch (d) {
|
|
121
|
+
console.warn("[maildeno-editor] couldn't load shared rows:", d), a.value = [];
|
|
122
|
+
} finally {
|
|
123
|
+
s.value = !1;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function m(d) {
|
|
128
|
+
return t.cloneSavedRowForCanvas(d);
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
systemRows: a,
|
|
132
|
+
isFetching: s,
|
|
133
|
+
isSupported: o,
|
|
134
|
+
fetchRows: r,
|
|
135
|
+
cloneRowForCanvas: m
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
var h = /* @__PURE__ */ Symbol("maildeno-editor:system-rows");
|
|
139
|
+
function k(e) {
|
|
140
|
+
const t = D(e);
|
|
141
|
+
return y(h, t), t;
|
|
142
|
+
}
|
|
143
|
+
function J() {
|
|
144
|
+
const e = w(h, void 0);
|
|
145
|
+
return e || D();
|
|
146
|
+
}
|
|
147
|
+
function M(e) {
|
|
148
|
+
if (typeof e == "object" && e !== null) try {
|
|
149
|
+
return e.handled = !0, e;
|
|
150
|
+
} catch {
|
|
151
|
+
}
|
|
152
|
+
return Object.assign(new Error(String(e?.message ?? e)), {
|
|
153
|
+
handled: !0,
|
|
154
|
+
cause: e
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function W(e) {
|
|
158
|
+
return typeof e == "object" && e !== null && e.handled === !0;
|
|
159
|
+
}
|
|
160
|
+
var f = u([]), I = 0, v = /* @__PURE__ */ new Map();
|
|
161
|
+
function F(e) {
|
|
162
|
+
f.value = f.value.filter((a) => a.id !== e);
|
|
163
|
+
const t = v.get(e);
|
|
164
|
+
t && (clearTimeout(t), v.delete(e));
|
|
165
|
+
}
|
|
166
|
+
function q() {
|
|
167
|
+
return {
|
|
168
|
+
add(e) {
|
|
169
|
+
const t = I++;
|
|
170
|
+
f.value = [...f.value, {
|
|
171
|
+
...e,
|
|
172
|
+
id: t
|
|
173
|
+
}], v.set(t, setTimeout(() => F(t), e.life ?? 3e3));
|
|
174
|
+
},
|
|
175
|
+
removeAll() {
|
|
176
|
+
v.forEach((e) => clearTimeout(e)), v.clear(), f.value = [];
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
export {
|
|
181
|
+
M as a,
|
|
182
|
+
O as c,
|
|
183
|
+
K as d,
|
|
184
|
+
j as f,
|
|
185
|
+
W as i,
|
|
186
|
+
H as l,
|
|
187
|
+
f as n,
|
|
188
|
+
k as o,
|
|
189
|
+
x as p,
|
|
190
|
+
q as r,
|
|
191
|
+
J as s,
|
|
192
|
+
F as t,
|
|
193
|
+
A as u
|
|
194
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface BorderSide {
|
|
2
|
+
width: number;
|
|
3
|
+
color: string;
|
|
4
|
+
style: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const borderDirections: readonly ["top", "right", "bottom", "left"];
|
|
7
|
+
export type BorderDirection = (typeof borderDirections)[number];
|
|
8
|
+
export interface BorderValue extends BorderSide {
|
|
9
|
+
sides?: Record<BorderDirection, BorderSide>;
|
|
10
|
+
}
|
|
11
|
+
export declare function borderSides(border?: BorderValue | null): Record<BorderDirection, BorderSide>;
|
|
12
|
+
export declare function toggleBorderMode<T extends BorderValue>(border: T): T;
|
|
13
|
+
export declare function hasBorder(border?: BorderValue | null): boolean;
|
|
14
|
+
export declare function borderStyles(border?: BorderValue | null): Record<string, string>;
|
|
15
|
+
export declare function borderToCss(border?: BorderValue | null, important?: boolean): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface RadiusCorners {
|
|
2
|
+
topLeft: number;
|
|
3
|
+
topRight: number;
|
|
4
|
+
bottomRight: number;
|
|
5
|
+
bottomLeft: number;
|
|
6
|
+
}
|
|
7
|
+
export type BorderRadius = number | RadiusCorners;
|
|
8
|
+
export declare function radiusCorners(value?: BorderRadius): RadiusCorners;
|
|
9
|
+
export declare function hasRadius(value?: BorderRadius): boolean;
|
|
10
|
+
export declare function radiusToCss(value?: BorderRadius, offset?: number): string;
|