@useinsider/guido 3.10.0 → 3.11.0-beta.0235cfb
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/composables/useCortexBlueprintBridge.js +7 -7
- package/dist/composables/useCustomInterfaceAppearance.js +16 -18
- package/dist/composables/useEmailTemplateApplier.js +9 -9
- package/dist/composables/useExport.js +18 -18
- package/dist/composables/useHtmlValidator.js +90 -90
- package/dist/composables/useStripo.js +53 -51
- package/dist/composables/useStripoNotifications.js +26 -0
- package/dist/composables/useToaster.js +11 -11
- package/dist/composables/useVersionHistoryApi.js +2 -2
- package/dist/composables/validators/useLiquidValidator.js +1 -1
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +10 -10
- package/dist/config/compiler/recommendationCompilerRules.js +55 -38
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +142 -100
- package/dist/config/i18n/en/labels.json.js +4 -1
- package/dist/config/migrator/index.js +7 -6
- package/dist/config/migrator/socialIconMigrator.js +29 -0
- package/dist/enums/toaster.js +2 -2
- package/dist/enums/unsubscribe.js +41 -36
- package/dist/extensions/Blocks/Checkbox/block.js +5 -3
- package/dist/extensions/Blocks/Checkbox/control.js +42 -28
- package/dist/extensions/Blocks/RadioButton/block.js +9 -7
- package/dist/extensions/Blocks/RadioButton/control.js +64 -50
- package/dist/extensions/Blocks/Recommendation/useRecommendationBlockWarning.js +7 -7
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +2 -0
- package/dist/package.json.js +1 -1
- package/dist/services/blankTemplate.js +1 -1
- package/dist/services/templateLibraryApi.js +8 -7
- package/dist/src/composables/useStripoNotifications.d.ts +10 -0
- package/dist/src/config/migrator/socialIconMigrator.d.ts +1 -0
- package/dist/src/enums/toaster.d.ts +2 -2
- package/dist/src/enums/unsubscribe.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +1 -0
- package/dist/src/stores/toaster.d.ts +2 -3
- package/dist/static/styles/components/dropdown-menu.css.js +12 -0
- package/dist/static/styles/components/wide-panel.css.js +7 -0
- package/dist/stores/toaster.js +10 -10
- package/dist/utils/templatePreparation.js +20 -16
- package/package.json +3 -3
- package/dist/static/styles/components/notification.css.js +0 -74
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import { getDefaultUnsubscribeGroup as
|
|
6
|
-
import { Control as
|
|
7
|
-
const b = "ui-elements-checkbox",
|
|
8
|
-
class
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var L = (i, n, e) => n in i ? p(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
|
+
var a = (i, n, e) => L(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { useHttp as h } from "../../../composables/useHttp.js";
|
|
5
|
+
import { getDefaultUnsubscribeGroup as T, PIXEL_TRACKING_SEND_GRID_ID as C, UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS as I } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as m, UIElementType as r, UEAttr as t, ModificationDescription as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const b = "ui-elements-checkbox", E = "select", { get: _ } = h();
|
|
8
|
+
class G extends m {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
a(this, "currentNode");
|
|
12
|
+
a(this, "selectedUnsubGroup");
|
|
13
|
+
a(this, "unsubList", []);
|
|
14
14
|
}
|
|
15
15
|
getId() {
|
|
16
16
|
return b;
|
|
@@ -19,12 +19,12 @@ class I extends p {
|
|
|
19
19
|
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
20
|
const e = this.currentNode.getAttribute("id");
|
|
21
21
|
if (e) {
|
|
22
|
-
const s = e
|
|
22
|
+
const s = I.includes(e) ? e : Number(e);
|
|
23
23
|
s && (this.selectedUnsubGroup = s);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
this.api.updateValues({
|
|
27
|
-
[
|
|
27
|
+
[E]: this.selectedUnsubGroup
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
_getLabel(e, s = `${Math.random()}`) {
|
|
@@ -46,17 +46,19 @@ class I extends p {
|
|
|
46
46
|
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
47
47
|
}
|
|
48
48
|
getTemplate() {
|
|
49
|
+
const e = this.api.translate("Unsubscribe & Preference Center Type"), s = this.api.translate("Select Unsubscribe and Preference Type");
|
|
49
50
|
return `
|
|
50
51
|
<div class="checkbox-controls-container">
|
|
51
|
-
<div class="checkbox-select-container container
|
|
52
|
+
<div class="checkbox-select-container container one-column stretch">
|
|
52
53
|
<${r.LABEL}
|
|
53
|
-
${t.LABEL.text}="${
|
|
54
|
+
${t.LABEL.text}="${e}"
|
|
54
55
|
${t.LABEL.name}="${Math.random()}">
|
|
55
56
|
</${r.LABEL}>
|
|
56
57
|
|
|
57
58
|
<${r.SELECTPICKER}
|
|
58
|
-
${t.SELECTPICKER.name}="${
|
|
59
|
-
${t.SELECTPICKER.
|
|
59
|
+
${t.SELECTPICKER.name}="${E}"
|
|
60
|
+
${t.SELECTPICKER.searchable}="true"
|
|
61
|
+
${t.SELECTPICKER.placeholder}="${s}">
|
|
60
62
|
${this._getSelect()}
|
|
61
63
|
</${r.SELECTPICKER}>
|
|
62
64
|
</div>
|
|
@@ -64,30 +66,42 @@ class I extends p {
|
|
|
64
66
|
`;
|
|
65
67
|
}
|
|
66
68
|
_onSelectChange(e) {
|
|
67
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new
|
|
69
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new S(`Updated text to ${e}`));
|
|
68
70
|
}
|
|
69
71
|
_listenToFormUpdates() {
|
|
70
|
-
this.api.onValueChanged(
|
|
72
|
+
this.api.onValueChanged(E, (e) => this._onSelectChange(e));
|
|
71
73
|
}
|
|
72
74
|
onTemplateNodeUpdated(e) {
|
|
73
75
|
this.currentNode = e, this._setFormValues();
|
|
74
76
|
}
|
|
75
77
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
76
78
|
async onRender() {
|
|
77
|
-
const e = await
|
|
79
|
+
const e = await _(
|
|
78
80
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}))
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
), s = {
|
|
82
|
+
name: this.api.translate("Pixel Tracking Opt-in"),
|
|
83
|
+
sendGridId: C
|
|
84
|
+
}, c = [T(), ...e.data], u = (o) => ({
|
|
85
|
+
[t.SELECT_ITEM.text]: o.name,
|
|
86
|
+
[t.SELECT_ITEM.value]: o.sendGridId
|
|
87
|
+
}), l = (o) => ({
|
|
88
|
+
[t.SELECT_ITEM.text]: o,
|
|
89
|
+
[t.SELECT_ITEM.value]: `header:${o}`,
|
|
90
|
+
[t.SELECT_ITEM.disabled]: !0
|
|
91
|
+
}), d = [
|
|
92
|
+
l(this.api.translate("OPT-IN SELECTION")),
|
|
93
|
+
u(s),
|
|
94
|
+
l(this.api.translate("UNSUBSCRIBE GROUPS")),
|
|
95
|
+
...c.map(u)
|
|
96
|
+
];
|
|
97
|
+
this.unsubList = [s, ...c], this.api.setUIEAttribute(
|
|
98
|
+
E,
|
|
85
99
|
t.SELECTPICKER.items,
|
|
86
|
-
|
|
100
|
+
d
|
|
87
101
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
102
|
}
|
|
89
103
|
}
|
|
90
104
|
export {
|
|
91
105
|
b as CHECKBOX_CONTROL_BLOCK_ID,
|
|
92
|
-
|
|
106
|
+
G as CheckboxControl
|
|
93
107
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Block as t, BlockCompositionType as
|
|
2
|
-
import { getDefaultTemplate as
|
|
1
|
+
import { Block as t, BlockCompositionType as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { getDefaultTemplate as o } from "./template.js";
|
|
3
3
|
const r = "radio-button-block";
|
|
4
|
-
class
|
|
4
|
+
class i extends t {
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
}
|
|
@@ -12,16 +12,18 @@ class l extends t {
|
|
|
12
12
|
return "radio-button-icon";
|
|
13
13
|
}
|
|
14
14
|
getBlockCompositionType() {
|
|
15
|
-
return
|
|
15
|
+
return e.CONTAINER;
|
|
16
16
|
}
|
|
17
17
|
getName() {
|
|
18
18
|
return this.api.translate("Radio Button Block");
|
|
19
19
|
}
|
|
20
20
|
getDescription() {
|
|
21
|
-
return this.api.translate(
|
|
21
|
+
return this.api.translate(
|
|
22
|
+
"Radio button lets you select Unsubscribe and Preference Type for users to manage their opt-in or opt-out preferences."
|
|
23
|
+
);
|
|
22
24
|
}
|
|
23
25
|
getTemplate() {
|
|
24
|
-
return
|
|
26
|
+
return o();
|
|
25
27
|
}
|
|
26
28
|
allowInnerBlocksDND() {
|
|
27
29
|
return !1;
|
|
@@ -29,5 +31,5 @@ class l extends t {
|
|
|
29
31
|
}
|
|
30
32
|
export {
|
|
31
33
|
r as BLOCK_ID,
|
|
32
|
-
|
|
34
|
+
i as RadioButtonCustomBlock
|
|
33
35
|
};
|
|
@@ -1,93 +1,107 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import { getDefaultUnsubscribeGroup as
|
|
6
|
-
import { Control as
|
|
7
|
-
const b = "ui-elements-radio-button",
|
|
8
|
-
class
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var L = (i, n, e) => n in i ? p(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
|
+
var a = (i, n, e) => L(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { useHttp as T } from "../../../composables/useHttp.js";
|
|
5
|
+
import { getDefaultUnsubscribeGroup as h, PIXEL_TRACKING_SEND_GRID_ID as I, UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS as m } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as C, UIElementType as r, UEAttr as t, ModificationDescription as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const b = "ui-elements-radio-button", E = "select", { get: _ } = T();
|
|
8
|
+
class G extends C {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
a(this, "currentNode");
|
|
12
|
+
a(this, "selectedUnsubGroup");
|
|
13
|
+
a(this, "unsubList", []);
|
|
14
14
|
}
|
|
15
15
|
getId() {
|
|
16
16
|
return b;
|
|
17
17
|
}
|
|
18
18
|
_setFormValues() {
|
|
19
19
|
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const s =
|
|
20
|
+
const e = this.currentNode.getAttribute("id");
|
|
21
|
+
if (e) {
|
|
22
|
+
const s = m.includes(e) ? e : Number(e);
|
|
23
23
|
s && (this.selectedUnsubGroup = s);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
this.api.updateValues({
|
|
27
|
-
[
|
|
27
|
+
[E]: this.selectedUnsubGroup
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
_getLabel(
|
|
30
|
+
_getLabel(e, s = `${Math.random()}`) {
|
|
31
31
|
return `
|
|
32
|
-
<${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
</${
|
|
32
|
+
<${r.LABEL}
|
|
33
|
+
${t.LABEL.text}="${e}"
|
|
34
|
+
${t.LABEL.name}="${s}">
|
|
35
|
+
</${r.LABEL}>
|
|
36
36
|
`;
|
|
37
37
|
}
|
|
38
|
-
_getSelectItem(
|
|
38
|
+
_getSelectItem(e, s) {
|
|
39
39
|
return `
|
|
40
|
-
<${
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
</${
|
|
40
|
+
<${r.SELECT_ITEM}
|
|
41
|
+
${t.SELECT_ITEM.text}="${e}"
|
|
42
|
+
${t.SELECT_ITEM.value}="${s}">
|
|
43
|
+
</${r.SELECT_ITEM}>`;
|
|
44
44
|
}
|
|
45
45
|
_getSelect() {
|
|
46
|
-
return this.unsubList.map((
|
|
46
|
+
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
47
47
|
}
|
|
48
48
|
getTemplate() {
|
|
49
|
+
const e = this.api.translate("Unsubscribe & Preference Center Type"), s = this.api.translate("Select Unsubscribe and Preference Type");
|
|
49
50
|
return `
|
|
50
51
|
<div class="checkbox-controls-container">
|
|
51
|
-
<div class="checkbox-select-container container
|
|
52
|
-
<${
|
|
53
|
-
${
|
|
54
|
-
${
|
|
55
|
-
</${
|
|
52
|
+
<div class="checkbox-select-container container one-column stretch">
|
|
53
|
+
<${r.LABEL}
|
|
54
|
+
${t.LABEL.text}="${e}"
|
|
55
|
+
${t.LABEL.name}="${Math.random()}">
|
|
56
|
+
</${r.LABEL}>
|
|
56
57
|
|
|
57
|
-
<${
|
|
58
|
-
${
|
|
59
|
-
${
|
|
58
|
+
<${r.SELECTPICKER}
|
|
59
|
+
${t.SELECTPICKER.name}="${E}"
|
|
60
|
+
${t.SELECTPICKER.searchable}="true"
|
|
61
|
+
${t.SELECTPICKER.placeholder}="${s}">
|
|
60
62
|
${this._getSelect()}
|
|
61
|
-
</${
|
|
63
|
+
</${r.SELECTPICKER}>
|
|
62
64
|
</div>
|
|
63
65
|
</div>
|
|
64
66
|
`;
|
|
65
67
|
}
|
|
66
|
-
_onSelectChange(
|
|
67
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id",
|
|
68
|
+
_onSelectChange(e) {
|
|
69
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new S(`Updated text to ${e}`));
|
|
68
70
|
}
|
|
69
71
|
_listenToFormUpdates() {
|
|
70
|
-
this.api.onValueChanged(
|
|
72
|
+
this.api.onValueChanged(E, (e) => this._onSelectChange(e));
|
|
71
73
|
}
|
|
72
|
-
onTemplateNodeUpdated(
|
|
73
|
-
this.currentNode =
|
|
74
|
+
onTemplateNodeUpdated(e) {
|
|
75
|
+
this.currentNode = e, this._setFormValues();
|
|
74
76
|
}
|
|
75
77
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
76
78
|
async onRender() {
|
|
77
|
-
const
|
|
79
|
+
const e = await _(
|
|
78
80
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}))
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
), s = {
|
|
82
|
+
name: this.api.translate("Pixel Tracking Opt-in"),
|
|
83
|
+
sendGridId: I
|
|
84
|
+
}, u = [h(), ...e.data], c = (o) => ({
|
|
85
|
+
[t.SELECT_ITEM.text]: o.name,
|
|
86
|
+
[t.SELECT_ITEM.value]: o.sendGridId
|
|
87
|
+
}), d = (o) => ({
|
|
88
|
+
[t.SELECT_ITEM.text]: o,
|
|
89
|
+
[t.SELECT_ITEM.value]: `header:${o}`,
|
|
90
|
+
[t.SELECT_ITEM.disabled]: !0
|
|
91
|
+
}), l = [
|
|
92
|
+
d(this.api.translate("OPT-IN SELECTION")),
|
|
93
|
+
c(s),
|
|
94
|
+
d(this.api.translate("UNSUBSCRIBE GROUPS")),
|
|
95
|
+
...u.map(c)
|
|
96
|
+
];
|
|
97
|
+
this.unsubList = [s, ...u], this.api.setUIEAttribute(
|
|
98
|
+
E,
|
|
99
|
+
t.SELECTPICKER.items,
|
|
100
|
+
l
|
|
87
101
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
102
|
}
|
|
89
103
|
}
|
|
90
104
|
export {
|
|
91
105
|
b as CONTROL_BLOCK_ID,
|
|
92
|
-
|
|
106
|
+
G as RadioButtonControl
|
|
93
107
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useToaster as
|
|
1
|
+
import { useToaster as n } from "../../../composables/useToaster.js";
|
|
2
2
|
import { useTranslations as s } from "../../../composables/useTranslations.js";
|
|
3
|
-
import { ToasterTypeOptions as
|
|
3
|
+
import { ToasterTypeOptions as r } from "../../../enums/toaster.js";
|
|
4
4
|
import { countLiveRecommendationBlocks as i } from "./utils/recommendationBlockCount.js";
|
|
5
|
-
const
|
|
6
|
-
const { showToaster: o } =
|
|
5
|
+
const c = "newsletter.multiple-reco-blocks-warning", u = () => {
|
|
6
|
+
const { showToaster: o } = n(), t = s();
|
|
7
7
|
return { warnIfMultipleBlocks: (e) => {
|
|
8
8
|
i(e) > 1 && o({
|
|
9
|
-
type:
|
|
10
|
-
message: t(
|
|
9
|
+
type: r.Info,
|
|
10
|
+
message: t(c)
|
|
11
11
|
});
|
|
12
12
|
} };
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
u as useRecommendationBlockWarning
|
|
16
16
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -26,7 +26,7 @@ const u = (e) => new Promise((t) => {
|
|
|
26
26
|
} catch (o) {
|
|
27
27
|
console.error(`Failed to fetch blank template (attempt ${r}/${a}):`, o), r < a && await u(r * f);
|
|
28
28
|
}
|
|
29
|
-
return e({ type: p.
|
|
29
|
+
return e({ type: p.Error, message: t("errors-pages.undefined-response") }), { html: "", css: "" };
|
|
30
30
|
} };
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
@@ -4,11 +4,12 @@ import { useToaster as C } from "../composables/useToaster.js";
|
|
|
4
4
|
import { useTranslations as h } from "../composables/useTranslations.js";
|
|
5
5
|
import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
|
|
6
6
|
import { EditorType as v } from "../enums/defaults.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { ToasterTypeOptions as N } from "../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as x } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { useSaveAsTemplateStore as E } from "../stores/save-as-template.js";
|
|
9
10
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
10
11
|
import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
|
|
11
|
-
const
|
|
12
|
+
const j = () => {
|
|
12
13
|
const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = h();
|
|
13
14
|
return {
|
|
14
15
|
getCategories: async () => {
|
|
@@ -39,7 +40,7 @@ const $ = () => {
|
|
|
39
40
|
createTemplate: async () => {
|
|
40
41
|
var e, t, d, y;
|
|
41
42
|
try {
|
|
42
|
-
const { prepareTemplateDetails: i } = A(), s =
|
|
43
|
+
const { prepareTemplateDetails: i } = A(), s = E(), a = await i();
|
|
43
44
|
if (p("liquidSyntax") && !await g(a.compiledHtml))
|
|
44
45
|
return !1;
|
|
45
46
|
const f = {
|
|
@@ -53,7 +54,7 @@ const $ = () => {
|
|
|
53
54
|
unsubscriptionPreferencePageStatus: !1,
|
|
54
55
|
unsubscriptionPreferencePages: [],
|
|
55
56
|
recommendationCampaignUrls: r(
|
|
56
|
-
|
|
57
|
+
x().recommendationCampaignUrls
|
|
57
58
|
),
|
|
58
59
|
recommendationConfigs: r({}),
|
|
59
60
|
isGuido: !0,
|
|
@@ -74,7 +75,7 @@ const $ = () => {
|
|
|
74
75
|
"newsletter.template-library-save-alert",
|
|
75
76
|
{ templateName: s.getTemplateName }
|
|
76
77
|
),
|
|
77
|
-
type:
|
|
78
|
+
type: N.Error
|
|
78
79
|
}), !1) : (l({
|
|
79
80
|
message: u(
|
|
80
81
|
"newsletter.template-library-save-success",
|
|
@@ -89,5 +90,5 @@ const $ = () => {
|
|
|
89
90
|
};
|
|
90
91
|
};
|
|
91
92
|
export {
|
|
92
|
-
|
|
93
|
+
j as useTemplateLibraryApi
|
|
93
94
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StripoNotifications } from '@@/Types/stripo';
|
|
2
|
+
/**
|
|
3
|
+
* Adapter that routes Stripo's in-editor notifications through Guido's own
|
|
4
|
+
* InToasts-based toaster, so the editor only ever shows one toaster style.
|
|
5
|
+
* Passed to `initEditor` as the `notifications` config (Stripo then delegates
|
|
6
|
+
* rendering to us instead of drawing its native <ue-notifications-container>).
|
|
7
|
+
*/
|
|
8
|
+
export declare const useStripoNotifications: () => {
|
|
9
|
+
getStripoNotifications: () => StripoNotifications;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function migrateSocialIcons(html: string): string;
|
|
@@ -19,6 +19,8 @@ export declare const PRODUCT_TYPE_URL_SEGMENTS: {
|
|
|
19
19
|
};
|
|
20
20
|
export declare const INSIDER_ID = "iid";
|
|
21
21
|
export declare const DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID = "G";
|
|
22
|
+
export declare const PIXEL_TRACKING_SEND_GRID_ID = "P";
|
|
23
|
+
export declare const UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS: string[];
|
|
22
24
|
/**
|
|
23
25
|
* Get the default unsubscribe group lazily so the translated name resolves at access time.
|
|
24
26
|
* Must be called within a Vue component context or after Pinia is initialized.
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* - `trending` → `trendingProducts` (id 40, path `trending`)
|
|
9
9
|
* - `mostValuable` → `mostValuableOfPartner` (id 46, path `most-valuable`)
|
|
10
10
|
* - `topSellers` → `mostPurchased` (id 62, path `top-sellers`)
|
|
11
|
+
* - `mostViewed` → `mostPopular` (id 61, path `most-popular`)
|
|
11
12
|
*
|
|
12
13
|
* Used at two boundaries:
|
|
13
14
|
* 1. The migrator (`settingsMapper`), so freshly migrated node configs carry
|
|
@@ -4,15 +4,14 @@ export declare const useToasterStore: import("pinia").StoreDefinition<"guidoToas
|
|
|
4
4
|
status: boolean;
|
|
5
5
|
type: import("@@/Types/toaster").ToasterType;
|
|
6
6
|
text: string;
|
|
7
|
-
icon: string;
|
|
8
|
-
withIcon: boolean;
|
|
9
7
|
withoutLeftMargin: boolean;
|
|
8
|
+
autoHide: boolean;
|
|
10
9
|
actionButton?: {
|
|
11
10
|
text: string;
|
|
12
11
|
onClick: () => void;
|
|
13
12
|
} | undefined;
|
|
14
13
|
} & import("pinia").PiniaCustomStateProperties<ToasterState>) => boolean;
|
|
15
14
|
}, {
|
|
16
|
-
showToaster(this: ToasterState, { type, message, actionButton }: ToasterOptions): void;
|
|
15
|
+
showToaster(this: ToasterState, { type, message, actionButton, autoHide }: ToasterOptions): void;
|
|
17
16
|
hideToaster(this: ToasterState): void;
|
|
18
17
|
}>;
|
|
@@ -39,6 +39,18 @@ ue-dropdown .service-element.padding-t-3 {
|
|
|
39
39
|
color: var(--guido-color-primary-500);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
/*
|
|
43
|
+
* SD-145233: the pixel-tracking preference dropdown has no native option groups,
|
|
44
|
+
* so its section titles are rendered as disabled items. Present them as
|
|
45
|
+
* non-interactive group headers instead of options: no hover/cursor affordance
|
|
46
|
+
* and a little extra vertical spacing.
|
|
47
|
+
*/
|
|
48
|
+
.dropdown__menu .dropdown__item.disabled {
|
|
49
|
+
padding-top: 14px;
|
|
50
|
+
padding-bottom: 8px;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
42
54
|
.menu {
|
|
43
55
|
padding: 8px 0px;
|
|
44
56
|
}
|
|
@@ -96,6 +96,13 @@ ue-control-panel,
|
|
|
96
96
|
min-height: auto;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/* Hide the "Press ESC to deselect" keyboard hint Stripo 2.69 adds to every block's settings
|
|
100
|
+
header (SD-145833) — no plugin option toggles it. The sibling close (X) is a <ue-button>,
|
|
101
|
+
so scoping to a bare <button> in .panel-close-hint leaves the close button intact. */
|
|
102
|
+
.control-panel-header .panel-close-hint > button {
|
|
103
|
+
display: none !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
.container.droppable-header-container ue-button:last-child {
|
|
100
107
|
margin-right: 0;
|
|
101
108
|
}
|
package/dist/stores/toaster.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ToasterTypeOptions as e } from "../enums/toaster.js";
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
2
|
+
import { defineStore as a } from "pinia";
|
|
3
|
+
const u = () => ({
|
|
4
4
|
status: !1,
|
|
5
5
|
type: e.Success,
|
|
6
6
|
text: "",
|
|
7
|
-
icon: "",
|
|
8
|
-
withIcon: !0,
|
|
9
7
|
withoutLeftMargin: !1,
|
|
8
|
+
autoHide: !0,
|
|
10
9
|
actionButton: void 0
|
|
11
|
-
}),
|
|
12
|
-
state: () =>
|
|
10
|
+
}), h = a("guidoToaster", {
|
|
11
|
+
state: () => u(),
|
|
13
12
|
getters: {
|
|
14
|
-
|
|
13
|
+
// A toast without auto-hide (e.g. Stripo `loader`) stays until hideToaster.
|
|
14
|
+
shouldAutoHide: (t) => t.status && !!t.text && t.autoHide
|
|
15
15
|
},
|
|
16
16
|
actions: {
|
|
17
|
-
showToaster({ type: t = e.Success, message: s, actionButton: o }) {
|
|
18
|
-
this.status = !0, this.text = s, this.type = t, this.actionButton = o;
|
|
17
|
+
showToaster({ type: t = e.Success, message: s, actionButton: o, autoHide: i = !0 }) {
|
|
18
|
+
this.status = !0, this.text = s, this.type = t, this.actionButton = o, this.autoHide = i;
|
|
19
19
|
},
|
|
20
20
|
hideToaster() {
|
|
21
21
|
this.status = !1;
|
|
@@ -23,5 +23,5 @@ const a = () => ({
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
h as useToasterStore
|
|
27
27
|
};
|
|
@@ -2,15 +2,16 @@ import { useActionsApi as P } from "../composables/useActionsApi.js";
|
|
|
2
2
|
import { useHtmlCompiler as w } from "../composables/useHtmlCompiler.js";
|
|
3
3
|
import { DEFAULT_CURRENCY as l, DEFAULT_NODE_CONFIG as i } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
4
4
|
import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { mapLegacyStrategy as E } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
5
6
|
import { DATA_ATTRIBUTES as h } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
6
|
-
import { parsePageList as
|
|
7
|
-
import { useDynamicContentStore as
|
|
8
|
-
import { useUnsubscribeStore as
|
|
9
|
-
function
|
|
7
|
+
import { parsePageList as H } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
8
|
+
import { useDynamicContentStore as U } from "../stores/dynamic-content.js";
|
|
9
|
+
import { useUnsubscribeStore as F } from "../stores/unsubscribe.js";
|
|
10
|
+
function L(s) {
|
|
10
11
|
const o = new DOMParser().parseFromString(s, "text/html").querySelectorAll(`[${h.PAGE_LIST}]`), t = [];
|
|
11
|
-
return o.forEach((
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
return o.forEach((a) => {
|
|
13
|
+
const n = a.getAttribute(h.PAGE_LIST);
|
|
14
|
+
n && t.push(...H(n));
|
|
14
15
|
}), [...new Set(t)];
|
|
15
16
|
}
|
|
16
17
|
async function R(s) {
|
|
@@ -20,8 +21,8 @@ async function R(s) {
|
|
|
20
21
|
const o = b();
|
|
21
22
|
m.forEach((t) => {
|
|
22
23
|
var c, p, g, f, r;
|
|
23
|
-
const
|
|
24
|
-
if (!Number.isFinite(
|
|
24
|
+
const a = t.getAttribute("recommendation-id"), n = a ? Number(a) : NaN;
|
|
25
|
+
if (!Number.isFinite(n))
|
|
25
26
|
return;
|
|
26
27
|
const d = t.getAttribute("esd-ext-config");
|
|
27
28
|
if (!d)
|
|
@@ -35,7 +36,10 @@ async function R(s) {
|
|
|
35
36
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
36
37
|
return;
|
|
37
38
|
const y = {
|
|
38
|
-
strategy
|
|
39
|
+
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
40
|
+
// already-saved blocks that never re-run the migrator don't emit a
|
|
41
|
+
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
42
|
+
strategy: E(e.strategy) || i.strategy,
|
|
39
43
|
language: e.language ?? i.language,
|
|
40
44
|
size: e.size ?? i.size,
|
|
41
45
|
// Spread the default arrays so each block gets a fresh reference
|
|
@@ -49,7 +53,7 @@ async function R(s) {
|
|
|
49
53
|
currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? l.decimalSeparator,
|
|
50
54
|
currencyThousandSeparator: ((r = e.currency) == null ? void 0 : r.thousandSeparator) ?? l.thousandSeparator
|
|
51
55
|
};
|
|
52
|
-
o.seedBlockUrlConfig(
|
|
56
|
+
o.seedBlockUrlConfig(n, y);
|
|
53
57
|
});
|
|
54
58
|
try {
|
|
55
59
|
await o.fetchRecommendationCreateData();
|
|
@@ -60,8 +64,8 @@ async function R(s) {
|
|
|
60
64
|
);
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
|
-
const
|
|
64
|
-
const s =
|
|
67
|
+
const G = () => {
|
|
68
|
+
const s = U(), u = F(), { getCompiledEmail: m, getTemplateData: o } = P(), { compileHtml: t, compileAmpHtml: a } = w();
|
|
65
69
|
return {
|
|
66
70
|
prepareTemplateDetails: async () => {
|
|
67
71
|
const { html: d, ampHtml: e = "", ampErrors: y = [] } = await m({
|
|
@@ -69,7 +73,7 @@ const v = () => {
|
|
|
69
73
|
resetDataSavedFlag: !1
|
|
70
74
|
}), { html: c, css: p, syncModulesIds: g = [] } = await o();
|
|
71
75
|
u.selectedUnsubscribePages.length && await u.fetchTemplates(), await R(c);
|
|
72
|
-
const { compiledHtml: f, stats: r, appliedRules: A } = t(d), C = e &&
|
|
76
|
+
const { compiledHtml: f, stats: r, appliedRules: A } = t(d), C = e && a(e).compiledHtml, T = s.getSelectedDynamicContentList, D = b(), S = L(c);
|
|
73
77
|
return console.debug("HTML Compilation Stats:", {
|
|
74
78
|
originalSize: r.originalSize,
|
|
75
79
|
compiledSize: r.compiledSize,
|
|
@@ -97,6 +101,6 @@ const v = () => {
|
|
|
97
101
|
};
|
|
98
102
|
};
|
|
99
103
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
L as getHtmlReferencedUnsubscribePages,
|
|
105
|
+
G as useTemplatePreparation
|
|
102
106
|
};
|