@useinsider/guido 3.17.0-beta.a18fbda → 3.17.0-beta.a471c11

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 (131) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +19 -16
  3. package/dist/components/Guido.vue.js +10 -10
  4. package/dist/components/Guido.vue2.js +81 -79
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
  7. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  10. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  11. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  12. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +21 -0
  13. package/dist/components/organisms/header/EditorActions.vue.js +11 -11
  14. package/dist/components/organisms/header/EditorActions.vue2.js +34 -63
  15. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  16. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +39 -0
  17. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  18. package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
  19. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  20. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  21. package/dist/components/organisms/header/RightSlot.vue.js +6 -6
  22. package/dist/components/organisms/header/RightSlot.vue2.js +17 -15
  23. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  24. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  25. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
  26. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  27. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +18 -0
  28. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +74 -0
  29. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +43 -34
  30. package/dist/composables/useAccessibilityApi.js +31 -0
  31. package/dist/composables/useActionsApi.js +67 -82
  32. package/dist/composables/useAutoSave.js +26 -31
  33. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  34. package/dist/composables/useGuidoStateBridge.js +31 -37
  35. package/dist/composables/useRecommendation.js +41 -34
  36. package/dist/composables/useSave.js +36 -39
  37. package/dist/composables/useStripo.js +14 -14
  38. package/dist/config/i18n/en/labels.json.js +29 -5
  39. package/dist/config/migrator/index.js +9 -8
  40. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  41. package/dist/config/migrator/recommendation/extractors.js +29 -24
  42. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  43. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  44. package/dist/config/migrator/recommendationMigrator.js +31 -25
  45. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  46. package/dist/enums/academy.js +2 -1
  47. package/dist/enums/date.js +5 -3
  48. package/dist/enums/extensions/recommendationBlock.js +3 -1
  49. package/dist/extensions/Blocks/Recommendation/block.js +35 -29
  50. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  51. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  52. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
  53. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  54. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
  55. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +241 -180
  56. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  57. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  58. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  59. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  60. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  61. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  62. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +175 -79
  63. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  64. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  65. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  66. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  67. package/dist/extensions/Blocks/common-control.js +22 -19
  68. package/dist/guido.css +1 -1
  69. package/dist/node_modules/@vueuse/core/index.js +102 -0
  70. package/dist/node_modules/@vueuse/shared/index.js +40 -28
  71. package/dist/services/recommendationApi.js +69 -30
  72. package/dist/src/@types/config/schemas.d.ts +6 -0
  73. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  74. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  75. package/dist/src/components/organisms/header/AutoSaveStatus.vue.d.ts +2 -0
  76. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  77. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  78. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  79. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  80. package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
  81. package/dist/src/composables/useActionsApi.d.ts +2 -2
  82. package/dist/src/composables/useConfig.d.ts +4 -0
  83. package/dist/src/composables/useRecommendation.d.ts +1 -0
  84. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  85. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  86. package/dist/src/enums/academy.d.ts +1 -0
  87. package/dist/src/enums/date.d.ts +1 -0
  88. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -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 +176 -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 +36 -0
  109. package/dist/src/stores/editor.d.ts +76 -0
  110. package/dist/src/stores/onboarding.d.ts +377 -0
  111. package/dist/src/stores/save-as-template.d.ts +4 -3
  112. package/dist/src/stores/version-history.d.ts +1 -1
  113. package/dist/src/utils/genericUtil.d.ts +5 -0
  114. package/dist/src/utils/timeUtil.d.ts +10 -0
  115. package/dist/static/assets/icons/line-change.svg.js +5 -0
  116. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  117. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  118. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  119. package/dist/static/styles/customEditorStyle.css.js +3 -1
  120. package/dist/stores/editor.js +4 -1
  121. package/dist/stores/onboarding.js +16 -11
  122. package/dist/utils/dateUtil.js +23 -10
  123. package/dist/utils/genericUtil.js +28 -27
  124. package/dist/utils/templatePreparation.js +35 -34
  125. package/dist/utils/timeUtil.js +6 -17
  126. package/package.json +2 -1
  127. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  128. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  129. package/dist/composables/useEditorLock.js +0 -20
  130. package/dist/src/composables/useEditorLock.d.ts +0 -10
  131. /package/dist/src/components/organisms/{header/AutoSaveToggle.vue.d.ts → extensions/recommendation/RemoveStrategyModal.vue.d.ts} +0 -0
@@ -0,0 +1,24 @@
1
+ import i from "./ColorVisionSelect.vue2.js";
2
+ /* empty css */
3
+ import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var l = function() {
5
+ var e = this, t = e._self._c, s = e._self._setupProxy;
6
+ return t("div", { ref: "root", staticClass: "color-vision-select p-r" }, [t("button", { staticClass: "color-vision-select__trigger d-f a-i-c", attrs: { id: "guido__a11y-color-vision-trigger", type: "button", disabled: s.editorStore.loadingStatus }, on: { click: function(o) {
7
+ s.isOpen = !s.isOpen;
8
+ } } }, [t(s.InIcons, { staticClass: "mr-2", attrs: { name: "line-show-on", size: "16" } }), t("span", { staticClass: "color-vision-select__label f-s-2" }, [e._v(e._s(s.selectedLabel))]), t(s.InIcons, { staticClass: "ml-2", attrs: { name: "line-chevron-small-down", size: "16" } })], 1), s.isOpen ? t("div", { staticClass: "color-vision-select__menu p-a" }, e._l(s.OPTIONS, function(o) {
9
+ return t("button", { key: o.value || "none", staticClass: "color-vision-select__option d-f f-d-c", class: { "color-vision-select__option_selected": o.value === s.editorStore.colorVisionDeficiency }, attrs: { type: "button" }, on: { click: function(_) {
10
+ return s.select(o.value);
11
+ } } }, [t("span", { staticClass: "color-vision-select__option-label f-s-2" }, [e._v(e._s(s.trans(o.labelKey)))]), o.descriptionKey ? t("span", { staticClass: "color-vision-select__option-description f-s-1 t-c-55" }, [e._v(" " + e._s(s.trans(o.descriptionKey)) + " ")]) : e._e()]);
12
+ }), 0) : e._e()]);
13
+ }, c = [], r = /* @__PURE__ */ n(
14
+ i,
15
+ l,
16
+ c,
17
+ !1,
18
+ null,
19
+ "383f6378"
20
+ );
21
+ const p = r.exports;
22
+ export {
23
+ p as default
24
+ };
@@ -0,0 +1,48 @@
1
+ import { defineComponent as p, ref as c, computed as m } from "vue";
2
+ import { useAccessibilityApi as u } from "../../../../composables/useAccessibilityApi.js";
3
+ import { useTranslations as v } from "../../../../composables/useTranslations.js";
4
+ import { useEditorStore as f } from "../../../../stores/editor.js";
5
+ import { InIcons as y } from "@useinsider/design-system-vue";
6
+ import { onClickOutside as K } from "../../../../node_modules/@vueuse/core/index.js";
7
+ const V = /* @__PURE__ */ p({
8
+ __name: "ColorVisionSelect",
9
+ setup(b) {
10
+ const e = [
11
+ {
12
+ value: "",
13
+ labelKey: "email-editor.cvd-none"
14
+ },
15
+ {
16
+ value: "protanopia",
17
+ labelKey: "email-editor.cvd-protanopia",
18
+ descriptionKey: "email-editor.cvd-protanopia-description"
19
+ },
20
+ {
21
+ value: "deuteranopia",
22
+ labelKey: "email-editor.cvd-deuteranopia",
23
+ descriptionKey: "email-editor.cvd-deuteranopia-description"
24
+ },
25
+ {
26
+ value: "tritanopia",
27
+ labelKey: "email-editor.cvd-tritanopia",
28
+ descriptionKey: "email-editor.cvd-tritanopia-description"
29
+ },
30
+ {
31
+ value: "achromatopsia",
32
+ labelKey: "email-editor.cvd-achromatopsia",
33
+ descriptionKey: "email-editor.cvd-achromatopsia-description"
34
+ }
35
+ ], t = f(), a = v(), { setColorVisionDeficiency: r } = u(), o = c(!1), n = c(null), s = m(() => {
36
+ const i = e.find((d) => d.value === t.colorVisionDeficiency) ?? e[0];
37
+ return a(i.labelKey);
38
+ }), l = (i) => {
39
+ r(i), o.value = !1;
40
+ };
41
+ return K(n, () => {
42
+ o.value = !1;
43
+ }), { __sfc: !0, OPTIONS: e, editorStore: t, trans: a, setColorVisionDeficiency: r, isOpen: o, root: n, selectedLabel: s, select: l, InIcons: y };
44
+ }
45
+ });
46
+ export {
47
+ V as default
48
+ };
@@ -0,0 +1,18 @@
1
+ import b from "./EditorTabBarOnboarding.vue2.js";
2
+ import g from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var l = function() {
4
+ var t, a, n, i, e, s;
5
+ var r = this, d = r._self._c, o = r._self._setupProxy;
6
+ return o.isVisible ? d(o.InOnboard, { key: "guido__tab-bar-onboard", staticClass: "w-21-s p-a z-11", class: (t = o.onboardingStore.getEditorTabBarCurrentCard) == null ? void 0 : t.classes, attrs: { id: "guido__tab-bar-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (a = o.onboardingStore.getEditorTabBarCurrentCard) == null ? void 0 : a.bottom, "left-position": (n = o.onboardingStore.getEditorTabBarCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.editorTabBarOnboarding.config, "pointer-position": (i = o.onboardingStore.getEditorTabBarCurrentCard) == null ? void 0 : i.position, "right-position": (e = o.onboardingStore.getEditorTabBarCurrentCard) == null ? void 0 : e.right, "top-position": (s = o.onboardingStore.getEditorTabBarCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: o.handleBack, close: o.finish, nextButtonClick: o.handleNext } }) : r._e();
7
+ }, _ = [], p = /* @__PURE__ */ g(
8
+ b,
9
+ l,
10
+ _,
11
+ !1,
12
+ null,
13
+ null
14
+ );
15
+ const f = p.exports;
16
+ export {
17
+ f as default
18
+ };
@@ -0,0 +1,74 @@
1
+ import { defineComponent as p, computed as d, watch as x } from "vue";
2
+ import { useRibbonOffset as B } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as m } from "../../../composables/useTranslations.js";
4
+ import { useOnboardingStore as k } from "../../../stores/onboarding.js";
5
+ import { InOnboard as T } from "@useinsider/design-system-vue";
6
+ const y = /* @__PURE__ */ p({
7
+ __name: "EditorTabBarOnboarding",
8
+ setup(f) {
9
+ const n = "editorTabBarOnboarding", t = m(), i = k(), { getTopPosition: a } = B(), r = () => i.next(n), c = () => i.previous(n), s = () => void i.close(n), b = d(() => [
10
+ {
11
+ classes: "guido-tab-bar-onboarding",
12
+ right: "150px",
13
+ top: a(56),
14
+ position: "Right Top",
15
+ title: t("email-editor.onboarding-kebab-title"),
16
+ description: t("email-editor.onboarding-kebab-description"),
17
+ imageSource: "",
18
+ backButtonClick: () => {
19
+ },
20
+ nextButtonType: "text",
21
+ nextButtonText: t("action-builder.next"),
22
+ nextButtonClick: r
23
+ },
24
+ {
25
+ classes: "guido-tab-bar-onboarding",
26
+ right: "320px",
27
+ top: a(56),
28
+ position: "Right Top",
29
+ title: t("email-editor.onboarding-autosave-title"),
30
+ description: t("email-editor.onboarding-autosave-description"),
31
+ imageSource: "",
32
+ backButtonType: "text",
33
+ backButtonText: t("action-builder.back"),
34
+ backButtonClick: c,
35
+ nextButtonType: "text",
36
+ nextButtonText: t("action-builder.next"),
37
+ nextButtonClick: r
38
+ },
39
+ {
40
+ classes: "guido-tab-bar-onboarding",
41
+ right: "150px",
42
+ top: a(56),
43
+ position: "Right Top",
44
+ title: t("email-editor.onboarding-accessibility-title"),
45
+ description: t("email-editor.onboarding-accessibility-description"),
46
+ imageSource: "",
47
+ backButtonType: "text",
48
+ backButtonText: t("action-builder.back"),
49
+ backButtonClick: c,
50
+ nextButtonType: "text",
51
+ nextButtonText: t("action-builder.ok"),
52
+ nextButtonClick: s
53
+ }
54
+ ]), u = d(
55
+ () => i.onboardings.editorTabBarOnboarding.config.length > 0 && i.onboardings.editorTabBarOnboarding.isActive
56
+ ), g = () => {
57
+ var o, e;
58
+ (e = (o = i.getEditorTabBarCurrentCard) == null ? void 0 : o.nextButtonClick) == null || e.call(o);
59
+ }, l = () => {
60
+ var o, e;
61
+ (e = (o = i.getEditorTabBarCurrentCard) == null ? void 0 : o.backButtonClick) == null || e.call(o);
62
+ };
63
+ return x(
64
+ () => i.onboardings.editorTabBarOnboarding.isActive,
65
+ (o) => {
66
+ o && i.setConfig(n, b.value);
67
+ },
68
+ { immediate: !0 }
69
+ ), { __sfc: !0, ONBOARDING: n, trans: t, onboardingStore: i, getTopPosition: a, goNext: r, goBack: c, finish: s, onboardingCardsConfig: b, isVisible: u, handleNext: g, handleBack: l, InOnboard: T };
70
+ }
71
+ });
72
+ export {
73
+ y as default
74
+ };
@@ -1,46 +1,55 @@
1
- import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
2
- import u from "./AMPOnboarding.vue.js";
3
- import v from "./GenericOnboarding.vue.js";
4
- import l from "./ItemsOnboarding.vue.js";
5
- import y from "./NewVersionPopup.vue.js";
6
- import S from "./TextBlockOnboarding.vue.js";
7
- import h from "./VersionHistoryOnboarding.vue.js";
8
- import { usePartner as w } from "../../../composables/usePartner.js";
9
- import { useEditorStore as P } from "../../../stores/editor.js";
10
- import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
11
- import { usePreviewStore as A } from "../../../stores/preview.js";
12
- const G = /* @__PURE__ */ b({
1
+ import { defineComponent as O, computed as a, onMounted as u, watch as e } from "vue";
2
+ import l from "./AMPOnboarding.vue.js";
3
+ import v from "./EditorTabBarOnboarding.vue.js";
4
+ import y from "./GenericOnboarding.vue.js";
5
+ import S from "./ItemsOnboarding.vue.js";
6
+ import h from "./NewVersionPopup.vue.js";
7
+ import w from "./TextBlockOnboarding.vue.js";
8
+ import P from "./VersionHistoryOnboarding.vue.js";
9
+ import { useConfig as A } from "../../../composables/useConfig.js";
10
+ import { usePartner as T } from "../../../composables/usePartner.js";
11
+ import { useEditorStore as _ } from "../../../stores/editor.js";
12
+ import { useOnboardingStore as H } from "../../../stores/onboarding.js";
13
+ import { usePreviewStore as B } from "../../../stores/preview.js";
14
+ const j = /* @__PURE__ */ O({
13
15
  __name: "OnboardingWrapper",
14
16
  emits: ["onboarding-finished"],
15
- setup(H, { emit: f }) {
16
- const o = _(), r = P(), s = A(), { isTestPartner: a } = w(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
17
- { type: "newVersionPopup", component: y },
18
- { type: "genericOnboarding", component: v },
19
- { type: "textBlockOnboarding", component: S },
20
- { type: "versionHistoryOnboarding", component: h },
21
- { type: "ampOnboarding", component: u },
22
- { type: "itemsOnboarding", component: l }
23
- ], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), g = e(() => m.filter((n) => c(n.type)));
24
- return O(async () => {
17
+ setup(M, { emit: g }) {
18
+ const o = H(), i = _(), d = B(), { isTestPartner: p } = T(), { isFeatureEnabled: m } = A(), t = a(() => i.isStripoInitialized), s = a(() => p()), b = [
19
+ { type: "newVersionPopup", component: h },
20
+ { type: "genericOnboarding", component: y },
21
+ { type: "textBlockOnboarding", component: w },
22
+ { type: "versionHistoryOnboarding", component: P },
23
+ { type: "ampOnboarding", component: l },
24
+ { type: "itemsOnboarding", component: S },
25
+ { type: "editorTabBarOnboarding", component: v }
26
+ ], c = (n) => s.value || !t.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), f = a(() => b.filter((n) => c(n.type)));
27
+ return u(async () => {
25
28
  await o.fetchUserModalState();
26
- }), t(
27
- () => r.isVersionHistoryOpen,
28
- (n, i) => {
29
- n && !i && o.shouldShowOnboarding("versionHistoryOnboarding") && o.start("versionHistoryOnboarding"), !n && i && o.isActive("versionHistoryOnboarding") && o.close("versionHistoryOnboarding");
29
+ }), e(
30
+ () => i.isVersionHistoryOpen,
31
+ (n, r) => {
32
+ n && !r && o.shouldShowOnboarding("versionHistoryOnboarding") && o.start("versionHistoryOnboarding"), !n && r && o.isActive("versionHistoryOnboarding") && o.close("versionHistoryOnboarding");
30
33
  }
31
- ), t(
32
- () => s.emailFormat,
33
- (n, i) => {
34
- i !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
34
+ ), e(
35
+ () => d.emailFormat,
36
+ (n, r) => {
37
+ r !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
35
38
  }
36
- ), t(
37
- () => r.isPreviewModeOpen,
39
+ ), e(
40
+ () => i.isPreviewModeOpen,
38
41
  (n) => {
39
42
  !n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
40
43
  }
41
- ), { __sfc: !0, emit: f, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: g };
44
+ ), e(
45
+ t,
46
+ (n) => {
47
+ n && m("accessibilityTesting") && !s.value && !o.isOnboardingActive() && o.shouldShowOnboarding("editorTabBarOnboarding") && o.start("editorTabBarOnboarding");
48
+ },
49
+ { immediate: !0 }
50
+ ), { __sfc: !0, emit: g, onboardingStore: o, editorStore: i, previewStore: d, isTestPartner: p, isFeatureEnabled: m, isStripoReady: t, isTestPartnerActive: s, onboardingConfigs: b, shouldShow: c, visibleOnboardings: f };
42
51
  }
43
52
  });
44
53
  export {
45
- G as default
54
+ j as default
46
55
  };
@@ -0,0 +1,31 @@
1
+ import { useEditorStore as r } from "../stores/editor.js";
2
+ const A = () => {
3
+ const e = r(), i = () => window.StripoEditorApi.accessibilityApi, s = () => {
4
+ i().openAccessibilityTestingMode(), e.isAccessibilityTestingOpen = !0;
5
+ }, o = () => {
6
+ i().closeAccessibilityTestingMode(), e.isAccessibilityTestingOpen = !1, e.imagesHidden = !1, e.colorVisionDeficiency = "";
7
+ }, g = () => e.isAccessibilityTestingOpen ? o() : s(), l = () => i().isAccessibilityTestingModeOpen(), t = () => {
8
+ i().showImages(), e.imagesHidden = !1;
9
+ }, c = () => {
10
+ i().hideImages(), e.imagesHidden = !0;
11
+ };
12
+ return {
13
+ openAccessibilityTestingMode: s,
14
+ closeAccessibilityTestingMode: o,
15
+ toggleAccessibilityTestingMode: g,
16
+ isAccessibilityTestingModeOpen: l,
17
+ showImages: t,
18
+ hideImages: c,
19
+ toggleImages: () => e.imagesHidden ? t() : c(),
20
+ setColorVisionDeficiency: (n) => {
21
+ i().setColorVisionDeficiency(n), e.colorVisionDeficiency = n;
22
+ },
23
+ getColorVisionDeficiency: () => i().getColorVisionDeficiency(),
24
+ switchToDesktopPreview: () => i().switchToDesktopPreview(),
25
+ switchToMobilePreview: () => i().switchToMobilePreview(),
26
+ toggleCodeEditor: () => i().emitToggleCodeEditor()
27
+ };
28
+ };
29
+ export {
30
+ A as useAccessibilityApi
31
+ };
@@ -1,68 +1,52 @@
1
- import { filterAmpErrors as v } from "../utils/ampErrorFilter.js";
2
- import { useToaster as y } from "./useToaster.js";
3
- const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
4
- const w = setTimeout(
5
- () => m(new Error(`${n} did not report completion within ${l}ms`)),
6
- l
7
- ), p = (A) => (t) => {
8
- clearTimeout(w), A(t);
9
- };
10
- u(p(T), p(m));
11
- }), I = () => {
12
- const { handleError: n } = y(), l = (t = {}) => s(
13
- "compileEmail",
14
- d,
15
- (e, a) => {
16
- const o = { ...{
17
- minimize: !0,
18
- utmEntity: {
19
- utmSource: "",
20
- utmMedium: "",
21
- utmCampaign: "",
22
- utmContent: "",
23
- utmTerm: "",
24
- customUtms: [
25
- {
26
- name1: "val1",
27
- name2: "val2"
28
- }
29
- ]
30
- },
31
- mergeTags: ["Tag1", "Tag2"],
32
- forceAmp: !1,
33
- resetDataSavedFlag: !1,
34
- disableLineHeightsReplace: !0
35
- }, ...t }, c = {
36
- callback: (r, C, f, S, g) => {
37
- r ? a(r) : e({
38
- html: C,
39
- ampHtml: f,
40
- ampErrors: v(S ?? []),
41
- displayConditions: g
42
- });
43
- },
44
- ...o
45
- };
46
- window.StripoEditorApi.actionsApi.compileEmail(c);
47
- }
48
- );
1
+ import { filterAmpErrors as T } from "../utils/ampErrorFilter.js";
2
+ import { useToaster as A } from "./useToaster.js";
3
+ const p = 1e4, D = () => {
4
+ const { handleError: r } = A(), l = (t = {}) => new Promise((e, a) => {
5
+ const o = { ...{
6
+ minimize: !0,
7
+ utmEntity: {
8
+ utmSource: "",
9
+ utmMedium: "",
10
+ utmCampaign: "",
11
+ utmContent: "",
12
+ utmTerm: "",
13
+ customUtms: [
14
+ {
15
+ name1: "val1",
16
+ name2: "val2"
17
+ }
18
+ ]
19
+ },
20
+ mergeTags: ["Tag1", "Tag2"],
21
+ forceAmp: !1,
22
+ resetDataSavedFlag: !1,
23
+ disableLineHeightsReplace: !0
24
+ }, ...t }, n = {
25
+ callback: (m, d, c, u, w) => {
26
+ m ? a(m) : e({
27
+ html: d,
28
+ ampHtml: c,
29
+ ampErrors: T(u ?? []),
30
+ displayConditions: w
31
+ });
32
+ },
33
+ ...o
34
+ };
35
+ window.StripoEditorApi.actionsApi.compileEmail(n);
36
+ });
49
37
  return {
50
38
  getCompiledEmail: l,
51
- getTemplateData: () => s(
52
- "getTemplateData",
53
- d,
54
- (t) => {
55
- const e = ({ html: a, css: i, width: o, height: E, utmParams: c, syncModulesIds: r }) => t({
56
- html: a,
57
- css: i,
58
- width: o,
59
- height: E,
60
- utmParams: c,
61
- syncModulesIds: r
62
- });
63
- window.StripoEditorApi.actionsApi.getTemplateData(e);
64
- }
65
- ),
39
+ getTemplateData: () => new Promise((t) => {
40
+ const e = ({ html: a, css: i, width: o, height: s, utmParams: n, syncModulesIds: m }) => t({
41
+ html: a,
42
+ css: i,
43
+ width: o,
44
+ height: s,
45
+ utmParams: n,
46
+ syncModulesIds: m
47
+ });
48
+ window.StripoEditorApi.actionsApi.getTemplateData(e);
49
+ }),
66
50
  activateCustomViewStyles: (t = !0) => {
67
51
  window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
68
52
  },
@@ -81,7 +65,7 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
81
65
  displayConditions: a
82
66
  };
83
67
  } catch (e) {
84
- return n(e, "Error loading preview"), {
68
+ return r(e, "Error loading preview"), {
85
69
  html: "",
86
70
  ampHtml: "",
87
71
  ampErrors: [],
@@ -97,33 +81,34 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
97
81
  }
98
82
  try {
99
83
  window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
100
- i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
84
+ i ? (r(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
101
85
  });
102
86
  } catch (i) {
103
- n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
87
+ r(i, "Failed to call updateTimerInClonedTemplate"), t(null);
104
88
  }
105
89
  }),
106
90
  updateHtmlAndCss: (t, e) => {
107
91
  const { actionsApi: a } = window.StripoEditorApi;
108
- return s("updateHtmlAndCss", D, (i) => {
109
- a.updateHtmlAndCss(t, e, () => i());
92
+ return new Promise((i, o) => {
93
+ const s = new Error(
94
+ `updateHtmlAndCss did not report completion within ${p}ms`
95
+ ), n = setTimeout(() => o(s), p);
96
+ a.updateHtmlAndCss(t, e, () => {
97
+ clearTimeout(n), i();
98
+ });
110
99
  });
111
100
  },
112
- editorSave: () => s(
113
- "save",
114
- d,
115
- (t) => {
116
- window.StripoEditorApi.actionsApi.save((e) => {
117
- if (e) {
118
- n(e, "Failed to save template"), t(!1);
119
- return;
120
- }
121
- t(!0);
122
- });
123
- }
124
- )
101
+ editorSave: () => new Promise((t) => {
102
+ window.StripoEditorApi.actionsApi.save((e) => {
103
+ if (e) {
104
+ r(e, "Failed to save template"), t(!1);
105
+ return;
106
+ }
107
+ t(!0);
108
+ });
109
+ })
125
110
  };
126
111
  };
127
112
  export {
128
- I as useActionsApi
113
+ D as useActionsApi
129
114
  };
@@ -1,22 +1,21 @@
1
- import { useConfig as E } from "./useConfig.js";
2
- import { useEditorLock as p } from "./useEditorLock.js";
1
+ import { useConfig as m } from "./useConfig.js";
3
2
  import { useAutosaveStore as A, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
4
- import { useEditorStore as f } from "../stores/editor.js";
5
- import { computed as y, watch as I, onUnmounted as L } from "vue";
6
- const w = 18e4, v = 6e4, R = (b) => {
7
- const { isFeatureEnabled: S } = E(), o = f(), t = A(), { isEditorBusy: g } = p();
3
+ import { useEditorStore as E } from "../stores/editor.js";
4
+ import { computed as f, watch as p, onUnmounted as y } from "vue";
5
+ const I = 18e4, r = 6e4, T = (b) => {
6
+ const { isFeatureEnabled: S } = m(), a = E(), t = A();
8
7
  let i = null, c = 0;
9
- const u = y(
8
+ const u = f(
10
9
  () => S("autosave") && t.isOn
11
- ), m = () => o.hasChanges && o.isInSaveableState, h = () => ({
12
- hasChanges: o.hasChanges,
13
- isInSaveableState: o.isInSaveableState
14
- }), r = async (e) => {
10
+ ), g = () => a.hasChanges && a.isInSaveableState, h = () => ({
11
+ hasChanges: a.hasChanges,
12
+ isInSaveableState: a.isInSaveableState
13
+ }), l = async (e) => {
15
14
  if (!u.value) {
16
15
  console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
17
16
  return;
18
17
  }
19
- if (!m()) {
18
+ if (!g()) {
20
19
  console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates: h() });
21
20
  return;
22
21
  }
@@ -24,19 +23,15 @@ const w = 18e4, v = 6e4, R = (b) => {
24
23
  console.debug("guido:autosave:skipped", { trigger: e, reason: "already-saving" });
25
24
  return;
26
25
  }
27
- if (g()) {
28
- console.debug("guido:autosave:skipped", { trigger: e, reason: "editor-busy" });
29
- return;
30
- }
31
26
  console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
32
27
  try {
33
28
  if (await b() === void 0) {
34
29
  console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = s.ERROR;
35
30
  return;
36
31
  }
37
- o.hasChanges = !1, t.status = s.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
38
- } catch (a) {
39
- console.debug("guido:autosave:error", { trigger: e, error: a }), t.status = s.ERROR;
32
+ a.hasChanges = !1, t.status = s.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
33
+ } catch (o) {
34
+ console.debug("guido:autosave:error", { trigger: e, error: o }), t.status = s.ERROR;
40
35
  }
41
36
  }, n = () => {
42
37
  const { visibilityState: e } = document;
@@ -45,32 +40,32 @@ const w = 18e4, v = 6e4, R = (b) => {
45
40
  isActive: u.value
46
41
  }), e !== "hidden")
47
42
  return;
48
- const a = Date.now() - c;
49
- if (a < v) {
43
+ const o = Date.now() - c;
44
+ if (o < r) {
50
45
  console.debug("guido:autosave:visibility-debounced", {
51
- sinceLastMs: a,
52
- debounceMs: v
46
+ sinceLastMs: o,
47
+ debounceMs: r
53
48
  });
54
49
  return;
55
50
  }
56
- c = Date.now(), r("visibility");
51
+ c = Date.now(), l("visibility");
57
52
  }, d = () => {
58
53
  i && (clearInterval(i), i = null);
59
- }, l = () => {
54
+ }, v = () => {
60
55
  document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
61
56
  };
62
- I(
57
+ p(
63
58
  u,
64
59
  (e) => {
65
60
  console.debug("guido:autosave:active-changed", { active: e }), e ? (d(), i = setInterval(() => {
66
- console.debug("guido:autosave:interval-tick"), r("interval");
67
- }, w), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), l(), t.status = s.IDLE);
61
+ console.debug("guido:autosave:interval-tick"), l("interval");
62
+ }, I), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), v(), t.status = s.IDLE);
68
63
  },
69
64
  { immediate: !0 }
70
- ), L(() => {
71
- d(), l(), t.status = s.IDLE, t.lastSavedAt = null;
65
+ ), y(() => {
66
+ d(), v(), t.status = s.IDLE, t.lastSavedAt = null;
72
67
  });
73
68
  };
74
69
  export {
75
- R as useAutoSave
70
+ T as useAutoSave
76
71
  };