@useinsider/guido 3.19.0-beta.acb00a2 → 3.19.0-beta.c604f7d
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 +21 -20
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +72 -71
- package/dist/components/organisms/AutoSaveController.vue2.js +10 -8
- 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 +36 -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/composables/useAccessibilityApi.js +35 -0
- package/dist/composables/useActionsApi.js +20 -24
- package/dist/composables/useCortexBlueprintBridge.js +54 -122
- package/dist/composables/useCustomInterfaceAppearance.js +42 -41
- package/dist/composables/useEmailTemplateApplier.js +52 -108
- package/dist/config/i18n/en/labels.json.js +36 -4
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/guido.css +1 -1
- package/dist/sprite.svg +6 -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/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/composables/useAccessibilityApi.d.ts +15 -0
- package/dist/src/composables/useActionsApi.d.ts +2 -2
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +3 -2
- package/dist/src/composables/useEmailTemplateApplier.d.ts +5 -18
- 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 +10 -20
- package/dist/src/stores/onboarding.d.ts +952 -21
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/timeUtil.d.ts +5 -0
- package/dist/static/styles/components/accessibility.css.js +234 -0
- package/dist/static/styles/variables.css.js +2 -0
- package/dist/stores/editor.js +7 -4
- package/dist/stores/guido-email-editor.js +1 -3
- package/dist/stores/onboarding.js +43 -21
- package/dist/utils/timeUtil.js +6 -17
- package/package.json +1 -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 → AutoSaveStatus.vue.d.ts} +0 -0
|
@@ -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
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
try {
|
|
7
|
+
i().closeAccessibilityTestingMode();
|
|
8
|
+
} finally {
|
|
9
|
+
e.isAccessibilityTestingOpen = !1, e.imagesHidden = !1, e.colorVisionDeficiency = "";
|
|
10
|
+
}
|
|
11
|
+
}, l = () => e.isAccessibilityTestingOpen ? o() : s(), g = () => i().isAccessibilityTestingModeOpen(), t = () => {
|
|
12
|
+
i().showImages(), e.imagesHidden = !1;
|
|
13
|
+
}, c = () => {
|
|
14
|
+
i().hideImages(), e.imagesHidden = !0;
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
openAccessibilityTestingMode: s,
|
|
18
|
+
closeAccessibilityTestingMode: o,
|
|
19
|
+
toggleAccessibilityTestingMode: l,
|
|
20
|
+
isAccessibilityTestingModeOpen: g,
|
|
21
|
+
showImages: t,
|
|
22
|
+
hideImages: c,
|
|
23
|
+
toggleImages: () => e.imagesHidden ? t() : c(),
|
|
24
|
+
setColorVisionDeficiency: (n) => {
|
|
25
|
+
i().setColorVisionDeficiency(n), e.colorVisionDeficiency = n;
|
|
26
|
+
},
|
|
27
|
+
getColorVisionDeficiency: () => i().getColorVisionDeficiency(),
|
|
28
|
+
switchToDesktopPreview: () => i().switchToDesktopPreview(),
|
|
29
|
+
switchToMobilePreview: () => i().switchToMobilePreview(),
|
|
30
|
+
toggleCodeEditor: () => i().emitToggleCodeEditor()
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
A as useAccessibilityApi
|
|
35
|
+
};
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { filterAmpErrors as v } from "../utils/ampErrorFilter.js";
|
|
2
2
|
import { useToaster as y } from "./useToaster.js";
|
|
3
|
-
const D = 1e4,
|
|
4
|
-
const
|
|
5
|
-
() =>
|
|
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
6
|
l
|
|
7
|
-
),
|
|
8
|
-
clearTimeout(
|
|
7
|
+
), p = (A) => (t) => {
|
|
8
|
+
clearTimeout(w), A(t);
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
w(d(A), d(s));
|
|
12
|
-
} catch (r) {
|
|
13
|
-
clearTimeout(c), s(r instanceof Error ? r : new Error(String(r)));
|
|
14
|
-
}
|
|
10
|
+
u(p(T), p(m));
|
|
15
11
|
}), I = () => {
|
|
16
|
-
const { handleError: n } = y(), l = (t = {}) =>
|
|
12
|
+
const { handleError: n } = y(), l = (t = {}) => s(
|
|
17
13
|
"compileEmail",
|
|
18
|
-
|
|
14
|
+
d,
|
|
19
15
|
(e, a) => {
|
|
20
16
|
const o = { ...{
|
|
21
17
|
minimize: !0,
|
|
@@ -36,9 +32,9 @@ const D = 1e4, T = 3e4, p = (n, l, w) => new Promise((A, s) => {
|
|
|
36
32
|
forceAmp: !1,
|
|
37
33
|
resetDataSavedFlag: !1,
|
|
38
34
|
disableLineHeightsReplace: !0
|
|
39
|
-
}, ...t },
|
|
40
|
-
callback: (
|
|
41
|
-
|
|
35
|
+
}, ...t }, c = {
|
|
36
|
+
callback: (r, C, f, S, g) => {
|
|
37
|
+
r ? a(r) : e({
|
|
42
38
|
html: C,
|
|
43
39
|
ampHtml: f,
|
|
44
40
|
ampErrors: v(S ?? []),
|
|
@@ -47,22 +43,22 @@ const D = 1e4, T = 3e4, p = (n, l, w) => new Promise((A, s) => {
|
|
|
47
43
|
},
|
|
48
44
|
...o
|
|
49
45
|
};
|
|
50
|
-
window.StripoEditorApi.actionsApi.compileEmail(
|
|
46
|
+
window.StripoEditorApi.actionsApi.compileEmail(c);
|
|
51
47
|
}
|
|
52
48
|
);
|
|
53
49
|
return {
|
|
54
50
|
getCompiledEmail: l,
|
|
55
|
-
getTemplateData: () =>
|
|
51
|
+
getTemplateData: () => s(
|
|
56
52
|
"getTemplateData",
|
|
57
|
-
|
|
53
|
+
d,
|
|
58
54
|
(t) => {
|
|
59
|
-
const e = ({ html: a, css: i, width: o, height: E, utmParams:
|
|
55
|
+
const e = ({ html: a, css: i, width: o, height: E, utmParams: c, syncModulesIds: r }) => t({
|
|
60
56
|
html: a,
|
|
61
57
|
css: i,
|
|
62
58
|
width: o,
|
|
63
59
|
height: E,
|
|
64
|
-
utmParams:
|
|
65
|
-
syncModulesIds:
|
|
60
|
+
utmParams: c,
|
|
61
|
+
syncModulesIds: r
|
|
66
62
|
});
|
|
67
63
|
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
68
64
|
}
|
|
@@ -109,13 +105,13 @@ const D = 1e4, T = 3e4, p = (n, l, w) => new Promise((A, s) => {
|
|
|
109
105
|
}),
|
|
110
106
|
updateHtmlAndCss: (t, e) => {
|
|
111
107
|
const { actionsApi: a } = window.StripoEditorApi;
|
|
112
|
-
return
|
|
108
|
+
return s("updateHtmlAndCss", D, (i) => {
|
|
113
109
|
a.updateHtmlAndCss(t, e, () => i());
|
|
114
110
|
});
|
|
115
111
|
},
|
|
116
|
-
editorSave: () =>
|
|
112
|
+
editorSave: () => s(
|
|
117
113
|
"save",
|
|
118
|
-
|
|
114
|
+
d,
|
|
119
115
|
(t) => {
|
|
120
116
|
window.StripoEditorApi.actionsApi.save((e) => {
|
|
121
117
|
if (e) {
|
|
@@ -1,138 +1,70 @@
|
|
|
1
|
-
import { useEmailTemplateApplier as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
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 = () => {
|
|
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 = () => {
|
|
11
8
|
if (typeof window > "u")
|
|
12
9
|
return !1;
|
|
13
10
|
try {
|
|
14
|
-
return window.localStorage.getItem(
|
|
11
|
+
return window.localStorage.getItem(M) === "1";
|
|
15
12
|
} catch {
|
|
16
13
|
return !1;
|
|
17
14
|
}
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
15
|
+
}, H = () => {
|
|
16
|
+
const c = v();
|
|
17
|
+
if (!c)
|
|
21
18
|
return;
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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)
|
|
63
|
-
return;
|
|
64
|
-
const { blueprintId: r } = t, n = (h = t.blueprintData) == null ? void 0 : h.html;
|
|
65
|
-
if (!r || !n)
|
|
66
|
-
return;
|
|
67
|
-
const e = ct(r, t.version);
|
|
68
|
-
if (!t.applyRequested) {
|
|
69
|
-
F(e);
|
|
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)
|
|
70
29
|
return;
|
|
71
|
-
|
|
72
|
-
|
|
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");
|
|
30
|
+
const t = r.blueprintId, e = r.blueprintData;
|
|
31
|
+
if (!t || !(e != null && e.html))
|
|
80
32
|
return;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (a === n || !P(e))
|
|
33
|
+
if (!r.applyRequested) {
|
|
34
|
+
d(t);
|
|
84
35
|
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
|
-
}));
|
|
98
36
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Array.isArray(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
+
});
|
|
117
60
|
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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());
|
|
61
|
+
},
|
|
62
|
+
{ deep: !0, immediate: !0 }
|
|
63
|
+
);
|
|
64
|
+
D(() => {
|
|
65
|
+
m(), i.clear(), a.clear(), _();
|
|
134
66
|
});
|
|
135
67
|
};
|
|
136
68
|
export {
|
|
137
|
-
|
|
69
|
+
H as useCortexBlueprintBridge
|
|
138
70
|
};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import p from "../static/assets/icons/filled-arrow-rising.svg.js";
|
|
2
2
|
import s from "../static/assets/icons/line-change.svg.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import f from "../static/assets/icons/line-delete.svg.js";
|
|
4
|
+
import a from "../static/assets/icons/line-info.svg.js";
|
|
5
5
|
import c from "../static/assets/icons/line-plus.svg.js";
|
|
6
6
|
import l from "../static/styles/base.css.js";
|
|
7
|
-
import C from "../static/styles/components/
|
|
8
|
-
import d from "../static/styles/components/
|
|
9
|
-
import u from "../static/styles/components/
|
|
10
|
-
import h from "../static/styles/components/
|
|
11
|
-
import I from "../static/styles/components/button.css.js";
|
|
12
|
-
import g from "../static/styles/components/
|
|
13
|
-
import w from "../static/styles/components/
|
|
14
|
-
import y from "../static/styles/components/
|
|
15
|
-
import A from "../static/styles/components/
|
|
16
|
-
import $ from "../static/styles/components/
|
|
17
|
-
import b from "../static/styles/components/
|
|
18
|
-
import B from "../static/styles/components/
|
|
19
|
-
import D from "../static/styles/components/
|
|
20
|
-
import R from "../static/styles/components/
|
|
21
|
-
import P from "../static/styles/components/
|
|
22
|
-
import T from "../static/styles/components/
|
|
23
|
-
import x from "../static/styles/components/
|
|
24
|
-
import M from "../static/styles/components/
|
|
25
|
-
import O from "../static/styles/
|
|
7
|
+
import C from "../static/styles/components/accessibility.css.js";
|
|
8
|
+
import d from "../static/styles/components/alert-message.css.js";
|
|
9
|
+
import u from "../static/styles/components/amp-block.css.js";
|
|
10
|
+
import h from "../static/styles/components/base-input.css.js";
|
|
11
|
+
import I from "../static/styles/components/button-group.css.js";
|
|
12
|
+
import g from "../static/styles/components/button.css.js";
|
|
13
|
+
import w from "../static/styles/components/combobox.css.js";
|
|
14
|
+
import y from "../static/styles/components/counter.css.js";
|
|
15
|
+
import A from "../static/styles/components/dropdown-menu.css.js";
|
|
16
|
+
import $ from "../static/styles/components/loader.css.js";
|
|
17
|
+
import b from "../static/styles/components/narrow-panel.css.js";
|
|
18
|
+
import B from "../static/styles/components/popup.css.js";
|
|
19
|
+
import D from "../static/styles/components/recommendation-strategy.css.js";
|
|
20
|
+
import R from "../static/styles/components/skeleton.css.js";
|
|
21
|
+
import P from "../static/styles/components/switcher.css.js";
|
|
22
|
+
import T from "../static/styles/components/tabs.css.js";
|
|
23
|
+
import x from "../static/styles/components/tools.css.js";
|
|
24
|
+
import M from "../static/styles/components/version-history.css.js";
|
|
25
|
+
import O from "../static/styles/components/wide-panel.css.js";
|
|
26
|
+
import V from "../static/styles/variables.css.js";
|
|
26
27
|
function o(i, r) {
|
|
27
28
|
return `--guido-icon-${i}: url("data:image/svg+xml,${encodeURIComponent(r.trim())}");`;
|
|
28
29
|
}
|
|
29
|
-
const
|
|
30
|
+
const W = `:host {
|
|
30
31
|
${o("line-change", s)}
|
|
31
|
-
${o("line-delete",
|
|
32
|
+
${o("line-delete", f)}
|
|
32
33
|
${o("filled-arrow-rising", p)}
|
|
33
|
-
${o("line-info",
|
|
34
|
+
${o("line-info", a)}
|
|
34
35
|
${o("line-plus", c)}
|
|
35
|
-
}`,
|
|
36
|
-
O,
|
|
37
|
-
// Must be on top
|
|
36
|
+
}`, _ = [
|
|
38
37
|
V,
|
|
38
|
+
// Must be on top
|
|
39
|
+
W,
|
|
39
40
|
l,
|
|
40
41
|
// Must be on top
|
|
41
|
-
C,
|
|
42
42
|
d,
|
|
43
43
|
u,
|
|
44
44
|
h,
|
|
@@ -49,33 +49,34 @@ const V = `:host {
|
|
|
49
49
|
A,
|
|
50
50
|
$,
|
|
51
51
|
b,
|
|
52
|
-
|
|
52
|
+
B,
|
|
53
53
|
R,
|
|
54
54
|
P,
|
|
55
55
|
T,
|
|
56
56
|
x,
|
|
57
57
|
M,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
O,
|
|
59
|
+
D,
|
|
60
|
+
C
|
|
60
61
|
].join(`
|
|
61
62
|
|
|
62
|
-
`),
|
|
63
|
+
`), k = 3e4;
|
|
63
64
|
let e = null;
|
|
64
|
-
function
|
|
65
|
-
return e || (e = new CSSStyleSheet(), e.replaceSync(
|
|
65
|
+
function q() {
|
|
66
|
+
return e || (e = new CSSStyleSheet(), e.replaceSync(_)), e;
|
|
66
67
|
}
|
|
67
|
-
const
|
|
68
|
-
const r =
|
|
69
|
-
var
|
|
70
|
-
const t = (
|
|
68
|
+
const fo = () => ({ importCss: () => {
|
|
69
|
+
const r = q(), S = Date.now() + k, m = () => {
|
|
70
|
+
var n;
|
|
71
|
+
const t = (n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot;
|
|
71
72
|
if (t) {
|
|
72
73
|
t.adoptedStyleSheets.includes(r) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, r]);
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
|
-
Date.now() < S && requestAnimationFrame(
|
|
76
|
+
Date.now() < S && requestAnimationFrame(m);
|
|
76
77
|
};
|
|
77
|
-
|
|
78
|
+
m();
|
|
78
79
|
} });
|
|
79
80
|
export {
|
|
80
|
-
|
|
81
|
+
fo as useCustomInterfaceAppearance
|
|
81
82
|
};
|