@useinsider/guido 1.0.2-beta.85ea6e2 → 1.0.2-beta.91efff4
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 +32 -2
- package/dist/@types/generic.d.ts +4 -0
- package/dist/components/Guido.vue.d.ts +3 -1
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/Guido.vue2.js +72 -60
- package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +3 -2
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -15
- package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +3 -1
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -9
- package/dist/components/organisms/header/RightSlot.vue.d.ts +3 -1
- package/dist/components/organisms/header/RightSlot.vue.js +5 -3
- package/dist/components/organisms/header/RightSlot.vue2.js +26 -27
- package/dist/components/organisms/header/ViewOptions.vue.js +5 -5
- package/dist/components/organisms/header/ViewOptions.vue2.js +5 -5
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +5 -5
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +5 -5
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +11 -11
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +8 -8
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +25 -20
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +40 -28
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +6 -6
- package/dist/composables/useCustomInterfaceAppearance.js +22 -18
- package/dist/composables/useHtmlCompiler.js +17 -9
- package/dist/composables/useHtmlValidator.d.ts +4 -0
- package/dist/composables/useHtmlValidator.js +139 -0
- package/dist/composables/usePreviewMode.js +14 -15
- package/dist/composables/useRecommendation.d.ts +19 -0
- package/dist/composables/useRecommendation.js +27 -0
- package/dist/composables/useSave.d.ts +4 -0
- package/dist/composables/useSave.js +15 -0
- package/dist/composables/useStripo.js +40 -36
- package/dist/composables/useToaster.js +17 -17
- package/dist/config/compiler/outlookCompilerRules.d.ts +2 -0
- package/dist/config/compiler/outlookCompilerRules.js +36 -0
- package/dist/config/compiler/recommendationCompilerRules.d.ts +2 -0
- package/dist/config/compiler/recommendationCompilerRules.js +83 -0
- package/dist/config/compiler/socialCompilerRules.d.ts +2 -0
- package/dist/config/compiler/socialCompilerRules.js +21 -0
- package/dist/config/compiler/unsubscribeCompilerRules.d.ts +2 -0
- package/dist/config/compiler/unsubscribeCompilerRules.js +64 -0
- package/dist/config/migrator/checkboxMigrator.d.ts +1 -0
- package/dist/config/migrator/checkboxMigrator.js +83 -0
- package/dist/config/migrator/index.d.ts +1 -0
- package/dist/config/migrator/index.js +5 -0
- package/dist/enums/defaults.d.ts +5 -1
- package/dist/enums/defaults.js +14 -10
- package/dist/enums/html-validator.d.ts +6 -0
- package/dist/enums/html-validator.js +7 -0
- package/dist/enums/recommendation.d.ts +54 -0
- package/dist/enums/recommendation.js +56 -0
- package/dist/enums/unsubscribe.d.ts +15 -0
- package/dist/enums/unsubscribe.js +17 -0
- package/dist/extensions/Blocks/Checkbox/block.d.ts +10 -0
- package/dist/extensions/Blocks/Checkbox/block.js +39 -0
- package/dist/extensions/Blocks/Checkbox/control.d.ts +22 -0
- package/dist/extensions/Blocks/Checkbox/control.js +104 -0
- package/dist/extensions/Blocks/Checkbox/extension.d.ts +2 -0
- package/dist/extensions/Blocks/Checkbox/extension.js +20 -0
- package/dist/extensions/Blocks/Checkbox/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +38 -0
- package/dist/extensions/Blocks/Checkbox/template.d.ts +6 -0
- package/dist/extensions/Blocks/Checkbox/template.js +75 -0
- package/dist/extensions/Blocks/CouponBlock/block.d.ts +11 -0
- package/dist/extensions/Blocks/CouponBlock/block.js +42 -0
- package/dist/extensions/Blocks/CouponBlock/extension.d.ts +2 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +19 -0
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +37 -0
- package/dist/extensions/Blocks/CouponBlock/template.d.ts +3 -0
- package/dist/extensions/Blocks/CouponBlock/template.js +13 -0
- package/dist/extensions/Blocks/_Boilerplate/block.d.ts +10 -0
- package/dist/extensions/Blocks/_Boilerplate/control.d.ts +17 -0
- package/dist/extensions/Blocks/_Boilerplate/extension.d.ts +2 -0
- package/dist/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/_Boilerplate/template.d.ts +6 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +41 -27
- package/dist/extensions/DynamicContent/extension.js +18 -6
- package/dist/guido.css +1 -1
- package/dist/icons/coupon.svg +3 -0
- package/dist/mock/api/unsubscribe.d.ts +2 -0
- package/dist/mock/api/validator.d.ts +2 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +72 -48
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +74 -49
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +120 -38
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +12 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +116 -101
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +12 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +22 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +21 -17
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +8 -15
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +30 -29
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +19 -23
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +37 -19
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +2 -15
- package/dist/static/styles/components/alert-message.css.js +32 -2
- package/dist/static/styles/components/button.css.js +32 -2
- package/dist/static/styles/components/notification.css.js +55 -0
- package/dist/static/styles/components/popup.css.js +68 -0
- package/dist/static/styles/components/wide-panel.css.js +5 -1
- package/dist/static/styles/customEditorStyle.css.js +6 -0
- package/dist/static/styles/variables.css.js +10 -0
- package/dist/stores/dynamic-content.d.ts +12 -0
- package/dist/stores/dynamic-content.js +7 -6
- package/dist/stores/onboarding.d.ts +72 -8
- package/dist/stores/preview.js +1 -3
- package/dist/stores/recommendation.d.ts +10 -0
- package/dist/stores/recommendation.js +9 -0
- package/dist/stores/unsubscribe.d.ts +8 -0
- package/dist/stores/unsubscribe.js +9 -0
- package/dist/utils/genericUtil.d.ts +5 -0
- package/dist/utils/genericUtil.js +9 -6
- package/dist/utils/templatePreparation.js +21 -14
- package/package.json +5 -3
- package/dist/_virtual/AddCustomFont.js +0 -4
- package/dist/_virtual/AiAssistantValueType.js +0 -4
- package/dist/_virtual/BackgroundColorBuiltInControl.js +0 -4
- package/dist/_virtual/BackgroundImageBuiltInControl.js +0 -4
- package/dist/_virtual/Block.js +0 -4
- package/dist/_virtual/BlockAttributes.js +0 -4
- package/dist/_virtual/BlockCompositionType.js +0 -4
- package/dist/_virtual/BlockPaddingsBuiltInControl.js +0 -4
- package/dist/_virtual/BlockRenderer.js +0 -4
- package/dist/_virtual/BlockType.js +0 -4
- package/dist/_virtual/BlocksPanel.js +0 -4
- package/dist/_virtual/BuiltInControl.js +0 -4
- package/dist/_virtual/BuiltInControlTypes.js +0 -4
- package/dist/_virtual/ButtonBorderBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonColorBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonFontColorBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonTextBuiltInControl.js +0 -4
- package/dist/_virtual/ContextAction.js +0 -4
- package/dist/_virtual/ContextActionType.js +0 -4
- package/dist/_virtual/Control.js +0 -4
- package/dist/_virtual/EditorStatePropertyType.js +0 -4
- package/dist/_virtual/Extension.js +0 -4
- package/dist/_virtual/ExtensionBuilder.js +0 -4
- package/dist/_virtual/FontFamilyBuiltInControl.js +0 -4
- package/dist/_virtual/LinkColorBuiltInControl.js +0 -4
- package/dist/_virtual/ModificationDescription.js +0 -4
- package/dist/_virtual/PanelPosition.js +0 -4
- package/dist/_virtual/PreviewDeviceMode.js +0 -4
- package/dist/_virtual/SettingsPanelRegistry.js +0 -4
- package/dist/_virtual/SettingsPanelTab.js +0 -4
- package/dist/_virtual/SettingsTab.js +0 -4
- package/dist/_virtual/StructureBorderBuiltInControl.js +0 -4
- package/dist/_virtual/StructurePaddingsBuiltInControl.js +0 -4
- package/dist/_virtual/TextColorBuiltInControl.js +0 -4
- package/dist/_virtual/TextLineSpacingBuiltInControl.js +0 -4
- package/dist/_virtual/TextSizeBuiltInControl.js +0 -4
- package/dist/_virtual/TextStyleBuiltInControl.js +0 -4
- package/dist/_virtual/UIElement.js +0 -4
- package/dist/_virtual/UIElementTagRegistry.js +0 -4
- package/dist/_virtual/UIElementType.js +0 -4
- package/dist/_virtual/UIElementsAttributes.js +0 -4
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index2.js +0 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +0 -18
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +0 -32
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +0 -18
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +0 -8
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +0 -34
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +0 -44
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +0 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +0 -44
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +0 -266
|
@@ -3,10 +3,10 @@ import { useTranslations as m } from "../../../../composables/useTranslations.js
|
|
|
3
3
|
import { useVersionHistoryApi as l } from "../../../../composables/useVersionHistoryApi.js";
|
|
4
4
|
import { useVersionHistoryStore as a } from "../../../../stores/version-history.js";
|
|
5
5
|
import { getTooltipOptions as n } from "../../../../utils/tooltipUtils.js";
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
6
|
+
import { InChips as c, InSegments as u } from "@useinsider/design-system-vue";
|
|
7
|
+
const T = /* @__PURE__ */ p({
|
|
8
8
|
__name: "ViewOptions",
|
|
9
|
-
setup(
|
|
9
|
+
setup(_) {
|
|
10
10
|
const t = a(), { switchToDesktopPreview: e, switchToMobilePreview: i } = l(), o = m(), r = [
|
|
11
11
|
{
|
|
12
12
|
text: "",
|
|
@@ -33,9 +33,9 @@ const h = /* @__PURE__ */ p({
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
e();
|
|
36
|
-
}, InSegments: c };
|
|
36
|
+
}, InSegments: u, InChips: c };
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
T as default
|
|
41
41
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, computed as e, watch as m } from "vue";
|
|
2
2
|
import { useTranslations as g } from "../../../composables/useTranslations.js";
|
|
3
|
-
import { useOnboardingStore as
|
|
4
|
-
import { InOnboard as
|
|
5
|
-
const
|
|
3
|
+
import { useOnboardingStore as u } from "../../../stores/onboarding.js";
|
|
4
|
+
import { InOnboard as b } from "@useinsider/design-system-vue";
|
|
5
|
+
const O = /* @__PURE__ */ p({
|
|
6
6
|
__name: "AMPOnboarding",
|
|
7
|
-
setup(
|
|
8
|
-
const i = g(), o =
|
|
7
|
+
setup(l) {
|
|
8
|
+
const i = g(), o = u(), r = e(() => `${window.innerWidth / 2 - 110}px`), a = e(() => [
|
|
9
9
|
{
|
|
10
10
|
classes: "guido-amp-onboarding",
|
|
11
11
|
left: r.value,
|
|
@@ -17,21 +17,21 @@ const _ = /* @__PURE__ */ m({
|
|
|
17
17
|
backButtonClick: () => {
|
|
18
18
|
},
|
|
19
19
|
nextButtonType: "text",
|
|
20
|
-
nextButtonText: i("
|
|
20
|
+
nextButtonText: i("action-builder.ok"),
|
|
21
21
|
nextButtonClick: () => void o.close("ampOnboarding")
|
|
22
22
|
}
|
|
23
|
-
]),
|
|
23
|
+
]), d = e(() => o.onboardings.ampOnboarding.config.length > 0 && o.onboardings.ampOnboarding.isActive), s = () => {
|
|
24
24
|
var n, t;
|
|
25
25
|
(t = (n = o.getAmpCurrentCard) == null ? void 0 : n.nextButtonClick) == null || t.call(n);
|
|
26
26
|
}, c = () => {
|
|
27
27
|
var n, t;
|
|
28
28
|
(t = (n = o.getAmpCurrentCard) == null ? void 0 : n.backButtonClick) == null || t.call(n);
|
|
29
29
|
};
|
|
30
|
-
return
|
|
30
|
+
return m(() => o.onboardings.ampOnboarding.isActive, (n) => {
|
|
31
31
|
n && o.setConfig("ampOnboarding", a.value);
|
|
32
|
-
}, { immediate: !0 }), { __sfc: !0, trans: i, onboardingStore: o, centerLeft: r, onboardingCardsConfig: a, isVisible:
|
|
32
|
+
}, { immediate: !0 }), { __sfc: !0, trans: i, onboardingStore: o, centerLeft: r, onboardingCardsConfig: a, isVisible: d, handleNext: s, handleBack: c, InOnboard: b };
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
O as default
|
|
37
37
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import c from "./GenericOnboarding.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import g from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var l = function() {
|
|
5
5
|
var r, n, t, i, a, s;
|
|
6
|
-
var o = this,
|
|
7
|
-
return e.isVisible ?
|
|
6
|
+
var o = this, d = o._self._c, e = o._self._setupProxy;
|
|
7
|
+
return e.isVisible ? d(e.InOnboard, { key: "guido__editor-onboard", staticClass: "w-21-s p-a z-11", class: (r = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : r.classes, attrs: { id: "guido__editor-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : n.bottom, "left-position": (t = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : t.left, "pages-config": e.onboardingStore.onboardings.genericOnboarding.config, "pointer-position": (i = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : i.position, "right-position": (a = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : a.right, "top-position": (s = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: e.handleBack, close: function(u) {
|
|
8
8
|
return e.onboardingStore.close("genericOnboarding");
|
|
9
9
|
}, nextButtonClick: e.handleNext } }) : o._e();
|
|
10
10
|
}, p = [], _ = /* @__PURE__ */ g(
|
|
11
|
-
|
|
11
|
+
c,
|
|
12
12
|
l,
|
|
13
13
|
p,
|
|
14
14
|
!1,
|
|
15
15
|
null,
|
|
16
|
-
"
|
|
16
|
+
"d3c52b44"
|
|
17
17
|
);
|
|
18
18
|
const S = _.exports;
|
|
19
19
|
export {
|
|
@@ -6,14 +6,14 @@ import { InOnboard as f } from "@useinsider/design-system-vue";
|
|
|
6
6
|
const S = /* @__PURE__ */ l({
|
|
7
7
|
__name: "GenericOnboarding",
|
|
8
8
|
setup(B) {
|
|
9
|
-
const e = x(), o = k(), r = i(() => `${window.innerWidth / 2 - 160}px`),
|
|
9
|
+
const e = x(), o = k(), r = i(() => `${window.innerWidth / 2 - 160}px`), c = () => {
|
|
10
10
|
const t = document.querySelector("ui-editor");
|
|
11
11
|
t != null && t.shadowRoot && m.forEach((n) => {
|
|
12
12
|
var d;
|
|
13
13
|
const a = (d = t.shadowRoot) == null ? void 0 : d.querySelector(n);
|
|
14
14
|
a && a.classList.add("hover");
|
|
15
15
|
});
|
|
16
|
-
},
|
|
16
|
+
}, s = i(() => [
|
|
17
17
|
{
|
|
18
18
|
classes: "guido-onboarding-blocks",
|
|
19
19
|
left: "90px",
|
|
@@ -27,14 +27,14 @@ const S = /* @__PURE__ */ l({
|
|
|
27
27
|
nextButtonType: "text",
|
|
28
28
|
nextButtonText: e("products.next"),
|
|
29
29
|
nextButtonClick: () => {
|
|
30
|
-
|
|
30
|
+
c(), o.next("genericOnboarding");
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
classes: "guido-onboarding-stripes",
|
|
35
35
|
right: "450px",
|
|
36
|
-
bottom: "
|
|
37
|
-
position: "Right
|
|
36
|
+
bottom: "38px",
|
|
37
|
+
position: "Right Bottom",
|
|
38
38
|
title: e("email-editor.onboarding-stripes-title"),
|
|
39
39
|
description: e("email-editor.onboarding-stripes-description"),
|
|
40
40
|
imageSource: "",
|
|
@@ -61,7 +61,7 @@ const S = /* @__PURE__ */ l({
|
|
|
61
61
|
backButtonText: e("ds-steps.back"),
|
|
62
62
|
backButtonClick: () => o.previous("genericOnboarding"),
|
|
63
63
|
nextButtonType: "text",
|
|
64
|
-
nextButtonText: e("
|
|
64
|
+
nextButtonText: e("action-builder.ok"),
|
|
65
65
|
nextButtonClick: () => {
|
|
66
66
|
o.close("genericOnboarding");
|
|
67
67
|
}
|
|
@@ -74,8 +74,8 @@ const S = /* @__PURE__ */ l({
|
|
|
74
74
|
(n = (t = o.getGenericCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
|
|
75
75
|
};
|
|
76
76
|
return b(() => o.onboardings.genericOnboarding.isActive, (t) => {
|
|
77
|
-
t && o.setConfig("genericOnboarding",
|
|
78
|
-
}, { immediate: !0 }), { __sfc: !0, trans: e, onboardingStore: o, centerLeft: r, addHoverToServiceElements:
|
|
77
|
+
t && o.setConfig("genericOnboarding", s.value);
|
|
78
|
+
}, { immediate: !0 }), { __sfc: !0, trans: e, onboardingStore: o, centerLeft: r, addHoverToServiceElements: c, onboardingCardsConfig: s, isVisible: g, handleNext: p, handleBack: u, InOnboard: f };
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
export {
|
|
@@ -1,36 +1,41 @@
|
|
|
1
|
-
import { defineComponent as g, computed as
|
|
1
|
+
import { defineComponent as g, computed as e, onMounted as b, watch as t } from "vue";
|
|
2
2
|
import { usePartner as O } from "../../../composables/usePartner.js";
|
|
3
3
|
import { useEditorStore as u } from "../../../stores/editor.js";
|
|
4
|
-
import { useOnboardingStore as
|
|
5
|
-
import { usePreviewStore as
|
|
4
|
+
import { useOnboardingStore as v } from "../../../stores/onboarding.js";
|
|
5
|
+
import { usePreviewStore as l } from "../../../stores/preview.js";
|
|
6
6
|
import y from "./AMPOnboarding.vue.js";
|
|
7
7
|
import S from "./GenericOnboarding.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import w from "./NewVersionPopup.vue.js";
|
|
9
|
+
import P from "./TextBlockOnboarding.vue.js";
|
|
10
|
+
import h from "./VersionHistoryOnboarding.vue.js";
|
|
11
11
|
const E = /* @__PURE__ */ g({
|
|
12
12
|
__name: "OnboardingWrapper",
|
|
13
13
|
setup(_) {
|
|
14
|
-
const o =
|
|
15
|
-
{ type: "newVersionPopup", component:
|
|
14
|
+
const o = v(), r = u(), s = l(), { isTestPartner: a } = O(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
|
|
15
|
+
{ type: "newVersionPopup", component: w },
|
|
16
16
|
{ type: "genericOnboarding", component: S },
|
|
17
|
-
{ type: "textBlockOnboarding", component:
|
|
18
|
-
{ type: "versionHistoryOnboarding", component:
|
|
17
|
+
{ type: "textBlockOnboarding", component: P },
|
|
18
|
+
{ type: "versionHistoryOnboarding", component: h },
|
|
19
19
|
{ type: "ampOnboarding", component: y }
|
|
20
|
-
],
|
|
20
|
+
], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), f = e(() => m.filter((n) => c(n.type)));
|
|
21
21
|
return b(async () => {
|
|
22
22
|
await o.fetchUserModalState();
|
|
23
|
-
}),
|
|
24
|
-
() =>
|
|
25
|
-
(
|
|
26
|
-
|
|
23
|
+
}), t(
|
|
24
|
+
() => r.isVersionHistoryOpen,
|
|
25
|
+
(n, i) => {
|
|
26
|
+
n && !i && o.shouldShowOnboarding("versionHistoryOnboarding") && o.start("versionHistoryOnboarding"), !n && i && o.isActive("versionHistoryOnboarding") && o.close("versionHistoryOnboarding");
|
|
27
27
|
}
|
|
28
|
-
),
|
|
29
|
-
() =>
|
|
30
|
-
(
|
|
31
|
-
|
|
28
|
+
), t(
|
|
29
|
+
() => s.emailFormat,
|
|
30
|
+
(n, i) => {
|
|
31
|
+
i !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
|
|
32
32
|
}
|
|
33
|
-
),
|
|
33
|
+
), t(
|
|
34
|
+
() => r.isPreviewModeOpen,
|
|
35
|
+
(n) => {
|
|
36
|
+
!n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
|
|
37
|
+
}
|
|
38
|
+
), { __sfc: !0, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: f };
|
|
34
39
|
}
|
|
35
40
|
});
|
|
36
41
|
export {
|
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { useOnboardingStore as
|
|
4
|
-
import { InOnboard as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as u, computed as a, watch as b } from "vue";
|
|
2
|
+
import { useTranslations as m } from "../../../composables/useTranslations.js";
|
|
3
|
+
import { useOnboardingStore as k } from "../../../stores/onboarding.js";
|
|
4
|
+
import { InOnboard as B } from "@useinsider/design-system-vue";
|
|
5
|
+
const y = /* @__PURE__ */ u({
|
|
6
6
|
__name: "TextBlockOnboarding",
|
|
7
|
-
setup(
|
|
8
|
-
const
|
|
7
|
+
setup(h) {
|
|
8
|
+
const i = m(), o = k(), e = a(() => {
|
|
9
|
+
const n = window.innerHeight - 128, r = Math.max(90, n * 0.15), s = Math.max(490, n * 0.71), d = 200, g = 40;
|
|
10
|
+
return {
|
|
11
|
+
settings: {
|
|
12
|
+
top: `${r}px`,
|
|
13
|
+
position: r + d + g > n ? "Right Bottom" : "Right Top"
|
|
14
|
+
},
|
|
15
|
+
dynamic: {
|
|
16
|
+
top: `${s}px`,
|
|
17
|
+
position: s + d + g > n ? "Right Bottom" : "Right Top"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}), c = a(() => [
|
|
9
21
|
{
|
|
10
22
|
classes: "guido-text-block-onboarding-settings",
|
|
11
23
|
right: "450px",
|
|
12
|
-
top:
|
|
13
|
-
position:
|
|
14
|
-
title:
|
|
15
|
-
description:
|
|
24
|
+
top: e.value.settings.top,
|
|
25
|
+
position: e.value.settings.position,
|
|
26
|
+
title: i("email-editor.onboarding-text-block-title"),
|
|
27
|
+
description: i("email-editor.onboarding-text-block-description"),
|
|
16
28
|
imageSource: "",
|
|
17
29
|
backButtonClick: () => {
|
|
18
30
|
},
|
|
19
31
|
nextButtonType: "text",
|
|
20
|
-
nextButtonText:
|
|
32
|
+
nextButtonText: i("products.next"),
|
|
21
33
|
nextButtonClick: () => {
|
|
22
34
|
o.next("textBlockOnboarding");
|
|
23
35
|
}
|
|
@@ -25,38 +37,38 @@ const C = /* @__PURE__ */ d({
|
|
|
25
37
|
{
|
|
26
38
|
classes: "guido-text-block-onboarding-dynamic",
|
|
27
39
|
right: "450px",
|
|
28
|
-
top:
|
|
29
|
-
position:
|
|
30
|
-
title:
|
|
31
|
-
description:
|
|
40
|
+
top: e.value.dynamic.top,
|
|
41
|
+
position: e.value.dynamic.position,
|
|
42
|
+
title: i("email-editor.onboarding-dynamic-content-title"),
|
|
43
|
+
description: i("email-editor.onboarding-dynamic-content-description"),
|
|
32
44
|
imageSource: "",
|
|
33
45
|
backButtonType: "text",
|
|
34
|
-
backButtonText:
|
|
46
|
+
backButtonText: i("ds-steps.back"),
|
|
35
47
|
backButtonClick: () => {
|
|
36
48
|
o.previous("textBlockOnboarding");
|
|
37
49
|
},
|
|
38
50
|
nextButtonType: "text",
|
|
39
|
-
nextButtonText:
|
|
51
|
+
nextButtonText: i("action-builder.ok"),
|
|
40
52
|
nextButtonClick: () => {
|
|
41
53
|
o.close("textBlockOnboarding");
|
|
42
54
|
}
|
|
43
55
|
}
|
|
44
|
-
]),
|
|
45
|
-
var t,
|
|
46
|
-
(
|
|
47
|
-
},
|
|
48
|
-
var t,
|
|
49
|
-
(
|
|
56
|
+
]), l = a(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), p = () => {
|
|
57
|
+
var t, n;
|
|
58
|
+
(n = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
|
|
59
|
+
}, x = () => {
|
|
60
|
+
var t, n;
|
|
61
|
+
(n = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
|
|
50
62
|
};
|
|
51
|
-
return
|
|
63
|
+
return b(
|
|
52
64
|
() => o.isActive("textBlockOnboarding"),
|
|
53
65
|
(t) => {
|
|
54
|
-
t && o.setConfig("textBlockOnboarding",
|
|
66
|
+
t && o.setConfig("textBlockOnboarding", c.value);
|
|
55
67
|
},
|
|
56
68
|
{ immediate: !0 }
|
|
57
|
-
), { __sfc: !0, trans:
|
|
69
|
+
), { __sfc: !0, trans: i, onboardingStore: o, dynamicPosition: e, onboardingCardsConfig: c, isVisible: l, handleNext: p, handleBack: x, InOnboard: B };
|
|
58
70
|
}
|
|
59
71
|
});
|
|
60
72
|
export {
|
|
61
|
-
|
|
73
|
+
y as default
|
|
62
74
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as c, computed as e, watch as g } from "vue";
|
|
2
2
|
import { useTranslations as b } from "../../../composables/useTranslations.js";
|
|
3
|
-
import { useOnboardingStore as
|
|
4
|
-
import { InOnboard as
|
|
3
|
+
import { useOnboardingStore as u } from "../../../stores/onboarding.js";
|
|
4
|
+
import { InOnboard as l } from "@useinsider/design-system-vue";
|
|
5
5
|
const C = /* @__PURE__ */ c({
|
|
6
6
|
__name: "VersionHistoryOnboarding",
|
|
7
|
-
setup(
|
|
8
|
-
const t = b(), n =
|
|
7
|
+
setup(p) {
|
|
8
|
+
const t = b(), n = u(), r = e(() => [
|
|
9
9
|
{
|
|
10
10
|
classes: "guido-version-history-onboarding",
|
|
11
11
|
left: "409px",
|
|
@@ -17,7 +17,7 @@ const C = /* @__PURE__ */ c({
|
|
|
17
17
|
backButtonClick: () => {
|
|
18
18
|
},
|
|
19
19
|
nextButtonType: "text",
|
|
20
|
-
nextButtonText: t("
|
|
20
|
+
nextButtonText: t("action-builder.ok"),
|
|
21
21
|
nextButtonClick: () => void n.close("versionHistoryOnboarding")
|
|
22
22
|
}
|
|
23
23
|
]), s = e(() => n.onboardings.versionHistoryOnboarding.config.length > 0 && n.onboardings.versionHistoryOnboarding.isActive), a = () => {
|
|
@@ -29,7 +29,7 @@ const C = /* @__PURE__ */ c({
|
|
|
29
29
|
};
|
|
30
30
|
return g(() => n.onboardings.versionHistoryOnboarding.isActive, (o) => {
|
|
31
31
|
o && n.setConfig("versionHistoryOnboarding", r.value);
|
|
32
|
-
}, { immediate: !0 }), { __sfc: !0, trans: t, onboardingStore: n, onboardingCardsConfig: r, isVisible: s, handleNext: a, handleBack: d, InOnboard:
|
|
32
|
+
}, { immediate: !0 }), { __sfc: !0, trans: t, onboardingStore: n, onboardingCardsConfig: r, isVisible: s, handleNext: a, handleBack: d, InOnboard: l };
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
export {
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import S from "../static/styles/base.css.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import m from "../static/styles/components/alert-message.css.js";
|
|
3
|
+
import e from "../static/styles/components/amp-block.css.js";
|
|
4
4
|
import i from "../static/styles/components/base-input.css.js";
|
|
5
5
|
import p from "../static/styles/components/button-group.css.js";
|
|
6
6
|
import n from "../static/styles/components/button.css.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import C from "../static/styles/components/combobox.css.js";
|
|
8
|
+
import s from "../static/styles/components/counter.css.js";
|
|
9
9
|
import f from "../static/styles/components/dropdown-menu.css.js";
|
|
10
10
|
import a from "../static/styles/components/loader.css.js";
|
|
11
11
|
import u from "../static/styles/components/narrow-panel.css.js";
|
|
12
|
-
import c from "../static/styles/components/
|
|
13
|
-
import d from "../static/styles/components/
|
|
14
|
-
import l from "../static/styles/components/
|
|
15
|
-
import h from "../static/styles/components/
|
|
16
|
-
import w from "../static/styles/components/
|
|
17
|
-
import y from "../static/styles/
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
import c from "../static/styles/components/notification.css.js";
|
|
13
|
+
import d from "../static/styles/components/popup.css.js";
|
|
14
|
+
import l from "../static/styles/components/switcher.css.js";
|
|
15
|
+
import h from "../static/styles/components/tabs.css.js";
|
|
16
|
+
import w from "../static/styles/components/tools.css.js";
|
|
17
|
+
import y from "../static/styles/components/version-history.css.js";
|
|
18
|
+
import B from "../static/styles/components/wide-panel.css.js";
|
|
19
|
+
import b from "../static/styles/variables.css.js";
|
|
20
|
+
const A = [
|
|
21
|
+
b,
|
|
20
22
|
// Must be on top
|
|
21
23
|
S,
|
|
22
24
|
// Must be on top
|
|
23
|
-
e,
|
|
24
25
|
m,
|
|
26
|
+
e,
|
|
25
27
|
i,
|
|
26
28
|
p,
|
|
27
29
|
n,
|
|
28
|
-
s,
|
|
29
30
|
C,
|
|
31
|
+
s,
|
|
30
32
|
f,
|
|
31
33
|
a,
|
|
32
34
|
u,
|
|
@@ -34,12 +36,14 @@ const B = [
|
|
|
34
36
|
d,
|
|
35
37
|
l,
|
|
36
38
|
h,
|
|
37
|
-
w
|
|
39
|
+
w,
|
|
40
|
+
y,
|
|
41
|
+
B
|
|
38
42
|
].join(`
|
|
39
43
|
|
|
40
|
-
`),
|
|
44
|
+
`), F = () => ({ importCss: () => {
|
|
41
45
|
const o = new CSSStyleSheet();
|
|
42
|
-
o.replaceSync(
|
|
46
|
+
o.replaceSync(A);
|
|
43
47
|
const r = document.querySelector("ui-editor");
|
|
44
48
|
if (!r)
|
|
45
49
|
return;
|
|
@@ -47,5 +51,5 @@ const B = [
|
|
|
47
51
|
t && (t.adoptedStyleSheets = [o]);
|
|
48
52
|
} });
|
|
49
53
|
export {
|
|
50
|
-
|
|
54
|
+
F as useCustomInterfaceAppearance
|
|
51
55
|
};
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { defaultHtmlCompilerRules as t } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { outlookCompilerRules as p } from "../config/compiler/outlookCompilerRules.js";
|
|
3
|
+
import { recommendationCompilerRules as s } from "../config/compiler/recommendationCompilerRules.js";
|
|
4
|
+
import { socialCompilerRules as u } from "../config/compiler/socialCompilerRules.js";
|
|
5
|
+
import { unsubscribeCompilerRules as n } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
6
|
+
import { createHtmlCompiler as c } from "../utils/htmlCompiler.js";
|
|
7
|
+
import { useConfig as f } from "./useConfig.js";
|
|
8
|
+
const h = () => {
|
|
9
|
+
const { config: e } = f(), l = e.htmlCompilerRules || [], m = [
|
|
10
|
+
...!!e.ignoreDefaultHtmlCompilerRules ? [] : t,
|
|
11
|
+
...s,
|
|
12
|
+
...n,
|
|
13
|
+
...p,
|
|
14
|
+
...u,
|
|
7
15
|
...l.map((o, i) => ({
|
|
8
16
|
...o,
|
|
9
17
|
priority: o.priority + 1e3 + i
|
|
10
18
|
// Ensure additional rules run after default rules
|
|
11
19
|
}))
|
|
12
|
-
],
|
|
13
|
-
return { compileHtml: (o) =>
|
|
20
|
+
], r = c(m);
|
|
21
|
+
return { compileHtml: (o) => r.compile(o) };
|
|
14
22
|
};
|
|
15
23
|
export {
|
|
16
|
-
|
|
24
|
+
h as useHtmlCompiler
|
|
17
25
|
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { useConfig as H } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as V } from "../enums/defaults.js";
|
|
3
|
+
import { DISPLAY_CONDITIONS_REGEX as B, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as _, CampaignCouldNotBeSavedKey as D, CanNotMakeAnyChangesForRunningKey as P } from "../enums/html-validator.js";
|
|
4
|
+
import { ToasterTypeOptions as l } from "../enums/toaster.js";
|
|
5
|
+
import { useRecommendationStore as R } from "../stores/recommendation.js";
|
|
6
|
+
import { base64EncodeWithSpecialChars as $ } from "../utils/base64.js";
|
|
7
|
+
import { useHttp as j } from "./useHttp.js";
|
|
8
|
+
import { useToaster as G } from "./useToaster.js";
|
|
9
|
+
import { useTranslations as X } from "./useTranslations.js";
|
|
10
|
+
const te = () => {
|
|
11
|
+
var d;
|
|
12
|
+
const { showToaster: c } = G(), { post: y } = j(), { config: h } = H(), o = X(), m = R(), u = ((d = h.partner) == null ? void 0 : d.messageType) === V.transactional, C = async (e) => {
|
|
13
|
+
const t = await y(
|
|
14
|
+
"/newsletter/template-library/check-template-html-body",
|
|
15
|
+
{ html: $(e) }
|
|
16
|
+
), { status: n, message: a } = t.data;
|
|
17
|
+
return n || c({
|
|
18
|
+
type: l.Alert,
|
|
19
|
+
message: n === void 0 ? a : o("newsletter.invalid-url-link-for-toaster")
|
|
20
|
+
}), o(D), a === o(P) && c({
|
|
21
|
+
type: l.Alert,
|
|
22
|
+
message: o("newsletter.already-in-progress")
|
|
23
|
+
}), n;
|
|
24
|
+
}, v = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), w = (e) => ["if", "endif"].includes(e.toLowerCase()), S = (e, s) => {
|
|
25
|
+
const t = e.match(/({%(.*?)%})/g);
|
|
26
|
+
let n = !0;
|
|
27
|
+
return t !== null && !u && t.forEach((a) => {
|
|
28
|
+
const i = a.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
29
|
+
if (i && i.length > 0) {
|
|
30
|
+
const [r] = i;
|
|
31
|
+
v(r) && !s.includes(r) && (c({
|
|
32
|
+
type: l.Warning,
|
|
33
|
+
message: o("custom-fields.invalid-custom-fields")
|
|
34
|
+
}), n = !1);
|
|
35
|
+
}
|
|
36
|
+
}), n;
|
|
37
|
+
}, b = async (e, s, t) => {
|
|
38
|
+
const n = t ? await C(e) : !0;
|
|
39
|
+
return S(e, s) && n;
|
|
40
|
+
}, E = (e) => e.length > 0 ? !0 : (c({
|
|
41
|
+
type: l.Warning,
|
|
42
|
+
message: o("newsletter.html-content-is-empty")
|
|
43
|
+
}), !1), A = (e) => {
|
|
44
|
+
const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
|
|
45
|
+
return s > t && c({
|
|
46
|
+
type: l.Warning,
|
|
47
|
+
message: o("custom-fields.missing-closing-braces")
|
|
48
|
+
}), s < t && c({
|
|
49
|
+
type: l.Warning,
|
|
50
|
+
message: o("custom-fields.missing-opening-braces")
|
|
51
|
+
}), s === t;
|
|
52
|
+
}, x = (e) => {
|
|
53
|
+
const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
54
|
+
return s || c({
|
|
55
|
+
type: l.Warning,
|
|
56
|
+
message: o("custom-fields.invalid-custom-fields")
|
|
57
|
+
}), s;
|
|
58
|
+
}, T = (e, s) => {
|
|
59
|
+
const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
60
|
+
if (t && !u) {
|
|
61
|
+
const n = new Set(s.map((i) => i.toLowerCase())), a = [];
|
|
62
|
+
if (t.forEach((i) => {
|
|
63
|
+
const r = i.slice(2, -2).trim().toLowerCase();
|
|
64
|
+
(!n.has(r) || r === "") && a.push(r);
|
|
65
|
+
}), a.length > 0) {
|
|
66
|
+
const i = `
|
|
67
|
+
<ul>
|
|
68
|
+
${a.map((r) => `<li>${r}</li>`).join("")}
|
|
69
|
+
</ul>
|
|
70
|
+
`;
|
|
71
|
+
return c({
|
|
72
|
+
type: l.Alert,
|
|
73
|
+
message: o("custom-fields.invalid-custom-fields") + i
|
|
74
|
+
}), !1;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return !0;
|
|
78
|
+
}, k = (e) => {
|
|
79
|
+
const s = e.match(/{%(.*?)%}/g), t = [];
|
|
80
|
+
let n = !0;
|
|
81
|
+
if (s && s.forEach((a) => {
|
|
82
|
+
const i = a.match(B), r = a.match(_), O = (i == null ? void 0 : i.join("")) || "";
|
|
83
|
+
(!i || a !== O) && !r && (c({
|
|
84
|
+
type: l.Alert,
|
|
85
|
+
message: o("newsletter.display-conditions-invalid-syntax")
|
|
86
|
+
}), n = !1), i && i.forEach((f) => {
|
|
87
|
+
f.trim() === "=" && (c({
|
|
88
|
+
type: l.Alert,
|
|
89
|
+
message: o("custom-conditions.wrong-equality-operators")
|
|
90
|
+
}), n = !1);
|
|
91
|
+
const g = f.match(/^[a-zA-Z]*$/g);
|
|
92
|
+
g && g.forEach((p) => {
|
|
93
|
+
w(p) && t.push(p);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}), t.length) {
|
|
97
|
+
const a = t.filter((r) => r === "if"), i = t.filter((r) => r === "endif");
|
|
98
|
+
a.length !== i.length && (c({
|
|
99
|
+
type: l.Alert,
|
|
100
|
+
message: o("custom-conditions.missing-if-endif-tag")
|
|
101
|
+
}), n = !1);
|
|
102
|
+
}
|
|
103
|
+
return n;
|
|
104
|
+
}, F = (e) => {
|
|
105
|
+
const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
|
|
106
|
+
return n || c({
|
|
107
|
+
type: l.Warning,
|
|
108
|
+
message: o("custom-conditions.no-space-after-braces")
|
|
109
|
+
}), n;
|
|
110
|
+
}, I = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (c({
|
|
111
|
+
type: l.Warning,
|
|
112
|
+
message: o("custom-conditions.no-braces-inside-if-tag")
|
|
113
|
+
}), !1) : !0, W = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (c({
|
|
114
|
+
type: l.Alert,
|
|
115
|
+
message: o("newsletter.fill-all-necessary-fields")
|
|
116
|
+
}), !1) : !0, L = (e) => {
|
|
117
|
+
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
118
|
+
return e.match(s) === null ? !0 : (c({
|
|
119
|
+
type: l.Alert,
|
|
120
|
+
message: o("newsletter.invalid-image-type")
|
|
121
|
+
}), !1);
|
|
122
|
+
}, N = (e) => {
|
|
123
|
+
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
124
|
+
return Array.from(n).find((i) => {
|
|
125
|
+
var r;
|
|
126
|
+
return !((r = i.id) != null && r.trim());
|
|
127
|
+
}) ? (c({
|
|
128
|
+
type: l.Alert,
|
|
129
|
+
message: o("unsubscribe-templates.select-checkbox-groups")
|
|
130
|
+
}), !1) : !0;
|
|
131
|
+
};
|
|
132
|
+
return { validateHtml: async (e, s, t = !1) => {
|
|
133
|
+
const n = s.map((i) => i.value);
|
|
134
|
+
return await b(e, n, t) && E(e) && A(e) && x(e) && T(e, n) && k(e) && F(e) && I(e) && W() && L(e) && N(e);
|
|
135
|
+
} };
|
|
136
|
+
};
|
|
137
|
+
export {
|
|
138
|
+
te as useHtmlValidator
|
|
139
|
+
};
|