@useinsider/guido 3.17.0-beta.ec8eabb → 3.17.0-beta.f7536b7
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/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +99 -96
- package/dist/components/organisms/header/EditorActions.vue.js +4 -4
- package/dist/components/organisms/header/EditorActions.vue2.js +23 -20
- package/dist/composables/useEditorLock.js +14 -12
- package/dist/composables/useGuidoStateBridge.js +35 -30
- package/dist/composables/useSave.js +0 -1
- package/dist/guido.css +1 -1
- package/dist/src/composables/useEditorLock.d.ts +4 -5
- package/package.json +1 -1
|
@@ -1,153 +1,156 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { provideGuidoActions as
|
|
5
|
-
import { useGuidoStateBridge as
|
|
6
|
-
import { usePartner as
|
|
7
|
-
import { useStripo as
|
|
8
|
-
import { useTimerClone as
|
|
9
|
-
import { migrate as
|
|
10
|
-
import { ModuleFolderDefaults as
|
|
11
|
-
import { RIBBON_SELECTOR as
|
|
12
|
-
import { useRecommendationExtensionStore as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { useStripoApi as
|
|
21
|
-
import { useConfigStore as
|
|
22
|
-
import { useDynamicContentStore as
|
|
23
|
-
import { useEditorStore as
|
|
24
|
-
import { usePreviewStore as
|
|
25
|
-
import { useTemplateStore as
|
|
26
|
-
import { useUnsubscribeStore as
|
|
27
|
-
import { readTrackFloor as
|
|
28
|
-
const
|
|
1
|
+
import { defineComponent as Y, defineAsyncComponent as N, ref as O, computed as P, watch as x, onMounted as Z, onUnmounted as ee } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as oe } from "../composables/useEditorLock.js";
|
|
4
|
+
import { provideGuidoActions as ne } from "../composables/useGuidoActions.js";
|
|
5
|
+
import { useGuidoStateBridge as re } from "../composables/useGuidoStateBridge.js";
|
|
6
|
+
import { usePartner as se } from "../composables/usePartner.js";
|
|
7
|
+
import { useStripo as ie } from "../composables/useStripo.js";
|
|
8
|
+
import { useTimerClone as ae } from "../composables/useTimerClone.js";
|
|
9
|
+
import { migrate as A } from "../config/migrator/index.js";
|
|
10
|
+
import { ModuleFolderDefaults as W } from "../enums/defaults.js";
|
|
11
|
+
import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
|
|
12
|
+
import { useRecommendationExtensionStore as de } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
13
|
+
import me from "./organisms/AutoSaveController.vue.js";
|
|
14
|
+
import le from "./organisms/base/Toaster.vue.js";
|
|
15
|
+
import ue from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
16
|
+
import pe from "./organisms/header/HeaderWrapper.vue.js";
|
|
17
|
+
import fe from "./organisms/LoadingWrapper.vue.js";
|
|
18
|
+
import ve from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
19
|
+
import ye from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
20
|
+
import { useStripoApi as ge } from "../services/stripoApi.js";
|
|
21
|
+
import { useConfigStore as he } from "../stores/config.js";
|
|
22
|
+
import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
|
|
23
|
+
import { useEditorStore as G } from "../stores/editor.js";
|
|
24
|
+
import { usePreviewStore as be } from "../stores/preview.js";
|
|
25
|
+
import { useTemplateStore as Ee } from "../stores/template.js";
|
|
26
|
+
import { useUnsubscribeStore as we } from "../stores/unsubscribe.js";
|
|
27
|
+
import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
|
|
28
|
+
const Qe = /* @__PURE__ */ Y({
|
|
29
29
|
__name: "Guido",
|
|
30
30
|
props: {
|
|
31
31
|
config: null,
|
|
32
32
|
ready: { type: Boolean, default: !0 }
|
|
33
33
|
},
|
|
34
34
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
35
|
-
setup(
|
|
36
|
-
const i =
|
|
35
|
+
setup($, { expose: z, emit: r }) {
|
|
36
|
+
const i = $, q = N(
|
|
37
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
|
-
),
|
|
38
|
+
), K = N(
|
|
39
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
), h =
|
|
41
|
-
i.ready &&
|
|
42
|
-
const c =
|
|
43
|
-
var
|
|
44
|
-
return (
|
|
45
|
-
},
|
|
46
|
-
c.loadingStatus =
|
|
40
|
+
), h = O(), l = O(), u = Se(), S = we(), o = he();
|
|
41
|
+
i.ready && o.init(i.config);
|
|
42
|
+
const c = G(), V = be(), m = P(() => c.hasChanges), { isTestPartner: j } = se(), b = () => {
|
|
43
|
+
var t;
|
|
44
|
+
return (t = h.value) == null ? void 0 : t.handleSave(!0);
|
|
45
|
+
}, E = (t) => {
|
|
46
|
+
c.loadingStatus = t;
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
te(), re();
|
|
49
49
|
const p = () => {
|
|
50
|
-
var
|
|
50
|
+
var t, e;
|
|
51
51
|
return {
|
|
52
|
-
emailId:
|
|
53
|
-
userId:
|
|
54
|
-
username:
|
|
55
|
-
partnerName:
|
|
56
|
-
savedModulesFolderName: ((
|
|
57
|
-
defaultModulesFolderName: ((e =
|
|
52
|
+
emailId: o.templateId,
|
|
53
|
+
userId: o.userId,
|
|
54
|
+
username: o.username,
|
|
55
|
+
partnerName: o.partnerName,
|
|
56
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
|
|
57
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
|
|
58
58
|
};
|
|
59
|
-
}, { initPlugin:
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
}, { initPlugin: w, preloadRuntime: C } = ie(), { runExclusive: k, beginMount: D, isCurrentMount: T } = oe();
|
|
60
|
+
let f = 0;
|
|
61
|
+
const { getDefaultTemplate: F } = ge(), { cloneTimersOnSave: I, hasTimerBlocks: L } = ae(), J = P(() => {
|
|
62
|
+
var t;
|
|
63
|
+
return !((t = o.ui) != null && t.showHeader);
|
|
62
64
|
});
|
|
63
|
-
|
|
65
|
+
ne({
|
|
64
66
|
onBack: () => {
|
|
65
67
|
console.debug("guido:back"), r("back");
|
|
66
68
|
},
|
|
67
69
|
onSaveStart: () => {
|
|
68
70
|
console.debug("guido:save:start"), r("save:start");
|
|
69
71
|
},
|
|
70
|
-
onSaveComplete: (
|
|
71
|
-
const e = { ...
|
|
72
|
+
onSaveComplete: (t) => {
|
|
73
|
+
const e = { ...t, metadata: p() };
|
|
72
74
|
console.debug("guido:save:complete", e), r("save:complete", e);
|
|
73
75
|
},
|
|
74
76
|
onTestEmailClick: () => {
|
|
75
77
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
76
78
|
}
|
|
77
79
|
});
|
|
78
|
-
const
|
|
79
|
-
console.debug("dynamic-content:close",
|
|
80
|
-
},
|
|
80
|
+
const M = (t) => {
|
|
81
|
+
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
82
|
+
}, R = () => {
|
|
81
83
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
82
84
|
};
|
|
83
|
-
|
|
85
|
+
x(() => m.value, () => {
|
|
84
86
|
r("on-change", m.value);
|
|
85
87
|
});
|
|
86
|
-
const
|
|
87
|
-
const e =
|
|
88
|
+
const v = (t) => {
|
|
89
|
+
const e = t, { attribute: s, position: d } = e.detail;
|
|
88
90
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
89
91
|
};
|
|
90
92
|
let a = null;
|
|
91
|
-
const
|
|
93
|
+
const y = () => {
|
|
92
94
|
var e;
|
|
93
|
-
const
|
|
94
|
-
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(
|
|
95
|
-
},
|
|
96
|
-
var
|
|
95
|
+
const t = document.querySelector(ce);
|
|
96
|
+
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
97
|
+
}, g = async () => {
|
|
98
|
+
var t;
|
|
97
99
|
try {
|
|
98
|
-
|
|
99
|
-
const e =
|
|
100
|
+
o.initialized || o.init(i.config), c.templateId = o.templateId;
|
|
101
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
100
102
|
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
101
|
-
const
|
|
103
|
+
const U = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds");
|
|
102
104
|
let n = {
|
|
103
|
-
html: s && await
|
|
105
|
+
html: s && await A(s, U),
|
|
104
106
|
css: d
|
|
105
107
|
};
|
|
106
|
-
n.html || (n = await
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
preselectedDynamicContentList:
|
|
108
|
+
n.html || (n = await F(), n.html = await A(n.html, U));
|
|
109
|
+
const Q = _ ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
110
|
+
L(n.html) && (n.html = await I(n.html)), _ && (c.trackIdSessionFloor = Math.max(Q, H(n.html)));
|
|
111
|
+
const X = {
|
|
112
|
+
preselectedDynamicContentList: B,
|
|
111
113
|
onReady: () => {
|
|
112
114
|
console.debug("guido:ready"), r("ready");
|
|
113
115
|
}
|
|
114
116
|
};
|
|
115
|
-
await
|
|
117
|
+
f = D(), await w(n, p(), X), u.selectedDynamicContentList = B;
|
|
116
118
|
} catch (e) {
|
|
117
119
|
console.error("Failed to initialize Stripo editor:", e);
|
|
118
120
|
}
|
|
119
121
|
};
|
|
120
|
-
return
|
|
122
|
+
return Z(async () => {
|
|
121
123
|
var e;
|
|
122
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
125
|
-
await
|
|
124
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), de().$reset(), G().$reset(), Ee().$reset(), y();
|
|
125
|
+
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
126
|
+
if (t && (a = new ResizeObserver(y), a.observe(t)), C(), i.ready)
|
|
127
|
+
await g();
|
|
126
128
|
else {
|
|
127
|
-
const s =
|
|
128
|
-
d && (s(),
|
|
129
|
+
const s = x(() => i.ready, (d) => {
|
|
130
|
+
d && (s(), g());
|
|
129
131
|
});
|
|
130
132
|
}
|
|
131
|
-
document.addEventListener("dynamic-content:open",
|
|
132
|
-
}),
|
|
133
|
-
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
document.addEventListener("dynamic-content:open", v);
|
|
134
|
+
}), ee(() => {
|
|
135
|
+
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", v), k(async () => {
|
|
136
|
+
if (T(f))
|
|
137
|
+
try {
|
|
138
|
+
window.UIEditor.removeEditor();
|
|
139
|
+
} catch {
|
|
140
|
+
console.debug("Failed to remove Stripo editor: No editor found");
|
|
141
|
+
}
|
|
142
|
+
}), o.reset();
|
|
143
|
+
}), z({
|
|
141
144
|
dynamicContent: {
|
|
142
|
-
insert:
|
|
143
|
-
close:
|
|
145
|
+
insert: M,
|
|
146
|
+
close: R
|
|
144
147
|
},
|
|
145
148
|
hasChanges: m,
|
|
146
|
-
saveSilent:
|
|
147
|
-
setLoading:
|
|
148
|
-
}), { __sfc: !0, PreviewContainer:
|
|
149
|
+
saveSilent: b,
|
|
150
|
+
setLoading: E
|
|
151
|
+
}), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: c, previewStore: V, hasChanges: m, isTestPartner: j, saveSilent: b, setLoading: E, emit: r, buildMetadata: p, initPlugin: w, preloadRuntime: C, runExclusive: k, beginMount: D, isCurrentMount: T, mountGeneration: f, getDefaultTemplate: F, cloneTimersOnSave: I, hasTimerBlocks: L, noHeader: J, insertDynamicContent: M, closeDynamicContent: R, handleDynamicContentOpen: v, ribbonObserver: a, updateRibbonOffset: y, startEditor: g, AutoSaveController: me, Toaster: le, FilterSelectionDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ve, UnsubscribeWrapper: ye };
|
|
149
152
|
}
|
|
150
153
|
});
|
|
151
154
|
export {
|
|
152
|
-
|
|
155
|
+
Qe as default
|
|
153
156
|
};
|
|
@@ -9,15 +9,15 @@ var u = function() {
|
|
|
9
9
|
} } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
|
|
10
10
|
return t.executeSave(!1);
|
|
11
11
|
} } })], 1);
|
|
12
|
-
},
|
|
12
|
+
}, c = [], p = /* @__PURE__ */ d(
|
|
13
13
|
l,
|
|
14
14
|
u,
|
|
15
|
-
|
|
15
|
+
c,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"c61cc8ea"
|
|
19
19
|
);
|
|
20
|
-
const v =
|
|
20
|
+
const v = p.exports;
|
|
21
21
|
export {
|
|
22
22
|
v as default
|
|
23
23
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as q, ref as n, computed as x } from "vue";
|
|
2
2
|
import { useActionsApi as b } from "../../../composables/useActionsApi.js";
|
|
3
3
|
import { useConfig as k } from "../../../composables/useConfig.js";
|
|
4
4
|
import { useExport as B } from "../../../composables/useExport.js";
|
|
@@ -15,33 +15,33 @@ import { getTooltipOptions as K } from "../../../utils/tooltipUtils.js";
|
|
|
15
15
|
import { InButtonV2 as N } from "@useinsider/design-system-vue";
|
|
16
16
|
import { storeToRefs as Q } from "pinia";
|
|
17
17
|
import U from "./MigrationConfirmModal.vue.js";
|
|
18
|
-
const ft = /* @__PURE__ */
|
|
18
|
+
const ft = /* @__PURE__ */ q({
|
|
19
19
|
__name: "EditorActions",
|
|
20
20
|
setup(W, { expose: w }) {
|
|
21
|
-
const { config:
|
|
21
|
+
const { config: l, isFeatureEnabled: m } = k(), { exportHtml: c } = B(), { save: p } = R(), { openVersionHistory: u, closeVersionHistory: f } = P(), { getCompiledEmail: d } = b(), { compileHtml: v } = L(), { validateLiquidSyntax: y } = j(), { handleError: r } = z(), e = G(), g = J(), { hasMigrations: S } = Q(g), s = I(), i = n(!1), a = n(!1), H = n(), h = D(), _ = () => {
|
|
22
22
|
if (e.isVersionHistoryOpen) {
|
|
23
|
-
|
|
23
|
+
f();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
u();
|
|
27
27
|
}, C = async () => {
|
|
28
|
-
|
|
28
|
+
i.value = !0, await c(), i.value = !1;
|
|
29
29
|
}, A = () => {
|
|
30
30
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
31
|
-
}, M = x(() => e.isVersionHistoryOpen ?
|
|
31
|
+
}, M = x(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = x(
|
|
32
32
|
() => {
|
|
33
33
|
var t, o;
|
|
34
|
-
return ((o = (t =
|
|
34
|
+
return ((o = (t = l.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
35
35
|
}
|
|
36
|
-
),
|
|
37
|
-
|
|
36
|
+
), V = async (t) => {
|
|
37
|
+
a.value = !0, t || (e.loadingStatus = !0);
|
|
38
38
|
let o;
|
|
39
39
|
try {
|
|
40
|
-
o = await
|
|
40
|
+
o = await p(t);
|
|
41
41
|
} catch (T) {
|
|
42
|
-
|
|
42
|
+
r(T, "Failed to save template");
|
|
43
43
|
} finally {
|
|
44
|
-
|
|
44
|
+
a.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
45
45
|
}
|
|
46
46
|
return o;
|
|
47
47
|
}, E = (t) => {
|
|
@@ -50,23 +50,26 @@ const ft = /* @__PURE__ */ F({
|
|
|
50
50
|
(o = H.value) == null || o.open();
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
return
|
|
54
|
-
},
|
|
55
|
-
if (
|
|
53
|
+
return V(t);
|
|
54
|
+
}, F = async () => {
|
|
55
|
+
if (m("liquidSyntax")) {
|
|
56
56
|
e.loadingStatus = !0;
|
|
57
57
|
try {
|
|
58
|
-
const { html: t } = await
|
|
59
|
-
if (!await
|
|
58
|
+
const { html: t } = await d({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = v(t);
|
|
59
|
+
if (!await y(o))
|
|
60
60
|
return;
|
|
61
|
+
} catch (t) {
|
|
62
|
+
r(t, "Failed to prepare test email");
|
|
63
|
+
return;
|
|
61
64
|
} finally {
|
|
62
65
|
e.loadingStatus = !1;
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
|
-
|
|
68
|
+
h();
|
|
66
69
|
};
|
|
67
70
|
return w({
|
|
68
71
|
handleSave: E
|
|
69
|
-
}), { __sfc: !0, config:
|
|
72
|
+
}), { __sfc: !0, config: l, isFeatureEnabled: m, exportHtml: c, save: p, openVersionHistory: u, closeVersionHistory: f, getCompiledEmail: d, compileHtml: v, validateLiquidSyntax: y, handleError: r, editorStore: e, templateStore: g, hasMigrations: S, trans: s, isExporting: i, isSaving: a, migrationModalRef: H, testEmailClick: h, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: V, handleSave: E, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
|
|
70
73
|
}
|
|
71
74
|
});
|
|
72
75
|
export {
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
let
|
|
2
|
-
const c = () => t > 0,
|
|
3
|
-
const
|
|
4
|
-
|
|
1
|
+
let o = Promise.resolve(), n = 0, e = 0;
|
|
2
|
+
const s = () => n > 0, c = () => (e += 1, e), u = (t) => t > 0 && t === e, i = (t) => {
|
|
3
|
+
const r = o.then(async () => {
|
|
4
|
+
n += 1;
|
|
5
5
|
try {
|
|
6
|
-
return await
|
|
6
|
+
return await t();
|
|
7
7
|
} finally {
|
|
8
|
-
|
|
8
|
+
n -= 1;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
return
|
|
12
|
-
}),
|
|
13
|
-
},
|
|
11
|
+
return o = r.catch(() => {
|
|
12
|
+
}), r;
|
|
13
|
+
}, a = () => ({ runExclusive: i, isEditorBusy: s, beginMount: c, isCurrentMount: u });
|
|
14
14
|
export {
|
|
15
|
-
c as
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
c as beginMount,
|
|
16
|
+
u as isCurrentMount,
|
|
17
|
+
s as isEditorBusy,
|
|
18
|
+
i as runExclusive,
|
|
19
|
+
a as useEditorLock
|
|
18
20
|
};
|
|
@@ -1,49 +1,54 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useEditorLock as
|
|
1
|
+
import { useActionsApi as b } from "./useActionsApi.js";
|
|
2
|
+
import { useEditorLock as v } from "./useEditorLock.js";
|
|
3
3
|
import { useConfigStore as T } from "../stores/config.js";
|
|
4
|
-
import { useEditorStore as
|
|
5
|
-
import { useGuidoEmailEditorStore as
|
|
6
|
-
import { watch as
|
|
7
|
-
const
|
|
8
|
-
const i =
|
|
9
|
-
let o = null,
|
|
10
|
-
const
|
|
4
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
5
|
+
import { useGuidoEmailEditorStore as y } from "../stores/guido-email-editor.js";
|
|
6
|
+
import { watch as a, onUnmounted as B } from "vue";
|
|
7
|
+
const C = 500, L = () => {
|
|
8
|
+
const i = w(), u = y(), l = T(), { getTemplateData: d } = b(), { runExclusive: m, isEditorBusy: p } = v();
|
|
9
|
+
let o = null, s = !1;
|
|
10
|
+
const n = () => {
|
|
11
11
|
o && (clearTimeout(o), o = null);
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
}, c = (t) => {
|
|
13
|
+
n(), o = setTimeout(() => {
|
|
14
|
+
o = null, t();
|
|
15
|
+
}, C);
|
|
16
|
+
}, e = async () => {
|
|
17
|
+
var t, r;
|
|
18
|
+
if (!(s || !i.isStripoInitialized)) {
|
|
19
|
+
if (p()) {
|
|
20
|
+
c(() => void e());
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
15
23
|
try {
|
|
16
|
-
const { html:
|
|
17
|
-
if (
|
|
24
|
+
const { html: E, css: g } = await m(d), I = ((r = (t = l.config) == null ? void 0 : t.identity) == null ? void 0 : r.templateId) ?? "";
|
|
25
|
+
if (s)
|
|
18
26
|
return;
|
|
19
|
-
|
|
20
|
-
html:
|
|
21
|
-
css:
|
|
22
|
-
templateId:
|
|
27
|
+
u.$patch({
|
|
28
|
+
html: E ?? "",
|
|
29
|
+
css: g ?? "",
|
|
30
|
+
templateId: I,
|
|
23
31
|
lastUpdatedAt: Date.now()
|
|
24
32
|
});
|
|
25
33
|
} catch {
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
o = null, n();
|
|
30
|
-
}, B);
|
|
31
|
-
}, f = c(
|
|
35
|
+
}
|
|
36
|
+
}, f = () => c(() => void e()), h = a(
|
|
32
37
|
() => i.isStripoInitialized,
|
|
33
38
|
(t) => {
|
|
34
|
-
t &&
|
|
39
|
+
t && e();
|
|
35
40
|
},
|
|
36
41
|
{ immediate: !0 }
|
|
37
|
-
),
|
|
42
|
+
), S = a(
|
|
38
43
|
() => i.hasChanges,
|
|
39
|
-
(t,
|
|
40
|
-
i.isStripoInitialized && (t ?
|
|
44
|
+
(t, r) => {
|
|
45
|
+
i.isStripoInitialized && (t ? f() : r && (n(), e()));
|
|
41
46
|
}
|
|
42
47
|
);
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
B(() => {
|
|
49
|
+
s = !0, n(), h(), S();
|
|
45
50
|
});
|
|
46
51
|
};
|
|
47
52
|
export {
|
|
48
|
-
|
|
53
|
+
L as useGuidoStateBridge
|
|
49
54
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-c61cc8ea]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-1f2703e5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-1f2703e5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-1f2703e5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export declare const isEditorBusy: () => boolean;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* read/export/save operations ever overlap. A rejected task propagates to its
|
|
5
|
-
* caller but never wedges the queue.
|
|
6
|
-
*/
|
|
2
|
+
export declare const beginMount: () => number;
|
|
3
|
+
export declare const isCurrentMount: (generation: number) => boolean;
|
|
7
4
|
export declare const runExclusive: <T>(task: () => Promise<T>) => Promise<T>;
|
|
8
5
|
export declare const useEditorLock: () => {
|
|
9
6
|
runExclusive: <T>(task: () => Promise<T>) => Promise<T>;
|
|
10
7
|
isEditorBusy: () => boolean;
|
|
8
|
+
beginMount: () => number;
|
|
9
|
+
isCurrentMount: (generation: number) => boolean;
|
|
11
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.17.0-beta.
|
|
3
|
+
"version": "3.17.0-beta.f7536b7",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|