@useinsider/guido 3.22.0-beta.e9b6f94 → 3.23.0-beta.0e4cf11
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 +7 -1
- package/dist/@types/config/schemas.js +11 -10
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +103 -92
- package/dist/components/organisms/AutoSaveController.vue2.js +20 -10
- package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
- package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
- package/dist/components/organisms/header/EditorActions.vue.js +13 -13
- package/dist/components/organisms/header/EditorActions.vue2.js +58 -73
- package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
- package/dist/components/organisms/header/EditorActionsMenu.vue2.js +99 -0
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
- package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
- package/dist/components/organisms/header/RightSlot.vue.js +11 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +60 -35
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +11 -11
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
- package/dist/composables/useAccessibilityApi.js +51 -0
- package/dist/composables/useCustomInterfaceAppearance.js +42 -41
- package/dist/composables/useStripo.js +70 -70
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -22
- package/dist/config/i18n/en/labels.json.js +36 -4
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/config/migrator/recommendation/compositionMapper.js +56 -49
- package/dist/config/migrator/recommendation/extractors.js +100 -40
- package/dist/config/migrator/recommendation/htmlBuilder.js +285 -207
- package/dist/config/migrator/recommendation/settingsMapper.js +37 -36
- package/dist/config/migrator/recommendation/themeMapper.js +53 -41
- package/dist/config/migrator/recommendationMigrator.js +68 -61
- package/dist/config/migrator/unsubscribeMigrator.js +87 -60
- package/dist/extensions/Blocks/Items/controls/button/link.js +14 -17
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +14 -17
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -17
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +9 -10
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +24 -25
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -13
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +29 -30
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +15 -16
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +25 -26
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +27 -28
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +75 -80
- package/dist/extensions/Blocks/Recommendation/block.js +33 -24
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +27 -26
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +13 -13
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +165 -175
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +8 -8
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +15 -15
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +23 -22
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +19 -18
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +82 -91
- package/dist/extensions/Blocks/Recommendation/utils/inlinePriceOrder.js +12 -0
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +3 -2
- package/dist/extensions/Blocks/common-control.js +62 -55
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/sprite.svg +10 -0
- package/dist/src/@types/config/schemas.d.ts +2 -0
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +19 -1
- package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -19
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -19
- package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
- package/dist/src/composables/useActionsApi.d.ts +2 -2
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useStripo.d.ts +1 -1
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/extractors.d.ts +35 -6
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/types.d.ts +11 -1
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -10
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -13
- package/dist/src/extensions/Blocks/Recommendation/utils/inlinePriceOrder.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -19
- package/dist/src/extensions/Blocks/common-control.d.ts +2 -0
- package/dist/src/stores/autosave.d.ts +73 -1
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/stores/editor.d.ts +109 -0
- package/dist/src/stores/onboarding.d.ts +966 -35
- package/dist/src/stores/unsubscribe.d.ts +10 -0
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/templatePreparation.d.ts +1 -1
- package/dist/src/utils/timeUtil.d.ts +5 -8
- package/dist/static/stripo-runtime-manifest.json.js +1 -1
- package/dist/static/styles/components/accessibility.css.js +234 -0
- package/dist/static/styles/variables.css.js +2 -0
- package/dist/stores/autosave.js +12 -7
- package/dist/stores/editor.js +8 -3
- package/dist/stores/onboarding.js +48 -22
- package/dist/stores/unsubscribe.js +33 -29
- package/dist/utils/timeUtil.js +6 -17
- package/package.json +3 -3
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import { useModuleRepair as
|
|
7
|
-
import { useStripoEventHandler as
|
|
8
|
-
import { useStripoNotifications as
|
|
9
|
-
import { useToaster as
|
|
10
|
-
import { localePatch as
|
|
1
|
+
import { useActionsApi as N } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as j } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as z } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as v } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as $ } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useModuleRepair as G } from "./useModuleRepair.js";
|
|
7
|
+
import { useStripoEventHandler as X } from "./useStripoEventHandler.js";
|
|
8
|
+
import { useStripoNotifications as J } from "./useStripoNotifications.js";
|
|
9
|
+
import { useToaster as K } from "./useToaster.js";
|
|
10
|
+
import { localePatch as Q } from "../config/i18n/index.js";
|
|
11
11
|
import { en as B } from "../config/i18n/en/index.js";
|
|
12
|
-
import { ToasterTypeOptions as
|
|
13
|
-
import { useStripoApi as
|
|
14
|
-
import
|
|
15
|
-
import { useEditorStore as
|
|
16
|
-
import { buildMergeTagEntries as
|
|
17
|
-
import { getStripoRuntimeBaseUrl as
|
|
18
|
-
let d = null,
|
|
19
|
-
const
|
|
20
|
-
const { features: u, template: m, isFeatureEnabled: p } =
|
|
12
|
+
import { ToasterTypeOptions as W } from "../enums/toaster.js";
|
|
13
|
+
import { useStripoApi as Y } from "../services/stripoApi.js";
|
|
14
|
+
import Z from "../static/styles/customEditorStyle.css.js";
|
|
15
|
+
import { useEditorStore as T } from "../stores/editor.js";
|
|
16
|
+
import { buildMergeTagEntries as ee, flattenDynamicContentList as te } from "../utils/genericUtil.js";
|
|
17
|
+
import { getStripoRuntimeBaseUrl as oe } from "../utils/stripoRuntime.js";
|
|
18
|
+
let d = null, F = !1;
|
|
19
|
+
const ke = (t) => {
|
|
20
|
+
const { features: u, template: m, isFeatureEnabled: p } = z(), { handleError: f, showToaster: A } = K(), { getToken: P, getCustomFonts: R, getSyncModulesStatus: U } = Y(), { handleEvent: V } = X(), { handleModuleAdd: D } = G(), { getStripoBlocksConfig: I } = j(), { getStripoNotifications: L } = J(), g = () => d || (d = new Promise((n, a) => {
|
|
21
21
|
if (document.getElementById("UiEditorScript")) {
|
|
22
|
-
|
|
22
|
+
n();
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
const i =
|
|
25
|
+
const i = oe();
|
|
26
26
|
if (!i) {
|
|
27
|
-
|
|
27
|
+
a(
|
|
28
28
|
new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
|
|
29
29
|
);
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
}, document.body.appendChild(
|
|
32
|
+
const s = `${i}UIEditor.js`, e = document.createElement("script");
|
|
33
|
+
e.id = "UiEditorScript", e.type = "module", e.src = s, e.onload = () => {
|
|
34
|
+
F = !0, n();
|
|
35
|
+
}, e.onerror = () => {
|
|
36
|
+
e.remove(), a(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
|
|
37
|
+
}, document.body.appendChild(e);
|
|
38
38
|
}), d.catch(() => {
|
|
39
39
|
d = null;
|
|
40
|
-
}), d),
|
|
41
|
-
var
|
|
42
|
-
const o =
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
40
|
+
}), d), q = async (n, a, i, s = [], e = !1, c = !1) => {
|
|
41
|
+
var w, k, b, _;
|
|
42
|
+
const o = T(), { html: S, css: y } = n, { baseBlocks: E, extensions: x } = await I();
|
|
43
|
+
t.mark("blocks_config_ready");
|
|
44
|
+
const h = ((w = u.value) == null ? void 0 : w.displayConditions) ?? !0, O = ((k = u.value) == null ? void 0 : k.modulesDisabled) ?? !1, C = c || (((b = m.value) == null ? void 0 : b.forceRecreate) ?? !1), H = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
45
|
+
t.setTemplate({ html: S, css: y, forceRecreate: C }), v().importCss(), t.mark("init_editor"), await window.UIEditor.initEditor(
|
|
46
46
|
document.querySelector("#guido-editor"),
|
|
47
47
|
{
|
|
48
|
-
metadata:
|
|
49
|
-
html:
|
|
50
|
-
css:
|
|
51
|
-
forceRecreate:
|
|
48
|
+
metadata: a,
|
|
49
|
+
html: S,
|
|
50
|
+
css: y,
|
|
51
|
+
forceRecreate: C,
|
|
52
52
|
locale: "en",
|
|
53
53
|
undoButtonSelector: "#guido__undo-button",
|
|
54
54
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -58,12 +58,12 @@ const we = (e) => {
|
|
|
58
58
|
customAppearanceMergetags: !p("liquidSyntax"),
|
|
59
59
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
60
60
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
61
|
-
customViewStyles:
|
|
62
|
-
conditionsEnabled:
|
|
63
|
-
customConditionsEnabled:
|
|
61
|
+
customViewStyles: Z,
|
|
62
|
+
conditionsEnabled: h,
|
|
63
|
+
customConditionsEnabled: h,
|
|
64
64
|
enableXSSSecurity: !0,
|
|
65
|
-
modulesDisabled:
|
|
66
|
-
syncModulesEnabled:
|
|
65
|
+
modulesDisabled: O,
|
|
66
|
+
syncModulesEnabled: e,
|
|
67
67
|
messageSettingsEnabled: !0,
|
|
68
68
|
displayGmailAnnotations: !0,
|
|
69
69
|
displayHiddenPreheader: !1,
|
|
@@ -73,37 +73,37 @@ const we = (e) => {
|
|
|
73
73
|
copyPasteEnabled: !1,
|
|
74
74
|
selectElementAfterDrop: !0,
|
|
75
75
|
sameFontSizeForOutlook: !0,
|
|
76
|
-
allowedScriptSourceDomains:
|
|
77
|
-
...
|
|
76
|
+
allowedScriptSourceDomains: H,
|
|
77
|
+
...E ? { baseBlocks: E } : {},
|
|
78
78
|
editorFonts: {
|
|
79
79
|
showDefaultStandardFonts: !0,
|
|
80
80
|
showDefaultNotStandardFonts: !0,
|
|
81
|
-
customFonts:
|
|
81
|
+
customFonts: s
|
|
82
82
|
},
|
|
83
83
|
mergeTags: [
|
|
84
84
|
{
|
|
85
|
-
entries:
|
|
85
|
+
entries: ee(
|
|
86
86
|
i.preselectedDynamicContentList,
|
|
87
|
-
|
|
87
|
+
te((_ = m.value) == null ? void 0 : _.dynamicContentList),
|
|
88
88
|
p("liquidSyntax")
|
|
89
89
|
)
|
|
90
90
|
}
|
|
91
91
|
],
|
|
92
92
|
async onTokenRefreshRequest(r) {
|
|
93
93
|
try {
|
|
94
|
-
|
|
95
|
-
const l = await
|
|
96
|
-
|
|
94
|
+
t.mark("token_start");
|
|
95
|
+
const l = await P();
|
|
96
|
+
t.mark("token_end"), r(l);
|
|
97
97
|
} catch (l) {
|
|
98
98
|
f(l, "Failed to refresh token");
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
onTemplateLoaded() {
|
|
102
102
|
try {
|
|
103
|
-
const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } =
|
|
104
|
-
|
|
103
|
+
const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = N(), { injectFullStory: M } = $();
|
|
104
|
+
v().importCss(), r(), M(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
|
|
105
105
|
o.hasChanges = !1;
|
|
106
|
-
}, 1e3),
|
|
106
|
+
}, 1e3), t.markReady();
|
|
107
107
|
} catch (r) {
|
|
108
108
|
f(r, "Failed to load custom interface appearance");
|
|
109
109
|
}
|
|
@@ -120,9 +120,9 @@ const we = (e) => {
|
|
|
120
120
|
onDataChanged() {
|
|
121
121
|
o.hasChanges = !0, o.changeSeq += 1;
|
|
122
122
|
},
|
|
123
|
-
onEvent:
|
|
124
|
-
onModuleAdd:
|
|
125
|
-
notifications:
|
|
123
|
+
onEvent: V,
|
|
124
|
+
onModuleAdd: D,
|
|
125
|
+
notifications: L(),
|
|
126
126
|
// Stripo deselects the block on any click outside the canvas, so every surface
|
|
127
127
|
// that belongs to the block's own flow has to be listed here (SD-153273).
|
|
128
128
|
ignoreClickOutsideSelectors: [
|
|
@@ -132,29 +132,29 @@ const we = (e) => {
|
|
|
132
132
|
".in-modal-v2-wrapper",
|
|
133
133
|
".in-toasts-wrapper"
|
|
134
134
|
],
|
|
135
|
-
extensions:
|
|
136
|
-
localePatch:
|
|
135
|
+
extensions: x,
|
|
136
|
+
localePatch: Q
|
|
137
137
|
}
|
|
138
138
|
);
|
|
139
139
|
};
|
|
140
|
-
return { initPlugin: async (a,
|
|
141
|
-
const
|
|
140
|
+
return { initPlugin: async (n, a, i, s = !1) => {
|
|
141
|
+
const e = T();
|
|
142
142
|
try {
|
|
143
|
-
|
|
144
|
-
const [
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
t.mark("plugin_start"), t.setScriptPreloaded(F), await g(), t.mark("script_ready");
|
|
144
|
+
const [c, o] = await Promise.all([
|
|
145
|
+
R(),
|
|
146
|
+
U()
|
|
147
147
|
]);
|
|
148
|
-
|
|
148
|
+
t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await q(n, a, i, c, o, s);
|
|
149
149
|
} catch {
|
|
150
|
-
|
|
151
|
-
type:
|
|
150
|
+
e.loadingStatus = !1, A({
|
|
151
|
+
type: W.Error,
|
|
152
152
|
message: B["An error has occurred. Please report the error code to support."],
|
|
153
153
|
actionButton: {
|
|
154
154
|
text: B["Reload page"],
|
|
155
155
|
onClick: () => window.location.reload()
|
|
156
156
|
}
|
|
157
|
-
}),
|
|
157
|
+
}), t.markFailed();
|
|
158
158
|
}
|
|
159
159
|
}, preloadRuntime: () => {
|
|
160
160
|
g().catch(() => {
|
|
@@ -162,5 +162,5 @@ const we = (e) => {
|
|
|
162
162
|
} };
|
|
163
163
|
};
|
|
164
164
|
export {
|
|
165
|
-
|
|
165
|
+
ke as useStripo
|
|
166
166
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useConfig as
|
|
1
|
+
import { useConfig as C } from "../../../composables/useConfig.js";
|
|
2
2
|
import { useRecommendation as O } from "../../../composables/useRecommendation.js";
|
|
3
3
|
import { MOBILE_ROW_SELECTOR as q, MOBILE_CONTAINER_SELECTOR as M, CSS_CLASS_RECO_BUTTON as B } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
4
4
|
import { useRecommendationExtensionStore as N } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
@@ -13,7 +13,7 @@ function A(t) {
|
|
|
13
13
|
[r] = r.children;
|
|
14
14
|
return r;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function _(t, r, e, o, c, i) {
|
|
17
17
|
switch (r) {
|
|
18
18
|
case "productImage": {
|
|
19
19
|
const n = t.querySelector("img");
|
|
@@ -78,7 +78,7 @@ function y(t, r, e, o, c, i) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
const P = "name";
|
|
81
|
-
function
|
|
81
|
+
function y(t, r, e, o) {
|
|
82
82
|
const c = `${o}${r}_${e}_${P}`;
|
|
83
83
|
return {
|
|
84
84
|
open: t.createComment(`{% if ${c} and ${c} != "" %}`),
|
|
@@ -86,19 +86,19 @@ function b(t, r, e, o) {
|
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
function R(t, r, e) {
|
|
89
|
-
return
|
|
89
|
+
return y(t, r, 0, e);
|
|
90
90
|
}
|
|
91
91
|
function w(t, r, e, o) {
|
|
92
92
|
if (!t.innerHTML.includes("{{"))
|
|
93
93
|
return;
|
|
94
|
-
const { open: c, close: i } =
|
|
94
|
+
const { open: c, close: i } = y(t.ownerDocument, r, e, o);
|
|
95
95
|
t.insertBefore(c, t.firstChild), t.appendChild(i);
|
|
96
96
|
}
|
|
97
97
|
function D(t, r, e, o) {
|
|
98
98
|
var n, s;
|
|
99
99
|
if (!t.innerHTML.includes("{{"))
|
|
100
100
|
return;
|
|
101
|
-
const { open: c, close: i } =
|
|
101
|
+
const { open: c, close: i } = y(t.ownerDocument, r, e, o);
|
|
102
102
|
(n = t.parentNode) == null || n.insertBefore(c, t), (s = t.parentNode) == null || s.insertBefore(i, t.nextSibling);
|
|
103
103
|
}
|
|
104
104
|
function v(t, r, e, o) {
|
|
@@ -106,8 +106,8 @@ function v(t, r, e, o) {
|
|
|
106
106
|
i.querySelectorAll("[data-attribute-type]").forEach((d) => {
|
|
107
107
|
const u = d.getAttribute("data-attribute-type") || "", a = d.querySelectorAll(".attribute-cell");
|
|
108
108
|
a.length > 0 ? a.forEach((l) => {
|
|
109
|
-
|
|
110
|
-
}) :
|
|
109
|
+
_(l, u, r, n, e, o);
|
|
110
|
+
}) : _(d, u, r, n, e, o);
|
|
111
111
|
}), D(i, r, n, o);
|
|
112
112
|
});
|
|
113
113
|
}
|
|
@@ -119,9 +119,9 @@ function H(t, r, e, o) {
|
|
|
119
119
|
c.forEach((d, u) => {
|
|
120
120
|
d.querySelectorAll("[data-attribute-type]").forEach((l) => {
|
|
121
121
|
const p = l.getAttribute("data-attribute-type") || "";
|
|
122
|
-
l.querySelectorAll(".attribute-cell").forEach((
|
|
122
|
+
l.querySelectorAll(".attribute-cell").forEach((m, h) => {
|
|
123
123
|
const S = u * s + h;
|
|
124
|
-
|
|
124
|
+
_(m, p, r, S, e, o), w(m, r, S, o);
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
127
|
});
|
|
@@ -132,10 +132,10 @@ function W(t, r, e, o) {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
function F(t, r, e) {
|
|
135
|
-
const o = t.getAttribute("data-layout") || "grid", c = t.getAttribute("currency-alignment") || "after";
|
|
136
|
-
o === "list" ? v(t, r,
|
|
135
|
+
const o = t.getAttribute("data-layout") || "grid", c = t.getAttribute("currency-alignment"), i = c === "0" || c === "before" ? "before" : "after";
|
|
136
|
+
o === "list" ? v(t, r, i, e) : W(t, r, i, e);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function b(t, r, e) {
|
|
139
139
|
const o = new RegExp(`${r}\\s*:\\s*(\\d+)\\s*px`, "i"), c = t.match(o);
|
|
140
140
|
return c ? parseInt(c[1]) : e;
|
|
141
141
|
}
|
|
@@ -143,7 +143,7 @@ function $(t) {
|
|
|
143
143
|
const r = t.trim();
|
|
144
144
|
return r.endsWith("%") ? parseFloat(r) < 100 : /^\d+(?:\.\d+)?(?:px)?$/.test(r) && parseInt(r) > 0;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function g(t) {
|
|
147
147
|
const r = t.getAttribute("width");
|
|
148
148
|
if (r && $(r))
|
|
149
149
|
return r.trim();
|
|
@@ -153,28 +153,28 @@ function C(t) {
|
|
|
153
153
|
function x(t, r) {
|
|
154
154
|
let e = t.parentElement;
|
|
155
155
|
for (; e && e !== r; ) {
|
|
156
|
-
if (e.tagName === "TD" &&
|
|
156
|
+
if (e.tagName === "TD" && g(e))
|
|
157
157
|
return e;
|
|
158
158
|
e = e.parentElement;
|
|
159
159
|
}
|
|
160
160
|
return null;
|
|
161
161
|
}
|
|
162
162
|
function G(t) {
|
|
163
|
-
const r = t.getAttribute("style") || "", e =
|
|
163
|
+
const r = t.getAttribute("style") || "", e = b(r, "width", 600), o = b(r, "padding", 0) * 2, c = Math.max(0, e - o);
|
|
164
164
|
c !== 0 && t.querySelectorAll("img.adapt-img").forEach((i) => {
|
|
165
165
|
if (i.hasAttribute("width"))
|
|
166
166
|
return;
|
|
167
167
|
const n = x(i, t);
|
|
168
168
|
if (!n)
|
|
169
169
|
return;
|
|
170
|
-
const s =
|
|
170
|
+
const s = g(n), d = b(n.getAttribute("style") || "", "padding", 0) * 2, u = s.endsWith("%") ? Math.floor(c * parseFloat(s) / 100) : parseInt(s), a = Math.max(1, u - d), l = i.getAttribute("style") || "", p = /(?:^|[;\s])max-height\s*:\s*(\d+(?:\.\d+)?)px/i.exec(l);
|
|
171
171
|
if (p) {
|
|
172
172
|
i.setAttribute("width", String(Math.max(1, Math.min(a, Math.floor(parseFloat(p[1])))))), i.removeAttribute("height");
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
if (i.setAttribute("width", String(a)), !/\bwidth\s*:\s*\d/i.test(l)) {
|
|
176
|
-
const
|
|
177
|
-
i.setAttribute("style", `${l}${
|
|
176
|
+
const f = l && !l.trim().endsWith(";") ? "; " : "";
|
|
177
|
+
i.setAttribute("style", `${l}${f}width: ${a}px`);
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
}
|
|
@@ -200,15 +200,15 @@ function Q(t) {
|
|
|
200
200
|
return t;
|
|
201
201
|
const { buildCampaignUrl: c } = O(), i = N();
|
|
202
202
|
i.recommendationCampaignUrls = {};
|
|
203
|
-
const { isFeatureEnabled: n } =
|
|
203
|
+
const { isFeatureEnabled: n } = C(), s = n("liquidSyntax") ? "reco_" : "";
|
|
204
204
|
return o.forEach((u) => {
|
|
205
|
-
var l, p,
|
|
205
|
+
var l, p, f, m;
|
|
206
206
|
const a = u.getAttribute("recommendation-id");
|
|
207
207
|
if (a) {
|
|
208
208
|
if ((l = u.parentNode) == null || l.insertBefore(e.createComment("REC_START"), u), (p = u.parentNode) == null || p.insertBefore(e.createComment("REC_END"), u.nextSibling), u.querySelectorAll('[data-visibility="0"]').forEach((h) => h.remove()), c(a), U(u, e), !T(u)) {
|
|
209
209
|
F(u, a, s);
|
|
210
210
|
const { open: h, close: S } = R(e, a, s);
|
|
211
|
-
(
|
|
211
|
+
(f = u.parentNode) == null || f.insertBefore(h, u), (m = u.parentNode) == null || m.insertBefore(S, u.nextSibling);
|
|
212
212
|
}
|
|
213
213
|
G(u);
|
|
214
214
|
}
|
|
@@ -1,19 +1,51 @@
|
|
|
1
|
-
const e = "Items", o = "Default",
|
|
1
|
+
const e = "Items", o = "Default", i = "Custom", t = {
|
|
2
2
|
"Global Styles & Layout": "Global Styles and Layout",
|
|
3
3
|
"Structures & Modules": "Structures and Modules",
|
|
4
4
|
"Recommendation Block": "Recommendation Block",
|
|
5
5
|
Items: e,
|
|
6
6
|
"This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.",
|
|
7
7
|
"This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.",
|
|
8
|
+
"email-editor.a11y-hide-images": "Hide images",
|
|
9
|
+
"email-editor.a11y-show-images": "Show images",
|
|
10
|
+
"email-editor.cvd-none": "No Color Deficiency",
|
|
11
|
+
"email-editor.cvd-protanopia": "Protanopia",
|
|
12
|
+
"email-editor.cvd-protanopia-description": "Causes red-green confusion and makes reds appear darker.",
|
|
13
|
+
"email-editor.cvd-deuteranopia": "Deuteranopia",
|
|
14
|
+
"email-editor.cvd-deuteranopia-description": "Causes red-green confusion.",
|
|
15
|
+
"email-editor.cvd-tritanopia": "Tritanopia",
|
|
16
|
+
"email-editor.cvd-tritanopia-description": "Causes blue-yellow confusion.",
|
|
17
|
+
"email-editor.cvd-achromatopsia": "Achromatopsia",
|
|
18
|
+
"email-editor.cvd-achromatopsia-description": "Causes complete color blindness.",
|
|
19
|
+
"email-editor.more-actions": "More actions",
|
|
20
|
+
"email-editor.preferences": "Preferences",
|
|
21
|
+
"email-editor.actions": "Actions",
|
|
22
|
+
"email-editor.accessibility-test": "Accessibility Test",
|
|
23
|
+
"email-editor.autosaved-at-today": "{boldStart}Autosaved{boldEnd} at {time}, Today",
|
|
24
|
+
"email-editor.autosaved-at-date": "{boldStart}Autosaved{boldEnd} at {date}",
|
|
25
|
+
"email-editor.export-html": "Export HTML",
|
|
26
|
+
"email-editor.onboarding-kebab-title": "Discover Preferences and Actions",
|
|
27
|
+
"email-editor.onboarding-kebab-description": "You can now access your Preferences and Actions easily such as Autosave, Export HTML, Version History, Accessibility Test and Save As Template.",
|
|
28
|
+
"email-editor.onboarding-autosave-title": "Autosave Your Design",
|
|
29
|
+
"email-editor.onboarding-autosave-description": "You can save your design automatically by enabling Autosave without losing your work.",
|
|
30
|
+
"email-editor.onboarding-accessibility-title": "Test Accessibility of Your Design",
|
|
31
|
+
"email-editor.onboarding-accessibility-description": "You can test the accessibility of your design to see the Failed, Passed items and update the Failed ones accordingly.",
|
|
8
32
|
"Pixel Tracking Opt-in": "Pixel Tracking Opt-in",
|
|
9
33
|
"OPT-IN SELECTION": "OPT-IN SELECTION",
|
|
10
34
|
"UNSUBSCRIBE GROUPS": "UNSUBSCRIBE GROUPS",
|
|
11
35
|
Default: o,
|
|
12
|
-
Custom:
|
|
36
|
+
Custom: i,
|
|
37
|
+
"Foreground color": "Foreground Color",
|
|
38
|
+
"Contrast ratio": "Contrast Ratio",
|
|
39
|
+
"You’ve fixed all issues!": `No Failed Items
|
|
40
|
+
You have no failed items.`,
|
|
41
|
+
"No accessibility issues found": `No Failed Items
|
|
42
|
+
You have no failed items.`,
|
|
43
|
+
"You have no ignored issues yet": `No Ignored Items
|
|
44
|
+
You have no ignored items.`
|
|
13
45
|
};
|
|
14
46
|
export {
|
|
15
|
-
|
|
47
|
+
i as Custom,
|
|
16
48
|
o as Default,
|
|
17
49
|
e as Items,
|
|
18
|
-
|
|
50
|
+
t as default
|
|
19
51
|
};
|
|
@@ -76,7 +76,8 @@ const e = {
|
|
|
76
76
|
"The data source link is unavailable. Please, make sure there is an access to the data source.": "Enter an accessible Data Source Link to contiue.",
|
|
77
77
|
"The file should not exceed the maximum resolution of {maxImageResolution}px.": "Upload files up to 1024x512 pixels to continue.",
|
|
78
78
|
"The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor.",
|
|
79
|
-
"Dropdown with a list of available data services, preliminarily created in the Data section → Services tab of the Account.": "Service for Data Collection lets you enter a form submission URL for the recipients to submit."
|
|
79
|
+
"Dropdown with a list of available data services, preliminarily created in the Data section → Services tab of the Account.": "Service for Data Collection lets you enter a form submission URL for the recipients to submit.",
|
|
80
|
+
'Read more about the issue on <a target="_blank" rel="noopener noreferrer" href="{url}">ACT Rules Community Group forum</a>': 'Read more about the issue on <a target="_blank" rel="noopener noreferrer" href="{url}">ACT Rules Community Group forum.</a>'
|
|
80
81
|
};
|
|
81
82
|
export {
|
|
82
83
|
e as default
|
|
@@ -1,101 +1,108 @@
|
|
|
1
|
-
import { DEFAULT_COMPOSITION as
|
|
2
|
-
import { ATTR_RECOMMENDATION_TITLE as
|
|
3
|
-
import { mapTextTheme as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
switch (
|
|
1
|
+
import { DEFAULT_COMPOSITION as k, DEFAULT_VISIBILITY as f } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
2
|
+
import { ATTR_RECOMMENDATION_TITLE as R, ATTR_CUSTOM_PREFIX as x, ATTR_PRODUCT_BUTTON as E, ATTR_PRODUCT_OMNIBUS_DISCOUNT as h, ATTR_PRODUCT_OMNIBUS_PRICE as O, ATTR_PRODUCT_OLD_PRICE as a, ATTR_PRODUCT_PRICE as d, ATTR_PRODUCT_NAME as y, ATTR_PRODUCT_IMAGE as b } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
3
|
+
import { mapTextTheme as C, mapButtonTheme as N, mapImageTheme as P } from "./themeMapper.js";
|
|
4
|
+
const U = "__title__", _ = "product_attribute.";
|
|
5
|
+
function D(n) {
|
|
6
|
+
const s = n.variable ?? "";
|
|
7
|
+
switch (s) {
|
|
8
8
|
case "p_recommendation_title":
|
|
9
|
-
return { key:
|
|
9
|
+
return { key: U, kind: "title" };
|
|
10
10
|
case "p_image":
|
|
11
|
-
return { key:
|
|
11
|
+
return { key: b, kind: "image" };
|
|
12
12
|
case "p_name":
|
|
13
|
-
return { key:
|
|
13
|
+
return { key: y, kind: "text" };
|
|
14
14
|
case "p_price":
|
|
15
|
-
return { key:
|
|
15
|
+
return { key: d, kind: "text" };
|
|
16
16
|
case "p_original_price":
|
|
17
|
-
return { key:
|
|
17
|
+
return { key: a, kind: "text" };
|
|
18
18
|
case "p_omnibus_price":
|
|
19
|
-
return { key:
|
|
19
|
+
return { key: O, kind: "text" };
|
|
20
20
|
case "p_omnibus_discount":
|
|
21
|
-
return { key:
|
|
21
|
+
return { key: h, kind: "text" };
|
|
22
22
|
case "p_button":
|
|
23
|
-
return { key:
|
|
23
|
+
return { key: E, kind: "button" };
|
|
24
24
|
default:
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
25
|
+
if (n.variableType === "p_attribute" || s.startsWith("p_attribute_")) {
|
|
26
|
+
const t = n.value ?? "", o = t.startsWith(_) ? t.slice(_.length) : t;
|
|
27
|
+
if (!o)
|
|
28
28
|
return null;
|
|
29
|
-
const
|
|
29
|
+
const u = t || `${_}${o}`;
|
|
30
30
|
return {
|
|
31
|
-
key: `${
|
|
31
|
+
key: `${x}${u}`,
|
|
32
32
|
kind: "custom",
|
|
33
|
-
customAttrName:
|
|
34
|
-
customAttrValue:
|
|
33
|
+
customAttrName: o,
|
|
34
|
+
customAttrValue: u
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
return
|
|
40
|
+
function I(n) {
|
|
41
|
+
const s = k.indexOf(n);
|
|
42
|
+
return s === -1 ? Number.POSITIVE_INFINITY : s;
|
|
43
|
+
}
|
|
44
|
+
const l = [d, a];
|
|
45
|
+
function S(n, s, t) {
|
|
46
|
+
return n === s || !l.includes(n) || !l.includes(s) ? 0 : n === (t ? a : d) ? -1 : 1;
|
|
43
47
|
}
|
|
44
|
-
function
|
|
48
|
+
function F(n, { oldPriceFirst: s = !1 } = {}) {
|
|
45
49
|
const t = {
|
|
46
50
|
composition: [],
|
|
47
|
-
visibility: { ...
|
|
51
|
+
visibility: { ...f },
|
|
48
52
|
customAttributes: [],
|
|
49
53
|
customAttrValues: {},
|
|
50
54
|
perElementStyles: {},
|
|
51
55
|
anyTextTrimming: !1
|
|
52
56
|
};
|
|
53
|
-
if (!
|
|
54
|
-
return t.composition = [...
|
|
57
|
+
if (!n || n.length === 0)
|
|
58
|
+
return t.composition = [...k], t;
|
|
55
59
|
const o = [];
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
if (
|
|
60
|
-
t.titleVariable = e, t.visibility[
|
|
60
|
+
n.forEach((e, i) => {
|
|
61
|
+
const r = D(e);
|
|
62
|
+
if (r) {
|
|
63
|
+
if (r.kind === "title") {
|
|
64
|
+
t.titleVariable = e, t.visibility[R] = e.hidden !== !0;
|
|
61
65
|
return;
|
|
62
66
|
}
|
|
63
67
|
o.push({
|
|
64
|
-
key:
|
|
65
|
-
kind:
|
|
68
|
+
key: r.key,
|
|
69
|
+
kind: r.kind,
|
|
66
70
|
hidden: e.hidden === !0,
|
|
67
71
|
positionIdx: typeof e.positionIdx == "number" ? e.positionIdx : Number.MAX_SAFE_INTEGER,
|
|
68
72
|
legacy: e,
|
|
69
|
-
customAttrName:
|
|
70
|
-
customAttrValue:
|
|
73
|
+
customAttrName: r.customAttrName,
|
|
74
|
+
customAttrValue: r.customAttrValue,
|
|
71
75
|
originalIndex: i
|
|
72
76
|
});
|
|
73
77
|
}
|
|
74
78
|
}), o.sort((e, i) => {
|
|
75
79
|
if (e.positionIdx !== i.positionIdx)
|
|
76
80
|
return e.positionIdx - i.positionIdx;
|
|
77
|
-
const
|
|
78
|
-
|
|
81
|
+
const r = S(e.key, i.key, s);
|
|
82
|
+
if (r !== 0)
|
|
83
|
+
return r;
|
|
84
|
+
const m = I(e.key), c = I(i.key);
|
|
85
|
+
return m !== c ? m - c : e.originalIndex - i.originalIndex;
|
|
79
86
|
});
|
|
80
|
-
const
|
|
87
|
+
const u = {};
|
|
81
88
|
return o.forEach((e) => {
|
|
82
|
-
const { key: i, kind:
|
|
83
|
-
switch (t.composition.push(i), t.visibility[i] = !
|
|
89
|
+
const { key: i, kind: r, hidden: m, legacy: c, customAttrName: A, customAttrValue: T } = e;
|
|
90
|
+
switch (t.composition.push(i), t.visibility[i] = !m, r === "custom" && A && T && (t.customAttributes.includes(T) || t.customAttributes.push(T), t.customAttrValues[i] = T), r) {
|
|
84
91
|
case "image":
|
|
85
|
-
|
|
92
|
+
u[i] = P(c.theme);
|
|
86
93
|
break;
|
|
87
94
|
case "button":
|
|
88
|
-
|
|
95
|
+
u[i] = N(c.theme);
|
|
89
96
|
break;
|
|
90
97
|
case "text":
|
|
91
98
|
case "custom": {
|
|
92
|
-
const
|
|
93
|
-
|
|
99
|
+
const p = C(c.theme);
|
|
100
|
+
u[i] = p, p.textTrimming && (t.anyTextTrimming = !0);
|
|
94
101
|
break;
|
|
95
102
|
}
|
|
96
103
|
}
|
|
97
|
-
}), t.perElementStyles =
|
|
104
|
+
}), t.perElementStyles = u, t;
|
|
98
105
|
}
|
|
99
106
|
export {
|
|
100
|
-
|
|
107
|
+
F as mapComposition
|
|
101
108
|
};
|