@useinsider/guido 3.20.1-beta.991508 → 3.20.1-beta.a9397b3
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/README.md +8 -0
- package/dist/@types/config/schemas.js +35 -33
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/Guido.vue2.js +70 -66
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +17 -0
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +35 -0
- package/dist/composables/useLegacyStrategyConversion.js +16 -16
- package/dist/composables/useModuleRepair.js +40 -24
- package/dist/config/migrator/index.js +12 -11
- package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +16 -0
- package/dist/enums/academy.js +2 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +223 -296
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +205 -219
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +36 -51
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +35 -31
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useModuleRepair.d.ts +2 -11
- package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -18
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -8
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +0 -7
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +9 -0
- package/dist/stores/editor.js +16 -15
- package/dist/utils/legacyUnsubscribeConversion.js +86 -0
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +0 -19
- package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +0 -17
|
@@ -1,33 +1,49 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { useConfig as g } from "./useConfig.js";
|
|
2
|
+
import { useToaster as h } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as C } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as v } from "../enums/toaster.js";
|
|
5
|
+
import { useEditorStore as M } from "../stores/editor.js";
|
|
6
|
+
import { buildDynamicContentLookup as T, convertModuleDynamicContent as D } from "../utils/dynamicContentConverter.js";
|
|
7
|
+
import { flattenDynamicContentList as L } from "../utils/genericUtil.js";
|
|
8
|
+
import { repairItemsCurrencyAttributes as O } from "../utils/itemsCurrencyRepair.js";
|
|
9
|
+
import { convertLegacyUnsubscribeInModuleHtml as E } from "../utils/legacyUnsubscribeConversion.js";
|
|
10
|
+
const N = "dynamic-content.unresolved-attributes-on-drop", W = () => {
|
|
11
|
+
const { template: d, isFeatureEnabled: s } = g(), { showToaster: f } = h(), b = C();
|
|
12
|
+
return { handleModuleAdd: (t, o) => {
|
|
13
|
+
var u, i, a;
|
|
14
|
+
let l = !1, c = !1;
|
|
12
15
|
try {
|
|
13
|
-
if ((
|
|
16
|
+
if ((t == null ? void 0 : t.action) !== "ADD" && (t == null ? void 0 : t.action) !== "COPY")
|
|
14
17
|
return;
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
18
|
+
const e = (u = o == null ? void 0 : o.getTargetNode) == null ? void 0 : u.call(o), n = (i = e == null ? void 0 : e.getOuterHTML) == null ? void 0 : i.call(e);
|
|
19
|
+
if (!e || typeof n != "string")
|
|
17
20
|
return;
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} catch (t) {
|
|
26
|
-
console.error("Failed to repair module on add:", t);
|
|
21
|
+
let r = O(n), m = !1;
|
|
22
|
+
s("legacyUnsubscribeConversion") && ({ html: r, converted: m } = E(r));
|
|
23
|
+
const p = T(L((a = d.value) == null ? void 0 : a.dynamicContentList));
|
|
24
|
+
let y = [];
|
|
25
|
+
p.size > 0 && ({ html: r, unresolved: y } = D(r, p, s("liquidSyntax"))), r !== n && o.modifyHtml(e).replaceWith(r), l = m, c = y.length > 0;
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.error("Failed to repair module on add:", e);
|
|
27
28
|
}
|
|
29
|
+
if (l)
|
|
30
|
+
try {
|
|
31
|
+
M().isLegacyUnsubscribeModalRequested = !0;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.error("Failed to request the legacy unsubscribe modal:", e);
|
|
34
|
+
}
|
|
35
|
+
if (c)
|
|
36
|
+
try {
|
|
37
|
+
f({
|
|
38
|
+
type: v.Warning,
|
|
39
|
+
message: b(N)
|
|
40
|
+
});
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.error("Failed to warn about unresolved dynamic content on add:", e);
|
|
43
|
+
}
|
|
28
44
|
} };
|
|
29
45
|
};
|
|
30
46
|
export {
|
|
31
47
|
N as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
|
|
32
|
-
|
|
48
|
+
W as useModuleRepair
|
|
33
49
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { migrateCheckbox as i } from "./checkboxMigrator.js";
|
|
2
2
|
import { migrateCouponBlock as e } from "./couponBlockMigrator.js";
|
|
3
3
|
import { migrateItemsBlock as a } from "./itemsBlockMigrator.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
import { migrateLinklessLegacyUnsubscribe as n } from "./legacyUnsubscribeTextMigrator.js";
|
|
5
|
+
import { migrateProductNameLink as c } from "./productNameLinkMigrator.js";
|
|
6
|
+
import { migrateRadioButton as g } from "./radioButtonMigrator.js";
|
|
7
|
+
import { migrateRecommendation as f } from "./recommendationMigrator.js";
|
|
8
|
+
import { migrateRecommendationPartnerScope as p } from "./recommendationPartnerMigrator.js";
|
|
9
|
+
import { migrateRecommendationTitle as s } from "./recommendationTitleMigrator.js";
|
|
10
|
+
import { migrateSocialIcons as l } from "./socialIconMigrator.js";
|
|
11
|
+
import { migrateUnsubscribe as d } from "./unsubscribeMigrator.js";
|
|
12
|
+
const U = async (o, t = {}, r) => {
|
|
13
|
+
let m = o;
|
|
14
|
+
return m = i(m), m = g(m), m = n(m), m = await d(m), m = e(m), m = f(m, t), r && (m = p(m, r)), m = s(m), m = a(m), m = c(m), m = l(m), m;
|
|
14
15
|
};
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
+
U as migrate
|
|
17
18
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useConfigStore as o } from "../../stores/config.js";
|
|
2
|
+
import { useEditorStore as s } from "../../stores/editor.js";
|
|
3
|
+
import { convertLegacyUnsubscribeInDocumentHtml as i } from "../../utils/legacyUnsubscribeConversion.js";
|
|
4
|
+
const a = (e) => {
|
|
5
|
+
try {
|
|
6
|
+
if (!o().isFeatureEnabled("legacyUnsubscribeConversion"))
|
|
7
|
+
return e;
|
|
8
|
+
const { html: r, converted: t } = i(e);
|
|
9
|
+
return t && (s().isLegacyUnsubscribeModalRequested = !0), r;
|
|
10
|
+
} catch (r) {
|
|
11
|
+
return console.error("LegacyUnsubscribeTextMigrator failed:", r), e;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
a as migrateLinklessLegacyUnsubscribe
|
|
16
|
+
};
|
package/dist/enums/academy.js
CHANGED
|
@@ -2,7 +2,8 @@ const e = "https://academy.insiderone.com", o = {
|
|
|
2
2
|
EMAIL_EDITOR: `${e}/docs/email-drag-and-drop-editor`,
|
|
3
3
|
GLOBAL_UNSUBSCRIBE: `${e}/docs/global-unsubscribe-preference-center`,
|
|
4
4
|
AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`,
|
|
5
|
-
EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block
|
|
5
|
+
EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block`,
|
|
6
|
+
LEGACY_UNSUBSCRIBE_MODULE: `${e}/docs/new-editor-add-unsubscribe-pages-into-emails`
|
|
6
7
|
};
|
|
7
8
|
export {
|
|
8
9
|
o as ACADEMY_LINKS
|