@useinsider/guido 3.20.2-beta.87fb8ae → 3.21.0-beta.0df5409
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +65 -64
- package/dist/components/organisms/AutoSaveController.vue2.js +10 -9
- package/dist/components/organisms/header/EditorActions.vue.js +4 -4
- package/dist/components/organisms/header/EditorActions.vue2.js +53 -51
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +23 -22
- package/dist/composables/useActionsApi.js +80 -63
- package/dist/composables/useAutoSave.js +46 -44
- package/dist/composables/useGuidoStateBridge.js +3 -3
- package/dist/composables/useSave.js +26 -23
- package/dist/composables/useSaveValidation.js +113 -114
- package/dist/composables/useSaveValidationRollout.js +17 -6
- package/dist/composables/useStripo.js +11 -10
- package/dist/extensions/Blocks/Items/block.js +43 -42
- package/dist/extensions/Blocks/Recommendation/block.js +33 -29
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +78 -83
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +1 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +2 -12
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +104 -86
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +222 -210
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +48 -50
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +16 -21
- package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +44 -40
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +14 -19
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +104 -102
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +18 -23
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +312 -286
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +24 -20
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +6 -7
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +8 -8
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +113 -151
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +9 -5
- package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +20 -11
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/currencySettings.js +25 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +106 -50
- package/dist/extensions/Blocks/Unsubscribe/block.js +70 -75
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +271 -192
- package/dist/package.json.js +1 -1
- package/dist/services/settingsApi.js +11 -0
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useActionsApi.d.ts +5 -1
- package/dist/src/composables/useAutoSave.d.ts +4 -1
- package/dist/src/composables/useSaveValidationRollout.d.ts +1 -0
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -6
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +5 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -11
- package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +6 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +6 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +21 -9
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +19 -13
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +10 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +9 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/currencySettings.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +13 -13
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +1 -6
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
- package/dist/src/services/settingsApi.d.ts +6 -0
- package/dist/src/stores/editor.d.ts +3 -1
- package/dist/src/stores/setup-settings.d.ts +4 -0
- package/dist/static/styles/components/button.css.js +5 -0
- package/dist/stores/editor.js +5 -0
- package/dist/stores/setup-settings.js +10 -0
- package/package.json +4 -4
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function o(a) {
|
|
2
|
+
return {
|
|
3
|
+
name: a.code,
|
|
4
|
+
value: a.code,
|
|
5
|
+
symbol: a.symbol,
|
|
6
|
+
alignment: a.alignment === "before" ? "0" : "1",
|
|
7
|
+
decimalCount: a.decimalCount.toString(),
|
|
8
|
+
decimalSeparator: a.decimalSeparator,
|
|
9
|
+
thousandSeparator: a.thousandSeparator
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function e(a) {
|
|
13
|
+
return {
|
|
14
|
+
code: a.value,
|
|
15
|
+
symbol: a.symbol,
|
|
16
|
+
alignment: a.alignment === "0" ? "before" : "after",
|
|
17
|
+
decimalCount: Number(a.decimalCount),
|
|
18
|
+
decimalSeparator: a.decimalSeparator,
|
|
19
|
+
thousandSeparator: a.thousandSeparator
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
e as toCurrencyConfig,
|
|
24
|
+
o as toCurrencySettings
|
|
25
|
+
};
|
|
@@ -1,68 +1,124 @@
|
|
|
1
1
|
import { ModificationDescription as g } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { RECOMMENDATION_ID_ATTR as
|
|
3
|
-
import { isPartnerManagedBlock as
|
|
4
|
-
import { RecommendationConfigService as
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { RECOMMENDATION_ID_ATTR as m } from "../constants/selectors.js";
|
|
3
|
+
import { setCurrencyAttributes as h, isPartnerManagedBlock as p, updateProductContentInPlace as O, regenerateProductRowsWithStyles as N } from "../controls/main/utils.js";
|
|
4
|
+
import { RecommendationConfigService as u } from "../services/configService.js";
|
|
5
|
+
import { useRecommendationExtensionStore as S } from "../store/recommendation.js";
|
|
6
|
+
const D = "Update recommendation filters", E = [
|
|
7
|
+
["strategyId", () => "Updated recommendation strategy"],
|
|
8
|
+
["strategy", (e) => `Changed algorithm to ${e.strategy}`],
|
|
9
|
+
["productIds", () => "Updated product IDs"],
|
|
10
|
+
["size", (e) => `Changed product count to ${e.size}`],
|
|
11
|
+
["language", (e) => `Changed language to ${e.language}`],
|
|
12
|
+
["shuffleProducts", (e) => `${e.shuffleProducts ? "Enabled" : "Disabled"} product shuffle`],
|
|
13
|
+
["currency", (e) => {
|
|
14
|
+
var n;
|
|
15
|
+
return `Changed currency to ${(n = e.currency) == null ? void 0 : n.code}`;
|
|
16
|
+
}],
|
|
17
|
+
["filters", () => D]
|
|
18
|
+
];
|
|
19
|
+
let i = null;
|
|
20
|
+
const a = /* @__PURE__ */ new Set();
|
|
21
|
+
function _(e) {
|
|
22
|
+
i = e;
|
|
9
23
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
24
|
+
function w(e) {
|
|
25
|
+
return a.add(e), () => {
|
|
26
|
+
a.delete(e);
|
|
27
|
+
};
|
|
13
28
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
return
|
|
29
|
+
function A() {
|
|
30
|
+
let e = 0;
|
|
31
|
+
return [...a].forEach((n) => {
|
|
32
|
+
try {
|
|
33
|
+
n() && (e += 1);
|
|
34
|
+
} catch (t) {
|
|
35
|
+
console.error("[recommendation] pending config flush failed", t);
|
|
36
|
+
}
|
|
37
|
+
}), e;
|
|
17
38
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
return
|
|
39
|
+
function C(e) {
|
|
40
|
+
const n = i == null ? void 0 : i.getDocumentRootHtmlNode();
|
|
41
|
+
return !n || !("querySelector" in n) ? null : n.querySelector(`[${m}="${e}"]`) ?? null;
|
|
21
42
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
return !r || !t ? !1 : (S(t, e) && c.updateConfig(r, t, e, o), !0);
|
|
43
|
+
function d(e) {
|
|
44
|
+
return JSON.stringify(e, (n, t) => t && typeof t == "object" && !Array.isArray(t) ? Object.fromEntries(Object.entries(t).sort(([r], [o]) => r.localeCompare(o))) : t);
|
|
25
45
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
function l(e, n, t) {
|
|
47
|
+
return t in n && d(e[t]) !== d(n[t]);
|
|
48
|
+
}
|
|
49
|
+
function I(e, n) {
|
|
50
|
+
const t = u.getConfig(e);
|
|
51
|
+
return Object.keys(n).some((r) => l(t, n, r));
|
|
52
|
+
}
|
|
53
|
+
function P(e, n) {
|
|
54
|
+
const t = E.find(([r]) => l(e, n, r));
|
|
55
|
+
return t ? t[1](n) : null;
|
|
56
|
+
}
|
|
57
|
+
function y(e, n, t) {
|
|
58
|
+
u.stageConfig(e, n, t), t.currency && l(u.getConfig(n), t, "currency") && h({ currentNode: n, documentModifier: e, currency: t.currency, stageOnly: !0 });
|
|
59
|
+
}
|
|
60
|
+
function k(e, n, t) {
|
|
61
|
+
const r = C(e);
|
|
62
|
+
if (!i || !r)
|
|
63
|
+
return "missing";
|
|
64
|
+
const o = P(u.getConfig(r), n);
|
|
65
|
+
if (o === null)
|
|
66
|
+
return "unchanged";
|
|
67
|
+
const c = i.getDocumentModifier();
|
|
68
|
+
return y(c, r, n), c.apply(new g(t ?? o)), "applied";
|
|
69
|
+
}
|
|
70
|
+
function R(e, n) {
|
|
71
|
+
const t = S(), r = t.currentRecommendationId;
|
|
72
|
+
if (r === e || !t.blockStates[e]) {
|
|
73
|
+
n();
|
|
30
74
|
return;
|
|
31
75
|
}
|
|
32
|
-
|
|
76
|
+
t.setCurrentBlock(e);
|
|
33
77
|
try {
|
|
34
|
-
|
|
78
|
+
n();
|
|
35
79
|
} finally {
|
|
36
|
-
|
|
80
|
+
t.$patch({ currentRecommendationId: r });
|
|
37
81
|
}
|
|
38
82
|
}
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
return !
|
|
83
|
+
function F(e) {
|
|
84
|
+
const n = i == null ? void 0 : i.getDocumentRootHtmlNode();
|
|
85
|
+
return !n || !("querySelectorAll" in n) ? [] : n.querySelectorAll(`[${m}="${e}"]`).map((t) => u.getConfig(t));
|
|
42
86
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
if (!
|
|
87
|
+
function j(e, n, t, r) {
|
|
88
|
+
const o = C(e);
|
|
89
|
+
if (!i || !o)
|
|
46
90
|
return !1;
|
|
47
|
-
const
|
|
48
|
-
if (c
|
|
49
|
-
return s &&
|
|
50
|
-
let
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
currentNode:
|
|
54
|
-
documentModifier:
|
|
55
|
-
products:
|
|
56
|
-
|
|
57
|
-
|
|
91
|
+
const c = i.getDocumentModifier(), s = I(o, n);
|
|
92
|
+
if (y(c, o, n), p(o))
|
|
93
|
+
return s && c.apply(new g(r)), !0;
|
|
94
|
+
let f = !1;
|
|
95
|
+
return R(e, () => {
|
|
96
|
+
O({
|
|
97
|
+
currentNode: o,
|
|
98
|
+
documentModifier: c,
|
|
99
|
+
products: t,
|
|
100
|
+
stageOnly: !0,
|
|
101
|
+
configOverrides: n,
|
|
102
|
+
onChanged: () => {
|
|
103
|
+
f = !0;
|
|
58
104
|
}
|
|
59
|
-
}) || (
|
|
60
|
-
|
|
105
|
+
}) || (f = N({
|
|
106
|
+
currentNode: o,
|
|
107
|
+
documentModifier: c,
|
|
108
|
+
products: t,
|
|
109
|
+
stageOnly: !0,
|
|
110
|
+
configOverrides: n
|
|
111
|
+
}));
|
|
112
|
+
}), (s || f) && c.apply(new g(r)), !0;
|
|
61
113
|
}
|
|
62
114
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
115
|
+
D as UPDATE_FILTERS_DESCRIPTION,
|
|
116
|
+
j as commitBlockChangeOutsidePanel,
|
|
117
|
+
P as describeConfigChange,
|
|
118
|
+
A as flushPendingNodeConfigWrites,
|
|
119
|
+
F as readBlockNodeConfigs,
|
|
120
|
+
_ as registerNodeConfigWriter,
|
|
121
|
+
w as registerPendingConfigFlush,
|
|
122
|
+
y as stageConfigChange,
|
|
123
|
+
k as writeBlockConfigOutsidePanel
|
|
68
124
|
};
|
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var I = (c, o, e) => o in c ? y(c, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[o] = e;
|
|
3
|
+
var g = (c, o, e) => I(c, typeof o != "symbol" ? o + "" : o, e);
|
|
4
4
|
import { useToaster as L } from "../../../composables/useToaster.js";
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import { PAGE_TYPES as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
import { useUnsubscribeStore as
|
|
9
|
-
import { Block as
|
|
10
|
-
import { getDefaultTemplate as
|
|
11
|
-
import { UNSUBSCRIBE_BLOCK_SELECTOR as
|
|
12
|
-
import { parsePageList as
|
|
13
|
-
const
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
},
|
|
17
|
-
|
|
5
|
+
import { ToasterTypeOptions as C } from "../../../enums/toaster.js";
|
|
6
|
+
import { PAGE_TYPES as m } from "../../../enums/unsubscribe.js";
|
|
7
|
+
import { useEditorStore as N } from "../../../stores/editor.js";
|
|
8
|
+
import { useUnsubscribeStore as a } from "../../../stores/unsubscribe.js";
|
|
9
|
+
import { Block as U, BlockCompositionType as R, ContextActionType as f, ModificationDescription as u, BlockType as v } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
10
|
+
import { getDefaultTemplate as D } from "./template.js";
|
|
11
|
+
import { UNSUBSCRIBE_BLOCK_SELECTOR as B, DATA_ATTRIBUTES as n, UNSUBSCRIBE_EVENTS as h } from "./utils/constants.js";
|
|
12
|
+
import { parsePageList as S } from "./utils/utils.js";
|
|
13
|
+
const w = "unsubscribe-block", E = 'a[data-unsubscribe-link="true"]', P = "{{ins-unsubscribe-link}}", x = "https://academy.insiderone.com/docs/adding-unsubscribe-pages-into-emails", G = "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.", M = {
|
|
14
|
+
[m.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
15
|
+
[m.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
16
|
+
}, O = 3;
|
|
17
|
+
let d = null, p = null;
|
|
18
|
+
const A = () => {
|
|
19
|
+
d && (document.removeEventListener(h.SELECT, d), d = null);
|
|
20
|
+
}, T = () => {
|
|
21
|
+
p && (document.removeEventListener(h.CANCEL, p), p = null);
|
|
22
|
+
}, q = () => {
|
|
23
|
+
A(), T();
|
|
24
|
+
};
|
|
25
|
+
class J extends U {
|
|
18
26
|
constructor() {
|
|
19
27
|
super();
|
|
20
|
-
|
|
21
|
-
a(this, "cancelEventListener", null);
|
|
22
|
-
a(this, "currentNode");
|
|
28
|
+
g(this, "currentNode");
|
|
23
29
|
// Per-block "did this instance have a link last time we saw it?" tracking.
|
|
24
30
|
// Keyed by the stable `data-unsubscribe-block-id` we assign, because
|
|
25
31
|
// ImmutableHtmlNode instances are recreated on every document mutation and
|
|
26
32
|
// can't be used as Map keys directly. A singleton boolean here would be
|
|
27
33
|
// polluted across blocks since Stripo fires onDocumentChanged per-instance.
|
|
28
|
-
|
|
34
|
+
g(this, "linkStateByBlockId", /* @__PURE__ */ new Map());
|
|
29
35
|
// Per-block prepend retry counter for the leading text guard (SD-143097).
|
|
30
|
-
|
|
36
|
+
g(this, "guardAttemptsByBlockId", /* @__PURE__ */ new Map());
|
|
31
37
|
}
|
|
32
38
|
getId() {
|
|
33
|
-
return
|
|
39
|
+
return w;
|
|
34
40
|
}
|
|
35
41
|
getIcon() {
|
|
36
42
|
return "unsubscribe-icon";
|
|
37
43
|
}
|
|
38
44
|
getBlockCompositionType() {
|
|
39
|
-
return
|
|
45
|
+
return R.BLOCK;
|
|
40
46
|
}
|
|
41
47
|
getName() {
|
|
42
48
|
return this.api.translate("Unsubscribe Block");
|
|
@@ -45,16 +51,16 @@ class W extends T {
|
|
|
45
51
|
return this.api.translate("Unsubscribe Block Description");
|
|
46
52
|
}
|
|
47
53
|
getTemplate() {
|
|
48
|
-
return
|
|
54
|
+
return D();
|
|
49
55
|
}
|
|
50
56
|
getContextActionsIds() {
|
|
51
|
-
return [
|
|
57
|
+
return [f.MOVE, f.REMOVE];
|
|
52
58
|
}
|
|
53
59
|
onSelect(e) {
|
|
54
|
-
if (this.currentNode = e,
|
|
60
|
+
if (this.currentNode = e, N().isPreviewModeOpen)
|
|
55
61
|
return;
|
|
56
62
|
const t = this._getOrAssignBlockId(e);
|
|
57
|
-
t && this.linkStateByBlockId.set(t, this._hasUnsubscribeLink(e)), this._setupSelectEventListener(), this._setupCancelEventListener(t), !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), t && (
|
|
63
|
+
t && this.linkStateByBlockId.set(t, this._hasUnsubscribeLink(e)), this._setupSelectEventListener(), this._setupCancelEventListener(t), !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), t && (a().pendingBlockId = t), this._loadBlockState(e), this._checkExistingBlocks(), this._openDrawer());
|
|
58
64
|
}
|
|
59
65
|
onCreated(e) {
|
|
60
66
|
this._ensureLeadingTextGuard(e);
|
|
@@ -62,7 +68,7 @@ class W extends T {
|
|
|
62
68
|
onDocumentInit() {
|
|
63
69
|
try {
|
|
64
70
|
const e = this.api.getDocumentRoot();
|
|
65
|
-
e && "querySelectorAll" in e && e.querySelectorAll(
|
|
71
|
+
e && "querySelectorAll" in e && e.querySelectorAll(B).forEach((t) => {
|
|
66
72
|
this._ensureLeadingTextGuard(t);
|
|
67
73
|
});
|
|
68
74
|
} catch {
|
|
@@ -77,13 +83,10 @@ class W extends T {
|
|
|
77
83
|
this.linkStateByBlockId.get(t) === !0 && !s && this._warnLinkRemoved(), this.linkStateByBlockId.set(t, s);
|
|
78
84
|
}
|
|
79
85
|
onDelete(e) {
|
|
80
|
-
|
|
86
|
+
q(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
|
|
81
87
|
const t = this._readBlockId(e);
|
|
82
88
|
t && (this.linkStateByBlockId.delete(t), this.guardAttemptsByBlockId.delete(t));
|
|
83
89
|
}
|
|
84
|
-
onDestroy() {
|
|
85
|
-
this._removeEventListeners(), this.currentNode = void 0, this.linkStateByBlockId.clear(), this.guardAttemptsByBlockId.clear();
|
|
86
|
-
}
|
|
87
90
|
/**
|
|
88
91
|
* Guarantees a plain-text node before the link's wrapper inside the <p>.
|
|
89
92
|
* Without it the only caret position left of the link is inside the anchor,
|
|
@@ -102,20 +105,20 @@ class W extends T {
|
|
|
102
105
|
return;
|
|
103
106
|
const i = s.previousSibling();
|
|
104
107
|
if (!!(i && i.getType() === "text" && i.getTextContent())) {
|
|
105
|
-
const
|
|
106
|
-
|
|
108
|
+
const b = this._readBlockId(e);
|
|
109
|
+
b && this.guardAttemptsByBlockId.delete(b);
|
|
107
110
|
return;
|
|
108
111
|
}
|
|
109
|
-
const
|
|
110
|
-
if (!
|
|
112
|
+
const k = this._getOrAssignBlockId(e);
|
|
113
|
+
if (!k)
|
|
111
114
|
return;
|
|
112
|
-
const
|
|
113
|
-
if (!(
|
|
114
|
-
this.guardAttemptsByBlockId.set(
|
|
115
|
+
const _ = this.guardAttemptsByBlockId.get(k) ?? 0;
|
|
116
|
+
if (!(_ >= O)) {
|
|
117
|
+
this.guardAttemptsByBlockId.set(k, _ + 1);
|
|
115
118
|
try {
|
|
116
|
-
this.api.getDocumentModifier().modifyHtml(r).prepend(" ").apply(new
|
|
117
|
-
} catch (
|
|
118
|
-
console.warn("[UnsubscribeBlock] Failed to ensure link text guard:",
|
|
119
|
+
this.api.getDocumentModifier().modifyHtml(r).prepend(" ").apply(new u("Ensure unsubscribe link text guard"));
|
|
120
|
+
} catch (b) {
|
|
121
|
+
console.warn("[UnsubscribeBlock] Failed to ensure link text guard:", b);
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
}
|
|
@@ -139,7 +142,7 @@ class W extends T {
|
|
|
139
142
|
return null;
|
|
140
143
|
const s = this._generateNextBlockId();
|
|
141
144
|
try {
|
|
142
|
-
this.api.getDocumentModifier().modifyHtml(e).setAttribute(n.BLOCK_ID, s).apply(new
|
|
145
|
+
this.api.getDocumentModifier().modifyHtml(e).setAttribute(n.BLOCK_ID, s).apply(new u(`Assign unsubscribe block id ${s}`));
|
|
143
146
|
} catch (r) {
|
|
144
147
|
return console.warn("[UnsubscribeBlock] Failed to assign block id:", r), null;
|
|
145
148
|
}
|
|
@@ -154,10 +157,10 @@ class W extends T {
|
|
|
154
157
|
let e = 0;
|
|
155
158
|
try {
|
|
156
159
|
const t = this.api.getDocumentRoot();
|
|
157
|
-
t && "querySelectorAll" in t && t.querySelectorAll(
|
|
160
|
+
t && "querySelectorAll" in t && t.querySelectorAll(B).forEach((r) => {
|
|
158
161
|
if ("getAttribute" in r) {
|
|
159
|
-
const i = r.getAttribute(n.BLOCK_ID),
|
|
160
|
-
|
|
162
|
+
const i = r.getAttribute(n.BLOCK_ID), l = i ? parseInt(i) : 0;
|
|
163
|
+
l > e && (e = l);
|
|
161
164
|
}
|
|
162
165
|
});
|
|
163
166
|
} catch {
|
|
@@ -168,12 +171,12 @@ class W extends T {
|
|
|
168
171
|
try {
|
|
169
172
|
const { showToaster: e } = L();
|
|
170
173
|
e({
|
|
171
|
-
type:
|
|
172
|
-
message: this.api.translate(
|
|
174
|
+
type: C.Warning,
|
|
175
|
+
message: this.api.translate(G),
|
|
173
176
|
actionButton: {
|
|
174
177
|
text: this.api.translate("Visit Academy"),
|
|
175
178
|
onClick: () => {
|
|
176
|
-
window.open(
|
|
179
|
+
window.open(x, "_blank", "noopener,noreferrer");
|
|
177
180
|
}
|
|
178
181
|
}
|
|
179
182
|
});
|
|
@@ -182,35 +185,26 @@ class W extends T {
|
|
|
182
185
|
}
|
|
183
186
|
}
|
|
184
187
|
_setupSelectEventListener() {
|
|
185
|
-
|
|
188
|
+
A(), d = (e) => {
|
|
186
189
|
const t = e, { collectionType: s, selectedPages: r } = t.detail;
|
|
187
190
|
this._updateBlock(s, r.join(","));
|
|
188
|
-
}, document.addEventListener(
|
|
189
|
-
}
|
|
190
|
-
_removeSelectEventListener() {
|
|
191
|
-
this.selectEventListener && (document.removeEventListener(b.SELECT, this.selectEventListener), this.selectEventListener = null);
|
|
191
|
+
}, document.addEventListener(h.SELECT, d);
|
|
192
192
|
}
|
|
193
193
|
_setupCancelEventListener(e) {
|
|
194
|
-
|
|
194
|
+
T(), p = (t) => {
|
|
195
195
|
const { detail: s } = t;
|
|
196
196
|
((s == null ? void 0 : s.blockId) ?? null) === e && this._handleCancel();
|
|
197
|
-
}, document.addEventListener(
|
|
198
|
-
}
|
|
199
|
-
_removeCancelEventListener() {
|
|
200
|
-
this.cancelEventListener && (document.removeEventListener(b.CANCEL, this.cancelEventListener), this.cancelEventListener = null);
|
|
197
|
+
}, document.addEventListener(h.CANCEL, p);
|
|
201
198
|
}
|
|
202
199
|
_handleCancel() {
|
|
203
200
|
try {
|
|
204
201
|
if (!this.currentNode)
|
|
205
202
|
return;
|
|
206
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${v.EMPTY_CONTAINER}/>`).apply(new
|
|
203
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${v.EMPTY_CONTAINER}/>`).apply(new u("Removed unsubscribe block due to cancel"));
|
|
207
204
|
} catch (e) {
|
|
208
205
|
console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
|
|
209
206
|
}
|
|
210
207
|
}
|
|
211
|
-
_removeEventListeners() {
|
|
212
|
-
this._removeSelectEventListener(), this._removeCancelEventListener();
|
|
213
|
-
}
|
|
214
208
|
_updateBlock(e, t) {
|
|
215
209
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
216
210
|
return;
|
|
@@ -218,28 +212,28 @@ class W extends T {
|
|
|
218
212
|
if (!s)
|
|
219
213
|
return;
|
|
220
214
|
const r = this._getMergeTag(e);
|
|
221
|
-
this.api.getDocumentModifier().modifyHtml(s).setAttribute("href", r).apply(new
|
|
215
|
+
this.api.getDocumentModifier().modifyHtml(s).setAttribute("href", r).apply(new u(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(n.PAGE_TYPE, e.toString()).setAttribute(n.PAGE_LIST, t).apply(new u("Updated unsubscribe block metadata"));
|
|
222
216
|
}
|
|
223
217
|
_getMergeTag(e) {
|
|
224
|
-
return
|
|
218
|
+
return M[e] ?? P;
|
|
225
219
|
}
|
|
226
220
|
_openDrawer() {
|
|
227
221
|
if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
|
|
228
222
|
try {
|
|
229
|
-
const e =
|
|
223
|
+
const e = a();
|
|
230
224
|
e.typeSelectionDrawerStatus = !0;
|
|
231
225
|
} catch (e) {
|
|
232
226
|
console.error("[UnsubscribeBlock] Failed to open drawer:", e);
|
|
233
227
|
}
|
|
234
228
|
}
|
|
235
229
|
_checkExistingBlocks() {
|
|
236
|
-
const e =
|
|
237
|
-
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(
|
|
230
|
+
const e = a();
|
|
231
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(B).forEach((s) => {
|
|
238
232
|
if ("getAttribute" in s) {
|
|
239
233
|
const r = s.getAttribute(n.PAGE_TYPE);
|
|
240
234
|
if (r) {
|
|
241
235
|
const i = Number(r);
|
|
242
|
-
i ===
|
|
236
|
+
i === m.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : i === m.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
243
237
|
}
|
|
244
238
|
}
|
|
245
239
|
});
|
|
@@ -250,11 +244,11 @@ class W extends T {
|
|
|
250
244
|
const t = e.getAttribute(n.PAGE_TYPE), s = e.getAttribute(n.PAGE_LIST);
|
|
251
245
|
if (!t || !s)
|
|
252
246
|
return;
|
|
253
|
-
const r =
|
|
254
|
-
await r.fetchTemplates(), r.setCollectionWithoutAutoSelection(i), r.loadSelectedTemplates(
|
|
247
|
+
const r = a(), i = Number(t), l = S(s);
|
|
248
|
+
await r.fetchTemplates(), r.setCollectionWithoutAutoSelection(i), r.loadSelectedTemplates(l);
|
|
255
249
|
}
|
|
256
250
|
_resetStoreState() {
|
|
257
|
-
|
|
251
|
+
a().$reset();
|
|
258
252
|
}
|
|
259
253
|
_removeBlockTemplatesFromStore(e) {
|
|
260
254
|
if (!("getAttribute" in e))
|
|
@@ -262,11 +256,12 @@ class W extends T {
|
|
|
262
256
|
const t = e.getAttribute(n.PAGE_LIST);
|
|
263
257
|
if (!t)
|
|
264
258
|
return;
|
|
265
|
-
const s =
|
|
259
|
+
const s = a(), r = S(t);
|
|
266
260
|
s.removeUnsubscribePages(r);
|
|
267
261
|
}
|
|
268
262
|
}
|
|
269
263
|
export {
|
|
270
|
-
|
|
271
|
-
|
|
264
|
+
w as UNSUBSCRIBE_BLOCK_ID,
|
|
265
|
+
J as UnsubscribeBlock,
|
|
266
|
+
q as disposeUnsubscribeListeners
|
|
272
267
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .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-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__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-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .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-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__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-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .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-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{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-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|