@useinsider/guido 3.17.0-beta.77567eb → 3.17.0-beta.7c9fc24

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.
Files changed (123) hide show
  1. package/README.md +2 -0
  2. package/dist/@types/config/schemas.js +33 -30
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +85 -77
  5. package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  9. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  10. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  11. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  12. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  13. package/dist/components/organisms/header/EditorActions.vue2.js +74 -43
  14. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
  16. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
  17. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +48 -0
  18. package/dist/components/wrappers/WpDrawer.vue.js +9 -7
  19. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  20. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  21. package/dist/composables/useHtmlCompiler.js +37 -26
  22. package/dist/composables/useHtmlValidator.js +2 -0
  23. package/dist/composables/useRecommendation.js +41 -34
  24. package/dist/composables/useSave.js +84 -41
  25. package/dist/composables/useSaveValidation.js +279 -0
  26. package/dist/composables/useSaveValidationRollout.js +9 -0
  27. package/dist/composables/useStripo.js +14 -14
  28. package/dist/composables/validators/useCouponBlockValidator.js +24 -21
  29. package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
  30. package/dist/config/i18n/en/labels.json.js +1 -1
  31. package/dist/config/migrator/index.js +9 -8
  32. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  33. package/dist/config/migrator/recommendation/extractors.js +29 -24
  34. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  35. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  36. package/dist/config/migrator/recommendationMigrator.js +31 -25
  37. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  38. package/dist/enums/academy.js +2 -1
  39. package/dist/enums/date.js +5 -3
  40. package/dist/enums/extensions/recommendationBlock.js +3 -1
  41. package/dist/enums/save-validation.js +4 -0
  42. package/dist/extensions/Blocks/Recommendation/block.js +35 -29
  43. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  44. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  45. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
  46. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  47. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
  48. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +241 -180
  49. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  50. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  51. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  52. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  53. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  54. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  55. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +182 -79
  56. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  57. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  58. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  59. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  60. package/dist/extensions/Blocks/common-control.js +22 -19
  61. package/dist/guido.css +1 -1
  62. package/dist/package.json.js +1 -1
  63. package/dist/services/recommendationApi.js +69 -30
  64. package/dist/src/@types/config/schemas.d.ts +6 -0
  65. package/dist/src/@types/save-validation.d.ts +19 -0
  66. package/dist/src/components/Guido.vue.d.ts +17 -1
  67. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  68. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  69. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  70. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
  71. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
  72. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
  73. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
  74. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
  75. package/dist/src/composables/useConfig.d.ts +4 -0
  76. package/dist/src/composables/useHtmlValidator.d.ts +21 -0
  77. package/dist/src/composables/useRecommendation.d.ts +1 -0
  78. package/dist/src/composables/useSave.d.ts +6 -1
  79. package/dist/src/composables/useSaveValidation.d.ts +6 -0
  80. package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
  81. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  82. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
  83. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  84. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  85. package/dist/src/enums/academy.d.ts +1 -0
  86. package/dist/src/enums/date.d.ts +1 -0
  87. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  88. package/dist/src/enums/save-validation.d.ts +27 -0
  89. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  90. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  91. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
  92. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  93. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  94. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  95. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  96. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
  97. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  98. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  99. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  100. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  101. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +181 -10
  102. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  103. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  104. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  105. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  106. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  107. package/dist/src/services/recommendationApi.d.ts +4 -1
  108. package/dist/src/stores/config.d.ts +48 -0
  109. package/dist/src/stores/save-as-template.d.ts +4 -3
  110. package/dist/src/stores/save-validation.d.ts +22 -0
  111. package/dist/src/utils/genericUtil.d.ts +5 -0
  112. package/dist/src/utils/templatePreparation.d.ts +30 -0
  113. package/dist/static/assets/icons/line-change.svg.js +5 -0
  114. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  115. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  116. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  117. package/dist/static/styles/customEditorStyle.css.js +3 -1
  118. package/dist/stores/config.js +39 -22
  119. package/dist/stores/save-validation.js +30 -0
  120. package/dist/utils/dateUtil.js +23 -10
  121. package/dist/utils/genericUtil.js +28 -27
  122. package/dist/utils/templatePreparation.js +46 -42
  123. package/package.json +3 -2
@@ -0,0 +1,17 @@
1
+ import s from "./RemoveStrategyModal.vue2.js";
2
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var a = function() {
4
+ var t = this, o = t._self._c, e = t._self._setupProxy;
5
+ return e.store.removeStrategyModalStatus ? o(e.WpModal, { attrs: { id: "guido__remove-strategy-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.remove-strategy-confirm-title") }, on: { close: e.close, "primary-action": e.handleConfirm, "secondary-action": e.close } }, [o("p", [t._v(t._s(e.messageParts[0])), o("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])]) : t._e();
6
+ }, n = [], _ = /* @__PURE__ */ r(
7
+ s,
8
+ a,
9
+ n,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = _.exports;
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,57 @@
1
+ import { defineComponent as u, computed as n } from "vue";
2
+ import y from "../../../wrappers/WpModal.vue.js";
3
+ import { useToaster as f } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as _ } from "../../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as v } from "../../../../enums/toaster.js";
6
+ import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { commitBlockChangeOutsidePanel as h } from "../../../../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
8
+ import { escapeHtml as R } from "../../../../utils/htmlEscape.js";
9
+ const P = /* @__PURE__ */ u({
10
+ __name: "RemoveStrategyModal",
11
+ setup(S) {
12
+ const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
13
+ cancelOrBackButton: {
14
+ type: "secondary",
15
+ labelText: t("products.cancel"),
16
+ styling: "ghost"
17
+ },
18
+ primaryButton: {
19
+ type: "danger",
20
+ labelText: t("discovery-strategy.remove")
21
+ }
22
+ })), m = n(() => {
23
+ var o;
24
+ const { strategyId: r } = e.recommendationConfigs;
25
+ return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${r}`;
26
+ }), s = "__STRATEGY_NAME__", d = n(() => t("email-editor.remove-strategy-confirm-message", { strategyName: s }).split(s)), c = () => {
27
+ e.closeRemoveStrategyModal();
28
+ };
29
+ return { __sfc: !0, trans: t, store: e, showToaster: a, footerButtonOptions: i, strategyName: m, NAME_TOKEN: s, messageParts: d, close: c, handleConfirm: async () => {
30
+ const r = m.value, o = e.currentRecommendationId;
31
+ e.removeStrategy(), c();
32
+ const { strategyId: l, size: g } = e.recommendationConfigs;
33
+ if (a({
34
+ type: v.Success,
35
+ // The toast renders through a sanitizing v-html, so the name is escaped first.
36
+ message: t("email-editor.strategy-removed-success", {
37
+ strategyName: `<b>${R(r)}</b>`
38
+ })
39
+ }), o !== null) {
40
+ try {
41
+ await e.fetchRecommendationProducts();
42
+ } catch (p) {
43
+ console.error("[RemoveStrategyModal] product refetch failed", p);
44
+ }
45
+ h(
46
+ o,
47
+ { strategyId: l, size: g },
48
+ e.recommendationProducts,
49
+ "Removed recommendation strategy"
50
+ );
51
+ }
52
+ }, WpModal: y };
53
+ }
54
+ });
55
+ export {
56
+ P as default
57
+ };
@@ -0,0 +1,19 @@
1
+ import r from "./StrategyInfoBoxContent.vue2.js";
2
+ import _ from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var c = function() {
4
+ var t = this, s = t._self._c, n = t._self._setupProxy;
5
+ return s("div", { staticClass: "d-f f-d-c mt-3" }, t._l(n.details, function(e, a) {
6
+ return s("div", { key: e.title, staticClass: "d-f f-d-c", class: { "mt-2": a > 0 } }, [s("span", { staticClass: "f-s-1 f-w-600 l-h-1 t-c-52 mb-12" }, [t._v(t._s(e.title))]), s("span", { staticClass: "f-s-1 l-h-6 t-c-55 w-b-b-w" }, [t._v(t._s(e.value))])]);
7
+ }), 0);
8
+ }, f = [], l = /* @__PURE__ */ _(
9
+ r,
10
+ c,
11
+ f,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const p = l.exports;
17
+ export {
18
+ p as default
19
+ };
@@ -0,0 +1,63 @@
1
+ import { defineComponent as f, computed as i } from "vue";
2
+ import { useTranslations as _ } from "../../../../composables/useTranslations.js";
3
+ import { asText as c } from "../../../../utils/genericUtil.js";
4
+ const j = /* @__PURE__ */ f({
5
+ __name: "StrategyInfoBoxContent",
6
+ props: {
7
+ strategy: null
8
+ },
9
+ setup(p) {
10
+ const a = p, n = _(), s = i(() => n("recommendation-strategy.none")), u = i(() => {
11
+ const e = c(a.strategy.algorithm) === "MIXED" ? n("discovery-strategy.mixed-algorithm") : n("discovery-strategy.single-algorithm"), t = c(a.strategy.algorithm_used).split(",").map((r) => r.trim()).filter(Boolean).map((r) => n(`recommendation-algorithm-names.${r.replaceAll("_", "-").toLowerCase()}`));
12
+ return t.length ? `${e} · ${t.join(", ")}` : e;
13
+ }), d = i(() => [
14
+ [a.strategy.exclude_view, "discovery-strategy.exclude-recently-view-items"],
15
+ [a.strategy.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
16
+ [a.strategy.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
17
+ ].filter(([e]) => Number(e) === 1).map(([, e]) => n(e)).join(", ") || s.value), l = (e) => {
18
+ const t = c(e).trim();
19
+ if (!t)
20
+ return "";
21
+ let r;
22
+ try {
23
+ r = JSON.parse(t);
24
+ } catch {
25
+ return t;
26
+ }
27
+ if (Array.isArray(r))
28
+ return r.length ? String(r.length) : "";
29
+ if (r && typeof r == "object") {
30
+ const o = Object.keys(r).length;
31
+ return o ? String(o) : "";
32
+ }
33
+ return t;
34
+ }, m = i(() => l(a.strategy.manual_merchandising) || l(a.strategy.manual_merchandising_products) || s.value), g = (e) => {
35
+ if (Array.isArray(e))
36
+ return e.length;
37
+ const { conditionList: t } = e ?? {};
38
+ return Array.isArray(t) ? t.length : 1;
39
+ }, y = i(() => {
40
+ const e = a.strategy.filters;
41
+ if (!e)
42
+ return s.value;
43
+ try {
44
+ const t = typeof e == "string" ? JSON.parse(e) : e;
45
+ if (!t || typeof t != "object")
46
+ return s.value;
47
+ const r = Object.values(t).reduce((o, v) => o + g(v), 0);
48
+ return r ? String(r) : s.value;
49
+ } catch {
50
+ return s.value;
51
+ }
52
+ }), h = i(() => [
53
+ { title: n("gpt-app-builder.algorithms-and-method"), value: u.value },
54
+ { title: n("gpt-app-builder.exclusions"), value: d.value },
55
+ { title: n("discovery-strategy.filters"), value: y.value },
56
+ { title: n("action-builder.manual-merchandising"), value: m.value }
57
+ ]);
58
+ return { __sfc: !0, props: a, trans: n, none: s, algorithmsAndMethod: u, exclusions: d, asMerchandising: l, manualMerchandising: m, conditionsIn: g, filters: y, details: h };
59
+ }
60
+ });
61
+ export {
62
+ j as default
63
+ };
@@ -4,7 +4,7 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var u = function() {
5
5
  var s, i, n, a;
6
6
  var o = this, e = o._self._c, t = o._self._setupProxy;
7
- return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
7
+ return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "label-text": t.saveLabel, "loading-status": t.isSaving }, on: { click: function(r) {
8
8
  return t.handleSave(!1);
9
9
  } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
10
10
  return t.executeSave(!1);
@@ -15,7 +15,7 @@ var u = function() {
15
15
  p,
16
16
  !1,
17
17
  null,
18
- "6e711fd7"
18
+ "eedf7416"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {
@@ -1,66 +1,97 @@
1
- import { defineComponent as O, ref as n, computed as h } from "vue";
2
- import { useActionsApi as q } from "../../../composables/useActionsApi.js";
3
- import { useConfig as b } from "../../../composables/useConfig.js";
4
- import { useExport as k } from "../../../composables/useExport.js";
5
- import { useTestEmailClick as B } from "../../../composables/useGuidoActions.js";
6
- import { useHtmlCompiler as D } from "../../../composables/useHtmlCompiler.js";
7
- import { useSave as F } from "../../../composables/useSave.js";
8
- import { useTranslations as L } from "../../../composables/useTranslations.js";
9
- import { useVersionHistoryApi as R } from "../../../composables/useVersionHistoryApi.js";
10
- import { useLiquidValidator as z } from "../../../composables/validators/useLiquidValidator.js";
11
- import { useEditorStore as I } from "../../../stores/editor.js";
12
- import { useTemplateStore as P } from "../../../stores/template.js";
13
- import { getTooltipOptions as j } from "../../../utils/tooltipUtils.js";
14
- import { InButtonV2 as G } from "@useinsider/design-system-vue";
15
- import { storeToRefs as J } from "pinia";
16
- import K from "./MigrationConfirmModal.vue.js";
17
- const ut = /* @__PURE__ */ O({
1
+ import { defineComponent as R, computed as l, ref as m } from "vue";
2
+ import { useActionsApi as D } from "../../../composables/useActionsApi.js";
3
+ import { useConfig as F } from "../../../composables/useConfig.js";
4
+ import { useExport as z } from "../../../composables/useExport.js";
5
+ import { useTestEmailClick as I } from "../../../composables/useGuidoActions.js";
6
+ import { useHtmlCompiler as P } from "../../../composables/useHtmlCompiler.js";
7
+ import { useSave as W } from "../../../composables/useSave.js";
8
+ import { useSaveValidation as j } from "../../../composables/useSaveValidation.js";
9
+ import { useSaveValidationRollout as G } from "../../../composables/useSaveValidationRollout.js";
10
+ import { useToaster as J } from "../../../composables/useToaster.js";
11
+ import { useTranslations as K } from "../../../composables/useTranslations.js";
12
+ import { useVersionHistoryApi as N } from "../../../composables/useVersionHistoryApi.js";
13
+ import { useLiquidValidator as Q } from "../../../composables/validators/useLiquidValidator.js";
14
+ import { ToasterTypeOptions as U } from "../../../enums/toaster.js";
15
+ import { useConfigStore as X } from "../../../stores/config.js";
16
+ import { useEditorStore as Y } from "../../../stores/editor.js";
17
+ import { useSaveValidationStore as Z } from "../../../stores/save-validation.js";
18
+ import { useTemplateStore as $ } from "../../../stores/template.js";
19
+ import { getTooltipOptions as tt } from "../../../utils/tooltipUtils.js";
20
+ import { InButtonV2 as ot } from "@useinsider/design-system-vue";
21
+ import { storeToRefs as et } from "pinia";
22
+ import rt from "./MigrationConfirmModal.vue.js";
23
+ const At = /* @__PURE__ */ R({
18
24
  __name: "EditorActions",
19
- setup(N, { expose: x }) {
20
- const { config: a, isFeatureEnabled: l } = b(), { exportHtml: m } = k(), { save: u } = F(), { openVersionHistory: c, closeVersionHistory: p } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations: g } = J(y), s = L(), i = n(!1), r = n(!1), S = n(), H = B(), T = () => {
25
+ setup(it, { expose: A }) {
26
+ const { config: u, isFeatureEnabled: c } = F(), { exportHtml: f } = z(), { save: p } = W(), { validateCurrentTemplate: d } = j(), { isEnabled: i } = G(), { showToaster: v } = J(), { openVersionHistory: S, closeVersionHistory: y } = N(), { getCompiledEmail: g } = D(), { compileHtml: h } = P(), { validateLiquidSyntax: V } = Q(), T = X(), e = Y(), w = Z(), H = $(), { hasMigrations: E } = et(H), r = K(), O = l(() => i.value && T.allowSaveWithErrors ? r("email-editor.save-and-continue") : "Save"), s = m(!1), a = m(!1), x = m(), n = I(), M = () => {
21
27
  if (e.isVersionHistoryOpen) {
22
- p();
28
+ y();
23
29
  return;
24
30
  }
25
- c();
26
- }, w = async () => {
27
- i.value = !0, await m(), i.value = !1;
28
- }, _ = () => {
31
+ S();
32
+ }, b = async () => {
33
+ s.value = !0, await f(), s.value = !1;
34
+ }, k = () => {
29
35
  e.isSaveAsTemplateDrawerOpen = !0;
30
- }, C = h(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), A = h(
36
+ }, q = l(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), B = l(
31
37
  () => {
32
38
  var t, o;
33
- return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
39
+ return ((o = (t = u.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
34
40
  }
35
- ), V = async (t) => {
36
- r.value = !0, t || (e.loadingStatus = !0);
37
- const o = await u(t);
38
- return r.value = !1, !t && !o && (e.loadingStatus = !1), o;
39
- }, E = (t) => {
41
+ ), C = async (t) => {
42
+ a.value = !0, t || (e.loadingStatus = !0);
43
+ const o = await p(t);
44
+ return a.value = !1, !t && !o && (e.loadingStatus = !1), o;
45
+ }, _ = (t) => {
40
46
  var o;
41
- if (!t && g.value) {
42
- (o = S.value) == null || o.open();
47
+ if (!t && E.value) {
48
+ (o = x.value) == null || o.open();
43
49
  return;
44
50
  }
45
- return V(t);
46
- }, M = async () => {
47
- if (l("liquidSyntax")) {
51
+ return C(t);
52
+ }, L = async () => {
53
+ if (i.value) {
48
54
  e.loadingStatus = !0;
55
+ let t = [];
49
56
  try {
50
- const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
51
- if (!await v(o))
57
+ t = await d();
58
+ } catch (o) {
59
+ console.warn("Test-path validation failed; sending without the drawer.", o);
60
+ } finally {
61
+ e.loadingStatus = !1;
62
+ }
63
+ if (t.length) {
64
+ v({
65
+ type: U.Error,
66
+ message: r("email-editor.validation-errors-found"),
67
+ actionButton: {
68
+ text: r("email-editor.check-errors"),
69
+ onClick: () => w.open(t, "test")
70
+ },
71
+ autoHide: !1
72
+ });
73
+ return;
74
+ }
75
+ n();
76
+ return;
77
+ }
78
+ if (c("liquidSyntax")) {
79
+ e.loadingStatus = !0;
80
+ try {
81
+ const { html: t } = await g({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = h(t);
82
+ if (!await V(o))
52
83
  return;
53
84
  } finally {
54
85
  e.loadingStatus = !1;
55
86
  }
56
87
  }
57
- H();
88
+ n();
58
89
  };
59
- return x({
60
- handleSave: E
61
- }), { __sfc: !0, config: a, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations: g, trans: s, isExporting: i, isSaving: r, migrationModalRef: S, testEmailClick: H, handleVersionHistory: T, handleExport: w, handleSaveAs: _, versionHistoryTooltipText: C, isVersionHistoryButtonVisible: A, executeSave: V, handleSave: E, handleTestEmail: M, getTooltipOptions: j, InButtonV2: G, MigrationConfirmModal: K };
90
+ return A({
91
+ handleSave: _
92
+ }), { __sfc: !0, config: u, isFeatureEnabled: c, exportHtml: f, save: p, validateCurrentTemplate: d, isEnabled: i, showToaster: v, openVersionHistory: S, closeVersionHistory: y, getCompiledEmail: g, compileHtml: h, validateLiquidSyntax: V, configStore: T, editorStore: e, saveValidationStore: w, templateStore: H, hasMigrations: E, trans: r, saveLabel: O, isExporting: s, isSaving: a, migrationModalRef: x, testEmailClick: n, handleVersionHistory: M, handleExport: b, handleSaveAs: k, versionHistoryTooltipText: q, isVersionHistoryButtonVisible: B, executeSave: C, handleSave: _, handleTestEmail: L, getTooltipOptions: tt, InButtonV2: ot, MigrationConfirmModal: rt };
62
93
  }
63
94
  });
64
95
  export {
65
- ut as default
96
+ At as default
66
97
  };
@@ -1,16 +1,16 @@
1
1
  import o from "./LeftSlot.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
3
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
5
  var e = this, s = e._self._c, t = e._self._setupProxy;
6
6
  return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { attrs: { id: "guido__back-button", "left-icon": "line-arrow-left", styling: "ghost", type: "secondary", "disabled-status": t.isBackButtonDisabled, "label-text": t.backButtonLabel, "skeleton-sizing": { width: 150, height: 26 }, "skeleton-status": t.editorStore.loadingStatus }, on: { click: t.handleBackClick } })], 1);
7
- }, i = [], r = /* @__PURE__ */ a(
7
+ }, i = [], r = /* @__PURE__ */ n(
8
8
  o,
9
- n,
9
+ a,
10
10
  i,
11
11
  !1,
12
12
  null,
13
- "73199fa4"
13
+ "b8f24f34"
14
14
  );
15
15
  const f = r.exports;
16
16
  export {
@@ -1,19 +1,19 @@
1
- import { defineComponent as l, computed as p, ref as d } from "vue";
1
+ import { defineComponent as m, computed as p, ref as d } from "vue";
2
2
  import { useConfig as k } from "../../../composables/useConfig.js";
3
3
  import { useBack as B } from "../../../composables/useGuidoActions.js";
4
4
  import { usePreviewMode as b } from "../../../composables/usePreviewMode.js";
5
5
  import { useTranslations as v } from "../../../composables/useTranslations.js";
6
6
  import { useVersionHistoryApi as _ } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as V } from "../../../stores/editor.js";
7
+ import { useEditorStore as y } from "../../../stores/editor.js";
8
8
  import { InButtonV2 as w } from "@useinsider/design-system-vue";
9
- import { useDebounceFn as y } from "../../../node_modules/@vueuse/shared/index.js";
10
- const D = /* @__PURE__ */ l({
9
+ import { useDebounceFn as V } from "../../../node_modules/@vueuse/shared/index.js";
10
+ const D = /* @__PURE__ */ m({
11
11
  __name: "LeftSlot",
12
12
  setup(C) {
13
- const e = V(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), f = p(() => {
14
- var u, m;
15
- return e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : (m = (u = t.value) == null ? void 0 : u.ui) != null && m.backButtonLabel ? t.value.ui.backButtonLabel : o("email-editor.back-to-design");
16
- }), r = d(!1), c = () => {
13
+ const e = y(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), l = p(() => {
14
+ var u, f;
15
+ return e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : (f = (u = t.value) == null ? void 0 : u.ui) != null && f.backButtonLabel ? t.value.ui.backButtonLabel : o("email-editor.back-to-design");
16
+ }), r = d(!1), a = () => {
17
17
  if (e.isVersionHistoryOpen) {
18
18
  n();
19
19
  return;
@@ -23,11 +23,15 @@ const D = /* @__PURE__ */ l({
23
23
  return;
24
24
  }
25
25
  i();
26
- }, a = y(() => {
27
- c(), r.value = !1;
26
+ }, c = V(async () => {
27
+ try {
28
+ await a();
29
+ } finally {
30
+ r.value = !1;
31
+ }
28
32
  }, 500);
29
- return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel: f, isBackButtonDisabled: r, executeBackAction: c, debouncedBackAction: a, handleBackClick: () => {
30
- r.value = !0, a();
33
+ return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel: l, isBackButtonDisabled: r, executeBackAction: a, debouncedBackAction: c, handleBackClick: () => {
34
+ r.value = !0, c();
31
35
  }, InButtonV2: w };
32
36
  }
33
37
  });
@@ -0,0 +1,20 @@
1
+ import a from "./ValidationErrorDrawer.vue2.js";
2
+ /* empty css */
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var i = function() {
5
+ var r = this, o = r._self._c, t = r._self._setupProxy;
6
+ return o(t.WpDrawer, { attrs: { id: "guido__validation-error-drawer", size: "small", "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.isDrawerOpen, "title-text": t.titleText }, on: { onCloseEvent: t.handleClose, primaryButtonEvent: t.handleClose, secondaryButtonEvent: t.handleSaveAndContinue } }, [o("div", { staticClass: "d-f f-d-c validation-error-list" }, r._l(t.rows, function(e, n) {
7
+ return o("div", { key: n, staticClass: "d-f a-i-c validation-error-row" }, [o(t.InIcons, { staticClass: "validation-error-row__icon i-c-12", attrs: { name: "filled-caution-triangle" } }), o("span", { staticClass: "validation-error-row__text" }, [r._v(r._s(e))])], 1);
8
+ }), 0)]);
9
+ }, l = [], _ = /* @__PURE__ */ s(
10
+ a,
11
+ i,
12
+ l,
13
+ !1,
14
+ null,
15
+ "30d2e1f9"
16
+ );
17
+ const p = _.exports;
18
+ export {
19
+ p as default
20
+ };
@@ -0,0 +1,48 @@
1
+ import { defineComponent as m, ref as p, computed as a } from "vue";
2
+ import f from "../../wrappers/WpDrawer.vue.js";
3
+ import { useSave as S } from "../../../composables/useSave.js";
4
+ import { useTranslations as v } from "../../../composables/useTranslations.js";
5
+ import { useConfigStore as g } from "../../../stores/config.js";
6
+ import { useEditorStore as y } from "../../../stores/editor.js";
7
+ import { useSaveValidationStore as h } from "../../../stores/save-validation.js";
8
+ import { InIcons as w } from "@useinsider/design-system-vue";
9
+ const I = /* @__PURE__ */ m({
10
+ __name: "ValidationErrorDrawer",
11
+ setup(_) {
12
+ const r = v(), e = h(), n = y(), s = g(), { saveWithErrors: i } = S(), o = p(!1), l = a(() => `${r("email-editor.validation-errors")} (${e.errorCount})`), u = a(() => {
13
+ const t = {
14
+ primaryButton: {
15
+ styling: "solid",
16
+ type: "primary",
17
+ labelText: r("email-editor.update-design")
18
+ }
19
+ };
20
+ return s.allowSaveWithErrors && e.intent !== "test" && (t.secondaryButton = {
21
+ styling: "solid",
22
+ type: "subtle-primary",
23
+ labelText: r("email-editor.save-and-continue"),
24
+ loadingStatus: o.value
25
+ }), t;
26
+ }), d = a(() => e.errors.map((t) => {
27
+ const c = t.detail ? ` (${t.detail})` : "";
28
+ return `${t.message}${c}`;
29
+ }));
30
+ return { __sfc: !0, trans: r, store: e, editorStore: n, configStore: s, saveWithErrors: i, isSaving: o, titleText: l, footerButtonGroupOptions: u, rows: d, handleClose: () => {
31
+ e.isDrawerOpen && e.close();
32
+ }, handleSaveAndContinue: async () => {
33
+ if (!o.value) {
34
+ o.value = !0, n.loadingStatus = !0;
35
+ try {
36
+ await i() ? e.close() : n.loadingStatus = !1;
37
+ } catch (t) {
38
+ console.warn("Soft-save failed; keeping the drawer open.", t), n.loadingStatus = !1;
39
+ } finally {
40
+ o.value = !1;
41
+ }
42
+ }
43
+ }, WpDrawer: f, InIcons: w };
44
+ }
45
+ });
46
+ export {
47
+ I as default
48
+ };
@@ -1,17 +1,19 @@
1
1
  import r from "./WpDrawer.vue2.js";
2
2
  import s from "../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var u = function() {
4
- var t = this, n = t._self._c, e = t._self._setupProxy;
5
- return n(e.InDrawer, { class: t.className, attrs: { id: t.id, "footer-status": "", "close-on-outside-click": t.closeOnOutsideClick, "description-status": t.descriptionStatus, "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, size: t.size, status: t.status, "title-text": t.titleText }, on: { cancelOrBackButtonEvent: function(o) {
4
+ var t = this, o = t._self._c, e = t._self._setupProxy;
5
+ return o(e.InDrawer, { class: t.className, attrs: { id: t.id, "footer-status": "", "close-on-outside-click": t.closeOnOutsideClick, "description-status": t.descriptionStatus, "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, size: t.size, status: t.status, "title-text": t.titleText }, on: { cancelOrBackButtonEvent: function(n) {
6
6
  return e.emit("cancelOrBackButtonEvent");
7
- }, onCloseEvent: function(o) {
7
+ }, onCloseEvent: function(n) {
8
8
  return e.emit("onCloseEvent");
9
- }, primaryButtonEvent: function(o) {
9
+ }, primaryButtonEvent: function(n) {
10
10
  return e.emit("primaryButtonEvent");
11
+ }, secondaryButtonEvent: function(n) {
12
+ return e.emit("secondaryButtonEvent");
11
13
  } }, scopedSlots: t._u([t.$slots.headerBottomSlot ? { key: "headerBottomSlot", fn: function() {
12
14
  return [t._t("headerBottomSlot")];
13
15
  }, proxy: !0 } : null, { key: "contentSlot", fn: function() {
14
- return [n("div", [t._t("default")], 2)];
16
+ return [o("div", [t._t("default")], 2)];
15
17
  }, proxy: !0 }], null, !0) });
16
18
  }, i = [], c = /* @__PURE__ */ s(
17
19
  r,
@@ -21,7 +23,7 @@ var u = function() {
21
23
  null,
22
24
  null
23
25
  );
24
- const f = c.exports;
26
+ const p = c.exports;
25
27
  export {
26
- f as default
28
+ p as default
27
29
  };
@@ -13,7 +13,7 @@ const r = /* @__PURE__ */ e({
13
13
  status: { type: Boolean },
14
14
  titleText: null
15
15
  },
16
- emits: ["cancelOrBackButtonEvent", "onCloseEvent", "primaryButtonEvent"],
16
+ emits: ["cancelOrBackButtonEvent", "onCloseEvent", "primaryButtonEvent", "secondaryButtonEvent"],
17
17
  setup(n, { emit: t }) {
18
18
  return { __sfc: !0, emit: t, InDrawer: o };
19
19
  }
@@ -1,53 +1,67 @@
1
- import S from "../static/styles/base.css.js";
2
- import m from "../static/styles/components/alert-message.css.js";
3
- import e from "../static/styles/components/amp-block.css.js";
4
- import i from "../static/styles/components/base-input.css.js";
5
- import p from "../static/styles/components/button-group.css.js";
6
- import n from "../static/styles/components/button.css.js";
7
- import s from "../static/styles/components/combobox.css.js";
8
- import C from "../static/styles/components/counter.css.js";
9
- import f from "../static/styles/components/dropdown-menu.css.js";
10
- import a from "../static/styles/components/loader.css.js";
11
- import u from "../static/styles/components/narrow-panel.css.js";
12
- import c from "../static/styles/components/popup.css.js";
13
- import d from "../static/styles/components/switcher.css.js";
14
- import l from "../static/styles/components/tabs.css.js";
15
- import h from "../static/styles/components/tools.css.js";
16
- import w from "../static/styles/components/version-history.css.js";
17
- import y from "../static/styles/components/wide-panel.css.js";
18
- import B from "../static/styles/variables.css.js";
19
- const b = [
20
- B,
21
- // Must be on top
22
- S,
1
+ import S from "../static/assets/icons/line-change.svg.js";
2
+ import i from "../static/assets/icons/line-delete.svg.js";
3
+ import n from "../static/assets/icons/line-plus.svg.js";
4
+ import p from "../static/styles/base.css.js";
5
+ import s from "../static/styles/components/alert-message.css.js";
6
+ import C from "../static/styles/components/amp-block.css.js";
7
+ import a from "../static/styles/components/base-input.css.js";
8
+ import f from "../static/styles/components/button-group.css.js";
9
+ import c from "../static/styles/components/button.css.js";
10
+ import u from "../static/styles/components/combobox.css.js";
11
+ import l from "../static/styles/components/counter.css.js";
12
+ import d from "../static/styles/components/dropdown-menu.css.js";
13
+ import h from "../static/styles/components/loader.css.js";
14
+ import g from "../static/styles/components/narrow-panel.css.js";
15
+ import I from "../static/styles/components/popup.css.js";
16
+ import w from "../static/styles/components/recommendation-strategy.css.js";
17
+ import y from "../static/styles/components/switcher.css.js";
18
+ import b from "../static/styles/components/tabs.css.js";
19
+ import B from "../static/styles/components/tools.css.js";
20
+ import $ from "../static/styles/components/version-history.css.js";
21
+ import P from "../static/styles/components/wide-panel.css.js";
22
+ import x from "../static/styles/variables.css.js";
23
+ function r(t, o) {
24
+ return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
25
+ }
26
+ const A = `:host {
27
+ ${r("line-change", S)}
28
+ ${r("line-delete", i)}
29
+ ${r("line-plus", n)}
30
+ }`, R = [
31
+ x,
23
32
  // Must be on top
24
- m,
25
- e,
26
- i,
33
+ A,
27
34
  p,
28
- n,
35
+ // Must be on top
29
36
  s,
30
37
  C,
31
- f,
32
38
  a,
33
- u,
39
+ f,
34
40
  c,
35
- d,
41
+ u,
36
42
  l,
43
+ d,
37
44
  h,
38
- w,
39
- y
45
+ g,
46
+ I,
47
+ y,
48
+ b,
49
+ B,
50
+ $,
51
+ P,
52
+ w
53
+ // Last: overrides button.css / wide-panel.css defaults
40
54
  ].join(`
41
55
 
42
- `), v = () => ({ importCss: () => {
56
+ `), Y = () => ({ importCss: () => {
43
57
  const o = new CSSStyleSheet();
44
- o.replaceSync(b);
45
- const r = document.querySelector("ui-editor");
46
- if (!r)
58
+ o.replaceSync(R);
59
+ const e = document.querySelector("ui-editor");
60
+ if (!e)
47
61
  return;
48
- const t = r.shadowRoot;
49
- t && (t.adoptedStyleSheets = [o]);
62
+ const m = e.shadowRoot;
63
+ m && (m.adoptedStyleSheets = [o]);
50
64
  } });
51
65
  export {
52
- v as useCustomInterfaceAppearance
66
+ Y as useCustomInterfaceAppearance
53
67
  };