@useinsider/guido 3.30.0-beta.b86be87 → 3.30.0-beta.c515f18
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 +0 -14
- package/dist/components/Guido.vue.js +9 -9
- package/dist/components/Guido.vue2.js +118 -137
- package/dist/extensions/DynamicContent/dynamic-content.js +26 -28
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/@types/generic.d.ts +0 -11
- package/dist/src/components/Guido.vue.d.ts +1 -5
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/dynamic-content.d.ts +1 -42
- package/dist/static/styles/customEditorStyle.css.js +0 -4
- package/dist/stores/dynamic-content.js +7 -19
- package/package.json +1 -1
- package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.js +0 -22
- package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue2.js +0 -21
- package/dist/composables/useInvalidDynamicContentMarking.js +0 -113
- package/dist/src/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.d.ts +0 -22
- package/dist/src/composables/useInvalidDynamicContentMarking.d.ts +0 -4
package/README.md
CHANGED
|
@@ -235,7 +235,6 @@ 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 |
|
|
239
238
|
| `back` | - | Back button clicked |
|
|
240
239
|
| `save:start` | - | Save process started |
|
|
241
240
|
| `save:complete` | `SavedTemplateDetails` | Save completed successfully (includes `metadata`) |
|
|
@@ -298,18 +297,6 @@ guidoRef.value?.dynamicContent.insert({
|
|
|
298
297
|
// Close dynamic content modal
|
|
299
298
|
guidoRef.value?.dynamicContent.close();
|
|
300
299
|
|
|
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
|
-
|
|
313
300
|
// Silent save (no UI feedback)
|
|
314
301
|
guidoRef.value?.saveSilent();
|
|
315
302
|
|
|
@@ -588,7 +575,6 @@ import type {
|
|
|
588
575
|
DynamicContent,
|
|
589
576
|
DynamicContentList,
|
|
590
577
|
DynamicContentNode,
|
|
591
|
-
InvalidDynamicContent,
|
|
592
578
|
DefaultBlockType,
|
|
593
579
|
CustomBlockType,
|
|
594
580
|
} from '@useinsider/guido';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o 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 n = function() {
|
|
5
|
+
var a = this, r = a._self._c, e = a._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) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), e.moduleDynamicContentStore.queue.length > 0 ? r(e.AmbiguousDynamicContentModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : a._e(), e.isTestPartner() ? a._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 = [],
|
|
10
|
-
a,
|
|
9
|
+
}, t = [], s = /* @__PURE__ */ i(
|
|
11
10
|
o,
|
|
11
|
+
n,
|
|
12
12
|
t,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"0c5f11a1"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const u = s.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
u as default
|
|
20
20
|
};
|
|
@@ -1,106 +1,103 @@
|
|
|
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
|
-
|
|
41
|
-
const Zt = /* @__PURE__ */ Fe({
|
|
1
|
+
import { defineComponent as Se, defineAsyncComponent as a, ref as W, computed as l, watch as $, onMounted as he, onUnmounted as Ee } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as Ce } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as De } from "../composables/useEditorLock.js";
|
|
4
|
+
import { startEditorOpenMetrics as we } from "../composables/useEditorOpenMetrics.js";
|
|
5
|
+
import { provideGuidoActions as Te } from "../composables/useGuidoActions.js";
|
|
6
|
+
import { useGuidoStateBridge as ke } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { usePartner as Fe } from "../composables/usePartner.js";
|
|
8
|
+
import { useSaveValidationRollout as Me } from "../composables/useSaveValidationRollout.js";
|
|
9
|
+
import { useStripo as Ie } from "../composables/useStripo.js";
|
|
10
|
+
import { useTimerClone as Le } from "../composables/useTimerClone.js";
|
|
11
|
+
import { useToaster as Re } from "../composables/useToaster.js";
|
|
12
|
+
import { useTranslations as Oe } from "../composables/useTranslations.js";
|
|
13
|
+
import { migrate as Ue } from "../config/migrator/index.js";
|
|
14
|
+
import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
15
|
+
import { RIBBON_SELECTOR as Ae } from "../enums/onboarding.js";
|
|
16
|
+
import { ToasterTypeOptions as Ne } from "../enums/toaster.js";
|
|
17
|
+
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as _e } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
|
+
import { disposeUnsubscribeListeners as Pe } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
19
|
+
import { disposeDisplayConditionRequest as xe } from "../extensions/DisplayConditions/bridge.js";
|
|
20
|
+
import Be from "./organisms/AutoSaveController.vue.js";
|
|
21
|
+
import He from "./organisms/base/AuthErrorModal.vue.js";
|
|
22
|
+
import Ve from "./organisms/base/Toaster.vue.js";
|
|
23
|
+
import We from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
24
|
+
import $e from "./organisms/header/HeaderWrapper.vue.js";
|
|
25
|
+
import Ge from "./organisms/LoadingWrapper.vue.js";
|
|
26
|
+
import ze from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
27
|
+
import qe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
28
|
+
import Ke from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
29
|
+
import { useStripoApi as je } from "../services/stripoApi.js";
|
|
30
|
+
import { useConfigStore as Je } from "../stores/config.js";
|
|
31
|
+
import { useDynamicContentStore as Qe } from "../stores/dynamic-content.js";
|
|
32
|
+
import { useEditorStore as C } from "../stores/editor.js";
|
|
33
|
+
import { useModuleDynamicContentStore as q } from "../stores/module-dynamic-content.js";
|
|
34
|
+
import { useOnboardingStore as Xe } from "../stores/onboarding.js";
|
|
35
|
+
import { usePreviewStore as Ye } from "../stores/preview.js";
|
|
36
|
+
import { useSaveValidationStore as Ze } from "../stores/save-validation.js";
|
|
37
|
+
import { useTemplateStore as et } from "../stores/template.js";
|
|
38
|
+
import { useUnsubscribeStore as tt } from "../stores/unsubscribe.js";
|
|
39
|
+
import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
|
|
40
|
+
const Vt = /* @__PURE__ */ Se({
|
|
42
41
|
__name: "Guido",
|
|
43
42
|
props: {
|
|
44
43
|
config: null,
|
|
45
44
|
ready: { type: Boolean, default: !0 }
|
|
46
45
|
},
|
|
47
|
-
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"
|
|
48
|
-
setup(
|
|
49
|
-
const c =
|
|
46
|
+
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
47
|
+
setup(j, { expose: J, emit: i }) {
|
|
48
|
+
const c = j, r = we(), Q = a(
|
|
50
49
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
51
|
-
),
|
|
50
|
+
), X = a(
|
|
52
51
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
53
|
-
),
|
|
52
|
+
), Y = a(
|
|
54
53
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
55
|
-
),
|
|
54
|
+
), Z = a(
|
|
56
55
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
57
|
-
),
|
|
56
|
+
), ee = a(
|
|
58
57
|
() => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
|
|
59
|
-
),
|
|
58
|
+
), D = W(), te = a(
|
|
60
59
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
61
|
-
),
|
|
60
|
+
), oe = a(
|
|
62
61
|
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
63
|
-
),
|
|
62
|
+
), ne = a(
|
|
64
63
|
() => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
|
|
65
|
-
),
|
|
66
|
-
() => import("./organisms/dynamic-content/InvalidDynamicContentCard.vue.js")
|
|
67
|
-
), M = 200, S = L(), p = st(), R = ut(), pe = ee(), o = at();
|
|
64
|
+
), y = W(), g = Qe(), w = tt(), re = q(), o = Je();
|
|
68
65
|
c.ready && o.init(c.config);
|
|
69
|
-
const d =
|
|
66
|
+
const d = C(), ie = Ye(), p = l(() => d.hasChanges), { isTestPartner: se } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster: k } = Re(), F = Oe(), M = () => {
|
|
70
67
|
var t;
|
|
71
68
|
if (d.isVersionHistoryOpen) {
|
|
72
|
-
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }),
|
|
73
|
-
type:
|
|
74
|
-
message:
|
|
69
|
+
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
|
|
70
|
+
type: Ne.Warning,
|
|
71
|
+
message: F("email-editor.save-blocked-outside-editor")
|
|
75
72
|
});
|
|
76
73
|
return;
|
|
77
74
|
}
|
|
78
|
-
return (t =
|
|
79
|
-
},
|
|
75
|
+
return (t = D.value) == null ? void 0 : t.saveSilent();
|
|
76
|
+
}, I = (t) => {
|
|
80
77
|
d.loadingStatus = t;
|
|
81
78
|
};
|
|
82
|
-
|
|
83
|
-
const
|
|
79
|
+
Ce(), ke();
|
|
80
|
+
const b = () => {
|
|
84
81
|
var t, e;
|
|
85
82
|
return {
|
|
86
83
|
emailId: o.templateId,
|
|
87
84
|
userId: o.userId,
|
|
88
85
|
username: o.username,
|
|
89
86
|
partnerName: o.partnerName,
|
|
90
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
91
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
87
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
|
|
88
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
|
|
92
89
|
};
|
|
93
|
-
}, { initPlugin:
|
|
94
|
-
let
|
|
95
|
-
const { getDefaultTemplate:
|
|
90
|
+
}, { initPlugin: L, preloadRuntime: R } = Ie(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = De();
|
|
91
|
+
let f = 0;
|
|
92
|
+
const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Le(), ce = l(() => {
|
|
96
93
|
var t;
|
|
97
94
|
return !((t = o.ui) != null && t.showHeader);
|
|
98
|
-
}),
|
|
95
|
+
}), de = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), me = l(() => o.externalDisplayConditions), le = l(
|
|
99
96
|
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
100
|
-
),
|
|
101
|
-
() => !!
|
|
97
|
+
), ue = l(
|
|
98
|
+
() => !!z().recommendationConfigs.strategyId
|
|
102
99
|
);
|
|
103
|
-
|
|
100
|
+
Te({
|
|
104
101
|
onBack: () => {
|
|
105
102
|
console.debug("guido:back"), i("back");
|
|
106
103
|
},
|
|
@@ -108,46 +105,31 @@ const Zt = /* @__PURE__ */ Fe({
|
|
|
108
105
|
console.debug("guido:save:start"), i("save:start");
|
|
109
106
|
},
|
|
110
107
|
onSaveComplete: (t) => {
|
|
111
|
-
const e = { ...t, metadata:
|
|
108
|
+
const e = { ...t, metadata: b() };
|
|
112
109
|
console.debug("guido:save:complete", e), i("save:complete", e);
|
|
113
110
|
},
|
|
114
111
|
onTestEmailClick: () => {
|
|
115
112
|
console.debug("guido:test-email:click"), i("test-email:click");
|
|
116
113
|
}
|
|
117
114
|
});
|
|
118
|
-
const
|
|
119
|
-
console.debug("dynamic-content:close", t),
|
|
120
|
-
},
|
|
115
|
+
const P = (t) => {
|
|
116
|
+
console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
117
|
+
}, x = () => {
|
|
121
118
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
122
|
-
}, K = (t) => {
|
|
123
|
-
p.setInvalidDynamicContent(t);
|
|
124
|
-
}, b = L(null);
|
|
125
|
-
let m = null;
|
|
126
|
-
const v = () => {
|
|
127
|
-
m && (clearTimeout(m), m = null);
|
|
128
|
-
}, E = () => {
|
|
129
|
-
v(), m = setTimeout(() => {
|
|
130
|
-
m = null, b.value = null;
|
|
131
|
-
}, M);
|
|
132
|
-
}, D = (t) => {
|
|
133
|
-
const { detail: e } = t;
|
|
134
|
-
!(e != null && e.entry) || !e.position || (v(), b.value = { entry: e.entry, position: e.position });
|
|
135
|
-
}, Ee = (t) => {
|
|
136
|
-
console.debug("dynamic-content:invalid-action", t), v(), b.value = null, i("dynamic-content:invalid-action", { value: t.value });
|
|
137
119
|
};
|
|
138
|
-
|
|
139
|
-
i("on-change",
|
|
120
|
+
$(() => p.value, () => {
|
|
121
|
+
i("on-change", p.value);
|
|
140
122
|
});
|
|
141
|
-
const
|
|
142
|
-
const e = t, { attribute: s, position:
|
|
143
|
-
console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s,
|
|
123
|
+
const S = (t) => {
|
|
124
|
+
const e = t, { attribute: s, position: u } = e.detail;
|
|
125
|
+
console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s, u);
|
|
144
126
|
};
|
|
145
|
-
let
|
|
146
|
-
const
|
|
127
|
+
let m = null;
|
|
128
|
+
const h = () => {
|
|
147
129
|
var e;
|
|
148
|
-
const t = document.querySelector(
|
|
149
|
-
(e =
|
|
150
|
-
},
|
|
130
|
+
const t = document.querySelector(Ae);
|
|
131
|
+
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
132
|
+
}, E = async () => {
|
|
151
133
|
var t;
|
|
152
134
|
r.mark("host_ready");
|
|
153
135
|
try {
|
|
@@ -157,78 +139,77 @@ const Zt = /* @__PURE__ */ Fe({
|
|
|
157
139
|
templateId: o.templateId,
|
|
158
140
|
variationId: o.variationId
|
|
159
141
|
});
|
|
160
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "",
|
|
161
|
-
|
|
162
|
-
const
|
|
142
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
143
|
+
w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
144
|
+
const pe = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), fe = {
|
|
163
145
|
partnerName: o.partnerName,
|
|
164
146
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
165
147
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
166
|
-
},
|
|
148
|
+
}, ye = {
|
|
167
149
|
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
168
|
-
},
|
|
150
|
+
}, V = (ve) => r.timed(
|
|
169
151
|
"migration",
|
|
170
|
-
() =>
|
|
152
|
+
() => Ue(ve, pe, fe, ye)
|
|
171
153
|
);
|
|
172
154
|
let n = {
|
|
173
|
-
html: s && await
|
|
174
|
-
css:
|
|
155
|
+
html: s && await V(s),
|
|
156
|
+
css: u
|
|
175
157
|
};
|
|
176
|
-
n.html || (n = await r.timed("default_template", () =>
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
const
|
|
180
|
-
preselectedDynamicContentList:
|
|
158
|
+
n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html));
|
|
159
|
+
const ge = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
160
|
+
_(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
|
|
161
|
+
const be = {
|
|
162
|
+
preselectedDynamicContentList: B,
|
|
181
163
|
onReady: () => {
|
|
182
164
|
console.debug("guido:ready"), i("ready");
|
|
183
165
|
}
|
|
184
166
|
};
|
|
185
|
-
|
|
167
|
+
f = U(), await L(n, b(), be, n.html !== s), g.selectedDynamicContentList = B;
|
|
186
168
|
} catch (e) {
|
|
187
169
|
console.error("Failed to initialize Stripo editor:", e), r.markFailed();
|
|
188
170
|
}
|
|
189
171
|
};
|
|
190
|
-
return
|
|
172
|
+
return he(async () => {
|
|
191
173
|
var e;
|
|
192
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
193
|
-
const t = (e =
|
|
194
|
-
if (t && (
|
|
195
|
-
await
|
|
174
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), et().$reset(), Ze().$reset(), q().$reset(), Xe().resetOnboarding("recommendationLegacyStrategyOnboarding"), T(), h();
|
|
175
|
+
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
176
|
+
if (t && (m = new ResizeObserver(h), m.observe(t)), R(), c.ready)
|
|
177
|
+
await E();
|
|
196
178
|
else {
|
|
197
|
-
const s =
|
|
198
|
-
|
|
179
|
+
const s = $(() => c.ready, (u) => {
|
|
180
|
+
u && (s(), E());
|
|
199
181
|
});
|
|
200
182
|
}
|
|
201
|
-
document.addEventListener("dynamic-content:open",
|
|
202
|
-
}),
|
|
203
|
-
if (
|
|
204
|
-
|
|
183
|
+
document.addEventListener("dynamic-content:open", S);
|
|
184
|
+
}), Ee(() => {
|
|
185
|
+
if (Pe(), _e(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
|
|
186
|
+
xe();
|
|
205
187
|
try {
|
|
206
|
-
const t =
|
|
188
|
+
const t = C();
|
|
207
189
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
208
190
|
} catch (t) {
|
|
209
191
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
210
192
|
}
|
|
211
193
|
}
|
|
212
|
-
|
|
213
|
-
if (
|
|
194
|
+
O(async () => {
|
|
195
|
+
if (v(f))
|
|
214
196
|
try {
|
|
215
197
|
window.UIEditor.removeEditor();
|
|
216
198
|
} catch {
|
|
217
199
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
218
200
|
}
|
|
219
201
|
}), o.reset();
|
|
220
|
-
}),
|
|
202
|
+
}), J({
|
|
221
203
|
dynamicContent: {
|
|
222
|
-
insert:
|
|
223
|
-
close:
|
|
224
|
-
setInvalid: K
|
|
204
|
+
insert: P,
|
|
205
|
+
close: x
|
|
225
206
|
},
|
|
226
|
-
hasChanges:
|
|
227
|
-
saveSilent:
|
|
228
|
-
setLoading:
|
|
229
|
-
}), { __sfc: !0, openMetrics: r, PreviewContainer:
|
|
207
|
+
hasChanges: p,
|
|
208
|
+
saveSilent: M,
|
|
209
|
+
setLoading: I
|
|
210
|
+
}), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, AmbiguousDynamicContentModal: ne, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, moduleDynamicContentStore: re, props: c, configStore: o, editorStore: d, previewStore: ie, hasChanges: p, isTestPartner: se, isSaveValidationEnabled: ae, loadRollout: T, showToaster: k, trans: F, saveSilent: M, setLoading: I, emit: i, buildMetadata: b, initPlugin: L, preloadRuntime: R, runExclusive: O, beginMount: U, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: ce, isRrsEnabled: de, isExternalDisplayConditionsEnabled: me, isLegacyUnsubscribeConversionEnabled: le, hasAssignedStrategy: ue, insertDynamicContent: P, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Be, AuthErrorModal: He, Toaster: Ve, FilterSelectionDrawer: We, HeaderWrapper: $e, LoadingWrapper: Ge, SaveAsTemplateDrawer: ze, UnsubscribeWrapper: qe, ValidationErrorDrawer: Ke };
|
|
230
211
|
}
|
|
231
212
|
});
|
|
232
213
|
export {
|
|
233
|
-
|
|
214
|
+
Vt as default
|
|
234
215
|
};
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
|
-
var g = (
|
|
3
|
-
var
|
|
4
|
-
import { useConfig as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
o[a.MERGETAGS] = l;
|
|
2
|
+
var g = (o, s, t) => s in o ? c(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
|
+
var r = (o, s, t) => g(o, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
import { useConfig as d } from "../../composables/useConfig.js";
|
|
5
|
+
import { findEditorShadowRoot as m } from "../../utils/editorShadowRoot.js";
|
|
6
|
+
import { mergeTagToDynamicContent as u, dynamicContentToMergeTags as h } from "../../utils/genericUtil.js";
|
|
7
|
+
import { UIElement as T, UIElementType as a, UEAttr as y, UIElementTagRegistry as C } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
8
|
+
import { ExternalMergeTagsLibrary as E } from "./dynamic-content-modal.js";
|
|
9
|
+
const l = "external-dynamic-content-ui-element", L = "button-add-dynamic-content";
|
|
10
|
+
class B extends C {
|
|
11
|
+
registerUiElements(s) {
|
|
12
|
+
s[a.MERGETAGS] = l;
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
|
-
class
|
|
15
|
+
class x extends T {
|
|
17
16
|
constructor() {
|
|
18
17
|
super(...arguments);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
r(this, "mergeTagsButton", null);
|
|
19
|
+
r(this, "mergeTagsLibrary", null);
|
|
20
|
+
r(this, "clickListener", null);
|
|
21
|
+
r(this, "lastClickedElement", null);
|
|
22
|
+
r(this, "lastClickedFrame", null);
|
|
23
|
+
r(this, "mousedownListener", null);
|
|
25
24
|
}
|
|
26
25
|
getId() {
|
|
27
26
|
return l;
|
|
@@ -46,7 +45,7 @@ class U extends y {
|
|
|
46
45
|
onAttributeUpdated(t, e) {
|
|
47
46
|
if (t !== "mergeTag" || !(e != null && e.value))
|
|
48
47
|
return;
|
|
49
|
-
const n =
|
|
48
|
+
const n = u(e), i = this._getLastClickedPosition();
|
|
50
49
|
this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(n, i);
|
|
51
50
|
}
|
|
52
51
|
openMergeTagLibrary() {
|
|
@@ -58,15 +57,14 @@ class U extends y {
|
|
|
58
57
|
* Dispatches event with dynamic content data and position
|
|
59
58
|
*/
|
|
60
59
|
_openDynamicContentLibrary(t, e) {
|
|
61
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
60
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new E()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
62
61
|
t,
|
|
63
62
|
(n) => {
|
|
64
63
|
if (n.text && n.value) {
|
|
65
|
-
const { isFeatureEnabled: i } =
|
|
66
|
-
this.api.triggerValueChange(
|
|
64
|
+
const { isFeatureEnabled: i } = d();
|
|
65
|
+
this.api.triggerValueChange(h([n], i("liquidSyntax"))[0]);
|
|
67
66
|
} else
|
|
68
67
|
this.api.triggerValueChange(null);
|
|
69
|
-
d();
|
|
70
68
|
},
|
|
71
69
|
e
|
|
72
70
|
);
|
|
@@ -98,7 +96,7 @@ class U extends y {
|
|
|
98
96
|
*/
|
|
99
97
|
_getEditorFrame() {
|
|
100
98
|
var e, n;
|
|
101
|
-
const t = (e =
|
|
99
|
+
const t = (e = m()) == null ? void 0 : e.querySelector("iframe");
|
|
102
100
|
return (n = t == null ? void 0 : t.contentWindow) != null && n.document ? t : null;
|
|
103
101
|
}
|
|
104
102
|
/**
|
|
@@ -147,7 +145,7 @@ class U extends y {
|
|
|
147
145
|
<${a.BUTTON}
|
|
148
146
|
id="guido__btn-add-dynamic-content"
|
|
149
147
|
class="btn btn-primary"
|
|
150
|
-
${
|
|
148
|
+
${y.BUTTON.name}="${L}">
|
|
151
149
|
<${a.ICON} src="plus" class="icon icon-button color-primary">
|
|
152
150
|
</${a.ICON}>
|
|
153
151
|
${this.api.translate("Add Dynamic Content")}
|
|
@@ -156,6 +154,6 @@ class U extends y {
|
|
|
156
154
|
}
|
|
157
155
|
}
|
|
158
156
|
export {
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
B as DynamicContentTagRegistry,
|
|
158
|
+
x as DynamicContentUiElementExtension
|
|
161
159
|
};
|
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-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{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-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{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-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.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}
|
package/dist/package.json.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const o = "3.30.0-beta.
|
|
1
|
+
const o = "3.30.0-beta.c515f18", 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,13 +13,6 @@ 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
|
-
};
|
|
23
16
|
/**
|
|
24
17
|
* A node in the partner-keyed dynamic-content tree (backend categorized-fields
|
|
25
18
|
* shape). Category nodes carry `children`/`select_items`; leaf nodes are the
|
|
@@ -61,10 +54,6 @@ export type DynamicContentEvent = {
|
|
|
61
54
|
attribute: DynamicContent;
|
|
62
55
|
position?: PositionData;
|
|
63
56
|
};
|
|
64
|
-
export type InvalidDynamicContentHoverEvent = {
|
|
65
|
-
entry: InvalidDynamicContent;
|
|
66
|
-
position: PositionData;
|
|
67
|
-
};
|
|
68
57
|
export type MergeTagClickEvent = {
|
|
69
58
|
position: PositionData;
|
|
70
59
|
element: HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicContent, GuidoConfigInput } from '@@/Types/config';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PositionData } from '@@/Types/generic';
|
|
3
3
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
/** Guido configuration object */
|
|
@@ -13,7 +13,6 @@ 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;
|
|
17
16
|
};
|
|
18
17
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
19
18
|
saveSilent: () => Promise<{
|
|
@@ -51,9 +50,6 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
51
50
|
ready: () => void;
|
|
52
51
|
"onboarding:finished": () => void;
|
|
53
52
|
"test-email:click": () => void;
|
|
54
|
-
"dynamic-content:invalid-action": (detail: {
|
|
55
|
-
value: string;
|
|
56
|
-
}) => void;
|
|
57
53
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
58
54
|
ready: boolean;
|
|
59
55
|
}>>>, {
|
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,
|
|
9
|
+
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { DynamicContent
|
|
1
|
+
import type { DynamicContent } from '@@/Types/generic';
|
|
2
2
|
export declare const useDynamicContentStore: import("pinia").StoreDefinition<"guidoDynamicContent", {
|
|
3
3
|
selectedDynamicContent: DynamicContent;
|
|
4
4
|
selectedDynamicContentList: DynamicContent[];
|
|
5
|
-
invalidDynamicContentList: InvalidDynamicContent[];
|
|
6
5
|
}, {
|
|
7
6
|
getSelectedDynamicContentList: (state: {
|
|
8
7
|
selectedDynamicContent: {
|
|
@@ -23,17 +22,9 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
|
|
|
23
22
|
} | undefined;
|
|
24
23
|
text: string;
|
|
25
24
|
}[];
|
|
26
|
-
invalidDynamicContentList: {
|
|
27
|
-
value: string;
|
|
28
|
-
title: string;
|
|
29
|
-
description: string;
|
|
30
|
-
actionLabel: string;
|
|
31
|
-
actionAvailable: boolean;
|
|
32
|
-
}[];
|
|
33
25
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
34
26
|
selectedDynamicContent: DynamicContent;
|
|
35
27
|
selectedDynamicContentList: DynamicContent[];
|
|
36
|
-
invalidDynamicContentList: InvalidDynamicContent[];
|
|
37
28
|
}>) => {
|
|
38
29
|
text: string;
|
|
39
30
|
value: string;
|
|
@@ -43,37 +34,6 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
|
|
|
43
34
|
value: string;
|
|
44
35
|
} | undefined;
|
|
45
36
|
}[];
|
|
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;
|
|
77
37
|
}, {
|
|
78
38
|
setSelectedDynamicContent(dynamicContent: DynamicContent): void;
|
|
79
39
|
/**
|
|
@@ -84,5 +44,4 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
|
|
|
84
44
|
* reactivity can't write a later mutation back into the host's catalog.
|
|
85
45
|
*/
|
|
86
46
|
registerDynamicContent(items: DynamicContent[]): void;
|
|
87
|
-
setInvalidDynamicContent(list: unknown): void;
|
|
88
47
|
}>;
|
|
@@ -9,10 +9,6 @@ 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
|
-
|
|
16
12
|
.ue-preview-control-wrapper ue-icon-component:not([disabled=true]):not(.stripo-static-icon):hover {
|
|
17
13
|
background: none;
|
|
18
14
|
}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import { removeDuplicatesFromArray as
|
|
2
|
-
import {
|
|
3
|
-
|
|
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", {
|
|
1
|
+
import { removeDuplicatesFromArray as n } from "../utils/arrayUtil.js";
|
|
2
|
+
import { defineStore as a } from "pinia";
|
|
3
|
+
const c = a("guidoDynamicContent", {
|
|
11
4
|
state: () => ({
|
|
12
5
|
selectedDynamicContent: { text: "", value: "" },
|
|
13
|
-
selectedDynamicContentList: []
|
|
14
|
-
invalidDynamicContentList: []
|
|
6
|
+
selectedDynamicContentList: []
|
|
15
7
|
}),
|
|
16
8
|
actions: {
|
|
17
9
|
setSelectedDynamicContent(t) {
|
|
@@ -26,21 +18,17 @@ const n = (t) => typeof t == "string" ? t : "", c = (t) => !o(t) || typeof t.val
|
|
|
26
18
|
*/
|
|
27
19
|
registerDynamicContent(t) {
|
|
28
20
|
this.selectedDynamicContentList.push(...t.map((e) => ({ ...e })));
|
|
29
|
-
},
|
|
30
|
-
setInvalidDynamicContent(t) {
|
|
31
|
-
this.invalidDynamicContentList = Array.isArray(t) ? t.map(c).filter((e) => e !== null) : [];
|
|
32
21
|
}
|
|
33
22
|
},
|
|
34
23
|
getters: {
|
|
35
|
-
getSelectedDynamicContentList: (t) =>
|
|
24
|
+
getSelectedDynamicContentList: (t) => n(t.selectedDynamicContentList).map((e) => ({
|
|
36
25
|
text: e.text,
|
|
37
26
|
value: e.value,
|
|
38
27
|
fallback: e.fallback,
|
|
39
28
|
format: e.format
|
|
40
|
-
}))
|
|
41
|
-
getInvalidDynamicContent: (t) => (e) => t.invalidDynamicContentList.find((a) => a.value === e)
|
|
29
|
+
}))
|
|
42
30
|
}
|
|
43
31
|
});
|
|
44
32
|
export {
|
|
45
|
-
|
|
33
|
+
c as useDynamicContentStore
|
|
46
34
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.30.0-beta.
|
|
3
|
+
"version": "3.30.0-beta.c515f18",
|
|
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",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import a from "./InvalidDynamicContentCard.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import c from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var o = function() {
|
|
5
|
-
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
6
|
-
return n("div", { staticClass: "invalid-dynamic-content-card", style: e.cardStyle, attrs: { id: "guido__invalid-dynamic-content-card", role: "tooltip" }, 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" }, [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 ? 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
|
-
}, r = [], s = /* @__PURE__ */ c(
|
|
12
|
-
a,
|
|
13
|
-
o,
|
|
14
|
-
r,
|
|
15
|
-
!1,
|
|
16
|
-
null,
|
|
17
|
-
"007c64e1"
|
|
18
|
-
);
|
|
19
|
-
const v = s.exports;
|
|
20
|
-
export {
|
|
21
|
-
v as default
|
|
22
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { defineComponent as c, computed as s } from "vue";
|
|
2
|
-
const l = /* @__PURE__ */ c({
|
|
3
|
-
__name: "InvalidDynamicContentCard",
|
|
4
|
-
props: {
|
|
5
|
-
entry: null,
|
|
6
|
-
position: null
|
|
7
|
-
},
|
|
8
|
-
emits: ["dynamic-content:invalid-action", "mouseenter", "mouseleave"],
|
|
9
|
-
setup(e, { emit: t }) {
|
|
10
|
-
const n = e, o = 4, i = s(() => ({
|
|
11
|
-
top: `${n.position.y + (n.position.height ?? 0) + o}px`,
|
|
12
|
-
left: `${n.position.x}px`
|
|
13
|
-
}));
|
|
14
|
-
return { __sfc: !0, CARD_OFFSET: o, props: n, emit: t, cardStyle: i, onAction: () => {
|
|
15
|
-
t("dynamic-content:invalid-action", { value: n.entry.value });
|
|
16
|
-
} };
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
l as default
|
|
21
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { useDynamicContentStore as g } from "../stores/dynamic-content.js";
|
|
2
|
-
import { useEditorStore as L } from "../stores/editor.js";
|
|
3
|
-
import { findEditorShadowRoot as S } from "../utils/editorShadowRoot.js";
|
|
4
|
-
import { watch as T } from "vue";
|
|
5
|
-
const p = "merge-tag-selector", y = "merge-tag-value", m = "guido-invalid-dynamic-content-style", $ = (t) => t.replace(/["\\]/g, "\\$&").replace(/[\n\r\f]/g, (n) => `\\${n.charCodeAt(0).toString(16)} `), M = (t) => {
|
|
6
|
-
const n = t.flatMap((o) => {
|
|
7
|
-
const e = $(o);
|
|
8
|
-
return [`="{{${e}}}"`, `^="{{${e}\\|"`, `="{{ ${e} }}"`, `^="{{ ${e} \\|"`].map((i) => `${p}[${y}${i}]`).flatMap((i) => [`${i} .esd-merge-tag`, `${i} .esd-x`]);
|
|
9
|
-
});
|
|
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
|
-
}, v = (t) => {
|
|
16
|
-
const n = /^\{\{([^}]*)\}\}/.exec(t.getAttribute(y) ?? "");
|
|
17
|
-
return (n == null ? void 0 : n[1].split("|")[0].trim()) ?? "";
|
|
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(p) : null;
|
|
21
|
-
}, f = () => {
|
|
22
|
-
var t;
|
|
23
|
-
return ((t = S()) == null ? void 0 : t.querySelector("iframe")) ?? null;
|
|
24
|
-
}, C = () => {
|
|
25
|
-
var t, n;
|
|
26
|
-
return ((n = (t = f()) == null ? void 0 : t.contentWindow) == null ? void 0 : n.document) ?? null;
|
|
27
|
-
}, A = (t, n) => {
|
|
28
|
-
const o = t.getBoundingClientRect(), e = n.getBoundingClientRect();
|
|
29
|
-
return {
|
|
30
|
-
x: o.x + e.x,
|
|
31
|
-
y: o.y + e.y,
|
|
32
|
-
width: e.width,
|
|
33
|
-
height: e.height
|
|
34
|
-
};
|
|
35
|
-
}, h = (t, n) => {
|
|
36
|
-
var c;
|
|
37
|
-
const o = M(n), e = t.getElementById(m);
|
|
38
|
-
if (!o) {
|
|
39
|
-
e == null || e.remove();
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (e) {
|
|
43
|
-
e.textContent !== o && (e.textContent = o);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const i = t.createElement("style");
|
|
47
|
-
i.id = m, i.textContent = o, (c = t.head ?? t.body) == null || c.appendChild(i);
|
|
48
|
-
}, B = () => {
|
|
49
|
-
const t = C();
|
|
50
|
-
if (t)
|
|
51
|
-
try {
|
|
52
|
-
const n = g().invalidDynamicContentList.map((o) => o.value);
|
|
53
|
-
h(t, n);
|
|
54
|
-
} catch (n) {
|
|
55
|
-
console.error("Failed to apply the invalid dynamic content marking", n);
|
|
56
|
-
}
|
|
57
|
-
}, G = () => {
|
|
58
|
-
const t = g(), n = L();
|
|
59
|
-
let o = null, e = null;
|
|
60
|
-
const i = () => {
|
|
61
|
-
e && (e = null, document.dispatchEvent(new CustomEvent("dynamic-content:invalid-leave")));
|
|
62
|
-
}, c = (r) => {
|
|
63
|
-
const s = x(r.target);
|
|
64
|
-
if (!s || s === e)
|
|
65
|
-
return;
|
|
66
|
-
const l = t.getInvalidDynamicContent(v(s)), u = f();
|
|
67
|
-
if (!l || !u)
|
|
68
|
-
return;
|
|
69
|
-
e = s;
|
|
70
|
-
const I = {
|
|
71
|
-
entry: { ...l },
|
|
72
|
-
position: A(u, s)
|
|
73
|
-
};
|
|
74
|
-
document.dispatchEvent(new CustomEvent("dynamic-content:invalid-hover", { detail: I }));
|
|
75
|
-
}, d = (r) => {
|
|
76
|
-
!e || w(r.relatedTarget) && e.contains(r.relatedTarget) || i();
|
|
77
|
-
}, a = () => {
|
|
78
|
-
o == null || o.removeEventListener("mouseover", c), o == null || o.removeEventListener("mouseout", d), o == null || o.removeEventListener("scroll", i, !0), o = null, i();
|
|
79
|
-
}, E = () => {
|
|
80
|
-
if (!n.isStripoInitialized) {
|
|
81
|
-
a();
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const r = C(), s = t.invalidDynamicContentList.map((l) => l.value);
|
|
85
|
-
if (!r) {
|
|
86
|
-
a();
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (h(r, s), s.length === 0) {
|
|
90
|
-
a();
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
r !== o && (a(), r.addEventListener("mouseover", c), r.addEventListener("mouseout", d), r.addEventListener("scroll", i, !0), o = r), e && (!e.isConnected || !s.includes(v(e))) && i();
|
|
94
|
-
};
|
|
95
|
-
return T(
|
|
96
|
-
[
|
|
97
|
-
() => n.isStripoInitialized,
|
|
98
|
-
() => n.changeSeq,
|
|
99
|
-
() => t.invalidDynamicContentList
|
|
100
|
-
],
|
|
101
|
-
() => {
|
|
102
|
-
try {
|
|
103
|
-
E();
|
|
104
|
-
} catch (r) {
|
|
105
|
-
console.error("Failed to track invalid dynamic content", r);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
), { dispose: a };
|
|
109
|
-
};
|
|
110
|
-
export {
|
|
111
|
-
B as applyInvalidDynamicContentMarking,
|
|
112
|
-
G as useInvalidDynamicContentMarking
|
|
113
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
};
|