@useinsider/guido 3.30.1-beta.33af8e3 → 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/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/composables/useInvalidDynamicContentMarking.js +105 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +39 -57
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/@types/generic.d.ts +11 -0
- 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/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/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,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
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useDynamicContentStore as f } from "../stores/dynamic-content.js";
|
|
2
|
+
import { useEditorStore as T } from "../stores/editor.js";
|
|
3
|
+
import { getEditorCanvasFrame as g, getCanvasElementPosition as S } from "../utils/editorCanvas.js";
|
|
4
|
+
import { watch as A } from "vue";
|
|
5
|
+
const C = "merge-tag-selector", E = "merge-tag-value", u = "guido-invalid-dynamic-content-style", v = ["", " "], h = (t) => v.flatMap((n) => v.map((e) => ({
|
|
6
|
+
exact: `{{${n}${t}${e}}}`,
|
|
7
|
+
prefix: `{{${n}${t}${e}|`
|
|
8
|
+
}))), D = (t, n) => h(n).some(({ exact: e, prefix: o }) => t === e || t.startsWith(o)), p = (t) => t.replace(/["\\|]/g, "\\$&").replace(/[\n\r\f]/g, (n) => `\\${n.charCodeAt(0).toString(16)} `), _ = (t) => {
|
|
9
|
+
const n = t.flatMap((e) => h(e).flatMap(({ exact: o, prefix: r }) => [`="${p(o)}"`, `^="${p(r)}"`]).map((o) => `${C}[${E}${o}]`).flatMap((o) => [`${o} .esd-merge-tag`, `${o} .esd-x`]));
|
|
10
|
+
return n.length === 0 ? "" : `${n.join(`,
|
|
11
|
+
`)} {
|
|
12
|
+
color: var(--guido-dc-invalid-color) !important;
|
|
13
|
+
border-color: var(--guido-dc-invalid-color) !important;
|
|
14
|
+
}`;
|
|
15
|
+
}, y = (t, n) => {
|
|
16
|
+
const e = t.getAttribute(E) ?? "";
|
|
17
|
+
return n.find((o) => D(e, o.value));
|
|
18
|
+
}, w = (t) => typeof (t == null ? void 0 : t.nodeType) == "number", x = (t) => {
|
|
19
|
+
const n = t;
|
|
20
|
+
return typeof (n == null ? void 0 : n.closest) == "function" ? n.closest(C) : null;
|
|
21
|
+
}, $ = () => {
|
|
22
|
+
var t, n;
|
|
23
|
+
return ((n = (t = g()) == null ? void 0 : t.contentWindow) == null ? void 0 : n.document) ?? null;
|
|
24
|
+
}, L = (t, n) => {
|
|
25
|
+
var a;
|
|
26
|
+
const e = _(n), o = t.getElementById(u);
|
|
27
|
+
if (!e) {
|
|
28
|
+
o == null || o.remove();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (o) {
|
|
32
|
+
o.textContent !== e && (o.textContent = e);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const r = t.createElement("style");
|
|
36
|
+
r.id = u, r.textContent = e, (a = t.head ?? t.body) == null || a.appendChild(r);
|
|
37
|
+
}, P = () => {
|
|
38
|
+
const t = $();
|
|
39
|
+
if (t)
|
|
40
|
+
try {
|
|
41
|
+
const n = f().invalidDynamicContentList.map((e) => e.value);
|
|
42
|
+
L(t, n);
|
|
43
|
+
} catch (n) {
|
|
44
|
+
console.error("Failed to apply the invalid dynamic content marking", n);
|
|
45
|
+
}
|
|
46
|
+
}, k = () => {
|
|
47
|
+
const t = f(), n = T();
|
|
48
|
+
let e = null, o = null;
|
|
49
|
+
const r = () => {
|
|
50
|
+
o && (o = null, document.dispatchEvent(new CustomEvent("dynamic-content:invalid-leave")));
|
|
51
|
+
}, a = (i) => {
|
|
52
|
+
const s = x(i.target);
|
|
53
|
+
if (!s || s === o)
|
|
54
|
+
return;
|
|
55
|
+
const l = y(s, t.invalidDynamicContentList), m = g();
|
|
56
|
+
if (!l || !m)
|
|
57
|
+
return;
|
|
58
|
+
o = s;
|
|
59
|
+
const M = {
|
|
60
|
+
entry: { ...l },
|
|
61
|
+
position: S(m, s)
|
|
62
|
+
};
|
|
63
|
+
document.dispatchEvent(new CustomEvent("dynamic-content:invalid-hover", { detail: M }));
|
|
64
|
+
}, d = (i) => {
|
|
65
|
+
!o || w(i.relatedTarget) && o.contains(i.relatedTarget) || r();
|
|
66
|
+
}, c = () => {
|
|
67
|
+
e == null || e.removeEventListener("mouseover", a), e == null || e.removeEventListener("mouseout", d), e == null || e.removeEventListener("scroll", r, !0), e = null, r();
|
|
68
|
+
}, I = () => {
|
|
69
|
+
if (!n.isStripoInitialized) {
|
|
70
|
+
c();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const i = $(), s = t.invalidDynamicContentList.map((l) => l.value);
|
|
74
|
+
if (!i) {
|
|
75
|
+
c();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (L(i, s), s.length === 0) {
|
|
79
|
+
c();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
i !== e && (c(), i.addEventListener("mouseover", a), i.addEventListener("mouseout", d), i.addEventListener("scroll", r, !0), e = i), o && (!o.isConnected || !y(o, t.invalidDynamicContentList)) && r();
|
|
83
|
+
};
|
|
84
|
+
return A(
|
|
85
|
+
[
|
|
86
|
+
() => n.isStripoInitialized,
|
|
87
|
+
() => n.changeSeq,
|
|
88
|
+
() => n.isCodeEditorOpen,
|
|
89
|
+
() => n.isVersionHistoryOpen,
|
|
90
|
+
() => n.isPreviewModeOpen,
|
|
91
|
+
() => t.invalidDynamicContentList
|
|
92
|
+
],
|
|
93
|
+
() => {
|
|
94
|
+
try {
|
|
95
|
+
I();
|
|
96
|
+
} catch (i) {
|
|
97
|
+
console.error("Failed to track invalid dynamic content", i);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
), { dispose: c };
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
P as applyInvalidDynamicContentMarking,
|
|
104
|
+
k as useInvalidDynamicContentMarking
|
|
105
|
+
};
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var g = (
|
|
3
|
-
var
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var g = (r, n, t) => n in r ? m(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
|
|
3
|
+
var o = (r, n, t) => g(r, typeof n != "symbol" ? n + "" : n, t);
|
|
4
4
|
import { useConfig as d } from "../../composables/useConfig.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
import { applyInvalidDynamicContentMarking as u } from "../../composables/useInvalidDynamicContentMarking.js";
|
|
6
|
+
import { getEditorCanvasFrame as l, getCanvasElementPosition as h } from "../../utils/editorCanvas.js";
|
|
7
|
+
import { mergeTagToDynamicContent as T, dynamicContentToMergeTags as C } from "../../utils/genericUtil.js";
|
|
8
|
+
import { UIElement as y, UIElementType as a, UEAttr as L, UIElementTagRegistry as k } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
9
|
+
import { ExternalMergeTagsLibrary as p } from "./dynamic-content-modal.js";
|
|
10
|
+
const c = "external-dynamic-content-ui-element", E = "button-add-dynamic-content";
|
|
11
|
+
class U extends k {
|
|
12
|
+
registerUiElements(n) {
|
|
13
|
+
n[a.MERGETAGS] = c;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
|
-
class
|
|
16
|
+
class v extends y {
|
|
16
17
|
constructor() {
|
|
17
18
|
super(...arguments);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
o(this, "mergeTagsButton", null);
|
|
20
|
+
o(this, "mergeTagsLibrary", null);
|
|
21
|
+
o(this, "clickListener", null);
|
|
22
|
+
o(this, "lastClickedElement", null);
|
|
23
|
+
o(this, "lastClickedFrame", null);
|
|
24
|
+
o(this, "mousedownListener", null);
|
|
24
25
|
}
|
|
25
26
|
getId() {
|
|
26
|
-
return
|
|
27
|
+
return c;
|
|
27
28
|
}
|
|
28
29
|
onRender(t) {
|
|
29
30
|
var e;
|
|
@@ -45,8 +46,8 @@ class x extends T {
|
|
|
45
46
|
onAttributeUpdated(t, e) {
|
|
46
47
|
if (t !== "mergeTag" || !(e != null && e.value))
|
|
47
48
|
return;
|
|
48
|
-
const
|
|
49
|
-
this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(
|
|
49
|
+
const i = T(e), s = this._getLastClickedPosition();
|
|
50
|
+
this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(i, s);
|
|
50
51
|
}
|
|
51
52
|
openMergeTagLibrary() {
|
|
52
53
|
const t = this._getButtonPosition(), e = { value: "", text: "" };
|
|
@@ -57,14 +58,15 @@ class x extends T {
|
|
|
57
58
|
* Dispatches event with dynamic content data and position
|
|
58
59
|
*/
|
|
59
60
|
_openDynamicContentLibrary(t, e) {
|
|
60
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
61
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new p()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
61
62
|
t,
|
|
62
|
-
(
|
|
63
|
-
if (
|
|
64
|
-
const { isFeatureEnabled:
|
|
65
|
-
this.api.triggerValueChange(
|
|
63
|
+
(i) => {
|
|
64
|
+
if (i.text && i.value) {
|
|
65
|
+
const { isFeatureEnabled: s } = d();
|
|
66
|
+
this.api.triggerValueChange(C([i], s("liquidSyntax"))[0]);
|
|
66
67
|
} else
|
|
67
68
|
this.api.triggerValueChange(null);
|
|
69
|
+
u();
|
|
68
70
|
},
|
|
69
71
|
e
|
|
70
72
|
);
|
|
@@ -76,8 +78,8 @@ class x extends T {
|
|
|
76
78
|
_getButtonPosition() {
|
|
77
79
|
if (!this.mergeTagsButton)
|
|
78
80
|
return { x: 0, y: 0, width: 0, height: 0 };
|
|
79
|
-
const { x: t, y: e, width:
|
|
80
|
-
return { x: t, y: e, width:
|
|
81
|
+
const { x: t, y: e, width: i, height: s } = this.mergeTagsButton.getBoundingClientRect();
|
|
82
|
+
return { x: t, y: e, width: i, height: s };
|
|
81
83
|
}
|
|
82
84
|
/**
|
|
83
85
|
* Sets up coordinate tracking for merge tag clicks in the iframe
|
|
@@ -85,20 +87,12 @@ class x extends T {
|
|
|
85
87
|
*/
|
|
86
88
|
_setupCoordinateTracking() {
|
|
87
89
|
var e;
|
|
88
|
-
const t =
|
|
89
|
-
(e = t == null ? void 0 : t.contentWindow) != null && e.document && (this.mousedownListener = (
|
|
90
|
-
const
|
|
91
|
-
|
|
90
|
+
const t = l();
|
|
91
|
+
(e = t == null ? void 0 : t.contentWindow) != null && e.document && (this.mousedownListener = (i) => {
|
|
92
|
+
const s = this._findMergeTagElement(i.target);
|
|
93
|
+
s && (this.lastClickedElement = s, this.lastClickedFrame = t);
|
|
92
94
|
}, t.contentWindow.document.addEventListener("mousedown", this.mousedownListener));
|
|
93
95
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Gets the editor iframe element
|
|
96
|
-
*/
|
|
97
|
-
_getEditorFrame() {
|
|
98
|
-
var e, n;
|
|
99
|
-
const t = (e = m()) == null ? void 0 : e.querySelector("iframe");
|
|
100
|
-
return (n = t == null ? void 0 : t.contentWindow) != null && n.document ? t : null;
|
|
101
|
-
}
|
|
102
96
|
/**
|
|
103
97
|
* Finds merge tag element in the element tree
|
|
104
98
|
*/
|
|
@@ -111,19 +105,7 @@ class x extends T {
|
|
|
111
105
|
*/
|
|
112
106
|
_getLastClickedPosition() {
|
|
113
107
|
if (!(!this.lastClickedElement || !this.lastClickedFrame))
|
|
114
|
-
return
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Calculates absolute position of element relative to page
|
|
118
|
-
*/
|
|
119
|
-
_calculateAbsolutePosition(t, e) {
|
|
120
|
-
const n = t.getBoundingClientRect(), i = e.getBoundingClientRect();
|
|
121
|
-
return {
|
|
122
|
-
x: n.x + i.x,
|
|
123
|
-
y: n.y + i.y,
|
|
124
|
-
width: i.width,
|
|
125
|
-
height: i.height
|
|
126
|
-
};
|
|
108
|
+
return h(this.lastClickedFrame, this.lastClickedElement);
|
|
127
109
|
}
|
|
128
110
|
/**
|
|
129
111
|
* Cleans up the coordinate tracking event listener
|
|
@@ -132,7 +114,7 @@ class x extends T {
|
|
|
132
114
|
var e;
|
|
133
115
|
if (!this.mousedownListener)
|
|
134
116
|
return;
|
|
135
|
-
const t =
|
|
117
|
+
const t = l();
|
|
136
118
|
(e = t == null ? void 0 : t.contentWindow) != null && e.document && t.contentWindow.document.removeEventListener("mousedown", this.mousedownListener), this.mousedownListener = null;
|
|
137
119
|
}
|
|
138
120
|
/**
|
|
@@ -145,7 +127,7 @@ class x extends T {
|
|
|
145
127
|
<${a.BUTTON}
|
|
146
128
|
id="guido__btn-add-dynamic-content"
|
|
147
129
|
class="btn btn-primary"
|
|
148
|
-
${
|
|
130
|
+
${L.BUTTON.name}="${E}">
|
|
149
131
|
<${a.ICON} src="plus" class="icon icon-button color-primary">
|
|
150
132
|
</${a.ICON}>
|
|
151
133
|
${this.api.translate("Add Dynamic Content")}
|
|
@@ -154,6 +136,6 @@ class x extends T {
|
|
|
154
136
|
}
|
|
155
137
|
}
|
|
156
138
|
export {
|
|
157
|
-
|
|
158
|
-
|
|
139
|
+
U as DynamicContentTagRegistry,
|
|
140
|
+
v as DynamicContentUiElementExtension
|
|
159
141
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-c8351f74]{gap:16px}.validation-error-row[data-v-c8351f74]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-c8351f74]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-c8351f74]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-c8351f74]{gap:16px}.validation-error-row[data-v-c8351f74]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-c8351f74]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-c8351f74]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-a12504dd]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-a12504dd]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-a12504dd]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{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-f5ff6219]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-f5ff6219]{min-height:504px}.iframe-wrapper[data-v-a7102458]{width:258px}.iframe-scaled[data-v-a7102458]{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}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[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}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}.invalid-dynamic-content-card[data-v-749d0533]{position:fixed;z-index:1000;max-width:280px;padding:12px 16px;border:1px solid #dc2a2a;border-radius:4px;background-color:#fff;box-shadow:0 2px 8px #00000029}.invalid-dynamic-content-card__title[data-v-749d0533]{margin:0 0 4px;font-weight:600;color:#dc2a2a}.invalid-dynamic-content-card__description[data-v-749d0533]{margin:0;color:#4a4a4a}.invalid-dynamic-content-card__action[data-v-749d0533]{margin-top:8px;padding:0;border:none;background:none;color:#0a2ecc;cursor:pointer}.invalid-dynamic-content-card__action[data-v-749d0533]:hover{text-decoration:underline}
|
package/dist/package.json.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const o = "3.30.1-beta.
|
|
1
|
+
const o = "3.30.1-beta.49c2d00", s = { stripo: { version: "2.87.0" } }, t = {
|
|
2
2
|
version: o,
|
|
3
3
|
guido: s
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
t as default,
|
|
7
7
|
s as guido,
|
|
8
8
|
o as version
|
|
9
9
|
};
|
|
@@ -13,6 +13,13 @@ export type BaseDynamicContent = {
|
|
|
13
13
|
export type DynamicContent = BaseDynamicContent & {
|
|
14
14
|
text: string;
|
|
15
15
|
};
|
|
16
|
+
export type InvalidDynamicContent = {
|
|
17
|
+
value: string;
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
actionLabel: string;
|
|
21
|
+
actionAvailable: boolean;
|
|
22
|
+
};
|
|
16
23
|
/**
|
|
17
24
|
* A node in the partner-keyed dynamic-content tree (backend categorized-fields
|
|
18
25
|
* shape). Category nodes carry `children`/`select_items`; leaf nodes are the
|
|
@@ -54,6 +61,10 @@ export type DynamicContentEvent = {
|
|
|
54
61
|
attribute: DynamicContent;
|
|
55
62
|
position?: PositionData;
|
|
56
63
|
};
|
|
64
|
+
export type InvalidDynamicContentHoverEvent = {
|
|
65
|
+
entry: InvalidDynamicContent;
|
|
66
|
+
position: PositionData;
|
|
67
|
+
};
|
|
57
68
|
export type MergeTagClickEvent = {
|
|
58
69
|
position: PositionData;
|
|
59
70
|
element: HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicContent, GuidoConfigInput } from '@@/Types/config';
|
|
2
|
-
import type { PositionData } from '@@/Types/generic';
|
|
2
|
+
import type { InvalidDynamicContent, PositionData } from '@@/Types/generic';
|
|
3
3
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
/** Guido configuration object */
|
|
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
13
13
|
dynamicContent: {
|
|
14
14
|
insert: (data: DynamicContent) => void;
|
|
15
15
|
close: () => void;
|
|
16
|
+
setInvalid: (list: InvalidDynamicContent[]) => void;
|
|
16
17
|
};
|
|
17
18
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
18
19
|
saveSilent: () => Promise<{
|
|
@@ -50,6 +51,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
50
51
|
ready: () => void;
|
|
51
52
|
"onboarding:finished": () => void;
|
|
52
53
|
"test-email:click": () => void;
|
|
54
|
+
"dynamic-content:invalid-action": (detail: {
|
|
55
|
+
value: string;
|
|
56
|
+
}) => void;
|
|
53
57
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
54
58
|
ready: boolean;
|
|
55
59
|
}>>>, {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { InvalidDynamicContent, PositionData } from '@@/Types/generic';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
entry: InvalidDynamicContent;
|
|
4
|
+
position: PositionData;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
7
|
+
"dynamic-content:invalid-action": (detail: {
|
|
8
|
+
value: string;
|
|
9
|
+
}) => void;
|
|
10
|
+
mouseenter: () => void;
|
|
11
|
+
mouseleave: () => void;
|
|
12
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
15
|
+
type __VLS_TypePropsToOption<T> = {
|
|
16
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
17
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
18
|
+
} : {
|
|
19
|
+
type: import('vue').PropType<T[K]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -37,10 +37,6 @@ export declare class DynamicContentUiElementExtension extends UIElement {
|
|
|
37
37
|
* Workaround from Stripo intercepting click events - tracks mousedown events instead
|
|
38
38
|
*/
|
|
39
39
|
private _setupCoordinateTracking;
|
|
40
|
-
/**
|
|
41
|
-
* Gets the editor iframe element
|
|
42
|
-
*/
|
|
43
|
-
private _getEditorFrame;
|
|
44
40
|
/**
|
|
45
41
|
* Finds merge tag element in the element tree
|
|
46
42
|
*/
|
|
@@ -50,10 +46,6 @@ export declare class DynamicContentUiElementExtension extends UIElement {
|
|
|
50
46
|
* This ensures we always use the correct element's position even with rapid clicks
|
|
51
47
|
*/
|
|
52
48
|
private _getLastClickedPosition;
|
|
53
|
-
/**
|
|
54
|
-
* Calculates absolute position of element relative to page
|
|
55
|
-
*/
|
|
56
|
-
private _calculateAbsolutePosition;
|
|
57
49
|
/**
|
|
58
50
|
* Cleans up the coordinate tracking event listener
|
|
59
51
|
*/
|
package/dist/src/library.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export { useGuidoEmailEditorStore } from './public/editorState';
|
|
|
6
6
|
export type { GuidoEmailEditorState } from './public/editorState';
|
|
7
7
|
export { prefetchGuidoRuntime } from './public/prefetchRuntime';
|
|
8
8
|
export type { StripoEventType } from './@types/events';
|
|
9
|
-
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
9
|
+
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, InvalidDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { DynamicContent } from '@@/Types/generic';
|
|
1
|
+
import type { DynamicContent, InvalidDynamicContent } from '@@/Types/generic';
|
|
2
2
|
export declare const useDynamicContentStore: import("pinia").StoreDefinition<"guidoDynamicContent", {
|
|
3
3
|
selectedDynamicContent: DynamicContent;
|
|
4
4
|
selectedDynamicContentList: DynamicContent[];
|
|
5
|
+
invalidDynamicContentList: InvalidDynamicContent[];
|
|
5
6
|
}, {
|
|
6
7
|
getSelectedDynamicContentList: (state: {
|
|
7
8
|
selectedDynamicContent: {
|
|
@@ -22,9 +23,17 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
|
|
|
22
23
|
} | undefined;
|
|
23
24
|
text: string;
|
|
24
25
|
}[];
|
|
26
|
+
invalidDynamicContentList: {
|
|
27
|
+
value: string;
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
actionLabel: string;
|
|
31
|
+
actionAvailable: boolean;
|
|
32
|
+
}[];
|
|
25
33
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
26
34
|
selectedDynamicContent: DynamicContent;
|
|
27
35
|
selectedDynamicContentList: DynamicContent[];
|
|
36
|
+
invalidDynamicContentList: InvalidDynamicContent[];
|
|
28
37
|
}>) => {
|
|
29
38
|
text: string;
|
|
30
39
|
value: string;
|
|
@@ -34,6 +43,37 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
|
|
|
34
43
|
value: string;
|
|
35
44
|
} | undefined;
|
|
36
45
|
}[];
|
|
46
|
+
getInvalidDynamicContent: (state: {
|
|
47
|
+
selectedDynamicContent: {
|
|
48
|
+
value: string;
|
|
49
|
+
fallback?: string | undefined;
|
|
50
|
+
format?: {
|
|
51
|
+
key: string;
|
|
52
|
+
value: string;
|
|
53
|
+
} | undefined;
|
|
54
|
+
text: string;
|
|
55
|
+
};
|
|
56
|
+
selectedDynamicContentList: {
|
|
57
|
+
value: string;
|
|
58
|
+
fallback?: string | undefined;
|
|
59
|
+
format?: {
|
|
60
|
+
key: string;
|
|
61
|
+
value: string;
|
|
62
|
+
} | undefined;
|
|
63
|
+
text: string;
|
|
64
|
+
}[];
|
|
65
|
+
invalidDynamicContentList: {
|
|
66
|
+
value: string;
|
|
67
|
+
title: string;
|
|
68
|
+
description: string;
|
|
69
|
+
actionLabel: string;
|
|
70
|
+
actionAvailable: boolean;
|
|
71
|
+
}[];
|
|
72
|
+
} & import("pinia").PiniaCustomStateProperties<{
|
|
73
|
+
selectedDynamicContent: DynamicContent;
|
|
74
|
+
selectedDynamicContentList: DynamicContent[];
|
|
75
|
+
invalidDynamicContentList: InvalidDynamicContent[];
|
|
76
|
+
}>) => (value: string) => InvalidDynamicContent | undefined;
|
|
37
77
|
}, {
|
|
38
78
|
setSelectedDynamicContent(dynamicContent: DynamicContent): void;
|
|
39
79
|
/**
|
|
@@ -44,4 +84,5 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
|
|
|
44
84
|
* reactivity can't write a later mutation back into the host's catalog.
|
|
45
85
|
*/
|
|
46
86
|
registerDynamicContent(items: DynamicContent[]): void;
|
|
87
|
+
setInvalidDynamicContent(list: unknown): void;
|
|
47
88
|
}>;
|
|
@@ -9,6 +9,10 @@ const n = `.esd-x,
|
|
|
9
9
|
border-radius: 4px !important;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
merge-tag-selector {
|
|
13
|
+
--guido-dc-invalid-color: #dc2a2a;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
.ue-preview-control-wrapper ue-icon-component:not([disabled=true]):not(.stripo-static-icon):hover {
|
|
13
17
|
background: none;
|
|
14
18
|
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { removeDuplicatesFromArray as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { removeDuplicatesFromArray as i } from "../utils/arrayUtil.js";
|
|
2
|
+
import { isPlainObject as o } from "../utils/genericUtil.js";
|
|
3
|
+
import { defineStore as l } from "pinia";
|
|
4
|
+
const n = (t) => typeof t == "string" ? t : "", c = (t) => !o(t) || typeof t.value != "string" || t.value === "" ? null : {
|
|
5
|
+
value: t.value,
|
|
6
|
+
title: n(t.title),
|
|
7
|
+
description: n(t.description),
|
|
8
|
+
actionLabel: n(t.actionLabel),
|
|
9
|
+
actionAvailable: t.actionAvailable === !0
|
|
10
|
+
}, m = l("guidoDynamicContent", {
|
|
4
11
|
state: () => ({
|
|
5
12
|
selectedDynamicContent: { text: "", value: "" },
|
|
6
|
-
selectedDynamicContentList: []
|
|
13
|
+
selectedDynamicContentList: [],
|
|
14
|
+
invalidDynamicContentList: []
|
|
7
15
|
}),
|
|
8
16
|
actions: {
|
|
9
17
|
setSelectedDynamicContent(t) {
|
|
@@ -18,17 +26,21 @@ const c = a("guidoDynamicContent", {
|
|
|
18
26
|
*/
|
|
19
27
|
registerDynamicContent(t) {
|
|
20
28
|
this.selectedDynamicContentList.push(...t.map((e) => ({ ...e })));
|
|
29
|
+
},
|
|
30
|
+
setInvalidDynamicContent(t) {
|
|
31
|
+
this.invalidDynamicContentList = Array.isArray(t) ? t.map(c).filter((e) => e !== null) : [];
|
|
21
32
|
}
|
|
22
33
|
},
|
|
23
34
|
getters: {
|
|
24
|
-
getSelectedDynamicContentList: (t) =>
|
|
35
|
+
getSelectedDynamicContentList: (t) => i(t.selectedDynamicContentList).map((e) => ({
|
|
25
36
|
text: e.text,
|
|
26
37
|
value: e.value,
|
|
27
38
|
fallback: e.fallback,
|
|
28
39
|
format: e.format
|
|
29
|
-
}))
|
|
40
|
+
})),
|
|
41
|
+
getInvalidDynamicContent: (t) => (e) => t.invalidDynamicContentList.find((a) => a.value === e)
|
|
30
42
|
}
|
|
31
43
|
});
|
|
32
44
|
export {
|
|
33
|
-
|
|
45
|
+
m as useDynamicContentStore
|
|
34
46
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { findEditorShadowRoot as i } from "./editorShadowRoot.js";
|
|
2
|
+
const c = () => {
|
|
3
|
+
var e, n;
|
|
4
|
+
const t = (e = i()) == null ? void 0 : e.querySelector("iframe");
|
|
5
|
+
return (n = t == null ? void 0 : t.contentWindow) != null && n.document ? t : null;
|
|
6
|
+
}, d = (t, e) => {
|
|
7
|
+
const n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
|
|
8
|
+
return {
|
|
9
|
+
x: n.x + o.x,
|
|
10
|
+
y: n.y + o.y,
|
|
11
|
+
width: o.width,
|
|
12
|
+
height: o.height
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
d as getCanvasElementPosition,
|
|
17
|
+
c as getEditorCanvasFrame
|
|
18
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.30.1-beta.
|
|
3
|
+
"version": "3.30.1-beta.49c2d00",
|
|
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",
|