@useinsider/guido 3.27.0-beta.0dd857f → 3.27.0-beta.13ad95b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/config/schemas.js +3 -3
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +9 -10
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +42 -41
- package/dist/composables/useSave.js +17 -19
- package/dist/composables/useSaveValidation.js +252 -134
- package/dist/composables/useTranslations.js +9 -14
- package/dist/enums/save-validation.js +2 -2
- package/dist/guido.css +1 -1
- package/dist/node_modules/valibot/dist/index.js +154 -232
- package/dist/package.json.js +1 -1
- package/dist/src/composables/useSaveValidation.d.ts +2 -2
- package/dist/src/enums/save-validation.d.ts +15 -3
- package/package.json +2 -2
- package/dist/@types/email-be/html-validation.js +0 -28
- package/dist/enums/email-be.js +0 -27
- package/dist/services/emailBe/errors/ApiError.js +0 -50
- package/dist/services/emailBe/errors/handleApiError.js +0 -31
- package/dist/services/emailBe/errors/toApiError.js +0 -71
- package/dist/services/emailBe/html/HtmlValidationService.js +0 -35
- package/dist/services/emailBe/html/index.js +0 -6
- package/dist/services/emailBe/http/HttpManager.js +0 -68
- package/dist/services/emailBe/http/RetryStack.js +0 -24
- package/dist/services/emailBe/http/client.js +0 -61
- package/dist/services/emailBe/http/index.js +0 -10
- package/dist/services/emailBe/http/transportErrors.js +0 -20
- package/dist/src/@types/email-be/html-validation.d.ts +0 -51
- package/dist/src/enums/email-be.d.ts +0 -26
- package/dist/src/services/emailBe/errors/ApiError.d.ts +0 -40
- package/dist/src/services/emailBe/errors/handleApiError.d.ts +0 -11
- package/dist/src/services/emailBe/errors/toApiError.d.ts +0 -2
- package/dist/src/services/emailBe/html/HtmlValidationService.d.ts +0 -8
- package/dist/src/services/emailBe/html/index.d.ts +0 -2
- package/dist/src/services/emailBe/http/HttpManager.d.ts +0 -13
- package/dist/src/services/emailBe/http/RetryStack.d.ts +0 -6
- package/dist/src/services/emailBe/http/client.d.ts +0 -3
- package/dist/src/services/emailBe/http/index.d.ts +0 -2
- package/dist/src/services/emailBe/http/transportErrors.d.ts +0 -15
- package/dist/src/services/emailBe/http/types.d.ts +0 -46
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
|
|
2
|
-
import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as k, boolean as a, array as n, transform as S, unknown as i, record as g, fallback as R, literal as u,
|
|
2
|
+
import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as k, boolean as a, array as n, transform as S, unknown as i, record as g, fallback as R, literal as u, looseObject as C, variant as T, union as h, lazy as I } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const b = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -76,7 +76,7 @@ const b = {
|
|
|
76
76
|
value: t()
|
|
77
77
|
})
|
|
78
78
|
)
|
|
79
|
-
}), f =
|
|
79
|
+
}), f = I(() => C({
|
|
80
80
|
text: e(t()),
|
|
81
81
|
// eslint-disable-next-line camelcase -- backend field name
|
|
82
82
|
tag_text: e(t()),
|
|
@@ -324,7 +324,7 @@ const b = {
|
|
|
324
324
|
(s) => typeof s == "function",
|
|
325
325
|
"processor must be a function"
|
|
326
326
|
)
|
|
327
|
-
}), V =
|
|
327
|
+
}), V = T("type", [
|
|
328
328
|
H,
|
|
329
329
|
_,
|
|
330
330
|
q,
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
/* empty css */
|
|
1
|
+
import r from "./AssignStrategyDrawer.vue2.js";
|
|
3
2
|
/* empty css */
|
|
4
3
|
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
5
4
|
var a = function() {
|
|
6
|
-
var e = this,
|
|
7
|
-
return t.store.assignStrategyDrawerStatus ?
|
|
8
|
-
return [
|
|
5
|
+
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
|
|
7
|
+
return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [t.strategiesLoading ? s(t.InSkeleton, { staticClass: "assign-strategy-select-skeleton", attrs: { sizing: t.SELECT_SKELETON_SIZING } }) : s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select w-23-s", attrs: { id: "assign-strategy-select", "create-button-visible": "", "info-box-position": "bottom right", "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { create: function(c) {
|
|
9
8
|
return t.store.openStrategyCreation();
|
|
10
9
|
}, infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
|
|
11
|
-
}, proxy: !0 }], null, !1,
|
|
10
|
+
}, proxy: !0 }], null, !1, 3648942541) }) : e._e();
|
|
12
11
|
}, n = [], i = /* @__PURE__ */ o(
|
|
13
|
-
|
|
12
|
+
r,
|
|
14
13
|
a,
|
|
15
14
|
n,
|
|
16
15
|
!1,
|
|
17
16
|
null,
|
|
18
|
-
|
|
17
|
+
null
|
|
19
18
|
);
|
|
20
|
-
const
|
|
19
|
+
const u = i.exports;
|
|
21
20
|
export {
|
|
22
|
-
|
|
21
|
+
u as default
|
|
23
22
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as b, defineAsyncComponent as T, ref as w, computed as o, watch as N } from "vue";
|
|
2
2
|
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { DOTTED_DATE_LOCALE as
|
|
6
|
-
import { URLS as
|
|
3
|
+
import { useToaster as R } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as P } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { DOTTED_DATE_LOCALE as U } from "../../../../enums/date.js";
|
|
6
|
+
import { URLS as G } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
7
|
import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import { commitStrategyChange as
|
|
10
|
-
import
|
|
11
|
-
import { formatShortDate as
|
|
12
|
-
import { asText as
|
|
13
|
-
import { escapeHtml as
|
|
14
|
-
import { InSkeleton as
|
|
15
|
-
const
|
|
8
|
+
import { useRecommendationExtensionStore as M } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { commitStrategyChange as E } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
|
|
10
|
+
import $ from "./StrategyInfoBoxContent.vue.js";
|
|
11
|
+
import { formatShortDate as z } from "../../../../utils/dateUtil.js";
|
|
12
|
+
import { asText as D } from "../../../../utils/genericUtil.js";
|
|
13
|
+
import { escapeHtml as H } from "../../../../utils/htmlEscape.js";
|
|
14
|
+
import { InSkeleton as O } from "@useinsider/design-system-vue";
|
|
15
|
+
const it = /* @__PURE__ */ b({
|
|
16
16
|
__name: "AssignStrategyDrawer",
|
|
17
|
-
setup(
|
|
17
|
+
setup(F) {
|
|
18
18
|
const g = () => import("@useinsider/design-system-organisms"), p = (t, r) => ({
|
|
19
|
-
render: (
|
|
20
|
-
}),
|
|
19
|
+
render: (s) => s(O, { props: { sizing: { width: t, height: r } } })
|
|
20
|
+
}), I = T({
|
|
21
21
|
loader: async () => (await g()).OrgStrategyDetailModal,
|
|
22
22
|
loadingComponent: p(480, 240),
|
|
23
23
|
delay: 0
|
|
24
|
-
}),
|
|
24
|
+
}), h = T({
|
|
25
25
|
loader: async () => (await g()).OrgStrategyDropdown
|
|
26
|
-
}), i = "guido-edit-strategy-", a =
|
|
27
|
-
|
|
26
|
+
}), i = "guido-edit-strategy-", x = { width: 480, height: 42 }, a = P(), e = M(), { showToaster: c } = R(), n = w(null), d = "legacy", l = w(!1), A = o(() => e.strategiesLoading || e.legacyConversionLoading), C = o(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: G.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
27
|
+
N(() => e.assignStrategyDrawerStatus, (t) => {
|
|
28
28
|
if (!t)
|
|
29
29
|
return;
|
|
30
30
|
const { strategyId: r } = e.recommendationConfigs;
|
|
31
|
-
|
|
31
|
+
n.value = r || (e.isLegacyStrategyBlock ? d : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
|
|
32
32
|
c({
|
|
33
33
|
type: u.Error,
|
|
34
34
|
message: a("discovery-strategy.error-description")
|
|
@@ -36,27 +36,28 @@ const st = /* @__PURE__ */ B({
|
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
38
|
const f = (t) => {
|
|
39
|
-
const r =
|
|
39
|
+
const r = D(t.updated_at || t.created_at);
|
|
40
40
|
if (!r)
|
|
41
41
|
return "";
|
|
42
|
-
const
|
|
43
|
-
return a("recommendation-strategy.last-updated-on", { value:
|
|
44
|
-
}, S =
|
|
42
|
+
const s = z(r, U);
|
|
43
|
+
return a("recommendation-strategy.last-updated-on", { value: s });
|
|
44
|
+
}, S = o(() => ({
|
|
45
45
|
text: a("ds-steps.legacy-strategy"),
|
|
46
|
-
value:
|
|
46
|
+
value: d,
|
|
47
47
|
hidden: !0
|
|
48
|
-
})),
|
|
48
|
+
})), m = o(() => e.strategies.map((t) => ({
|
|
49
49
|
text: t.name,
|
|
50
50
|
value: t.strategy_id,
|
|
51
51
|
infoBoxProps: {
|
|
52
52
|
id: `strategy-info-${t.strategy_id}`,
|
|
53
53
|
theme: "light",
|
|
54
54
|
variant: "information",
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
size: "small",
|
|
56
|
+
class: "assign-strategy-info-box",
|
|
57
|
+
titleText: H(D(t.name)),
|
|
57
58
|
descriptionStatus: !0,
|
|
58
59
|
descriptionText: f(t),
|
|
59
|
-
slot:
|
|
60
|
+
slot: $,
|
|
60
61
|
slotProps: { strategy: t },
|
|
61
62
|
// The info box drops the option's value/text, so the id is the only channel
|
|
62
63
|
// that can carry the strategy back to the click handler.
|
|
@@ -69,17 +70,17 @@ const st = /* @__PURE__ */ B({
|
|
|
69
70
|
icon: "line-open-website"
|
|
70
71
|
}]
|
|
71
72
|
}
|
|
72
|
-
}))),
|
|
73
|
+
}))), L = o(() => e.isLegacyStrategyBlock ? [S.value, ...m.value] : m.value), B = (t) => {
|
|
73
74
|
var _;
|
|
74
75
|
const r = (_ = t == null ? void 0 : t.id) != null && _.startsWith(i) ? t.id.slice(i.length) : "";
|
|
75
76
|
if (!r)
|
|
76
77
|
return;
|
|
77
|
-
const
|
|
78
|
-
e.openStrategyEdit(r) && (String(
|
|
79
|
-
}, v =
|
|
80
|
-
const t = e.strategies.find((r) => String(r.strategy_id) === String(
|
|
78
|
+
const s = e.currentRecommendationId, y = e.recommendationConfigs.strategyId === r;
|
|
79
|
+
e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null), y && (e.removeStrategy(), s !== null && E(s, "Removed recommendation strategy")));
|
|
80
|
+
}, v = o(() => {
|
|
81
|
+
const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
|
|
81
82
|
return t ? { ...t, fallback_config: null } : null;
|
|
82
|
-
}),
|
|
83
|
+
}), k = o(() => ({
|
|
83
84
|
primaryButton: {
|
|
84
85
|
styling: "solid",
|
|
85
86
|
type: "primary",
|
|
@@ -91,7 +92,7 @@ const st = /* @__PURE__ */ B({
|
|
|
91
92
|
labelText: a("products.cancel")
|
|
92
93
|
}
|
|
93
94
|
}));
|
|
94
|
-
return { __sfc: !0, loadOrganisms: g, skeleton: p, OrgStrategyDetailModal:
|
|
95
|
+
return { __sfc: !0, loadOrganisms: g, skeleton: p, OrgStrategyDetailModal: I, OrgStrategyDropdown: h, EDIT_BUTTON_ID_PREFIX: i, SELECT_SKELETON_SIZING: x, trans: a, store: e, showToaster: c, selectedStrategyId: n, LEGACY_OPTION_VALUE: d, showSelectionError: l, strategiesLoading: A, drawerDescription: C, lastUpdatedText: f, legacyStrategyOption: S, remoteStrategyOptions: m, strategyOptions: L, onInfoBoxButtonClick: B, selectedStrategy: v, footerButtonGroupOptions: k, closeDrawer: () => {
|
|
95
96
|
e.closeAssignStrategyDrawer();
|
|
96
97
|
}, assignStrategy: async () => {
|
|
97
98
|
const t = v.value;
|
|
@@ -112,16 +113,16 @@ const st = /* @__PURE__ */ B({
|
|
|
112
113
|
});
|
|
113
114
|
return;
|
|
114
115
|
}
|
|
115
|
-
const
|
|
116
|
+
const s = e.currentRecommendationId;
|
|
116
117
|
e.assignStrategy(t), c({
|
|
117
118
|
type: u.Success,
|
|
118
119
|
message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
119
|
-
}), e.closeAssignStrategyDrawer(),
|
|
120
|
+
}), e.closeAssignStrategyDrawer(), s !== null && await E(s, "Assigned recommendation strategy");
|
|
120
121
|
}, onSelect: (t) => {
|
|
121
|
-
|
|
122
|
-
} };
|
|
122
|
+
n.value = t.value, l.value = !1;
|
|
123
|
+
}, InSkeleton: O };
|
|
123
124
|
}
|
|
124
125
|
});
|
|
125
126
|
export {
|
|
126
|
-
|
|
127
|
+
it as default
|
|
127
128
|
};
|
|
@@ -16,40 +16,40 @@ import { useHtmlValidator as tt } from "./useHtmlValidator.js";
|
|
|
16
16
|
import { useToaster as et } from "./useToaster.js";
|
|
17
17
|
import { useCouponBlockValidator as ot } from "./validators/useCouponBlockValidator.js";
|
|
18
18
|
import { useHtmlDocumentCountValidator as it } from "./validators/useHtmlDocumentCountValidator.js";
|
|
19
|
-
import { useLiquidValidator as
|
|
20
|
-
import { useSyncModuleBlockValidator as
|
|
19
|
+
import { useLiquidValidator as st } from "./validators/useLiquidValidator.js";
|
|
20
|
+
import { useSyncModuleBlockValidator as rt } from "./validators/useSyncModuleBlockValidator.js";
|
|
21
21
|
import { useUnsubscribeBlockValidator as at } from "./validators/useUnsubscribeBlockValidator.js";
|
|
22
22
|
const Pt = () => {
|
|
23
|
-
const n = I(), S = N(), { validateHtml: y } = tt(), { validateLiquidSyntax: b } =
|
|
23
|
+
const n = I(), S = N(), { validateHtml: y } = tt(), { validateLiquidSyntax: b } = st(), { validateCouponBlockTags: H } = ot(), {
|
|
24
24
|
validateUnsubscribeBlockUniqueness: E,
|
|
25
25
|
validateUnsubscribeBlockHasTemplate: g,
|
|
26
26
|
validateNoInsiderUnsubscribeCode: V
|
|
27
|
-
} = at(), { validateSyncModuleBlocks: l } =
|
|
27
|
+
} = at(), { validateSyncModuleBlocks: l } = rt(), { validateSingleHtmlDocument: c } = it(), { callbacks: a, isFeatureEnabled: u } = D(), { extractSyncModuleData: x } = G(), { setSyncModuleUnsubscriptionPages: k } = K(), { editorSave: C, getTemplateData: m } = O(), { showToaster: h } = et(), { getBlockedDomains: B, resolveToast: T } = $(), { prepareTemplateDetails: p } = Z(), { collectSaveValidationErrors: L } = j(), { isEnabled: P } = z(), U = Y(), A = X(), w = Q(), { runExclusive: d } = F(), f = async (t, e, i) => {
|
|
28
28
|
if (!u("allowlistEnabled"))
|
|
29
29
|
return !1;
|
|
30
30
|
const o = await B(t, e);
|
|
31
31
|
if (!o.length)
|
|
32
32
|
return !1;
|
|
33
33
|
if (!i) {
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const s = await T(o);
|
|
35
|
+
s != null && s.message && h({
|
|
36
36
|
type: J.Warning,
|
|
37
|
-
message:
|
|
38
|
-
actionButton:
|
|
37
|
+
message: s.message,
|
|
38
|
+
actionButton: s.actionButton
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
return !0;
|
|
42
42
|
}, M = async (t, e) => !H(t.compiledHtml) || u("blockUnsubscribeLinks") && !V(t.rawHtml, e) || !E(t.compiledHtml) || !g(t.compiledHtml) ? !1 : u("liquidSyntax") ? b(t.compiledHtml) : y(t.compiledHtml, t.dynamicContentList, !0), v = async (t, e) => {
|
|
43
43
|
if (!await C())
|
|
44
44
|
return;
|
|
45
|
-
const { unsubscribePayload: o, stripoModules:
|
|
46
|
-
if (await k(o), t.modules =
|
|
47
|
-
const
|
|
48
|
-
S({ ...t, ...
|
|
45
|
+
const { unsubscribePayload: o, stripoModules: s } = x(t.rawHtml);
|
|
46
|
+
if (await k(o), t.modules = s, !e.suppress) {
|
|
47
|
+
const r = e.blankCompiled ? { compiledHtml: "", ampHtml: "" } : {};
|
|
48
|
+
S({ ...t, ...r, silent: e.silent });
|
|
49
49
|
}
|
|
50
50
|
return t;
|
|
51
51
|
}, W = async (t, e) => {
|
|
52
|
-
var
|
|
52
|
+
var s;
|
|
53
53
|
n();
|
|
54
54
|
const i = await m();
|
|
55
55
|
if (!c(i.html, e))
|
|
@@ -57,20 +57,18 @@ const Pt = () => {
|
|
|
57
57
|
const o = await p(i);
|
|
58
58
|
if (l(o.rawHtml, e)) {
|
|
59
59
|
if (P.value && !e) {
|
|
60
|
-
const
|
|
60
|
+
const r = await L(
|
|
61
61
|
o.compiledHtml,
|
|
62
62
|
o.dynamicContentList,
|
|
63
63
|
o.rawHtml
|
|
64
64
|
);
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
if (s.length) {
|
|
68
|
-
U.open(s, "save");
|
|
65
|
+
if (r.length) {
|
|
66
|
+
U.open(r, "save");
|
|
69
67
|
return;
|
|
70
68
|
}
|
|
71
69
|
} else if (!await M(o, e))
|
|
72
70
|
return;
|
|
73
|
-
if (!((
|
|
71
|
+
if (!((s = a.value) != null && s.externalValidation && !await a.value.externalValidation(o)) && !await f(o.compiledHtml, o.css, e))
|
|
74
72
|
return v(o, { silent: e, suppress: t });
|
|
75
73
|
}
|
|
76
74
|
}, R = async () => {
|