@useinsider/guido 3.21.2-beta.b6f3ef8 → 3.21.2-beta.eea8885
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/README.md +4 -34
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +108 -118
- package/dist/composables/useStripo.js +82 -94
- package/dist/guido.css +1 -1
- package/dist/library.js +10 -12
- package/dist/package.json.js +4 -6
- package/dist/src/library.d.ts +0 -1
- package/dist/utils/pairProductVariables.js +98 -90
- package/package.json +1 -6
- package/dist/composables/useEditorOpenMetrics.js +0 -164
- package/dist/public/prefetchRuntime.js +0 -4
- package/dist/src/composables/useEditorOpenMetrics.d.ts +0 -27
- package/dist/src/public/prefetchRuntime.d.ts +0 -1
- package/dist/src/utils/runtimePrefetch.d.ts +0 -4
- package/dist/src/utils/stripoRuntime.d.ts +0 -2
- package/dist/static/stripo-runtime-manifest.json.js +0 -9
- package/dist/utils/runtimePrefetch.js +0 -26
- package/dist/utils/stripoRuntime.js +0 -9
package/README.md
CHANGED
|
@@ -582,9 +582,9 @@ import '@useinsider/guido/style';
|
|
|
582
582
|
|
|
583
583
|
### Subpath entries
|
|
584
584
|
|
|
585
|
-
|
|
586
|
-
own dependencies, so a consumer that needs the store
|
|
587
|
-
|
|
585
|
+
Two surfaces also ship as their own entry points. Importing one pulls in only its
|
|
586
|
+
own dependencies, so a consumer that needs the store or the tracking-id helpers
|
|
587
|
+
never loads the editor:
|
|
588
588
|
|
|
589
589
|
```typescript
|
|
590
590
|
// Live editor state, published by the editor into the host's shared Pinia instance.
|
|
@@ -595,41 +595,11 @@ import type { GuidoEmailEditorState } from '@useinsider/guido/editor-state';
|
|
|
595
595
|
// Persistent link ids for the click heatmap.
|
|
596
596
|
import { assignTrackingIds, TRACK_ID_ATTRIBUTE } from '@useinsider/guido/tracking-ids';
|
|
597
597
|
import type { TrackingIdResult } from '@useinsider/guido/tracking-ids';
|
|
598
|
-
|
|
599
|
-
// Start downloading the Stripo editor runtime before the editor opens.
|
|
600
|
-
import { prefetchGuidoRuntime } from '@useinsider/guido/prefetch';
|
|
601
598
|
```
|
|
602
599
|
|
|
603
|
-
|
|
600
|
+
Both are re-exported from the root barrel as well; the subpath is what keeps the
|
|
604
601
|
editor out of the consumer's module graph.
|
|
605
602
|
|
|
606
|
-
### Runtime prefetch
|
|
607
|
-
|
|
608
|
-
```typescript
|
|
609
|
-
import { prefetchGuidoRuntime } from '@useinsider/guido/prefetch';
|
|
610
|
-
|
|
611
|
-
prefetchGuidoRuntime(); // e.g. when the user lands on the page that opens the editor
|
|
612
|
-
```
|
|
613
|
-
|
|
614
|
-
Call it as early as the host knows an editor is likely to open. It appends one
|
|
615
|
-
`<link rel="prefetch" data-guido-prefetch>` per file of the pinned Stripo runtime
|
|
616
|
-
(`src/static/stripo-runtime-manifest.json`) from
|
|
617
|
-
`https://email-static.useinsider.com/guido/<stripo version>/`, so the files are in the
|
|
618
|
-
HTTP cache when `<Guido>` mounts. It only downloads: no Stripo code runs and the
|
|
619
|
-
editor's startup order does not change.
|
|
620
|
-
|
|
621
|
-
- Returns `void` and never throws.
|
|
622
|
-
- Idempotent: later calls add nothing.
|
|
623
|
-
- Adds nothing when the runtime is already loading or loaded (`#UiEditorScript` exists
|
|
624
|
-
or `window.UIEditor` is defined), when `navigator.connection.saveData` is on, or when
|
|
625
|
-
`navigator.connection.effectiveType` is `slow-2g` or `2g`.
|
|
626
|
-
- The `guido_editor_open` metric reports it as `runtime_prefetch`: `none` (not called
|
|
627
|
-
before Guido's setup), `pending` (some files still downloading) or `done`.
|
|
628
|
-
|
|
629
|
-
After bumping `guido.stripo.version`, regenerate the file list with
|
|
630
|
-
`npm run stripo:manifest`; a unit test fails while the manifest's version differs from
|
|
631
|
-
the pinned one.
|
|
632
|
-
|
|
633
603
|
---
|
|
634
604
|
|
|
635
605
|
## Constants
|
|
@@ -6,15 +6,15 @@ var t = function() {
|
|
|
6
6
|
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
}, s = [],
|
|
9
|
+
}, s = [], n = /* @__PURE__ */ i(
|
|
10
10
|
o,
|
|
11
11
|
t,
|
|
12
12
|
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"c5146fc5"
|
|
16
16
|
);
|
|
17
|
-
const v =
|
|
17
|
+
const v = n.exports;
|
|
18
18
|
export {
|
|
19
19
|
v as default
|
|
20
20
|
};
|
|
@@ -1,189 +1,179 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import Re from "./organisms/
|
|
21
|
-
import
|
|
22
|
-
import Le from "./organisms/
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
const ht = /* @__PURE__ */ de({
|
|
1
|
+
import { defineComponent as ie, defineAsyncComponent as m, ref as W, computed as p, watch as G, onMounted as ce, onUnmounted as de } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as me } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as le } from "../composables/useEditorLock.js";
|
|
4
|
+
import { provideGuidoActions as ue } from "../composables/useGuidoActions.js";
|
|
5
|
+
import { useGuidoStateBridge as pe } from "../composables/useGuidoStateBridge.js";
|
|
6
|
+
import { usePartner as fe } from "../composables/usePartner.js";
|
|
7
|
+
import { useSaveValidationRollout as ye } from "../composables/useSaveValidationRollout.js";
|
|
8
|
+
import { useStripo as ge } from "../composables/useStripo.js";
|
|
9
|
+
import { useTimerClone as Se } from "../composables/useTimerClone.js";
|
|
10
|
+
import { migrate as V } from "../config/migrator/index.js";
|
|
11
|
+
import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
|
|
12
|
+
import { RIBBON_SELECTOR as ve } from "../enums/onboarding.js";
|
|
13
|
+
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as be } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
14
|
+
import { disposeUnsubscribeListeners as he } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
15
|
+
import Ee from "./organisms/AutoSaveController.vue.js";
|
|
16
|
+
import we from "./organisms/base/AuthErrorModal.vue.js";
|
|
17
|
+
import De from "./organisms/base/Toaster.vue.js";
|
|
18
|
+
import Ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
19
|
+
import ke from "./organisms/header/HeaderWrapper.vue.js";
|
|
20
|
+
import Re from "./organisms/LoadingWrapper.vue.js";
|
|
21
|
+
import Fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
22
|
+
import Le from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
23
|
+
import Me from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
24
|
+
import { useStripoApi as Te } from "../services/stripoApi.js";
|
|
25
|
+
import { useConfigStore as Ie } from "../stores/config.js";
|
|
26
|
+
import { useDynamicContentStore as Ue } from "../stores/dynamic-content.js";
|
|
27
|
+
import { useEditorStore as E } from "../stores/editor.js";
|
|
28
|
+
import { usePreviewStore as Ae } from "../stores/preview.js";
|
|
29
|
+
import { useSaveValidationStore as Be } from "../stores/save-validation.js";
|
|
30
|
+
import { useTemplateStore as Ne } from "../stores/template.js";
|
|
31
|
+
import { useUnsubscribeStore as Pe } from "../stores/unsubscribe.js";
|
|
32
|
+
import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
|
|
33
|
+
const yt = /* @__PURE__ */ ie({
|
|
35
34
|
__name: "Guido",
|
|
36
35
|
props: {
|
|
37
36
|
config: null,
|
|
38
37
|
ready: { type: Boolean, default: !0 }
|
|
39
38
|
},
|
|
40
39
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
41
|
-
setup(
|
|
42
|
-
const s =
|
|
40
|
+
setup(q, { expose: K, emit: r }) {
|
|
41
|
+
const s = q, j = m(
|
|
43
42
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
44
|
-
),
|
|
43
|
+
), J = m(
|
|
45
44
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
46
|
-
),
|
|
45
|
+
), Q = m(
|
|
47
46
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
48
|
-
),
|
|
47
|
+
), X = m(
|
|
49
48
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
50
|
-
),
|
|
49
|
+
), Y = m(
|
|
51
50
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
52
|
-
),
|
|
51
|
+
), w = W(), f = W(), y = Ue(), D = Pe(), o = Ie();
|
|
53
52
|
s.ready && o.init(s.config);
|
|
54
|
-
const
|
|
53
|
+
const c = E(), Z = Ae(), l = p(() => c.hasChanges), { isTestPartner: ee } = fe(), { isEnabled: te, loadRollout: C } = ye(), k = () => {
|
|
55
54
|
var t;
|
|
56
|
-
return (t =
|
|
57
|
-
},
|
|
58
|
-
|
|
55
|
+
return (t = w.value) == null ? void 0 : t.handleSave(!0);
|
|
56
|
+
}, R = (t) => {
|
|
57
|
+
c.loadingStatus = t;
|
|
59
58
|
};
|
|
60
|
-
|
|
61
|
-
const
|
|
59
|
+
me(), pe();
|
|
60
|
+
const g = () => {
|
|
62
61
|
var t, e;
|
|
63
62
|
return {
|
|
64
63
|
emailId: o.templateId,
|
|
65
64
|
userId: o.userId,
|
|
66
65
|
username: o.username,
|
|
67
66
|
partnerName: o.partnerName,
|
|
68
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
69
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
67
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
|
|
68
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
|
|
70
69
|
};
|
|
71
|
-
}, { initPlugin:
|
|
72
|
-
let
|
|
73
|
-
const { getDefaultTemplate:
|
|
70
|
+
}, { initPlugin: F, preloadRuntime: L } = ge(), { runExclusive: M, beginMount: T, isCurrentMount: S } = le();
|
|
71
|
+
let u = 0;
|
|
72
|
+
const { getDefaultTemplate: I } = Te(), { cloneTimersOnSave: U, hasTimerBlocks: A } = Se(), oe = p(() => {
|
|
74
73
|
var t;
|
|
75
74
|
return !((t = o.ui) != null && t.showHeader);
|
|
76
|
-
}),
|
|
77
|
-
() => !!
|
|
75
|
+
}), ne = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = p(
|
|
76
|
+
() => !!z().recommendationConfigs.strategyId
|
|
78
77
|
);
|
|
79
|
-
|
|
78
|
+
ue({
|
|
80
79
|
onBack: () => {
|
|
81
|
-
console.debug("guido:back"),
|
|
80
|
+
console.debug("guido:back"), r("back");
|
|
82
81
|
},
|
|
83
82
|
onSaveStart: () => {
|
|
84
|
-
console.debug("guido:save:start"),
|
|
83
|
+
console.debug("guido:save:start"), r("save:start");
|
|
85
84
|
},
|
|
86
85
|
onSaveComplete: (t) => {
|
|
87
|
-
const e = { ...t, metadata:
|
|
88
|
-
console.debug("guido:save:complete", e),
|
|
86
|
+
const e = { ...t, metadata: g() };
|
|
87
|
+
console.debug("guido:save:complete", e), r("save:complete", e);
|
|
89
88
|
},
|
|
90
89
|
onTestEmailClick: () => {
|
|
91
|
-
console.debug("guido:test-email:click"),
|
|
90
|
+
console.debug("guido:test-email:click"), r("test-email:click");
|
|
92
91
|
}
|
|
93
92
|
});
|
|
94
|
-
const
|
|
95
|
-
console.debug("dynamic-content:close", t),
|
|
96
|
-
},
|
|
93
|
+
const B = (t) => {
|
|
94
|
+
console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
95
|
+
}, N = () => {
|
|
97
96
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
98
97
|
};
|
|
99
|
-
G(() =>
|
|
100
|
-
|
|
98
|
+
G(() => l.value, () => {
|
|
99
|
+
r("on-change", l.value);
|
|
101
100
|
});
|
|
102
|
-
const
|
|
103
|
-
const e = t, { attribute:
|
|
104
|
-
console.debug("dynamic-content:open", e.detail),
|
|
101
|
+
const v = (t) => {
|
|
102
|
+
const e = t, { attribute: a, position: d } = e.detail;
|
|
103
|
+
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, d);
|
|
105
104
|
};
|
|
106
|
-
let
|
|
107
|
-
const
|
|
105
|
+
let i = null;
|
|
106
|
+
const b = () => {
|
|
108
107
|
var e;
|
|
109
|
-
const t = document.querySelector(
|
|
110
|
-
(e =
|
|
111
|
-
},
|
|
108
|
+
const t = document.querySelector(ve);
|
|
109
|
+
(e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
110
|
+
}, h = async () => {
|
|
112
111
|
var t;
|
|
113
|
-
a.mark("host_ready");
|
|
114
112
|
try {
|
|
115
|
-
o.initialized || o.init(s.config),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
variationId: o.variationId
|
|
120
|
-
});
|
|
121
|
-
const e = o.template, i = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", O = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
122
|
-
C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
123
|
-
const ne = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, P = o.isFeatureEnabled("linkTrackingIds"), ae = {
|
|
113
|
+
o.initialized || o.init(s.config), c.templateId = o.templateId;
|
|
114
|
+
const e = o.template, a = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
115
|
+
D.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
116
|
+
const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds"), x = {
|
|
124
117
|
partnerName: o.partnerName,
|
|
125
118
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
126
119
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
127
|
-
}, x = (ce) => a.timed(
|
|
128
|
-
"migration",
|
|
129
|
-
() => Ee(ce, ne, ae)
|
|
130
|
-
);
|
|
131
|
-
let r = {
|
|
132
|
-
html: i && await x(i),
|
|
133
|
-
css: m
|
|
134
120
|
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
121
|
+
let n = {
|
|
122
|
+
html: a && await V(a, _, x),
|
|
123
|
+
css: d
|
|
124
|
+
};
|
|
125
|
+
n.html || (n = await I(), n.html = await V(n.html, _, x));
|
|
126
|
+
const ae = O ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
127
|
+
A(n.html) && (n.html = await U(n.html)), O && (c.trackIdSessionFloor = Math.max(ae, H(n.html)));
|
|
138
128
|
const se = {
|
|
139
|
-
preselectedDynamicContentList:
|
|
129
|
+
preselectedDynamicContentList: P,
|
|
140
130
|
onReady: () => {
|
|
141
|
-
console.debug("guido:ready"),
|
|
131
|
+
console.debug("guido:ready"), r("ready");
|
|
142
132
|
}
|
|
143
133
|
};
|
|
144
|
-
|
|
134
|
+
u = T(), await F(n, g(), se), y.selectedDynamicContentList = P;
|
|
145
135
|
} catch (e) {
|
|
146
|
-
console.error("Failed to initialize Stripo editor:", e)
|
|
136
|
+
console.error("Failed to initialize Stripo editor:", e);
|
|
147
137
|
}
|
|
148
138
|
};
|
|
149
|
-
return
|
|
139
|
+
return ce(async () => {
|
|
150
140
|
var e;
|
|
151
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
152
|
-
const t = (e =
|
|
153
|
-
if (t && (
|
|
154
|
-
await
|
|
141
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), E().$reset(), Ne().$reset(), Be().$reset(), C(), b();
|
|
142
|
+
const t = (e = f.value) == null ? void 0 : e.parentElement;
|
|
143
|
+
if (t && (i = new ResizeObserver(b), i.observe(t)), L(), s.ready)
|
|
144
|
+
await h();
|
|
155
145
|
else {
|
|
156
|
-
const
|
|
157
|
-
|
|
146
|
+
const a = G(() => s.ready, (d) => {
|
|
147
|
+
d && (a(), h());
|
|
158
148
|
});
|
|
159
149
|
}
|
|
160
|
-
document.addEventListener("dynamic-content:open",
|
|
161
|
-
}),
|
|
162
|
-
if (
|
|
150
|
+
document.addEventListener("dynamic-content:open", v);
|
|
151
|
+
}), de(() => {
|
|
152
|
+
if (he(), be(), i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), S(u))
|
|
163
153
|
try {
|
|
164
|
-
|
|
154
|
+
E().isStripoInitialized = !1;
|
|
165
155
|
} catch (t) {
|
|
166
156
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
167
157
|
}
|
|
168
|
-
|
|
169
|
-
if (S(
|
|
158
|
+
M(async () => {
|
|
159
|
+
if (S(u))
|
|
170
160
|
try {
|
|
171
161
|
window.UIEditor.removeEditor();
|
|
172
162
|
} catch {
|
|
173
163
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
174
164
|
}
|
|
175
165
|
}), o.reset();
|
|
176
|
-
}),
|
|
166
|
+
}), K({
|
|
177
167
|
dynamicContent: {
|
|
178
|
-
insert:
|
|
179
|
-
close:
|
|
168
|
+
insert: B,
|
|
169
|
+
close: N
|
|
180
170
|
},
|
|
181
|
-
hasChanges:
|
|
182
|
-
saveSilent:
|
|
183
|
-
setLoading:
|
|
184
|
-
}), { __sfc: !0,
|
|
171
|
+
hasChanges: l,
|
|
172
|
+
saveSilent: k,
|
|
173
|
+
setLoading: R
|
|
174
|
+
}), { __sfc: !0, PreviewContainer: j, OnboardingWrapper: J, AssignStrategyDrawer: Q, RemoveStrategyModal: X, LegacyStrategyUpdatedModal: Y, headerWrapperRef: w, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: D, props: s, configStore: o, editorStore: c, previewStore: Z, hasChanges: l, isTestPartner: ee, isSaveValidationEnabled: te, loadRollout: C, saveSilent: k, setLoading: R, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: L, runExclusive: M, beginMount: T, isCurrentMount: S, mountGeneration: u, getDefaultTemplate: I, cloneTimersOnSave: U, hasTimerBlocks: A, noHeader: oe, isRrsEnabled: ne, hasAssignedStrategy: re, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: b, startEditor: h, AutoSaveController: Ee, AuthErrorModal: we, Toaster: De, FilterSelectionDrawer: Ce, HeaderWrapper: ke, LoadingWrapper: Re, SaveAsTemplateDrawer: Fe, UnsubscribeWrapper: Le, ValidationErrorDrawer: Me };
|
|
185
175
|
}
|
|
186
176
|
});
|
|
187
177
|
export {
|
|
188
|
-
|
|
178
|
+
yt as default
|
|
189
179
|
};
|
|
@@ -1,55 +1,44 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
1
|
+
import { useActionsApi as L } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as O } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as H } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useModuleRepair as j } from "./useModuleRepair.js";
|
|
7
|
+
import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
|
|
8
|
+
import { useStripoNotifications as $ } from "./useStripoNotifications.js";
|
|
9
|
+
import { useToaster as G } from "./useToaster.js";
|
|
10
|
+
import { localePatch as J } from "../config/i18n/index.js";
|
|
11
|
+
import { en as b } from "../config/i18n/en/index.js";
|
|
12
|
+
import { ToasterTypeOptions as X } from "../enums/toaster.js";
|
|
13
|
+
import { useStripoApi as K } from "../services/stripoApi.js";
|
|
14
|
+
import Q from "../static/styles/customEditorStyle.css.js";
|
|
15
|
+
import { useEditorStore as k } from "../stores/editor.js";
|
|
16
|
+
import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
|
|
17
|
+
import Z from "../package.json.js";
|
|
18
|
+
let n = null;
|
|
19
|
+
const he = () => {
|
|
20
|
+
const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = O(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
|
|
21
|
+
var d;
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
23
|
-
|
|
23
|
+
r();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
const i =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, t.onerror = () => {
|
|
37
|
-
t.remove(), a(new Error(`Failed to load Stripo UIEditor script from S3: ${n}`));
|
|
38
|
-
}, document.body.appendChild(t);
|
|
39
|
-
}), d.catch(() => {
|
|
40
|
-
d = null;
|
|
41
|
-
}), d), I = async (s, a, i, n = [], t = !1) => {
|
|
42
|
-
var C, w, k, b;
|
|
43
|
-
const o = M(), { html: c, css: S } = s, { baseBlocks: y, extensions: L } = await V();
|
|
44
|
-
e.mark("blocks_config_ready");
|
|
45
|
-
const E = ((C = u.value) == null ? void 0 : C.displayConditions) ?? !0, O = ((w = u.value) == null ? void 0 : w.modulesDisabled) ?? !1, h = !!c || (((k = m.value) == null ? void 0 : k.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
46
|
-
e.setTemplate({ html: c, css: S, forceRecreate: h }), _().importCss(), e.mark("init_editor"), await window.UIEditor.initEditor(
|
|
26
|
+
const o = Z.guido, i = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
|
|
27
|
+
e.id = "UiEditorScript", e.type = "module", e.src = i, e.onload = () => r(), e.onerror = () => {
|
|
28
|
+
e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${i}`));
|
|
29
|
+
}, document.body.appendChild(e);
|
|
30
|
+
}), n.catch(() => {
|
|
31
|
+
n = null;
|
|
32
|
+
}), n), D = async (r, s, o, a = [], i = !1) => {
|
|
33
|
+
var y, E, h, C;
|
|
34
|
+
const e = k(), { html: d, css: P } = r, { baseBlocks: g, extensions: R } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
35
|
+
w().importCss(), await window.UIEditor.initEditor(
|
|
47
36
|
document.querySelector("#guido-editor"),
|
|
48
37
|
{
|
|
49
|
-
metadata:
|
|
50
|
-
html:
|
|
51
|
-
css:
|
|
52
|
-
forceRecreate:
|
|
38
|
+
metadata: s,
|
|
39
|
+
html: d,
|
|
40
|
+
css: P,
|
|
41
|
+
forceRecreate: I,
|
|
53
42
|
locale: "en",
|
|
54
43
|
undoButtonSelector: "#guido__undo-button",
|
|
55
44
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -59,12 +48,12 @@ const be = () => {
|
|
|
59
48
|
customAppearanceMergetags: !p("liquidSyntax"),
|
|
60
49
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
61
50
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
62
|
-
customViewStyles:
|
|
63
|
-
conditionsEnabled:
|
|
64
|
-
customConditionsEnabled:
|
|
51
|
+
customViewStyles: Q,
|
|
52
|
+
conditionsEnabled: S,
|
|
53
|
+
customConditionsEnabled: S,
|
|
65
54
|
enableXSSSecurity: !0,
|
|
66
|
-
modulesDisabled:
|
|
67
|
-
syncModulesEnabled:
|
|
55
|
+
modulesDisabled: U,
|
|
56
|
+
syncModulesEnabled: i,
|
|
68
57
|
messageSettingsEnabled: !0,
|
|
69
58
|
displayGmailAnnotations: !0,
|
|
70
59
|
displayHiddenPreheader: !1,
|
|
@@ -75,55 +64,54 @@ const be = () => {
|
|
|
75
64
|
selectElementAfterDrop: !0,
|
|
76
65
|
sameFontSizeForOutlook: !0,
|
|
77
66
|
allowedScriptSourceDomains: q,
|
|
78
|
-
...
|
|
67
|
+
...g ? { baseBlocks: g } : {},
|
|
79
68
|
editorFonts: {
|
|
80
69
|
showDefaultStandardFonts: !0,
|
|
81
70
|
showDefaultNotStandardFonts: !0,
|
|
82
|
-
customFonts:
|
|
71
|
+
customFonts: a
|
|
83
72
|
},
|
|
84
73
|
mergeTags: [
|
|
85
74
|
{
|
|
86
|
-
entries:
|
|
87
|
-
|
|
88
|
-
|
|
75
|
+
entries: W(
|
|
76
|
+
o.preselectedDynamicContentList,
|
|
77
|
+
Y((C = u.value) == null ? void 0 : C.dynamicContentList),
|
|
89
78
|
p("liquidSyntax")
|
|
90
79
|
)
|
|
91
80
|
}
|
|
92
81
|
],
|
|
93
|
-
async onTokenRefreshRequest(
|
|
82
|
+
async onTokenRefreshRequest(t) {
|
|
94
83
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
e.mark("token_end"), r(l);
|
|
84
|
+
const l = await B();
|
|
85
|
+
t(l);
|
|
98
86
|
} catch (l) {
|
|
99
|
-
|
|
87
|
+
m(l, "Failed to refresh token");
|
|
100
88
|
}
|
|
101
89
|
},
|
|
102
90
|
onTemplateLoaded() {
|
|
103
91
|
try {
|
|
104
|
-
const { activateCustomViewStyles:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}, 1e3)
|
|
108
|
-
} catch (
|
|
109
|
-
|
|
92
|
+
const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = L(), { injectFullStory: x } = N();
|
|
93
|
+
w().importCss(), t(), x(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
94
|
+
e.hasChanges = !1;
|
|
95
|
+
}, 1e3);
|
|
96
|
+
} catch (t) {
|
|
97
|
+
m(t, "Failed to load custom interface appearance");
|
|
110
98
|
}
|
|
111
99
|
},
|
|
112
|
-
onCodeEditorVisibilityChanged(
|
|
113
|
-
|
|
100
|
+
onCodeEditorVisibilityChanged(t) {
|
|
101
|
+
e.isCodeEditorOpen = t;
|
|
114
102
|
},
|
|
115
|
-
onEditorVisualModeChanged(
|
|
116
|
-
|
|
103
|
+
onEditorVisualModeChanged(t) {
|
|
104
|
+
e.editorVisualMode = t.toLowerCase();
|
|
117
105
|
},
|
|
118
|
-
onVersionHistoryVisibilityChanged(
|
|
119
|
-
|
|
106
|
+
onVersionHistoryVisibilityChanged(t) {
|
|
107
|
+
e.isVersionHistoryOpen = t;
|
|
120
108
|
},
|
|
121
109
|
onDataChanged() {
|
|
122
|
-
|
|
110
|
+
e.hasChanges = !0, e.changeSeq += 1;
|
|
123
111
|
},
|
|
124
|
-
onEvent:
|
|
125
|
-
onModuleAdd:
|
|
126
|
-
notifications:
|
|
112
|
+
onEvent: F,
|
|
113
|
+
onModuleAdd: A,
|
|
114
|
+
notifications: _(),
|
|
127
115
|
// Stripo deselects the block on any click outside the canvas, so every surface
|
|
128
116
|
// that belongs to the block's own flow has to be listed here (SD-153273).
|
|
129
117
|
ignoreClickOutsideSelectors: [
|
|
@@ -133,35 +121,35 @@ const be = () => {
|
|
|
133
121
|
".in-modal-v2-wrapper",
|
|
134
122
|
".in-toasts-wrapper"
|
|
135
123
|
],
|
|
136
|
-
extensions:
|
|
137
|
-
localePatch:
|
|
124
|
+
extensions: R,
|
|
125
|
+
localePatch: J
|
|
138
126
|
}
|
|
139
127
|
);
|
|
140
128
|
};
|
|
141
|
-
return { initPlugin: async (
|
|
142
|
-
const
|
|
129
|
+
return { initPlugin: async (r, s, o) => {
|
|
130
|
+
const a = k();
|
|
143
131
|
try {
|
|
144
|
-
|
|
145
|
-
const [
|
|
146
|
-
|
|
147
|
-
|
|
132
|
+
await f();
|
|
133
|
+
const [i, e] = await Promise.all([
|
|
134
|
+
M(),
|
|
135
|
+
T()
|
|
148
136
|
]);
|
|
149
|
-
|
|
137
|
+
a.syncModulesEnabled = e, await D(r, s, o, i, e);
|
|
150
138
|
} catch {
|
|
151
|
-
|
|
152
|
-
type:
|
|
153
|
-
message:
|
|
139
|
+
a.loadingStatus = !1, v({
|
|
140
|
+
type: X.Error,
|
|
141
|
+
message: b["An error has occurred. Please report the error code to support."],
|
|
154
142
|
actionButton: {
|
|
155
|
-
text:
|
|
143
|
+
text: b["Reload page"],
|
|
156
144
|
onClick: () => window.location.reload()
|
|
157
145
|
}
|
|
158
|
-
})
|
|
146
|
+
});
|
|
159
147
|
}
|
|
160
148
|
}, preloadRuntime: () => {
|
|
161
|
-
|
|
149
|
+
f().catch(() => {
|
|
162
150
|
});
|
|
163
151
|
} };
|
|
164
152
|
};
|
|
165
153
|
export {
|
|
166
|
-
|
|
154
|
+
he as useStripo
|
|
167
155
|
};
|