@useinsider/guido 3.3.0-beta.9ab0297 → 3.3.0-beta.a262798
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/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +42 -40
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +9 -11
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +70 -35
- package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
- package/dist/composables/useCortexBlueprintBridge.js +66 -0
- package/dist/composables/useEmailTemplateApplier.js +41 -0
- package/dist/composables/useGuidoStateBridge.js +48 -0
- package/dist/config/migrator/radioButtonMigrator.js +30 -29
- package/dist/enums/extensions/recommendationBlock.js +33 -32
- package/dist/extensions/Blocks/RadioButton/template.js +6 -6
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +25 -12
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +25 -0
- package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
- package/dist/src/composables/useGuidoStateBridge.d.ts +22 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
- package/dist/src/stores/guido-email-editor.d.ts +41 -0
- package/dist/stores/guido-email-editor.js +20 -0
- package/package.json +2 -2
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { defineComponent as J, defineAsyncComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import se from "
|
|
11
|
-
import ce from "./organisms/
|
|
12
|
-
import ae from "./organisms/
|
|
13
|
-
import ie from "./organisms/
|
|
14
|
-
import me from "./organisms/
|
|
15
|
-
import de from "./organisms/
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
1
|
+
import { defineComponent as J, defineAsyncComponent as R, ref as I, computed as W, watch as Q, onMounted as X, onUnmounted as Y } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as Z } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as ee } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as oe } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as te } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as ne } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as re } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as x } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
10
|
+
import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
|
|
11
|
+
import ce from "./organisms/AutoSaveController.vue.js";
|
|
12
|
+
import ae from "./organisms/base/Toaster.vue.js";
|
|
13
|
+
import ie from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
14
|
+
import me from "./organisms/header/HeaderWrapper.vue.js";
|
|
15
|
+
import de from "./organisms/LoadingWrapper.vue.js";
|
|
16
|
+
import le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
17
|
+
import ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
18
|
+
import { useStripoApi as pe } from "../services/stripoApi.js";
|
|
19
|
+
import { useConfigStore as fe } from "../stores/config.js";
|
|
20
|
+
import { useDynamicContentStore as ve } from "../stores/dynamic-content.js";
|
|
21
|
+
import { useEditorStore as ye } from "../stores/editor.js";
|
|
22
|
+
import { usePreviewStore as he } from "../stores/preview.js";
|
|
23
|
+
import { useUnsubscribeStore as Se } from "../stores/unsubscribe.js";
|
|
24
|
+
const He = /* @__PURE__ */ J({
|
|
23
25
|
__name: "Guido",
|
|
24
26
|
props: {
|
|
25
27
|
config: null
|
|
26
28
|
},
|
|
27
29
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
28
|
-
setup(
|
|
29
|
-
const g =
|
|
30
|
+
setup(H, { expose: z, emit: n }) {
|
|
31
|
+
const g = H, q = R(
|
|
30
32
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
31
|
-
), K =
|
|
33
|
+
), K = R(
|
|
32
34
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
33
|
-
), w =
|
|
35
|
+
), w = I(), u = I(), p = ve(), E = Se(), i = fe();
|
|
34
36
|
i.init(g.config);
|
|
35
|
-
const f =
|
|
37
|
+
const f = ye(), V = he(), m = W(() => f.hasChanges), { isTestPartner: $ } = te(), D = () => {
|
|
36
38
|
var e;
|
|
37
39
|
return (e = w.value) == null ? void 0 : e.handleSave(!0);
|
|
38
40
|
}, {
|
|
@@ -42,8 +44,8 @@ const We = /* @__PURE__ */ J({
|
|
|
42
44
|
username: k,
|
|
43
45
|
template: o,
|
|
44
46
|
editor: s
|
|
45
|
-
} = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (s == null ? void 0 : s.savedModulesFolderName) ||
|
|
46
|
-
f.templateId = v;
|
|
47
|
+
} = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (s == null ? void 0 : s.savedModulesFolderName) || G.SAVED_MODULES, U = (s == null ? void 0 : s.defaultModulesFolderName) || G.DEFAULT_MODULES;
|
|
48
|
+
f.templateId = v, Z(), oe();
|
|
47
49
|
const h = {
|
|
48
50
|
emailId: v,
|
|
49
51
|
userId: C,
|
|
@@ -56,11 +58,11 @@ const We = /* @__PURE__ */ J({
|
|
|
56
58
|
onReady: () => {
|
|
57
59
|
console.debug("guido:ready"), n("ready");
|
|
58
60
|
}
|
|
59
|
-
}, { initPlugin: M } =
|
|
61
|
+
}, { initPlugin: M } = ne(h, _), { getDefaultTemplate: O } = pe(), { cloneTimersOnSave: P, hasTimerBlocks: A } = re(), j = W(() => {
|
|
60
62
|
var e;
|
|
61
63
|
return !((e = i.ui) != null && e.showHeader);
|
|
62
64
|
});
|
|
63
|
-
|
|
65
|
+
ee({
|
|
64
66
|
onBack: () => {
|
|
65
67
|
console.debug("guido:back"), n("back");
|
|
66
68
|
},
|
|
@@ -75,9 +77,9 @@ const We = /* @__PURE__ */ J({
|
|
|
75
77
|
console.debug("guido:test-email:click"), n("test-email:click");
|
|
76
78
|
}
|
|
77
79
|
});
|
|
78
|
-
const
|
|
80
|
+
const B = (e) => {
|
|
79
81
|
console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
80
|
-
},
|
|
82
|
+
}, N = () => {
|
|
81
83
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
82
84
|
};
|
|
83
85
|
Q(() => m.value, () => {
|
|
@@ -90,7 +92,7 @@ const We = /* @__PURE__ */ J({
|
|
|
90
92
|
let c = null;
|
|
91
93
|
const b = () => {
|
|
92
94
|
var t;
|
|
93
|
-
const e = document.querySelector(
|
|
95
|
+
const e = document.querySelector(se);
|
|
94
96
|
(t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
95
97
|
};
|
|
96
98
|
return X(async () => {
|
|
@@ -102,10 +104,10 @@ const We = /* @__PURE__ */ J({
|
|
|
102
104
|
E.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
103
105
|
const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
|
|
104
106
|
let r = {
|
|
105
|
-
html: d && await
|
|
107
|
+
html: d && await x(d, a),
|
|
106
108
|
css: F
|
|
107
109
|
};
|
|
108
|
-
r.html || (r = await O(), r.html = await
|
|
110
|
+
r.html || (r = await O(), r.html = await x(r.html, a)), A(r.html) && (r.html = await P(r.html)), await M(r), p.selectedDynamicContentList = y;
|
|
109
111
|
} catch (a) {
|
|
110
112
|
console.error("Failed to initialize Stripo editor:", a);
|
|
111
113
|
}
|
|
@@ -120,14 +122,14 @@ const We = /* @__PURE__ */ J({
|
|
|
120
122
|
i.reset();
|
|
121
123
|
}), z({
|
|
122
124
|
dynamicContent: {
|
|
123
|
-
insert:
|
|
124
|
-
close:
|
|
125
|
+
insert: B,
|
|
126
|
+
close: N
|
|
125
127
|
},
|
|
126
128
|
hasChanges: m,
|
|
127
129
|
saveSilent: D
|
|
128
|
-
}), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: w, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: E, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: $, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: h, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: A, noHeader: j, insertDynamicContent:
|
|
130
|
+
}), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: w, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: E, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: $, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: h, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: A, noHeader: j, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: S, ribbonObserver: c, updateRibbonOffset: b, AutoSaveController: ce, Toaster: ae, FilterSelectionDrawer: ie, HeaderWrapper: me, LoadingWrapper: de, SaveAsTemplateDrawer: le, UnsubscribeWrapper: ue };
|
|
129
131
|
}
|
|
130
132
|
});
|
|
131
133
|
export {
|
|
132
|
-
|
|
134
|
+
He as default
|
|
133
135
|
};
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from "./FilterItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
5
|
var a = this, e = a._self._c, t = a._self._setupProxy;
|
|
6
6
|
return e("div", { staticClass: "d-f f-d-c w-1 gap-16", attrs: { "data-filter-group": a.filter.filterGroup, "data-filter-number": a.filter.filterNumber } }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
|
|
7
7
|
return t.emit("delete-filter", t.props.filter);
|
|
8
|
-
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: function(s) {
|
|
9
|
-
return t.updateFilter({ text: "operator", value: s.value });
|
|
10
|
-
} } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
|
|
8
|
+
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: t.handleOperatorChange } }), t.isAnyOfOperator ? e(t.InTags, { staticClass: "w-2", attrs: { "allow-bulk-paste": "", validate: "text", "allow-duplicates": !1, invalid: t.invalidFields.has("value"), "invalid-message": t.valueErrorMessage, label: t.trans("condition.value"), placeholder: t.trans("condition.enter-value-placeholder"), value: t.tagValues }, on: { input: t.onTagsInput } }) : t.isDateAttribute ? e(t.InDatePickerV2, { staticClass: "w-2", attrs: { id: `filter-item-input--value-${a.index}`, "single-date-picker-status": "", "label-text": t.trans("condition.value"), locale: t.datePickerLocale, name: `filter-item-input--value-${a.index}`, "placeholder-text": t.trans("condition.enter-value-placeholder"), state: t.getFieldState("value"), "state-message": t.valueErrorMessage, value: t.datePickerValue }, on: { apply: t.onDatePickerApply } }) : e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: `filter-item-input--value-${a.index}`, name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: t.safeDecodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
|
|
11
9
|
t.updateFilter({ text: "value", value: encodeURIComponent(s) });
|
|
12
10
|
} } })]], 2), t.props.hasLogicAdapter ? e("div", { staticClass: "w-1 d-f a-i-c j-c-c p-r bor-b-s-s bor-b-w-1 bor-b-c-50 mt-4" }, [e(t.LogicAdapter, { staticClass: "p-a", attrs: { logic: t.props.filter.innerGroupOperator }, on: { change: function(s) {
|
|
13
11
|
return t.updateFilter({ text: "innerGroupOperator", value: s });
|
|
14
12
|
} } })], 1) : a._e()]);
|
|
15
|
-
},
|
|
13
|
+
}, n = [], o = /* @__PURE__ */ i(
|
|
14
|
+
l,
|
|
16
15
|
r,
|
|
17
|
-
|
|
18
|
-
o,
|
|
16
|
+
n,
|
|
19
17
|
!1,
|
|
20
18
|
null,
|
|
21
|
-
"
|
|
19
|
+
"8053a037"
|
|
22
20
|
);
|
|
23
|
-
const f =
|
|
21
|
+
const f = o.exports;
|
|
24
22
|
export {
|
|
25
23
|
f as default
|
|
26
24
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { getOperatorOptions as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { defineComponent as N, computed as r } from "vue";
|
|
2
|
+
import { useTranslations as U } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { getOperatorOptions as f, OP_ANY_OF as d } from "../../../../enums/extensions/recommendationBlock.js";
|
|
4
|
+
import { useRecommendationExtensionStore as E } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { parseTagList as j, safeDecodeURIComponent as g } from "../../../../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
6
|
+
import { getInvalidFilterFields as w } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
|
|
7
|
+
import { locale as M } from "../../../../utils/dateUtil.js";
|
|
8
|
+
import { InTags as Y, InButtonV2 as q, InSelect as z, InDatePickerV2 as G, InBasicTextInput as H } from "@useinsider/design-system-vue";
|
|
9
|
+
import J from "./LogicAdapter.vue.js";
|
|
10
|
+
import { useDebounceFn as K } from "../../../../node_modules/@vueuse/shared/index.js";
|
|
11
|
+
const se = /* @__PURE__ */ N({
|
|
10
12
|
__name: "FilterItem",
|
|
11
13
|
props: {
|
|
12
14
|
filter: null,
|
|
@@ -15,55 +17,88 @@ const K = /* @__PURE__ */ _({
|
|
|
15
17
|
submitted: { type: Boolean }
|
|
16
18
|
},
|
|
17
19
|
emits: ["delete-filter"],
|
|
18
|
-
setup(
|
|
19
|
-
const t =
|
|
20
|
+
setup(I, { emit: O }) {
|
|
21
|
+
const t = I, s = U(), n = E(), T = [
|
|
20
22
|
{
|
|
21
|
-
text:
|
|
23
|
+
text: s("email-editor.standard-filter"),
|
|
22
24
|
value: "standardFilter"
|
|
23
25
|
}
|
|
24
|
-
],
|
|
26
|
+
], u = [
|
|
25
27
|
{ text: "True", value: "true" },
|
|
26
28
|
{ text: "False", value: "false" }
|
|
27
|
-
],
|
|
29
|
+
], m = r(() => t.filter.attribute || ""), i = r(() => n.getFilterList.find((e) => e.value === m.value) || { text: "", value: "", type: "" }), h = r(
|
|
28
30
|
() => {
|
|
29
31
|
var e;
|
|
30
|
-
return ((e =
|
|
32
|
+
return ((e = i.value) == null ? void 0 : e.type) === "Boolean";
|
|
31
33
|
}
|
|
32
|
-
), b =
|
|
34
|
+
), b = r(() => {
|
|
33
35
|
var e;
|
|
34
|
-
return
|
|
35
|
-
}),
|
|
36
|
-
() =>
|
|
37
|
-
),
|
|
38
|
-
() =>
|
|
39
|
-
),
|
|
36
|
+
return f((e = i.value) == null ? void 0 : e.type).find((o) => o.value === t.filter.operator);
|
|
37
|
+
}), A = r(
|
|
38
|
+
() => u.find((e) => e.value === t.filter.value) || u[0]
|
|
39
|
+
), p = r(() => t.submitted ? w(t.filter) : /* @__PURE__ */ new Set()), x = (e) => p.value.has(e) ? "error" : "default", B = r(
|
|
40
|
+
() => p.value.has("value") ? s("action-builder.filter-empty-value-error") : ""
|
|
41
|
+
), v = r(
|
|
40
42
|
() => {
|
|
41
43
|
var e;
|
|
42
|
-
return ((e =
|
|
44
|
+
return ((e = i.value) == null ? void 0 : e.type) === "Number";
|
|
43
45
|
}
|
|
44
|
-
),
|
|
45
|
-
|
|
46
|
+
), D = r(() => v.value ? "number" : "text"), C = r(
|
|
47
|
+
() => {
|
|
48
|
+
var e;
|
|
49
|
+
return ((e = i.value) == null ? void 0 : e.type) === "Date";
|
|
50
|
+
}
|
|
51
|
+
), _ = r(() => t.filter.operator === d), k = r(() => j(t.filter.value)), P = K((e) => {
|
|
52
|
+
n.updateFilter({
|
|
46
53
|
...t.filter,
|
|
47
54
|
[e.text]: e.value
|
|
48
55
|
});
|
|
49
|
-
}, 500)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
a.updateFilter({
|
|
56
|
+
}, 500), V = (e) => {
|
|
57
|
+
const o = n.getFilterList.find((c) => c.value === e.value), l = (o == null ? void 0 : o.type) === "Boolean", [a] = f(o == null ? void 0 : o.type);
|
|
58
|
+
n.updateFilter({
|
|
53
59
|
...t.filter,
|
|
54
60
|
attribute: e.value,
|
|
55
|
-
operator:
|
|
56
|
-
value:
|
|
61
|
+
operator: l ? "=" : (a == null ? void 0 : a.value) ?? "",
|
|
62
|
+
value: l ? "true" : ""
|
|
57
63
|
});
|
|
58
|
-
},
|
|
59
|
-
|
|
64
|
+
}, L = (e) => {
|
|
65
|
+
n.updateFilter({
|
|
60
66
|
...t.filter,
|
|
61
67
|
operator: "=",
|
|
62
68
|
value: e.value
|
|
63
69
|
});
|
|
64
|
-
},
|
|
70
|
+
}, S = (e) => {
|
|
71
|
+
const o = e.value;
|
|
72
|
+
if (o === t.filter.operator)
|
|
73
|
+
return;
|
|
74
|
+
const c = t.filter.operator === d !== (o === d);
|
|
75
|
+
n.updateFilter({
|
|
76
|
+
...t.filter,
|
|
77
|
+
operator: o,
|
|
78
|
+
value: c ? "" : t.filter.value
|
|
79
|
+
});
|
|
80
|
+
}, $ = M(), y = (e) => {
|
|
81
|
+
const [o, l, a] = e.split("-");
|
|
82
|
+
return !o || !l || !a ? "" : `${l}/${a}/${o}`;
|
|
83
|
+
}, F = (e) => {
|
|
84
|
+
const [o, l, a] = e.split("/");
|
|
85
|
+
return !a || !o || !l ? "" : `${a}-${o.padStart(2, "0")}-${l.padStart(2, "0")}`;
|
|
86
|
+
}, R = r(
|
|
87
|
+
() => y(g(t.filter.value))
|
|
88
|
+
);
|
|
89
|
+
return { __sfc: !0, trans: s, store: n, props: t, filterTypeOptions: T, booleanValueOptions: u, attributeType: m, selectedAttributeType: i, isBooleanAttribute: h, selectedOperatorType: b, selectedBooleanValue: A, emit: O, invalidFields: p, getFieldState: x, valueErrorMessage: B, isNumericAttribute: v, valueInputType: D, isDateAttribute: C, isAnyOfOperator: _, tagValues: k, updateFilter: P, handleAttributeChange: V, handleBooleanValueChange: L, handleOperatorChange: S, datePickerLocale: $, isoToPickerDate: y, pickerDateToIso: F, datePickerValue: R, onDatePickerApply: (e) => {
|
|
90
|
+
n.updateFilter({
|
|
91
|
+
...t.filter,
|
|
92
|
+
value: encodeURIComponent(F(e))
|
|
93
|
+
});
|
|
94
|
+
}, onTagsInput: (e) => {
|
|
95
|
+
n.updateFilter({
|
|
96
|
+
...t.filter,
|
|
97
|
+
value: e.map(encodeURIComponent).join(",")
|
|
98
|
+
});
|
|
99
|
+
}, getOperatorOptions: f, safeDecodeURIComponent: g, InBasicTextInput: H, InDatePickerV2: G, InSelect: z, InButtonV2: q, InTags: Y, LogicAdapter: J };
|
|
65
100
|
}
|
|
66
101
|
});
|
|
67
102
|
export {
|
|
68
|
-
|
|
103
|
+
se as default
|
|
69
104
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from "./MiddleSlot.vue2.js";
|
|
2
2
|
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var t = function() {
|
|
4
|
-
var
|
|
5
|
-
return e("div", [
|
|
6
|
-
},
|
|
7
|
-
|
|
4
|
+
var o = this, e = o._self._c, i = o._self._setupProxy;
|
|
5
|
+
return e("div", { staticClass: "d-f a-i-c" }, [i.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(i.VersionHistory), e(i.VersionHistoryViewOptions)], 1) : i.editorStore.isPreviewModeOpen ? e("div", { staticClass: "d-f" }, [e(i.EmailSizeIndicator), e(i.AmpToggle)], 1) : o._e(), e(i.EditorToolbar, { directives: [{ name: "show", rawName: "v-show", value: i.editorStore.isEditorToolbarVisible, expression: "editorStore.isEditorToolbarVisible" }] })], 1);
|
|
6
|
+
}, a = [], n = /* @__PURE__ */ s(
|
|
7
|
+
r,
|
|
8
8
|
t,
|
|
9
|
-
|
|
9
|
+
a,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const c =
|
|
14
|
+
const c = n.exports;
|
|
15
15
|
export {
|
|
16
16
|
c as default
|
|
17
17
|
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useEmailTemplateApplier as m, resetEmailTemplateApplier as w } from "./useEmailTemplateApplier.js";
|
|
2
|
+
import { useToaster as _ } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as I } 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 P = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
|
|
8
|
+
if (typeof window > "u")
|
|
9
|
+
return !1;
|
|
10
|
+
try {
|
|
11
|
+
return window.localStorage.getItem(L) === "1";
|
|
12
|
+
} catch {
|
|
13
|
+
return !1;
|
|
14
|
+
}
|
|
15
|
+
}, O = () => {
|
|
16
|
+
const a = v();
|
|
17
|
+
if (!a)
|
|
18
|
+
return;
|
|
19
|
+
const l = a._s, p = l == null ? void 0 : l.get(x);
|
|
20
|
+
if (!p)
|
|
21
|
+
return;
|
|
22
|
+
const { applyTemplate: d, applyTemplateDebounced: f } = m(), { showToaster: T } = _(), h = I(), A = (e, t) => {
|
|
23
|
+
const r = h(e);
|
|
24
|
+
return r === e ? t : r;
|
|
25
|
+
}, i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), u = M(), E = (e, t) => {
|
|
26
|
+
u && console.debug(`[guido:cortex] msg=${e ?? "?"} type=${(t == null ? void 0 : t.type) ?? "?"}`, t);
|
|
27
|
+
}, y = (e) => {
|
|
28
|
+
if (e.blueprintType !== P)
|
|
29
|
+
return;
|
|
30
|
+
const t = e.blueprintId, r = e.blueprintData;
|
|
31
|
+
if (!t || !(r != null && r.html))
|
|
32
|
+
return;
|
|
33
|
+
const o = i.get(t);
|
|
34
|
+
o === void 0 ? (i.set(t, r.html), d(t, r)) : o !== r.html && (i.set(t, r.html), f(t, r));
|
|
35
|
+
}, s = (e) => e === void 0 || c.has(e) ? !1 : (c.add(e), T({
|
|
36
|
+
type: S.Alert,
|
|
37
|
+
message: A("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
|
|
38
|
+
}), !0), b = B(
|
|
39
|
+
() => p.messages,
|
|
40
|
+
(e) => {
|
|
41
|
+
Array.isArray(e) && e.forEach((t) => {
|
|
42
|
+
const r = t == null ? void 0 : t.id;
|
|
43
|
+
(t == null ? void 0 : t.isError) === !0 && s(r) && u && console.debug(`[guido:cortex] message-level error id=${r}`, t);
|
|
44
|
+
const o = t == null ? void 0 : t.segments;
|
|
45
|
+
Array.isArray(o) && o.forEach((n) => {
|
|
46
|
+
if (n)
|
|
47
|
+
switch (E(r, n), n.type) {
|
|
48
|
+
case "blueprint":
|
|
49
|
+
y(n);
|
|
50
|
+
break;
|
|
51
|
+
case "error":
|
|
52
|
+
s(r);
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
{ deep: !0, immediate: !0 }
|
|
59
|
+
);
|
|
60
|
+
D(() => {
|
|
61
|
+
b(), i.clear(), c.clear(), w();
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
O as useCortexBlueprintBridge
|
|
66
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useActionsApi as u } from "./useActionsApi.js";
|
|
2
|
+
import { useToaster as T } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as f } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as n } from "../enums/toaster.js";
|
|
5
|
+
import { ref as y } from "vue";
|
|
6
|
+
const h = 250, s = y({}), o = {}, j = () => {
|
|
7
|
+
const { updateHtmlAndCss: l } = u(), { showToaster: r } = T(), i = f(), c = (e, t, p) => {
|
|
8
|
+
s.value = { ...s.value, [e]: "applying" };
|
|
9
|
+
try {
|
|
10
|
+
l(t, p), s.value = { ...s.value, [e]: "applied" }, r({
|
|
11
|
+
type: n.Success,
|
|
12
|
+
message: i("newsletter.ai-template-applied")
|
|
13
|
+
});
|
|
14
|
+
} catch (a) {
|
|
15
|
+
s.value = { ...s.value, [e]: "failed" }, r({
|
|
16
|
+
type: n.Alert,
|
|
17
|
+
message: a instanceof Error ? a.message : "Failed to apply template"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}, m = (e) => {
|
|
21
|
+
const t = o[e];
|
|
22
|
+
t && (clearTimeout(t), delete o[e]);
|
|
23
|
+
};
|
|
24
|
+
return { applyStatus: s, applyTemplate: (e, t) => {
|
|
25
|
+
t.html && (m(e), c(e, t.html, t.css ?? ""));
|
|
26
|
+
}, applyTemplateDebounced: (e, t) => {
|
|
27
|
+
if (!t.html)
|
|
28
|
+
return;
|
|
29
|
+
m(e);
|
|
30
|
+
const { html: p } = t, a = t.css ?? "";
|
|
31
|
+
o[e] = setTimeout(() => {
|
|
32
|
+
delete o[e], c(e, p, a);
|
|
33
|
+
}, h);
|
|
34
|
+
} };
|
|
35
|
+
}, w = () => {
|
|
36
|
+
Object.values(o).forEach(clearTimeout), Object.keys(o).forEach((l) => delete o[l]), s.value = {};
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
w as resetEmailTemplateApplier,
|
|
40
|
+
j as useEmailTemplateApplier
|
|
41
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useActionsApi as g } from "./useActionsApi.js";
|
|
2
|
+
import { useConfigStore as I } from "../stores/config.js";
|
|
3
|
+
import { useEditorStore as b } from "../stores/editor.js";
|
|
4
|
+
import { useGuidoEmailEditorStore as E } from "../stores/guido-email-editor.js";
|
|
5
|
+
import { watch as c, onUnmounted as T } from "vue";
|
|
6
|
+
const w = 500, z = () => {
|
|
7
|
+
const i = b(), a = E(), l = I(), { getTemplateData: m } = g();
|
|
8
|
+
let e = null, n = !1;
|
|
9
|
+
const r = () => {
|
|
10
|
+
e && (clearTimeout(e), e = null);
|
|
11
|
+
}, s = async () => {
|
|
12
|
+
var t, o;
|
|
13
|
+
if (!(n || !i.isStripoInitialized))
|
|
14
|
+
try {
|
|
15
|
+
const { html: f, css: h } = await m(), S = ((o = (t = l.config) == null ? void 0 : t.identity) == null ? void 0 : o.templateId) ?? "";
|
|
16
|
+
if (n)
|
|
17
|
+
return;
|
|
18
|
+
a.$patch({
|
|
19
|
+
html: f ?? "",
|
|
20
|
+
css: h ?? "",
|
|
21
|
+
templateId: S,
|
|
22
|
+
lastUpdatedAt: Date.now()
|
|
23
|
+
});
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
}, u = () => {
|
|
27
|
+
r(), e = setTimeout(() => {
|
|
28
|
+
e = null, s();
|
|
29
|
+
}, w);
|
|
30
|
+
}, d = c(
|
|
31
|
+
() => i.isStripoInitialized,
|
|
32
|
+
(t) => {
|
|
33
|
+
t && s();
|
|
34
|
+
},
|
|
35
|
+
{ immediate: !0 }
|
|
36
|
+
), p = c(
|
|
37
|
+
() => i.hasChanges,
|
|
38
|
+
(t, o) => {
|
|
39
|
+
i.isStripoInitialized && (t ? u() : o && (r(), s()));
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
T(() => {
|
|
43
|
+
n = !0, r(), d(), p();
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
z as useGuidoStateBridge
|
|
48
|
+
};
|
|
@@ -9,14 +9,14 @@ class B {
|
|
|
9
9
|
}
|
|
10
10
|
migrate(e) {
|
|
11
11
|
try {
|
|
12
|
-
const t = this.parser.parseFromString(e, "text/html"),
|
|
13
|
-
if (
|
|
12
|
+
const t = this.parser.parseFromString(e, "text/html"), s = t.querySelectorAll("td.radio-button-block"), i = t.querySelectorAll("td.radio-button-v2");
|
|
13
|
+
if (s.length === 0 && i.length === 0)
|
|
14
14
|
return e;
|
|
15
15
|
let o = !1;
|
|
16
|
-
return
|
|
16
|
+
return s.forEach((r) => {
|
|
17
17
|
if (r.classList.contains("radio-button-v2"))
|
|
18
18
|
return;
|
|
19
|
-
const n = r.getAttribute("id"), a = this.extractTextFromElement(r, "ins-title"), g = this.extractTextFromElement(r, "ins-description"), c = this.extractTextFromElement(r, "ins-subscribe"), u = this.extractTextFromElement(r, "ins-unsubscribe"),
|
|
19
|
+
const n = r.getAttribute("id"), a = this.extractTextFromElement(r, "ins-title"), g = this.extractTextFromElement(r, "ins-description"), c = this.extractTextFromElement(r, "ins-subscribe"), u = this.extractTextFromElement(r, "ins-unsubscribe"), p = this.buildTextBlock(a), d = this.buildTextBlock(g), y = this.buildTextBlock({ ...c, classList: "" }), f = this.buildTextBlock({ ...u, classList: "" }), h = S.replace("{-{-TITLE-}-}", p).replace("{-{-DESCRIPTION-}-}", d).replace("{-{-YES-}-}", y).replace("{-{-NO-}-}", f), m = this.parser.parseFromString(
|
|
20
20
|
`<table id="tempDoc"><tbody><tr>${h}</tr></tbody></table>`,
|
|
21
21
|
"text/html"
|
|
22
22
|
).querySelector(".radio-button-v2");
|
|
@@ -28,25 +28,26 @@ class B {
|
|
|
28
28
|
}
|
|
29
29
|
healRadioButtonV2(e) {
|
|
30
30
|
let t = !1;
|
|
31
|
-
return e.querySelectorAll("td.radio-button-v2").forEach((
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
return e.querySelectorAll("td.radio-button-v2").forEach((s) => {
|
|
32
|
+
var d;
|
|
33
|
+
s.classList.contains("radio-button-block") || (s.classList.add("radio-button-block"), t = !0);
|
|
34
|
+
const i = s.querySelector("input#radioYes"), o = s.querySelector("input#radioNo");
|
|
35
|
+
if (!i || !o)
|
|
35
36
|
return;
|
|
36
|
-
const r = ((
|
|
37
|
-
if (!r && !
|
|
37
|
+
const r = ((d = i.parentElement) == null ? void 0 : d.querySelector(":scope > p")) || null;
|
|
38
|
+
if (!r && !i.hasAttribute("align"))
|
|
38
39
|
return;
|
|
39
|
-
const n =
|
|
40
|
+
const n = i.closest("tr"), a = o.closest("tr");
|
|
40
41
|
if (!n || !a || n === a || !n.parentNode)
|
|
41
42
|
return;
|
|
42
|
-
const g = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", c = a.cloneNode(!0), u = c.querySelector("input#radioNo"),
|
|
43
|
-
u && (u.setAttribute("id", "radioYes"), u.removeAttribute("align")),
|
|
43
|
+
const g = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", c = a.cloneNode(!0), u = c.querySelector("input#radioNo"), p = c.querySelector("p");
|
|
44
|
+
u && (u.setAttribute("id", "radioYes"), u.removeAttribute("align")), p && (p.innerHTML = g), n.parentNode.replaceChild(c, n), t = !0;
|
|
44
45
|
}), t;
|
|
45
46
|
}
|
|
46
47
|
extractTextFromElement(e, t) {
|
|
47
|
-
var
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
48
|
+
var d, y;
|
|
49
|
+
const s = e.querySelector(`.${t}`);
|
|
50
|
+
if (!s)
|
|
50
51
|
return {
|
|
51
52
|
text: t === "ins-title" ? "Title" : "Description",
|
|
52
53
|
isBold: !1,
|
|
@@ -55,42 +56,42 @@ class B {
|
|
|
55
56
|
styles: "",
|
|
56
57
|
classList: ""
|
|
57
58
|
};
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
59
|
+
const i = s.querySelector("p");
|
|
60
|
+
if (!i)
|
|
60
61
|
return {
|
|
61
|
-
text: ((
|
|
62
|
+
text: ((d = s.textContent) == null ? void 0 : d.trim()) || (t === "ins-title" ? "Title" : "Description"),
|
|
62
63
|
isBold: !1,
|
|
63
64
|
isItalic: !1,
|
|
64
|
-
align:
|
|
65
|
+
align: s.getAttribute("align") || "left",
|
|
65
66
|
styles: "",
|
|
66
67
|
classList: ""
|
|
67
68
|
};
|
|
68
|
-
const o = ((y =
|
|
69
|
+
const o = ((y = i.textContent) == null ? void 0 : y.trim()) || (t === "ins-title" ? "Title" : "Description"), r = i.getAttribute("style") || "", n = s.getAttribute("align") || i.getAttribute("align") || "left", a = /font-weight\s*:\s*bold/i.test(r) || !!i.querySelector("b, strong"), g = /font-style\s*:\s*italic/i.test(r) || !!i.querySelector("i, em"), c = this.removeStyleProperties(r, ["font-weight", "font-style"]), u = this.convertInlineToBlock(c), p = s.getAttribute("class") || "";
|
|
69
70
|
return {
|
|
70
71
|
text: o,
|
|
71
72
|
isBold: a,
|
|
72
73
|
isItalic: g,
|
|
73
74
|
align: n,
|
|
74
75
|
styles: u,
|
|
75
|
-
classList:
|
|
76
|
+
classList: p
|
|
76
77
|
};
|
|
77
78
|
}
|
|
78
79
|
buildTextBlock(e) {
|
|
79
80
|
let t = e.text;
|
|
80
81
|
e.isBold && e.isItalic ? t = `<strong path="1,0"><em path="1,0,0">${t}</em></strong>` : e.isBold ? t = `<strong path="1,0">${t}</strong>` : e.isItalic && (t = `<em path="1,0">${t}</em>`);
|
|
81
|
-
const
|
|
82
|
+
const s = e.align ? ` align="${e.align}"` : "", i = e.styles ? ` style="${e.styles.replaceAll('"', "'")}"` : "";
|
|
82
83
|
return `
|
|
83
|
-
<td class="esd-block-text ${e.classList}" ${
|
|
84
|
-
<p path="1" ${
|
|
84
|
+
<td class="esd-block-text ${e.classList}" ${s}>
|
|
85
|
+
<p path="1" ${i}>
|
|
85
86
|
${t}
|
|
86
87
|
</p>
|
|
87
88
|
</td>
|
|
88
89
|
`;
|
|
89
90
|
}
|
|
90
91
|
removeStyleProperties(e, t) {
|
|
91
|
-
return e ? t.reduce((
|
|
92
|
+
return e ? t.reduce((i, o) => {
|
|
92
93
|
const r = new RegExp(`${o}\\s*:\\s*[^;]*;?`, "gi");
|
|
93
|
-
return
|
|
94
|
+
return i.replace(r, "");
|
|
94
95
|
}, e).replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim() : "";
|
|
95
96
|
}
|
|
96
97
|
convertInlineToBlock(e) {
|
|
@@ -100,9 +101,9 @@ class B {
|
|
|
100
101
|
return /display\s*:/i.test(t) || (t = t ? `${t}; display: block` : "display: block"), t.replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim();
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
+
function L(l) {
|
|
104
105
|
return new B().migrate(l);
|
|
105
106
|
}
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
+
L as migrateRadioButton
|
|
108
109
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useTranslations as
|
|
2
|
-
const
|
|
1
|
+
import { useTranslations as r } from "../../composables/useTranslations.js";
|
|
2
|
+
const l = {
|
|
3
3
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
|
|
4
|
-
},
|
|
4
|
+
}, c = {
|
|
5
5
|
CLIENT_ID: "clientId"
|
|
6
|
-
},
|
|
7
|
-
const e =
|
|
6
|
+
}, d = () => {
|
|
7
|
+
const e = r();
|
|
8
8
|
return [
|
|
9
9
|
{
|
|
10
10
|
id: 11,
|
|
@@ -67,72 +67,73 @@ const u = {
|
|
|
67
67
|
path: "top-sellers"
|
|
68
68
|
}
|
|
69
69
|
];
|
|
70
|
-
},
|
|
70
|
+
}, m = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], p = [
|
|
71
71
|
{ text: "before the amount", value: "0" },
|
|
72
72
|
{ text: "after the amount", value: "1" }
|
|
73
|
-
],
|
|
73
|
+
], v = [
|
|
74
74
|
{ text: "dot(.)", value: "." },
|
|
75
75
|
{ text: "comma(,)", value: "," },
|
|
76
76
|
{ text: "space( )", value: " " }
|
|
77
|
-
],
|
|
77
|
+
], h = [
|
|
78
78
|
{ text: "0", value: "0" },
|
|
79
79
|
{ text: "1", value: "1" },
|
|
80
80
|
{ text: "2", value: "2" },
|
|
81
81
|
{ text: "3", value: "3" },
|
|
82
82
|
{ text: "4", value: "4" },
|
|
83
83
|
{ text: "5", value: "5" }
|
|
84
|
-
], t = [
|
|
84
|
+
], a = "||", t = [
|
|
85
85
|
{ text: "is exactly", value: "=" },
|
|
86
86
|
{ text: "contains", value: "~" },
|
|
87
87
|
{ text: "does not contain", value: "!~" },
|
|
88
|
-
{ text: "any of", value:
|
|
89
|
-
],
|
|
88
|
+
{ text: "any of", value: a }
|
|
89
|
+
], n = [
|
|
90
90
|
{ text: "is exactly", value: "=" },
|
|
91
91
|
{ text: "is not exactly", value: "!==" },
|
|
92
92
|
{ text: "contains", value: "~" },
|
|
93
93
|
{ text: "does not contain", value: "!~" },
|
|
94
|
-
{ text: "any of", value:
|
|
95
|
-
],
|
|
94
|
+
{ text: "any of", value: a }
|
|
95
|
+
], o = [
|
|
96
96
|
{ text: "is equal to", value: "=" },
|
|
97
97
|
{ text: "is greater than", value: ">" },
|
|
98
98
|
{ text: "is less than", value: "<" }
|
|
99
|
-
],
|
|
99
|
+
], s = [
|
|
100
100
|
{ text: "is equal to", value: "=" },
|
|
101
101
|
{ text: "after", value: ">" },
|
|
102
102
|
{ text: "before", value: "<" }
|
|
103
|
-
],
|
|
103
|
+
], i = [
|
|
104
104
|
{ text: "true", value: "==" },
|
|
105
105
|
{ text: "false", value: "!=" }
|
|
106
|
-
],
|
|
106
|
+
], x = (e) => {
|
|
107
107
|
if (!e)
|
|
108
108
|
return t;
|
|
109
109
|
switch (e) {
|
|
110
110
|
case "Boolean":
|
|
111
|
-
return
|
|
111
|
+
return i;
|
|
112
112
|
case "Date":
|
|
113
|
-
return
|
|
113
|
+
return s;
|
|
114
114
|
case "Number":
|
|
115
|
-
return
|
|
115
|
+
return o;
|
|
116
116
|
case "String":
|
|
117
117
|
return t;
|
|
118
118
|
case "Strings":
|
|
119
|
-
return
|
|
119
|
+
return n;
|
|
120
120
|
default:
|
|
121
121
|
return t;
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
export {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
p as
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
125
|
+
a as OP_ANY_OF,
|
|
126
|
+
m as PriceAttributes,
|
|
127
|
+
c as QUERY_PARAMS,
|
|
128
|
+
l as URLS,
|
|
129
|
+
h as currencyDecimalCounts,
|
|
130
|
+
p as currencyLocationMaps,
|
|
131
|
+
v as currencyOperators,
|
|
132
|
+
x as getOperatorOptions,
|
|
133
|
+
d as getRecommendationFeedSourceMaps,
|
|
134
|
+
n as operatorOptionsForArrayOfStrings,
|
|
135
|
+
i as operatorOptionsForBooleans,
|
|
136
|
+
s as operatorOptionsForDates,
|
|
137
|
+
o as operatorOptionsForNumbers,
|
|
137
138
|
t as operatorOptionsForStrings
|
|
138
139
|
};
|
|
@@ -5,7 +5,7 @@ const e = {
|
|
|
5
5
|
YES: "Yes",
|
|
6
6
|
NO: "No"
|
|
7
7
|
}, d = `
|
|
8
|
-
<td align="left" class="radio-button radio-button-v2 esd-block-radio es-p10t es-p10b es-p30r es-p30l">
|
|
8
|
+
<td align="left" class="radio-button-block radio-button-v2 esd-block-radio es-p10t es-p10b es-p30r es-p30l">
|
|
9
9
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
10
10
|
<tbody>
|
|
11
11
|
<tr>
|
|
@@ -75,13 +75,13 @@ const e = {
|
|
|
75
75
|
</tbody>
|
|
76
76
|
</table>
|
|
77
77
|
</td>
|
|
78
|
-
`,
|
|
78
|
+
`, l = `
|
|
79
79
|
<td
|
|
80
80
|
align="left"
|
|
81
81
|
esd-extension-block-id="radio-button-block"
|
|
82
82
|
esd-handler-name="esd-extension-RadioButtonBlock"
|
|
83
83
|
class="
|
|
84
|
-
radio-button
|
|
84
|
+
radio-button-block
|
|
85
85
|
radio-button-v2
|
|
86
86
|
esd-block-ra
|
|
87
87
|
esd-radio-button-block
|
|
@@ -149,10 +149,10 @@ const e = {
|
|
|
149
149
|
</table>
|
|
150
150
|
</td>
|
|
151
151
|
`;
|
|
152
|
-
function
|
|
152
|
+
function a() {
|
|
153
153
|
return d.replace("{-{-TITLE-}-}", `<p path="1">${e.TITLE}</p>`).replace("{-{-DESCRIPTION-}-}", `<p path="1">${e.DESCRIPTION}</p>`).replace("{-{-YES-}-}", `<p path="1">${e.YES}</p>`).replace("{-{-NO-}-}", `<p path="1">${e.NO}</p>`);
|
|
154
154
|
}
|
|
155
155
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
l as default,
|
|
157
|
+
a as getDefaultTemplate
|
|
158
158
|
};
|
|
@@ -1,31 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
import { OP_ANY_OF as l } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
+
function m(t) {
|
|
3
|
+
try {
|
|
4
|
+
return decodeURIComponent(t);
|
|
5
|
+
} catch {
|
|
6
|
+
return t;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function f(t) {
|
|
10
|
+
return t.split(",").filter(Boolean).map(m);
|
|
11
|
+
}
|
|
12
|
+
function y(t) {
|
|
2
13
|
if (t.length === 0)
|
|
3
14
|
return "";
|
|
4
15
|
const o = t.sort((r, e) => r.filterNumber - e.filterNumber), u = o.map((r) => {
|
|
5
|
-
const e = r.operator ===
|
|
16
|
+
const e = r.operator === l, a = e ? "=" : r.operator, c = e ? f(r.value).join(l) : r.value;
|
|
6
17
|
return `[${r.attribute}][${a}][${c}]`;
|
|
7
|
-
}), [
|
|
8
|
-
let n =
|
|
18
|
+
}), [i, ...p] = u;
|
|
19
|
+
let n = i;
|
|
9
20
|
for (let r = 0; r < p.length; r++) {
|
|
10
21
|
const e = o[r].innerGroupOperator;
|
|
11
22
|
n += `${e}${p[r]}`;
|
|
12
23
|
}
|
|
13
24
|
return `(${n})`;
|
|
14
25
|
}
|
|
15
|
-
function
|
|
26
|
+
function Q(t) {
|
|
16
27
|
if (!t || t.length === 0)
|
|
17
28
|
return "";
|
|
18
|
-
const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), u = Object.keys(o).map(Number).sort((r, e) => r - e),
|
|
29
|
+
const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), u = Object.keys(o).map(Number).sort((r, e) => r - e), i = u.map((r) => {
|
|
19
30
|
const e = o[r];
|
|
20
|
-
return
|
|
21
|
-
}), [p, ...n] =
|
|
22
|
-
let
|
|
31
|
+
return y(e);
|
|
32
|
+
}), [p, ...n] = i;
|
|
33
|
+
let s = p;
|
|
23
34
|
for (let r = 0; r < n.length; r++) {
|
|
24
35
|
const e = u[r + 1], c = o[e][0].outerGroupOperator;
|
|
25
|
-
|
|
36
|
+
s += `${c}${n[r]}`;
|
|
26
37
|
}
|
|
27
|
-
return
|
|
38
|
+
return s.trim();
|
|
28
39
|
}
|
|
29
40
|
export {
|
|
30
|
-
|
|
41
|
+
Q as generateCompleteFilterQuery,
|
|
42
|
+
f as parseTagList,
|
|
43
|
+
m as safeDecodeURIComponent
|
|
31
44
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-
|
|
1
|
+
.gap-16[data-v-8053a037],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-4e2a4adb]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-cdee3452]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-cdee3452]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-cdee3452]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-df672485]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-df672485]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-df672485]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-df672485]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-df672485]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
|
package/dist/package.json.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridges cortex-fe's chat store to Guido's Stripo editor.
|
|
3
|
+
*
|
|
4
|
+
* cortex-fe is a Module Federation MFE that registers `defineStore('chat', …)`
|
|
5
|
+
* on the host's shared (singleton) Pinia. Guido — bundled inside MFE consumers
|
|
6
|
+
* that also share that pinia — reads the same store at runtime via
|
|
7
|
+
* `getActivePinia()._s.get('chat')`. No build-time dep on cortex-fe.
|
|
8
|
+
*
|
|
9
|
+
* The bridge handles two segment shapes:
|
|
10
|
+
*
|
|
11
|
+
* - `blueprint` segments with `blueprintType === 'email_template'` are
|
|
12
|
+
* applied to the Stripo editor (immediate on first sighting, debounced on
|
|
13
|
+
* update, identical-html no-ops).
|
|
14
|
+
* - `error` segments (and message-level `isError` / `isCancelled`) trigger
|
|
15
|
+
* a localized toaster.
|
|
16
|
+
*
|
|
17
|
+
* In dev (`import.meta.env.DEV`) every observed segment + message-level flag
|
|
18
|
+
* change is also `console.debug`-logged with the prefix `[guido:cortex]` so a
|
|
19
|
+
* developer can watch the agent stream in real time. In production this is
|
|
20
|
+
* gated behind `localStorage.guido:debug:ai === '1'`.
|
|
21
|
+
*
|
|
22
|
+
* If cortex-fe isn't loaded the chat store is undefined and the bridge is a
|
|
23
|
+
* no-op (intentional — Guido must still work standalone).
|
|
24
|
+
*/
|
|
25
|
+
export declare const useCortexBlueprintBridge: () => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
|
|
2
|
+
/**
|
|
3
|
+
* Applies email_template blueprints from the chat agent to the Stripo editor.
|
|
4
|
+
*
|
|
5
|
+
* - blueprint_create + manual Apply click: immediate.
|
|
6
|
+
* - blueprint_update: debounced 250 ms trailing so rapid mid-stream updates
|
|
7
|
+
* don't thrash updateHtmlAndCss.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useEmailTemplateApplier: () => {
|
|
10
|
+
applyStatus: import("vue").Ref<Record<string, ApplyStatus>>;
|
|
11
|
+
applyTemplate: (blueprintId: string, data: {
|
|
12
|
+
html?: string;
|
|
13
|
+
css?: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
applyTemplateDebounced: (blueprintId: string, data: {
|
|
16
|
+
html?: string;
|
|
17
|
+
css?: string;
|
|
18
|
+
}) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const resetEmailTemplateApplier: () => void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outbound bridge — publishes the current editor's html/css to the shared
|
|
3
|
+
* Pinia store `guidoEmailEditor` so cortex-fe can read it at chat-stream
|
|
4
|
+
* submit time and forward it as `clientState.editor`. This is what enables
|
|
5
|
+
* sub-case 1.3 (refine an already-loaded template via the email-agent).
|
|
6
|
+
*
|
|
7
|
+
* The bridge writes on three triggers:
|
|
8
|
+
*
|
|
9
|
+
* 1. Stripo finishes initializing — first snapshot.
|
|
10
|
+
* 2. Editor `hasChanges` flips to true — debounced 500 ms so a streaming
|
|
11
|
+
* Stripo edit doesn't thrash the store.
|
|
12
|
+
* 3. Editor `hasChanges` flips back to false (post-save / autosave) —
|
|
13
|
+
* immediate, since this is the canonical "saved" snapshot.
|
|
14
|
+
*
|
|
15
|
+
* `getTemplateData()` is a Stripo iframe call; it must not run before
|
|
16
|
+
* `isStripoInitialized` is true. The bridge guards against that.
|
|
17
|
+
*
|
|
18
|
+
* If cortex-fe isn't loaded the store still gets written — that's fine;
|
|
19
|
+
* the store has zero overhead and any future reader will find consistent
|
|
20
|
+
* state. The bridge is a one-way pipe with no consumer dependency.
|
|
21
|
+
*/
|
|
22
|
+
export declare const useGuidoStateBridge: () => void;
|
|
@@ -15,6 +15,7 @@ export declare const PriceAttributes: string[];
|
|
|
15
15
|
export declare const currencyLocationMaps: TextValueObject[];
|
|
16
16
|
export declare const currencyOperators: TextValueObject[];
|
|
17
17
|
export declare const currencyDecimalCounts: TextValueObject[];
|
|
18
|
+
export declare const OP_ANY_OF = "||";
|
|
18
19
|
export declare const operatorOptionsForStrings: TextValueObject[];
|
|
19
20
|
export declare const operatorOptionsForArrayOfStrings: TextValueObject[];
|
|
20
21
|
export declare const operatorOptionsForNumbers: TextValueObject[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"radio-button-block\"\n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"\n radio-button\n radio-button-v2\n esd-block-ra\n esd-radio-button-block\n esd-extension-block\n es-p10t\n es-p10b\n es-p30r\n es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
|
|
1
|
+
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"radio-button-block\"\n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"\n radio-button-block\n radio-button-v2\n esd-block-ra\n esd-radio-button-block\n esd-extension-block\n es-p10t\n es-p10b\n es-p30r\n es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
|
|
2
2
|
/**
|
|
3
3
|
* @returns The template for the default checkbox block
|
|
4
4
|
*/
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Filter } from '@@/Types/recommendation';
|
|
2
|
+
export declare function safeDecodeURIComponent(value: string): string;
|
|
3
|
+
export declare function parseTagList(value: string): string[];
|
|
2
4
|
/**
|
|
3
5
|
* Generates the complete query with outer group operators
|
|
4
6
|
* @param filters Array of Filter objects
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outbound contract Guido publishes to the host's shared Pinia singleton so
|
|
3
|
+
* cortex-fe can pick up the current editor state and forward it as
|
|
4
|
+
* `clientState.editor` on the next chat-stream POST.
|
|
5
|
+
*
|
|
6
|
+
* State + getters only — `useGuidoStateBridge` writes via `$patch`, no actions
|
|
7
|
+
* live here (architecture invariant).
|
|
8
|
+
*
|
|
9
|
+
* Store id `guidoEmailEditor` is cross-MFE: cortex-fe reads it via
|
|
10
|
+
* `pinia._s.get('guidoEmailEditor')` at runtime. The internal Guido editor
|
|
11
|
+
* store keeps id `guidoEditor` — these are intentionally separate. The
|
|
12
|
+
* internal store carries UI state that cortex-fe should not see; this public
|
|
13
|
+
* store carries the contract Guido is willing to share.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"guidoEmailEditor", {
|
|
16
|
+
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
17
|
+
html: string;
|
|
18
|
+
/** Current Stripo CSS — es-p* utility classes used by the html. */
|
|
19
|
+
css: string;
|
|
20
|
+
/** Wall-clock ms when html/css were last written by the bridge. */
|
|
21
|
+
lastUpdatedAt: number;
|
|
22
|
+
/** Template id from the editor config, for cortex-fe to scope per-template. */
|
|
23
|
+
templateId: string;
|
|
24
|
+
}, {
|
|
25
|
+
/** True once the bridge has published at least one snapshot. */
|
|
26
|
+
hasSnapshot: (state: {
|
|
27
|
+
html: string;
|
|
28
|
+
css: string;
|
|
29
|
+
lastUpdatedAt: number;
|
|
30
|
+
templateId: string;
|
|
31
|
+
} & import("pinia").PiniaCustomStateProperties<{
|
|
32
|
+
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
33
|
+
html: string;
|
|
34
|
+
/** Current Stripo CSS — es-p* utility classes used by the html. */
|
|
35
|
+
css: string;
|
|
36
|
+
/** Wall-clock ms when html/css were last written by the bridge. */
|
|
37
|
+
lastUpdatedAt: number;
|
|
38
|
+
/** Template id from the editor config, for cortex-fe to scope per-template. */
|
|
39
|
+
templateId: string;
|
|
40
|
+
}>) => boolean;
|
|
41
|
+
}, {}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineStore as e } from "pinia";
|
|
2
|
+
const d = e("guidoEmailEditor", {
|
|
3
|
+
state: () => ({
|
|
4
|
+
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
5
|
+
html: "",
|
|
6
|
+
/** Current Stripo CSS — es-p* utility classes used by the html. */
|
|
7
|
+
css: "",
|
|
8
|
+
/** Wall-clock ms when html/css were last written by the bridge. */
|
|
9
|
+
lastUpdatedAt: 0,
|
|
10
|
+
/** Template id from the editor config, for cortex-fe to scope per-template. */
|
|
11
|
+
templateId: ""
|
|
12
|
+
}),
|
|
13
|
+
getters: {
|
|
14
|
+
/** True once the bridge has published at least one snapshot. */
|
|
15
|
+
hasSnapshot: (t) => t.lastUpdatedAt > 0 && t.html !== ""
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
d as useGuidoEmailEditorStore
|
|
20
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.3.0-beta.
|
|
3
|
+
"version": "3.3.0-beta.a262798",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
"guido": {
|
|
92
92
|
"stripo": {
|
|
93
|
-
"version": "2.
|
|
93
|
+
"version": "2.62.0"
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|