@useinsider/guido 3.2.0-beta.e01b42a → 3.2.0-beta.ec6228c

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 (109) hide show
  1. package/README.md +24 -0
  2. package/dist/@types/config/schemas.js +82 -68
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +92 -81
  5. package/dist/components/organisms/AutoSaveController.vue.js +17 -0
  6. package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
  7. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
  8. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
  9. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  10. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  11. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  12. package/dist/components/organisms/header/EditorActions.vue2.js +51 -36
  13. package/dist/components/organisms/header/RightSlot.vue.js +11 -11
  14. package/dist/components/organisms/header/RightSlot.vue2.js +17 -13
  15. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -17
  16. package/dist/composables/useActionsApi.js +4 -4
  17. package/dist/composables/useAutoSave.js +68 -0
  18. package/dist/composables/useFullStoryBridge.js +14 -0
  19. package/dist/composables/useHtmlCompiler.js +23 -21
  20. package/dist/composables/useHtmlValidator.js +40 -38
  21. package/dist/composables/usePreviewMode.js +20 -16
  22. package/dist/composables/useSave.js +23 -15
  23. package/dist/composables/useStripo.js +52 -47
  24. package/dist/composables/validators/useLiquidValidator.js +42 -0
  25. package/dist/config/compiler/liquidCompilerRules.js +15 -0
  26. package/dist/config/compiler/recommendationCompilerRules.js +162 -43
  27. package/dist/config/compiler/unsubscribeCompilerRules.js +37 -37
  28. package/dist/config/compiler/utils/recommendationCompilerUtils.js +52 -46
  29. package/dist/config/migrator/checkboxMigrator.js +5 -3
  30. package/dist/config/migrator/radioButtonMigrator.js +14 -12
  31. package/dist/config/migrator/recommendationMigrator.js +1 -1
  32. package/dist/enums/extensions/recommendationBlock.js +14 -11
  33. package/dist/enums/recommendation.js +2 -2
  34. package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
  35. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
  36. package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
  37. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  38. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
  39. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
  40. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
  41. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
  42. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +6 -6
  43. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
  44. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +94 -92
  45. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
  46. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
  47. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +31 -31
  48. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
  49. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +29 -25
  50. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
  51. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
  52. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
  53. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
  54. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
  55. package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
  56. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
  57. package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
  58. package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
  59. package/dist/guido.css +1 -1
  60. package/dist/package.json.js +1 -1
  61. package/dist/services/recommendationApi.js +15 -15
  62. package/dist/services/stripoApi.js +9 -9
  63. package/dist/services/templateLibraryApi.js +48 -46
  64. package/dist/src/@types/config/index.d.ts +1 -1
  65. package/dist/src/@types/config/schemas.d.ts +32 -0
  66. package/dist/src/@types/config/types.d.ts +3 -1
  67. package/dist/src/@types/generic.d.ts +0 -1
  68. package/dist/src/@types/save-as-template.d.ts +1 -0
  69. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
  70. package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
  71. package/dist/src/composables/useActionsApi.d.ts +1 -1
  72. package/dist/src/composables/useAutoSave.d.ts +3 -0
  73. package/dist/src/composables/useConfig.d.ts +14 -0
  74. package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
  75. package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
  76. package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
  77. package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
  78. package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
  79. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
  80. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  81. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  82. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
  83. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
  84. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
  85. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
  86. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
  87. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
  88. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  89. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  90. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
  91. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
  92. package/dist/src/services/templateLibraryApi.d.ts +1 -1
  93. package/dist/src/stores/autosave.d.ts +6 -0
  94. package/dist/src/stores/config.d.ts +126 -0
  95. package/dist/src/stores/preview.d.ts +3 -0
  96. package/dist/src/utils/genericUtil.d.ts +1 -1
  97. package/dist/src/utils/htmlCompiler.d.ts +2 -1
  98. package/dist/src/utils/timeUtil.d.ts +8 -0
  99. package/dist/static/styles/base.css.js +7 -2
  100. package/dist/static/styles/components/button.css.js +3 -2
  101. package/dist/static/styles/components/loader.css.js +4 -0
  102. package/dist/stores/autosave.js +11 -0
  103. package/dist/stores/preview.js +4 -3
  104. package/dist/utils/genericUtil.js +42 -20
  105. package/dist/utils/htmlCompiler.js +48 -41
  106. package/dist/utils/templatePreparation.js +36 -25
  107. package/dist/utils/timeUtil.js +19 -0
  108. package/dist/utils/tooltipUtils.js +4 -5
  109. package/package.json +3 -3
@@ -1,25 +1,17 @@
1
- import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
2
- import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
- import { usePreviewStore as _ } from "../../../../stores/preview.js";
4
- import { InTooltipV2 as v, InProgress as f } from "@useinsider/design-system-vue";
5
- const S = /* @__PURE__ */ c({
1
+ import { defineComponent as i, computed as t } from "vue";
2
+ import { useTranslations as m } from "../../../../composables/useTranslations.js";
3
+ import { usePreviewStore as a } from "../../../../stores/preview.js";
4
+ import { InTooltipV2 as p, InSkeleton as c, InProgress as _ } from "@useinsider/design-system-vue";
5
+ const z = /* @__PURE__ */ i({
6
6
  __name: "EmailSizeIndicator",
7
- setup(w) {
8
- const t = _(), o = 102, e = n(0), s = n({
9
- type: "success",
10
- value: 0
11
- }), a = l(() => `~${e.value} KB`), r = () => {
12
- const m = new Blob([t.previewHtml]).size;
13
- e.value = Math.round(m / 1024), s.value = {
14
- type: e.value < o ? "success" : "warning",
15
- value: Math.min(e.value, o)
16
- };
17
- }, i = p();
18
- return u(() => t.previewHtml, () => {
19
- r();
20
- }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltipV2: v };
7
+ setup(l) {
8
+ const e = a(), o = 102, r = t(() => `~${e.emailSizeKB} KB`), n = t(() => ({
9
+ type: e.emailSizeKB < o ? "success" : "warning",
10
+ value: Math.min(e.emailSizeKB, o)
11
+ })), s = m();
12
+ return { __sfc: !0, previewStore: e, MAX_EMAIL_SIZE_IN_KB: o, htmlSize: r, progress: n, trans: s, InProgress: _, InSkeleton: c, InTooltipV2: p };
21
13
  }
22
14
  });
23
15
  export {
24
- S as default
16
+ z as default
25
17
  };
@@ -0,0 +1,22 @@
1
+ import o from "./AutoSaveToggle.vue2.js";
2
+ /* empty css */
3
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var e = this, a = e._self._c, t = e._self._setupProxy;
6
+ return t.isFeatureEnabled("autosave") ? a("div", { staticClass: "d-f a-i-c mr-3 auto-save-toggle", on: { mouseenter: function(s) {
7
+ t.isHovered = !0;
8
+ }, mouseleave: function(s) {
9
+ t.isHovered = !1;
10
+ } } }, [a(t.InToggle, { attrs: { id: "guido__autosave-toggle", name: "guido-autosave-toggle", checked: t.autosaveStore.isOn, disable: t.editorStore.loadingStatus }, on: { click: t.toggle } }), a("span", { staticClass: "ml-2 auto-save-toggle__label t-c-55" }, [e._v(" " + e._s(t.trans("email-editor.auto-save")) + " ")]), t.autosaveStore.status === "saving" ? a("span", { staticClass: "ml-2 d-f a-i-c f-s-1" }, [a(t.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), a("span", { staticClass: "ml-1 t-c-53" }, [e._v(" " + e._s(t.trans("newsletter.saving")) + " ")])], 1) : t.lastSavedLabel ? a("span", { staticClass: "ml-2 f-s-1 t-c-53" }, [e._v(" " + e._s(t.lastSavedLabel) + " ")]) : e._e(), t.isHovered ? a(t.InInfoBox, { staticClass: "auto-save-toggle__info-box", attrs: { id: "guido__autosave-info-box", size: "small", variant: "information", "description-text": t.trans("email-editor.auto-save-description"), "title-text": t.trans("email-editor.auto-save-title") } }) : e._e()], 1) : e._e();
11
+ }, l = [], r = /* @__PURE__ */ i(
12
+ o,
13
+ n,
14
+ l,
15
+ !1,
16
+ null,
17
+ "4cbf0abd"
18
+ );
19
+ const d = r.exports;
20
+ export {
21
+ d as default
22
+ };
@@ -0,0 +1,19 @@
1
+ import { defineComponent as m, ref as i, computed as f } from "vue";
2
+ import { useConfig as u } from "../../../composables/useConfig.js";
3
+ import { useTranslations as l } from "../../../composables/useTranslations.js";
4
+ import { useAutosaveStore as p } from "../../../stores/autosave.js";
5
+ import { useEditorStore as c } from "../../../stores/editor.js";
6
+ import { formatLocalTime as d } from "../../../utils/timeUtil.js";
7
+ import { InToggle as g, InLoading as v, InInfoBox as S } from "@useinsider/design-system-vue";
8
+ const B = /* @__PURE__ */ m({
9
+ __name: "AutoSaveToggle",
10
+ setup(_) {
11
+ const { isFeatureEnabled: t } = u(), e = c(), o = p(), r = l(), s = i(!1), n = f(() => o.status !== "saved" || !o.lastSavedAt ? "" : d(o.lastSavedAt));
12
+ return { __sfc: !0, isFeatureEnabled: t, editorStore: e, autosaveStore: o, trans: r, isHovered: s, lastSavedLabel: n, toggle: (a) => {
13
+ o.isOn = a;
14
+ }, InInfoBox: S, InLoading: v, InToggle: g };
15
+ }
16
+ });
17
+ export {
18
+ B as default
19
+ };
@@ -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.testEmailClick } }) : 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", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "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
- "acff76a8"
18
+ "4e2a4adb"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {
@@ -1,51 +1,66 @@
1
- import { defineComponent as E, ref as n, computed as g } from "vue";
2
- import { useConfig as w } from "../../../composables/useConfig.js";
3
- import { useExport as C } from "../../../composables/useExport.js";
4
- import { useTestEmailClick as M } from "../../../composables/useGuidoActions.js";
5
- import { useSave as O } from "../../../composables/useSave.js";
6
- import { useTranslations as A } from "../../../composables/useTranslations.js";
7
- import { useVersionHistoryApi as k } from "../../../composables/useVersionHistoryApi.js";
8
- import { useEditorStore as B } from "../../../stores/editor.js";
9
- import { useTemplateStore as R } from "../../../stores/template.js";
10
- import { getTooltipOptions as b } from "../../../utils/tooltipUtils.js";
11
- import { InButtonV2 as D } from "@useinsider/design-system-vue";
12
- import { storeToRefs as I } from "pinia";
13
- import P from "./MigrationConfirmModal.vue.js";
14
- const Z = /* @__PURE__ */ E({
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({
15
18
  __name: "EditorActions",
16
- setup(j, { expose: H }) {
17
- const { config: a } = w(), { exportHtml: m } = C(), { save: p } = O(), { openVersionHistory: l, closeVersionHistory: u } = k(), e = B(), c = R(), { hasMigrations: f } = I(c), r = A(), s = n(!1), i = n(!1), v = n(), S = M(), V = () => {
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: S } = J(y), s = L(), i = n(!1), r = n(!1), g = n(), H = B(), T = () => {
18
21
  if (e.isVersionHistoryOpen) {
19
- u();
22
+ p();
20
23
  return;
21
24
  }
22
- l();
23
- }, T = async () => {
24
- s.value = !0, await m(), s.value = !1;
25
+ c();
26
+ }, w = async () => {
27
+ i.value = !0, await m(), i.value = !1;
25
28
  }, _ = () => {
26
29
  e.isSaveAsTemplateDrawerOpen = !0;
27
- }, h = g(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), x = g(
30
+ }, C = h(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), A = h(
28
31
  () => {
29
- var o, t;
30
- return ((t = (o = a.value) == null ? void 0 : o.features) == null ? void 0 : t.versionHistory) && !e.isPreviewModeOpen;
32
+ var t, o;
33
+ return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
31
34
  }
32
- ), d = async (o) => {
33
- i.value = !0, e.loadingStatus = !0;
34
- const t = await p(o);
35
- return i.value = !1, (o || !t) && (e.loadingStatus = !1), t;
36
- }, y = (o) => {
37
- var t;
38
- if (!o && f.value) {
39
- (t = v.value) == null || t.open();
35
+ ), V = async (t) => {
36
+ r.value = !0, e.loadingStatus = !0;
37
+ const o = await u(t);
38
+ return r.value = !1, (t || !o) && (e.loadingStatus = !1), o;
39
+ }, E = (t) => {
40
+ var o;
41
+ if (!t && S.value) {
42
+ (o = g.value) == null || o.open();
40
43
  return;
41
44
  }
42
- return d(o);
45
+ return V(t);
46
+ }, M = async () => {
47
+ if (l("liquidSyntax")) {
48
+ e.loadingStatus = !0;
49
+ try {
50
+ const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
51
+ if (!await v(o))
52
+ return;
53
+ } finally {
54
+ e.loadingStatus = !1;
55
+ }
56
+ }
57
+ H();
43
58
  };
44
- return H({
45
- handleSave: y
46
- }), { __sfc: !0, config: a, exportHtml: m, save: p, openVersionHistory: l, closeVersionHistory: u, editorStore: e, templateStore: c, hasMigrations: f, trans: r, isExporting: s, isSaving: i, migrationModalRef: v, testEmailClick: S, handleVersionHistory: V, handleExport: T, handleSaveAs: _, versionHistoryTooltipText: h, isVersionHistoryButtonVisible: x, executeSave: d, handleSave: y, getTooltipOptions: b, InButtonV2: D, MigrationConfirmModal: P };
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: S, trans: s, isExporting: i, isSaving: r, migrationModalRef: g, testEmailClick: H, handleVersionHistory: T, handleExport: w, handleSaveAs: _, versionHistoryTooltipText: C, isVersionHistoryButtonVisible: A, executeSave: V, handleSave: E, handleTestEmail: M, getTooltipOptions: j, InButtonV2: G, MigrationConfirmModal: K };
47
62
  }
48
63
  });
49
64
  export {
50
- Z as default
65
+ ut as default
51
66
  };
@@ -1,17 +1,17 @@
1
- import o from "./RightSlot.vue2.js";
2
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
4
- var r = this, t = r._self._c, e = r._self._setupProxy;
5
- return t("div", { staticClass: "d-f" }, [e.editorStore.isVersionHistoryOpen ? t(e.RestoreButton) : t(e.EditorActions, { ref: "editorActionsRef" })], 1);
6
- }, i = [], _ = /* @__PURE__ */ s(
7
- o,
8
- n,
9
- i,
1
+ import s from "./RightSlot.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var r = function() {
4
+ var i = this, e = i._self._c, t = i._self._setupProxy;
5
+ return e("div", { staticClass: "d-f a-i-c" }, [t.editorStore.isVersionHistoryOpen ? i._e() : e(t.AutoSaveToggle), t.isLiquidEnabled && !t.editorStore.isVersionHistoryOpen ? e(t.InChips, { staticClass: "mr-1", attrs: { id: "guido__liquid-tag-chip", styles: "stroke", type: "default", value: "liquid-tags", "close-button": !1, "disabled-status": t.editorStore.loadingStatus, interactive: !1, text: t.trans("email-editor.liquid-tags-enabled") } }) : i._e(), t.editorStore.isVersionHistoryOpen ? e(t.RestoreButton) : e(t.EditorActions, { ref: "editorActionsRef" })], 1);
6
+ }, a = [], n = /* @__PURE__ */ o(
7
+ s,
8
+ r,
9
+ a,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const l = _.exports;
14
+ const u = n.exports;
15
15
  export {
16
- l as default
16
+ u as default
17
17
  };
@@ -1,19 +1,23 @@
1
- import { defineComponent as i, ref as s } from "vue";
2
- import { useEditorStore as m } from "../../../stores/editor.js";
3
- import f from "./EditorActions.vue.js";
4
- import a from "./version-history/RestoreButton.vue.js";
5
- const l = /* @__PURE__ */ i({
1
+ import { defineComponent as a, ref as f, computed as p } from "vue";
2
+ import { useConfig as u } from "../../../composables/useConfig.js";
3
+ import { useTranslations as d } from "../../../composables/useTranslations.js";
4
+ import { useEditorStore as l } from "../../../stores/editor.js";
5
+ import { InChips as c } from "@useinsider/design-system-vue";
6
+ import _ from "./AutoSaveToggle.vue.js";
7
+ import S from "./EditorActions.vue.js";
8
+ import g from "./version-history/RestoreButton.vue.js";
9
+ const T = /* @__PURE__ */ a({
6
10
  __name: "RightSlot",
7
- setup(p, { expose: e }) {
8
- const r = m(), o = s(null);
9
- return e({
10
- handleSave: (n) => {
11
- var t;
12
- return (t = o.value) == null ? void 0 : t.handleSave(n);
11
+ setup(h, { expose: r }) {
12
+ const { isFeatureEnabled: o } = u(), i = d(), n = l(), t = f(null), s = p(() => o("liquidSyntax"));
13
+ return r({
14
+ handleSave: (m) => {
15
+ var e;
16
+ return (e = t.value) == null ? void 0 : e.handleSave(m);
13
17
  }
14
- }), { __sfc: !0, editorStore: r, editorActionsRef: o, EditorActions: f, RestoreButton: a };
18
+ }), { __sfc: !0, isFeatureEnabled: o, trans: i, editorStore: n, editorActionsRef: t, isLiquidEnabled: s, InChips: c, AutoSaveToggle: _, EditorActions: S, RestoreButton: g };
15
19
  }
16
20
  });
17
21
  export {
18
- l as default
22
+ T as default
19
23
  };
@@ -10,29 +10,29 @@ import { useDebounceFn as V } from "../../../node_modules/@vueuse/shared/index.j
10
10
  const H = /* @__PURE__ */ A({
11
11
  __name: "SaveAsTemplateDrawer",
12
12
  setup(E) {
13
- const s = O(), o = D(), t = k(), { createTemplate: m } = B(), a = c(!1), n = c(!1), r = c(""), f = b(() => ({
13
+ const o = O(), n = D(), t = k(), { createTemplate: m } = B(), a = c(!1), r = c(!1), l = c(""), f = b(() => ({
14
14
  primaryButton: {
15
15
  styling: "solid",
16
16
  type: "primary",
17
- labelText: s(a.value ? "newsletter.saving" : "products.save"),
17
+ labelText: o(a.value ? "newsletter.saving" : "products.save"),
18
18
  loadingStatus: a.value,
19
19
  disabledStatus: t.skeletonStatus
20
20
  },
21
21
  cancelOrBackButton: {
22
22
  styling: "ghost",
23
23
  type: "secondary",
24
- labelText: s("products.cancel"),
24
+ labelText: o("products.cancel"),
25
25
  disabledStatus: a.value
26
26
  }
27
- })), p = () => {
28
- r.value = "", o.isSaveAsTemplateDrawerOpen = !1;
29
- }, l = async () => {
30
- const e = h(t, "templateName"), { success: i, errorMessage: _ } = await x(e).validate();
31
- return r.value = _, i;
27
+ })), u = () => {
28
+ l.value = "", n.isSaveAsTemplateDrawerOpen = !1;
29
+ }, i = async () => {
30
+ const e = h(t, "templateName"), { success: s, errorMessage: _ } = await x(e).validate();
31
+ return l.value = _, s;
32
32
  }, v = V(async (e) => {
33
- t.templateName = e, await l();
33
+ t.templateName = e, await i();
34
34
  }, 500), g = async (e) => {
35
- n.value = !0, await t.addCategory(e), n.value = !1;
35
+ r.value = !0, await t.addCategory(e), r.value = !1;
36
36
  }, y = (e) => {
37
37
  t.selectedCategories = e;
38
38
  }, S = (e) => {
@@ -40,22 +40,23 @@ const H = /* @__PURE__ */ A({
40
40
  }, T = () => {
41
41
  t.selectedCategories = [];
42
42
  }, w = async () => {
43
- if (a.value = !0, !await l()) {
43
+ if (a.value = !0, !await i()) {
44
44
  a.value = !1;
45
45
  return;
46
46
  }
47
- await m(), a.value = !1, p();
48
- }, u = () => {
47
+ const s = await m();
48
+ a.value = !1, s && u();
49
+ }, p = () => {
49
50
  C(() => {
50
51
  const e = document.querySelector("input#guido__template-name-input");
51
52
  e == null || e.focus();
52
53
  });
53
54
  }, d = async () => {
54
- t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1, u();
55
+ t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1, p();
55
56
  };
56
- return o.$subscribe((e, { isSaveAsTemplateDrawerOpen: i }) => {
57
- i && d();
58
- }), { __sfc: !0, trans: s, editorStore: o, saveAsTemplateStore: t, createTemplate: m, isSaving: a, isAddingOption: n, templateNameError: r, footerButtonGroupOptions: f, closeModal: p, validateTemplateName: l, handleTemplateName: v, handleAddOption: g, handleCategoryChange: y, handleSelectAllOptions: S, handleResetAllOptions: T, saveTemplate: w, focusToInput: u, initializeDrawer: d, WpDrawer: N, InBasicTextInput: M, InMultiSelect: I };
57
+ return n.$subscribe((e, { isSaveAsTemplateDrawerOpen: s }) => {
58
+ s && d();
59
+ }), { __sfc: !0, trans: o, editorStore: n, saveAsTemplateStore: t, createTemplate: m, isSaving: a, isAddingOption: r, templateNameError: l, footerButtonGroupOptions: f, closeModal: u, validateTemplateName: i, handleTemplateName: v, handleAddOption: g, handleCategoryChange: y, handleSelectAllOptions: S, handleResetAllOptions: T, saveTemplate: w, focusToInput: p, initializeDrawer: d, WpDrawer: N, InBasicTextInput: M, InMultiSelect: I };
59
60
  }
60
61
  });
61
62
  export {
@@ -89,11 +89,11 @@ const v = () => {
89
89
  updateHtmlAndCss: (t, e) => {
90
90
  window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
91
91
  },
92
- editorSave: () => {
93
- window.StripoEditorApi.actionsApi.save((t) => {
94
- t && n(t, "Failed to save template");
92
+ editorSave: () => new Promise((t) => {
93
+ window.StripoEditorApi.actionsApi.save((e) => {
94
+ e && n(e, "Failed to save template"), t();
95
95
  });
96
- }
96
+ })
97
97
  };
98
98
  };
99
99
  export {
@@ -0,0 +1,68 @@
1
+ import { useConfig as m } from "./useConfig.js";
2
+ import { useAutosaveStore as p } from "../stores/autosave.js";
3
+ import { useEditorStore as S } from "../stores/editor.js";
4
+ import { computed as E, watch as f, onUnmounted as y } from "vue";
5
+ const A = 18e4, c = 6e4, O = (l) => {
6
+ const { isFeatureEnabled: b } = m(), s = S(), t = p();
7
+ let o = null, u = 0;
8
+ const n = E(
9
+ () => b("autosave") && t.isOn
10
+ ), g = () => s.hasChanges && !s.isSaveButtonDisabled && !s.isCodeEditorOpen, h = () => ({
11
+ hasChanges: s.hasChanges,
12
+ isSaveButtonDisabled: s.isSaveButtonDisabled,
13
+ isCodeEditorOpen: s.isCodeEditorOpen
14
+ }), r = async (e) => {
15
+ if (!n.value) {
16
+ console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
17
+ return;
18
+ }
19
+ if (!g()) {
20
+ console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates: h() });
21
+ return;
22
+ }
23
+ if (t.status === "saving") {
24
+ console.debug("guido:autosave:skipped", { trigger: e, reason: "already-saving" });
25
+ return;
26
+ }
27
+ console.debug("guido:autosave:save-start", { trigger: e }), t.status = "saving";
28
+ try {
29
+ await l(), s.hasChanges = !1, t.status = "saved", t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
30
+ } catch (i) {
31
+ console.debug("guido:autosave:error", { trigger: e, error: i }), t.status = "error";
32
+ }
33
+ }, a = () => {
34
+ const { visibilityState: e } = document;
35
+ if (console.debug("guido:autosave:visibility-change", {
36
+ visibilityState: e,
37
+ isActive: n.value
38
+ }), e !== "hidden")
39
+ return;
40
+ const i = Date.now() - u;
41
+ if (i < c) {
42
+ console.debug("guido:autosave:visibility-debounced", {
43
+ sinceLastMs: i,
44
+ debounceMs: c
45
+ });
46
+ return;
47
+ }
48
+ u = Date.now(), r("visibility");
49
+ }, d = () => {
50
+ o && (clearInterval(o), o = null);
51
+ }, v = () => {
52
+ document.removeEventListener("visibilitychange", a), window.removeEventListener("pagehide", a);
53
+ };
54
+ f(
55
+ n,
56
+ (e) => {
57
+ console.debug("guido:autosave:active-changed", { active: e }), e ? (d(), o = setInterval(() => {
58
+ console.debug("guido:autosave:interval-tick"), r("interval");
59
+ }, A), document.addEventListener("visibilitychange", a), window.addEventListener("pagehide", a)) : (d(), v(), t.status = "idle");
60
+ },
61
+ { immediate: !0 }
62
+ ), y(() => {
63
+ d(), v();
64
+ });
65
+ };
66
+ export {
67
+ O as useAutoSave
68
+ };
@@ -0,0 +1,14 @@
1
+ const c = "https://email-static.useinsider.com/guido/guido-fs.js", u = () => ({ injectFullStory: () => {
2
+ var n;
3
+ const s = window;
4
+ if (typeof s._fs_org != "string" || !s._fs_org)
5
+ return;
6
+ const r = document.querySelector("ui-editor"), o = (n = r == null ? void 0 : r.shadowRoot) == null ? void 0 : n.querySelector("iframe"), e = o == null ? void 0 : o.contentDocument;
7
+ if (!e || e.querySelector('script[data-fullstory-bridge="true"]'))
8
+ return;
9
+ const t = e.createElement("script");
10
+ t.src = c, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", e.head.appendChild(t);
11
+ } });
12
+ export {
13
+ u as useFullStoryBridge
14
+ };
@@ -1,28 +1,30 @@
1
- import { defaultHtmlCompilerRules as p } from "../config/compiler/htmlCompilerRules.js";
2
- import { itemsCompilerRules as u } from "../config/compiler/itemsCompilerRules.js";
3
- import { outlookCompilerRules as c } from "../config/compiler/outlookCompilerRules.js";
4
- import { recommendationCompilerRules as n } from "../config/compiler/recommendationCompilerRules.js";
5
- import { socialCompilerRules as f } from "../config/compiler/socialCompilerRules.js";
6
- import { unsubscribeCompilerRules as R } from "../config/compiler/unsubscribeCompilerRules.js";
7
- import { createHtmlCompiler as a } from "../utils/htmlCompiler.js";
8
- import { useConfig as C } from "./useConfig.js";
9
- const B = () => {
10
- var m, l;
11
- const { compiler: e } = C(), r = ((m = e.value) == null ? void 0 : m.customRules) || [], t = [
12
- ...!!((l = e.value) != null && l.ignoreDefaultRules) ? [] : p,
13
- ...n,
14
- ...R,
15
- ...u,
16
- ...c,
1
+ import { defaultHtmlCompilerRules as c } from "../config/compiler/htmlCompilerRules.js";
2
+ import { itemsCompilerRules as f } from "../config/compiler/itemsCompilerRules.js";
3
+ import { liquidCompilerRules as R } from "../config/compiler/liquidCompilerRules.js";
4
+ import { outlookCompilerRules as C } from "../config/compiler/outlookCompilerRules.js";
5
+ import { recommendationCompilerRules as d } from "../config/compiler/recommendationCompilerRules.js";
6
+ import { socialCompilerRules as b } from "../config/compiler/socialCompilerRules.js";
7
+ import { unsubscribeCompilerRules as g } from "../config/compiler/unsubscribeCompilerRules.js";
8
+ import { createHtmlCompiler as H } from "../utils/htmlCompiler.js";
9
+ import { useConfig as v } from "./useConfig.js";
10
+ const w = () => {
11
+ var l, m, r;
12
+ const { compiler: e, isFeatureEnabled: t, partner: i } = v(), s = ((l = e.value) == null ? void 0 : l.customRules) || [], u = [
13
+ ...!!((m = e.value) != null && m.ignoreDefaultRules) ? [] : c,
14
+ ...d,
15
+ ...g,
17
16
  ...f,
18
- ...r.map((o, s) => ({
17
+ ...C,
18
+ ...b,
19
+ ...t("liquidSyntax") ? R : [],
20
+ ...s.map((o, a) => ({
19
21
  ...o,
20
- priority: o.priority + 1e3 + s
22
+ priority: o.priority + 1e3 + a
21
23
  // Ensure additional rules run after default rules
22
24
  }))
23
- ], i = a(t);
24
- return { compileHtml: (o) => i.compile(o) };
25
+ ], p = H(u), n = (r = i.value) == null ? void 0 : r.fallbackFont;
26
+ return { compileHtml: (o) => p.compile(o, void 0, n) };
25
27
  };
26
28
  export {
27
- B as useHtmlCompiler
29
+ w as useHtmlCompiler
28
30
  };