@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.
- package/dist/@types/config/schemas.js +9 -8
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +104 -86
- package/dist/components/organisms/AutoSaveController.vue2.js +18 -8
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
- package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
- package/dist/components/organisms/header/EditorActions.vue.js +13 -13
- package/dist/components/organisms/header/EditorActions.vue2.js +37 -52
- package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
- package/dist/components/organisms/header/EditorActionsMenu.vue2.js +98 -0
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +32 -23
- package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
- package/dist/components/organisms/header/RightSlot.vue.js +9 -8
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +56 -38
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useAccessibilityApi.js +45 -0
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useAutoSave.js +11 -11
- package/dist/composables/useCortexBlueprintBridge.js +122 -54
- package/dist/composables/useCustomInterfaceAppearance.js +42 -41
- package/dist/composables/useEmailTemplateApplier.js +111 -50
- package/dist/composables/useHttp.js +64 -54
- package/dist/composables/useLegacyStrategyConversion.js +23 -19
- package/dist/composables/useStripo.js +24 -20
- package/dist/composables/useToaster.js +17 -15
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/config/i18n/en/labels.json.js +36 -4
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/config/migrator/index.js +14 -13
- package/dist/config/migrator/itemsBlockMigrator.js +236 -248
- package/dist/config/migrator/recommendationMigrator.js +28 -21
- package/dist/config/migrator/recommendationPartnerMigrator.js +56 -0
- package/dist/enums/extensions/recommendationBlock.js +30 -29
- package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
- package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
- package/dist/extensions/Blocks/Items/template.js +219 -204
- package/dist/extensions/Blocks/Recommendation/block.js +54 -88
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +32 -51
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +11 -12
- package/dist/guido.css +1 -1
- package/dist/sprite.svg +10 -0
- package/dist/src/@types/config/schemas.d.ts +2 -0
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +3 -1
- package/dist/src/components/organisms/header/AutoSaveStatus.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -3
- package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
- package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
- package/dist/src/composables/useActionsApi.d.ts +2 -2
- package/dist/src/composables/useAuthError.d.ts +12 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +2 -3
- package/dist/src/composables/useEmailTemplateApplier.d.ts +18 -5
- package/dist/src/composables/useGuidoActions.d.ts +2 -0
- package/dist/src/composables/useHttp.d.ts +2 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -6
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +13 -7
- package/dist/src/mock/cortexChatStore.d.ts +12 -0
- package/dist/src/stores/autosave.d.ts +73 -1
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/stores/editor.d.ts +109 -0
- package/dist/src/stores/guido-email-editor.d.ts +20 -10
- package/dist/src/stores/onboarding.d.ts +956 -21
- package/dist/src/stores/recommendation.d.ts +5 -0
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/dateUtil.d.ts +10 -0
- package/dist/src/utils/genericUtil.d.ts +3 -0
- package/dist/src/utils/timeUtil.d.ts +5 -0
- package/dist/static/styles/components/accessibility.css.js +234 -0
- package/dist/static/styles/components/version-history.css.js +2 -6
- package/dist/static/styles/variables.css.js +2 -0
- package/dist/stores/autosave.js +12 -7
- package/dist/stores/editor.js +7 -4
- package/dist/stores/guido-email-editor.js +3 -1
- package/dist/stores/onboarding.js +47 -21
- package/dist/utils/pairProductVariables.js +71 -71
- package/dist/utils/timeUtil.js +6 -17
- package/package.json +2 -1
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- /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
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var n = this,
|
|
5
|
-
return
|
|
6
|
-
return e
|
|
7
|
-
return
|
|
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
|
-
},
|
|
11
|
-
|
|
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
|
|
18
|
+
const f = a.exports;
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
f as default
|
|
21
21
|
};
|
|
@@ -1,50 +1,68 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
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(
|
|
18
|
-
const o =
|
|
19
|
-
{ type: "newVersionPopup", component:
|
|
20
|
-
{ type: "genericOnboarding", component:
|
|
21
|
-
{ type: "textBlockOnboarding", component:
|
|
22
|
-
{ type: "versionHistoryOnboarding", component:
|
|
23
|
-
{ type: "ampOnboarding", component:
|
|
24
|
-
{ type: "itemsOnboarding", component:
|
|
25
|
-
{ type: "
|
|
26
|
-
{ type: "
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
}),
|
|
31
|
-
() =>
|
|
32
|
-
(n,
|
|
33
|
-
n && !
|
|
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
|
-
),
|
|
36
|
-
() =>
|
|
37
|
-
(n,
|
|
38
|
-
|
|
38
|
+
), e(
|
|
39
|
+
() => c.emailFormat,
|
|
40
|
+
(n, t) => {
|
|
41
|
+
t !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
|
|
39
42
|
}
|
|
40
|
-
),
|
|
41
|
-
() =>
|
|
43
|
+
), e(
|
|
44
|
+
() => i.isPreviewModeOpen,
|
|
42
45
|
(n) => {
|
|
43
46
|
!n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
|
|
44
47
|
}
|
|
45
|
-
)
|
|
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
|
-
|
|
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
|
|
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(
|
|
17
|
+
setup(a, { emit: t }) {
|
|
17
18
|
return { __sfc: !0, emit: t, InModalV2: o };
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
21
|
export {
|
|
21
|
-
|
|
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
|
|
3
|
-
import { useAutosaveStore as
|
|
4
|
-
import { useEditorStore as
|
|
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 =
|
|
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
|
-
}),
|
|
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
|
-
|
|
56
|
+
l("visibility");
|
|
57
57
|
}, d = () => {
|
|
58
58
|
i && (clearInterval(i), i = null);
|
|
59
|
-
},
|
|
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"),
|
|
67
|
-
}, w), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(),
|
|
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(),
|
|
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
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
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(
|
|
14
|
+
return window.localStorage.getItem(ot) === "1";
|
|
12
15
|
} catch {
|
|
13
16
|
return !1;
|
|
14
17
|
}
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
if (!
|
|
18
|
+
}, bt = () => {
|
|
19
|
+
const b = k();
|
|
20
|
+
if (!b)
|
|
18
21
|
return;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
31
|
-
if (!
|
|
64
|
+
const { blueprintId: r } = t, n = (h = t.blueprintData) == null ? void 0 : h.html;
|
|
65
|
+
if (!r || !n)
|
|
32
66
|
return;
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Array.isArray(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
137
|
+
bt as useCortexBlueprintBridge
|
|
70
138
|
};
|