@useinsider/guido 2.0.0-beta.254566 → 2.0.0-beta.25fe7cd
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/PreviewContainer.vue.js +3 -3
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +8 -8
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +7 -8
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +10 -14
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +18 -22
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -10
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
- package/dist/components/organisms/header/HeaderWrapper.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue.js +11 -11
- package/dist/components/organisms/header/LeftSlot.vue2.js +11 -12
- package/dist/components/organisms/header/MiddleSlot.vue.js +5 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -13
- package/dist/components/organisms/header/RightSlot.vue.js +12 -12
- package/dist/components/organisms/header/RightSlot.vue2.js +26 -20
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
- package/dist/enums/academy.js +8 -0
- package/dist/enums/onboarding.js +1 -2
- package/dist/enums/unsubscribe.js +20 -21
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +4 -13
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +69 -153
- package/dist/extensions/Blocks/Recommendation/constants.js +1 -9
- package/dist/extensions/Blocks/Recommendation/control.js +61 -91
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +42 -16
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +72 -117
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +64 -85
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +17 -54
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +45 -74
- package/dist/extensions/Blocks/common-control.js +6 -7
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +290 -363
- package/dist/package.json.js +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/enums/academy.d.ts +12 -0
- package/dist/src/enums/onboarding.d.ts +0 -1
- package/dist/src/enums/unsubscribe.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +3 -50
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -32
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +2 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +7 -15
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
- package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
- package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
- package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
- package/dist/static/styles/components/wide-panel.css.js +4 -0
- package/dist/static/styles/customEditorStyle.css.js +0 -13
- package/package.json +3 -3
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
- package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
- package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -245
- package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.js +0 -71
- package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +0 -25
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +0 -25
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -592
- package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +0 -60
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -19
- package/dist/static/assets/inbox-mockup.svg.js +0 -4
- package/dist/static/assets/phone-mockup.svg.js +0 -4
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
return e("div", { staticClass: "d-f" }, [
|
|
1
|
+
import l from "./RightSlot.vue2.js";
|
|
2
|
+
import r from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var d = function() {
|
|
4
|
+
var s, i, n, a;
|
|
5
|
+
var o = this, e = o._self._c, t = o._self._setupProxy;
|
|
6
|
+
return e("div", { staticClass: "d-f" }, [t.editorStore.isVersionHistoryOpen ? e(t.RestoreButton) : [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.testEmailClick } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(_) {
|
|
7
7
|
return t.handleSave(!1);
|
|
8
|
-
} } })],
|
|
9
|
-
},
|
|
8
|
+
} } })]], 2);
|
|
9
|
+
}, u = [], p = /* @__PURE__ */ r(
|
|
10
|
+
l,
|
|
11
|
+
d,
|
|
10
12
|
u,
|
|
11
|
-
p,
|
|
12
|
-
c,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
15
|
null
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const f = p.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
f as default
|
|
20
20
|
};
|
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as _, ref as c, computed as f } from "vue";
|
|
2
2
|
import { useConfig as h } from "../../../composables/useConfig.js";
|
|
3
|
-
import { useExport as
|
|
3
|
+
import { useExport as w } from "../../../composables/useExport.js";
|
|
4
4
|
import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
|
|
5
5
|
import { useSave as E } from "../../../composables/useSave.js";
|
|
6
6
|
import { useTranslations as T } from "../../../composables/useTranslations.js";
|
|
7
|
-
import { useVersionHistoryApi as
|
|
7
|
+
import { useVersionHistoryApi as O } from "../../../composables/useVersionHistoryApi.js";
|
|
8
8
|
import { useEditorStore as C } from "../../../stores/editor.js";
|
|
9
|
-
import { getTooltipOptions as
|
|
10
|
-
import { InButtonV2 as
|
|
11
|
-
|
|
9
|
+
import { getTooltipOptions as A } from "../../../utils/tooltipUtils.js";
|
|
10
|
+
import { InButtonV2 as B } from "@useinsider/design-system-vue";
|
|
11
|
+
import k from "./version-history/RestoreButton.vue.js";
|
|
12
|
+
const K = /* @__PURE__ */ _({
|
|
12
13
|
__name: "RightSlot",
|
|
13
|
-
setup(
|
|
14
|
-
const { config:
|
|
14
|
+
setup(R, { expose: v }) {
|
|
15
|
+
const { config: n } = h(), { exportHtml: a } = w(), { save: l } = E(), { openVersionHistory: p, closeVersionHistory: m } = O(), o = C(), s = T(), r = c(!1), i = c(!1), d = x(), y = () => {
|
|
15
16
|
if (o.isVersionHistoryOpen) {
|
|
16
|
-
|
|
17
|
+
m();
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
|
|
20
|
+
p();
|
|
21
|
+
}, H = async () => {
|
|
22
|
+
r.value = !0, await a(), r.value = !1;
|
|
22
23
|
}, S = () => {
|
|
23
24
|
o.isSaveAsTemplateDrawerOpen = !0;
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
}, V = f(() => o.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), g = f(
|
|
26
|
+
() => {
|
|
27
|
+
var t, e;
|
|
28
|
+
return ((e = (t = n.value) == null ? void 0 : t.features) == null ? void 0 : e.versionHistory) && !o.isPreviewModeOpen;
|
|
29
|
+
}
|
|
30
|
+
), u = async (t) => {
|
|
31
|
+
i.value = !0, o.loadingStatus = !0;
|
|
32
|
+
const e = await l(t);
|
|
33
|
+
return i.value = !1, (t || !e) && (o.loadingStatus = !1), e;
|
|
28
34
|
};
|
|
29
|
-
return
|
|
30
|
-
handleSave:
|
|
31
|
-
}), { __sfc: !0, config:
|
|
35
|
+
return v({
|
|
36
|
+
handleSave: u
|
|
37
|
+
}), { __sfc: !0, config: n, exportHtml: a, save: l, openVersionHistory: p, closeVersionHistory: m, editorStore: o, trans: s, isExporting: r, isSaving: i, testEmailClick: d, handleVersionHistory: y, handleExport: H, handleSaveAs: S, versionHistoryTooltipText: V, isVersionHistoryButtonVisible: g, handleSave: u, getTooltipOptions: A, InButtonV2: B, RestoreButton: k };
|
|
32
38
|
}
|
|
33
39
|
});
|
|
34
40
|
export {
|
|
35
|
-
|
|
41
|
+
K as default
|
|
36
42
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { defineComponent as v, ref as D, computed as o } from "vue";
|
|
2
|
-
import
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { useOnboardingStore as
|
|
8
|
-
import { isAfterDate as w, formatShortDate as
|
|
9
|
-
const
|
|
2
|
+
import _ from "../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useConfig as h } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useTranslations as y } from "../../../composables/useTranslations.js";
|
|
5
|
+
import { ACADEMY_LINKS as c } from "../../../enums/academy.js";
|
|
6
|
+
import L from "../../../static/assets/onboarding-img.svg.js";
|
|
7
|
+
import { useOnboardingStore as C } from "../../../stores/onboarding.js";
|
|
8
|
+
import { isAfterDate as w, formatShortDate as A } from "../../../utils/dateUtil.js";
|
|
9
|
+
const V = /* @__PURE__ */ v({
|
|
10
10
|
__name: "NewVersionPopup",
|
|
11
11
|
emits: ["onboarding-finished"],
|
|
12
|
-
setup(
|
|
13
|
-
const e =
|
|
12
|
+
setup(I, { emit: a }) {
|
|
13
|
+
const e = y(), t = C(), s = D(!0), { config: p } = h(), i = o(() => {
|
|
14
14
|
var l, m;
|
|
15
15
|
return (m = (l = p.value) == null ? void 0 : l.editor) == null ? void 0 : m.migrationDate;
|
|
16
|
-
}), n = o(() => w(i.value || 0)), d = o(() =>
|
|
16
|
+
}), n = o(() => w(i.value || 0)), d = o(() => A(
|
|
17
17
|
i.value || 0
|
|
18
18
|
)), f = o(() => n.value ? e("email-editor.onboarding-popup-sunsetted-title") : e("email-editor.onboarding-title")), g = o(() => n.value ? e("email-editor.onboarding-popup-sunsetted-description", {
|
|
19
19
|
sunsetDate: d.value,
|
|
20
|
-
academyLink: c
|
|
20
|
+
academyLink: c.EMAIL_EDITOR
|
|
21
21
|
}) : e("email-editor.onboarding-description", {
|
|
22
|
-
academyLink: c
|
|
22
|
+
academyLink: c.EMAIL_EDITOR
|
|
23
23
|
})), u = o(() => n.value ? e("products.cancel") : e("products.remind-me-later")), b = o(() => ({
|
|
24
24
|
primaryButton: {
|
|
25
25
|
type: "primary",
|
|
@@ -38,9 +38,9 @@ const E = /* @__PURE__ */ v({
|
|
|
38
38
|
t.onRemindMeLater(), r();
|
|
39
39
|
}, handleClose: () => {
|
|
40
40
|
t.onNewVersionPopupClose(), r();
|
|
41
|
-
}, WpModal:
|
|
41
|
+
}, WpModal: _, onboardingImageSvg: L };
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
export {
|
|
45
|
-
|
|
45
|
+
V as default
|
|
46
46
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as h, ref as b, computed as g, watch as _ } from "vue";
|
|
2
|
+
import v from "../../wrappers/WpDrawer.vue.js";
|
|
3
3
|
import { useToaster as U } from "../../../composables/useToaster.js";
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useTranslations as N } from "../../../composables/useTranslations.js";
|
|
5
|
+
import { ACADEMY_LINKS as w } from "../../../enums/academy.js";
|
|
6
|
+
import { ToasterTypeOptions as R } from "../../../enums/toaster.js";
|
|
7
|
+
import { PAGE_TYPES as l, getTypeTranslations as D, UNSUBSCRIBE_PAGES_LINK as I } from "../../../enums/unsubscribe.js";
|
|
8
|
+
import { useUnsubscribeStore as P } from "../../../stores/unsubscribe.js";
|
|
8
9
|
import { InSegments as G } from "@useinsider/design-system-vue";
|
|
9
|
-
const
|
|
10
|
+
const V = /* @__PURE__ */ h({
|
|
10
11
|
__name: "UnsubscribeTypeSelection",
|
|
11
|
-
setup(
|
|
12
|
-
const e =
|
|
12
|
+
setup(L) {
|
|
13
|
+
const e = N(), { showToaster: f } = U(), t = P(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
|
|
13
14
|
"unsubscription-preference.select-unsubscribe-page-description",
|
|
14
|
-
{ action: `<a href="${
|
|
15
|
-
), T =
|
|
15
|
+
{ action: `<a href="${w.GLOBAL_UNSUBSCRIBE}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
|
|
16
|
+
), T = g(() => [
|
|
16
17
|
{
|
|
17
18
|
description: e("unsubscription-preference.type-global-unsubscribe-description"),
|
|
18
19
|
icon: "line-contact-global-unsub-page",
|
|
@@ -30,7 +31,7 @@ const K = /* @__PURE__ */ v({
|
|
|
30
31
|
disable: t.isSubscriptionPreferencesCenterDisabled,
|
|
31
32
|
tooltipText: t.isSubscriptionPreferencesCenterDisabled ? e("unsubscription-preference.pref-center-added") : ""
|
|
32
33
|
}
|
|
33
|
-
]), y =
|
|
34
|
+
]), y = g(() => ({
|
|
34
35
|
primaryButton: {
|
|
35
36
|
styling: "solid",
|
|
36
37
|
type: "primary",
|
|
@@ -56,13 +57,13 @@ const K = /* @__PURE__ */ v({
|
|
|
56
57
|
}, 500);
|
|
57
58
|
}, E = (s) => {
|
|
58
59
|
o.value = s;
|
|
59
|
-
},
|
|
60
|
+
}, m = () => {
|
|
60
61
|
const s = t.hasTemplatesByCollectionType, r = [];
|
|
61
62
|
if (Object.entries(s).forEach(([c, p]) => {
|
|
62
63
|
p || r.push(Number(c));
|
|
63
64
|
}), r.length === 0)
|
|
64
65
|
return !0;
|
|
65
|
-
const
|
|
66
|
+
const B = D(), a = r.map((c) => B[c]);
|
|
66
67
|
let u = "";
|
|
67
68
|
if (r.length === 1)
|
|
68
69
|
u = e("unsubscription-preference.create-page-to-continue", {
|
|
@@ -81,17 +82,17 @@ const K = /* @__PURE__ */ v({
|
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
return f({
|
|
84
|
-
type:
|
|
85
|
+
type: R.Warning,
|
|
85
86
|
message: u,
|
|
86
87
|
actionButton: {
|
|
87
88
|
text: "Go to Unsubscribe Pages",
|
|
88
89
|
onClick: () => {
|
|
89
|
-
window.location.href =
|
|
90
|
+
window.location.href = I;
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
}), !1;
|
|
93
94
|
}, C = async () => {
|
|
94
|
-
if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !
|
|
95
|
+
if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !m()) {
|
|
95
96
|
n.value = !1, d();
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
@@ -99,9 +100,9 @@ const K = /* @__PURE__ */ v({
|
|
|
99
100
|
};
|
|
100
101
|
return _(() => t.typeSelectionDrawerStatus, (s) => {
|
|
101
102
|
s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, t.isGlobalUnsubscribeDisabled && (o.value = t.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
|
|
102
|
-
}), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates:
|
|
103
|
+
}), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: m, selectCollection: C, WpDrawer: v, InSegments: G };
|
|
103
104
|
}
|
|
104
105
|
});
|
|
105
106
|
export {
|
|
106
|
-
|
|
107
|
+
V as default
|
|
107
108
|
};
|
package/dist/enums/onboarding.js
CHANGED
|
@@ -2,9 +2,8 @@ const e = [
|
|
|
2
2
|
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-0.ng-star-inserted",
|
|
3
3
|
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-1.ng-star-inserted",
|
|
4
4
|
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-2.ng-star-inserted"
|
|
5
|
-
], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper"
|
|
5
|
+
], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper";
|
|
6
6
|
export {
|
|
7
|
-
a as ACADEMY_LINK,
|
|
8
7
|
n as CARD_COMPOSITION_TAB_SELECTOR,
|
|
9
8
|
o as RIBBON_SELECTOR,
|
|
10
9
|
e as SERVICE_HOVER_SELECTORS,
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { useTranslations as
|
|
1
|
+
import { useTranslations as e } from "../composables/useTranslations.js";
|
|
2
2
|
import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
|
|
3
|
-
const
|
|
3
|
+
const I = {
|
|
4
4
|
UNSUBSCRIBE_LINK_TYPE: 1,
|
|
5
5
|
PREFERENCES_LINK_TYPE: 3
|
|
6
|
-
},
|
|
6
|
+
}, r = {
|
|
7
7
|
UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
|
|
8
8
|
DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
|
|
9
9
|
GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
|
|
10
10
|
PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
|
|
11
|
-
}, s = R(),
|
|
11
|
+
}, s = R(), _ = {
|
|
12
12
|
UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
|
|
13
13
|
PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
|
|
14
|
-
},
|
|
14
|
+
}, i = "iid", B = {
|
|
15
15
|
name: "Global Unsubscribe",
|
|
16
16
|
sendGridId: "G"
|
|
17
|
-
},
|
|
17
|
+
}, C = "/email/unsubscribe-pages", E = {
|
|
18
18
|
GLOBAL_UNSUBSCRIBE: 1,
|
|
19
19
|
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
|
|
20
20
|
SUBSCRIPTION_PREFERENCE_CENTER: 3,
|
|
21
21
|
SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
|
|
22
22
|
RESUBSCRIBE: 5
|
|
23
|
-
},
|
|
23
|
+
}, t = {
|
|
24
24
|
[E.GLOBAL_UNSUBSCRIBE]: [
|
|
25
25
|
E.GLOBAL_UNSUBSCRIBE,
|
|
26
26
|
E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
|
|
@@ -31,29 +31,28 @@ const N = {
|
|
|
31
31
|
E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
|
|
32
32
|
]
|
|
33
33
|
}, U = () => {
|
|
34
|
-
const
|
|
34
|
+
const n = e();
|
|
35
35
|
return {
|
|
36
|
-
[E.GLOBAL_UNSUBSCRIBE]:
|
|
37
|
-
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]:
|
|
38
|
-
[E.RESUBSCRIBE]:
|
|
39
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]:
|
|
40
|
-
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]:
|
|
36
|
+
[E.GLOBAL_UNSUBSCRIBE]: n("unsubscription-preference.type-global-unsubscribe"),
|
|
37
|
+
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: n("unsubscription-preference.type-global-unsubscription-confirmation"),
|
|
38
|
+
[E.RESUBSCRIBE]: n("unsubscription-preference.type-resubscribe"),
|
|
39
|
+
[E.SUBSCRIPTION_PREFERENCE_CENTER]: n("unsubscription-preference.type-subscription-preferences-center"),
|
|
40
|
+
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: n("unsubscription-preference.type-subscription-preferences-confirmation")
|
|
41
41
|
};
|
|
42
|
-
},
|
|
42
|
+
}, c = {
|
|
43
43
|
default: "{{ins-unsubscribe-link}}",
|
|
44
44
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
45
45
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
46
46
|
};
|
|
47
47
|
export {
|
|
48
|
-
t as ACADEMY_LINK,
|
|
49
48
|
B as DEFAULT_UNSUBSCRIBE_GROUP,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
i as INSIDER_ID,
|
|
50
|
+
r as LINK_REGEXES,
|
|
51
|
+
I as LINK_TYPES,
|
|
52
|
+
c as MERGE_TAGS,
|
|
54
53
|
E as PAGE_TYPES,
|
|
55
|
-
|
|
54
|
+
t as TYPE_COLLECTIONS,
|
|
56
55
|
C as UNSUBSCRIBE_PAGES_LINK,
|
|
57
|
-
|
|
56
|
+
_ as URLS,
|
|
58
57
|
U as getTypeTranslations
|
|
59
58
|
};
|
|
@@ -145,19 +145,10 @@ class g extends R {
|
|
|
145
145
|
T && this.api.getDocumentModifier().modifyHtml(o).setAttribute(C[T], e ? "1" : "0").apply(new l(`Updated ${t} visibility attribute`));
|
|
146
146
|
}
|
|
147
147
|
_listenToFormUpdates() {
|
|
148
|
-
this.api.onValueChanged(i.PRODUCT_IMAGE, (t) =>
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}), this.api.onValueChanged(i.PRODUCT_QUANTITY, (t) => {
|
|
153
|
-
this._onProductQuantityChange(t);
|
|
154
|
-
}), this.api.onValueChanged(i.PRODUCT_PRICE, (t) => {
|
|
155
|
-
this._onProductPriceChange(t);
|
|
156
|
-
}), this.api.onValueChanged(i.PRODUCT_ORIGINAL_PRICE, (t) => {
|
|
157
|
-
this._onProductOriginalPriceChange(t);
|
|
158
|
-
}), this.api.onValueChanged(i.PRODUCT_BUTTON, (t) => {
|
|
159
|
-
this._onProductButtonChange(t);
|
|
160
|
-
});
|
|
148
|
+
this.api.onValueChanged(i.PRODUCT_IMAGE, (t) => this._onProductImageChange(t)), this.api.onValueChanged(i.PRODUCT_NAME, (t) => this._onProductNameChange(t)), this.api.onValueChanged(i.PRODUCT_QUANTITY, (t) => this._onProductQuantityChange(t)), this.api.onValueChanged(i.PRODUCT_PRICE, (t) => this._onProductPriceChange(t)), this.api.onValueChanged(
|
|
149
|
+
i.PRODUCT_ORIGINAL_PRICE,
|
|
150
|
+
(t) => this._onProductOriginalPriceChange(t)
|
|
151
|
+
), this.api.onValueChanged(i.PRODUCT_BUTTON, (t) => this._onProductButtonChange(t));
|
|
161
152
|
}
|
|
162
153
|
_onProductImageChange(t) {
|
|
163
154
|
var o;
|
|
@@ -1,187 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{ key:
|
|
8
|
-
{ key:
|
|
9
|
-
{ key:
|
|
10
|
-
{ key:
|
|
11
|
-
{ key:
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var y = (n, o, i) => o in n ? m(n, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[o] = i;
|
|
3
|
+
var a = (n, o, i) => y(n, typeof o != "symbol" ? o + "" : o, i);
|
|
4
|
+
import { ModificationDescription as u } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as b } from "../common-control.js";
|
|
6
|
+
const h = "ui-elements-recommendation-card-composition", s = [
|
|
7
|
+
{ key: "productImage", label: "Product Image", visible: !0 },
|
|
8
|
+
{ key: "productName", label: "Product Name", visible: !0 },
|
|
9
|
+
{ key: "productPrice", label: "Product Price", visible: !0 },
|
|
10
|
+
{ key: "productOriginalPrice", label: "Product Original Price", visible: !0 },
|
|
11
|
+
{ key: "productButton", label: "Product Button", visible: !0 }
|
|
12
12
|
];
|
|
13
|
-
class
|
|
13
|
+
class g extends b {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
a(this, "currentComposition", []);
|
|
17
|
+
a(this, "currentVisibility", {});
|
|
18
|
+
}
|
|
14
19
|
getId() {
|
|
15
|
-
return
|
|
20
|
+
return h;
|
|
16
21
|
}
|
|
17
22
|
getTemplate() {
|
|
18
|
-
const
|
|
19
|
-
key:
|
|
20
|
-
label:
|
|
21
|
-
content:
|
|
23
|
+
const i = s.map((e) => ({
|
|
24
|
+
key: e.key,
|
|
25
|
+
label: e.label,
|
|
26
|
+
content: `
|
|
27
|
+
<div style="display: flex; align-items: center; justify-content: space-between;
|
|
28
|
+
padding: 8px; gap: 8px;">
|
|
29
|
+
<span style="flex: 1;">${e.label}</span>
|
|
30
|
+
${this._GuToggle(`visibility_${e.key}`)}
|
|
31
|
+
</div>
|
|
32
|
+
`
|
|
22
33
|
}));
|
|
23
34
|
return `
|
|
24
35
|
<div class="container">
|
|
25
36
|
${this._GuLabel({ text: "Card Element Order & Visibility" })}
|
|
26
|
-
${this._GuOrderable("cardComposition",
|
|
37
|
+
${this._GuOrderable("cardComposition", i)}
|
|
27
38
|
</div>
|
|
28
39
|
`;
|
|
29
40
|
}
|
|
30
41
|
onRender() {
|
|
31
|
-
this._initializeComposition(), this.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Creates the HTML content for an orderable item with label and toggle
|
|
38
|
-
*/
|
|
39
|
-
_createItemContent(t, i) {
|
|
40
|
-
return `
|
|
41
|
-
<div style="display: flex; align-items: center; justify-content: space-between;
|
|
42
|
-
padding: 8px; gap: 8px;">
|
|
43
|
-
<span style="flex: 1;">${t}</span>
|
|
44
|
-
${this._GuToggle(`visibility_${i}`)}
|
|
45
|
-
</div>
|
|
46
|
-
`;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Registers event listeners for composition and visibility changes
|
|
50
|
-
*/
|
|
51
|
-
_registerValueChangeListeners() {
|
|
52
|
-
this.api.onValueChanged("cardComposition", (t) => {
|
|
53
|
-
this._applyCompositionToBlock(t);
|
|
54
|
-
}), s.forEach((t) => {
|
|
55
|
-
this.api.onValueChanged(`visibility_${t.key}`, (i) => {
|
|
56
|
-
this._applyVisibilityToBlock(t.key, i);
|
|
42
|
+
this._initializeComposition(), this.api.onValueChanged("cardComposition", (i) => {
|
|
43
|
+
this.currentComposition = i, this._applyCompositionToBlock(i);
|
|
44
|
+
}), s.forEach((i) => {
|
|
45
|
+
this.api.onValueChanged(`visibility_${i.key}`, (e) => {
|
|
46
|
+
this.currentVisibility[i.key] = e, this._applyVisibilityToBlock();
|
|
57
47
|
});
|
|
58
48
|
});
|
|
59
49
|
}
|
|
50
|
+
onTemplateNodeUpdated(i) {
|
|
51
|
+
super.onTemplateNodeUpdated(i), this._initializeComposition();
|
|
52
|
+
}
|
|
60
53
|
/**
|
|
61
|
-
*
|
|
54
|
+
* Initialize the composition order and visibility from the block or use defaults
|
|
62
55
|
*/
|
|
63
56
|
_initializeComposition() {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
var p;
|
|
58
|
+
const i = (p = this.currentNode) == null ? void 0 : p.querySelector(".ins-recommendation-v3-block-v2");
|
|
59
|
+
let e = null, l = null;
|
|
60
|
+
if (i && "getAttribute" in i && (e = i.getAttribute("data-card-composition"), l = i.getAttribute("data-card-visibility")), e) {
|
|
61
|
+
const t = e.split(",").filter(Boolean), r = s.map((c) => c.key);
|
|
62
|
+
t.every((c) => r.includes(c)) && t.length > 0 ? this.currentComposition = t : this.currentComposition = r;
|
|
63
|
+
} else
|
|
64
|
+
this.currentComposition = s.map((t) => t.key);
|
|
65
|
+
if (l)
|
|
66
|
+
try {
|
|
67
|
+
const t = JSON.parse(l);
|
|
68
|
+
this.currentVisibility = t;
|
|
69
|
+
} catch {
|
|
70
|
+
this.currentVisibility = s.reduce((t, r) => (t[r.key] = r.visible, t), {});
|
|
71
|
+
}
|
|
72
|
+
else
|
|
73
|
+
this.currentVisibility = s.reduce((t, r) => (t[r.key] = r.visible, t), {});
|
|
74
|
+
const d = {
|
|
75
|
+
cardComposition: this.currentComposition
|
|
67
76
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
* Reads composition order from node's data-card-composition attribute
|
|
72
|
-
* Falls back to default order if attribute is not present
|
|
73
|
-
*/
|
|
74
|
-
_readCompositionFromNode() {
|
|
75
|
-
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
76
|
-
return s.map((i) => i.key);
|
|
77
|
-
const t = this.currentNode.getAttribute(c);
|
|
78
|
-
return t ? t.split(",").filter(Boolean) : s.map((i) => i.key);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Builds visibility values object from the visibility map
|
|
82
|
-
*/
|
|
83
|
-
_buildVisibilityValues(t) {
|
|
84
|
-
return s.reduce((i, e) => (i[`visibility_${e.key}`] = t[e.key] ?? !0, i), {});
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Read visibility state from individual row elements' data-visibility attributes
|
|
88
|
-
* This ensures toggles reflect the actual DOM state
|
|
89
|
-
*/
|
|
90
|
-
_readVisibilityFromRows() {
|
|
91
|
-
if (!this.currentNode)
|
|
92
|
-
return this._getDefaultVisibilities();
|
|
93
|
-
const t = Array.from(this.currentNode.querySelectorAll(l));
|
|
94
|
-
console.debug("_readVisibilityFromRows - found attribute rows:", t.length);
|
|
95
|
-
const i = this._extractVisibilityFromRows(t);
|
|
96
|
-
return this._mergeWithDefaults(i);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Returns default visibility values for all items
|
|
100
|
-
*/
|
|
101
|
-
_getDefaultVisibilities() {
|
|
102
|
-
return s.reduce((t, i) => (t[i.key] = i.visible, t), {});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Extracts visibility values from DOM nodes
|
|
106
|
-
*/
|
|
107
|
-
_extractVisibilityFromRows(t) {
|
|
108
|
-
const i = {};
|
|
109
|
-
return t.forEach((e) => {
|
|
110
|
-
if (!("getAttribute" in e))
|
|
111
|
-
return;
|
|
112
|
-
const o = e.getAttribute(a), r = e.getAttribute(d);
|
|
113
|
-
o && r !== null && (i[o] = this._parseVisibilityValue(r), console.debug(
|
|
114
|
-
`_readVisibilityFromRows - ${o}: ${i[o]} (raw: ${r})`
|
|
115
|
-
));
|
|
116
|
-
}), i;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Parses visibility value from string to boolean
|
|
120
|
-
* Accepts "1", "true" as true, everything else as false
|
|
121
|
-
*/
|
|
122
|
-
_parseVisibilityValue(t) {
|
|
123
|
-
return t === "1" || t === "true";
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Merges extracted visibilities with default values for missing keys
|
|
127
|
-
*/
|
|
128
|
-
_mergeWithDefaults(t) {
|
|
129
|
-
return s.forEach((i) => {
|
|
130
|
-
i.key in t || (t[i.key] = i.visible, console.debug(`_readVisibilityFromRows - ${i.key}: using default ${i.visible}`));
|
|
131
|
-
}), t;
|
|
77
|
+
s.forEach((t) => {
|
|
78
|
+
d[`visibility_${t.key}`] = this.currentVisibility[t.key] ?? !0;
|
|
79
|
+
}), this.api.updateValues(d);
|
|
132
80
|
}
|
|
133
81
|
/**
|
|
134
82
|
* Apply the reordered composition to the block's HTML structure
|
|
135
|
-
* Updates the data-card-composition attribute and reorders product attributes
|
|
136
|
-
*/
|
|
137
|
-
_applyCompositionToBlock(t) {
|
|
138
|
-
if (console.debug("_applyCompositionToBlock - composition:", t), !this.currentNode) {
|
|
139
|
-
console.debug("_applyCompositionToBlock - no current node");
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(c, t.join(",")).apply(new n("Update card composition")), this._reorderProductAttributes(t);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Reorders attribute rows within each product row based on composition order
|
|
146
83
|
*/
|
|
147
|
-
|
|
84
|
+
_applyCompositionToBlock(i) {
|
|
148
85
|
if (!this.currentNode)
|
|
149
86
|
return;
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
return;
|
|
153
|
-
const e = this.api.getDocumentModifier();
|
|
154
|
-
i.forEach((o) => {
|
|
155
|
-
const r = this._buildCompositionHtml(o, t);
|
|
156
|
-
e.modifyHtml(o).setInnerHtml(r);
|
|
157
|
-
}), e.apply(new n("Reorder product attributes"));
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Builds HTML string with attributes ordered according to composition
|
|
161
|
-
*/
|
|
162
|
-
_buildCompositionHtml(t, i) {
|
|
163
|
-
return i.reduce((e, o) => {
|
|
164
|
-
const r = t.querySelector(`${l}[${a}="${o}"]`);
|
|
165
|
-
return r && "getOuterHTML" in r ? e + r.getOuterHTML() : e;
|
|
166
|
-
}, "");
|
|
87
|
+
const e = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
88
|
+
e && this.api.getDocumentModifier().modifyHtml(e).setAttribute("data-card-composition", i.join(",")).apply(new u("Stored card composition order"));
|
|
167
89
|
}
|
|
168
90
|
/**
|
|
169
91
|
* Apply visibility changes to the block's HTML structure
|
|
170
|
-
* Updates display style and data-visibility attribute for all matching rows
|
|
171
92
|
*/
|
|
172
|
-
_applyVisibilityToBlock(
|
|
173
|
-
if (
|
|
174
|
-
return;
|
|
175
|
-
const e = this.currentNode.querySelectorAll(`${l}[${a}="${t}"]`);
|
|
176
|
-
if (!(e != null && e.length))
|
|
93
|
+
_applyVisibilityToBlock() {
|
|
94
|
+
if (!this.currentNode)
|
|
177
95
|
return;
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
u.modifyHtml(b).setStyle("display", o).setAttribute(d, r);
|
|
181
|
-
}), u.apply(new n(p));
|
|
96
|
+
const i = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
97
|
+
i && this.api.getDocumentModifier().modifyHtml(i).setAttribute("data-card-visibility", JSON.stringify(this.currentVisibility)).apply(new u("Stored card visibility settings"));
|
|
182
98
|
}
|
|
183
99
|
}
|
|
184
100
|
export {
|
|
185
|
-
|
|
186
|
-
|
|
101
|
+
h as COMPOSITION_CONTROL_BLOCK_ID,
|
|
102
|
+
g as RecommendationCardCompositionControl
|
|
187
103
|
};
|