@useinsider/guido 3.19.0-beta.4b9be3a → 3.19.0-beta.575d19c
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/README.md +21 -3
- package/dist/@types/config/schemas.js +76 -67
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +94 -91
- package/dist/components/organisms/AutoSaveController.vue2.js +18 -8
- package/dist/components/organisms/base/Toaster.vue2.js +13 -12
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +78 -57
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +28 -42
- 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 +35 -53
- 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 -34
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
- package/dist/composables/useAccessibilityApi.js +45 -0
- package/dist/composables/useActionsApi.js +44 -43
- package/dist/composables/useCodeEditorApi.js +23 -9
- package/dist/composables/useCortexBlueprintBridge.js +54 -120
- package/dist/composables/useCustomInterfaceAppearance.js +67 -52
- package/dist/composables/useEmailTemplateApplier.js +51 -96
- package/dist/composables/useHtmlValidator.js +87 -82
- package/dist/composables/useLegacyStrategyConversion.js +61 -0
- package/dist/composables/useRecommendation.js +40 -35
- package/dist/composables/useStripo.js +30 -30
- package/dist/composables/useToaster.js +14 -20
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useVersionHistoryApi.js +33 -24
- package/dist/config/i18n/en/labels.json.js +36 -4
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/enums/extensions/recommendationBlock.js +49 -33
- package/dist/extensions/Blocks/Recommendation/block.js +61 -42
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +100 -94
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +130 -55
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +273 -92
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +46 -37
- package/dist/sprite.svg +6 -0
- package/dist/src/@types/config/schemas.d.ts +18 -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/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
- package/dist/src/composables/useActionsApi.d.ts +2 -2
- package/dist/src/composables/useConfig.d.ts +6 -0
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +3 -4
- package/dist/src/composables/useEmailTemplateApplier.d.ts +5 -26
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +7 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +162 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
- package/dist/src/services/recommendationApi.d.ts +2 -1
- package/dist/src/stores/config.d.ts +342 -0
- package/dist/src/stores/editor.d.ts +109 -0
- package/dist/src/stores/guido-email-editor.d.ts +10 -32
- package/dist/src/stores/onboarding.d.ts +1865 -136
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/stripoEditorApi.d.ts +4 -0
- package/dist/src/utils/timeUtil.d.ts +5 -0
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
- package/dist/static/assets/icons/line-info.svg.js +5 -0
- package/dist/static/styles/components/accessibility.css.js +234 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +104 -9
- package/dist/static/styles/components/skeleton.css.js +23 -0
- package/dist/static/styles/variables.css.js +2 -0
- package/dist/stores/config.js +74 -60
- package/dist/stores/editor.js +7 -4
- package/dist/stores/guido-email-editor.js +1 -3
- package/dist/stores/onboarding.js +79 -47
- package/dist/stores/unsubscribe.js +3 -3
- package/dist/utils/stripoEditorApi.js +11 -0
- package/dist/utils/templatePreparation.js +55 -55
- 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 → extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts} +0 -0
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { filterAmpErrors as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { filterAmpErrors as y } from "../utils/ampErrorFilter.js";
|
|
2
|
+
import { getEditorApi as s } from "../utils/stripoEditorApi.js";
|
|
3
|
+
import { useToaster as D } from "./useToaster.js";
|
|
4
|
+
const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
|
|
5
|
+
const f = setTimeout(
|
|
6
|
+
() => p(new Error(`${n} did not report completion within ${l}ms`)),
|
|
6
7
|
l
|
|
7
|
-
),
|
|
8
|
-
clearTimeout(
|
|
9
|
-
};
|
|
8
|
+
), c = (t) => (e) => {
|
|
9
|
+
clearTimeout(f), t(e);
|
|
10
|
+
}, d = c(p);
|
|
10
11
|
try {
|
|
11
|
-
|
|
12
|
-
} catch (
|
|
13
|
-
|
|
12
|
+
A(c(C), d);
|
|
13
|
+
} catch (t) {
|
|
14
|
+
d(t);
|
|
14
15
|
}
|
|
15
|
-
}),
|
|
16
|
-
const { handleError: n } =
|
|
16
|
+
}), P = () => {
|
|
17
|
+
const { handleError: n } = D(), l = (t = {}) => r(
|
|
17
18
|
"compileEmail",
|
|
18
19
|
T,
|
|
19
|
-
(e,
|
|
20
|
+
(e, i) => {
|
|
20
21
|
const o = { ...{
|
|
21
22
|
minimize: !0,
|
|
22
23
|
utmEntity: {
|
|
@@ -37,52 +38,52 @@ const D = 1e4, T = 3e4, p = (n, l, w) => new Promise((A, s) => {
|
|
|
37
38
|
resetDataSavedFlag: !1,
|
|
38
39
|
disableLineHeightsReplace: !0
|
|
39
40
|
}, ...t }, u = {
|
|
40
|
-
callback: (m,
|
|
41
|
-
m ?
|
|
42
|
-
html:
|
|
43
|
-
ampHtml:
|
|
44
|
-
ampErrors:
|
|
45
|
-
displayConditions:
|
|
41
|
+
callback: (m, g, w, S, v) => {
|
|
42
|
+
m ? i(m) : e({
|
|
43
|
+
html: g,
|
|
44
|
+
ampHtml: w,
|
|
45
|
+
ampErrors: y(S ?? []),
|
|
46
|
+
displayConditions: v
|
|
46
47
|
});
|
|
47
48
|
},
|
|
48
49
|
...o
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
+
s().actionsApi.compileEmail(u);
|
|
51
52
|
}
|
|
52
53
|
);
|
|
53
54
|
return {
|
|
54
55
|
getCompiledEmail: l,
|
|
55
|
-
getTemplateData: () =>
|
|
56
|
+
getTemplateData: () => r(
|
|
56
57
|
"getTemplateData",
|
|
57
58
|
T,
|
|
58
59
|
(t) => {
|
|
59
|
-
const e = ({ html:
|
|
60
|
-
html:
|
|
61
|
-
css:
|
|
60
|
+
const e = ({ html: i, css: a, width: o, height: E, utmParams: u, syncModulesIds: m }) => t({
|
|
61
|
+
html: i,
|
|
62
|
+
css: a,
|
|
62
63
|
width: o,
|
|
63
64
|
height: E,
|
|
64
65
|
utmParams: u,
|
|
65
66
|
syncModulesIds: m
|
|
66
67
|
});
|
|
67
|
-
|
|
68
|
+
s().actionsApi.getTemplateData(e);
|
|
68
69
|
}
|
|
69
70
|
),
|
|
70
71
|
activateCustomViewStyles: (t = !0) => {
|
|
71
|
-
|
|
72
|
+
s().actionsApi.activateCustomViewStyles(t);
|
|
72
73
|
},
|
|
73
74
|
getPreviewData: async (t) => {
|
|
74
75
|
try {
|
|
75
76
|
const {
|
|
76
77
|
html: e,
|
|
77
|
-
displayConditions:
|
|
78
|
-
ampHtml:
|
|
78
|
+
displayConditions: i,
|
|
79
|
+
ampHtml: a = "",
|
|
79
80
|
ampErrors: o = []
|
|
80
81
|
} = await l({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
81
82
|
return {
|
|
82
83
|
html: e,
|
|
83
|
-
ampHtml:
|
|
84
|
+
ampHtml: a,
|
|
84
85
|
ampErrors: o,
|
|
85
|
-
displayConditions:
|
|
86
|
+
displayConditions: i
|
|
86
87
|
};
|
|
87
88
|
} catch (e) {
|
|
88
89
|
return n(e, "Error loading preview"), {
|
|
@@ -94,30 +95,30 @@ const D = 1e4, T = 3e4, p = (n, l, w) => new Promise((A, s) => {
|
|
|
94
95
|
}
|
|
95
96
|
},
|
|
96
97
|
updateTimerInClonedTemplate: () => new Promise((t) => {
|
|
97
|
-
var e,
|
|
98
|
-
if (typeof ((
|
|
98
|
+
var e, i;
|
|
99
|
+
if (typeof ((i = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : i.updateTimerInClonedTemplate) != "function") {
|
|
99
100
|
t(null);
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
103
|
try {
|
|
103
|
-
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((
|
|
104
|
-
|
|
104
|
+
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((a, o) => {
|
|
105
|
+
a ? (n(a, "Failed to update timer in cloned template"), t(null)) : t(o || null);
|
|
105
106
|
});
|
|
106
|
-
} catch (
|
|
107
|
-
n(
|
|
107
|
+
} catch (a) {
|
|
108
|
+
n(a, "Failed to call updateTimerInClonedTemplate"), t(null);
|
|
108
109
|
}
|
|
109
110
|
}),
|
|
110
111
|
updateHtmlAndCss: (t, e) => {
|
|
111
|
-
const { actionsApi:
|
|
112
|
-
return
|
|
113
|
-
|
|
112
|
+
const { actionsApi: i } = s();
|
|
113
|
+
return r("updateHtmlAndCss", h, (a) => {
|
|
114
|
+
i.updateHtmlAndCss(t, e, () => a());
|
|
114
115
|
});
|
|
115
116
|
},
|
|
116
|
-
editorSave: () =>
|
|
117
|
+
editorSave: () => r(
|
|
117
118
|
"save",
|
|
118
119
|
T,
|
|
119
120
|
(t) => {
|
|
120
|
-
|
|
121
|
+
s().actionsApi.save((e) => {
|
|
121
122
|
if (e) {
|
|
122
123
|
n(e, "Failed to save template"), t(!1);
|
|
123
124
|
return;
|
|
@@ -129,5 +130,5 @@ const D = 1e4, T = 3e4, p = (n, l, w) => new Promise((A, s) => {
|
|
|
129
130
|
};
|
|
130
131
|
};
|
|
131
132
|
export {
|
|
132
|
-
|
|
133
|
+
P as useActionsApi
|
|
133
134
|
};
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { ToasterTypeOptions as d } from "../enums/toaster.js";
|
|
2
|
+
import { findEditorApi as s, EDITOR_NOT_READY_MESSAGE as p } from "../utils/stripoEditorApi.js";
|
|
3
|
+
import { useToaster as E } from "./useToaster.js";
|
|
4
|
+
const T = () => {
|
|
5
|
+
const { showToaster: i } = E(), t = (o) => {
|
|
6
|
+
var r;
|
|
7
|
+
const e = (r = s()) == null ? void 0 : r.codeEditorApi;
|
|
8
|
+
if (!e) {
|
|
9
|
+
i({ type: d.Error, message: p });
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
o(e);
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
openCodeEditor: () => {
|
|
16
|
+
t((o) => o.openCodeEditor());
|
|
17
|
+
},
|
|
18
|
+
closeCodeEditor: () => {
|
|
19
|
+
t((o) => o.closeCodeEditor());
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
9
23
|
export {
|
|
10
|
-
|
|
24
|
+
T as useCodeEditorApi
|
|
11
25
|
};
|
|
@@ -1,136 +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", it = "guido:debug:ai", ot = 2, lt = 500, ct = (E, u) => `${E}:${u ?? 1}`;
|
|
9
|
-
let y = 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), B = (t, r, n, e) => {
|
|
33
|
-
if (y !== M)
|
|
34
|
-
return;
|
|
35
|
-
const i = u.applyAcks[t], c = Math.max(Date.now(), ((i == null ? void 0 : i.ackAt) ?? 0) + 1), a = { status: r, requestedAt: n, ackAt: c };
|
|
36
|
-
e !== void 0 && (a.error = Y(e)), u.$patch((o) => {
|
|
37
|
-
o.applyAcks = { ...o.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, o, h;
|
|
41
|
-
const e = ((a = r.blueprintData) == null ? void 0 : a.html) ?? "", i = ((o = r.blueprintData) == null ? void 0 : o.css) ?? "", c = r.applyRequestedAt ?? 0;
|
|
42
|
-
d.set(t, (d.get(t) ?? 0) + 1);
|
|
43
|
-
try {
|
|
44
|
-
const l = n === "debounced" ? await O(t, { html: e, css: i }) : await H(t, { html: e, css: i });
|
|
45
|
-
if (l.status === "superseded")
|
|
46
|
-
return;
|
|
47
|
-
if (l.status === "applied") {
|
|
48
|
-
b.set(t, e), p.delete(t), B(t, "applied", c);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const S = p.get(t), j = (S == null ? void 0 : S.html) === e ? S.count + 1 : 1;
|
|
52
|
-
p.set(t, { html: e, count: j }), B(t, "failed", c, l.error);
|
|
53
|
-
} finally {
|
|
54
|
-
d.set(t, (d.get(t) ?? 1) - 1);
|
|
55
|
-
const l = T.get(t);
|
|
56
|
-
l && !I(t) && (T.delete(t), P(t) && (((h = l.blueprintData) == null ? void 0 : h.html) ?? "") !== e && v(t, l, n));
|
|
57
|
-
}
|
|
58
|
-
}, N = (t) => {
|
|
59
|
-
var h;
|
|
60
|
-
if (t.blueprintType !== rt)
|
|
61
|
-
return;
|
|
62
|
-
const { blueprintId: r } = t, n = (h = t.blueprintData) == null ? void 0 : h.html;
|
|
63
|
-
if (!r || !n)
|
|
64
|
-
return;
|
|
65
|
-
const e = ct(r, t.version);
|
|
66
|
-
if (!t.applyRequested) {
|
|
67
|
-
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)
|
|
68
29
|
return;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (c === void 0 || i > c) {
|
|
72
|
-
const l = c === void 0;
|
|
73
|
-
if (_.set(e, i), p.delete(e), (!s || i >= s.requestedAt) && (s = { key: e, requestedAt: i }), l && U().has(e)) {
|
|
74
|
-
b.set(e, n);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
v(e, t, "immediate");
|
|
30
|
+
const t = r.blueprintId, e = r.blueprintData;
|
|
31
|
+
if (!t || !(e != null && e.html))
|
|
78
32
|
return;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (a === n || !P(e))
|
|
33
|
+
if (!r.applyRequested) {
|
|
34
|
+
d(t);
|
|
82
35
|
return;
|
|
83
|
-
const o = p.get(e);
|
|
84
|
-
if (!((o == null ? void 0 : o.html) === n && o.count >= ot)) {
|
|
85
|
-
if (a === void 0) {
|
|
86
|
-
if (I(e)) {
|
|
87
|
-
T.set(e, t);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
v(e, t, "immediate");
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
f.get(e) !== n && (f.set(e, n), v(e, t, "debounced").finally(() => {
|
|
94
|
-
f.get(e) === n && f.delete(e);
|
|
95
|
-
}));
|
|
96
36
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Array.isArray(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
+
});
|
|
115
60
|
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return (t = E._s) == null ? void 0 : t.get(nt);
|
|
122
|
-
}, L = (t) => {
|
|
123
|
-
A = t, m = et(() => t.messages, X, { deep: !0, immediate: !0 });
|
|
124
|
-
}, x = q();
|
|
125
|
-
x ? L(x) : w = setInterval(() => {
|
|
126
|
-
const t = q();
|
|
127
|
-
t && ($(), L(t));
|
|
128
|
-
}, lt), tt(() => {
|
|
129
|
-
$(), m == null || m(), A = void 0, b.clear(), f.clear(), _.clear(), p.clear(), s = null, d.clear(), T.clear(), g.clear(), y === M && (y = null, u.$patch((t) => {
|
|
130
|
-
t.bridgeActive = !1, t.applyAcks = {};
|
|
131
|
-
}), J());
|
|
61
|
+
},
|
|
62
|
+
{ deep: !0, immediate: !0 }
|
|
63
|
+
);
|
|
64
|
+
D(() => {
|
|
65
|
+
m(), i.clear(), a.clear(), _();
|
|
132
66
|
});
|
|
133
67
|
};
|
|
134
68
|
export {
|
|
135
|
-
|
|
69
|
+
H as useCortexBlueprintBridge
|
|
136
70
|
};
|
|
@@ -1,67 +1,82 @@
|
|
|
1
|
-
import
|
|
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
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import P from "../static/styles/components/
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import p from "../static/assets/icons/filled-arrow-rising.svg.js";
|
|
2
|
+
import s from "../static/assets/icons/line-change.svg.js";
|
|
3
|
+
import f from "../static/assets/icons/line-delete.svg.js";
|
|
4
|
+
import a from "../static/assets/icons/line-info.svg.js";
|
|
5
|
+
import c from "../static/assets/icons/line-plus.svg.js";
|
|
6
|
+
import l from "../static/styles/base.css.js";
|
|
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";
|
|
27
|
+
function o(i, r) {
|
|
28
|
+
return `--guido-icon-${i}: url("data:image/svg+xml,${encodeURIComponent(r.trim())}");`;
|
|
25
29
|
}
|
|
26
|
-
const
|
|
27
|
-
${
|
|
28
|
-
${
|
|
29
|
-
${
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
p,
|
|
30
|
+
const W = `:host {
|
|
31
|
+
${o("line-change", s)}
|
|
32
|
+
${o("line-delete", f)}
|
|
33
|
+
${o("filled-arrow-rising", p)}
|
|
34
|
+
${o("line-info", a)}
|
|
35
|
+
${o("line-plus", c)}
|
|
36
|
+
}`, _ = [
|
|
37
|
+
V,
|
|
35
38
|
// Must be on top
|
|
36
|
-
|
|
37
|
-
C,
|
|
38
|
-
a,
|
|
39
|
-
f,
|
|
40
|
-
c,
|
|
41
|
-
u,
|
|
39
|
+
W,
|
|
42
40
|
l,
|
|
41
|
+
// Must be on top
|
|
43
42
|
d,
|
|
43
|
+
u,
|
|
44
44
|
h,
|
|
45
|
-
g,
|
|
46
45
|
I,
|
|
46
|
+
g,
|
|
47
|
+
w,
|
|
47
48
|
y,
|
|
49
|
+
A,
|
|
50
|
+
$,
|
|
48
51
|
b,
|
|
49
52
|
B,
|
|
50
|
-
|
|
53
|
+
R,
|
|
51
54
|
P,
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
T,
|
|
56
|
+
x,
|
|
57
|
+
M,
|
|
58
|
+
O,
|
|
59
|
+
D,
|
|
60
|
+
C
|
|
54
61
|
].join(`
|
|
55
62
|
|
|
56
|
-
`),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const m =
|
|
63
|
-
|
|
63
|
+
`), k = 3e4;
|
|
64
|
+
let e = null;
|
|
65
|
+
function q() {
|
|
66
|
+
return e || (e = new CSSStyleSheet(), e.replaceSync(_)), e;
|
|
67
|
+
}
|
|
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;
|
|
72
|
+
if (t) {
|
|
73
|
+
t.adoptedStyleSheets.includes(r) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, r]);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
Date.now() < S && requestAnimationFrame(m);
|
|
77
|
+
};
|
|
78
|
+
m();
|
|
64
79
|
} });
|
|
65
80
|
export {
|
|
66
|
-
|
|
81
|
+
fo as useCustomInterfaceAppearance
|
|
67
82
|
};
|