@useinsider/guido 3.7.0-beta.9fddd7d → 3.7.0-beta.a1aaf44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/config/schemas.js +66 -70
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +37 -34
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +54 -51
- package/dist/composables/usePreviewMode.js +14 -15
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +82 -90
- package/dist/config/migrator/recommendation/htmlBuilder.js +58 -59
- package/dist/config/migrator/recommendation/settingsMapper.js +33 -38
- package/dist/extensions/Blocks/Recommendation/block.js +39 -58
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +32 -41
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +288 -369
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +72 -84
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +66 -68
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +7 -21
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +4 -64
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +5 -7
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +72 -101
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -31
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -9
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +59 -74
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -88
- package/dist/extensions/Blocks/Unsubscribe/block.js +74 -60
- package/dist/extensions/Blocks/Unsubscribe/control.js +33 -24
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -16
- package/dist/src/composables/useConfig.d.ts +0 -4
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -29
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +0 -13
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +2 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -33
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -15
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +6 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
- package/dist/src/stores/config.d.ts +0 -36
- package/dist/src/stores/unsubscribe.d.ts +11 -1
- package/dist/stores/unsubscribe.js +8 -7
- package/package.json +1 -1
- package/dist/composables/useRecommendationPreview.js +0 -100
- package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +0 -133
- package/dist/src/composables/useRecommendationPreview.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +0 -59
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
var
|
|
2
|
-
var k = (c, n, e) => n in c ?
|
|
3
|
-
var
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var k = (c, n, e) => n in c ? m(c, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[n] = e;
|
|
3
|
+
var a = (c, n, e) => k(c, typeof n != "symbol" ? n + "" : n, e);
|
|
4
4
|
import { useToaster as B } from "../../../composables/useToaster.js";
|
|
5
5
|
import { ToasterTypeOptions as S } from "../../../enums/toaster.js";
|
|
6
6
|
import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { useEditorStore as f } from "../../../stores/editor.js";
|
|
8
|
+
import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
|
|
9
|
+
import { Block as L, BlockCompositionType as A, ContextActionType as h, ModificationDescription as b, BlockType as v } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
10
|
+
import { getDefaultTemplate as I } from "./template.js";
|
|
10
11
|
import { DATA_ATTRIBUTES as i, UNSUBSCRIBE_EVENTS as d } from "./utils/constants.js";
|
|
11
12
|
import { parsePageList as p } from "./utils/utils.js";
|
|
12
|
-
const
|
|
13
|
+
const T = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', _ = ".unsubscribe-block-v2", y = "{{ins-unsubscribe-link}}", C = "https://academy.insiderone.com/docs/adding-unsubscribe-pages-into-emails", N = "Removing the unsubscribe text leaves an empty block, but an active unsubscribe link is required. Undo your last action to restore the text, or delete the unsubscribe block entirely.", U = {
|
|
13
14
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
14
15
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
15
16
|
};
|
|
16
|
-
class
|
|
17
|
+
class K extends L {
|
|
17
18
|
constructor() {
|
|
18
19
|
super();
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
a(this, "selectEventListener", null);
|
|
21
|
+
a(this, "cancelEventListener", null);
|
|
22
|
+
a(this, "currentNode");
|
|
22
23
|
// Per-block "did this instance have a link last time we saw it?" tracking.
|
|
23
24
|
// Keyed by the stable `data-unsubscribe-block-id` we assign, because
|
|
24
25
|
// ImmutableHtmlNode instances are recreated on every document mutation and
|
|
25
26
|
// can't be used as Map keys directly. A singleton boolean here would be
|
|
26
27
|
// polluted across blocks since Stripo fires onDocumentChanged per-instance.
|
|
27
|
-
|
|
28
|
+
a(this, "linkStateByBlockId", /* @__PURE__ */ new Map());
|
|
28
29
|
}
|
|
29
30
|
getId() {
|
|
30
|
-
return
|
|
31
|
+
return T;
|
|
31
32
|
}
|
|
32
33
|
getIcon() {
|
|
33
34
|
return "unsubscribe-icon";
|
|
34
35
|
}
|
|
35
36
|
getBlockCompositionType() {
|
|
36
|
-
return
|
|
37
|
+
return A.BLOCK;
|
|
37
38
|
}
|
|
38
39
|
getName() {
|
|
39
40
|
return this.api.translate("Unsubscribe Block");
|
|
@@ -42,37 +43,49 @@ class F extends L {
|
|
|
42
43
|
return this.api.translate("Unsubscribe Block Description");
|
|
43
44
|
}
|
|
44
45
|
getTemplate() {
|
|
45
|
-
return
|
|
46
|
+
return I();
|
|
46
47
|
}
|
|
47
48
|
getContextActionsIds() {
|
|
48
49
|
return [h.MOVE, h.REMOVE];
|
|
49
50
|
}
|
|
50
51
|
onSelect(e) {
|
|
51
|
-
this.currentNode = e
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
if (this.currentNode = e, f().isPreviewModeOpen)
|
|
53
|
+
return;
|
|
54
|
+
const r = this._readBlockId(e) !== null, t = this._getOrAssignBlockId(e);
|
|
55
|
+
t && this.linkStateByBlockId.set(t, this._hasUnsubscribeLink(e)), !("getAttribute" in e && e.getAttribute("data-migration")) && (r && !this._hasPageSelection(e) || (this._resetStoreState(), t && (l().pendingBlockId = t), this._loadBlockState(e), this._setupSelectEventListener(), this._setupCancelEventListener(t), this._checkExistingBlocks(), this._openDrawer()));
|
|
54
56
|
}
|
|
55
57
|
onDocumentChanged(e) {
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
58
|
+
const r = this._getOrAssignBlockId(e);
|
|
59
|
+
if (!r)
|
|
58
60
|
return;
|
|
59
|
-
const
|
|
60
|
-
this.linkStateByBlockId.get(
|
|
61
|
+
const t = this._hasUnsubscribeLink(e);
|
|
62
|
+
this.linkStateByBlockId.get(r) === !0 && !t && this._warnLinkRemoved(), this.linkStateByBlockId.set(r, t);
|
|
61
63
|
}
|
|
62
64
|
onDelete(e) {
|
|
63
65
|
this._removeEventListeners(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
+
const r = this._readBlockId(e);
|
|
67
|
+
r && this.linkStateByBlockId.delete(r);
|
|
66
68
|
}
|
|
67
69
|
onDestroy() {
|
|
68
70
|
this._removeEventListeners(), this.currentNode = void 0, this.linkStateByBlockId.clear();
|
|
69
71
|
}
|
|
70
72
|
_hasUnsubscribeLink(e) {
|
|
71
|
-
return "querySelector" in e ? !!e.querySelector(
|
|
73
|
+
return "querySelector" in e ? !!e.querySelector(g) : !1;
|
|
72
74
|
}
|
|
73
75
|
_readBlockId(e) {
|
|
74
76
|
return "getAttribute" in e ? e.getAttribute(i.BLOCK_ID) : null;
|
|
75
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* True when the block has a page type and a page list — i.e. a template was
|
|
80
|
+
* applied. A block with neither, combined with an already-present block id,
|
|
81
|
+
* is an undo-restored orphan of a cancelled block.
|
|
82
|
+
*/
|
|
83
|
+
_hasPageSelection(e) {
|
|
84
|
+
if (!("getAttribute" in e))
|
|
85
|
+
return !1;
|
|
86
|
+
const r = e.getAttribute(i.PAGE_TYPE), t = e.getAttribute(i.PAGE_LIST);
|
|
87
|
+
return !!r && !!t;
|
|
88
|
+
}
|
|
76
89
|
/**
|
|
77
90
|
* Returns the block's stable id, assigning one via the document modifier if
|
|
78
91
|
* the node has not been tagged yet. Idempotent: subsequent calls during
|
|
@@ -80,18 +93,18 @@ class F extends L {
|
|
|
80
93
|
* `apply()`) short-circuit on the existing attribute.
|
|
81
94
|
*/
|
|
82
95
|
_getOrAssignBlockId(e) {
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
return
|
|
96
|
+
const r = this._readBlockId(e);
|
|
97
|
+
if (r)
|
|
98
|
+
return r;
|
|
86
99
|
if (!("getAttribute" in e))
|
|
87
100
|
return null;
|
|
88
|
-
const
|
|
101
|
+
const t = this._generateNextBlockId();
|
|
89
102
|
try {
|
|
90
|
-
this.api.getDocumentModifier().modifyHtml(e).setAttribute(i.BLOCK_ID,
|
|
103
|
+
this.api.getDocumentModifier().modifyHtml(e).setAttribute(i.BLOCK_ID, t).apply(new b(`Assign unsubscribe block id ${t}`));
|
|
91
104
|
} catch (s) {
|
|
92
105
|
return console.warn("[UnsubscribeBlock] Failed to assign block id:", s), null;
|
|
93
106
|
}
|
|
94
|
-
return
|
|
107
|
+
return t;
|
|
95
108
|
}
|
|
96
109
|
/**
|
|
97
110
|
* Generates a unique id by scanning the document for the highest existing
|
|
@@ -101,8 +114,8 @@ class F extends L {
|
|
|
101
114
|
_generateNextBlockId() {
|
|
102
115
|
let e = 0;
|
|
103
116
|
try {
|
|
104
|
-
const
|
|
105
|
-
|
|
117
|
+
const r = this.api.getDocumentRoot();
|
|
118
|
+
r && "querySelectorAll" in r && r.querySelectorAll(_).forEach((s) => {
|
|
106
119
|
if ("getAttribute" in s) {
|
|
107
120
|
const o = s.getAttribute(i.BLOCK_ID), u = o ? parseInt(o) : 0;
|
|
108
121
|
u > e && (e = u);
|
|
@@ -117,11 +130,11 @@ class F extends L {
|
|
|
117
130
|
const { showToaster: e } = B();
|
|
118
131
|
e({
|
|
119
132
|
type: S.Warning,
|
|
120
|
-
message: this.api.translate(
|
|
133
|
+
message: this.api.translate(N),
|
|
121
134
|
actionButton: {
|
|
122
135
|
text: this.api.translate("Visit Academy"),
|
|
123
136
|
onClick: () => {
|
|
124
|
-
window.open(
|
|
137
|
+
window.open(C, "_blank", "noopener,noreferrer");
|
|
125
138
|
}
|
|
126
139
|
}
|
|
127
140
|
});
|
|
@@ -131,16 +144,17 @@ class F extends L {
|
|
|
131
144
|
}
|
|
132
145
|
_setupSelectEventListener() {
|
|
133
146
|
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
134
|
-
const
|
|
135
|
-
this._updateBlock(
|
|
147
|
+
const r = e, { collectionType: t, selectedPages: s } = r.detail;
|
|
148
|
+
this._updateBlock(t, s.join(","));
|
|
136
149
|
}, document.addEventListener(d.SELECT, this.selectEventListener);
|
|
137
150
|
}
|
|
138
151
|
_removeSelectEventListener() {
|
|
139
152
|
this.selectEventListener && (document.removeEventListener(d.SELECT, this.selectEventListener), this.selectEventListener = null);
|
|
140
153
|
}
|
|
141
|
-
_setupCancelEventListener() {
|
|
142
|
-
this._removeCancelEventListener(), this.cancelEventListener = () => {
|
|
143
|
-
|
|
154
|
+
_setupCancelEventListener(e) {
|
|
155
|
+
this._removeCancelEventListener(), this.cancelEventListener = (r) => {
|
|
156
|
+
const { detail: t } = r, s = (t == null ? void 0 : t.blockId) ?? null;
|
|
157
|
+
s !== null && s !== e || this._handleCancel();
|
|
144
158
|
}, document.addEventListener(d.CANCEL, this.cancelEventListener);
|
|
145
159
|
}
|
|
146
160
|
_removeCancelEventListener() {
|
|
@@ -158,32 +172,32 @@ class F extends L {
|
|
|
158
172
|
_removeEventListeners() {
|
|
159
173
|
this._removeSelectEventListener(), this._removeCancelEventListener();
|
|
160
174
|
}
|
|
161
|
-
_updateBlock(e,
|
|
175
|
+
_updateBlock(e, r) {
|
|
162
176
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
163
177
|
return;
|
|
164
|
-
const
|
|
165
|
-
if (!
|
|
178
|
+
const t = this.currentNode.querySelector(g);
|
|
179
|
+
if (!t)
|
|
166
180
|
return;
|
|
167
181
|
const s = this._getMergeTag(e);
|
|
168
|
-
this.api.getDocumentModifier().modifyHtml(
|
|
182
|
+
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", s).apply(new b(`Updated unsubscribe link to ${s}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(i.PAGE_TYPE, e.toString()).setAttribute(i.PAGE_LIST, r).apply(new b("Updated unsubscribe block metadata"));
|
|
169
183
|
}
|
|
170
184
|
_getMergeTag(e) {
|
|
171
|
-
return
|
|
185
|
+
return U[e] ?? y;
|
|
172
186
|
}
|
|
173
187
|
_openDrawer() {
|
|
174
188
|
if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
|
|
175
189
|
try {
|
|
176
|
-
const e =
|
|
190
|
+
const e = l();
|
|
177
191
|
e.typeSelectionDrawerStatus = !0;
|
|
178
192
|
} catch (e) {
|
|
179
193
|
console.error("[UnsubscribeBlock] Failed to open drawer:", e);
|
|
180
194
|
}
|
|
181
195
|
}
|
|
182
196
|
_checkExistingBlocks() {
|
|
183
|
-
const e =
|
|
184
|
-
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(_).forEach((
|
|
185
|
-
if ("getAttribute" in
|
|
186
|
-
const s =
|
|
197
|
+
const e = l();
|
|
198
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(_).forEach((t) => {
|
|
199
|
+
if ("getAttribute" in t) {
|
|
200
|
+
const s = t.getAttribute(i.PAGE_TYPE);
|
|
187
201
|
if (s) {
|
|
188
202
|
const o = Number(s);
|
|
189
203
|
o === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : o === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
@@ -194,26 +208,26 @@ class F extends L {
|
|
|
194
208
|
async _loadBlockState(e) {
|
|
195
209
|
if (!("getAttribute" in e))
|
|
196
210
|
return;
|
|
197
|
-
const
|
|
198
|
-
if (!
|
|
211
|
+
const r = e.getAttribute(i.PAGE_TYPE), t = e.getAttribute(i.PAGE_LIST);
|
|
212
|
+
if (!r || !t)
|
|
199
213
|
return;
|
|
200
|
-
const s =
|
|
214
|
+
const s = l(), o = Number(r), u = p(t);
|
|
201
215
|
await s.fetchTemplates(), s.setCollectionWithoutAutoSelection(o), s.loadSelectedTemplates(u);
|
|
202
216
|
}
|
|
203
217
|
_resetStoreState() {
|
|
204
|
-
|
|
218
|
+
l().$reset();
|
|
205
219
|
}
|
|
206
220
|
_removeBlockTemplatesFromStore(e) {
|
|
207
221
|
if (!("getAttribute" in e))
|
|
208
222
|
return;
|
|
209
|
-
const
|
|
210
|
-
if (!
|
|
223
|
+
const r = e.getAttribute(i.PAGE_LIST);
|
|
224
|
+
if (!r)
|
|
211
225
|
return;
|
|
212
|
-
const
|
|
213
|
-
|
|
226
|
+
const t = l(), s = p(r);
|
|
227
|
+
t.removeUnsubscribePages(s);
|
|
214
228
|
}
|
|
215
229
|
}
|
|
216
230
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
231
|
+
T as UNSUBSCRIBE_BLOCK_ID,
|
|
232
|
+
K as UnsubscribeBlock
|
|
219
233
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var T = Object.defineProperty;
|
|
2
|
+
var p = (a, s, e) => s in a ? T(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e;
|
|
3
|
+
var c = (a, s, e) => p(a, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { useEditorStore as _ } from "../../../stores/editor.js";
|
|
4
5
|
import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
|
|
5
|
-
import { Control as
|
|
6
|
-
import { DATA_ATTRIBUTES as
|
|
7
|
-
import { parsePageList as
|
|
6
|
+
import { Control as g, UEAttr as i, UIElementType as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { DATA_ATTRIBUTES as d } from "./utils/constants.js";
|
|
8
|
+
import { parsePageList as h } from "./utils/utils.js";
|
|
8
9
|
const v = "ui-elements-unsubscribe", r = {
|
|
9
10
|
SELECT_BUTTON: "selectTemplateButton",
|
|
10
11
|
PREV_BUTTON: "prevButton",
|
|
@@ -12,14 +13,14 @@ const v = "ui-elements-unsubscribe", r = {
|
|
|
12
13
|
COUNTER_TEXT: "counterText",
|
|
13
14
|
PREVIEW_IMAGE: "previewImage"
|
|
14
15
|
};
|
|
15
|
-
class
|
|
16
|
+
class w extends g {
|
|
16
17
|
constructor() {
|
|
17
18
|
super(...arguments);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
c(this, "currentPreviewIndex", 0);
|
|
20
|
+
c(this, "currentNode");
|
|
21
|
+
c(this, "currentPages");
|
|
22
|
+
c(this, "valueChangeHandlers", []);
|
|
23
|
+
c(this, "lastParsedAttribute");
|
|
23
24
|
}
|
|
24
25
|
getId() {
|
|
25
26
|
return v;
|
|
@@ -34,8 +35,8 @@ class B extends T {
|
|
|
34
35
|
}
|
|
35
36
|
onTemplateNodeUpdated(e) {
|
|
36
37
|
if (this.currentNode = e, "getAttribute" in this.currentNode) {
|
|
37
|
-
const t = this.currentNode.getAttribute(
|
|
38
|
-
t && (t !== this.lastParsedAttribute && (this.currentPages =
|
|
38
|
+
const t = this.currentNode.getAttribute(d.PAGE_LIST);
|
|
39
|
+
t && (t !== this.lastParsedAttribute && (this.currentPages = h(t), this.lastParsedAttribute = t, this.currentPreviewIndex = 0), this._updateCounter(), this._loadAndUpdatePreview());
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
onRender() {
|
|
@@ -61,12 +62,20 @@ class B extends T {
|
|
|
61
62
|
}
|
|
62
63
|
_onButtonClick() {
|
|
63
64
|
try {
|
|
65
|
+
if (_().isPreviewModeOpen)
|
|
66
|
+
return;
|
|
64
67
|
const e = l();
|
|
65
|
-
e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
|
|
68
|
+
this._reseedSelectionFromBlock(e), e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
|
|
66
69
|
} catch (e) {
|
|
67
70
|
console.error("[UnsubscribeControl] Failed to open drawer:", e);
|
|
68
71
|
}
|
|
69
72
|
}
|
|
73
|
+
_reseedSelectionFromBlock(e) {
|
|
74
|
+
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
75
|
+
return;
|
|
76
|
+
const t = this.currentNode.getAttribute(d.PAGE_TYPE), o = this.currentNode.getAttribute(d.PAGE_LIST);
|
|
77
|
+
!t || !o || (e.$reset(), e.setCollectionWithoutAutoSelection(Number(t)), e.loadSelectedTemplates(h(o)));
|
|
78
|
+
}
|
|
70
79
|
_onPrevClick() {
|
|
71
80
|
this.currentPreviewIndex > 0 && (this.currentPreviewIndex--, this._updatePreview(), this._updateCounter());
|
|
72
81
|
}
|
|
@@ -80,21 +89,21 @@ class B extends T {
|
|
|
80
89
|
var e;
|
|
81
90
|
if ((e = this.currentPages) != null && e.length)
|
|
82
91
|
try {
|
|
83
|
-
const t = this.currentPages[this.currentPreviewIndex],
|
|
84
|
-
if (!
|
|
92
|
+
const t = this.currentPages[this.currentPreviewIndex], u = l().getThumbnailByTemplateId(t);
|
|
93
|
+
if (!u) {
|
|
85
94
|
console.warn("[UnsubscribeControl] No thumbnail found for page:", t);
|
|
86
95
|
return;
|
|
87
96
|
}
|
|
88
97
|
this.api.updateValues({
|
|
89
|
-
[r.PREVIEW_IMAGE]:
|
|
98
|
+
[r.PREVIEW_IMAGE]: u
|
|
90
99
|
});
|
|
91
100
|
} catch (t) {
|
|
92
101
|
console.error("[UnsubscribeControl] Failed to update preview:", t);
|
|
93
102
|
}
|
|
94
103
|
}
|
|
95
104
|
_updateCounter() {
|
|
96
|
-
const e = this.currentPreviewIndex + 1, t = this.totalTemplates,
|
|
97
|
-
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled,
|
|
105
|
+
const e = this.currentPreviewIndex + 1, t = this.totalTemplates, o = this.currentPreviewIndex === 0, u = this.currentPreviewIndex >= t - 1;
|
|
106
|
+
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, u), this.api.setUIEAttribute(
|
|
98
107
|
r.COUNTER_TEXT,
|
|
99
108
|
i.LABEL.text,
|
|
100
109
|
`${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
|
|
@@ -135,14 +144,14 @@ class B extends T {
|
|
|
135
144
|
</${n.LABEL}>
|
|
136
145
|
`;
|
|
137
146
|
}
|
|
138
|
-
_getIconButton(e, t,
|
|
139
|
-
const
|
|
147
|
+
_getIconButton(e, t, o) {
|
|
148
|
+
const u = o ? `${i.BUTTON.disabled}="true"` : "";
|
|
140
149
|
return `
|
|
141
150
|
<${n.BUTTON}
|
|
142
151
|
id="${e}"
|
|
143
152
|
class="flat-inline flat-white"
|
|
144
153
|
${i.BUTTON.name}="${e}"
|
|
145
|
-
${
|
|
154
|
+
${u}
|
|
146
155
|
>
|
|
147
156
|
<${n.ICON}
|
|
148
157
|
src="${t}"
|
|
@@ -166,5 +175,5 @@ class B extends T {
|
|
|
166
175
|
}
|
|
167
176
|
export {
|
|
168
177
|
v as UNSUBSCRIBE_CONTROL_ID,
|
|
169
|
-
|
|
178
|
+
w as UnsubscribeControl
|
|
170
179
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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-82128f7d]{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-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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-82128f7d]{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-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-1b31027d]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-1b31027d]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-1b31027d]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-1b31027d]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-1b31027d]{object-fit:cover;transform:scale(1)}[data-v-811cff80] .guido__verion-history-view-option-selection-desktop svg,[data-v-811cff80] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-811cff80] .in-segments-wrapper__button_selected,[data-v-811cff80] .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}
|
|
@@ -139,10 +139,6 @@ export declare const LegacyRecommendationConfigSchema: v.LooseObjectSchema<{
|
|
|
139
139
|
readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
140
140
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
141
141
|
readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
142
|
-
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
143
|
-
readonly isPriceMovedToNextLine: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
144
|
-
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
145
|
-
readonly isPriceDeletedForZeroSale: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
146
142
|
}, undefined>;
|
|
147
143
|
/**
|
|
148
144
|
* Migration-only inputs scoped to this template.
|
|
@@ -199,10 +195,6 @@ export declare const TemplateMigrationSchema: v.ObjectSchema<{
|
|
|
199
195
|
readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
200
196
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
201
197
|
readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
202
|
-
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
203
|
-
readonly isPriceMovedToNextLine: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
204
|
-
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
205
|
-
readonly isPriceDeletedForZeroSale: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
206
198
|
}, undefined>, undefined>, {}>;
|
|
207
199
|
}, undefined>;
|
|
208
200
|
/**
|
|
@@ -282,10 +274,6 @@ export declare const TemplateSchema: v.ObjectSchema<{
|
|
|
282
274
|
readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
283
275
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
284
276
|
readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
285
|
-
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
286
|
-
readonly isPriceMovedToNextLine: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
287
|
-
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
288
|
-
readonly isPriceDeletedForZeroSale: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
289
277
|
}, undefined>, undefined>, {}>;
|
|
290
278
|
}, undefined>, {}>;
|
|
291
279
|
}, undefined>;
|
|
@@ -677,10 +665,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
677
665
|
readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
678
666
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
679
667
|
readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
680
|
-
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
681
|
-
readonly isPriceMovedToNextLine: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
682
|
-
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
683
|
-
readonly isPriceDeletedForZeroSale: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
684
668
|
}, undefined>, undefined>, {}>;
|
|
685
669
|
}, undefined>, {}>;
|
|
686
670
|
}, undefined>, {}>;
|
|
@@ -60,8 +60,6 @@ export declare const useConfig: () => {
|
|
|
60
60
|
blockType?: string | undefined;
|
|
61
61
|
size?: string | number | undefined;
|
|
62
62
|
verticalResponsiveness?: boolean | undefined;
|
|
63
|
-
isPriceMovedToNextLine?: boolean | undefined;
|
|
64
|
-
isPriceDeletedForZeroSale?: boolean | undefined;
|
|
65
63
|
} & {
|
|
66
64
|
[key: string]: unknown;
|
|
67
65
|
};
|
|
@@ -188,8 +186,6 @@ export declare const useConfig: () => {
|
|
|
188
186
|
blockType?: string | undefined;
|
|
189
187
|
size?: string | number | undefined;
|
|
190
188
|
verticalResponsiveness?: boolean | undefined;
|
|
191
|
-
isPriceMovedToNextLine?: boolean | undefined;
|
|
192
|
-
isPriceDeletedForZeroSale?: boolean | undefined;
|
|
193
189
|
} & {
|
|
194
190
|
[key: string]: unknown;
|
|
195
191
|
};
|
|
@@ -3,5 +3,5 @@ import type { CurrencyConfig, RecommendationNodeConfig } from '@@/Extensions/Blo
|
|
|
3
3
|
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
4
4
|
/** Defensive against missing/malformed legacy `currencySettings` — defaults are per-field, not whole-object. */
|
|
5
5
|
export declare function mapCurrency(legacy: unknown): CurrencyConfig;
|
|
6
|
-
export type SettingsPartial = Pick<RecommendationNodeConfig, 'recommendationId' | 'strategy' | 'productIds' | 'size' | 'shuffleProducts' | 'language' | 'currency' | 'filters' | 'layout' | 'cardsInRow' | 'mobileCardsInRow' | 'mobileLayoutEnabled' | 'previousMobileCardsInRow' | 'columnSpacing' | 'rowSpacing' | 'mobileColumnSpacing' | 'mobileRowSpacing' | 'omnibusPrice' | 'omnibusDiscount' | '
|
|
6
|
+
export type SettingsPartial = Pick<RecommendationNodeConfig, 'recommendationId' | 'strategy' | 'productIds' | 'size' | 'shuffleProducts' | 'language' | 'currency' | 'filters' | 'layout' | 'cardsInRow' | 'mobileCardsInRow' | 'mobileLayoutEnabled' | 'previousMobileCardsInRow' | 'columnSpacing' | 'rowSpacing' | 'mobileColumnSpacing' | 'mobileRowSpacing' | 'omnibusPrice' | 'omnibusDiscount' | 'configVersion'>;
|
|
7
7
|
export declare function mapSettings(recCfg: LegacyRecommendationConfig, parsed: LegacyProductConfig, id: number): SettingsPartial;
|
|
@@ -104,16 +104,6 @@ export declare class RecommendationBlock extends Block {
|
|
|
104
104
|
* added classes via setAttribute.
|
|
105
105
|
*/
|
|
106
106
|
private _assignRecommendationId;
|
|
107
|
-
/**
|
|
108
|
-
* Stamps the `hide-price` attribute (read by email-service at send time) on
|
|
109
|
-
* the block element from the config flag.
|
|
110
|
-
*/
|
|
111
|
-
private _stampHidePrice;
|
|
112
|
-
/**
|
|
113
|
-
* Stamps `hide-price` from config only when the block lacks the attribute —
|
|
114
|
-
* heals templates saved before this feature without dirtying current ones.
|
|
115
|
-
*/
|
|
116
|
-
private _healHidePriceAttr;
|
|
117
107
|
/**
|
|
118
108
|
* Gets the recommendation-id from a block node
|
|
119
109
|
*/
|
|
@@ -43,15 +43,6 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
43
43
|
*/
|
|
44
44
|
private _tryReorderInPlace;
|
|
45
45
|
private _createBuiltInItemHtml;
|
|
46
|
-
/**
|
|
47
|
-
* Inline mode: the merged "Product Prices" group item. It moves as a unit in
|
|
48
|
-
* the main list (both keys stay adjacent) and contains a nested 2-item drag
|
|
49
|
-
* to reorder Product Price ↔ Product Original Price — which flips the inline
|
|
50
|
-
* render order via `resolveInlinePriceOrder`. The group keeps a single
|
|
51
|
-
* visibility toggle (`data-action-for="productPrice"`). Nested sub-items use a
|
|
52
|
-
* plain drag handle (no UE button → untouched by the reorder-icon rescue).
|
|
53
|
-
*/
|
|
54
|
-
private _createPriceGroupItemHtml;
|
|
55
46
|
private _createCustomItemHtml;
|
|
56
47
|
/**
|
|
57
48
|
* Builds select options from the store's filterList.
|
|
@@ -107,23 +98,7 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
107
98
|
*/
|
|
108
99
|
private _rescueReorderIconsToStore;
|
|
109
100
|
private _setupEventListeners;
|
|
110
|
-
/**
|
|
111
|
-
* Builds the composition key order from the orderable list, expanding the
|
|
112
|
-
* inline "Product Prices" group into its two sub-keys (in nested DOM order)
|
|
113
|
-
* so both price keys stay adjacent and in the user-chosen order.
|
|
114
|
-
*/
|
|
115
|
-
private _extractCompositionOrder;
|
|
116
101
|
private _setupDragAndDrop;
|
|
117
|
-
/**
|
|
118
|
-
* Wires drag/drop reordering for one item level on the shared list. Both the
|
|
119
|
-
* top-level items and the nested price sub-items use this; they never fight
|
|
120
|
-
* because each only sets its `dragged` ref when its own `itemSelector` matches
|
|
121
|
-
* at dragstart (and the top-level one additionally ignores drags originating
|
|
122
|
-
* inside `ignoreSelector`). Every drop re-reads the full composition via
|
|
123
|
-
* `_extractCompositionOrder`, so both levels commit through `_onReorder`
|
|
124
|
-
* identically.
|
|
125
|
-
*/
|
|
126
|
-
private _registerDragHandlers;
|
|
127
102
|
private _setupDeleteHandler;
|
|
128
103
|
private _onAddAttribute;
|
|
129
104
|
/**
|
|
@@ -180,10 +155,9 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
180
155
|
private _extractSegmentBgFromCard;
|
|
181
156
|
private _getControlContainer;
|
|
182
157
|
/**
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* disabled state.)
|
|
158
|
+
* Adds/removes orderable-disabled class based on layout orientation.
|
|
159
|
+
* List layout hides drag handles via CSS and disables draggable attribute
|
|
160
|
+
* to prevent native browser drag-and-drop from working without the handle.
|
|
187
161
|
*/
|
|
188
162
|
private _updateOrderableState;
|
|
189
163
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* // Or individual imports
|
|
10
10
|
* import { NameAlignControl, ButtonColorControl } from './controls';
|
|
11
11
|
*/
|
|
12
|
-
export { RecommendationBlockControl, CONTROL_BLOCK_ID, AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID,
|
|
12
|
+
export { RecommendationBlockControl, CONTROL_BLOCK_ID, AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, } from './main';
|
|
13
13
|
export * from './main/utils';
|
|
14
14
|
export { NameControls } from './name';
|
|
15
15
|
export { PriceControls } from './price';
|
|
@@ -5,12 +5,11 @@ import { CurrencyControl, CURRENCY_CONTROL_ID } from './currency';
|
|
|
5
5
|
import { FiltersControl, FILTERS_CONTROL_ID } from './filters';
|
|
6
6
|
import { LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID } from './layoutOrientation';
|
|
7
7
|
import { LocaleControl, LOCALE_CONTROL_ID } from './locale';
|
|
8
|
-
import { PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID } from './pricePlacement';
|
|
9
8
|
import { ProductCountControl, PRODUCT_COUNT_CONTROL_ID } from './productCount';
|
|
10
9
|
import { ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID } from './productLayout';
|
|
11
10
|
import { ShuffleControl, SHUFFLE_CONTROL_ID } from './shuffle';
|
|
12
11
|
export declare const CONTROL_BLOCK_ID = "ui-elements-recommendation-block";
|
|
13
|
-
export { AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID,
|
|
12
|
+
export { AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, };
|
|
14
13
|
export * from './utils';
|
|
15
14
|
/**
|
|
16
15
|
* Main recommendation block control that composes all sub-controls
|
|
@@ -26,7 +25,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
26
25
|
private productLayoutControl;
|
|
27
26
|
private filtersControl;
|
|
28
27
|
private shuffleControl;
|
|
29
|
-
private pricePlacementControl;
|
|
30
28
|
private layoutOrientationControl;
|
|
31
29
|
getId(): string;
|
|
32
30
|
getTemplate(): string;
|
|
@@ -24,8 +24,6 @@ export interface PerBlockConfigs {
|
|
|
24
24
|
unresponsive: boolean;
|
|
25
25
|
size: string;
|
|
26
26
|
customAttributes: string[];
|
|
27
|
-
priceMovedToNextLine: boolean;
|
|
28
|
-
priceHideIfSameAsDiscounted: boolean;
|
|
29
27
|
}
|
|
30
28
|
interface PerBlockState {
|
|
31
29
|
recommendationConfigs: PerBlockConfigs;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
1
|
import { type ElementRenderer } from '../utils';
|
|
3
2
|
/**
|
|
4
3
|
* Grid element renderer
|
|
@@ -25,19 +24,4 @@ export declare const ATTRIBUTE_CELL_CLASS = "attribute-cell";
|
|
|
25
24
|
* card-composition control so both render identical filler markup.
|
|
26
25
|
*/
|
|
27
26
|
export declare function buildFillerCell(columnWidth: string, padding?: string): string;
|
|
28
|
-
/**
|
|
29
|
-
* Renders the inline price cell used when "Move to next line" is OFF: the sale
|
|
30
|
-
* price and original price sit side by side in a single attribute cell, each
|
|
31
|
-
* keeping its own `esd-extension-block-id` + `product-*` class so the per-element
|
|
32
|
-
* style controls and the compiler keep working.
|
|
33
|
-
*
|
|
34
|
-
* `originalFirst` preserves the card-composition order (original before sale when
|
|
35
|
-
* `productOldPrice` precedes `productPrice` in the composition) so the side-by-side
|
|
36
|
-
* order matches the stacked order.
|
|
37
|
-
*/
|
|
38
|
-
export declare function renderInlineGridPriceCell(product: RecommendationProduct, originalFirst?: boolean): string;
|
|
39
|
-
/**
|
|
40
|
-
* Standalone (stacked) original-price cell.
|
|
41
|
-
*/
|
|
42
|
-
export declare function renderGridOldPriceCell(product: RecommendationProduct): string;
|
|
43
27
|
export declare const gridElementRenderer: ElementRenderer;
|