@useinsider/guido 3.3.0-beta.d5c796a → 3.3.0-beta.ddabd14
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/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +103 -91
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +9 -11
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +70 -35
- package/dist/components/organisms/header/MiddleSlot.vue.js +1 -1
- package/dist/components/organisms/header/MiddleSlot.vue2.js +7 -8
- package/dist/composables/useCortexBlueprintBridge.js +36 -61
- package/dist/composables/useHtmlValidator.js +41 -36
- package/dist/composables/useRecommendation.js +2 -2
- package/dist/composables/useStripo.js +66 -62
- package/dist/config/migrator/index.js +21 -10
- package/dist/config/migrator/radioButtonMigrator.js +73 -48
- package/dist/enums/extensions/recommendationBlock.js +101 -46
- package/dist/enums/unsubscribe.js +25 -24
- package/dist/extensions/Blocks/Checkbox/control.js +23 -23
- package/dist/extensions/Blocks/RadioButton/control.js +15 -15
- package/dist/extensions/Blocks/RadioButton/template.js +6 -6
- package/dist/extensions/Blocks/Recommendation/block.js +43 -36
- package/dist/extensions/Blocks/Recommendation/services/configService.js +33 -26
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +35 -26
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +25 -12
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
- package/dist/guido.css +1 -1
- package/dist/services/unsubscribeApi.js +6 -6
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +2 -5
- package/dist/src/enums/extensions/recommendationBlock.d.ts +6 -1
- package/dist/src/enums/unsubscribe.d.ts +8 -3
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +11 -3
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
- package/dist/utils/templatePreparation.js +57 -50
- package/package.json +1 -1
- package/dist/components/organisms/header/AiStatusPill.vue.js +0 -18
- package/dist/components/organisms/header/AiStatusPill.vue2.js +0 -13
- package/dist/src/components/organisms/header/AiStatusPill.vue.d.ts +0 -2
- package/dist/src/stores/ai-status.d.ts +0 -41
- package/dist/stores/ai-status.js +0 -25
|
@@ -1,135 +1,147 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { provideGuidoActions as
|
|
4
|
-
import { useGuidoStateBridge as
|
|
5
|
-
import { usePartner as
|
|
6
|
-
import { useStripo as
|
|
7
|
-
import { useTimerClone as
|
|
8
|
-
import { migrate as
|
|
9
|
-
import { ModuleFolderDefaults as
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { useStripoApi as
|
|
19
|
-
import { useConfigStore as
|
|
20
|
-
import { useDynamicContentStore as
|
|
21
|
-
import { useEditorStore as
|
|
22
|
-
import { usePreviewStore as
|
|
23
|
-
import { useUnsubscribeStore as
|
|
24
|
-
const
|
|
1
|
+
import { defineComponent as ee, defineAsyncComponent as G, ref as z, computed as q, watch as oe, onMounted as te, onUnmounted as ne } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as se } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as re } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as ce } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as ae } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as ie } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as de } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as K } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as V } from "../enums/defaults.js";
|
|
10
|
+
import { RIBBON_SELECTOR as me } from "../enums/onboarding.js";
|
|
11
|
+
import le from "./organisms/AutoSaveController.vue.js";
|
|
12
|
+
import ue from "./organisms/base/Toaster.vue.js";
|
|
13
|
+
import pe from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
14
|
+
import fe from "./organisms/header/HeaderWrapper.vue.js";
|
|
15
|
+
import ve from "./organisms/LoadingWrapper.vue.js";
|
|
16
|
+
import be from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
17
|
+
import ge from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
18
|
+
import { useStripoApi as ye } from "../services/stripoApi.js";
|
|
19
|
+
import { useConfigStore as Se } from "../stores/config.js";
|
|
20
|
+
import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
|
|
21
|
+
import { useEditorStore as we } from "../stores/editor.js";
|
|
22
|
+
import { usePreviewStore as Ee } from "../stores/preview.js";
|
|
23
|
+
import { useUnsubscribeStore as De } from "../stores/unsubscribe.js";
|
|
24
|
+
const je = /* @__PURE__ */ ee({
|
|
25
25
|
__name: "Guido",
|
|
26
26
|
props: {
|
|
27
27
|
config: null
|
|
28
28
|
},
|
|
29
29
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
30
|
-
setup(
|
|
31
|
-
const
|
|
30
|
+
setup($, { expose: j, emit: r }) {
|
|
31
|
+
const D = $, J = G(
|
|
32
32
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
33
|
-
),
|
|
33
|
+
), Q = G(
|
|
34
34
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
const
|
|
35
|
+
), C = z(), v = z(), b = he(), k = De(), m = Se();
|
|
36
|
+
m.init(D.config);
|
|
37
|
+
const g = we(), X = Ee(), f = q(() => g.hasChanges), { isTestPartner: Y } = ae(), T = () => {
|
|
38
38
|
var e;
|
|
39
|
-
return (e =
|
|
39
|
+
return (e = C.value) == null ? void 0 : e.handleSave(!0);
|
|
40
40
|
}, {
|
|
41
|
-
templateId:
|
|
42
|
-
userId:
|
|
43
|
-
partnerName:
|
|
44
|
-
username:
|
|
41
|
+
templateId: y,
|
|
42
|
+
userId: A,
|
|
43
|
+
partnerName: B,
|
|
44
|
+
username: F,
|
|
45
45
|
template: o,
|
|
46
|
-
editor:
|
|
47
|
-
} =
|
|
48
|
-
|
|
46
|
+
editor: c
|
|
47
|
+
} = m, l = (o == null ? void 0 : o.html) || "", L = (o == null ? void 0 : o.css) || "", S = (o == null ? void 0 : o.preselectedDynamicContent) || [], U = (c == null ? void 0 : c.savedModulesFolderName) || V.SAVED_MODULES, _ = (c == null ? void 0 : c.defaultModulesFolderName) || V.DEFAULT_MODULES;
|
|
48
|
+
g.templateId = y, se(), ce();
|
|
49
49
|
const h = {
|
|
50
|
-
emailId:
|
|
51
|
-
userId:
|
|
52
|
-
username:
|
|
53
|
-
partnerName:
|
|
54
|
-
savedModulesFolderName:
|
|
55
|
-
defaultModulesFolderName:
|
|
56
|
-
},
|
|
57
|
-
preselectedDynamicContentList:
|
|
50
|
+
emailId: y,
|
|
51
|
+
userId: A,
|
|
52
|
+
username: F,
|
|
53
|
+
partnerName: B,
|
|
54
|
+
savedModulesFolderName: U,
|
|
55
|
+
defaultModulesFolderName: _
|
|
56
|
+
}, H = {
|
|
57
|
+
preselectedDynamicContentList: S,
|
|
58
58
|
onReady: () => {
|
|
59
|
-
console.debug("guido:ready"),
|
|
59
|
+
console.debug("guido:ready"), r("ready");
|
|
60
60
|
}
|
|
61
|
-
}, { initPlugin: M } =
|
|
61
|
+
}, { initPlugin: M } = ie(h, H), { getDefaultTemplate: O } = ye(), { cloneTimersOnSave: P, hasTimerBlocks: N } = de(), Z = q(() => {
|
|
62
62
|
var e;
|
|
63
|
-
return !((e =
|
|
63
|
+
return !((e = m.ui) != null && e.showHeader);
|
|
64
64
|
});
|
|
65
|
-
|
|
65
|
+
re({
|
|
66
66
|
onBack: () => {
|
|
67
|
-
console.debug("guido:back"),
|
|
67
|
+
console.debug("guido:back"), r("back");
|
|
68
68
|
},
|
|
69
69
|
onSaveStart: () => {
|
|
70
|
-
console.debug("guido:save:start"),
|
|
70
|
+
console.debug("guido:save:start"), r("save:start");
|
|
71
71
|
},
|
|
72
72
|
onSaveComplete: (e) => {
|
|
73
|
-
const t = { ...e, metadata: h }
|
|
74
|
-
|
|
73
|
+
const t = { ...e, metadata: h }, a = (n) => ((n == null ? void 0 : n.match(/<td[^>]*radio-button-v2[^>]*>/gi)) ?? []).map((u) => {
|
|
74
|
+
var p;
|
|
75
|
+
const d = (((p = u.match(/class="([^"]*)"/)) == null ? void 0 : p[1]) ?? "").split(/\s+/).filter(Boolean);
|
|
76
|
+
return { classes: d, hasBlock: d.includes("radio-button-block"), tag: u };
|
|
77
|
+
});
|
|
78
|
+
console.debug("guido:save:complete", t), console.debug("guido:save:radio-tds", {
|
|
79
|
+
rawHtml: a(e.rawHtml),
|
|
80
|
+
compiledHtml: a(e.compiledHtml)
|
|
81
|
+
}), r("save:complete", t);
|
|
75
82
|
},
|
|
76
83
|
onTestEmailClick: () => {
|
|
77
|
-
console.debug("guido:test-email:click"),
|
|
84
|
+
console.debug("guido:test-email:click"), r("test-email:click");
|
|
78
85
|
}
|
|
79
86
|
});
|
|
80
|
-
const
|
|
81
|
-
console.debug("dynamic-content:close", e),
|
|
82
|
-
},
|
|
87
|
+
const R = (e) => {
|
|
88
|
+
console.debug("dynamic-content:close", e), b.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
89
|
+
}, I = () => {
|
|
83
90
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
84
91
|
};
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
oe(() => f.value, () => {
|
|
93
|
+
r("on-change", f.value);
|
|
87
94
|
});
|
|
88
|
-
const
|
|
89
|
-
const t = e, { attribute:
|
|
90
|
-
console.debug("dynamic-content:open", t.detail),
|
|
95
|
+
const w = (e) => {
|
|
96
|
+
const t = e, { attribute: a, position: n } = t.detail;
|
|
97
|
+
console.debug("dynamic-content:open", t.detail), r("dynamic-content:open", a, n);
|
|
91
98
|
};
|
|
92
|
-
let
|
|
93
|
-
const
|
|
99
|
+
let i = null;
|
|
100
|
+
const E = () => {
|
|
94
101
|
var t;
|
|
95
|
-
const e = document.querySelector(
|
|
96
|
-
(t =
|
|
102
|
+
const e = document.querySelector(me);
|
|
103
|
+
(t = v.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
97
104
|
};
|
|
98
|
-
return
|
|
99
|
-
var t,
|
|
100
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
101
|
-
const e = (t =
|
|
102
|
-
e && (
|
|
105
|
+
return te(async () => {
|
|
106
|
+
var t, a;
|
|
107
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E();
|
|
108
|
+
const e = (t = v.value) == null ? void 0 : t.parentElement;
|
|
109
|
+
e && (i = new ResizeObserver(E), i.observe(e));
|
|
103
110
|
try {
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
k.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
112
|
+
const n = ((a = o == null ? void 0 : o.migration) == null ? void 0 : a.recommendationConfigs) ?? {}, u = (d) => ((d == null ? void 0 : d.match(/<td[^>]*radio-button-v2[^>]*>/gi)) ?? []).map((p) => {
|
|
113
|
+
var x;
|
|
114
|
+
const W = (((x = p.match(/class="([^"]*)"/)) == null ? void 0 : x[1]) ?? "").split(/\s+/).filter(Boolean);
|
|
115
|
+
return { classes: W, hasBlock: W.includes("radio-button-block"), tag: p };
|
|
116
|
+
});
|
|
117
|
+
console.debug("guido:pre-migrate radio-tds", u(l));
|
|
118
|
+
let s = {
|
|
119
|
+
html: l && await K(l, n),
|
|
120
|
+
css: L
|
|
109
121
|
};
|
|
110
|
-
|
|
111
|
-
} catch (
|
|
112
|
-
console.error("Failed to initialize Stripo editor:",
|
|
122
|
+
console.debug("guido:post-migrate radio-tds", u(s.html)), s.html || (s = await O(), s.html = await K(s.html, n)), N(s.html) && (s.html = await P(s.html)), await M(s), b.selectedDynamicContentList = S;
|
|
123
|
+
} catch (n) {
|
|
124
|
+
console.error("Failed to initialize Stripo editor:", n);
|
|
113
125
|
}
|
|
114
|
-
document.addEventListener("dynamic-content:open",
|
|
115
|
-
}),
|
|
116
|
-
|
|
126
|
+
document.addEventListener("dynamic-content:open", w);
|
|
127
|
+
}), ne(() => {
|
|
128
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", w);
|
|
117
129
|
try {
|
|
118
130
|
window.UIEditor.removeEditor();
|
|
119
131
|
} catch {
|
|
120
132
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
121
133
|
}
|
|
122
|
-
|
|
123
|
-
}),
|
|
134
|
+
m.reset();
|
|
135
|
+
}), j({
|
|
124
136
|
dynamicContent: {
|
|
125
|
-
insert:
|
|
126
|
-
close:
|
|
137
|
+
insert: R,
|
|
138
|
+
close: I
|
|
127
139
|
},
|
|
128
|
-
hasChanges:
|
|
129
|
-
saveSilent:
|
|
130
|
-
}), { __sfc: !0, PreviewContainer:
|
|
140
|
+
hasChanges: f,
|
|
141
|
+
saveSilent: T
|
|
142
|
+
}), { __sfc: !0, PreviewContainer: J, OnboardingWrapper: Q, headerWrapperRef: C, wrapperRef: v, dynamicContentStore: b, unsubscribeStore: k, props: D, configStore: m, editorStore: g, previewStore: X, hasChanges: f, isTestPartner: Y, saveSilent: T, templateId: y, userId: A, partnerName: B, username: F, templateConfig: o, editorConfig: c, html: l, css: L, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: r, metadata: h, options: H, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: N, noHeader: Z, insertDynamicContent: R, closeDynamicContent: I, handleDynamicContentOpen: w, ribbonObserver: i, updateRibbonOffset: E, AutoSaveController: le, Toaster: ue, FilterSelectionDrawer: pe, HeaderWrapper: fe, LoadingWrapper: ve, SaveAsTemplateDrawer: be, UnsubscribeWrapper: ge };
|
|
131
143
|
}
|
|
132
144
|
});
|
|
133
145
|
export {
|
|
134
|
-
|
|
146
|
+
je as default
|
|
135
147
|
};
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from "./FilterItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
5
|
var a = this, e = a._self._c, t = a._self._setupProxy;
|
|
6
6
|
return e("div", { staticClass: "d-f f-d-c w-1 gap-16", attrs: { "data-filter-group": a.filter.filterGroup, "data-filter-number": a.filter.filterNumber } }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
|
|
7
7
|
return t.emit("delete-filter", t.props.filter);
|
|
8
|
-
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: function(s) {
|
|
9
|
-
return t.updateFilter({ text: "operator", value: s.value });
|
|
10
|
-
} } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
|
|
8
|
+
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: t.handleOperatorChange } }), t.isAnyOfOperator ? e(t.InTags, { staticClass: "w-2", attrs: { "allow-bulk-paste": "", validate: "text", "allow-duplicates": !1, invalid: t.invalidFields.has("value"), "invalid-message": t.valueErrorMessage, label: t.trans("condition.value"), placeholder: t.trans("condition.enter-value-placeholder"), value: t.tagValues }, on: { input: t.onTagsInput } }) : t.isDateAttribute ? e(t.InDatePickerV2, { staticClass: "w-2", attrs: { id: `filter-item-input--value-${a.index}`, "single-date-picker-status": "", "label-text": t.trans("condition.value"), locale: t.datePickerLocale, name: `filter-item-input--value-${a.index}`, "placeholder-text": t.trans("condition.enter-value-placeholder"), state: t.getFieldState("value"), "state-message": t.valueErrorMessage, value: t.datePickerValue }, on: { apply: t.onDatePickerApply } }) : e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: `filter-item-input--value-${a.index}`, name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: t.safeDecodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
|
|
11
9
|
t.updateFilter({ text: "value", value: encodeURIComponent(s) });
|
|
12
10
|
} } })]], 2), t.props.hasLogicAdapter ? e("div", { staticClass: "w-1 d-f a-i-c j-c-c p-r bor-b-s-s bor-b-w-1 bor-b-c-50 mt-4" }, [e(t.LogicAdapter, { staticClass: "p-a", attrs: { logic: t.props.filter.innerGroupOperator }, on: { change: function(s) {
|
|
13
11
|
return t.updateFilter({ text: "innerGroupOperator", value: s });
|
|
14
12
|
} } })], 1) : a._e()]);
|
|
15
|
-
},
|
|
13
|
+
}, n = [], o = /* @__PURE__ */ i(
|
|
14
|
+
l,
|
|
16
15
|
r,
|
|
17
|
-
|
|
18
|
-
o,
|
|
16
|
+
n,
|
|
19
17
|
!1,
|
|
20
18
|
null,
|
|
21
|
-
"
|
|
19
|
+
"8053a037"
|
|
22
20
|
);
|
|
23
|
-
const f =
|
|
21
|
+
const f = o.exports;
|
|
24
22
|
export {
|
|
25
23
|
f as default
|
|
26
24
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { getOperatorOptions as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { defineComponent as N, computed as r } from "vue";
|
|
2
|
+
import { useTranslations as U } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { getOperatorOptions as f, OP_ANY_OF as d } from "../../../../enums/extensions/recommendationBlock.js";
|
|
4
|
+
import { useRecommendationExtensionStore as E } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { parseTagList as j, safeDecodeURIComponent as g } from "../../../../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
6
|
+
import { getInvalidFilterFields as w } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
|
|
7
|
+
import { locale as M } from "../../../../utils/dateUtil.js";
|
|
8
|
+
import { InTags as Y, InButtonV2 as q, InSelect as z, InDatePickerV2 as G, InBasicTextInput as H } from "@useinsider/design-system-vue";
|
|
9
|
+
import J from "./LogicAdapter.vue.js";
|
|
10
|
+
import { useDebounceFn as K } from "../../../../node_modules/@vueuse/shared/index.js";
|
|
11
|
+
const se = /* @__PURE__ */ N({
|
|
10
12
|
__name: "FilterItem",
|
|
11
13
|
props: {
|
|
12
14
|
filter: null,
|
|
@@ -15,55 +17,88 @@ const K = /* @__PURE__ */ _({
|
|
|
15
17
|
submitted: { type: Boolean }
|
|
16
18
|
},
|
|
17
19
|
emits: ["delete-filter"],
|
|
18
|
-
setup(
|
|
19
|
-
const t =
|
|
20
|
+
setup(I, { emit: O }) {
|
|
21
|
+
const t = I, s = U(), n = E(), T = [
|
|
20
22
|
{
|
|
21
|
-
text:
|
|
23
|
+
text: s("email-editor.standard-filter"),
|
|
22
24
|
value: "standardFilter"
|
|
23
25
|
}
|
|
24
|
-
],
|
|
26
|
+
], u = [
|
|
25
27
|
{ text: "True", value: "true" },
|
|
26
28
|
{ text: "False", value: "false" }
|
|
27
|
-
],
|
|
29
|
+
], m = r(() => t.filter.attribute || ""), i = r(() => n.getFilterList.find((e) => e.value === m.value) || { text: "", value: "", type: "" }), h = r(
|
|
28
30
|
() => {
|
|
29
31
|
var e;
|
|
30
|
-
return ((e =
|
|
32
|
+
return ((e = i.value) == null ? void 0 : e.type) === "Boolean";
|
|
31
33
|
}
|
|
32
|
-
), b =
|
|
34
|
+
), b = r(() => {
|
|
33
35
|
var e;
|
|
34
|
-
return
|
|
35
|
-
}),
|
|
36
|
-
() =>
|
|
37
|
-
),
|
|
38
|
-
() =>
|
|
39
|
-
),
|
|
36
|
+
return f((e = i.value) == null ? void 0 : e.type).find((o) => o.value === t.filter.operator);
|
|
37
|
+
}), A = r(
|
|
38
|
+
() => u.find((e) => e.value === t.filter.value) || u[0]
|
|
39
|
+
), p = r(() => t.submitted ? w(t.filter) : /* @__PURE__ */ new Set()), x = (e) => p.value.has(e) ? "error" : "default", B = r(
|
|
40
|
+
() => p.value.has("value") ? s("action-builder.filter-empty-value-error") : ""
|
|
41
|
+
), v = r(
|
|
40
42
|
() => {
|
|
41
43
|
var e;
|
|
42
|
-
return ((e =
|
|
44
|
+
return ((e = i.value) == null ? void 0 : e.type) === "Number";
|
|
43
45
|
}
|
|
44
|
-
),
|
|
45
|
-
|
|
46
|
+
), D = r(() => v.value ? "number" : "text"), C = r(
|
|
47
|
+
() => {
|
|
48
|
+
var e;
|
|
49
|
+
return ((e = i.value) == null ? void 0 : e.type) === "Date";
|
|
50
|
+
}
|
|
51
|
+
), _ = r(() => t.filter.operator === d), k = r(() => j(t.filter.value)), P = K((e) => {
|
|
52
|
+
n.updateFilter({
|
|
46
53
|
...t.filter,
|
|
47
54
|
[e.text]: e.value
|
|
48
55
|
});
|
|
49
|
-
}, 500)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
a.updateFilter({
|
|
56
|
+
}, 500), V = (e) => {
|
|
57
|
+
const o = n.getFilterList.find((c) => c.value === e.value), l = (o == null ? void 0 : o.type) === "Boolean", [a] = f(o == null ? void 0 : o.type);
|
|
58
|
+
n.updateFilter({
|
|
53
59
|
...t.filter,
|
|
54
60
|
attribute: e.value,
|
|
55
|
-
operator:
|
|
56
|
-
value:
|
|
61
|
+
operator: l ? "=" : (a == null ? void 0 : a.value) ?? "",
|
|
62
|
+
value: l ? "true" : ""
|
|
57
63
|
});
|
|
58
|
-
},
|
|
59
|
-
|
|
64
|
+
}, L = (e) => {
|
|
65
|
+
n.updateFilter({
|
|
60
66
|
...t.filter,
|
|
61
67
|
operator: "=",
|
|
62
68
|
value: e.value
|
|
63
69
|
});
|
|
64
|
-
},
|
|
70
|
+
}, S = (e) => {
|
|
71
|
+
const o = e.value;
|
|
72
|
+
if (o === t.filter.operator)
|
|
73
|
+
return;
|
|
74
|
+
const c = t.filter.operator === d !== (o === d);
|
|
75
|
+
n.updateFilter({
|
|
76
|
+
...t.filter,
|
|
77
|
+
operator: o,
|
|
78
|
+
value: c ? "" : t.filter.value
|
|
79
|
+
});
|
|
80
|
+
}, $ = M(), y = (e) => {
|
|
81
|
+
const [o, l, a] = e.split("-");
|
|
82
|
+
return !o || !l || !a ? "" : `${l}/${a}/${o}`;
|
|
83
|
+
}, F = (e) => {
|
|
84
|
+
const [o, l, a] = e.split("/");
|
|
85
|
+
return !a || !o || !l ? "" : `${a}-${o.padStart(2, "0")}-${l.padStart(2, "0")}`;
|
|
86
|
+
}, R = r(
|
|
87
|
+
() => y(g(t.filter.value))
|
|
88
|
+
);
|
|
89
|
+
return { __sfc: !0, trans: s, store: n, props: t, filterTypeOptions: T, booleanValueOptions: u, attributeType: m, selectedAttributeType: i, isBooleanAttribute: h, selectedOperatorType: b, selectedBooleanValue: A, emit: O, invalidFields: p, getFieldState: x, valueErrorMessage: B, isNumericAttribute: v, valueInputType: D, isDateAttribute: C, isAnyOfOperator: _, tagValues: k, updateFilter: P, handleAttributeChange: V, handleBooleanValueChange: L, handleOperatorChange: S, datePickerLocale: $, isoToPickerDate: y, pickerDateToIso: F, datePickerValue: R, onDatePickerApply: (e) => {
|
|
90
|
+
n.updateFilter({
|
|
91
|
+
...t.filter,
|
|
92
|
+
value: encodeURIComponent(F(e))
|
|
93
|
+
});
|
|
94
|
+
}, onTagsInput: (e) => {
|
|
95
|
+
n.updateFilter({
|
|
96
|
+
...t.filter,
|
|
97
|
+
value: e.map(encodeURIComponent).join(",")
|
|
98
|
+
});
|
|
99
|
+
}, getOperatorOptions: f, safeDecodeURIComponent: g, InBasicTextInput: H, InDatePickerV2: G, InSelect: z, InButtonV2: q, InTags: Y, LogicAdapter: J };
|
|
65
100
|
}
|
|
66
101
|
});
|
|
67
102
|
export {
|
|
68
|
-
|
|
103
|
+
se as default
|
|
69
104
|
};
|
|
@@ -2,7 +2,7 @@ import r from "./MiddleSlot.vue2.js";
|
|
|
2
2
|
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var t = function() {
|
|
4
4
|
var o = this, e = o._self._c, i = o._self._setupProxy;
|
|
5
|
-
return e("div", { staticClass: "d-f a-i-c" }, [i.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(i.VersionHistory), e(i.VersionHistoryViewOptions)], 1) : i.editorStore.isPreviewModeOpen ? e("div", { staticClass: "d-f" }, [e(i.EmailSizeIndicator), e(i.AmpToggle)], 1) : o._e(), e(i.EditorToolbar, { directives: [{ name: "show", rawName: "v-show", value: i.editorStore.isEditorToolbarVisible, expression: "editorStore.isEditorToolbarVisible" }] })
|
|
5
|
+
return e("div", { staticClass: "d-f a-i-c" }, [i.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(i.VersionHistory), e(i.VersionHistoryViewOptions)], 1) : i.editorStore.isPreviewModeOpen ? e("div", { staticClass: "d-f" }, [e(i.EmailSizeIndicator), e(i.AmpToggle)], 1) : o._e(), e(i.EditorToolbar, { directives: [{ name: "show", rawName: "v-show", value: i.editorStore.isEditorToolbarVisible, expression: "editorStore.isEditorToolbarVisible" }] })], 1);
|
|
6
6
|
}, a = [], n = /* @__PURE__ */ s(
|
|
7
7
|
r,
|
|
8
8
|
t,
|
|
@@ -2,16 +2,15 @@ import { defineComponent as o } from "vue";
|
|
|
2
2
|
import r from "../email-preview/amp/AmpToggle.vue.js";
|
|
3
3
|
import t from "../email-preview/desktop-preview/EmailSizeIndicator.vue.js";
|
|
4
4
|
import { useEditorStore as i } from "../../../stores/editor.js";
|
|
5
|
-
import e from "./
|
|
6
|
-
import m from "./
|
|
7
|
-
import p from "./version-history/
|
|
8
|
-
|
|
9
|
-
const V = /* @__PURE__ */ o({
|
|
5
|
+
import e from "./EditorToolbar.vue.js";
|
|
6
|
+
import m from "./version-history/VersionHistory.vue.js";
|
|
7
|
+
import p from "./version-history/ViewOptions.vue.js";
|
|
8
|
+
const S = /* @__PURE__ */ o({
|
|
10
9
|
__name: "MiddleSlot",
|
|
11
|
-
setup(
|
|
12
|
-
return { __sfc: !0, editorStore: i(), AmpToggle: r, EmailSizeIndicator: t,
|
|
10
|
+
setup(s) {
|
|
11
|
+
return { __sfc: !0, editorStore: i(), AmpToggle: r, EmailSizeIndicator: t, EditorToolbar: e, VersionHistory: m, VersionHistoryViewOptions: p };
|
|
13
12
|
}
|
|
14
13
|
});
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
S as default
|
|
17
16
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { useEmailTemplateApplier as
|
|
2
|
-
import { useToaster as
|
|
1
|
+
import { useEmailTemplateApplier as m, resetEmailTemplateApplier as w } from "./useEmailTemplateApplier.js";
|
|
2
|
+
import { useToaster as _ } from "./useToaster.js";
|
|
3
3
|
import { useTranslations as I } from "./useTranslations.js";
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import {
|
|
6
|
-
import { getActivePinia as W } from "pinia";
|
|
4
|
+
import { ToasterTypeOptions as S } from "../enums/toaster.js";
|
|
5
|
+
import { getActivePinia as v } from "pinia";
|
|
7
6
|
import { watch as B, onUnmounted as D } from "vue";
|
|
8
|
-
const
|
|
7
|
+
const P = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
|
|
9
8
|
if (typeof window > "u")
|
|
10
9
|
return !1;
|
|
11
10
|
try {
|
|
@@ -13,68 +12,44 @@ const v = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
|
|
|
13
12
|
} catch {
|
|
14
13
|
return !1;
|
|
15
14
|
}
|
|
16
|
-
},
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
15
|
+
}, O = () => {
|
|
16
|
+
const a = v();
|
|
17
|
+
if (!a)
|
|
19
18
|
return;
|
|
20
|
-
const
|
|
19
|
+
const l = a._s, p = l == null ? void 0 : l.get(x);
|
|
21
20
|
if (!p)
|
|
22
21
|
return;
|
|
23
|
-
const { applyTemplate:
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
if (
|
|
22
|
+
const { applyTemplate: d, applyTemplateDebounced: f } = m(), { showToaster: T } = _(), h = I(), A = (e, t) => {
|
|
23
|
+
const r = h(e);
|
|
24
|
+
return r === e ? t : r;
|
|
25
|
+
}, i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), u = M(), E = (e, t) => {
|
|
26
|
+
u && console.debug(`[guido:cortex] msg=${e ?? "?"} type=${(t == null ? void 0 : t.type) ?? "?"}`, t);
|
|
27
|
+
}, y = (e) => {
|
|
28
|
+
if (e.blueprintType !== P)
|
|
30
29
|
return;
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
30
|
+
const t = e.blueprintId, r = e.blueprintData;
|
|
31
|
+
if (!t || !(r != null && r.html))
|
|
33
32
|
return;
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
i.$patch({ isWorking: !1, currentTool: "", lastError: "tool_error" });
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
t.isRunning === !0 ? i.$patch({
|
|
44
|
-
isWorking: !0,
|
|
45
|
-
currentTool: t.name ?? "",
|
|
46
|
-
lastError: ""
|
|
47
|
-
}) : i.$patch({ isWorking: !1, currentTool: "" });
|
|
48
|
-
}
|
|
49
|
-
}, w = (t, r) => {
|
|
50
|
-
r && a.has(r) || (r && a.add(r), i.$patch({ isWorking: !1, currentTool: "", lastError: t.content ?? "error" }), f({
|
|
51
|
-
type: T.Alert,
|
|
52
|
-
message: d("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
|
|
53
|
-
}));
|
|
54
|
-
}, $ = B(
|
|
33
|
+
const o = i.get(t);
|
|
34
|
+
o === void 0 ? (i.set(t, r.html), d(t, r)) : o !== r.html && (i.set(t, r.html), f(t, r));
|
|
35
|
+
}, s = (e) => e === void 0 || c.has(e) ? !1 : (c.add(e), T({
|
|
36
|
+
type: S.Alert,
|
|
37
|
+
message: A("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
|
|
38
|
+
}), !0), b = B(
|
|
55
39
|
() => p.messages,
|
|
56
|
-
(
|
|
57
|
-
Array.isArray(
|
|
58
|
-
const
|
|
59
|
-
(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
)
|
|
65
|
-
}), h && console.debug(`[guido:cortex] message-level error id=${e}`, r));
|
|
66
|
-
const n = r == null ? void 0 : r.segments;
|
|
67
|
-
Array.isArray(n) && n.forEach((o) => {
|
|
68
|
-
if (o)
|
|
69
|
-
switch (b(e, o), o.type) {
|
|
40
|
+
(e) => {
|
|
41
|
+
Array.isArray(e) && e.forEach((t) => {
|
|
42
|
+
const r = t == null ? void 0 : t.id;
|
|
43
|
+
(t == null ? void 0 : t.isError) === !0 && s(r) && u && console.debug(`[guido:cortex] message-level error id=${r}`, t);
|
|
44
|
+
const o = t == null ? void 0 : t.segments;
|
|
45
|
+
Array.isArray(o) && o.forEach((n) => {
|
|
46
|
+
if (n)
|
|
47
|
+
switch (E(r, n), n.type) {
|
|
70
48
|
case "blueprint":
|
|
71
|
-
|
|
72
|
-
break;
|
|
73
|
-
case "tool":
|
|
74
|
-
S(o);
|
|
49
|
+
y(n);
|
|
75
50
|
break;
|
|
76
51
|
case "error":
|
|
77
|
-
|
|
52
|
+
s(r);
|
|
78
53
|
break;
|
|
79
54
|
}
|
|
80
55
|
});
|
|
@@ -83,9 +58,9 @@ const v = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
|
|
|
83
58
|
{ deep: !0, immediate: !0 }
|
|
84
59
|
);
|
|
85
60
|
D(() => {
|
|
86
|
-
|
|
61
|
+
b(), i.clear(), c.clear(), w();
|
|
87
62
|
});
|
|
88
63
|
};
|
|
89
64
|
export {
|
|
90
|
-
|
|
65
|
+
O as useCortexBlueprintBridge
|
|
91
66
|
};
|