@useinsider/guido 3.7.2-beta.a114aa7 → 3.7.2-beta.a787136
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/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +8 -8
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +15 -12
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +16 -15
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +4 -4
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +38 -35
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +54 -51
- package/dist/composables/useHtmlValidator.js +133 -180
- package/dist/composables/usePreviewInteractionGuard.js +17 -0
- package/dist/composables/useSave.js +14 -14
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +26 -17
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +27 -28
- package/dist/config/migrator/recommendation/extractors.js +22 -44
- package/dist/config/migrator/recommendation/htmlBuilder.js +169 -175
- package/dist/config/migrator/recommendationMigrator.js +31 -30
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -21
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +41 -55
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +42 -43
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +33 -44
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +2 -3
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +49 -59
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +82 -89
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +6 -7
- package/dist/extensions/Blocks/Recommendation/extension.js +5 -6
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +2 -3
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +2 -3
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +12 -13
- package/dist/extensions/Blocks/Recommendation/templates/index.js +4 -5
- package/dist/extensions/Blocks/Unsubscribe/block.js +40 -37
- package/dist/extensions/Blocks/Unsubscribe/control.js +19 -16
- package/dist/guido.css +1 -1
- package/dist/src/composables/useHtmlValidator.d.ts +0 -27
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -15
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +0 -8
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -21
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +0 -6
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -9
- package/dist/src/stores/unsubscribe.d.ts +11 -1
- package/dist/stores/unsubscribe.js +8 -7
- package/package.json +1 -1
- package/dist/config/compiler/utils/recommendationIgnoreUtils.js +0 -15
- package/dist/src/composables/useHtmlValidator.test.d.ts +0 -1
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +0 -17
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +0 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
var S = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var a = (c, o, e) =>
|
|
4
|
-
import { useToaster as
|
|
2
|
+
var f = (c, o, e) => o in c ? S(c, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[o] = e;
|
|
3
|
+
var a = (c, o, e) => f(c, typeof o != "symbol" ? o + "" : o, e);
|
|
4
|
+
import { useToaster as L } from "../../../composables/useToaster.js";
|
|
5
5
|
import { ToasterTypeOptions as A } from "../../../enums/toaster.js";
|
|
6
6
|
import { PAGE_TYPES as h } from "../../../enums/unsubscribe.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { useEditorStore as y } from "../../../stores/editor.js";
|
|
8
|
+
import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
|
|
9
|
+
import { Block as T, BlockCompositionType as I, ContextActionType as B, ModificationDescription as d, BlockType as v } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
10
|
+
import { getDefaultTemplate as C } from "./template.js";
|
|
10
11
|
import { UNSUBSCRIBE_BLOCK_SELECTOR as m, DATA_ATTRIBUTES as n, UNSUBSCRIBE_EVENTS as b } from "./utils/constants.js";
|
|
11
|
-
import { parsePageList as
|
|
12
|
-
const
|
|
12
|
+
import { parsePageList as _ } from "./utils/utils.js";
|
|
13
|
+
const N = "unsubscribe-block", E = 'a[data-unsubscribe-link="true"]', U = "{{ins-unsubscribe-link}}", R = "https://academy.insiderone.com/docs/adding-unsubscribe-pages-into-emails", D = "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.", w = {
|
|
13
14
|
[h.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
14
15
|
[h.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
15
|
-
},
|
|
16
|
-
class
|
|
16
|
+
}, P = 3;
|
|
17
|
+
class W extends T {
|
|
17
18
|
constructor() {
|
|
18
19
|
super();
|
|
19
20
|
a(this, "selectEventListener", null);
|
|
@@ -29,13 +30,13 @@ class H extends y {
|
|
|
29
30
|
a(this, "guardAttemptsByBlockId", /* @__PURE__ */ new Map());
|
|
30
31
|
}
|
|
31
32
|
getId() {
|
|
32
|
-
return
|
|
33
|
+
return N;
|
|
33
34
|
}
|
|
34
35
|
getIcon() {
|
|
35
36
|
return "unsubscribe-icon";
|
|
36
37
|
}
|
|
37
38
|
getBlockCompositionType() {
|
|
38
|
-
return
|
|
39
|
+
return I.BLOCK;
|
|
39
40
|
}
|
|
40
41
|
getName() {
|
|
41
42
|
return this.api.translate("Unsubscribe Block");
|
|
@@ -44,15 +45,16 @@ class H extends y {
|
|
|
44
45
|
return this.api.translate("Unsubscribe Block Description");
|
|
45
46
|
}
|
|
46
47
|
getTemplate() {
|
|
47
|
-
return
|
|
48
|
+
return C();
|
|
48
49
|
}
|
|
49
50
|
getContextActionsIds() {
|
|
50
|
-
return [
|
|
51
|
+
return [B.MOVE, B.REMOVE];
|
|
51
52
|
}
|
|
52
53
|
onSelect(e) {
|
|
53
|
-
this.currentNode = e
|
|
54
|
+
if (this.currentNode = e, y().isPreviewModeOpen)
|
|
55
|
+
return;
|
|
54
56
|
const t = this._getOrAssignBlockId(e);
|
|
55
|
-
t && this.linkStateByBlockId.set(t, this._hasUnsubscribeLink(e)), !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
57
|
+
t && this.linkStateByBlockId.set(t, this._hasUnsubscribeLink(e)), !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), t && (l().pendingBlockId = t), this._loadBlockState(e), this._setupSelectEventListener(), this._setupCancelEventListener(t), this._checkExistingBlocks(), this._openDrawer());
|
|
56
58
|
}
|
|
57
59
|
onCreated(e) {
|
|
58
60
|
this._ensureLeadingTextGuard(e);
|
|
@@ -107,9 +109,9 @@ class H extends y {
|
|
|
107
109
|
const g = this._getOrAssignBlockId(e);
|
|
108
110
|
if (!g)
|
|
109
111
|
return;
|
|
110
|
-
const
|
|
111
|
-
if (!(
|
|
112
|
-
this.guardAttemptsByBlockId.set(g,
|
|
112
|
+
const k = this.guardAttemptsByBlockId.get(g) ?? 0;
|
|
113
|
+
if (!(k >= P)) {
|
|
114
|
+
this.guardAttemptsByBlockId.set(g, k + 1);
|
|
113
115
|
try {
|
|
114
116
|
this.api.getDocumentModifier().modifyHtml(r).prepend(" ").apply(new d("Ensure unsubscribe link text guard"));
|
|
115
117
|
} catch (p) {
|
|
@@ -154,8 +156,8 @@ class H extends y {
|
|
|
154
156
|
const t = this.api.getDocumentRoot();
|
|
155
157
|
t && "querySelectorAll" in t && t.querySelectorAll(m).forEach((r) => {
|
|
156
158
|
if ("getAttribute" in r) {
|
|
157
|
-
const i = r.getAttribute(n.BLOCK_ID),
|
|
158
|
-
|
|
159
|
+
const i = r.getAttribute(n.BLOCK_ID), u = i ? parseInt(i) : 0;
|
|
160
|
+
u > e && (e = u);
|
|
159
161
|
}
|
|
160
162
|
});
|
|
161
163
|
} catch {
|
|
@@ -164,14 +166,14 @@ class H extends y {
|
|
|
164
166
|
}
|
|
165
167
|
_warnLinkRemoved() {
|
|
166
168
|
try {
|
|
167
|
-
const { showToaster: e } =
|
|
169
|
+
const { showToaster: e } = L();
|
|
168
170
|
e({
|
|
169
171
|
type: A.Warning,
|
|
170
|
-
message: this.api.translate(
|
|
172
|
+
message: this.api.translate(D),
|
|
171
173
|
actionButton: {
|
|
172
174
|
text: this.api.translate("Visit Academy"),
|
|
173
175
|
onClick: () => {
|
|
174
|
-
window.open(
|
|
176
|
+
window.open(R, "_blank", "noopener,noreferrer");
|
|
175
177
|
}
|
|
176
178
|
}
|
|
177
179
|
});
|
|
@@ -188,9 +190,10 @@ class H extends y {
|
|
|
188
190
|
_removeSelectEventListener() {
|
|
189
191
|
this.selectEventListener && (document.removeEventListener(b.SELECT, this.selectEventListener), this.selectEventListener = null);
|
|
190
192
|
}
|
|
191
|
-
_setupCancelEventListener() {
|
|
192
|
-
this._removeCancelEventListener(), this.cancelEventListener = () => {
|
|
193
|
-
|
|
193
|
+
_setupCancelEventListener(e) {
|
|
194
|
+
this._removeCancelEventListener(), this.cancelEventListener = (t) => {
|
|
195
|
+
const { detail: s } = t, r = (s == null ? void 0 : s.blockId) ?? null;
|
|
196
|
+
r !== null && r !== e || this._handleCancel();
|
|
194
197
|
}, document.addEventListener(b.CANCEL, this.cancelEventListener);
|
|
195
198
|
}
|
|
196
199
|
_removeCancelEventListener() {
|
|
@@ -200,7 +203,7 @@ class H extends y {
|
|
|
200
203
|
try {
|
|
201
204
|
if (!this.currentNode)
|
|
202
205
|
return;
|
|
203
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${
|
|
206
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${v.EMPTY_CONTAINER}/>`).apply(new d("Removed unsubscribe block due to cancel"));
|
|
204
207
|
} catch (e) {
|
|
205
208
|
console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
|
|
206
209
|
}
|
|
@@ -218,19 +221,19 @@ class H extends y {
|
|
|
218
221
|
this.api.getDocumentModifier().modifyHtml(s).setAttribute("href", r).apply(new d(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(n.PAGE_TYPE, e.toString()).setAttribute(n.PAGE_LIST, t).apply(new d("Updated unsubscribe block metadata"));
|
|
219
222
|
}
|
|
220
223
|
_getMergeTag(e) {
|
|
221
|
-
return
|
|
224
|
+
return w[e] ?? U;
|
|
222
225
|
}
|
|
223
226
|
_openDrawer() {
|
|
224
227
|
if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
|
|
225
228
|
try {
|
|
226
|
-
const e =
|
|
229
|
+
const e = l();
|
|
227
230
|
e.typeSelectionDrawerStatus = !0;
|
|
228
231
|
} catch (e) {
|
|
229
232
|
console.error("[UnsubscribeBlock] Failed to open drawer:", e);
|
|
230
233
|
}
|
|
231
234
|
}
|
|
232
235
|
_checkExistingBlocks() {
|
|
233
|
-
const e =
|
|
236
|
+
const e = l();
|
|
234
237
|
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(m).forEach((s) => {
|
|
235
238
|
if ("getAttribute" in s) {
|
|
236
239
|
const r = s.getAttribute(n.PAGE_TYPE);
|
|
@@ -247,11 +250,11 @@ class H extends y {
|
|
|
247
250
|
const t = e.getAttribute(n.PAGE_TYPE), s = e.getAttribute(n.PAGE_LIST);
|
|
248
251
|
if (!t || !s)
|
|
249
252
|
return;
|
|
250
|
-
const r =
|
|
251
|
-
await r.fetchTemplates(), r.setCollectionWithoutAutoSelection(i), r.loadSelectedTemplates(
|
|
253
|
+
const r = l(), i = Number(t), u = _(s);
|
|
254
|
+
await r.fetchTemplates(), r.setCollectionWithoutAutoSelection(i), r.loadSelectedTemplates(u);
|
|
252
255
|
}
|
|
253
256
|
_resetStoreState() {
|
|
254
|
-
|
|
257
|
+
l().$reset();
|
|
255
258
|
}
|
|
256
259
|
_removeBlockTemplatesFromStore(e) {
|
|
257
260
|
if (!("getAttribute" in e))
|
|
@@ -259,11 +262,11 @@ class H extends y {
|
|
|
259
262
|
const t = e.getAttribute(n.PAGE_LIST);
|
|
260
263
|
if (!t)
|
|
261
264
|
return;
|
|
262
|
-
const s =
|
|
265
|
+
const s = l(), r = _(t);
|
|
263
266
|
s.removeUnsubscribePages(r);
|
|
264
267
|
}
|
|
265
268
|
}
|
|
266
269
|
export {
|
|
267
|
-
|
|
268
|
-
|
|
270
|
+
N as UNSUBSCRIBE_BLOCK_ID,
|
|
271
|
+
W as UnsubscribeBlock
|
|
269
272
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
var T = Object.defineProperty;
|
|
2
|
-
var p = (
|
|
3
|
-
var c = (
|
|
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 { Control as g, UEAttr as i, UIElementType as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
7
|
import { DATA_ATTRIBUTES as d } from "./utils/constants.js";
|
|
7
8
|
import { parsePageList as h } from "./utils/utils.js";
|
|
8
|
-
const
|
|
9
|
+
const v = "ui-elements-unsubscribe", r = {
|
|
9
10
|
SELECT_BUTTON: "selectTemplateButton",
|
|
10
11
|
PREV_BUTTON: "prevButton",
|
|
11
12
|
NEXT_BUTTON: "nextButton",
|
|
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
|
c(this, "currentPreviewIndex", 0);
|
|
@@ -22,7 +23,7 @@ class B extends _ {
|
|
|
22
23
|
c(this, "lastParsedAttribute");
|
|
23
24
|
}
|
|
24
25
|
getId() {
|
|
25
|
-
return
|
|
26
|
+
return v;
|
|
26
27
|
}
|
|
27
28
|
getTemplate() {
|
|
28
29
|
return `
|
|
@@ -59,10 +60,12 @@ class B extends _ {
|
|
|
59
60
|
this.api.onValueChanged(r.NEXT_BUTTON, () => this._onNextClick())
|
|
60
61
|
);
|
|
61
62
|
}
|
|
62
|
-
_onButtonClick() {
|
|
63
|
+
async _onButtonClick() {
|
|
63
64
|
try {
|
|
65
|
+
if (_().isPreviewModeOpen)
|
|
66
|
+
return;
|
|
64
67
|
const e = l();
|
|
65
|
-
this._reseedSelectionFromBlock(), e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
|
|
68
|
+
await e.fetchTemplates(!0), this._reseedSelectionFromBlock(), 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
|
}
|
|
@@ -71,8 +74,8 @@ class B extends _ {
|
|
|
71
74
|
const e = l();
|
|
72
75
|
if (e.$reset(), !this.currentNode || !("getAttribute" in this.currentNode))
|
|
73
76
|
return;
|
|
74
|
-
const t = this.currentNode.getAttribute(d.PAGE_TYPE),
|
|
75
|
-
!t || !
|
|
77
|
+
const t = this.currentNode.getAttribute(d.PAGE_TYPE), o = this.currentNode.getAttribute(d.PAGE_LIST);
|
|
78
|
+
!t || !o || (e.setCollectionWithoutAutoSelection(Number(t)), e.loadSelectedTemplates(h(o)));
|
|
76
79
|
}
|
|
77
80
|
_onPrevClick() {
|
|
78
81
|
this.currentPreviewIndex > 0 && (this.currentPreviewIndex--, this._updatePreview(), this._updateCounter());
|
|
@@ -100,8 +103,8 @@ class B extends _ {
|
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
_updateCounter() {
|
|
103
|
-
const e = this.currentPreviewIndex + 1, t = this.totalTemplates,
|
|
104
|
-
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled,
|
|
106
|
+
const e = this.currentPreviewIndex + 1, t = this.totalTemplates, o = this.currentPreviewIndex === 0, u = this.currentPreviewIndex >= t - 1;
|
|
107
|
+
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, u), this.api.setUIEAttribute(
|
|
105
108
|
r.COUNTER_TEXT,
|
|
106
109
|
i.LABEL.text,
|
|
107
110
|
`${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
|
|
@@ -142,8 +145,8 @@ class B extends _ {
|
|
|
142
145
|
</${n.LABEL}>
|
|
143
146
|
`;
|
|
144
147
|
}
|
|
145
|
-
_getIconButton(e, t,
|
|
146
|
-
const u =
|
|
148
|
+
_getIconButton(e, t, o) {
|
|
149
|
+
const u = o ? `${i.BUTTON.disabled}="true"` : "";
|
|
147
150
|
return `
|
|
148
151
|
<${n.BUTTON}
|
|
149
152
|
id="${e}"
|
|
@@ -172,6 +175,6 @@ class B extends _ {
|
|
|
172
175
|
}
|
|
173
176
|
}
|
|
174
177
|
export {
|
|
175
|
-
|
|
176
|
-
|
|
178
|
+
v as UNSUBSCRIBE_CONTROL_ID,
|
|
179
|
+
w as UnsubscribeControl
|
|
177
180
|
};
|
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-ec5c2ac6]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-ec5c2ac6]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-ec5c2ac6]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-ec5c2ac6]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-ec5c2ac6]{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-06afaecb]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-06afaecb]{min-height:504px}.iframe-wrapper[data-v-cbafc185]{width:258px}.iframe-scaled[data-v-cbafc185]{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}
|
|
@@ -1,31 +1,4 @@
|
|
|
1
1
|
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
-
import type { FiltersResponse } from '@@/Types/recommendation';
|
|
3
|
-
/**
|
|
4
|
-
* Parses a `{{recoId_index_attributeName}}` variable (already stripped of the
|
|
5
|
-
* braces/whitespace) into its recommendation id and attribute name. Returns
|
|
6
|
-
* null for anything that isn't a well-formed recommendation variable.
|
|
7
|
-
*/
|
|
8
|
-
export declare function parseRecommendationVariable(field: string): {
|
|
9
|
-
recoId: string;
|
|
10
|
-
attribute: string;
|
|
11
|
-
} | null;
|
|
12
|
-
/**
|
|
13
|
-
* Builds the set of attribute forms valid inside partner-authored
|
|
14
|
-
* `{{recoId_index_attribute}}` variables: the built-in compiler attributes plus
|
|
15
|
-
* each account attribute in its canonical token form — bare for
|
|
16
|
-
* `defaultAttribute`, `product_attribute.<name>` for `productAttribute`. Using
|
|
17
|
-
* `resolveProductAttrValue` (the same producer the block builder uses) keeps the
|
|
18
|
-
* validator's notion of "valid form" identical to what is actually emitted.
|
|
19
|
-
*/
|
|
20
|
-
export declare function buildPartnerAttributeNameSet(filterList: FiltersResponse): Set<string>;
|
|
21
|
-
/**
|
|
22
|
-
* Returns the `{{...}}` custom fields in the HTML that are invalid. Partner
|
|
23
|
-
* attributes in `ins-skip-compile` blocks (recoId ∈ ignoredIds) are checked
|
|
24
|
-
* against `ignoredAttributeNames`; Guido-generated reco variables and known merge
|
|
25
|
-
* tags pass. An unrecognized dotted token is ignored: it was never captured
|
|
26
|
-
* before, so flagging it would false-positive on merge tags like `{{user.name}}`.
|
|
27
|
-
*/
|
|
28
|
-
export declare function findInvalidCustomFields(html: string, validCustomFields: string[], recommendationBlockIds: string[], ignoredIds: Set<string>, ignoredAttributeNames: Set<string> | null): string[];
|
|
29
2
|
export declare const useHtmlValidator: () => {
|
|
30
3
|
validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
|
|
31
4
|
};
|
|
@@ -5,18 +5,3 @@ export declare function extractTitleText(block: Element): string;
|
|
|
5
5
|
* the caller treats that as "no segment background".
|
|
6
6
|
*/
|
|
7
7
|
export declare function extractCardBgColor(block: Element): string;
|
|
8
|
-
/**
|
|
9
|
-
* Reads the legacy block's own `currency-*` attributes into a
|
|
10
|
-
* `currencySettings`-shaped object that `mapCurrency` understands. Used as a
|
|
11
|
-
* fallback when the external recommendationConfigs map has no entry for this
|
|
12
|
-
* block, so the migrated block keeps its real currency instead of defaulting.
|
|
13
|
-
* Returns undefined when the block carries no `currency` attribute.
|
|
14
|
-
*/
|
|
15
|
-
export declare function extractCurrencyFromBlock(block: Element): Record<string, string> | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* True when a PM has manually opted the legacy block out of content
|
|
18
|
-
* regeneration by adding the `ins-skip-compile` class. Detected before rebuild
|
|
19
|
-
* so the migrator preserves the partner's markup verbatim (keeping their
|
|
20
|
-
* hand-authored variables) instead of regenerating the block.
|
|
21
|
-
*/
|
|
22
|
-
export declare function isPartnerManagedBlock(block: Element): boolean;
|
|
@@ -8,12 +8,4 @@ export declare function buildBlockHtml(params: {
|
|
|
8
8
|
extraClasses?: string;
|
|
9
9
|
legacyId?: string;
|
|
10
10
|
legacyBgColor?: string;
|
|
11
|
-
/**
|
|
12
|
-
* When set, the block's existing inner HTML is preserved verbatim instead
|
|
13
|
-
* of regenerating product rows — used for partner-customized blocks so
|
|
14
|
-
* their hand-authored `{{...}}` variables survive migration.
|
|
15
|
-
*/
|
|
16
|
-
preserveInnerHtml?: string;
|
|
17
|
-
/** Adds the `ins-skip-compile` opt-out class to the migrated block. */
|
|
18
|
-
skipCompile?: boolean;
|
|
19
11
|
}): string;
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { RecommendationBlockId } from './blockIds';
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
|
-
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON,
|
|
11
|
+
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
12
12
|
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
13
|
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -23,18 +23,6 @@ export declare const MOBILE_ROW_SELECTOR = ".ins-recommendation-mobile-row";
|
|
|
23
23
|
* `{{cId_pIdx_url}}` template variable.
|
|
24
24
|
*/
|
|
25
25
|
export declare const CSS_CLASS_RECO_BUTTON = "reco-v3-button";
|
|
26
|
-
/**
|
|
27
|
-
* Opt-out class for partners who want to inject their own template variables
|
|
28
|
-
* into a recommendation block. When present on `.recommendation-block-v2`,
|
|
29
|
-
* Guido skips ONLY its product-data → template-variable substitution
|
|
30
|
-
* (`replaceProductAttributes`) for that block — partners author their own
|
|
31
|
-
* `{{recoId_index_attribute}}` variables. Everything else (campaign URL
|
|
32
|
-
* building, hidden-row removal, Outlook image widths, text-trim CSS, discount
|
|
33
|
-
* conditions, store hydration, store-level config validation, and general HTML
|
|
34
|
-
* optimizations) still applies. The class is preserved in the final compiled
|
|
35
|
-
* output so partners may use it for their own styling.
|
|
36
|
-
*/
|
|
37
|
-
export declare const CSS_CLASS_SKIP_COMPILE = "ins-skip-compile";
|
|
38
26
|
/**
|
|
39
27
|
* Currency HTML attributes set on the block element
|
|
40
28
|
* These are read by the HTML compiler at runtime to format prices
|
|
@@ -73,12 +61,3 @@ export declare const ATTR_PRODUCT_ATTR = "product-attr";
|
|
|
73
61
|
* Used to exclude these from the custom attribute dropdown to prevent duplication with toggles.
|
|
74
62
|
*/
|
|
75
63
|
export declare const BUILT_IN_DEFAULT_ATTRIBUTES: Set<string>;
|
|
76
|
-
/**
|
|
77
|
-
* Attribute names valid inside a `{{recoId_index_attributeName}}` template
|
|
78
|
-
* variable regardless of the account's custom attribute list. Every built-in
|
|
79
|
-
* composition attribute is valid, plus `currency` and `discount` which the
|
|
80
|
-
* compiler emits but are not composition toggles. Custom attributes are
|
|
81
|
-
* validated separately against the account's fetched attribute list
|
|
82
|
-
* (`stripo/email-recommendation-attributes`).
|
|
83
|
-
*/
|
|
84
|
-
export declare const RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES: Set<string>;
|
|
@@ -17,13 +17,6 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
17
17
|
getId(): string;
|
|
18
18
|
getTemplate(): string;
|
|
19
19
|
onRender(): void;
|
|
20
|
-
/**
|
|
21
|
-
* Card composition restructures the block (toggles/reorders/adds attribute
|
|
22
|
-
* cells), which would corrupt a partner-managed (`ins-skip-compile`) block's
|
|
23
|
-
* preserved markup. There is no native tab-disable API, so the whole control
|
|
24
|
-
* container is rendered inert (greyed + non-interactive) instead.
|
|
25
|
-
*/
|
|
26
|
-
_syncDisabledState(): void;
|
|
27
20
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
28
21
|
onDestroy(): void;
|
|
29
22
|
private _initializeComposition;
|
|
@@ -21,11 +21,6 @@ export declare class LayoutOrientationControl extends CommonControl {
|
|
|
21
21
|
getTemplate(): string;
|
|
22
22
|
onRender(): void;
|
|
23
23
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
24
|
-
/**
|
|
25
|
-
* Layout orientation restructures the whole block, which is meaningless for
|
|
26
|
-
* partner-managed (`ins-skip-compile`) blocks — disable the control there.
|
|
27
|
-
*/
|
|
28
|
-
_syncDisabledState(): void;
|
|
29
24
|
_setFormValues(): void;
|
|
30
25
|
/**
|
|
31
26
|
* Handles layout change
|
|
@@ -30,12 +30,6 @@ export declare class ProductLayoutControl extends CommonControl {
|
|
|
30
30
|
getTemplate(): string;
|
|
31
31
|
onRender(): void;
|
|
32
32
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
33
|
-
/**
|
|
34
|
-
* Products-per-row and mobile-layout restructure the block, which is
|
|
35
|
-
* meaningless for partner-managed (`ins-skip-compile`) blocks — disable
|
|
36
|
-
* these inputs there. Disabling coexists with the visibility logic above.
|
|
37
|
-
*/
|
|
38
|
-
_syncDisabledState(): void;
|
|
39
33
|
onDestroy(): void;
|
|
40
34
|
_setFormValues(): void;
|
|
41
35
|
/**
|
|
@@ -35,15 +35,6 @@ interface DocumentModifier {
|
|
|
35
35
|
* @returns The block element or null if not found
|
|
36
36
|
*/
|
|
37
37
|
export declare function getBlockElement(currentNode: ImmutableHtmlNode | null | undefined): ImmutableHtmlNode | null;
|
|
38
|
-
/**
|
|
39
|
-
* True when the recommendation block has opted out of Guido's content
|
|
40
|
-
* regeneration via the `ins-skip-compile` class. Partner-managed blocks carry
|
|
41
|
-
* hand-authored `{{...}}` variables in their cells, so Guido must never
|
|
42
|
-
* overwrite their content with product data (regenerate / in-place update).
|
|
43
|
-
* @param currentNode - The current template node
|
|
44
|
-
* @returns True if the block opted out of content regeneration
|
|
45
|
-
*/
|
|
46
|
-
export declare function isPartnerManagedBlock(currentNode: ImmutableHtmlNode | null | undefined): boolean;
|
|
47
38
|
/**
|
|
48
39
|
* Gets the current layout orientation from the block's data attribute
|
|
49
40
|
* Supports both old (horizontal/vertical) and new (list/grid) values for backward compatibility
|
|
@@ -10,6 +10,7 @@ interface StoreState {
|
|
|
10
10
|
typeSelectionDrawerStatus: boolean;
|
|
11
11
|
isGlobalUnsubscribeDisabled: boolean;
|
|
12
12
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
13
|
+
pendingBlockId: string | null;
|
|
13
14
|
}
|
|
14
15
|
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guidoUnsubscribe", StoreState, {
|
|
15
16
|
getSelectedCollection: (state: {
|
|
@@ -35,6 +36,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
35
36
|
typeSelectionDrawerStatus: boolean;
|
|
36
37
|
isGlobalUnsubscribeDisabled: boolean;
|
|
37
38
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
39
|
+
pendingBlockId: string | null;
|
|
38
40
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => number[];
|
|
39
41
|
getSelectedTemplateByActiveType: (state: {
|
|
40
42
|
templates: {
|
|
@@ -59,6 +61,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
59
61
|
typeSelectionDrawerStatus: boolean;
|
|
60
62
|
isGlobalUnsubscribeDisabled: boolean;
|
|
61
63
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
64
|
+
pendingBlockId: string | null;
|
|
62
65
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => number;
|
|
63
66
|
getTemplatesByActiveType: (state: {
|
|
64
67
|
templates: {
|
|
@@ -83,6 +86,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
83
86
|
typeSelectionDrawerStatus: boolean;
|
|
84
87
|
isGlobalUnsubscribeDisabled: boolean;
|
|
85
88
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
89
|
+
pendingBlockId: string | null;
|
|
86
90
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
87
91
|
id: number;
|
|
88
92
|
name: string;
|
|
@@ -119,6 +123,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
119
123
|
typeSelectionDrawerStatus: boolean;
|
|
120
124
|
isGlobalUnsubscribeDisabled: boolean;
|
|
121
125
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
126
|
+
pendingBlockId: string | null;
|
|
122
127
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => (id: number) => string;
|
|
123
128
|
getSelectedUnsubscribePagesByCollection: (state: {
|
|
124
129
|
templates: {
|
|
@@ -143,6 +148,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
143
148
|
typeSelectionDrawerStatus: boolean;
|
|
144
149
|
isGlobalUnsubscribeDisabled: boolean;
|
|
145
150
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
151
|
+
pendingBlockId: string | null;
|
|
146
152
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => (collectionType: number) => number[];
|
|
147
153
|
isActiveTypeFirstInCollection: (state: {
|
|
148
154
|
templates: {
|
|
@@ -167,6 +173,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
167
173
|
typeSelectionDrawerStatus: boolean;
|
|
168
174
|
isGlobalUnsubscribeDisabled: boolean;
|
|
169
175
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
176
|
+
pendingBlockId: string | null;
|
|
170
177
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
171
178
|
isActiveTypeLastInCollection: (state: {
|
|
172
179
|
templates: {
|
|
@@ -191,6 +198,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
191
198
|
typeSelectionDrawerStatus: boolean;
|
|
192
199
|
isGlobalUnsubscribeDisabled: boolean;
|
|
193
200
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
201
|
+
pendingBlockId: string | null;
|
|
194
202
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
195
203
|
hasTemplatesByCollectionType: (state: {
|
|
196
204
|
templates: {
|
|
@@ -215,6 +223,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
215
223
|
typeSelectionDrawerStatus: boolean;
|
|
216
224
|
isGlobalUnsubscribeDisabled: boolean;
|
|
217
225
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
226
|
+
pendingBlockId: string | null;
|
|
218
227
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => Record<number, boolean>;
|
|
219
228
|
unsubscribePagesStatus: (state: {
|
|
220
229
|
templates: {
|
|
@@ -239,10 +248,11 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
239
248
|
typeSelectionDrawerStatus: boolean;
|
|
240
249
|
isGlobalUnsubscribeDisabled: boolean;
|
|
241
250
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
251
|
+
pendingBlockId: string | null;
|
|
242
252
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
243
253
|
}, {
|
|
244
254
|
$reset(): void;
|
|
245
|
-
fetchTemplates(): Promise<void>;
|
|
255
|
+
fetchTemplates(force?: boolean): Promise<void>;
|
|
246
256
|
setCollection(collectionType: number): void;
|
|
247
257
|
setCollectionWithoutAutoSelection(collectionType: number): void;
|
|
248
258
|
setSelectedTemplate(template: number): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TYPE_COLLECTIONS as i, PAGE_TYPES as p } from "../enums/unsubscribe.js";
|
|
2
2
|
import { useUnsubscribeApi as d } from "../services/unsubscribeApi.js";
|
|
3
|
-
import { defineStore as
|
|
3
|
+
import { defineStore as u } from "pinia";
|
|
4
4
|
let o = null;
|
|
5
5
|
const r = () => ({
|
|
6
6
|
templates: [],
|
|
@@ -12,8 +12,9 @@ const r = () => ({
|
|
|
12
12
|
pageSelectionDrawerStatus: !1,
|
|
13
13
|
typeSelectionDrawerStatus: !1,
|
|
14
14
|
isGlobalUnsubscribeDisabled: !1,
|
|
15
|
-
isSubscriptionPreferencesCenterDisabled: !1
|
|
16
|
-
|
|
15
|
+
isSubscriptionPreferencesCenterDisabled: !1,
|
|
16
|
+
pendingBlockId: null
|
|
17
|
+
}), b = u("guidoUnsubscribe", {
|
|
17
18
|
state: () => r(),
|
|
18
19
|
getters: {
|
|
19
20
|
getSelectedCollection: (e) => i[e.selectedCollectionType],
|
|
@@ -62,10 +63,10 @@ const r = () => ({
|
|
|
62
63
|
selectedUnsubscribePages: t
|
|
63
64
|
});
|
|
64
65
|
},
|
|
65
|
-
async fetchTemplates() {
|
|
66
|
-
this.templates.length || (
|
|
67
|
-
const { getUnsubscribePages:
|
|
68
|
-
this.templates = await
|
|
66
|
+
async fetchTemplates(e = !1) {
|
|
67
|
+
!e && this.templates.length || ((e || !o) && (o = (async () => {
|
|
68
|
+
const { getUnsubscribePages: t } = d();
|
|
69
|
+
this.templates = await t();
|
|
69
70
|
})().finally(() => {
|
|
70
71
|
o = null;
|
|
71
72
|
})), await o);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.7.2-beta.
|
|
3
|
+
"version": "3.7.2-beta.a787136",
|
|
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",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CSS_CLASS_SKIP_COMPILE as n, BLOCK_ROOT_SELECTOR as i } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
2
|
-
function m(o) {
|
|
3
|
-
return o.classList.contains(n);
|
|
4
|
-
}
|
|
5
|
-
function a(o) {
|
|
6
|
-
const r = new DOMParser().parseFromString(o, "text/html").querySelectorAll(`${i}.${n}`), t = /* @__PURE__ */ new Set();
|
|
7
|
-
return r.forEach((c) => {
|
|
8
|
-
const e = c.getAttribute("recommendation-id");
|
|
9
|
-
e && t.add(e);
|
|
10
|
-
}), t;
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
a as getIgnoredRecommendationBlockIds,
|
|
14
|
-
m as isIgnoredRecommendationBlock
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns true when a recommendation block has opted out of Guido's
|
|
3
|
-
* product-data → template-variable substitution. Partners signal opt-out by
|
|
4
|
-
* adding the `ins-skip-compile` class on the `.recommendation-block-v2`
|
|
5
|
-
* element. Only the variable substitution is skipped — campaign URL building,
|
|
6
|
-
* hidden-row removal, Outlook image widths, discount conditions, text-trim CSS
|
|
7
|
-
* and general HTML optimizations still apply. See `CSS_CLASS_SKIP_COMPILE` for
|
|
8
|
-
* the full scope.
|
|
9
|
-
*/
|
|
10
|
-
export declare function isIgnoredRecommendationBlock(block: Element): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* DOM-parses the HTML once and returns the set of `recommendation-id`
|
|
13
|
-
* values that belong to ignored blocks. Use this in regex/string-based
|
|
14
|
-
* compiler rules where the rule processes flat matches and only has the
|
|
15
|
-
* extracted block ID rather than a DOM Element reference.
|
|
16
|
-
*/
|
|
17
|
-
export declare function getIgnoredRecommendationBlockIds(html: string): Set<string>;
|