@useinsider/guido 3.19.0-beta.80b64cf → 3.19.0-beta.84c97db

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 (110) hide show
  1. package/dist/@types/config/schemas.js +9 -8
  2. package/dist/components/Guido.vue.js +8 -8
  3. package/dist/components/Guido.vue2.js +104 -86
  4. package/dist/components/organisms/AutoSaveController.vue2.js +18 -8
  5. package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
  6. package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
  7. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  8. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
  9. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  10. package/dist/components/organisms/header/EditorActions.vue2.js +37 -52
  11. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  12. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +98 -0
  13. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  14. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
  15. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  16. package/dist/components/organisms/header/LeftSlot.vue2.js +32 -23
  17. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  18. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  19. package/dist/components/organisms/header/RightSlot.vue.js +9 -8
  20. package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
  21. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  22. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  23. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
  24. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  25. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
  26. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
  27. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  28. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +56 -38
  29. package/dist/components/wrappers/WpModal.vue.js +1 -1
  30. package/dist/components/wrappers/WpModal.vue2.js +4 -3
  31. package/dist/composables/useAccessibilityApi.js +45 -0
  32. package/dist/composables/useAuthError.js +52 -0
  33. package/dist/composables/useAutoSave.js +11 -11
  34. package/dist/composables/useCortexBlueprintBridge.js +122 -54
  35. package/dist/composables/useCustomInterfaceAppearance.js +42 -41
  36. package/dist/composables/useEmailTemplateApplier.js +111 -50
  37. package/dist/composables/useHttp.js +64 -54
  38. package/dist/composables/useLegacyStrategyConversion.js +23 -19
  39. package/dist/composables/useStripo.js +24 -20
  40. package/dist/composables/useToaster.js +17 -15
  41. package/dist/composables/validators/useLiquidValidator.js +15 -15
  42. package/dist/config/i18n/en/labels.json.js +36 -4
  43. package/dist/config/i18n/en/tooltips.json.js +2 -1
  44. package/dist/config/migrator/index.js +14 -13
  45. package/dist/config/migrator/itemsBlockMigrator.js +236 -248
  46. package/dist/config/migrator/recommendationMigrator.js +28 -21
  47. package/dist/config/migrator/recommendationPartnerMigrator.js +56 -0
  48. package/dist/enums/extensions/recommendationBlock.js +30 -29
  49. package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
  50. package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
  51. package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
  52. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  53. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
  54. package/dist/extensions/Blocks/Items/template.js +219 -204
  55. package/dist/extensions/Blocks/Recommendation/block.js +54 -88
  56. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +32 -51
  57. package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +11 -12
  58. package/dist/guido.css +1 -1
  59. package/dist/sprite.svg +10 -0
  60. package/dist/src/@types/config/schemas.d.ts +2 -0
  61. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +3 -1
  62. package/dist/src/components/organisms/header/AutoSaveStatus.vue.d.ts +2 -0
  63. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  64. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
  65. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -3
  66. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  67. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  68. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  69. package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
  70. package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
  71. package/dist/src/composables/useActionsApi.d.ts +2 -2
  72. package/dist/src/composables/useAuthError.d.ts +12 -0
  73. package/dist/src/composables/useConfig.d.ts +2 -0
  74. package/dist/src/composables/useCortexBlueprintBridge.d.ts +2 -3
  75. package/dist/src/composables/useEmailTemplateApplier.d.ts +18 -5
  76. package/dist/src/composables/useGuidoActions.d.ts +2 -0
  77. package/dist/src/composables/useHttp.d.ts +2 -0
  78. package/dist/src/config/migrator/index.d.ts +2 -1
  79. package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
  80. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
  81. package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
  82. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
  83. package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
  84. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -6
  85. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  86. package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +13 -7
  87. package/dist/src/mock/cortexChatStore.d.ts +12 -0
  88. package/dist/src/stores/autosave.d.ts +73 -1
  89. package/dist/src/stores/config.d.ts +20 -0
  90. package/dist/src/stores/editor.d.ts +109 -0
  91. package/dist/src/stores/guido-email-editor.d.ts +20 -10
  92. package/dist/src/stores/onboarding.d.ts +956 -21
  93. package/dist/src/stores/recommendation.d.ts +5 -0
  94. package/dist/src/stores/version-history.d.ts +1 -1
  95. package/dist/src/utils/dateUtil.d.ts +10 -0
  96. package/dist/src/utils/genericUtil.d.ts +3 -0
  97. package/dist/src/utils/timeUtil.d.ts +5 -0
  98. package/dist/static/styles/components/accessibility.css.js +234 -0
  99. package/dist/static/styles/components/version-history.css.js +2 -6
  100. package/dist/static/styles/variables.css.js +2 -0
  101. package/dist/stores/autosave.js +12 -7
  102. package/dist/stores/editor.js +7 -4
  103. package/dist/stores/guido-email-editor.js +3 -1
  104. package/dist/stores/onboarding.js +47 -21
  105. package/dist/utils/pairProductVariables.js +71 -71
  106. package/dist/utils/timeUtil.js +6 -17
  107. package/package.json +2 -1
  108. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  109. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  110. /package/dist/src/components/organisms/{header/AutoSaveToggle.vue.d.ts → base/AuthErrorModal.vue.d.ts} +0 -0
@@ -0,0 +1,19 @@
1
+ import i from "./EditorTabBarOnboarding.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = function() {
5
+ var r, n;
6
+ var t = this, e = t._self._c, o = t._self._setupProxy;
7
+ return o.isVisible ? e(o.InOnboard, { key: "guido__tab-bar-onboard", staticClass: "w-21-s p-a z-11", class: (r = o.onboardingStore.getEditorTabBarCurrentCard) == null ? void 0 : r.classes, attrs: { id: o.CARD_ID, "is-multiple-page": "", visible: "", "image-source": "", title: "", "pages-config": o.onboardingStore.onboardings.editorTabBarOnboarding.config, "pointer-position": (n = o.onboardingStore.getEditorTabBarCurrentCard) == null ? void 0 : n.position, "right-position": o.placement.right, "top-position": o.placement.top }, on: { backButtonClick: o.handleBack, close: o.finish, nextButtonClick: o.handleNext } }) : t._e();
8
+ }, c = [], d = /* @__PURE__ */ a(
9
+ i,
10
+ s,
11
+ c,
12
+ !1,
13
+ null,
14
+ "42f02a1f"
15
+ );
16
+ const g = d.exports;
17
+ export {
18
+ g as default
19
+ };
@@ -0,0 +1,90 @@
1
+ import { defineComponent as M, ref as q, computed as P, watch as N, nextTick as A } from "vue";
2
+ import { useConfig as D } from "../../../composables/useConfig.js";
3
+ import { useRibbonOffset as F } from "../../../composables/useRibbonOffset.js";
4
+ import { useTranslations as G } from "../../../composables/useTranslations.js";
5
+ import { useOnboardingStore as K } from "../../../stores/onboarding.js";
6
+ import { InOnboard as $ } from "@useinsider/design-system-vue";
7
+ const Q = /* @__PURE__ */ M({
8
+ __name: "EditorTabBarOnboarding",
9
+ setup(H) {
10
+ const r = "editorTabBarOnboarding", m = "guido__tab-bar-onboard", a = G(), o = K(), { isFeatureEnabled: B } = D(), { getTopPosition: x } = F(), f = () => o.next(r), k = () => o.previous(r), T = () => void o.close(r), _ = 4, C = 17, c = "#guido__kebab-button", u = ".editor-actions-menu__dropdown", d = (t, e, n) => ({
11
+ classes: "guido-tab-bar-onboarding",
12
+ position: "Right Top",
13
+ title: a(t),
14
+ description: a(e),
15
+ imageSource: "",
16
+ backButtonType: "text",
17
+ backButtonText: a("action-builder.back"),
18
+ backButtonClick: k,
19
+ nextButtonType: "text",
20
+ nextButtonText: a("action-builder.next"),
21
+ nextButtonClick: f,
22
+ ...n
23
+ }), b = { backButtonType: void 0, backButtonText: void 0, backButtonClick: () => {
24
+ } }, O = () => B("autosave") ? [{
25
+ card: d("email-editor.onboarding-autosave-title", "email-editor.onboarding-autosave-description", {
26
+ pinsMenu: !0
27
+ }),
28
+ edge: u,
29
+ target: '[data-attr-value="guido__kebab-autosave"]'
30
+ }] : [], v = () => [
31
+ {
32
+ card: d("email-editor.onboarding-kebab-title", "email-editor.onboarding-kebab-description", b),
33
+ edge: c,
34
+ target: c
35
+ },
36
+ ...O(),
37
+ {
38
+ card: d("email-editor.onboarding-accessibility-title", "email-editor.onboarding-accessibility-description", {
39
+ nextButtonText: a("action-builder.ok"),
40
+ nextButtonClick: T,
41
+ pinsMenu: !0
42
+ }),
43
+ edge: u,
44
+ target: '[data-attr-value="guido__kebab-accessibility"]'
45
+ }
46
+ ], h = (t, e) => {
47
+ if (e <= 0 || e >= t.length)
48
+ return { steps: t, offset: 0 };
49
+ const [n, ...i] = t.slice(e);
50
+ return { steps: [{ ...n, card: { ...n.card, ...b } }, ...i], offset: e };
51
+ }, g = () => ({ top: x(56), right: "150px" });
52
+ let s = [];
53
+ const l = q(g()), p = async () => {
54
+ var R;
55
+ await A();
56
+ const t = s[o.onboardings.editorTabBarOnboarding.cardIndex], e = (R = document.getElementById(m)) == null ? void 0 : R.offsetParent, n = (t && document.querySelector(t.edge)) ?? document.querySelector(c), i = (t && document.querySelector(t.target)) ?? document.querySelector(c);
57
+ if (!e || !n || !i) {
58
+ l.value = g();
59
+ return;
60
+ }
61
+ const y = e.getBoundingClientRect(), E = i.getBoundingClientRect();
62
+ l.value = {
63
+ top: `${Math.round(E.top + E.height / 2 - y.top - C)}px`,
64
+ right: `${Math.round(y.right - n.getBoundingClientRect().left - _)}px`
65
+ };
66
+ }, S = P(
67
+ () => o.onboardings.editorTabBarOnboarding.config.length > 0 && o.onboardings.editorTabBarOnboarding.isActive
68
+ ), I = () => {
69
+ var t, e;
70
+ (e = (t = o.getEditorTabBarCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
71
+ }, w = () => {
72
+ var t, e;
73
+ (e = (t = o.getEditorTabBarCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
74
+ };
75
+ return N(
76
+ () => o.onboardings.editorTabBarOnboarding.isActive,
77
+ async (t) => {
78
+ if (!t)
79
+ return;
80
+ await A();
81
+ const { cardOffset: e } = o.onboardings.editorTabBarOnboarding, n = h(v(), e);
82
+ ({ steps: s } = n), o.setConfig(r, s.map((i) => i.card), n.offset), await p();
83
+ },
84
+ { immediate: !0 }
85
+ ), N(() => o.onboardings.editorTabBarOnboarding.cardIndex, p), { __sfc: !0, ONBOARDING: r, CARD_ID: m, trans: a, onboardingStore: o, isFeatureEnabled: B, getTopPosition: x, goNext: f, goBack: k, finish: T, ANCHOR_GAP: _, POINTER_CENTER: C, KEBAB: c, MENU: u, card: d, NO_BACK: b, autoSaveStep: O, buildSteps: v, resumeFrom: h, designFallback: g, steps: s, placement: l, place: p, isVisible: S, handleNext: I, handleBack: w, InOnboard: $ };
86
+ }
87
+ });
88
+ export {
89
+ Q as default
90
+ };
@@ -1,21 +1,21 @@
1
- import t from "./OnboardingWrapper.vue2.js";
2
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var s = function() {
4
- var n = this, e = n._self._c, r = n._self._setupProxy;
5
- return e("div", n._l(r.visibleOnboardings, function(o) {
6
- return e(o.component, { key: o.type, tag: "component", on: { "onboarding-finished": function(p) {
7
- return r.emit("onboarding-finished");
1
+ import o from "./OnboardingWrapper.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var _ = function() {
4
+ var n = this, r = n._self._c, t = n._self._setupProxy;
5
+ return r("div", n._l(t.visibleOnboardings, function(e) {
6
+ return r(e.component, { key: e.type, tag: "component", on: { "onboarding-finished": function(l) {
7
+ return t.handleFinished(e.type);
8
8
  } } });
9
9
  }), 1);
10
- }, _ = [], a = /* @__PURE__ */ i(
11
- t,
12
- s,
10
+ }, i = [], a = /* @__PURE__ */ s(
11
+ o,
13
12
  _,
13
+ i,
14
14
  !1,
15
15
  null,
16
16
  null
17
17
  );
18
- const d = a.exports;
18
+ const f = a.exports;
19
19
  export {
20
- d as default
20
+ f as default
21
21
  };
@@ -1,50 +1,68 @@
1
- import { defineComponent as f, computed as e, onMounted as O, watch as t } from "vue";
2
- import y from "./AMPOnboarding.vue.js";
3
- import u from "./GenericOnboarding.vue.js";
4
- import v from "./ItemsOnboarding.vue.js";
5
- import S from "./NewVersionPopup.vue.js";
6
- import l from "./RecommendationLegacyStrategyOnboarding.vue.js";
7
- import h from "./RecommendationStrategyOnboarding.vue.js";
8
- import w from "./TextBlockOnboarding.vue.js";
9
- import P from "./VersionHistoryOnboarding.vue.js";
10
- import { usePartner as _ } from "../../../composables/usePartner.js";
11
- import { useEditorStore as A } from "../../../stores/editor.js";
12
- import { useOnboardingStore as H } from "../../../stores/onboarding.js";
13
- import { usePreviewStore as M } from "../../../stores/preview.js";
14
- const U = /* @__PURE__ */ f({
1
+ import { defineComponent as y, computed as r, onMounted as S, watch as e, ref as h } from "vue";
2
+ import w from "./AMPOnboarding.vue.js";
3
+ import T from "./EditorTabBarOnboarding.vue.js";
4
+ import P from "./GenericOnboarding.vue.js";
5
+ import B from "./ItemsOnboarding.vue.js";
6
+ import A from "./NewVersionPopup.vue.js";
7
+ import M from "./RecommendationLegacyStrategyOnboarding.vue.js";
8
+ import _ from "./RecommendationStrategyOnboarding.vue.js";
9
+ import H from "./TextBlockOnboarding.vue.js";
10
+ import F from "./VersionHistoryOnboarding.vue.js";
11
+ import { useConfig as V } from "../../../composables/useConfig.js";
12
+ import { usePartner as C } from "../../../composables/usePartner.js";
13
+ import { useEditorStore as x } from "../../../stores/editor.js";
14
+ import { useOnboardingStore as E } from "../../../stores/onboarding.js";
15
+ import { usePreviewStore as N } from "../../../stores/preview.js";
16
+ const Z = /* @__PURE__ */ y({
15
17
  __name: "OnboardingWrapper",
16
18
  emits: ["onboarding-finished"],
17
- setup(x, { emit: g }) {
18
- const o = H(), r = A(), a = M(), { isTestPartner: s } = _(), m = e(() => r.isStripoInitialized), p = e(() => s()), d = [
19
- { type: "newVersionPopup", component: S },
20
- { type: "genericOnboarding", component: u },
21
- { type: "textBlockOnboarding", component: w },
22
- { type: "versionHistoryOnboarding", component: P },
23
- { type: "ampOnboarding", component: y },
24
- { type: "itemsOnboarding", component: v },
25
- { type: "recommendationStrategyOnboarding", component: h },
26
- { type: "recommendationLegacyStrategyOnboarding", component: l }
27
- ], c = (n) => p.value || !m.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), b = e(() => d.filter((n) => c(n.type)));
28
- return O(async () => {
19
+ setup(R, { emit: p }) {
20
+ const o = E(), i = x(), c = N(), { isTestPartner: b } = C(), { isFeatureEnabled: g } = V(), a = r(() => i.isStripoInitialized), s = r(() => b()), O = [
21
+ { type: "newVersionPopup", component: A },
22
+ { type: "genericOnboarding", component: P },
23
+ { type: "textBlockOnboarding", component: H },
24
+ { type: "versionHistoryOnboarding", component: F },
25
+ { type: "ampOnboarding", component: w },
26
+ { type: "itemsOnboarding", component: B },
27
+ { type: "editorTabBarOnboarding", component: T },
28
+ { type: "recommendationStrategyOnboarding", component: _ },
29
+ { type: "recommendationLegacyStrategyOnboarding", component: M }
30
+ ], f = (n) => s.value || !a.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), l = r(() => O.filter((n) => f(n.type)));
31
+ S(async () => {
29
32
  await o.fetchUserModalState();
30
- }), t(
31
- () => r.isVersionHistoryOpen,
32
- (n, i) => {
33
- n && !i && o.shouldShowOnboarding("versionHistoryOnboarding") && o.start("versionHistoryOnboarding"), !n && i && o.isActive("versionHistoryOnboarding") && o.close("versionHistoryOnboarding");
33
+ }), e(
34
+ () => i.isVersionHistoryOpen,
35
+ (n, t) => {
36
+ n && !t && (o.isActive("editorTabBarOnboarding") && o.closeForSession("editorTabBarOnboarding"), o.shouldShowOnboarding("versionHistoryOnboarding") && o.start("versionHistoryOnboarding")), !n && t && o.isActive("versionHistoryOnboarding") && o.close("versionHistoryOnboarding");
34
37
  }
35
- ), t(
36
- () => a.emailFormat,
37
- (n, i) => {
38
- i !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
38
+ ), e(
39
+ () => c.emailFormat,
40
+ (n, t) => {
41
+ t !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
39
42
  }
40
- ), t(
41
- () => r.isPreviewModeOpen,
43
+ ), e(
44
+ () => i.isPreviewModeOpen,
42
45
  (n) => {
43
46
  !n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
44
47
  }
45
- ), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore: a, isTestPartner: s, isStripoReady: m, isTestPartnerActive: p, onboardingConfigs: d, shouldShow: c, visibleOnboardings: b };
48
+ );
49
+ const d = h(!1), v = (n) => {
50
+ n === "newVersionPopup" && (d.value = !0), p("onboarding-finished");
51
+ }, m = r(() => i.isNormalMode && !i.isPreviewModeOpen), u = r(() => a.value && o.isFetched && g("accessibilityTesting") && !s.value && m.value && !(o.shouldShowOnboarding("newVersionPopup") && !d.value) && !o.isOnboardingActive() && !o.closedThisSession.includes("editorTabBarOnboarding") && o.shouldShowOnboarding("editorTabBarOnboarding"));
52
+ return e(
53
+ u,
54
+ (n) => {
55
+ n && o.start("editorTabBarOnboarding");
56
+ },
57
+ { immediate: !0 }
58
+ ), e(
59
+ m,
60
+ (n) => {
61
+ !n && o.isActive("editorTabBarOnboarding") && o.closeForSession("editorTabBarOnboarding");
62
+ }
63
+ ), { __sfc: !0, emit: p, onboardingStore: o, editorStore: i, previewStore: c, isTestPartner: b, isFeatureEnabled: g, isStripoReady: a, isTestPartnerActive: s, onboardingConfigs: O, shouldShow: f, visibleOnboardings: l, isNewVersionPopupClosed: d, handleFinished: v, isTourAnchored: m, canStartTabBarTour: u };
46
64
  }
47
65
  });
48
66
  export {
49
- U as default
67
+ Z as default
50
68
  };
@@ -2,7 +2,7 @@ import r from "./WpModal.vue2.js";
2
2
  import s from "../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var i = function() {
4
4
  var t = this, o = t._self._c, e = t._self._setupProxy;
5
- return o(e.InModalV2, { attrs: { id: t.id, "description-status": "", status: "", "close-button-status": t.closeButtonStatus, "close-on-outside-click": t.closeOnOutsideClick, "description-text": t.description, "footer-button-group-options": t.footerButtonOptions, "footer-status": t.footerStatus, size: t.size, "title-text": t.title }, on: { cancelOrBackButtonEvent: function(n) {
5
+ return o(e.InModalV2, { attrs: { id: t.id, "description-status": "", status: "", "close-button-status": t.closeButtonStatus, "close-on-outside-click": t.closeOnOutsideClick, "description-text": t.description, "footer-button-group-options": t.footerButtonOptions, "footer-status": t.footerStatus, size: t.size, state: t.state, "title-text": t.title }, on: { cancelOrBackButtonEvent: function(n) {
6
6
  return e.emit("close");
7
7
  }, onCloseEvent: function(n) {
8
8
  return e.emit("close");
@@ -1,11 +1,12 @@
1
1
  import { defineComponent as e } from "vue";
2
2
  import { InModalV2 as o } from "@useinsider/design-system-vue";
3
- const u = /* @__PURE__ */ e({
3
+ const n = /* @__PURE__ */ e({
4
4
  __name: "WpModal",
5
5
  props: {
6
6
  id: null,
7
7
  title: null,
8
8
  description: { default: "" },
9
+ state: { default: "default" },
9
10
  size: { default: "small" },
10
11
  footerButtonOptions: { default: void 0 },
11
12
  closeButtonStatus: { type: Boolean, default: !0 },
@@ -13,10 +14,10 @@ const u = /* @__PURE__ */ e({
13
14
  footerStatus: { type: Boolean, default: !0 }
14
15
  },
15
16
  emits: ["close", "primary-action", "secondary-action"],
16
- setup(l, { emit: t }) {
17
+ setup(a, { emit: t }) {
17
18
  return { __sfc: !0, emit: t, InModalV2: o };
18
19
  }
19
20
  });
20
21
  export {
21
- u as default
22
+ n as default
22
23
  };
@@ -0,0 +1,45 @@
1
+ import { ToasterTypeOptions as p } from "../enums/toaster.js";
2
+ import { useEditorStore as T } from "../stores/editor.js";
3
+ import { findEditorApi as g, EDITOR_NOT_READY_MESSAGE as m } from "../utils/stripoEditorApi.js";
4
+ import { useToaster as y } from "./useToaster.js";
5
+ const I = () => {
6
+ const e = T(), { showToaster: d } = y(), s = (i) => {
7
+ var l;
8
+ const o = (l = g()) == null ? void 0 : l.accessibilityApi;
9
+ if (!o) {
10
+ d({ type: p.Error, message: m });
11
+ return;
12
+ }
13
+ i(o);
14
+ }, t = () => s((i) => {
15
+ i.openAccessibilityTestingMode(), e.isAccessibilityTestingOpen = !0;
16
+ }), c = () => {
17
+ var i;
18
+ try {
19
+ (i = g()) == null || i.accessibilityApi.closeAccessibilityTestingMode();
20
+ } finally {
21
+ e.isAccessibilityTestingOpen = !1, e.imagesHidden = !1, e.colorVisionDeficiency = "";
22
+ }
23
+ }, a = () => e.isAccessibilityTestingOpen ? c() : t(), n = () => s((i) => {
24
+ i.showImages(), e.imagesHidden = !1;
25
+ }), r = () => s((i) => {
26
+ i.hideImages(), e.imagesHidden = !0;
27
+ });
28
+ return {
29
+ openAccessibilityTestingMode: t,
30
+ closeAccessibilityTestingMode: c,
31
+ toggleAccessibilityTestingMode: a,
32
+ showImages: n,
33
+ hideImages: r,
34
+ toggleImages: () => e.imagesHidden ? n() : r(),
35
+ setColorVisionDeficiency: (i) => s((o) => {
36
+ o.setColorVisionDeficiency(i), e.colorVisionDeficiency = i;
37
+ }),
38
+ switchToDesktopPreview: () => s((i) => i.switchToDesktopPreview()),
39
+ switchToMobilePreview: () => s((i) => i.switchToMobilePreview()),
40
+ toggleCodeEditor: () => s((i) => i.emitToggleCodeEditor())
41
+ };
42
+ };
43
+ export {
44
+ I as useAccessibilityApi
45
+ };
@@ -0,0 +1,52 @@
1
+ import { ToasterTypeOptions as l } from "../enums/toaster.js";
2
+ import { ref as p } from "vue";
3
+ import { useToaster as u } from "./useToaster.js";
4
+ import { useTranslations as f } from "./useTranslations.js";
5
+ const d = ["accessExpired", "domainRestricted", "ipRestricted", "insiderAccessRestricted"], n = p(null), a = (e) => {
6
+ try {
7
+ return new URL(e, window.location.href).origin === window.location.origin;
8
+ } catch {
9
+ return !0;
10
+ }
11
+ }, g = (e) => {
12
+ try {
13
+ const o = new URL(e, window.location.href);
14
+ return o.origin === window.location.origin ? o.href : "";
15
+ } catch {
16
+ return "";
17
+ }
18
+ }, w = (e) => {
19
+ try {
20
+ const o = JSON.parse(e);
21
+ return o && typeof o == "object" && Object.keys(o).length ? o : null;
22
+ } catch {
23
+ return null;
24
+ }
25
+ }, y = (e) => typeof (e == null ? void 0 : e.message) == "string" ? e.message : "", s = (e) => y(e) || f()("user-management.collaborate-forbidden-action"), c = (e) => {
26
+ u().showToaster({ type: l.Error, message: e });
27
+ }, R = (e, o, t) => {
28
+ if (t && !a(t))
29
+ return;
30
+ const r = w(o);
31
+ if (e === 403) {
32
+ c(s(r));
33
+ return;
34
+ }
35
+ if (e === 401 && (r == null ? void 0 : r.type) === "groupLevelAccess") {
36
+ c(s(r));
37
+ return;
38
+ }
39
+ if (e === 401 && typeof (r == null ? void 0 : r.type) == "string" && d.includes(r.type)) {
40
+ const i = typeof r.redirect == "string" ? g(r.redirect) : "";
41
+ if (i) {
42
+ window.location.replace(i);
43
+ return;
44
+ }
45
+ }
46
+ e !== 401 && e !== 419 || n.value || (window.isSessionExpired = !0, n.value = { status: e, data: r });
47
+ }, T = () => ({ authError: n });
48
+ export {
49
+ a as isPanelOrigin,
50
+ R as reportAuthError,
51
+ T as useAuthError
52
+ };
@@ -1,17 +1,17 @@
1
1
  import { useConfig as E } from "./useConfig.js";
2
- import { useEditorLock as p } from "./useEditorLock.js";
3
- import { useAutosaveStore as A, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
4
- import { useEditorStore as f } from "../stores/editor.js";
2
+ import { useEditorLock as f } from "./useEditorLock.js";
3
+ import { useAutosaveStore as p, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
4
+ import { useEditorStore as A } from "../stores/editor.js";
5
5
  import { computed as y, watch as I, onUnmounted as L } from "vue";
6
6
  const w = 18e4, v = 6e4, R = (b) => {
7
- const { isFeatureEnabled: S } = E(), o = f(), t = A(), { isEditorBusy: g } = p();
7
+ const { isFeatureEnabled: S } = E(), o = A(), t = p(), { isEditorBusy: g } = f();
8
8
  let i = null, c = 0;
9
9
  const u = y(
10
10
  () => S("autosave") && t.isOn
11
11
  ), m = () => o.hasChanges && o.isInSaveableState, h = () => ({
12
12
  hasChanges: o.hasChanges,
13
13
  isInSaveableState: o.isInSaveableState
14
- }), r = async (e) => {
14
+ }), l = async (e) => {
15
15
  if (!u.value) {
16
16
  console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
17
17
  return;
@@ -28,7 +28,7 @@ const w = 18e4, v = 6e4, R = (b) => {
28
28
  console.debug("guido:autosave:skipped", { trigger: e, reason: "editor-busy" });
29
29
  return;
30
30
  }
31
- console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
31
+ e === "visibility" && (c = Date.now()), console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
32
32
  try {
33
33
  if (await b() === void 0) {
34
34
  console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = s.ERROR;
@@ -53,22 +53,22 @@ const w = 18e4, v = 6e4, R = (b) => {
53
53
  });
54
54
  return;
55
55
  }
56
- c = Date.now(), r("visibility");
56
+ l("visibility");
57
57
  }, d = () => {
58
58
  i && (clearInterval(i), i = null);
59
- }, l = () => {
59
+ }, r = () => {
60
60
  document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
61
61
  };
62
62
  I(
63
63
  u,
64
64
  (e) => {
65
65
  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);
66
+ console.debug("guido:autosave:interval-tick"), l("interval");
67
+ }, w), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), r(), t.status = s.IDLE);
68
68
  },
69
69
  { immediate: !0 }
70
70
  ), L(() => {
71
- d(), l(), t.status = s.IDLE, t.lastSavedAt = null;
71
+ d(), r(), t.status = s.IDLE, t.lastSavedAt = null;
72
72
  });
73
73
  };
74
74
  export {
@@ -1,70 +1,138 @@
1
- import { useEmailTemplateApplier as w, resetEmailTemplateApplier as _ } from "./useEmailTemplateApplier.js";
2
- import { useToaster as I } from "./useToaster.js";
3
- import { useTranslations as P } from "./useTranslations.js";
4
- import { ToasterTypeOptions as S } from "../enums/toaster.js";
5
- import { getActivePinia as v } from "pinia";
6
- import { watch as B, onUnmounted as D } from "vue";
7
- const x = "email_template", L = "chat", M = "guido:debug:ai", R = () => {
1
+ import { useEmailTemplateApplier as z, resetEmailTemplateApplier as J } from "./useEmailTemplateApplier.js";
2
+ import { useToaster as Q } from "./useToaster.js";
3
+ import { useTranslations as V } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as Z } from "../enums/toaster.js";
5
+ import { useGuidoEmailEditorStore as W } from "../stores/guido-email-editor.js";
6
+ import { getActivePinia as k } from "pinia";
7
+ import { onUnmounted as tt, watch as et } from "vue";
8
+ const rt = "email_template", nt = "chat", ot = "guido:debug:ai", it = 2, lt = 500, ct = (b, p) => `${b}:${p ?? 1}`;
9
+ let S = null;
10
+ const at = () => {
8
11
  if (typeof window > "u")
9
12
  return !1;
10
13
  try {
11
- return window.localStorage.getItem(M) === "1";
14
+ return window.localStorage.getItem(ot) === "1";
12
15
  } catch {
13
16
  return !1;
14
17
  }
15
- }, H = () => {
16
- const c = v();
17
- if (!c)
18
+ }, bt = () => {
19
+ const b = k();
20
+ if (!b)
18
21
  return;
19
- const l = c._s, p = l == null ? void 0 : l.get(L);
20
- if (!p)
21
- return;
22
- const { markPending: d, applyTemplate: f, applyTemplateDebounced: T } = w(), { showToaster: E } = I(), h = P(), y = (r, t) => {
23
- const e = h(r);
24
- return e === r ? t : e;
25
- }, i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), u = R(), A = (r, t) => {
26
- u && console.debug(`[guido:cortex] msg=${r ?? "?"} type=${(t == null ? void 0 : t.type) ?? "?"}`, t);
27
- }, b = (r) => {
28
- if (r.blueprintType !== x)
22
+ const p = W(), M = Symbol("cortexBlueprintBridge");
23
+ S = M, p.$patch((t) => {
24
+ t.bridgeActive = !0;
25
+ });
26
+ const { markPending: F, applyTemplate: H, applyTemplateDebounced: O } = z(), { showToaster: C } = Q(), G = V(), E = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
27
+ let s = null;
28
+ const d = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), B = at();
29
+ let w = null, m = null, A;
30
+ const K = (t, r) => {
31
+ B && console.debug(`[guido:cortex] msg=${t ?? "?"} type=${(r == null ? void 0 : r.type) ?? "?"}`, r);
32
+ }, U = () => new Set((A == null ? void 0 : A.appliedBlueprintKeys) ?? []), Y = (t) => t instanceof Error ? t.message : String(t), D = (t, r, n, e) => {
33
+ if (S !== M)
34
+ return;
35
+ const o = p.applyAcks[t], c = Math.max(Date.now(), ((o == null ? void 0 : o.ackAt) ?? 0) + 1), a = { status: r, requestedAt: n, ackAt: c };
36
+ e !== void 0 && (a.error = Y(e)), p.$patch((l) => {
37
+ l.applyAcks = { ...l.applyAcks, [t]: a };
38
+ });
39
+ }, I = (t) => (d.get(t) ?? 0) > 0, P = (t) => (s == null ? void 0 : s.key) === t, v = async (t, r, n) => {
40
+ var a, l, h;
41
+ const e = ((a = r.blueprintData) == null ? void 0 : a.html) ?? "", o = ((l = r.blueprintData) == null ? void 0 : l.css) ?? "", c = r.applyRequestedAt ?? 0;
42
+ d.set(t, (d.get(t) ?? 0) + 1);
43
+ try {
44
+ const i = n === "debounced" ? await O(t, { html: e, css: o }) : await H(t, { html: e, css: o });
45
+ if (i.status === "superseded")
46
+ return;
47
+ if (i.status === "applied") {
48
+ E.set(t, e), u.delete(t), D(t, "applied", c);
49
+ return;
50
+ }
51
+ const y = u.get(t), j = (y == null ? void 0 : y.html) === e ? y.count + 1 : 1;
52
+ u.set(t, { html: e, count: j }), D(t, "failed", c, i.error);
53
+ } catch (i) {
54
+ console.error("[guido:apply] apply threw before it could settle", i), D(t, "failed", c, i);
55
+ } finally {
56
+ d.set(t, (d.get(t) ?? 1) - 1);
57
+ const i = T.get(t);
58
+ i && !I(t) && (T.delete(t), P(t) && (((h = i.blueprintData) == null ? void 0 : h.html) ?? "") !== e && v(t, i, n));
59
+ }
60
+ }, N = (t) => {
61
+ var h;
62
+ if (t.blueprintType !== rt)
29
63
  return;
30
- const t = r.blueprintId, e = r.blueprintData;
31
- if (!t || !(e != null && e.html))
64
+ const { blueprintId: r } = t, n = (h = t.blueprintData) == null ? void 0 : h.html;
65
+ if (!r || !n)
32
66
  return;
33
- if (!r.applyRequested) {
34
- d(t);
67
+ const e = ct(r, t.version);
68
+ if (!t.applyRequested) {
69
+ F(e);
70
+ return;
71
+ }
72
+ const o = t.applyRequestedAt ?? 0, c = _.get(e);
73
+ if (c === void 0 || o > c) {
74
+ const i = c === void 0;
75
+ if (_.set(e, o), u.delete(e), (!s || o >= s.requestedAt) && (s = { key: e, requestedAt: o }), i && U().has(e)) {
76
+ E.set(e, n);
77
+ return;
78
+ }
79
+ v(e, t, "immediate");
80
+ return;
81
+ }
82
+ const a = E.get(e);
83
+ if (a === n || !P(e))
35
84
  return;
85
+ const l = u.get(e);
86
+ if (!((l == null ? void 0 : l.html) === n && l.count >= it)) {
87
+ if (a === void 0) {
88
+ if (I(e)) {
89
+ T.set(e, t);
90
+ return;
91
+ }
92
+ v(e, t, "immediate");
93
+ return;
94
+ }
95
+ f.get(e) !== n && (f.set(e, n), v(e, t, "debounced").finally(() => {
96
+ f.get(e) === n && f.delete(e);
97
+ }));
36
98
  }
37
- const o = i.get(t);
38
- o === void 0 ? (i.set(t, e.html), f(t, e)) : o !== e.html && (i.set(t, e.html), T(t, e));
39
- }, s = (r) => r === void 0 || a.has(r) ? !1 : (a.add(r), E({
40
- type: S.Error,
41
- message: y("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
42
- }), !0), m = B(
43
- () => p.messages,
44
- (r) => {
45
- Array.isArray(r) && r.forEach((t) => {
46
- const e = t == null ? void 0 : t.id;
47
- (t == null ? void 0 : t.isError) === !0 && s(e) && u && console.debug(`[guido:cortex] message-level error id=${e}`, t);
48
- const o = t == null ? void 0 : t.segments;
49
- Array.isArray(o) && o.forEach((n) => {
50
- if (n)
51
- switch (A(e, n), n.type) {
52
- case "blueprint":
53
- b(n);
54
- break;
55
- case "error":
56
- s(e);
57
- break;
58
- }
59
- });
99
+ }, R = (t) => t === void 0 || g.has(t) ? !1 : (g.add(t), C({
100
+ type: Z.Error,
101
+ message: G("newsletter.ai-template-failed")
102
+ }), !0), X = (t) => {
103
+ Array.isArray(t) && t.forEach((r) => {
104
+ const n = r == null ? void 0 : r.id;
105
+ (r == null ? void 0 : r.isError) === !0 && R(n) && B && console.debug(`[guido:cortex] message-level error id=${n}`, r);
106
+ const e = r == null ? void 0 : r.segments;
107
+ Array.isArray(e) && e.forEach((o) => {
108
+ if (o)
109
+ switch (K(n, o), o.type) {
110
+ case "blueprint":
111
+ N(o);
112
+ break;
113
+ case "error":
114
+ R(n);
115
+ break;
116
+ }
60
117
  });
61
- },
62
- { deep: !0, immediate: !0 }
63
- );
64
- D(() => {
65
- m(), i.clear(), a.clear(), _();
118
+ });
119
+ }, $ = () => {
120
+ w !== null && (clearInterval(w), w = null);
121
+ }, q = () => {
122
+ var t;
123
+ return (t = b._s) == null ? void 0 : t.get(nt);
124
+ }, L = (t) => {
125
+ A = t, m = et(() => t.messages, X, { deep: !0, immediate: !0 });
126
+ }, x = q();
127
+ x ? L(x) : w = setInterval(() => {
128
+ const t = q();
129
+ t && ($(), L(t));
130
+ }, lt), tt(() => {
131
+ $(), m == null || m(), A = void 0, E.clear(), f.clear(), _.clear(), u.clear(), s = null, d.clear(), T.clear(), g.clear(), S === M && (S = null, p.$patch((t) => {
132
+ t.bridgeActive = !1, t.applyAcks = {};
133
+ }), J());
66
134
  });
67
135
  };
68
136
  export {
69
- H as useCortexBlueprintBridge
137
+ bt as useCortexBlueprintBridge
70
138
  };