@useinsider/guido 3.20.1 → 3.21.0-beta.1bd7edd
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 +1 -0
- package/dist/@types/config/schemas.js +41 -39
- package/dist/@types/display-condition.js +25 -0
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +86 -83
- package/dist/components/organisms/AutoSaveController.vue2.js +10 -9
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +20 -0
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +30 -0
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +71 -0
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +34 -0
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +57 -0
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
- package/dist/components/organisms/header/EditorActions.vue.js +4 -4
- package/dist/components/organisms/header/EditorActions.vue2.js +53 -51
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +23 -22
- package/dist/composables/useAutoSave.js +46 -44
- package/dist/composables/useBlocksConfig.js +32 -24
- package/dist/composables/useDisplayConditions.js +102 -0
- package/dist/composables/useLegacyStrategyConversion.js +16 -16
- package/dist/composables/useSave.js +26 -23
- package/dist/composables/useSaveValidation.js +113 -114
- package/dist/composables/useSaveValidationRollout.js +17 -6
- package/dist/composables/useStripo.js +4 -3
- package/dist/enums/academy.js +1 -0
- package/dist/enums/display-condition.js +12 -0
- package/dist/extensions/Blocks/Items/block.js +43 -42
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +296 -223
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +221 -203
- package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +19 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +51 -36
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +31 -35
- package/dist/extensions/Blocks/Unsubscribe/block.js +70 -75
- package/dist/extensions/DisplayConditions/bridge.js +17 -0
- package/dist/extensions/DisplayConditions/constants.js +17 -0
- package/dist/extensions/DisplayConditions/control.js +178 -0
- package/dist/extensions/DisplayConditions/display-conditions.css.js +201 -0
- package/dist/extensions/DisplayConditions/extension.js +28 -0
- package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
- package/dist/extensions/DisplayConditions/library.js +27 -0
- package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +272 -192
- package/dist/node_modules/valibot/dist/index.js +297 -261
- package/dist/package.json.js +1 -1
- package/dist/services/displayConditionApi.js +39 -0
- package/dist/services/settingsApi.js +11 -0
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/display-condition.d.ts +59 -0
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useAutoSave.d.ts +4 -1
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useDisplayConditions.d.ts +16 -0
- package/dist/src/composables/useSaveValidationRollout.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/display-condition.d.ts +15 -0
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +18 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +9 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +17 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +7 -0
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +1 -6
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +6 -0
- package/dist/src/extensions/DisplayConditions/constants.d.ts +14 -0
- package/dist/src/extensions/DisplayConditions/control.d.ts +23 -0
- package/dist/src/extensions/DisplayConditions/extension.d.ts +2 -0
- package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
- package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
- package/dist/src/mock/api/display-conditions.d.ts +2 -0
- package/dist/src/services/displayConditionApi.d.ts +8 -0
- package/dist/src/services/settingsApi.d.ts +6 -0
- package/dist/src/stores/config.d.ts +166 -0
- package/dist/src/stores/display-condition.d.ts +81 -0
- package/dist/src/stores/setup-settings.d.ts +4 -0
- package/dist/src/utils/displayCondition.d.ts +10 -0
- package/dist/src/utils/protectTableText.d.ts +2 -0
- package/dist/static/styles/components/button.css.js +5 -0
- package/dist/stores/config.js +13 -6
- package/dist/stores/display-condition.js +28 -0
- package/dist/stores/setup-settings.js +10 -0
- package/dist/utils/displayCondition.js +26 -0
- package/dist/utils/pairProductVariables.js +15 -14
- package/dist/utils/protectTableText.js +22 -0
- package/package.json +4 -4
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import a from "./DisplayConditionCreateDrawer.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var n = function() {
|
|
5
|
+
var i = this, t = i._self._c, e = i._self._setupProxy;
|
|
6
|
+
return t(e.WpDrawer, { attrs: { id: "guido__display-condition-create-drawer", "description-status": "", "class-name": "guido-display-condition-create-drawer", size: "large", "close-on-outside-click": !1, "description-text": e.descriptionText, "footer-button-group-options": e.footerButtonGroupOptions, status: e.store.isCreateOpen, "title-text": e.trans(`${e.KEY}.create-title`) }, on: { cancelOrBackButtonEvent: e.close, onCloseEvent: e.close, primaryButtonEvent: function(o) {
|
|
7
|
+
return e.submit("inline");
|
|
8
|
+
}, secondaryButtonEvent: function(o) {
|
|
9
|
+
return e.submit("save");
|
|
10
|
+
} } }, [t("div", { staticClass: "guido-display-condition-create" }, [t(e.InBasicTextInput, { staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-name-input", name: "displayConditionName", "character-counter-status": !1, "disabled-status": e.isSaving, "label-text": e.trans(`${e.KEY}.condition-name`), "max-character-length": e.DISPLAY_CONDITION_LIMITS.NAME_MAX, "placeholder-text": e.trans(`${e.KEY}.condition-name-placeholder`), "state-message": e.errors.name || "", states: e.errors.name ? "error" : "default", "tooltip-status": !1, value: e.draft.name }, on: { input: function(o) {
|
|
11
|
+
return e.updateField("name", o);
|
|
12
|
+
} } }), t(e.InBasicTextInput, { staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-description-input", name: "displayConditionDescription", "character-counter-status": !1, "disabled-status": e.isSaving, "label-text": e.descriptionLabel, "max-character-length": e.DISPLAY_CONDITION_LIMITS.DESCRIPTION_MAX, "placeholder-text": e.trans(`${e.KEY}.condition-description-placeholder`), "state-message": e.errors.description || "", states: e.errors.description ? "error" : "default", "tooltip-status": !1, value: e.draft.description }, on: { input: function(o) {
|
|
13
|
+
return e.updateField("description", o);
|
|
14
|
+
} } }), t("div", { staticClass: "guido-display-condition-create__separator" }), t("p", { staticClass: "guido-display-condition-create__method-title" }, [i._v(" " + i._s(e.trans(`${e.KEY}.select-method`)) + " ")]), t("div", { staticClass: "guido-display-condition-create__methods" }, [t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-logic-builder", disable: "", disabled: "", name: "displayConditionMethod", selected: "codeOnly", value: "logicBuilder", label: e.trans(`${e.KEY}.logic-builder`) } }), t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-code-only", name: "displayConditionMethod", selected: "codeOnly", value: "codeOnly", label: e.trans(`${e.KEY}.code-only`) } })], 1), t(e.CodeEditorField, { ref: "codeBeforeRef", staticClass: "mb-3", attrs: { id: "guido__display-condition-code-before", disabled: e.isSaving, error: e.errors.codeBefore, label: e.trans(`${e.KEY}.code-before`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeBefore }, on: { input: function(o) {
|
|
15
|
+
return e.updateField("codeBefore", o);
|
|
16
|
+
} } }), t(e.CodeEditorField, { ref: "codeAfterRef", attrs: { id: "guido__display-condition-code-after", disabled: e.isSaving, error: e.errors.codeAfter, label: e.trans(`${e.KEY}.code-after`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeAfter }, on: { input: function(o) {
|
|
17
|
+
return e.updateField("codeAfter", o);
|
|
18
|
+
} } })], 1)]);
|
|
19
|
+
}, s = [], d = /* @__PURE__ */ r(
|
|
20
|
+
a,
|
|
21
|
+
n,
|
|
22
|
+
s,
|
|
23
|
+
!1,
|
|
24
|
+
null,
|
|
25
|
+
"a4b2ccb9"
|
|
26
|
+
);
|
|
27
|
+
const f = d.exports;
|
|
28
|
+
export {
|
|
29
|
+
f as default
|
|
30
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent as D, reactive as $, ref as s, watch as C, computed as u } from "vue";
|
|
2
|
+
import O from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import { useDisplayConditions as T } from "../../../composables/useDisplayConditions.js";
|
|
4
|
+
import { useTranslations as L } from "../../../composables/useTranslations.js";
|
|
5
|
+
import { ACADEMY_LINKS as x } from "../../../enums/academy.js";
|
|
6
|
+
import { DISPLAY_CONDITION_LIMITS as h } from "../../../enums/display-condition.js";
|
|
7
|
+
import { useDisplayConditionStore as k } from "../../../stores/display-condition.js";
|
|
8
|
+
import { InRadioButton as N, InBasicTextInput as w } from "@useinsider/design-system-vue";
|
|
9
|
+
import E from "./CodeEditorField.vue.js";
|
|
10
|
+
const J = /* @__PURE__ */ D({
|
|
11
|
+
__name: "DisplayConditionCreateDrawer",
|
|
12
|
+
setup(Y) {
|
|
13
|
+
const r = "email-editor.display-conditions", i = L(), c = k(), { validate: p, notifyInvalid: l, createInline: f, createAndSave: m, cancel: y } = T(), d = () => ({ name: "", description: "", codeBefore: "", codeAfter: "" }), e = $(d()), o = s({}), a = s(!1), v = s(), _ = s();
|
|
14
|
+
C(() => c.isCreateOpen, (n) => {
|
|
15
|
+
if (!n)
|
|
16
|
+
return;
|
|
17
|
+
const { editing: t } = c;
|
|
18
|
+
Object.assign(e, t ? {
|
|
19
|
+
name: t.name,
|
|
20
|
+
description: t.description,
|
|
21
|
+
codeBefore: t.beforeScript,
|
|
22
|
+
codeAfter: t.afterScript
|
|
23
|
+
} : d()), o.value = {}, a.value = !1;
|
|
24
|
+
}, { immediate: !0 });
|
|
25
|
+
const g = u(() => i(`${r}.create-description`, {
|
|
26
|
+
academyLink: `<a href="${x.EMAIL_DISPLAY_CONDITIONS}" class="guido-display-condition-academy" target="_blank">${i(`${r}.academy`)}</a>`
|
|
27
|
+
})), S = u(() => ({
|
|
28
|
+
cancelOrBackButton: {
|
|
29
|
+
styling: "ghost",
|
|
30
|
+
type: "secondary",
|
|
31
|
+
labelText: i(`${r}.cancel`),
|
|
32
|
+
disabledStatus: a.value
|
|
33
|
+
},
|
|
34
|
+
secondaryButton: {
|
|
35
|
+
styling: "solid",
|
|
36
|
+
type: "subtle-primary",
|
|
37
|
+
labelText: i(`${r}.create-and-save`),
|
|
38
|
+
loadingStatus: a.value
|
|
39
|
+
},
|
|
40
|
+
primaryButton: {
|
|
41
|
+
styling: "solid",
|
|
42
|
+
type: "primary",
|
|
43
|
+
labelText: i(`${r}.create`),
|
|
44
|
+
disabledStatus: a.value
|
|
45
|
+
}
|
|
46
|
+
})), B = (n, t) => {
|
|
47
|
+
t !== e[n] && (e[n] = t, o.value[n] && (o.value = { ...o.value, [n]: void 0 }));
|
|
48
|
+
}, A = u(() => `${i(`${r}.condition-description`)} <span class="guido-display-condition-create__optional">(${i(`${r}.optional`)})</span>`);
|
|
49
|
+
return { __sfc: !0, KEY: r, trans: i, store: c, validate: p, notifyInvalid: l, createInline: f, createAndSave: m, cancel: y, emptyDraft: d, draft: e, errors: o, isSaving: a, codeBeforeRef: v, codeAfterRef: _, descriptionText: g, footerButtonGroupOptions: S, updateField: B, descriptionLabel: A, submit: async (n) => {
|
|
50
|
+
var I, b;
|
|
51
|
+
if (a.value)
|
|
52
|
+
return;
|
|
53
|
+
if (e.codeBefore = ((I = v.value) == null ? void 0 : I.read()) ?? e.codeBefore, e.codeAfter = ((b = _.value) == null ? void 0 : b.read()) ?? e.codeAfter, o.value = p(e), Object.keys(o.value).length) {
|
|
54
|
+
l();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (n === "inline") {
|
|
58
|
+
f({ ...e });
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
a.value = !0;
|
|
62
|
+
const t = await m({ ...e });
|
|
63
|
+
a.value = !1, o.value = t ?? {}, Object.keys(o.value).length && l();
|
|
64
|
+
}, close: () => {
|
|
65
|
+
a.value || y();
|
|
66
|
+
}, WpDrawer: O, DISPLAY_CONDITION_LIMITS: h, InBasicTextInput: w, InRadioButton: N, CodeEditorField: E };
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
J as default
|
|
71
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import a from "./DisplayConditionSelectDrawer.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import o from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var d = function() {
|
|
5
|
+
var s = this, i = s._self._c, t = s._self._setupProxy;
|
|
6
|
+
return i("div", { staticClass: "guido-display-condition-select-root" }, [i(t.WpDrawer, { attrs: { id: "guido__display-condition-select-drawer", "description-status": "", "class-name": "guido-display-condition-select-drawer", size: "large", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.isSelectOpen, "title-text": t.trans(`${t.KEY}.select-title`) }, on: { cancelOrBackButtonEvent: t.cancel, onCloseEvent: t.cancel } }, [i("div", { staticClass: "guido-display-condition-select" }, [t.store.listStatus === "loaded" && t.store.list.length ? i(t.InBasicTextInput, { staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-search-input", name: "displayConditionSearch", "character-counter-status": !1, "label-status": !1, "placeholder-text": t.trans(`${t.KEY}.search`), "tooltip-status": !1, value: t.search }, on: { input: function(e) {
|
|
7
|
+
t.search = e;
|
|
8
|
+
} } }) : s._e(), t.store.listStatus === "loading" || t.store.listStatus === "idle" ? i("div", { staticClass: "guido-display-condition-select__list", attrs: { "data-testid": "display-condition-loading" } }, s._l(t.SKELETON_HEIGHTS, function(e, n) {
|
|
9
|
+
return i(t.InSkeleton, { key: n, attrs: { sizing: { width: 856, height: e } } });
|
|
10
|
+
}), 1) : t.store.listStatus === "error" ? i(t.InNoData, { attrs: { id: "guido__display-condition-error", "button-status": "", icon: "no-data", "button-text": t.trans(`${t.KEY}.retry`), description: t.trans(`${t.KEY}.error-load`), title: t.trans(`${t.KEY}.error-load-title`) }, on: { click: t.loadList } }) : t.store.list.length ? t.filteredList.length ? i("ul", { staticClass: "guido-display-condition-select__list" }, s._l(t.filteredList, function(e) {
|
|
11
|
+
return i("li", { key: e.id, staticClass: "guido-display-condition-card", attrs: { "data-condition-id": e.id } }, [i("div", { staticClass: "guido-display-condition-card__header" }, [i("div", { staticClass: "guido-display-condition-card__text" }, [i("p", { staticClass: "guido-display-condition-card__name" }, [s._v(" " + s._s(e.name) + " ")]), e.description ? i("p", { staticClass: "guido-display-condition-card__description" }, [s._v(" " + s._s(e.description) + " ")]) : s._e()]), i("div", { staticClass: "guido-display-condition-card__actions" }, [i("div", { staticClass: "guido-display-condition-card__split" }, [i(t.InButtonV2, { attrs: { id: `guido__display-condition-select-${e.id}`, type: "subtle-primary", "label-text": t.trans(`${t.KEY}.select`) }, on: { click: function(n) {
|
|
12
|
+
return t.select(e);
|
|
13
|
+
} } }), i(t.InButtonV2, { attrs: { id: `guido__display-condition-menu-${e.id}`, "left-icon": "filled-dropdown-down", type: "subtle-primary", "label-text-status": !1 }, on: { click: function(n) {
|
|
14
|
+
return t.toggleMenu(e);
|
|
15
|
+
} } }), t.menuId === e.id ? i("div", { staticClass: "guido-display-condition-card__menu" }, [i("button", { staticClass: "guido-display-condition-card__menu-item", attrs: { id: `guido__display-condition-delete-${e.id}`, type: "button" }, on: { click: function(n) {
|
|
16
|
+
return t.requestDelete(e);
|
|
17
|
+
} } }, [s._v(" " + s._s(t.trans(`${t.KEY}.delete`)) + " ")])]) : s._e()], 1), i("span", { staticClass: "guido-display-condition-card__divider" }), i("button", { staticClass: "guido-display-condition-card__expand", attrs: { id: `guido__display-condition-expand-${e.id}`, type: "button", "aria-expanded": t.expandedId === e.id ? "true" : "false", "aria-label": t.trans(`${t.KEY}.preview`) }, on: { click: function(n) {
|
|
18
|
+
return t.toggleExpanded(e);
|
|
19
|
+
} } }, [i(t.InIcons, { attrs: { name: t.expandedId === e.id ? "filled-dropdown-up" : "filled-dropdown-down" } })], 1)])]), t.expandedId === e.id ? i("pre", { staticClass: "guido-display-condition-card__code" }, [s._v(s._s(t.codeOf(e)))]) : s._e()]);
|
|
20
|
+
}), 0) : i(t.InNoData, { attrs: { id: "guido__display-condition-no-result", icon: "no-data", title: t.trans(`${t.KEY}.no-result`) } }) : i(t.InNoData, { attrs: { id: "guido__display-condition-empty", "button-status": "", icon: "no-personalization", "button-text": t.trans(`${t.KEY}.create-new`), description: t.trans(`${t.KEY}.empty-description`), title: t.trans(`${t.KEY}.empty-title`) }, on: { click: function(e) {
|
|
21
|
+
return t.store.openCreate();
|
|
22
|
+
} } })], 1)]), t.store.pendingDelete ? i("div", { staticClass: "guido-display-condition-select__delete-modal" }, [i(t.WpModal, { attrs: { id: "guido__display-condition-delete-modal", size: "X-small", state: "danger", "close-on-outside-click": !1, "footer-button-options": t.deleteModalButtons, title: t.trans(`${t.KEY}.delete-confirm-title`) }, on: { close: t.closeDeleteModal, "primary-action": t.confirmDelete } }, [i("p", { staticClass: "guido-display-condition-select__delete-text" }, [s._v(" " + s._s(t.trans(`${t.KEY}.delete-confirm-description`, { name: t.store.pendingDelete.name })) + " ")])])], 1) : s._e()], 1);
|
|
23
|
+
}, l = [], c = /* @__PURE__ */ o(
|
|
24
|
+
a,
|
|
25
|
+
d,
|
|
26
|
+
l,
|
|
27
|
+
!1,
|
|
28
|
+
null,
|
|
29
|
+
"10ac7a13"
|
|
30
|
+
);
|
|
31
|
+
const y = c.exports;
|
|
32
|
+
export {
|
|
33
|
+
y as default
|
|
34
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent as _, ref as i, watch as S, computed as c } from "vue";
|
|
2
|
+
import B from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import L from "../../wrappers/WpModal.vue.js";
|
|
4
|
+
import { useDisplayConditions as x } from "../../../composables/useDisplayConditions.js";
|
|
5
|
+
import { useTranslations as O } from "../../../composables/useTranslations.js";
|
|
6
|
+
import { ACADEMY_LINKS as T } from "../../../enums/academy.js";
|
|
7
|
+
import { useDisplayConditionStore as $ } from "../../../stores/display-condition.js";
|
|
8
|
+
import { InSkeleton as C, InNoData as E, InIcons as M, InButtonV2 as b, InBasicTextInput as k } from "@useinsider/design-system-vue";
|
|
9
|
+
const J = /* @__PURE__ */ _({
|
|
10
|
+
__name: "DisplayConditionSelectDrawer",
|
|
11
|
+
setup(h) {
|
|
12
|
+
const o = "email-editor.display-conditions", m = [40, 76, 76, 76], l = O(), t = $(), { loadList: d, select: f, deleteSaved: u, cancel: g } = x(), r = i(""), s = i(null), a = i(null), n = i(!1);
|
|
13
|
+
S(() => t.isSelectOpen, (e) => {
|
|
14
|
+
e && (r.value = "", s.value = null, a.value = null, d());
|
|
15
|
+
}, { immediate: !0 });
|
|
16
|
+
const D = c(() => {
|
|
17
|
+
const e = r.value.trim().toLocaleLowerCase();
|
|
18
|
+
return e ? t.list.filter((p) => `${p.name} ${p.description}`.toLocaleLowerCase().includes(e)) : t.list;
|
|
19
|
+
}), v = c(() => l(`${o}.select-description`, {
|
|
20
|
+
academyLink: `<a href="${T.EMAIL_DISPLAY_CONDITIONS}" class="guido-display-condition-academy" target="_blank">${l(`${o}.academy`)}</a>`
|
|
21
|
+
})), y = c(() => ({
|
|
22
|
+
cancelOrBackButton: {
|
|
23
|
+
styling: "ghost",
|
|
24
|
+
type: "secondary",
|
|
25
|
+
labelText: l(`${o}.back`),
|
|
26
|
+
leftIcon: "line-arrow-left"
|
|
27
|
+
}
|
|
28
|
+
})), I = c(() => ({
|
|
29
|
+
cancelOrBackButton: {
|
|
30
|
+
type: "secondary",
|
|
31
|
+
styling: "ghost",
|
|
32
|
+
labelText: l(`${o}.cancel`),
|
|
33
|
+
disabledStatus: n.value
|
|
34
|
+
},
|
|
35
|
+
primaryButton: {
|
|
36
|
+
type: "danger",
|
|
37
|
+
labelText: l(`${o}.delete`),
|
|
38
|
+
loadingStatus: n.value
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
return { __sfc: !0, KEY: o, SKELETON_HEIGHTS: m, trans: l, store: t, loadList: d, select: f, deleteSaved: u, cancel: g, search: r, expandedId: s, menuId: a, isDeleting: n, filteredList: D, descriptionText: v, footerButtonGroupOptions: y, deleteModalButtons: I, toggleExpanded: (e) => {
|
|
42
|
+
s.value = s.value === e.id ? null : e.id;
|
|
43
|
+
}, toggleMenu: (e) => {
|
|
44
|
+
a.value = a.value === e.id ? null : e.id;
|
|
45
|
+
}, requestDelete: (e) => {
|
|
46
|
+
a.value = null, t.pendingDelete = e;
|
|
47
|
+
}, confirmDelete: async () => {
|
|
48
|
+
!t.pendingDelete || n.value || (n.value = !0, await u(t.pendingDelete), n.value = !1);
|
|
49
|
+
}, closeDeleteModal: () => {
|
|
50
|
+
n.value || (t.pendingDelete = null);
|
|
51
|
+
}, codeOf: (e) => [e.codeBefore, e.codeAfter].filter(Boolean).join(`
|
|
52
|
+
`), WpDrawer: B, WpModal: L, InBasicTextInput: k, InButtonV2: b, InIcons: M, InNoData: E, InSkeleton: C };
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
J as default
|
|
57
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import e from "./DisplayConditionsHost.vue2.js";
|
|
2
|
+
import n from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var r = function() {
|
|
4
|
+
var s = this, o = s._self._c, t = s._self._setupProxy;
|
|
5
|
+
return o("div", { staticClass: "guido-display-conditions-host" }, [o(t.DisplayConditionCreateDrawer), o(t.DisplayConditionSelectDrawer)], 1);
|
|
6
|
+
}, i = [], a = /* @__PURE__ */ n(
|
|
7
|
+
e,
|
|
8
|
+
r,
|
|
9
|
+
i,
|
|
10
|
+
!1,
|
|
11
|
+
null,
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
const p = a.exports;
|
|
15
|
+
export {
|
|
16
|
+
p as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineComponent as i, onMounted as s, onBeforeUnmount as m } from "vue";
|
|
2
|
+
import { useDisplayConditions as p } from "../../../composables/useDisplayConditions.js";
|
|
3
|
+
import { DisplayConditionEvent as n } from "../../../enums/display-condition.js";
|
|
4
|
+
import { useDisplayConditionStore as a } from "../../../stores/display-condition.js";
|
|
5
|
+
import d from "./DisplayConditionCreateDrawer.vue.js";
|
|
6
|
+
import f from "./DisplayConditionSelectDrawer.vue.js";
|
|
7
|
+
const E = /* @__PURE__ */ i({
|
|
8
|
+
__name: "DisplayConditionsHost",
|
|
9
|
+
setup(l) {
|
|
10
|
+
const o = a(), { handleOpen: t } = p(), e = (r) => {
|
|
11
|
+
t(r.detail);
|
|
12
|
+
};
|
|
13
|
+
return s(() => {
|
|
14
|
+
o.$reset(), document.addEventListener(n.OPEN, e);
|
|
15
|
+
}), m(() => {
|
|
16
|
+
document.removeEventListener(n.OPEN, e), o.$reset();
|
|
17
|
+
}), { __sfc: !0, store: o, handleOpen: t, onOpen: e, DisplayConditionCreateDrawer: d, DisplayConditionSelectDrawer: f };
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
E as default
|
|
22
|
+
};
|
|
@@ -9,15 +9,15 @@ var u = function() {
|
|
|
9
9
|
} } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
|
|
10
10
|
return t.executeSave(!1);
|
|
11
11
|
} } })], 1);
|
|
12
|
-
},
|
|
12
|
+
}, p = [], c = /* @__PURE__ */ d(
|
|
13
13
|
l,
|
|
14
14
|
u,
|
|
15
|
-
|
|
15
|
+
p,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"baf7a5dd"
|
|
19
19
|
);
|
|
20
|
-
const v =
|
|
20
|
+
const v = c.exports;
|
|
21
21
|
export {
|
|
22
22
|
v as default
|
|
23
23
|
};
|
|
@@ -1,83 +1,85 @@
|
|
|
1
|
-
import { defineComponent as I, computed as
|
|
1
|
+
import { defineComponent as I, computed as u, ref as c } from "vue";
|
|
2
2
|
import { useActionsApi as P } from "../../../composables/useActionsApi.js";
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useExport as
|
|
5
|
-
import { useTestEmailClick as
|
|
6
|
-
import { useHtmlCompiler as
|
|
7
|
-
import { useSave as
|
|
8
|
-
import { useSaveValidation as
|
|
9
|
-
import { useSaveValidationRollout as
|
|
10
|
-
import { useToaster as
|
|
3
|
+
import { useConfig as j } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as G } from "../../../composables/useExport.js";
|
|
5
|
+
import { useTestEmailClick as J } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useHtmlCompiler as K } from "../../../composables/useHtmlCompiler.js";
|
|
7
|
+
import { useSave as N } from "../../../composables/useSave.js";
|
|
8
|
+
import { useSaveValidation as Q } from "../../../composables/useSaveValidation.js";
|
|
9
|
+
import { useSaveValidationRollout as U } from "../../../composables/useSaveValidationRollout.js";
|
|
10
|
+
import { useToaster as W } from "../../../composables/useToaster.js";
|
|
11
11
|
import { useTranslations as X } from "../../../composables/useTranslations.js";
|
|
12
12
|
import { useVersionHistoryApi as Y } from "../../../composables/useVersionHistoryApi.js";
|
|
13
13
|
import { useLiquidValidator as Z } from "../../../composables/validators/useLiquidValidator.js";
|
|
14
14
|
import { ToasterTypeOptions as $ } from "../../../enums/toaster.js";
|
|
15
|
-
import {
|
|
16
|
-
import { useEditorStore as ot } from "../../../stores/editor.js";
|
|
15
|
+
import { useEditorStore as tt } from "../../../stores/editor.js";
|
|
17
16
|
import { useSaveValidationStore as et } from "../../../stores/save-validation.js";
|
|
18
|
-
import { useTemplateStore as
|
|
19
|
-
import { getTooltipOptions as
|
|
20
|
-
import { InButtonV2 as
|
|
21
|
-
import { storeToRefs as
|
|
22
|
-
import
|
|
23
|
-
const
|
|
17
|
+
import { useTemplateStore as ot } from "../../../stores/template.js";
|
|
18
|
+
import { getTooltipOptions as rt } from "../../../utils/tooltipUtils.js";
|
|
19
|
+
import { InButtonV2 as it } from "@useinsider/design-system-vue";
|
|
20
|
+
import { storeToRefs as st } from "pinia";
|
|
21
|
+
import at from "./MigrationConfirmModal.vue.js";
|
|
22
|
+
const Ot = /* @__PURE__ */ I({
|
|
24
23
|
__name: "EditorActions",
|
|
25
|
-
setup(
|
|
26
|
-
const { config: p, isFeatureEnabled: f } =
|
|
27
|
-
if (
|
|
28
|
-
|
|
24
|
+
setup(nt, { expose: b }) {
|
|
25
|
+
const { config: p, isFeatureEnabled: f } = j(), { exportHtml: d } = G(), { save: v } = N(), { validateCurrentTemplate: y } = Q(), { isEnabled: s } = U(), { showToaster: S, hideToaster: g, handleError: i } = W(), { openVersionHistory: h, closeVersionHistory: T } = Y(), { getCompiledEmail: V } = P(), { compileHtml: E } = K(), { validateLiquidSyntax: H } = Z(), e = tt(), w = et(), x = ot(), { hasMigrations: C } = st(x), r = X(), k = u(() => s.value ? r("email-editor.save-and-continue") : "Save"), a = c(!1), n = c(!1), _ = c(), l = J(), q = () => {
|
|
26
|
+
if (e.isVersionHistoryOpen) {
|
|
27
|
+
T();
|
|
29
28
|
return;
|
|
30
29
|
}
|
|
31
|
-
|
|
30
|
+
h();
|
|
32
31
|
}, B = async () => {
|
|
33
32
|
a.value = !0, await d(), a.value = !1;
|
|
34
33
|
}, L = () => {
|
|
35
|
-
|
|
36
|
-
}, R =
|
|
34
|
+
e.isSaveAsTemplateDrawerOpen = !0;
|
|
35
|
+
}, R = u(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), D = u(
|
|
37
36
|
() => {
|
|
38
|
-
var t,
|
|
39
|
-
return ((
|
|
37
|
+
var t, o;
|
|
38
|
+
return ((o = (t = p.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
40
39
|
}
|
|
41
40
|
), A = async (t) => {
|
|
42
|
-
n.value = !0, t || (
|
|
43
|
-
let
|
|
41
|
+
n.value = !0, t || (e.loadingStatus = !0);
|
|
42
|
+
let o;
|
|
44
43
|
try {
|
|
45
|
-
|
|
46
|
-
} catch (
|
|
47
|
-
|
|
44
|
+
o = await v(t);
|
|
45
|
+
} catch (M) {
|
|
46
|
+
i(M, "Failed to save template");
|
|
48
47
|
} finally {
|
|
49
|
-
n.value = !1, !t && !
|
|
48
|
+
n.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
50
49
|
}
|
|
51
|
-
return
|
|
50
|
+
return o;
|
|
52
51
|
}, O = (t) => {
|
|
53
|
-
var
|
|
52
|
+
var o;
|
|
54
53
|
if (!t && C.value) {
|
|
55
|
-
(
|
|
54
|
+
(o = _.value) == null || o.open();
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
58
57
|
return A(t);
|
|
59
58
|
}, m = async () => {
|
|
60
|
-
|
|
59
|
+
e.loadingStatus = !0;
|
|
61
60
|
try {
|
|
62
61
|
return await y();
|
|
63
62
|
} catch (t) {
|
|
64
|
-
return
|
|
63
|
+
return i(t, "Failed to prepare test email"), null;
|
|
65
64
|
} finally {
|
|
66
|
-
|
|
65
|
+
e.loadingStatus = !1;
|
|
67
66
|
}
|
|
68
|
-
},
|
|
67
|
+
}, F = async () => {
|
|
69
68
|
const t = await m();
|
|
70
|
-
t.length
|
|
69
|
+
t != null && t.length ? w.open(t, "test") : t && g();
|
|
71
70
|
}, z = async () => {
|
|
72
|
-
if (
|
|
73
|
-
|
|
71
|
+
if (s.value) {
|
|
72
|
+
const t = await m();
|
|
73
|
+
if (!t)
|
|
74
|
+
return;
|
|
75
|
+
if (t.length) {
|
|
74
76
|
S({
|
|
75
77
|
type: $.Error,
|
|
76
78
|
message: r("email-editor.validation-errors-found"),
|
|
77
79
|
actionButton: {
|
|
78
80
|
text: r("email-editor.check-errors"),
|
|
79
81
|
onClick: () => {
|
|
80
|
-
|
|
82
|
+
F();
|
|
81
83
|
}
|
|
82
84
|
},
|
|
83
85
|
autoHide: !1
|
|
@@ -88,25 +90,25 @@ const bt = /* @__PURE__ */ I({
|
|
|
88
90
|
return;
|
|
89
91
|
}
|
|
90
92
|
if (f("liquidSyntax")) {
|
|
91
|
-
|
|
93
|
+
e.loadingStatus = !0;
|
|
92
94
|
try {
|
|
93
|
-
const { html: t } = await
|
|
94
|
-
if (!await
|
|
95
|
+
const { html: t } = await V({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = E(t);
|
|
96
|
+
if (!await H(o))
|
|
95
97
|
return;
|
|
96
98
|
} catch (t) {
|
|
97
|
-
|
|
99
|
+
i(t, "Failed to prepare test email");
|
|
98
100
|
return;
|
|
99
101
|
} finally {
|
|
100
|
-
|
|
102
|
+
e.loadingStatus = !1;
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
l();
|
|
104
106
|
};
|
|
105
|
-
return
|
|
107
|
+
return b({
|
|
106
108
|
handleSave: O
|
|
107
|
-
}), { __sfc: !0, config: p, isFeatureEnabled: f, exportHtml: d, save: v, validateCurrentTemplate: y, isEnabled:
|
|
109
|
+
}), { __sfc: !0, config: p, isFeatureEnabled: f, exportHtml: d, save: v, validateCurrentTemplate: y, isEnabled: s, showToaster: S, hideToaster: g, handleError: i, openVersionHistory: h, closeVersionHistory: T, getCompiledEmail: V, compileHtml: E, validateLiquidSyntax: H, editorStore: e, saveValidationStore: w, templateStore: x, hasMigrations: C, trans: r, saveLabel: k, isExporting: a, isSaving: n, migrationModalRef: _, testEmailClick: l, handleVersionHistory: q, handleExport: B, handleSaveAs: L, versionHistoryTooltipText: R, isVersionHistoryButtonVisible: D, executeSave: A, handleSave: O, collectTestErrors: m, openTestErrors: F, handleTestEmail: z, getTooltipOptions: rt, InButtonV2: it, MigrationConfirmModal: at };
|
|
108
110
|
}
|
|
109
111
|
});
|
|
110
112
|
export {
|
|
111
|
-
|
|
113
|
+
Ot as default
|
|
112
114
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as c, ref as f, computed as s } from "vue";
|
|
2
|
+
import v from "../../wrappers/WpDrawer.vue.js";
|
|
3
3
|
import { useSave as S } from "../../../composables/useSave.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
4
|
+
import { useToaster as g } from "../../../composables/useToaster.js";
|
|
5
|
+
import { useTranslations as y } from "../../../composables/useTranslations.js";
|
|
6
|
+
import { useConfigStore as h } from "../../../stores/config.js";
|
|
7
|
+
import { useEditorStore as _ } from "../../../stores/editor.js";
|
|
8
|
+
import { useSaveValidationStore as w } from "../../../stores/save-validation.js";
|
|
9
|
+
import { escapeHtml as C } from "../../../utils/htmlEscape.js";
|
|
10
|
+
import { InIcons as E } from "@useinsider/design-system-vue";
|
|
11
|
+
const H = /* @__PURE__ */ c({
|
|
11
12
|
__name: "ValidationErrorDrawer",
|
|
12
|
-
setup(
|
|
13
|
-
const r =
|
|
13
|
+
setup(T) {
|
|
14
|
+
const r = y(), e = w(), a = _(), n = h(), { saveWithErrors: i } = S(), { handleError: l } = g(), o = f(!1), m = s(() => {
|
|
14
15
|
const t = {
|
|
15
16
|
primaryButton: {
|
|
16
17
|
styling: "solid",
|
|
@@ -18,32 +19,32 @@ const V = /* @__PURE__ */ p({
|
|
|
18
19
|
labelText: r("email-editor.update-design")
|
|
19
20
|
}
|
|
20
21
|
};
|
|
21
|
-
return
|
|
22
|
+
return n.allowSaveWithErrors && e.intent !== "test" && (t.secondaryButton = {
|
|
22
23
|
styling: "solid",
|
|
23
24
|
type: "subtle-primary",
|
|
24
25
|
labelText: r("email-editor.save-and-continue"),
|
|
25
26
|
loadingStatus: o.value
|
|
26
27
|
}), t;
|
|
27
|
-
}),
|
|
28
|
-
const
|
|
29
|
-
return `${t.message}${
|
|
30
|
-
}));
|
|
31
|
-
return { __sfc: !0, trans: r, store: e, editorStore:
|
|
28
|
+
}), u = s(() => e.errors.map((t) => {
|
|
29
|
+
const p = t.detail ? ` (${C(t.detail)})` : "";
|
|
30
|
+
return `${t.message}${p}`;
|
|
31
|
+
})), d = s(() => `${r("email-editor.validation-errors")} (${u.value.length})`);
|
|
32
|
+
return { __sfc: !0, trans: r, store: e, editorStore: a, configStore: n, saveWithErrors: i, handleError: l, isSaving: o, footerButtonGroupOptions: m, rows: u, titleText: d, handleClose: () => {
|
|
32
33
|
e.isDrawerOpen && e.close();
|
|
33
34
|
}, handleSaveAndContinue: async () => {
|
|
34
35
|
if (!o.value) {
|
|
35
|
-
o.value = !0,
|
|
36
|
+
o.value = !0, a.loadingStatus = !0;
|
|
36
37
|
try {
|
|
37
|
-
await i() ? e.close() :
|
|
38
|
+
await i() ? e.close() : a.loadingStatus = !1;
|
|
38
39
|
} catch (t) {
|
|
39
|
-
|
|
40
|
+
l(t, "Failed to save template"), a.loadingStatus = !1;
|
|
40
41
|
} finally {
|
|
41
42
|
o.value = !1;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
}, WpDrawer:
|
|
45
|
+
}, WpDrawer: v, InIcons: E };
|
|
45
46
|
}
|
|
46
47
|
});
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
+
H as default
|
|
49
50
|
};
|