@useinsider/guido 3.30.1-beta.34bc10d → 3.30.1-beta.49c2d00
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 +14 -0
- package/dist/@types/config/schemas.js +4 -4
- package/dist/@types/email-be/html-validation.js +1 -1
- package/dist/components/Guido.vue.js +9 -9
- package/dist/components/Guido.vue2.js +156 -130
- package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.js +22 -0
- package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue2.js +30 -0
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +2 -2
- package/dist/composables/useInvalidDynamicContentMarking.js +105 -0
- package/dist/enums/defaults.js +5 -4
- package/dist/enums/email-be.js +9 -20
- package/dist/extensions/DynamicContent/dynamic-content.js +39 -57
- package/dist/guido.css +1 -1
- package/dist/node_modules/valibot/dist/index.js +90 -95
- package/dist/package.json.js +1 -1
- package/dist/services/emailBe/errors/ApiError.js +26 -27
- package/dist/services/templateLibraryApi.js +87 -59
- package/dist/src/@types/generic.d.ts +11 -0
- package/dist/src/@types/save-as-template.d.ts +23 -1
- package/dist/src/components/Guido.vue.d.ts +5 -1
- package/dist/src/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.d.ts +22 -0
- package/dist/src/composables/useInvalidDynamicContentMarking.d.ts +4 -0
- package/dist/src/enums/email-be.d.ts +0 -11
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +0 -8
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/dynamic-content.d.ts +42 -1
- package/dist/src/utils/editorCanvas.d.ts +3 -0
- package/dist/static/styles/customEditorStyle.css.js +4 -0
- package/dist/stores/dynamic-content.js +19 -7
- package/dist/utils/editorCanvas.js +18 -0
- package/package.json +1 -1
- package/dist/@types/email-be/templates.js +0 -15
- package/dist/services/emailBe/templates/TemplateService.js +0 -149
- package/dist/services/emailBe/templates/index.js +0 -6
- package/dist/src/@types/email-be/templates.d.ts +0 -40
- package/dist/src/services/emailBe/templates/TemplateService.d.ts +0 -13
- package/dist/src/services/emailBe/templates/index.d.ts +0 -2
package/README.md
CHANGED
|
@@ -235,6 +235,7 @@ one-way. While `ready` is `false` every `features` toggle reads as disabled.
|
|
|
235
235
|
|-------|---------|-------------|
|
|
236
236
|
| `ready` | - | Editor is loaded and ready |
|
|
237
237
|
| `dynamic-content:open` | `DynamicContent \| null` | User wants to insert dynamic content |
|
|
238
|
+
| `dynamic-content:invalid-action` | `{ value: string }` | User clicked the link on an invalid chip's hover card; `value` is the chip's token |
|
|
238
239
|
| `back` | - | Back button clicked |
|
|
239
240
|
| `save:start` | - | Save process started |
|
|
240
241
|
| `save:complete` | `SavedTemplateDetails` | Save completed successfully (includes `metadata`) |
|
|
@@ -297,6 +298,18 @@ guidoRef.value?.dynamicContent.insert({
|
|
|
297
298
|
// Close dynamic content modal
|
|
298
299
|
guidoRef.value?.dynamicContent.close();
|
|
299
300
|
|
|
301
|
+
// Mark chips as invalid (red, with a hover card). Each call replaces the list;
|
|
302
|
+
// an empty list clears every mark. `value` is the token, without braces.
|
|
303
|
+
guidoRef.value?.dynamicContent.setInvalid([
|
|
304
|
+
{
|
|
305
|
+
value: 'zc_profile.i12.city',
|
|
306
|
+
title: 'Dynamic Content Unavailable',
|
|
307
|
+
description: 'Segment name',
|
|
308
|
+
actionLabel: 'Update Segment',
|
|
309
|
+
actionAvailable: true,
|
|
310
|
+
},
|
|
311
|
+
] satisfies InvalidDynamicContent[]);
|
|
312
|
+
|
|
300
313
|
// Silent save (no UI feedback)
|
|
301
314
|
guidoRef.value?.saveSilent();
|
|
302
315
|
|
|
@@ -575,6 +588,7 @@ import type {
|
|
|
575
588
|
DynamicContent,
|
|
576
589
|
DynamicContentList,
|
|
577
590
|
DynamicContentNode,
|
|
591
|
+
InvalidDynamicContent,
|
|
578
592
|
DefaultBlockType,
|
|
579
593
|
CustomBlockType,
|
|
580
594
|
} from '@useinsider/guido';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
|
|
2
|
-
import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as k, boolean as a, array as n, transform as S, unknown as i,
|
|
2
|
+
import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as k, boolean as a, array as n, transform as S, unknown as i, record as g, fallback as R, literal as u, lazy as T, looseObject as C, variant as I, union as h } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const b = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -76,7 +76,7 @@ const b = {
|
|
|
76
76
|
value: t()
|
|
77
77
|
})
|
|
78
78
|
)
|
|
79
|
-
}), f =
|
|
79
|
+
}), f = T(() => C({
|
|
80
80
|
text: e(t()),
|
|
81
81
|
// eslint-disable-next-line camelcase -- backend field name
|
|
82
82
|
tag_text: e(t()),
|
|
@@ -86,7 +86,7 @@ const b = {
|
|
|
86
86
|
select_items: e(n(f))
|
|
87
87
|
})), P = g(
|
|
88
88
|
t(),
|
|
89
|
-
|
|
89
|
+
R(n(f), [])
|
|
90
90
|
), v = C({
|
|
91
91
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
92
92
|
id: e(c()),
|
|
@@ -324,7 +324,7 @@ const b = {
|
|
|
324
324
|
(s) => typeof s == "function",
|
|
325
325
|
"processor must be a function"
|
|
326
326
|
)
|
|
327
|
-
}), V =
|
|
327
|
+
}), V = I("type", [
|
|
328
328
|
H,
|
|
329
329
|
_,
|
|
330
330
|
q,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pipe as o, check as i, object as r, array as l, boolean as s, string as e, fallback as m,
|
|
1
|
+
import { pipe as o, check as i, object as r, array as l, boolean as s, string as e, fallback as m, union as t, nullable as d, record as h, number as a, transform as u, tuple as p } from "../../node_modules/valibot/dist/index.js";
|
|
2
2
|
const b = r({
|
|
3
3
|
code: e(),
|
|
4
4
|
trans: r({
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper), r(e.AutoSaveController, { ref: "autoSaveControllerRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) :
|
|
4
|
+
var o = function() {
|
|
5
|
+
var n = this, r = n._self._c, e = n._self._setupProxy;
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper), r(e.AutoSaveController, { ref: "autoSaveControllerRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : n._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) : n._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : n._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : n._e(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : n._e(), e.moduleDynamicContentStore.queue.length > 0 ? r(e.AmbiguousDynamicContentModal) : n._e(), e.hoveredInvalidDynamicContent && e.hoveredInvalidEntry ? r(e.InvalidDynamicContentCard, { attrs: { entry: e.hoveredInvalidEntry, position: e.hoveredInvalidDynamicContent.position }, on: { "dynamic-content:invalid-action": e.handleInvalidDynamicContentAction, mouseenter: e.cancelInvalidCardHide, mouseleave: e.scheduleInvalidCardHide } }) : n._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : n._e(), e.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : n._e(), e.isTestPartner() ? n._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(l) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
}, t = [],
|
|
9
|
+
}, t = [], d = /* @__PURE__ */ i(
|
|
10
|
+
a,
|
|
10
11
|
o,
|
|
11
|
-
n,
|
|
12
12
|
t,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"a12504dd"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const p = d.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
p as default
|
|
20
20
|
};
|
|
@@ -1,215 +1,241 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { startEditorOpenMetrics as
|
|
5
|
-
import { provideGuidoActions as
|
|
6
|
-
import { useGuidoStateBridge as
|
|
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
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
|
|
1
|
+
import { defineComponent as Re, defineAsyncComponent as s, ref as w, computed as d, watch as F, onMounted as Ae, onUnmounted as Oe } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as Ue } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as _e } from "../composables/useEditorLock.js";
|
|
4
|
+
import { startEditorOpenMetrics as He } from "../composables/useEditorOpenMetrics.js";
|
|
5
|
+
import { provideGuidoActions as Ne } from "../composables/useGuidoActions.js";
|
|
6
|
+
import { useGuidoStateBridge as Pe } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { useInvalidDynamicContentMarking as xe } from "../composables/useInvalidDynamicContentMarking.js";
|
|
8
|
+
import { usePartner as Be } from "../composables/usePartner.js";
|
|
9
|
+
import { useSaveValidationRollout as Ve } from "../composables/useSaveValidationRollout.js";
|
|
10
|
+
import { useStripo as We } from "../composables/useStripo.js";
|
|
11
|
+
import { useTimerClone as $e } from "../composables/useTimerClone.js";
|
|
12
|
+
import { useToaster as Ge } from "../composables/useToaster.js";
|
|
13
|
+
import { useTranslations as ze } from "../composables/useTranslations.js";
|
|
14
|
+
import { migrate as qe } from "../config/migrator/index.js";
|
|
15
|
+
import { ModuleFolderDefaults as ee } from "../enums/defaults.js";
|
|
16
|
+
import { RIBBON_SELECTOR as Ke } from "../enums/onboarding.js";
|
|
17
|
+
import { ToasterTypeOptions as Ye } from "../enums/toaster.js";
|
|
18
|
+
import { useRecommendationExtensionStore as te, disposeStrategyPageReturnListeners as je } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
19
|
+
import { disposeUnsubscribeListeners as Je } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
20
|
+
import { disposeDisplayConditionRequest as Qe } from "../extensions/DisplayConditions/bridge.js";
|
|
21
|
+
import Xe from "./organisms/AutoSaveController.vue.js";
|
|
22
|
+
import Ze from "./organisms/base/AuthErrorModal.vue.js";
|
|
23
|
+
import et from "./organisms/base/Toaster.vue.js";
|
|
24
|
+
import tt from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
25
|
+
import ot from "./organisms/header/HeaderWrapper.vue.js";
|
|
26
|
+
import nt from "./organisms/LoadingWrapper.vue.js";
|
|
27
|
+
import it from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
28
|
+
import rt from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
29
|
+
import at from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
30
|
+
import { useStripoApi as st } from "../services/stripoApi.js";
|
|
31
|
+
import { useConfigStore as ct } from "../stores/config.js";
|
|
32
|
+
import { useDynamicContentStore as dt } from "../stores/dynamic-content.js";
|
|
33
|
+
import { useEditorStore as M } from "../stores/editor.js";
|
|
34
|
+
import { useModuleDynamicContentStore as oe } from "../stores/module-dynamic-content.js";
|
|
35
|
+
import { useOnboardingStore as lt } from "../stores/onboarding.js";
|
|
36
|
+
import { usePreviewStore as mt } from "../stores/preview.js";
|
|
37
|
+
import { useSaveValidationStore as ut } from "../stores/save-validation.js";
|
|
38
|
+
import { useTemplateStore as pt } from "../stores/template.js";
|
|
39
|
+
import { useUnsubscribeStore as vt } from "../stores/unsubscribe.js";
|
|
40
|
+
import { readTrackFloor as ne } from "../utils/linkTrackingIds.js";
|
|
41
|
+
const to = /* @__PURE__ */ Re({
|
|
41
42
|
__name: "Guido",
|
|
42
43
|
props: {
|
|
43
44
|
config: null,
|
|
44
45
|
ready: { type: Boolean, default: !0 }
|
|
45
46
|
},
|
|
46
|
-
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
47
|
-
setup(
|
|
48
|
-
const
|
|
47
|
+
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click", "dynamic-content:invalid-action"],
|
|
48
|
+
setup(ie, { expose: re, emit: r }) {
|
|
49
|
+
const l = ie, a = He(), ae = s(
|
|
49
50
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
50
|
-
),
|
|
51
|
+
), se = s(
|
|
51
52
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
52
|
-
),
|
|
53
|
+
), ce = s(
|
|
53
54
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
54
|
-
),
|
|
55
|
+
), de = s(
|
|
55
56
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
56
|
-
),
|
|
57
|
+
), le = s(
|
|
57
58
|
() => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
|
|
58
|
-
),
|
|
59
|
+
), R = w(), me = s(
|
|
59
60
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
60
|
-
),
|
|
61
|
+
), ue = s(
|
|
61
62
|
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
62
|
-
),
|
|
63
|
+
), pe = s(
|
|
63
64
|
() => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
|
|
64
|
-
),
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
), ve = s(
|
|
66
|
+
() => import("./organisms/dynamic-content/InvalidDynamicContentCard.vue.js")
|
|
67
|
+
), A = 200, h = w(), m = dt(), O = vt(), ye = oe(), o = ct();
|
|
68
|
+
l.ready && o.init(l.config);
|
|
69
|
+
const u = M(), fe = mt(), g = d(() => u.hasChanges), { isTestPartner: ge } = Be(), { isEnabled: be, loadRollout: U } = Ve(), { showToaster: _ } = Ge(), H = ze(), N = () => {
|
|
67
70
|
var t;
|
|
68
|
-
if (
|
|
69
|
-
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }),
|
|
70
|
-
type:
|
|
71
|
-
message:
|
|
71
|
+
if (u.isVersionHistoryOpen) {
|
|
72
|
+
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), _({
|
|
73
|
+
type: Ye.Warning,
|
|
74
|
+
message: H("email-editor.save-blocked-outside-editor")
|
|
72
75
|
});
|
|
73
76
|
return;
|
|
74
77
|
}
|
|
75
|
-
return (t =
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
+
return (t = R.value) == null ? void 0 : t.saveSilent();
|
|
79
|
+
}, P = (t) => {
|
|
80
|
+
u.loadingStatus = t;
|
|
78
81
|
};
|
|
79
|
-
|
|
80
|
-
const
|
|
82
|
+
Ue(), Pe();
|
|
83
|
+
const x = xe(), C = () => {
|
|
81
84
|
var t, e;
|
|
82
85
|
return {
|
|
83
86
|
emailId: o.templateId,
|
|
84
87
|
userId: o.userId,
|
|
85
88
|
username: o.username,
|
|
86
89
|
partnerName: o.partnerName,
|
|
87
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
88
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
90
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || ee.SAVED_MODULES,
|
|
91
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || ee.DEFAULT_MODULES
|
|
89
92
|
};
|
|
90
|
-
}, { initPlugin:
|
|
91
|
-
let
|
|
92
|
-
const { getDefaultTemplate:
|
|
93
|
+
}, { initPlugin: B, preloadRuntime: V } = We(a), { runExclusive: W, beginMount: $, isCurrentMount: E } = _e();
|
|
94
|
+
let b = 0;
|
|
95
|
+
const { getDefaultTemplate: G } = st(), { cloneTimersOnSave: z, hasTimerBlocks: q } = $e(), Se = d(() => {
|
|
93
96
|
var t;
|
|
94
97
|
return !((t = o.ui) != null && t.showHeader);
|
|
95
|
-
}),
|
|
98
|
+
}), he = d(() => o.isFeatureEnabled("reusableRecommendationStrategy")), Ce = d(() => o.externalDisplayConditions), Ee = d(
|
|
96
99
|
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
97
|
-
),
|
|
98
|
-
() => !!
|
|
100
|
+
), De = d(
|
|
101
|
+
() => !!te().recommendationConfigs.strategyId
|
|
99
102
|
);
|
|
100
|
-
|
|
103
|
+
Ne({
|
|
101
104
|
onBack: () => {
|
|
102
|
-
console.debug("guido:back"),
|
|
105
|
+
console.debug("guido:back"), r("back");
|
|
103
106
|
},
|
|
104
107
|
onSaveStart: () => {
|
|
105
|
-
console.debug("guido:save:start"),
|
|
108
|
+
console.debug("guido:save:start"), r("save:start");
|
|
106
109
|
},
|
|
107
110
|
onSaveComplete: (t) => {
|
|
108
|
-
const e = { ...t, metadata:
|
|
109
|
-
console.debug("guido:save:complete", e),
|
|
111
|
+
const e = { ...t, metadata: C() };
|
|
112
|
+
console.debug("guido:save:complete", e), r("save:complete", e);
|
|
110
113
|
},
|
|
111
114
|
onTestEmailClick: () => {
|
|
112
|
-
console.debug("guido:test-email:click"),
|
|
115
|
+
console.debug("guido:test-email:click"), r("test-email:click");
|
|
113
116
|
}
|
|
114
117
|
});
|
|
115
|
-
const
|
|
116
|
-
console.debug("dynamic-content:close", t),
|
|
117
|
-
},
|
|
118
|
+
const K = (t) => {
|
|
119
|
+
console.debug("dynamic-content:close", t), m.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
120
|
+
}, Y = () => {
|
|
118
121
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
122
|
+
}, j = (t) => {
|
|
123
|
+
m.setInvalidDynamicContent(t);
|
|
124
|
+
}, c = w(null), J = d(() => c.value ? m.getInvalidDynamicContent(c.value.value) : void 0);
|
|
125
|
+
let p = null;
|
|
126
|
+
const y = () => {
|
|
127
|
+
p && (clearTimeout(p), p = null);
|
|
128
|
+
}, D = () => {
|
|
129
|
+
y(), p = setTimeout(() => {
|
|
130
|
+
p = null, c.value = null;
|
|
131
|
+
}, A);
|
|
132
|
+
}, I = (t) => {
|
|
133
|
+
var n;
|
|
134
|
+
const { detail: e } = t;
|
|
135
|
+
typeof ((n = e == null ? void 0 : e.entry) == null ? void 0 : n.value) != "string" || !e.position || (y(), c.value = { value: e.entry.value, position: e.position });
|
|
136
|
+
}, S = () => {
|
|
137
|
+
y(), c.value = null;
|
|
138
|
+
};
|
|
139
|
+
F(J, (t) => {
|
|
140
|
+
!t && c.value && S();
|
|
141
|
+
});
|
|
142
|
+
const Ie = (t) => {
|
|
143
|
+
console.debug("dynamic-content:invalid-action", t), S(), r("dynamic-content:invalid-action", { value: t.value });
|
|
119
144
|
};
|
|
120
|
-
|
|
121
|
-
|
|
145
|
+
F(() => g.value, () => {
|
|
146
|
+
r("on-change", g.value);
|
|
122
147
|
});
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
148
|
+
const T = (t) => {
|
|
149
|
+
S();
|
|
150
|
+
const e = t, { attribute: n, position: f } = e.detail;
|
|
151
|
+
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", n, f);
|
|
126
152
|
};
|
|
127
|
-
let
|
|
128
|
-
const
|
|
153
|
+
let v = null;
|
|
154
|
+
const k = () => {
|
|
129
155
|
var e;
|
|
130
|
-
const t = document.querySelector(
|
|
131
|
-
(e =
|
|
132
|
-
},
|
|
156
|
+
const t = document.querySelector(Ke);
|
|
157
|
+
(e = h.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
158
|
+
}, L = async () => {
|
|
133
159
|
var t;
|
|
134
|
-
|
|
160
|
+
a.mark("host_ready");
|
|
135
161
|
try {
|
|
136
|
-
o.initialized || o.init(
|
|
162
|
+
o.initialized || o.init(l.config), u.templateId = o.templateId, a.setContext({
|
|
137
163
|
partnerName: o.partnerName,
|
|
138
164
|
productType: o.productType,
|
|
139
165
|
templateId: o.templateId,
|
|
140
166
|
variationId: o.variationId
|
|
141
167
|
});
|
|
142
|
-
const e = o.template,
|
|
143
|
-
|
|
144
|
-
const
|
|
168
|
+
const e = o.template, n = (e == null ? void 0 : e.html) || "", f = (e == null ? void 0 : e.css) || "", Q = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
169
|
+
O.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
170
|
+
const Te = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, X = o.isFeatureEnabled("linkTrackingIds"), ke = {
|
|
145
171
|
partnerName: o.partnerName,
|
|
146
172
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
147
173
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
148
|
-
},
|
|
174
|
+
}, Le = {
|
|
149
175
|
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
150
|
-
},
|
|
176
|
+
}, Z = (Me) => a.timed(
|
|
151
177
|
"migration",
|
|
152
|
-
() =>
|
|
178
|
+
() => qe(Me, Te, ke, Le)
|
|
153
179
|
);
|
|
154
|
-
let
|
|
155
|
-
html:
|
|
156
|
-
css:
|
|
180
|
+
let i = {
|
|
181
|
+
html: n && await Z(n),
|
|
182
|
+
css: f
|
|
157
183
|
};
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
preselectedDynamicContentList:
|
|
184
|
+
i.html || (i = await a.timed("default_template", () => G()), i.html = await Z(i.html));
|
|
185
|
+
const we = X ? ne(i.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
186
|
+
q(i.html) && (i.html = await a.timed("timer_clone", () => z(i.html))), X && (u.trackIdSessionFloor = Math.max(we, ne(i.html)));
|
|
187
|
+
const Fe = {
|
|
188
|
+
preselectedDynamicContentList: Q,
|
|
163
189
|
onReady: () => {
|
|
164
|
-
console.debug("guido:ready"),
|
|
190
|
+
console.debug("guido:ready"), r("ready");
|
|
165
191
|
}
|
|
166
192
|
};
|
|
167
|
-
|
|
193
|
+
b = $(), await B(i, C(), Fe, i.html !== n), m.selectedDynamicContentList = Q;
|
|
168
194
|
} catch (e) {
|
|
169
|
-
console.error("Failed to initialize Stripo editor:", e),
|
|
195
|
+
console.error("Failed to initialize Stripo editor:", e), a.markFailed();
|
|
170
196
|
}
|
|
171
197
|
};
|
|
172
|
-
return
|
|
198
|
+
return Ae(async () => {
|
|
173
199
|
var e;
|
|
174
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
175
|
-
const t = (e =
|
|
176
|
-
if (t && (
|
|
177
|
-
await
|
|
200
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), M().$reset(), pt().$reset(), ut().$reset(), oe().$reset(), m.setInvalidDynamicContent([]), lt().resetOnboarding("recommendationLegacyStrategyOnboarding"), U(), k();
|
|
201
|
+
const t = (e = h.value) == null ? void 0 : e.parentElement;
|
|
202
|
+
if (t && (v = new ResizeObserver(k), v.observe(t)), V(), document.addEventListener("dynamic-content:open", T), document.addEventListener("dynamic-content:invalid-hover", I), document.addEventListener("dynamic-content:invalid-leave", D), l.ready)
|
|
203
|
+
await L();
|
|
178
204
|
else {
|
|
179
|
-
const
|
|
180
|
-
|
|
205
|
+
const n = F(() => l.ready, (f) => {
|
|
206
|
+
f && (n(), L());
|
|
181
207
|
});
|
|
182
208
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
xe();
|
|
209
|
+
}), Oe(() => {
|
|
210
|
+
if (Je(), je(), a.dispose(), x.dispose(), v == null || v.disconnect(), document.removeEventListener("dynamic-content:open", T), document.removeEventListener("dynamic-content:invalid-hover", I), document.removeEventListener("dynamic-content:invalid-leave", D), y(), E(b)) {
|
|
211
|
+
Qe();
|
|
187
212
|
try {
|
|
188
|
-
const t =
|
|
213
|
+
const t = M();
|
|
189
214
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
190
215
|
} catch (t) {
|
|
191
216
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
192
217
|
}
|
|
193
218
|
}
|
|
194
|
-
|
|
195
|
-
if (
|
|
219
|
+
W(async () => {
|
|
220
|
+
if (E(b))
|
|
196
221
|
try {
|
|
197
222
|
window.UIEditor.removeEditor();
|
|
198
223
|
} catch {
|
|
199
224
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
200
225
|
}
|
|
201
226
|
}), o.reset();
|
|
202
|
-
}),
|
|
227
|
+
}), re({
|
|
203
228
|
dynamicContent: {
|
|
204
|
-
insert:
|
|
205
|
-
close:
|
|
229
|
+
insert: K,
|
|
230
|
+
close: Y,
|
|
231
|
+
setInvalid: j
|
|
206
232
|
},
|
|
207
|
-
hasChanges:
|
|
208
|
-
saveSilent:
|
|
209
|
-
setLoading:
|
|
210
|
-
}), { __sfc: !0, openMetrics:
|
|
233
|
+
hasChanges: g,
|
|
234
|
+
saveSilent: N,
|
|
235
|
+
setLoading: P
|
|
236
|
+
}), { __sfc: !0, openMetrics: a, PreviewContainer: ae, OnboardingWrapper: se, AssignStrategyDrawer: ce, RemoveStrategyModal: de, DisplayConditionsHost: le, autoSaveControllerRef: R, LegacyStrategyUpdatedModal: me, LegacyUnsubscribeConvertedModal: ue, AmbiguousDynamicContentModal: pe, InvalidDynamicContentCard: ve, INVALID_CARD_HIDE_DELAY: A, wrapperRef: h, dynamicContentStore: m, unsubscribeStore: O, moduleDynamicContentStore: ye, props: l, configStore: o, editorStore: u, previewStore: fe, hasChanges: g, isTestPartner: ge, isSaveValidationEnabled: be, loadRollout: U, showToaster: _, trans: H, saveSilent: N, setLoading: P, emit: r, invalidDynamicContentMarking: x, buildMetadata: C, initPlugin: B, preloadRuntime: V, runExclusive: W, beginMount: $, isCurrentMount: E, mountGeneration: b, getDefaultTemplate: G, cloneTimersOnSave: z, hasTimerBlocks: q, noHeader: Se, isRrsEnabled: he, isExternalDisplayConditionsEnabled: Ce, isLegacyUnsubscribeConversionEnabled: Ee, hasAssignedStrategy: De, insertDynamicContent: K, closeDynamicContent: Y, setInvalidDynamicContent: j, hoveredInvalidDynamicContent: c, hoveredInvalidEntry: J, invalidCardHideTimer: p, cancelInvalidCardHide: y, scheduleInvalidCardHide: D, handleInvalidDynamicContentHover: I, hideInvalidCard: S, handleInvalidDynamicContentAction: Ie, handleDynamicContentOpen: T, ribbonObserver: v, updateRibbonOffset: k, startEditor: L, AutoSaveController: Xe, AuthErrorModal: Ze, Toaster: et, FilterSelectionDrawer: tt, HeaderWrapper: ot, LoadingWrapper: nt, SaveAsTemplateDrawer: it, UnsubscribeWrapper: rt, ValidationErrorDrawer: at };
|
|
211
237
|
}
|
|
212
238
|
});
|
|
213
239
|
export {
|
|
214
|
-
|
|
240
|
+
to as default
|
|
215
241
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import a from "./InvalidDynamicContentCard.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import c from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
|
+
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
6
|
+
return n("div", { ref: "cardRef", staticClass: "invalid-dynamic-content-card", style: e.cardStyle, attrs: { id: "guido__invalid-dynamic-content-card", "aria-labelledby": "guido__invalid-dynamic-content-card-title", role: "dialog" }, on: { mouseenter: function(i) {
|
|
7
|
+
return e.emit("mouseenter");
|
|
8
|
+
}, mouseleave: function(i) {
|
|
9
|
+
return e.emit("mouseleave");
|
|
10
|
+
} } }, [n("p", { staticClass: "invalid-dynamic-content-card__title", attrs: { id: "guido__invalid-dynamic-content-card-title" } }, [t._v(" " + t._s(t.entry.title) + " ")]), n("p", { staticClass: "invalid-dynamic-content-card__description" }, [t._v(" " + t._s(t.entry.description) + " ")]), t.entry.actionAvailable && t.entry.actionLabel ? n("button", { staticClass: "invalid-dynamic-content-card__action", attrs: { id: "guido__invalid-dynamic-content-card-action", type: "button" }, on: { click: e.onAction } }, [t._v(" " + t._s(t.entry.actionLabel) + " ")]) : t._e()]);
|
|
11
|
+
}, o = [], d = /* @__PURE__ */ c(
|
|
12
|
+
a,
|
|
13
|
+
r,
|
|
14
|
+
o,
|
|
15
|
+
!1,
|
|
16
|
+
null,
|
|
17
|
+
"749d0533"
|
|
18
|
+
);
|
|
19
|
+
const v = d.exports;
|
|
20
|
+
export {
|
|
21
|
+
v as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent as y, ref as u, onMounted as _, watch as x, nextTick as C, computed as R } from "vue";
|
|
2
|
+
const I = /* @__PURE__ */ y({
|
|
3
|
+
__name: "InvalidDynamicContentCard",
|
|
4
|
+
props: {
|
|
5
|
+
entry: null,
|
|
6
|
+
position: null
|
|
7
|
+
},
|
|
8
|
+
emits: ["dynamic-content:invalid-action", "mouseenter", "mouseleave"],
|
|
9
|
+
setup(m, { emit: s }) {
|
|
10
|
+
const t = m, i = 4, o = 8, r = u(), c = u({ width: 0, height: 0 }), a = () => {
|
|
11
|
+
var e;
|
|
12
|
+
const n = (e = r.value) == null ? void 0 : e.getBoundingClientRect();
|
|
13
|
+
n && (c.value = { width: n.width, height: n.height });
|
|
14
|
+
};
|
|
15
|
+
_(a), x(() => [t.entry, t.position], () => C(a));
|
|
16
|
+
const p = R(() => {
|
|
17
|
+
const { x: n, y: e, height: f = 0 } = t.position, { width: v, height: d } = c.value, h = e + f + i, l = e - i - d, w = h + d > window.innerHeight - o, g = window.innerWidth - v - o;
|
|
18
|
+
return {
|
|
19
|
+
top: `${w && l >= o ? l : h}px`,
|
|
20
|
+
left: `${Math.max(0, Math.min(n, g))}px`
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
return { __sfc: !0, CARD_OFFSET: i, VIEWPORT_MARGIN: o, props: t, emit: s, cardRef: r, cardSize: c, measureCard: a, cardStyle: p, onAction: () => {
|
|
24
|
+
s("dynamic-content:invalid-action", { value: t.entry.value });
|
|
25
|
+
} };
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
I as default
|
|
30
|
+
};
|
|
@@ -4,8 +4,8 @@ var r = function() {
|
|
|
4
4
|
var a = this, e = a._self._c, t = a._self._setupProxy;
|
|
5
5
|
return e(t.WpDrawer, { attrs: { id: "save-as-template-modal", "description-status": "", "description-text": t.trans("newsletter.save-template-description"), "footer-button-group-options": t.footerButtonGroupOptions, status: t.editorStore.isSaveAsTemplateDrawerOpen, "title-text": t.trans("products.save-template") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.saveTemplate } }, [e(t.InBasicTextInput, { staticClass: "mb-5 w-1", attrs: { id: "guido__template-name-input", name: "templateName", "character-counter-status": !1, "disabled-status": t.isSaving, "label-text": t.trans("products.template-name"), "max-character-length": 1e3, "placeholder-text": t.trans("newsletter.enter-template-name"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, "state-message": t.templateNameError, states: t.templateNameError ? "error" : "default", "tooltip-status": !1, value: t.saveAsTemplateStore.templateName }, on: { input: t.handleTemplateName } }), e(t.InMultiSelect, { staticClass: "template-category-dropdown mb-5 w-1", attrs: { id: "guido__template-category-dropdown", "create-option-status": "", "search-status": "", "button-status": !1, "character-limit-validation-text": t.trans("validation-v2.duration-value", {
|
|
6
6
|
min: 1,
|
|
7
|
-
max:
|
|
8
|
-
}), "create-button-label": t.trans("products.create-new-category"), "disabled-status": t.isSaving, "label-text": t.trans("products.template-category"), "loading-state": t.isAddingOption, "max-character-limit":
|
|
7
|
+
max: 25
|
|
8
|
+
}), "create-button-label": t.trans("products.create-new-category"), "disabled-status": t.isSaving, "label-text": t.trans("products.template-category"), "loading-state": t.isAddingOption, "max-character-limit": 25, "max-height": 350, options: t.saveAsTemplateStore.categories, "placeholder-text": t.trans("products.select-template-category"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, value: t.saveAsTemplateStore.selectedCategories }, on: { addOption: t.handleAddOption, change: t.handleCategoryChange, resetAllOptions: t.handleResetAllOptions, selectAllOptions: t.handleSelectAllOptions } })], 1);
|
|
9
9
|
}, l = [], n = /* @__PURE__ */ o(
|
|
10
10
|
s,
|
|
11
11
|
r,
|