@useinsider/guido 3.20.1 → 3.21.0
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/useAutoSave.js +46 -44
- package/dist/composables/useLegacyStrategyConversion.js +16 -16
- 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 +4 -3
- package/dist/extensions/Blocks/Items/block.js +43 -42
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +296 -223
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +221 -203
- package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +19 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +51 -36
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +31 -35
- 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/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/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/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/index.d.ts +18 -3
- 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/title/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +9 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +17 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +7 -0
- 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/setup-settings.d.ts +4 -0
- package/dist/static/styles/components/button.css.js +5 -0
- package/dist/stores/setup-settings.js +10 -0
- package/package.json +4 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useRecommendationExtensionStore as u } from "../store/recommendation.js";
|
|
2
|
+
import { commitBlockChangeOutsidePanel as d } from "./nodeConfigWriter.js";
|
|
3
|
+
async function l(e, { pickUpdates: n, description: i, fetch: s = !0 }) {
|
|
4
|
+
const t = u(), r = t.blockStates[e];
|
|
5
|
+
if (!r)
|
|
6
|
+
return !1;
|
|
7
|
+
const { configVersion: c, adoptedSizeVersion: a } = r, f = n(r.recommendationConfigs);
|
|
8
|
+
if (s)
|
|
9
|
+
try {
|
|
10
|
+
await t.fetchRecommendationProductsForBlock(e);
|
|
11
|
+
} catch (m) {
|
|
12
|
+
console.error("[recommendation] product refetch outside the panel failed", m);
|
|
13
|
+
}
|
|
14
|
+
const o = t.blockStates[e];
|
|
15
|
+
return o ? o.configVersion !== c || o.adoptedSizeVersion !== a ? l(e, { pickUpdates: n, description: i }) : d(e, f, o.recommendationProducts, i) : !1;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
l as refreshBlockOutsidePanel
|
|
19
|
+
};
|
|
@@ -1,53 +1,68 @@
|
|
|
1
|
-
import { ModificationDescription as
|
|
2
|
-
import { RECOMMENDATION_ID_ATTR as
|
|
3
|
-
import { isPartnerManagedBlock as
|
|
4
|
-
import { RecommendationConfigService as
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
6
|
-
let
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { ModificationDescription as g } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { RECOMMENDATION_ID_ATTR as l } from "../constants/selectors.js";
|
|
3
|
+
import { isPartnerManagedBlock as m, updateProductContentInPlace as d, regenerateProductRowsWithStyles as C } from "../controls/main/utils.js";
|
|
4
|
+
import { RecommendationConfigService as c } from "../services/configService.js";
|
|
5
|
+
import { useRecommendationExtensionStore as y } from "../store/recommendation.js";
|
|
6
|
+
let r = null;
|
|
7
|
+
function M(n) {
|
|
8
|
+
r = n;
|
|
9
|
+
}
|
|
10
|
+
function a(n) {
|
|
11
|
+
const e = r == null ? void 0 : r.getDocumentRootHtmlNode();
|
|
12
|
+
return !e || !("querySelector" in e) ? null : e.querySelector(`[${l}="${n}"]`) ?? null;
|
|
13
|
+
}
|
|
14
|
+
function N(n, e) {
|
|
15
|
+
const o = c.getConfig(n);
|
|
16
|
+
return Object.keys(e).some((t) => JSON.stringify(o[t]) !== JSON.stringify(e[t]));
|
|
17
|
+
}
|
|
18
|
+
function S(n, e) {
|
|
19
|
+
const o = c.getConfig(n);
|
|
20
|
+
return ["filters", "strategy", "strategyId", "size"].some((t) => t in e && JSON.stringify(o[t]) !== JSON.stringify(e[t]));
|
|
21
|
+
}
|
|
22
|
+
function P(n, e, o) {
|
|
23
|
+
const t = a(n);
|
|
24
|
+
return !r || !t ? !1 : (S(t, e) && c.updateConfig(r, t, e, o), !0);
|
|
25
|
+
}
|
|
26
|
+
function p(n, e) {
|
|
27
|
+
const o = y(), t = o.currentRecommendationId;
|
|
28
|
+
if (t === n || !o.blockStates[n]) {
|
|
29
|
+
e();
|
|
14
30
|
return;
|
|
15
31
|
}
|
|
16
|
-
o.setCurrentBlock(
|
|
32
|
+
o.setCurrentBlock(n);
|
|
17
33
|
try {
|
|
18
|
-
|
|
34
|
+
e();
|
|
19
35
|
} finally {
|
|
20
|
-
o.$patch({ currentRecommendationId:
|
|
36
|
+
o.$patch({ currentRecommendationId: t });
|
|
21
37
|
}
|
|
22
38
|
}
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
return !
|
|
39
|
+
function I(n) {
|
|
40
|
+
const e = r == null ? void 0 : r.getDocumentRootHtmlNode();
|
|
41
|
+
return !e || !("querySelectorAll" in e) ? [] : e.querySelectorAll(`[${l}="${n}"]`).map((o) => c.getConfig(o));
|
|
26
42
|
}
|
|
27
|
-
function $(
|
|
28
|
-
const
|
|
29
|
-
if (!
|
|
30
|
-
return !1;
|
|
31
|
-
const r = f.querySelector(`[${a}="${e}"]`);
|
|
32
|
-
if (!r)
|
|
43
|
+
function $(n, e, o, t) {
|
|
44
|
+
const i = a(n);
|
|
45
|
+
if (!r || !i)
|
|
33
46
|
return !1;
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
return
|
|
47
|
+
const f = r.getDocumentModifier(), s = N(i, e);
|
|
48
|
+
if (c.stageConfig(f, i, e), m(i))
|
|
49
|
+
return s && f.apply(new g(t)), !0;
|
|
37
50
|
let u = !1;
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
currentNode:
|
|
41
|
-
documentModifier:
|
|
51
|
+
return p(n, () => {
|
|
52
|
+
d({
|
|
53
|
+
currentNode: i,
|
|
54
|
+
documentModifier: f,
|
|
42
55
|
products: o,
|
|
43
56
|
onApplied: () => {
|
|
44
57
|
u = !0;
|
|
45
58
|
}
|
|
46
|
-
}) || (u =
|
|
47
|
-
}), !u &&
|
|
59
|
+
}) || (u = C({ currentNode: i, documentModifier: f, products: o }));
|
|
60
|
+
}), !u && s && f.apply(new g(t)), !0;
|
|
48
61
|
}
|
|
49
62
|
export {
|
|
50
63
|
$ as commitBlockChangeOutsidePanel,
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
S as hasEditedConfigChange,
|
|
65
|
+
I as readBlockNodeConfigs,
|
|
66
|
+
M as registerNodeConfigWriter,
|
|
67
|
+
P as writeBlockConfigOutsidePanel
|
|
53
68
|
};
|
|
@@ -1,47 +1,43 @@
|
|
|
1
1
|
import { useRecommendationExtensionStore as g } from "../store/recommendation.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { refreshBlockOutsidePanel as y } from "./blockRefresh.js";
|
|
3
|
+
import { toBlockUrlConfig as a } from "./blockUrlConfig.js";
|
|
4
|
+
import { commitBlockChangeOutsidePanel as l, readBlockNodeConfigs as S } from "./nodeConfigWriter.js";
|
|
5
|
+
function d(e, t) {
|
|
6
|
+
const r = JSON.stringify(a(t));
|
|
7
|
+
return S(e).find((o) => JSON.stringify(a(o)) !== r) ?? t;
|
|
7
8
|
}
|
|
8
|
-
async function
|
|
9
|
-
const
|
|
10
|
-
(/* @__PURE__ */ new Map([[
|
|
11
|
-
var
|
|
12
|
-
(!!n.strategyId ||
|
|
13
|
-
}),
|
|
14
|
-
if (!await
|
|
9
|
+
async function p(e, t, r) {
|
|
10
|
+
const o = g(), s = [e, t];
|
|
11
|
+
(/* @__PURE__ */ new Map([[e, d(e, r)], [t, r]])).forEach((n, i) => {
|
|
12
|
+
var m;
|
|
13
|
+
(!!n.strategyId || i === t) && ((m = o.blockStates[i]) == null ? void 0 : m.recommendationConfigs.strategyId) !== n.strategyId && o.seedBlockUrlConfig(i, a(n));
|
|
14
|
+
}), o.resetArrivedBlock(t), await Promise.all(s.map(async (n) => {
|
|
15
|
+
if (!await o.refreshStrategyBlock(n))
|
|
15
16
|
return;
|
|
16
|
-
const { recommendationConfigs:
|
|
17
|
-
|
|
17
|
+
const { recommendationConfigs: i, recommendationProducts: f } = o.blockStates[n];
|
|
18
|
+
l(
|
|
18
19
|
n,
|
|
19
|
-
{ size:
|
|
20
|
-
|
|
20
|
+
{ size: i.size },
|
|
21
|
+
f,
|
|
21
22
|
"Refresh duplicated recommendation strategy"
|
|
22
23
|
);
|
|
23
24
|
}));
|
|
24
25
|
}
|
|
25
|
-
async function
|
|
26
|
-
|
|
27
|
-
if (!e)
|
|
26
|
+
async function k(e, t) {
|
|
27
|
+
if (!g().blockStates[e])
|
|
28
28
|
return !1;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
e.recommendationProducts,
|
|
40
|
-
o
|
|
41
|
-
);
|
|
42
|
-
return i || console.error("[recommendation] strategy change did not reach a node", { blockId: t }), i;
|
|
29
|
+
const r = await y(e, {
|
|
30
|
+
pickUpdates: ({ strategyId: o, strategy: s, size: c, nodeConfigVersion: n }) => ({
|
|
31
|
+
strategyId: o,
|
|
32
|
+
strategy: s,
|
|
33
|
+
size: c,
|
|
34
|
+
configVersion: n
|
|
35
|
+
}),
|
|
36
|
+
description: t
|
|
37
|
+
});
|
|
38
|
+
return r || console.error("[recommendation] strategy change did not reach a node", { blockId: e }), r;
|
|
43
39
|
}
|
|
44
40
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
k as commitStrategyChange,
|
|
42
|
+
p as refreshDuplicatedStrategyBlocks
|
|
47
43
|
};
|
|
@@ -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}
|