@useinsider/guido 3.2.0-beta.e69fb3b → 3.2.0-beta.ecc7c6c
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/@types/config/schemas.js +1 -1
- package/dist/@types/config/validator.js +34 -27
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +81 -76
- package/dist/components/organisms/base/Toaster.vue2.js +11 -10
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +15 -9
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +40 -31
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +20 -19
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +14 -11
- package/dist/components/organisms/header/EditorActions.vue.js +12 -11
- package/dist/components/organisms/header/EditorActions.vue2.js +22 -18
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -12
- package/dist/components/organisms/header/LeftSlot.vue2.js +19 -16
- package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -14
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -14
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +26 -24
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +44 -41
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +38 -36
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +21 -18
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +31 -27
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +32 -30
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +23 -21
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +9 -8
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -9
- package/dist/composables/useActionsApi.js +38 -37
- package/dist/composables/useBlocksConfig.js +26 -26
- package/dist/composables/useFullStoryBridge.js +9 -8
- package/dist/composables/useHtmlCompiler.js +26 -34
- package/dist/composables/useHtmlValidator.js +114 -101
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/useRecommendation.js +15 -14
- package/dist/composables/useRibbonOffset.js +15 -15
- package/dist/composables/useSave.js +23 -19
- package/dist/composables/useStripo.js +48 -53
- package/dist/composables/useSyncModuleExtractor.js +29 -31
- package/dist/composables/useTimerClone.js +25 -24
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useValidation.js +8 -7
- package/dist/composables/validators/useCouponBlockValidator.js +24 -0
- package/dist/composables/validators/useLiquidValidator.js +13 -13
- package/dist/config/compiler/recommendationCompilerRules.js +27 -27
- package/dist/config/compiler/unsubscribeCompilerRules.js +19 -17
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +11 -10
- package/dist/config/migrator/checkboxMigrator.js +21 -20
- package/dist/config/migrator/couponBlockMigrator.js +19 -18
- package/dist/config/migrator/itemsBlockMigrator.js +89 -87
- package/dist/config/migrator/radioButtonMigrator.js +63 -42
- package/dist/config/migrator/recommendationMigrator.js +109 -106
- package/dist/config/migrator/unsubscribeMigrator.js +11 -10
- package/dist/enums/unsubscribe.js +19 -18
- package/dist/extensions/Blocks/Items/block.js +9 -9
- package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +97 -89
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +24 -23
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +14 -13
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +47 -44
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +40 -38
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +162 -155
- package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
- package/dist/extensions/Blocks/Items/template.js +210 -210
- package/dist/extensions/Blocks/RadioButton/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +133 -128
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +18 -17
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +6 -4
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -82
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +36 -35
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +135 -134
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +32 -32
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +20 -18
- package/dist/extensions/Blocks/Recommendation/extension.js +32 -31
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +16 -8
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +64 -54
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +23 -22
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -24
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +47 -45
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +16 -13
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
- package/dist/extensions/Blocks/Unsubscribe/control.js +13 -11
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +18 -16
- package/dist/extensions/Blocks/common-control.js +26 -25
- package/dist/extensions/DynamicContent/dynamic-content.js +58 -53
- package/dist/guido.css +1 -1
- package/dist/library.js +12 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +234 -233
- package/dist/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/lodash-es/_SetCache.js +13 -0
- package/dist/node_modules/lodash-es/_Stack.js +18 -0
- package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +20 -0
- package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
- package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
- package/dist/node_modules/lodash-es/_arraySome.js +9 -0
- package/dist/node_modules/lodash-es/_baseEach.js +6 -0
- package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
- package/dist/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
- package/dist/node_modules/lodash-es/_baseGet.js +11 -0
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
- package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
- package/dist/node_modules/lodash-es/_baseMap.js +11 -0
- package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/dist/node_modules/lodash-es/_baseRange.js +9 -0
- package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
- package/dist/node_modules/lodash-es/_baseToString.js +18 -0
- package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
- package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/dist/node_modules/lodash-es/_createRange.js +11 -0
- package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
- package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
- package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
- package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
- package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/lodash-es/_getTag.js +28 -0
- package/dist/node_modules/lodash-es/_getValue.js +1 -1
- package/dist/node_modules/lodash-es/_hasPath.js +19 -0
- package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
- package/dist/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/dist/node_modules/lodash-es/_isKey.js +12 -0
- package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/lodash-es/_stackSet.js +17 -0
- package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
- package/dist/node_modules/lodash-es/flatMap.js +8 -0
- package/dist/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/lodash-es/hasIn.js +8 -0
- package/dist/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/lodash-es/map.js +11 -0
- package/dist/node_modules/lodash-es/property.js +10 -0
- package/dist/node_modules/lodash-es/range.js +5 -0
- package/dist/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/lodash-es/toFinite.js +14 -0
- package/dist/node_modules/lodash-es/toNumber.js +22 -0
- package/dist/node_modules/lodash-es/toString.js +7 -0
- package/dist/node_modules/valibot/dist/index.js +126 -122
- package/dist/services/recommendationApi.js +17 -14
- package/dist/services/templateLibraryApi.js +40 -38
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useHtmlCompiler.d.ts +2 -1
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/stores/config.js +81 -25
- package/dist/stores/dynamic-content.js +11 -6
- package/dist/stores/onboarding.js +1 -1
- package/dist/stores/preview.js +9 -6
- package/dist/stores/unsubscribe.js +4 -1
- package/dist/utils/dateUtil.js +10 -7
- package/dist/utils/genericUtil.js +13 -10
- package/dist/utils/pairProductVariables.js +89 -87
- package/package.json +1 -6
- package/dist/enums/displayConditions.js +0 -80
- package/dist/src/enums/displayConditions.d.ts +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useToaster as w } from "./useToaster.js";
|
|
2
2
|
const v = () => {
|
|
3
|
-
const { handleError:
|
|
4
|
-
const
|
|
3
|
+
const { handleError: n } = w(), m = (t = {}) => new Promise((e, a) => {
|
|
4
|
+
const o = { ...{
|
|
5
5
|
minimize: !0,
|
|
6
6
|
utmEntity: {
|
|
7
7
|
utmSource: "",
|
|
@@ -20,51 +20,51 @@ const v = () => {
|
|
|
20
20
|
forceAmp: !1,
|
|
21
21
|
resetDataSavedFlag: !1,
|
|
22
22
|
disableLineHeightsReplace: !0
|
|
23
|
-
}, ...
|
|
23
|
+
}, ...t }, s = {
|
|
24
24
|
callback: (l, r, d, c, u) => {
|
|
25
|
-
l ?
|
|
25
|
+
l ? a(l) : e({
|
|
26
26
|
html: r,
|
|
27
27
|
ampHtml: d,
|
|
28
28
|
ampErrors: c,
|
|
29
29
|
displayConditions: u
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
|
-
...
|
|
32
|
+
...o
|
|
33
33
|
};
|
|
34
34
|
window.StripoEditorApi.actionsApi.compileEmail(s);
|
|
35
35
|
});
|
|
36
36
|
return {
|
|
37
37
|
getCompiledEmail: m,
|
|
38
|
-
getTemplateData: () => new Promise((
|
|
39
|
-
const
|
|
40
|
-
html:
|
|
41
|
-
css:
|
|
42
|
-
width:
|
|
38
|
+
getTemplateData: () => new Promise((t) => {
|
|
39
|
+
const e = ({ html: a, css: i, width: o, height: p, utmParams: s, syncModulesIds: l }) => t({
|
|
40
|
+
html: a,
|
|
41
|
+
css: i,
|
|
42
|
+
width: o,
|
|
43
43
|
height: p,
|
|
44
44
|
utmParams: s,
|
|
45
45
|
syncModulesIds: l
|
|
46
46
|
});
|
|
47
|
-
window.StripoEditorApi.actionsApi.getTemplateData(
|
|
47
|
+
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
48
48
|
}),
|
|
49
|
-
activateCustomViewStyles: (
|
|
50
|
-
window.StripoEditorApi.actionsApi.activateCustomViewStyles(
|
|
49
|
+
activateCustomViewStyles: (t = !0) => {
|
|
50
|
+
window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
|
|
51
51
|
},
|
|
52
|
-
getPreviewData: async (
|
|
52
|
+
getPreviewData: async (t) => {
|
|
53
53
|
try {
|
|
54
54
|
const {
|
|
55
|
-
html:
|
|
56
|
-
displayConditions:
|
|
57
|
-
ampHtml:
|
|
58
|
-
ampErrors:
|
|
59
|
-
} = await m({ minimize: !1, resetDataSavedFlag: !1, ...
|
|
55
|
+
html: e,
|
|
56
|
+
displayConditions: a,
|
|
57
|
+
ampHtml: i = "",
|
|
58
|
+
ampErrors: o = []
|
|
59
|
+
} = await m({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
60
60
|
return {
|
|
61
|
-
html:
|
|
62
|
-
ampHtml:
|
|
63
|
-
ampErrors:
|
|
64
|
-
displayConditions:
|
|
61
|
+
html: e,
|
|
62
|
+
ampHtml: i,
|
|
63
|
+
ampErrors: o,
|
|
64
|
+
displayConditions: a
|
|
65
65
|
};
|
|
66
|
-
} catch (
|
|
67
|
-
return
|
|
66
|
+
} catch (e) {
|
|
67
|
+
return n(e, "Error loading preview"), {
|
|
68
68
|
html: "",
|
|
69
69
|
ampHtml: "",
|
|
70
70
|
ampErrors: [],
|
|
@@ -72,25 +72,26 @@ const v = () => {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
updateTimerInClonedTemplate: () => new Promise((
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
updateTimerInClonedTemplate: () => new Promise((t) => {
|
|
76
|
+
var e, a;
|
|
77
|
+
if (typeof ((a = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : a.updateTimerInClonedTemplate) != "function") {
|
|
78
|
+
t(null);
|
|
78
79
|
return;
|
|
79
80
|
}
|
|
80
81
|
try {
|
|
81
|
-
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((
|
|
82
|
-
|
|
82
|
+
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
|
|
83
|
+
i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
|
|
83
84
|
});
|
|
84
|
-
} catch (
|
|
85
|
-
|
|
85
|
+
} catch (i) {
|
|
86
|
+
n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
|
|
86
87
|
}
|
|
87
88
|
}),
|
|
88
|
-
updateHtmlAndCss: (
|
|
89
|
-
window.StripoEditorApi.actionsApi.updateHtmlAndCss(
|
|
89
|
+
updateHtmlAndCss: (t, e) => {
|
|
90
|
+
window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
|
|
90
91
|
},
|
|
91
|
-
editorSave: () => new Promise((
|
|
92
|
-
window.StripoEditorApi.actionsApi.save((
|
|
93
|
-
|
|
92
|
+
editorSave: () => new Promise((t) => {
|
|
93
|
+
window.StripoEditorApi.actionsApi.save((e) => {
|
|
94
|
+
e && n(e, "Failed to save template"), t();
|
|
94
95
|
});
|
|
95
96
|
})
|
|
96
97
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useConfigStore as
|
|
3
|
-
const
|
|
1
|
+
import r from "../extensions/ModulesTabIcons/extension.js";
|
|
2
|
+
import { useConfigStore as l } from "../stores/config.js";
|
|
3
|
+
const a = {
|
|
4
4
|
"amp-accordion": "ampAccordionEnabled",
|
|
5
5
|
"amp-carousel": "ampCarouselEnabled",
|
|
6
6
|
"amp-form-controls": "ampFormControlsEnabled",
|
|
@@ -14,7 +14,7 @@ const s = {
|
|
|
14
14
|
"text-block": "textEnabled",
|
|
15
15
|
"timer-block": "timerEnabled",
|
|
16
16
|
"video-block": "videoEnabled"
|
|
17
|
-
},
|
|
17
|
+
}, s = {
|
|
18
18
|
"dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
|
|
19
19
|
"checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
|
|
20
20
|
"radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
|
|
@@ -22,40 +22,40 @@ const s = {
|
|
|
22
22
|
"unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
|
|
23
23
|
"coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
|
|
24
24
|
"items-block": () => import("../extensions/Blocks/Items/extension.js")
|
|
25
|
-
}, i = (
|
|
26
|
-
if (!
|
|
25
|
+
}, i = (n) => {
|
|
26
|
+
if (!n || !n.length)
|
|
27
27
|
return {};
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
const e =
|
|
31
|
-
e && (
|
|
32
|
-
}),
|
|
33
|
-
}, b = () => [
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
return
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const c =
|
|
28
|
+
const t = {};
|
|
29
|
+
return n.forEach((o) => {
|
|
30
|
+
const e = a[o];
|
|
31
|
+
e && (t[e] = !1);
|
|
32
|
+
}), t;
|
|
33
|
+
}, b = () => [r], m = async (n) => {
|
|
34
|
+
const t = b();
|
|
35
|
+
if (!n || !n.length)
|
|
36
|
+
return t;
|
|
37
|
+
const o = await Promise.all(
|
|
38
|
+
n.map(async (e) => {
|
|
39
|
+
const c = s[e];
|
|
40
40
|
return c ? (await c()).default : null;
|
|
41
41
|
})
|
|
42
42
|
);
|
|
43
43
|
return [
|
|
44
|
-
...
|
|
45
|
-
...
|
|
44
|
+
...t,
|
|
45
|
+
...o.filter((e) => e !== null)
|
|
46
46
|
];
|
|
47
|
-
},
|
|
48
|
-
const
|
|
47
|
+
}, E = () => {
|
|
48
|
+
const n = l();
|
|
49
49
|
return {
|
|
50
50
|
getStripoBlocksConfig: async () => {
|
|
51
|
-
const
|
|
51
|
+
const o = n.blocks;
|
|
52
52
|
return {
|
|
53
|
-
baseBlocks: i(
|
|
54
|
-
extensions: await m(
|
|
53
|
+
baseBlocks: i(o == null ? void 0 : o.excludeDefaults),
|
|
54
|
+
extensions: await m(o == null ? void 0 : o.includeCustoms)
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
E as useBlocksConfig
|
|
61
61
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const c = "https://email-static.useinsider.com/guido/guido-fs.js", u = () => ({ injectFullStory: () => {
|
|
2
|
+
var n;
|
|
3
|
+
const s = window;
|
|
4
|
+
if (typeof s._fs_org != "string" || !s._fs_org)
|
|
4
5
|
return;
|
|
5
|
-
const r = document.querySelector("ui-editor")
|
|
6
|
-
if (!
|
|
6
|
+
const r = document.querySelector("ui-editor"), o = (n = r == null ? void 0 : r.shadowRoot) == null ? void 0 : n.querySelector("iframe"), e = o == null ? void 0 : o.contentDocument;
|
|
7
|
+
if (!e || e.querySelector('script[data-fullstory-bridge="true"]'))
|
|
7
8
|
return;
|
|
8
|
-
const t =
|
|
9
|
-
t.src =
|
|
9
|
+
const t = e.createElement("script");
|
|
10
|
+
t.src = c, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", e.head.appendChild(t);
|
|
10
11
|
} });
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
u as useFullStoryBridge
|
|
13
14
|
};
|
|
@@ -1,38 +1,30 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import { liquidCompilerRules as
|
|
4
|
-
import { outlookCompilerRules as
|
|
1
|
+
import { defaultHtmlCompilerRules as c } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { itemsCompilerRules as f } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { liquidCompilerRules as R } from "../config/compiler/liquidCompilerRules.js";
|
|
4
|
+
import { outlookCompilerRules as C } from "../config/compiler/outlookCompilerRules.js";
|
|
5
5
|
import { recommendationCompilerRules as d } from "../config/compiler/recommendationCompilerRules.js";
|
|
6
|
-
import { socialCompilerRules as
|
|
7
|
-
import { unsubscribeCompilerRules as
|
|
8
|
-
import { createHtmlCompiler as
|
|
9
|
-
import { useConfig as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const { compiler:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
...
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
...(e.customRules ?? []).map((r, s) => ({
|
|
28
|
-
...r,
|
|
29
|
-
priority: r.priority + 1e3 + s
|
|
30
|
-
}))
|
|
31
|
-
];
|
|
32
|
-
i = C(t), u = e.fallbackFont, o = e;
|
|
33
|
-
}
|
|
34
|
-
return { compileHtml: (t) => i.compile(t, void 0, u) };
|
|
6
|
+
import { socialCompilerRules as b } from "../config/compiler/socialCompilerRules.js";
|
|
7
|
+
import { unsubscribeCompilerRules as g } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
8
|
+
import { createHtmlCompiler as H } from "../utils/htmlCompiler.js";
|
|
9
|
+
import { useConfig as v } from "./useConfig.js";
|
|
10
|
+
const w = () => {
|
|
11
|
+
var l, m, r;
|
|
12
|
+
const { compiler: e, isFeatureEnabled: t, partner: i } = v(), s = ((l = e.value) == null ? void 0 : l.customRules) || [], u = [
|
|
13
|
+
...!!((m = e.value) != null && m.ignoreDefaultRules) ? [] : c,
|
|
14
|
+
...d,
|
|
15
|
+
...g,
|
|
16
|
+
...f,
|
|
17
|
+
...C,
|
|
18
|
+
...b,
|
|
19
|
+
...t("liquidSyntax") ? R : [],
|
|
20
|
+
...s.map((o, a) => ({
|
|
21
|
+
...o,
|
|
22
|
+
priority: o.priority + 1e3 + a
|
|
23
|
+
// Ensure additional rules run after default rules
|
|
24
|
+
}))
|
|
25
|
+
], p = H(u), n = (r = i.value) == null ? void 0 : r.fallbackFont;
|
|
26
|
+
return { compileHtml: (o) => p.compile(o, void 0, n) };
|
|
35
27
|
};
|
|
36
28
|
export {
|
|
37
|
-
|
|
29
|
+
w as useHtmlCompiler
|
|
38
30
|
};
|
|
@@ -1,153 +1,166 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import { DISPLAY_CONDITIONS_REGEX as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import { itemsBlockDynamicVariables as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { useConfig as _ } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as H } from "../enums/defaults.js";
|
|
3
|
+
import { DISPLAY_CONDITIONS_REGEX as P, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as G, CampaignCouldNotBeSavedKey as M, CanNotMakeAnyChangesForRunningKey as $ } from "../enums/html-validator.js";
|
|
4
|
+
import { ToasterTypeOptions as c } from "../enums/toaster.js";
|
|
5
|
+
import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
6
|
+
import { useRecommendationExtensionStore as X } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
7
|
+
import { RecommendationRequiredFieldsKey as j } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
|
|
8
|
+
import { useRecommendationStore as K } from "../stores/recommendation.js";
|
|
9
|
+
import { base64EncodeWithSpecialChars as z } from "../utils/base64.js";
|
|
10
|
+
import { useHttp as U } from "./useHttp.js";
|
|
11
|
+
import { useToaster as Y } from "./useToaster.js";
|
|
12
|
+
import { useTranslations as Z } from "./useTranslations.js";
|
|
13
|
+
const J = /recommendation-id="(\d+)"/g;
|
|
14
|
+
function Q(a) {
|
|
15
|
+
return [...a.matchAll(J)].map((u) => u[1]);
|
|
14
16
|
}
|
|
15
|
-
function
|
|
16
|
-
return u.some((d) =>
|
|
17
|
+
function ee(a, u) {
|
|
18
|
+
return u.some((d) => a.startsWith(`${d}_`));
|
|
17
19
|
}
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
+
const ge = () => {
|
|
21
|
+
var y, h;
|
|
22
|
+
const { showToaster: a } = Y(), { post: u } = U(), { config: d } = _(), r = Z(), g = K(), S = X(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === H.transactional, b = async (e) => {
|
|
20
23
|
const t = await u(
|
|
21
24
|
"/newsletter/template-library/check-template-html-body",
|
|
22
|
-
{ html:
|
|
23
|
-
), { status: n, message:
|
|
24
|
-
return n ||
|
|
25
|
-
type:
|
|
26
|
-
message: n === void 0 ?
|
|
27
|
-
}),
|
|
28
|
-
type:
|
|
29
|
-
message:
|
|
25
|
+
{ html: z(e) }
|
|
26
|
+
), { status: n, message: l } = t.data;
|
|
27
|
+
return n || a({
|
|
28
|
+
type: c.Alert,
|
|
29
|
+
message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
|
|
30
|
+
}), r(M), l === r($) && a({
|
|
31
|
+
type: c.Alert,
|
|
32
|
+
message: r("newsletter.already-in-progress")
|
|
30
33
|
}), n;
|
|
31
|
-
},
|
|
34
|
+
}, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), A = (e, s) => {
|
|
32
35
|
const t = e.match(/({%(.*?)%})/g);
|
|
33
36
|
let n = !0;
|
|
34
|
-
return t !== null && !p && t.forEach((
|
|
35
|
-
const o =
|
|
37
|
+
return t !== null && !p && t.forEach((l) => {
|
|
38
|
+
const o = l.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
36
39
|
if (o && o.length > 0) {
|
|
37
|
-
const [
|
|
38
|
-
|
|
39
|
-
type:
|
|
40
|
-
message:
|
|
40
|
+
const [i] = o;
|
|
41
|
+
w(i) && !s.includes(i) && (a({
|
|
42
|
+
type: c.Warning,
|
|
43
|
+
message: r("custom-fields.invalid-custom-fields")
|
|
41
44
|
}), n = !1);
|
|
42
45
|
}
|
|
43
46
|
}), n;
|
|
44
|
-
},
|
|
45
|
-
const n = t ? await
|
|
46
|
-
return
|
|
47
|
-
},
|
|
48
|
-
type:
|
|
49
|
-
message:
|
|
50
|
-
}), !1),
|
|
47
|
+
}, k = async (e, s, t) => {
|
|
48
|
+
const n = t ? await b(e) : !0;
|
|
49
|
+
return A(e, s) && n;
|
|
50
|
+
}, x = (e) => e.length > 0 ? !0 : (a({
|
|
51
|
+
type: c.Warning,
|
|
52
|
+
message: r("newsletter.html-content-is-empty")
|
|
53
|
+
}), !1), I = (e) => {
|
|
51
54
|
const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
|
|
52
|
-
return s > t &&
|
|
53
|
-
type:
|
|
54
|
-
message:
|
|
55
|
-
}), s < t &&
|
|
56
|
-
type:
|
|
57
|
-
message:
|
|
55
|
+
return s > t && a({
|
|
56
|
+
type: c.Warning,
|
|
57
|
+
message: r("custom-fields.missing-closing-braces")
|
|
58
|
+
}), s < t && a({
|
|
59
|
+
type: c.Warning,
|
|
60
|
+
message: r("custom-fields.missing-opening-braces")
|
|
58
61
|
}), s === t;
|
|
59
|
-
},
|
|
62
|
+
}, F = (e) => {
|
|
60
63
|
const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
61
|
-
return s ||
|
|
62
|
-
type:
|
|
63
|
-
message:
|
|
64
|
+
return s || a({
|
|
65
|
+
type: c.Warning,
|
|
66
|
+
message: r("custom-fields.invalid-custom-fields")
|
|
64
67
|
}), s;
|
|
65
|
-
},
|
|
68
|
+
}, T = (e, s) => {
|
|
66
69
|
const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
67
70
|
if (t && !p) {
|
|
68
|
-
const n = new Set(s.map((
|
|
69
|
-
if (t.forEach((
|
|
70
|
-
const m =
|
|
71
|
-
(!n.has(m) || m === "") && !
|
|
71
|
+
const n = new Set(s.map((i) => i.toLowerCase())), l = Q(e), o = [];
|
|
72
|
+
if (t.forEach((i) => {
|
|
73
|
+
const m = i.slice(2, -2).trim().toLowerCase();
|
|
74
|
+
(!n.has(m) || m === "") && !ee(m, l) && o.push(m);
|
|
72
75
|
}), o.length > 0) {
|
|
73
|
-
const
|
|
76
|
+
const i = `
|
|
74
77
|
<ul>
|
|
75
78
|
${o.map((m) => `<li>${m}</li>`).join("")}
|
|
76
79
|
</ul>
|
|
77
80
|
`;
|
|
78
|
-
return
|
|
79
|
-
type:
|
|
80
|
-
message:
|
|
81
|
+
return a({
|
|
82
|
+
type: c.Alert,
|
|
83
|
+
message: r("custom-fields.invalid-custom-fields") + i
|
|
81
84
|
}), !1;
|
|
82
85
|
}
|
|
83
86
|
}
|
|
84
87
|
return !0;
|
|
85
|
-
},
|
|
88
|
+
}, R = (e) => {
|
|
86
89
|
const s = e.match(/{%(.*?)%}/g), t = [];
|
|
87
90
|
let n = !0;
|
|
88
|
-
if (s && s.forEach((
|
|
89
|
-
const o =
|
|
90
|
-
(!o ||
|
|
91
|
-
type:
|
|
92
|
-
message:
|
|
91
|
+
if (s && s.forEach((l) => {
|
|
92
|
+
const o = l.match(P), i = l.match(G), m = (o == null ? void 0 : o.join("")) || "";
|
|
93
|
+
(!o || l !== m) && !i && (a({
|
|
94
|
+
type: c.Alert,
|
|
95
|
+
message: r("newsletter.display-conditions-invalid-syntax")
|
|
93
96
|
}), n = !1), o && o.forEach((f) => {
|
|
94
|
-
f.trim() === "=" && (
|
|
95
|
-
type:
|
|
96
|
-
message:
|
|
97
|
+
f.trim() === "=" && (a({
|
|
98
|
+
type: c.Alert,
|
|
99
|
+
message: r("custom-conditions.wrong-equality-operators")
|
|
97
100
|
}), n = !1);
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
const v = f.match(/^[a-zA-Z]*$/g);
|
|
102
|
+
v && v.forEach((C) => {
|
|
103
|
+
E(C) && t.push(C);
|
|
101
104
|
});
|
|
102
105
|
});
|
|
103
106
|
}), t.length) {
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
type:
|
|
107
|
-
message:
|
|
107
|
+
const l = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
|
|
108
|
+
l.length !== o.length && (a({
|
|
109
|
+
type: c.Alert,
|
|
110
|
+
message: r("custom-conditions.missing-if-endif-tag")
|
|
108
111
|
}), n = !1);
|
|
109
112
|
}
|
|
110
113
|
return n;
|
|
111
|
-
},
|
|
114
|
+
}, B = (e) => {
|
|
112
115
|
const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
|
|
113
|
-
return n ||
|
|
114
|
-
type:
|
|
115
|
-
message:
|
|
116
|
+
return n || a({
|
|
117
|
+
type: c.Warning,
|
|
118
|
+
message: r("custom-conditions.no-space-after-braces")
|
|
116
119
|
}), n;
|
|
117
|
-
},
|
|
118
|
-
type:
|
|
119
|
-
message:
|
|
120
|
-
}), !1) : !0,
|
|
121
|
-
type:
|
|
122
|
-
message:
|
|
123
|
-
}), !1) : !0,
|
|
120
|
+
}, W = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
|
|
121
|
+
type: c.Warning,
|
|
122
|
+
message: r("custom-conditions.no-braces-inside-if-tag")
|
|
123
|
+
}), !1) : !0, N = () => S.hasInvalidBlock() ? (a({
|
|
124
|
+
type: c.Alert,
|
|
125
|
+
message: r(j)
|
|
126
|
+
}), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
|
|
127
|
+
type: c.Alert,
|
|
128
|
+
message: r("newsletter.fill-all-necessary-fields")
|
|
129
|
+
}), !1) : !0, D = (e) => {
|
|
124
130
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
125
|
-
return e.match(s) === null ? !0 : (
|
|
126
|
-
type:
|
|
127
|
-
message:
|
|
131
|
+
return e.match(s) === null ? !0 : (a({
|
|
132
|
+
type: c.Alert,
|
|
133
|
+
message: r("newsletter.invalid-image-type")
|
|
128
134
|
}), !1);
|
|
129
|
-
},
|
|
135
|
+
}, L = (e) => {
|
|
130
136
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
131
|
-
return Array.from(n).find((o) =>
|
|
132
|
-
|
|
133
|
-
|
|
137
|
+
return Array.from(n).find((o) => {
|
|
138
|
+
var i;
|
|
139
|
+
return !((i = o.id) != null && i.trim());
|
|
140
|
+
}) ? (a({
|
|
141
|
+
type: c.Alert,
|
|
142
|
+
message: r("unsubscribe-templates.select-checkbox-groups")
|
|
134
143
|
}), !1) : !0;
|
|
135
|
-
},
|
|
144
|
+
}, V = (e) => {
|
|
136
145
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
137
|
-
return Array.from(n).find((o) =>
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
return Array.from(n).find((o) => {
|
|
147
|
+
var i;
|
|
148
|
+
return !((i = o.id) != null && i.trim());
|
|
149
|
+
}) ? (a({
|
|
150
|
+
type: c.Alert,
|
|
151
|
+
message: r("unsubscribe-templates.select-radio-button-groups")
|
|
140
152
|
}), !1) : !0;
|
|
141
153
|
};
|
|
142
154
|
return { validateHtml: async (e, s, t = !1) => {
|
|
155
|
+
var o, i;
|
|
143
156
|
const n = [
|
|
144
|
-
...s.map((
|
|
145
|
-
...
|
|
146
|
-
...d.value
|
|
157
|
+
...s.map((m) => m.value),
|
|
158
|
+
...q,
|
|
159
|
+
...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
|
|
147
160
|
];
|
|
148
|
-
return await
|
|
161
|
+
return await k(e, n, t) && x(e) && I(e) && F(e) && T(e, n) && R(e) && B(e) && W(e) && N() && O() && D(e) && L(e) && V(e);
|
|
149
162
|
} };
|
|
150
163
|
};
|
|
151
164
|
export {
|
|
152
|
-
|
|
165
|
+
ge as useHtmlValidator
|
|
153
166
|
};
|