@useinsider/guido 1.0.3-beta.40a19f6 → 1.0.3-beta.413aef4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Guido.vue.js +7 -7
- package/dist/components/Guido.vue2.js +74 -68
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +28 -0
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +38 -0
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +37 -0
- package/dist/components/organisms/extensions/recommendation/Filters.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +44 -0
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +27 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +16 -0
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +24 -0
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +64 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +107 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +12 -0
- package/dist/components/wrappers/WpDrawer.vue.js +6 -4
- package/dist/composables/useStripo.js +42 -33
- package/dist/config/compiler/unsubscribeCompilerRules.js +42 -29
- package/dist/config/migrator/couponBlockMigrator.js +32 -32
- package/dist/config/migrator/index.js +7 -6
- package/dist/config/migrator/unsubscribeMigrator.js +124 -0
- package/dist/enums/defaults.js +6 -3
- package/dist/enums/extensions/recommendationBlock.js +80 -0
- package/dist/enums/unsubscribe.js +43 -6
- package/dist/extensions/Blocks/Checkbox/block.js +15 -24
- package/dist/extensions/Blocks/Checkbox/control.js +55 -67
- package/dist/extensions/Blocks/Checkbox/extension.js +5 -16
- package/dist/extensions/Blocks/Checkbox/iconsRegistry.js +18 -0
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +12 -25
- package/dist/extensions/Blocks/Checkbox/template.js +5 -16
- package/dist/extensions/Blocks/CouponBlock/block.js +14 -24
- package/dist/extensions/Blocks/CouponBlock/extension.js +5 -16
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +16 -29
- package/dist/extensions/Blocks/CouponBlock/template.js +6 -8
- package/dist/extensions/Blocks/RadioButton/block.js +13 -22
- package/dist/extensions/Blocks/RadioButton/control.js +40 -52
- package/dist/extensions/Blocks/RadioButton/extension.js +4 -15
- package/dist/extensions/Blocks/RadioButton/iconsRegistry.js +14 -0
- package/dist/extensions/Blocks/RadioButton/settingsPanel.js +13 -26
- package/dist/extensions/Blocks/RadioButton/template.js +13 -24
- package/dist/extensions/Blocks/Recommendation/block.js +27 -0
- package/dist/extensions/Blocks/Recommendation/control.js +277 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +10 -0
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +51 -0
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +19 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +32 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +266 -0
- package/dist/extensions/Blocks/Recommendation/template.js +200 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +28 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +131 -0
- package/dist/extensions/Blocks/Unsubscribe/control.js +167 -0
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +42 -0
- package/dist/extensions/Blocks/Unsubscribe/extension.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +35 -0
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +42 -0
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +10 -0
- package/dist/extensions/Blocks/Unsubscribe/template.js +22 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +6 -0
- package/dist/extensions/Blocks/common-control.js +102 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +31 -45
- package/dist/extensions/DynamicContent/extension.js +6 -18
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +659 -0
- package/dist/package.json.js +7 -0
- package/dist/services/recommendationApi.js +43 -0
- package/dist/services/unsubscribeApi.js +16 -0
- package/dist/{@types → src/@types}/generic.d.ts +13 -0
- package/dist/{components → src/components}/Guido.vue.d.ts +2 -2
- package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +19 -0
- package/dist/src/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +16 -0
- package/dist/src/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +2 -0
- package/dist/src/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +2 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +2 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -0
- package/dist/{components → src/components}/wrappers/WpDrawer.vue.d.ts +6 -4
- package/dist/src/config/migrator/index.d.ts +1 -0
- package/dist/src/config/migrator/unsubscribeMigrator.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +16 -0
- package/dist/src/enums/unsubscribe.d.ts +38 -0
- package/dist/{extensions → src/extensions}/Blocks/Checkbox/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Checkbox/iconsRegistry.d.ts +4 -0
- package/dist/{extensions → src/extensions}/Blocks/CouponBlock/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/CouponBlock/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +3 -0
- package/dist/{extensions → src/extensions}/Blocks/RadioButton/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/RadioButton/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +555 -0
- package/dist/src/extensions/Blocks/Recommendation/template.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +7 -0
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +32 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
- package/dist/src/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
- package/dist/src/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Unsubscribe/template.d.ts +12 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -0
- package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/_Boilerplate/extension.d.ts +2 -0
- package/dist/src/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +66 -0
- package/dist/src/extensions/DynamicContent/extension.d.ts +2 -0
- package/dist/src/mock/api/validator.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +6 -0
- package/dist/src/services/unsubscribeApi.d.ts +4 -0
- package/dist/src/stores/config.d.ts +96 -0
- package/dist/{stores → src/stores}/editor.d.ts +21 -0
- package/dist/src/stores/unsubscribe.d.ts +256 -0
- package/dist/{utils → src/utils}/genericUtil.d.ts +1 -0
- package/dist/stores/config.js +17 -0
- package/dist/stores/editor.js +2 -1
- package/dist/stores/unsubscribe.js +126 -6
- package/dist/utils/genericUtil.js +8 -7
- package/dist/utils/templatePreparation.js +17 -16
- package/package.json +8 -3
- package/dist/config/migrator/index.d.ts +0 -1
- package/dist/enums/unsubscribe.d.ts +0 -15
- package/dist/extensions/Blocks/CouponBlock/template.d.ts +0 -3
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +0 -75
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +0 -77
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +0 -123
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +0 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +0 -119
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +0 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +0 -24
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +0 -24
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +0 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +0 -33
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +0 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +0 -40
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +0 -5
- package/dist/static/assets/icons/coupon.svg.js +0 -4
- package/dist/stores/unsubscribe.d.ts +0 -8
- /package/dist/{@types → src/@types}/events.d.ts +0 -0
- /package/dist/{@types → src/@types}/save-as-template.d.ts +0 -0
- /package/dist/{App.vue.d.ts → src/App.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/organisms/LoadingWrapper.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/base/Toaster.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/PreviewContainer.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -0
- /package/dist/{components/organisms/header/LeftSlot.vue.d.ts → src/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts} +0 -0
- /package/dist/{components/organisms/header/MiddleSlot.vue.d.ts → src/components/organisms/extensions/recommendation/Filters.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/organisms/header/HeaderWrapper.vue.d.ts +0 -0
- /package/dist/{components/organisms/header/ViewOptions.vue.d.ts → src/components/organisms/header/LeftSlot.vue.d.ts} +0 -0
- /package/dist/{components/organisms/header/version-history/RestoreButton.vue.d.ts → src/components/organisms/header/MiddleSlot.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/organisms/header/RightSlot.vue.d.ts +0 -0
- /package/dist/{components/organisms/header/version-history → src/components/organisms/header}/ViewOptions.vue.d.ts +0 -0
- /package/dist/{components/organisms/onboarding/AMPOnboarding.vue.d.ts → src/components/organisms/header/version-history/RestoreButton.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/VersionHistory.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -0
- /package/dist/{components/organisms/onboarding/GenericOnboarding.vue.d.ts → src/components/organisms/header/version-history/ViewOptions.vue.d.ts} +0 -0
- /package/dist/{components/organisms/onboarding/NewVersionPopup.vue.d.ts → src/components/organisms/onboarding/AMPOnboarding.vue.d.ts} +0 -0
- /package/dist/{components/organisms/onboarding/OnboardingWrapper.vue.d.ts → src/components/organisms/onboarding/GenericOnboarding.vue.d.ts} +0 -0
- /package/dist/{components/organisms/onboarding/TextBlockOnboarding.vue.d.ts → src/components/organisms/onboarding/NewVersionPopup.vue.d.ts} +0 -0
- /package/dist/{components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts → src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts} +0 -0
- /package/dist/{components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts → src/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/wrappers/WpModal.vue.d.ts +0 -0
- /package/dist/{composables → src/composables}/useActionsApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/useApiExample.d.ts +0 -0
- /package/dist/{composables → src/composables}/useCodeEditorApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/useConfig.d.ts +0 -0
- /package/dist/{composables → src/composables}/useCustomInterfaceAppearance.d.ts +0 -0
- /package/dist/{composables → src/composables}/useDebounce.d.ts +0 -0
- /package/dist/{composables → src/composables}/useExport.d.ts +0 -0
- /package/dist/{composables → src/composables}/useGuidoActions.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHtmlCompiler.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHtmlValidator.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHttp.d.ts +0 -0
- /package/dist/{composables → src/composables}/usePartner.d.ts +0 -0
- /package/dist/{composables → src/composables}/usePreviewMode.d.ts +0 -0
- /package/dist/{composables → src/composables}/useProvideInject.d.ts +0 -0
- /package/dist/{composables → src/composables}/useRecommendation.d.ts +0 -0
- /package/dist/{composables → src/composables}/useResponsivePreview.d.ts +0 -0
- /package/dist/{composables → src/composables}/useSave.d.ts +0 -0
- /package/dist/{composables → src/composables}/useStripo.d.ts +0 -0
- /package/dist/{composables → src/composables}/useStripoEventHandler.d.ts +0 -0
- /package/dist/{composables → src/composables}/useToaster.d.ts +0 -0
- /package/dist/{composables → src/composables}/useTranslations.d.ts +0 -0
- /package/dist/{composables → src/composables}/useValidation.d.ts +0 -0
- /package/dist/{composables → src/composables}/useVersionHistoryApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/validators/saveAsTemplate.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/htmlCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/outlookCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/recommendationCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/socialCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/unsubscribeCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/checkboxMigrator.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/couponBlockMigrator.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/radioButtonMigrator.d.ts +0 -0
- /package/dist/{enums → src/enums}/defaults.d.ts +0 -0
- /package/dist/{enums → src/enums}/displayConditions.d.ts +0 -0
- /package/dist/{enums → src/enums}/html-validator.d.ts +0 -0
- /package/dist/{enums → src/enums}/onboarding.d.ts +0 -0
- /package/dist/{enums → src/enums}/preview.d.ts +0 -0
- /package/dist/{enums → src/enums}/recommendation.d.ts +0 -0
- /package/dist/{enums → src/enums}/toaster.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/control.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/control.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/template.d.ts +0 -0
- /package/dist/{extensions/Blocks/_Boilerplate → src/extensions/Blocks/Recommendation}/extension.d.ts +0 -0
- /package/dist/{extensions/Blocks/_Boilerplate → src/extensions/Blocks/Recommendation}/settingsPanel.d.ts +0 -0
- /package/dist/{extensions/DynamicContent → src/extensions/Blocks/Unsubscribe}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/control.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/DynamicContent/dynamic-content-modal.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/DynamicContent/dynamic-content.d.ts +0 -0
- /package/dist/{library.d.ts → src/library.d.ts} +0 -0
- /package/dist/{main.d.ts → src/main.d.ts} +0 -0
- /package/dist/{mock → src/mock}/api/auth.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/custom-fonts.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/default-template.d.ts +0 -0
- /package/dist/{mock/api/template-library.d.ts → src/mock/api/recommendation.d.ts} +0 -0
- /package/dist/{mock/api/unsubscribe.d.ts → src/mock/api/template-library.d.ts} +0 -0
- /package/dist/{mock/api/user-modal-state.d.ts → src/mock/api/unsubscribe.d.ts} +0 -0
- /package/dist/{mock/api/validator.d.ts → src/mock/api/user-modal-state.d.ts} +0 -0
- /package/dist/{mock → src/mock}/browser.d.ts +0 -0
- /package/dist/{mock → src/mock}/handlers.d.ts +0 -0
- /package/dist/{services → src/services}/onboardingApi.d.ts +0 -0
- /package/dist/{services → src/services}/stripoApi.d.ts +0 -0
- /package/dist/{services → src/services}/templateLibraryApi.d.ts +0 -0
- /package/dist/{stores → src/stores}/dynamic-content.d.ts +0 -0
- /package/dist/{stores → src/stores}/onboarding.d.ts +0 -0
- /package/dist/{stores → src/stores}/preview.d.ts +0 -0
- /package/dist/{stores → src/stores}/recommendation.d.ts +0 -0
- /package/dist/{stores → src/stores}/save-as-template.d.ts +0 -0
- /package/dist/{stores → src/stores}/toaster.d.ts +0 -0
- /package/dist/{stores → src/stores}/version-history.d.ts +0 -0
- /package/dist/{utils → src/utils}/arrayUtil.d.ts +0 -0
- /package/dist/{utils → src/utils}/base64.d.ts +0 -0
- /package/dist/{utils → src/utils}/dateUtil.d.ts +0 -0
- /package/dist/{utils → src/utils}/htmlCompiler.d.ts +0 -0
- /package/dist/{utils → src/utils}/templatePreparation.d.ts +0 -0
- /package/dist/{utils → src/utils}/tooltipUtils.d.ts +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { defineComponent as h, ref as b, computed as m, watch as _ } from "vue";
|
|
2
|
+
import v from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import { useToaster as B } from "../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as N } from "../../../composables/useTranslations.js";
|
|
5
|
+
import { ToasterTypeOptions as U } from "../../../enums/toaster.js";
|
|
6
|
+
import { PAGE_TYPES as l, ACADEMY_LINK as w, UNSUBSCRIBE_PAGES_LINK as P, TYPE_TRANSLATIONS as R } from "../../../enums/unsubscribe.js";
|
|
7
|
+
import { useUnsubscribeStore as D } from "../../../stores/unsubscribe.js";
|
|
8
|
+
import { InSegments as I } from "@useinsider/design-system-vue";
|
|
9
|
+
const z = /* @__PURE__ */ h({
|
|
10
|
+
__name: "UnsubscribeTypeSelection",
|
|
11
|
+
setup(G) {
|
|
12
|
+
const e = N(), { showToaster: f } = B(), t = D(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
|
|
13
|
+
"unsubscription-preference.select-unsubscribe-page-description",
|
|
14
|
+
{ action: `<a href="${w}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
|
|
15
|
+
), T = m(() => [
|
|
16
|
+
{
|
|
17
|
+
description: e("unsubscription-preference.type-global-unsubscribe-description"),
|
|
18
|
+
icon: "line-contact-global-unsub-page",
|
|
19
|
+
text: e("unsubscription-preference.type-global-unsubscribe"),
|
|
20
|
+
value: l.GLOBAL_UNSUBSCRIBE,
|
|
21
|
+
disable: t.isGlobalUnsubscribeDisabled,
|
|
22
|
+
position: "bottom",
|
|
23
|
+
tooltipText: t.isGlobalUnsubscribeDisabled ? e("unsubscription-preference.global-unsub-added") : ""
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
description: e("unsubscription-preference.type-subscription-preferences-center-description"),
|
|
27
|
+
icon: "line-contact-sub-pref-center-page",
|
|
28
|
+
text: e("unsubscription-preference.type-subscription-preferences-center"),
|
|
29
|
+
value: l.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
30
|
+
disable: t.isSubscriptionPreferencesCenterDisabled,
|
|
31
|
+
tooltipText: t.isSubscriptionPreferencesCenterDisabled ? e("unsubscription-preference.pref-center-added") : ""
|
|
32
|
+
}
|
|
33
|
+
]), y = m(() => ({
|
|
34
|
+
primaryButton: {
|
|
35
|
+
styling: "solid",
|
|
36
|
+
type: "primary",
|
|
37
|
+
labelText: e(
|
|
38
|
+
n.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
|
|
39
|
+
),
|
|
40
|
+
loadingStatus: n.value,
|
|
41
|
+
disabledStatus: !1,
|
|
42
|
+
skeletonStatus: i.value,
|
|
43
|
+
skeletonSizing: { width: 168, height: 40 }
|
|
44
|
+
},
|
|
45
|
+
cancelOrBackButton: {
|
|
46
|
+
styling: "ghost",
|
|
47
|
+
type: "secondary",
|
|
48
|
+
labelText: e("products.cancel"),
|
|
49
|
+
disabledStatus: n.value,
|
|
50
|
+
skeletonStatus: i.value,
|
|
51
|
+
skeletonSizing: { width: 78, height: 40 }
|
|
52
|
+
}
|
|
53
|
+
})), d = (s) => {
|
|
54
|
+
t.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel")), s && setTimeout(() => {
|
|
55
|
+
s();
|
|
56
|
+
}, 500);
|
|
57
|
+
}, E = (s) => {
|
|
58
|
+
o.value = s;
|
|
59
|
+
}, g = () => {
|
|
60
|
+
const s = t.hasTemplatesByCollectionType, r = [];
|
|
61
|
+
if (Object.entries(s).forEach(([c, p]) => {
|
|
62
|
+
p || r.push(Number(c));
|
|
63
|
+
}), r.length === 0)
|
|
64
|
+
return !0;
|
|
65
|
+
const a = r.map((c) => R[c]);
|
|
66
|
+
let u = "";
|
|
67
|
+
if (r.length === 1)
|
|
68
|
+
u = e("unsubscription-preference.create-page-to-continue", {
|
|
69
|
+
page: a[0]
|
|
70
|
+
});
|
|
71
|
+
else if (r.length === 2)
|
|
72
|
+
u = e("unsubscription-preference.create-pages-to-continue", {
|
|
73
|
+
page1: a[0],
|
|
74
|
+
page2: a[1]
|
|
75
|
+
});
|
|
76
|
+
else {
|
|
77
|
+
const c = a.pop() ?? "", p = a.join(", ");
|
|
78
|
+
u = e("unsubscription-preference.create-multiple-pages-to-continue", {
|
|
79
|
+
pages: p,
|
|
80
|
+
lastPage: c
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return f({
|
|
84
|
+
type: U.Warning,
|
|
85
|
+
message: u,
|
|
86
|
+
actionButton: {
|
|
87
|
+
text: "Go to Unsubscribe Pages",
|
|
88
|
+
onClick: () => {
|
|
89
|
+
window.location.href = P;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}), !1;
|
|
93
|
+
}, C = async () => {
|
|
94
|
+
if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !g()) {
|
|
95
|
+
n.value = !1, d();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
n.value = !1, t.typeSelectionDrawerStatus = !1, t.pageSelectionDrawerStatus = !0;
|
|
99
|
+
};
|
|
100
|
+
return _(() => t.typeSelectionDrawerStatus, (s) => {
|
|
101
|
+
s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, t.isGlobalUnsubscribeDisabled && (o.value = t.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
|
|
102
|
+
}), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: g, selectCollection: C, WpDrawer: v, InSegments: I };
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
export {
|
|
106
|
+
z as default
|
|
107
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import o from "./UnsubscribeWrapper.vue2.js";
|
|
2
|
+
import t from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var _ = function() {
|
|
4
|
+
var s;
|
|
5
|
+
var e = this, n = e._self._c, r = e._self._setupProxy;
|
|
6
|
+
return (s = r.config.extensions) != null && s.unsubscribe ? n("div", [n(r.UnsubscribeTypeSelection), n(r.UnsubscribePageSelection)], 1) : e._e();
|
|
7
|
+
}, c = [], i = /* @__PURE__ */ t(
|
|
8
|
+
o,
|
|
9
|
+
_,
|
|
10
|
+
c,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
null
|
|
14
|
+
);
|
|
15
|
+
const l = i.exports;
|
|
16
|
+
export {
|
|
17
|
+
l as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineComponent as t, defineAsyncComponent as e } from "vue";
|
|
2
|
+
import { useConfig as r } from "../../../composables/useConfig.js";
|
|
3
|
+
const m = /* @__PURE__ */ t({
|
|
4
|
+
__name: "UnsubscribeWrapper",
|
|
5
|
+
setup(i) {
|
|
6
|
+
const n = e(() => import("./UnsubscribePageSelection.vue.js")), o = e(() => import("./UnsubscribeTypeSelection.vue.js")), { config: s } = r();
|
|
7
|
+
return { __sfc: !0, UnsubscribePageSelection: n, UnsubscribeTypeSelection: o, config: s };
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
m as default
|
|
12
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import r from "./WpDrawer.vue2.js";
|
|
2
2
|
import s from "../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var
|
|
3
|
+
var u = function() {
|
|
4
4
|
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
5
5
|
return n(e.InDrawer, { class: t.className, attrs: { id: t.id, "footer-status": "", "close-on-outside-click": t.closeOnOutsideClick, "description-status": t.descriptionStatus, "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, size: t.size, status: t.status, "title-text": t.titleText }, on: { cancelOrBackButtonEvent: function(o) {
|
|
6
6
|
return e.emit("cancelOrBackButtonEvent");
|
|
@@ -8,13 +8,15 @@ var i = function() {
|
|
|
8
8
|
return e.emit("onCloseEvent");
|
|
9
9
|
}, primaryButtonEvent: function(o) {
|
|
10
10
|
return e.emit("primaryButtonEvent");
|
|
11
|
-
} }, scopedSlots: t._u([{ key: "
|
|
11
|
+
} }, scopedSlots: t._u([t.$slots.headerBottomSlot ? { key: "headerBottomSlot", fn: function() {
|
|
12
|
+
return [t._t("headerBottomSlot")];
|
|
13
|
+
}, proxy: !0 } : null, { key: "contentSlot", fn: function() {
|
|
12
14
|
return [n("div", [t._t("default")], 2)];
|
|
13
15
|
}, proxy: !0 }], null, !0) });
|
|
14
|
-
},
|
|
16
|
+
}, i = [], c = /* @__PURE__ */ s(
|
|
15
17
|
r,
|
|
16
|
-
i,
|
|
17
18
|
u,
|
|
19
|
+
i,
|
|
18
20
|
!1,
|
|
19
21
|
null,
|
|
20
22
|
null
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
import { useActionsApi as f } from "./useActionsApi.js";
|
|
2
|
-
import { useCustomInterfaceAppearance as
|
|
3
|
-
import { useStripoEventHandler as
|
|
2
|
+
import { useCustomInterfaceAppearance as E } from "./useCustomInterfaceAppearance.js";
|
|
3
|
+
import { useStripoEventHandler as S } from "./useStripoEventHandler.js";
|
|
4
4
|
import { useToaster as C } from "./useToaster.js";
|
|
5
5
|
import { displayConditions as y } from "../enums/displayConditions.js";
|
|
6
6
|
import h from "../extensions/Blocks/Checkbox/extension.js";
|
|
7
7
|
import w from "../extensions/Blocks/CouponBlock/extension.js";
|
|
8
8
|
import b from "../extensions/Blocks/RadioButton/extension.js";
|
|
9
|
+
import V from "../extensions/Blocks/Recommendation/extension.js";
|
|
10
|
+
import _ from "../extensions/Blocks/Unsubscribe/extension.js";
|
|
9
11
|
import k from "../extensions/DynamicContent/extension.js";
|
|
10
12
|
import { useStripoApi as B } from "../services/stripoApi.js";
|
|
11
|
-
import
|
|
12
|
-
import { useEditorStore as
|
|
13
|
-
import { dynamicContentToMergeTags as
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import x from "../static/styles/customEditorStyle.css.js";
|
|
14
|
+
import { useEditorStore as F } from "../stores/editor.js";
|
|
15
|
+
import { dynamicContentToMergeTags as A } from "../utils/genericUtil.js";
|
|
16
|
+
import T from "../package.json.js";
|
|
17
|
+
const G = (a) => {
|
|
18
|
+
const { handleError: d } = C(), { getToken: u, getCustomFonts: m } = B(), { handleEvent: p } = S(), l = (r, i = []) => {
|
|
19
|
+
const t = F(), { html: n, css: c, forceRecreate: s } = r;
|
|
17
20
|
window.UIEditor.initEditor(
|
|
18
21
|
document.querySelector("#guido-editor"),
|
|
19
22
|
{
|
|
20
|
-
metadata:
|
|
21
|
-
html:
|
|
22
|
-
css:
|
|
23
|
-
forceRecreate:
|
|
23
|
+
metadata: a,
|
|
24
|
+
html: n,
|
|
25
|
+
css: c,
|
|
26
|
+
forceRecreate: s,
|
|
24
27
|
locale: "en",
|
|
25
28
|
undoButtonSelector: "#guido__undo-button",
|
|
26
29
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -30,7 +33,7 @@ const j = (s) => {
|
|
|
30
33
|
customAppearanceMergetags: !0,
|
|
31
34
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
32
35
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
33
|
-
customViewStyles:
|
|
36
|
+
customViewStyles: x,
|
|
34
37
|
conditionsEnabled: !0,
|
|
35
38
|
customConditionsEnabled: !0,
|
|
36
39
|
conditionCategories: y,
|
|
@@ -44,21 +47,21 @@ const j = (s) => {
|
|
|
44
47
|
},
|
|
45
48
|
mergeTags: [
|
|
46
49
|
{
|
|
47
|
-
entries:
|
|
50
|
+
entries: A(a.preselectedDynamicContentList)
|
|
48
51
|
}
|
|
49
52
|
],
|
|
50
53
|
async onTokenRefreshRequest(o) {
|
|
51
54
|
try {
|
|
52
|
-
const
|
|
53
|
-
o(
|
|
54
|
-
} catch (
|
|
55
|
-
d(
|
|
55
|
+
const e = await u();
|
|
56
|
+
o(e);
|
|
57
|
+
} catch (e) {
|
|
58
|
+
d(e, "Failed to refresh token");
|
|
56
59
|
}
|
|
57
60
|
},
|
|
58
61
|
onTemplateLoaded() {
|
|
59
62
|
try {
|
|
60
|
-
const { importCss: o } =
|
|
61
|
-
o(),
|
|
63
|
+
const { importCss: o } = E(), { activateCustomViewStyles: e } = f();
|
|
64
|
+
o(), e(), a.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
|
|
62
65
|
t.hasChanges = !1;
|
|
63
66
|
}, 1e3);
|
|
64
67
|
} catch (o) {
|
|
@@ -77,36 +80,42 @@ const j = (s) => {
|
|
|
77
80
|
onDataChanged() {
|
|
78
81
|
t.hasChanges = !0;
|
|
79
82
|
},
|
|
80
|
-
onEvent:
|
|
81
|
-
ignoreClickOutsideSelectors: [
|
|
83
|
+
onEvent: p,
|
|
84
|
+
ignoreClickOutsideSelectors: [
|
|
85
|
+
"#guido-dynamic-content-modal",
|
|
86
|
+
".in-on-board-wrapper",
|
|
87
|
+
".in-drawer__container"
|
|
88
|
+
],
|
|
82
89
|
extensions: [
|
|
83
90
|
k,
|
|
84
91
|
h,
|
|
85
92
|
b,
|
|
93
|
+
V,
|
|
94
|
+
_,
|
|
86
95
|
w
|
|
87
96
|
]
|
|
88
97
|
}
|
|
89
98
|
);
|
|
90
|
-
},
|
|
99
|
+
}, g = (r) => new Promise((i, t) => {
|
|
100
|
+
var e;
|
|
91
101
|
if (document.getElementById("UiEditorScript")) {
|
|
92
102
|
r(), i();
|
|
93
103
|
return;
|
|
94
104
|
}
|
|
95
|
-
const e = document.createElement("script");
|
|
96
|
-
|
|
105
|
+
const n = T.guido, s = `https://email-static.useinsider.com/guido/${(e = n == null ? void 0 : n.stripo) == null ? void 0 : e.version}/UIEditor.js`, o = document.createElement("script");
|
|
106
|
+
o.id = "UiEditorScript", o.type = "module", o.src = s, o.onload = () => {
|
|
97
107
|
r(), i();
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}, document.body.appendChild(e);
|
|
108
|
+
}, o.onerror = () => {
|
|
109
|
+
t(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
|
|
110
|
+
}, document.body.appendChild(o);
|
|
102
111
|
});
|
|
103
112
|
return { initPlugin: async (r) => {
|
|
104
|
-
await
|
|
105
|
-
const i = await
|
|
106
|
-
|
|
113
|
+
await g(async () => {
|
|
114
|
+
const i = await m();
|
|
115
|
+
l(r, i);
|
|
107
116
|
});
|
|
108
117
|
} };
|
|
109
118
|
};
|
|
110
119
|
export {
|
|
111
|
-
|
|
120
|
+
G as useStripo
|
|
112
121
|
};
|
|
@@ -1,23 +1,36 @@
|
|
|
1
|
-
import { usePartner as
|
|
2
|
-
import { LINK_REGEXES as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { usePartner as U } from "../../composables/usePartner.js";
|
|
2
|
+
import { LINK_REGEXES as l, LINK_TYPES as b, URLS as f } from "../../enums/unsubscribe.js";
|
|
3
|
+
import { parsePageList as B } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
4
|
+
import { useConfigStore as N } from "../../stores/config.js";
|
|
5
|
+
import { useUnsubscribeStore as I } from "../../stores/unsubscribe.js";
|
|
6
|
+
const T = [
|
|
5
7
|
{
|
|
6
8
|
id: "add-unsubscribe-link-values",
|
|
7
9
|
description: "Adding unsubscribe link values",
|
|
8
10
|
type: "custom",
|
|
9
|
-
processor: (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
processor: (t) => {
|
|
12
|
+
const { getPartnerName: i } = U(), a = N(), n = I(), u = a.getVariationId;
|
|
13
|
+
if (!u)
|
|
14
|
+
return t;
|
|
15
|
+
let o = t;
|
|
16
|
+
const e = `/${i()}/email/${u}?user={{iid}}`;
|
|
17
|
+
return new DOMParser().parseFromString(o, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
|
|
18
|
+
var g;
|
|
19
|
+
const d = p.getAttribute("data-unsubscribe-page-list");
|
|
20
|
+
if (!d)
|
|
21
|
+
return;
|
|
22
|
+
const S = B(d), m = ((g = n.templates) == null ? void 0 : g.filter(
|
|
23
|
+
(c) => S.includes(c.id)
|
|
24
|
+
)) ?? [], R = m.some((c) => c.type === b.UNSUBSCRIBE_LINK_TYPE), _ = m.some((c) => c.type === b.PREFERENCES_LINK_TYPE), E = p.outerHTML;
|
|
25
|
+
let s = E;
|
|
26
|
+
R && (s = s.replace(
|
|
27
|
+
l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
28
|
+
f.UNSUBSCRIBE_URL + e
|
|
29
|
+
)), _ && (s = s.replace(
|
|
30
|
+
l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
31
|
+
f.PREFERENCES_URL + e
|
|
32
|
+
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), o = o.replace(E, s);
|
|
33
|
+
}), o;
|
|
21
34
|
},
|
|
22
35
|
priority: 60
|
|
23
36
|
},
|
|
@@ -25,7 +38,7 @@ const S = [
|
|
|
25
38
|
id: "remove-data-ogsb-button-styles",
|
|
26
39
|
description: "Removing styles like [data-ogsb] .es-button.es-button-123 { background: red; }",
|
|
27
40
|
type: "regex",
|
|
28
|
-
pattern:
|
|
41
|
+
pattern: l.DATA_OGSB_BUTTON_CSS_REGEX,
|
|
29
42
|
replacement: "",
|
|
30
43
|
flags: "g",
|
|
31
44
|
priority: 61
|
|
@@ -34,25 +47,25 @@ const S = [
|
|
|
34
47
|
id: "format-comment-braces",
|
|
35
48
|
description: "Adding spaces around comment braces for proper formatting",
|
|
36
49
|
type: "custom",
|
|
37
|
-
processor: (
|
|
50
|
+
processor: (t) => t.replace(/{#/g, "{ #").replace(/#}/g, "# }"),
|
|
38
51
|
priority: 62
|
|
39
52
|
},
|
|
40
53
|
{
|
|
41
54
|
id: "add-universal-link-flags",
|
|
42
55
|
description: "Adding universal link flags",
|
|
43
56
|
type: "custom",
|
|
44
|
-
processor: (
|
|
45
|
-
let i =
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
if (
|
|
57
|
+
processor: (t) => {
|
|
58
|
+
let i = t;
|
|
59
|
+
const a = i.match(/<a[^>]+>(.*?)<\/a>/gm);
|
|
60
|
+
return a && a.forEach((n) => {
|
|
61
|
+
if (n.includes("insEmail=1"))
|
|
49
62
|
return;
|
|
50
|
-
if (
|
|
51
|
-
const o =
|
|
52
|
-
const
|
|
53
|
-
return
|
|
63
|
+
if (n.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
|
|
64
|
+
const o = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
|
|
65
|
+
const r = e.slice(6, e.length - 1).trim();
|
|
66
|
+
return e.includes("?") || e.includes("#") ? r.slice(-1) === "&" ? e.replace(r, `${r}insEmail=1`) : e.replace(r, `${r}&insEmail=1`) : e.replace(r, `${r}?insEmail=1`);
|
|
54
67
|
});
|
|
55
|
-
i = i.replace(
|
|
68
|
+
i = i.replace(n, o);
|
|
56
69
|
}
|
|
57
70
|
}), i;
|
|
58
71
|
},
|
|
@@ -60,5 +73,5 @@ const S = [
|
|
|
60
73
|
}
|
|
61
74
|
];
|
|
62
75
|
export {
|
|
63
|
-
|
|
76
|
+
T as unsubscribeCompilerRules
|
|
64
77
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var x = (
|
|
4
|
-
import
|
|
5
|
-
class
|
|
1
|
+
var k = Object.defineProperty;
|
|
2
|
+
var m = (o, t, e) => t in o ? k(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
3
|
+
var x = (o, t, e) => m(o, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import h from "../../extensions/Blocks/CouponBlock/template.js";
|
|
5
|
+
class y {
|
|
6
6
|
constructor() {
|
|
7
7
|
x(this, "parser");
|
|
8
8
|
this.parser = new DOMParser();
|
|
@@ -11,17 +11,17 @@ class k {
|
|
|
11
11
|
try {
|
|
12
12
|
const e = this.parser.parseFromString(t, "text/html"), n = e.querySelectorAll("td.coupon-block.ins-coupon-code:not([esd-extension-block-id])");
|
|
13
13
|
return n.length === 0 ? t : (n.forEach((s) => {
|
|
14
|
-
const
|
|
14
|
+
const i = this.extractText(s), c = this.extractAttributes(s), l = h.replace("{@COUPON_CODE}", i).replace(
|
|
15
|
+
'class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block"',
|
|
16
|
+
c.class
|
|
17
|
+
).replace(
|
|
15
18
|
'esd-extension-block-id="coupon-block"',
|
|
16
19
|
`esd-extension-block-id="coupon-block"${c.block}`
|
|
17
20
|
).replace(
|
|
18
21
|
'<p class="ins-title"',
|
|
19
22
|
`<p class="ins-title"${c.text}`
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
"text/html"
|
|
23
|
-
).querySelector(".coupon-block.ins-coupon-code");
|
|
24
|
-
o && s.parentNode && (s.id && (o.id = s.id), s.parentNode.replaceChild(o, s));
|
|
23
|
+
);
|
|
24
|
+
s.outerHTML = l;
|
|
25
25
|
}), e.documentElement.outerHTML);
|
|
26
26
|
} catch (e) {
|
|
27
27
|
return console.error("CouponBlockMigrator failed:", e), t;
|
|
@@ -32,35 +32,35 @@ class k {
|
|
|
32
32
|
const e = t.querySelector(".ins-title");
|
|
33
33
|
if (!e)
|
|
34
34
|
return "{@COUPON_CODE}";
|
|
35
|
-
const n = ((g = e.textContent) == null ? void 0 : g.trim()) || "{@COUPON_CODE}", s = e.getAttribute("style") || "",
|
|
35
|
+
const n = ((g = e.textContent) == null ? void 0 : g.trim()) || "{@COUPON_CODE}", s = e.getAttribute("style") || "", i = /font-weight\s*:\s*bold/i.test(s), c = /font-style\s*:\s*italic/i.test(s), l = /text-decoration[^;]*underline/i.test(s), u = /text-decoration[^;]*line-through/i.test(s), a = /vertical-align\s*:\s*sub/i.test(s), p = /vertical-align\s*:\s*super/i.test(s);
|
|
36
36
|
return [
|
|
37
|
-
[
|
|
37
|
+
[i, "strong"],
|
|
38
38
|
[c, "em"],
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
].reduce((
|
|
39
|
+
[l, "u"],
|
|
40
|
+
[u, "s"],
|
|
41
|
+
[a, "sub"],
|
|
42
|
+
[p, "sup"]
|
|
43
|
+
].reduce((b, [f, d]) => f ? `<${d}>${b}</${d}>` : b, n);
|
|
44
44
|
}
|
|
45
45
|
extractAttributes(t) {
|
|
46
|
-
const e = t.querySelector(".ins-title"), n = t.className.split(" ").filter((
|
|
47
|
-
let
|
|
48
|
-
n.length && (
|
|
49
|
-
let
|
|
50
|
-
if (s && (
|
|
51
|
-
const
|
|
52
|
-
|
|
46
|
+
const e = t.querySelector(".ins-title"), n = t.className.split(" ").filter((r) => r.startsWith("es-")), s = t.getAttribute("align"), i = t.getAttribute("bgcolor"), c = t.getAttribute("style"), l = e == null ? void 0 : e.getAttribute("style");
|
|
47
|
+
let u = 'class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block';
|
|
48
|
+
n.length && (u += ` ${n.join(" ")}`), u += '"';
|
|
49
|
+
let a = "";
|
|
50
|
+
if (s && (a += ` align="${s}"`), i && (a += ` bgcolor="${i}"`), c) {
|
|
51
|
+
const r = c.replace(/background-color[^;]+;?/gi, "").replace(/;+/g, ";").trim();
|
|
52
|
+
r && (a += ` style="${r.replace(/"/g, "'")}"`);
|
|
53
53
|
}
|
|
54
|
-
let
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
|
|
54
|
+
let p = "";
|
|
55
|
+
if (l) {
|
|
56
|
+
const r = l.replace(/"/g, '"').replace(/font-weight\s*:\s*[^;]+;?/gi, "").replace(/font-style\s*:\s*[^;]+;?/gi, "").replace(/text-decoration\s*:\s*[^;]+;?/gi, "").replace(/vertical-align\s*:\s*[^;]+;?/gi, "").replace(/;+/g, ";").replace(/^;|;$/g, "").trim().replace(/"/g, "'");
|
|
57
|
+
r && (p = ` style="${r}"`);
|
|
58
58
|
}
|
|
59
|
-
return { class:
|
|
59
|
+
return { class: u, block: a, text: p };
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
function C(
|
|
63
|
-
return new
|
|
62
|
+
function C(o) {
|
|
63
|
+
return new y().migrate(o);
|
|
64
64
|
}
|
|
65
65
|
export {
|
|
66
66
|
C as migrateCouponBlock
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
2
|
-
import { migrateCouponBlock as
|
|
1
|
+
import { migrateCheckbox as o } from "./checkboxMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as m } from "./couponBlockMigrator.js";
|
|
3
3
|
import { migrateRadioButton as i } from "./radioButtonMigrator.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { migrateUnsubscribe as e } from "./unsubscribeMigrator.js";
|
|
5
|
+
const c = async (t) => {
|
|
6
|
+
let r = t;
|
|
7
|
+
return r = o(r), r = i(r), r = await e(r), r = m(r), r;
|
|
7
8
|
};
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
c as migrate
|
|
10
11
|
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var x = (l, e, t) => e in l ? h(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
|
|
3
|
+
var S = (l, e, t) => x(l, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { MERGE_TAGS as k, PAGE_TYPES as p } from "../../enums/unsubscribe.js";
|
|
5
|
+
import { DATA_ATTRIBUTES as A } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
6
|
+
import { useUnsubscribeStore as T } from "../../stores/unsubscribe.js";
|
|
7
|
+
class C {
|
|
8
|
+
constructor() {
|
|
9
|
+
S(this, "parser");
|
|
10
|
+
this.parser = new DOMParser();
|
|
11
|
+
}
|
|
12
|
+
async migrate(e) {
|
|
13
|
+
try {
|
|
14
|
+
const t = this.parser.parseFromString(e, "text/html"), i = t.querySelectorAll("td.unsubscribe-block");
|
|
15
|
+
if (!i.length)
|
|
16
|
+
return e;
|
|
17
|
+
const o = T();
|
|
18
|
+
return await o.fetchTemplates(), i.forEach((r) => {
|
|
19
|
+
const c = r.getAttribute("id"), g = this.extractPaddingClass(r), u = r.getAttribute("bgcolor") || "", n = this.extractUnsubscribeContent(r), s = this.getCollectionTypeFromMergeTag(n.linkHref), b = o.getSelectedUnsubscribePagesByCollection(s);
|
|
20
|
+
console.debug("[UnsubscribeMigrator]", {
|
|
21
|
+
mergeTag: n.linkHref,
|
|
22
|
+
collectionType: s,
|
|
23
|
+
pageIds: b,
|
|
24
|
+
paddingClass: g,
|
|
25
|
+
bgColor: u
|
|
26
|
+
});
|
|
27
|
+
const f = this.buildUnsubscribeBlock(
|
|
28
|
+
n,
|
|
29
|
+
s,
|
|
30
|
+
b,
|
|
31
|
+
g,
|
|
32
|
+
u
|
|
33
|
+
), a = this.parser.parseFromString(
|
|
34
|
+
`<table id="tempDoc"><tbody><tr>${f}</tr></tbody></table>`,
|
|
35
|
+
"text/html"
|
|
36
|
+
).querySelector(".unsubscribe-block-v2");
|
|
37
|
+
a && r.parentNode && (a.setAttribute("id", c || ""), r.parentNode.replaceChild(a, r));
|
|
38
|
+
}), t.documentElement.outerHTML;
|
|
39
|
+
} catch (t) {
|
|
40
|
+
return console.error("UnsubscribeMigrator failed:", t), e;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
extractPaddingClass(e) {
|
|
44
|
+
const i = (e.getAttribute("class") || "").match(/\bes-p\d+\b/);
|
|
45
|
+
return i ? i[0] : "";
|
|
46
|
+
}
|
|
47
|
+
extractUnsubscribeContent(e) {
|
|
48
|
+
var m;
|
|
49
|
+
const t = e.querySelector("p");
|
|
50
|
+
if (!t)
|
|
51
|
+
return {
|
|
52
|
+
textBefore: "You can ",
|
|
53
|
+
linkText: "unsubscribe",
|
|
54
|
+
linkHref: "{{ins-unsubscribe-link}}",
|
|
55
|
+
linkStyle: "",
|
|
56
|
+
textAfter: " from our emails, if you need to.",
|
|
57
|
+
isBold: !1,
|
|
58
|
+
isItalic: !1,
|
|
59
|
+
align: "center",
|
|
60
|
+
paragraphStyle: ""
|
|
61
|
+
};
|
|
62
|
+
const i = e.getAttribute("align") || t.getAttribute("align") || "center", o = t.getAttribute("style") || "", r = t.querySelector("a.unsubscribe-link") || t.querySelector('a[href*="unsubscribe"]');
|
|
63
|
+
if (!r)
|
|
64
|
+
return {
|
|
65
|
+
textBefore: "You can ",
|
|
66
|
+
linkText: "unsubscribe",
|
|
67
|
+
linkHref: "{{ins-unsubscribe-link}}",
|
|
68
|
+
linkStyle: "",
|
|
69
|
+
textAfter: " from our emails, if you need to.",
|
|
70
|
+
isBold: !1,
|
|
71
|
+
isItalic: !1,
|
|
72
|
+
align: i,
|
|
73
|
+
paragraphStyle: o
|
|
74
|
+
};
|
|
75
|
+
const c = ((m = r.textContent) == null ? void 0 : m.trim()) || "unsubscribe", g = r.getAttribute("href") || "{{ins-unsubscribe-link}}", u = r.getAttribute("style") || "", n = t.textContent || "", s = n.indexOf(c), b = s >= 0 ? n.substring(0, s).trim() : "You can ", f = s >= 0 ? n.substring(s + c.length).trim() : " from our emails, if you need to.", d = !!t.querySelector("b, strong"), a = !!t.querySelector("i, em");
|
|
76
|
+
return {
|
|
77
|
+
textBefore: b,
|
|
78
|
+
linkText: c,
|
|
79
|
+
linkHref: this.normalizeUnsubscribeHref(g),
|
|
80
|
+
linkStyle: u,
|
|
81
|
+
textAfter: f,
|
|
82
|
+
isBold: d,
|
|
83
|
+
isItalic: a,
|
|
84
|
+
align: i,
|
|
85
|
+
paragraphStyle: o
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
buildUnsubscribeBlock(e, t, i, o, r) {
|
|
89
|
+
const c = e.linkStyle ? ` style="${e.linkStyle}"` : "", u = `<a ${`href="${e.linkHref}" class="unsubscribe-link" target="_blank" data-unsubscribe-link="true"`}${c}>${e.linkText}</a>`, n = [];
|
|
90
|
+
e.textBefore && n.push(e.textBefore), n.push(u), e.textAfter && n.push(e.textAfter);
|
|
91
|
+
let s = n.join(" ");
|
|
92
|
+
e.isBold && e.isItalic ? s = `<strong path="1,0"><em path="1,0,0">${s}</em></strong>` : e.isBold ? s = `<strong path="1,0">${s}</strong>` : e.isItalic && (s = `<em path="1,0">${s}</em>`);
|
|
93
|
+
const b = e.align ? ` align="${e.align}"` : "", f = r ? ` bgcolor="${r}"` : "", d = e.paragraphStyle ? ` style="${e.paragraphStyle}"` : "", a = i.length > 0 ? ` ${A.PAGE_LIST}="${i.join(",")}"` : "", m = ` ${A.PAGE_TYPE}="${t}"`, y = "esd-block-text unsubscribe-block-v2 esd-block-unsubscribe esd-unsubscribe-block esd-extension-block";
|
|
94
|
+
return `
|
|
95
|
+
<td
|
|
96
|
+
data-migration="true"
|
|
97
|
+
esd-extension-block-id="unsubscribe-block"
|
|
98
|
+
class="${o ? `${y} ${o}` : y}"
|
|
99
|
+
${b}${f}${m}${a}
|
|
100
|
+
>
|
|
101
|
+
<p path="1"${d}>
|
|
102
|
+
${s}
|
|
103
|
+
</p>
|
|
104
|
+
</td>
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
getCollectionTypeFromMergeTag(e) {
|
|
108
|
+
return e === k[p.SUBSCRIPTION_PREFERENCE_CENTER] ? p.SUBSCRIPTION_PREFERENCE_CENTER : e === k[p.GLOBAL_UNSUBSCRIBE] ? p.GLOBAL_UNSUBSCRIBE : p.GLOBAL_UNSUBSCRIBE;
|
|
109
|
+
}
|
|
110
|
+
normalizeUnsubscribeHref(e) {
|
|
111
|
+
if (Object.values(k).includes(e))
|
|
112
|
+
return e;
|
|
113
|
+
const i = e.match(/{{ins-(?:global-)?(?:preferences-)?unsubscribe-link}}/);
|
|
114
|
+
return i ? i[0] : e.includes("unsubscribe") || e.includes("unsub") ? (console.warn(
|
|
115
|
+
`[UnsubscribeMigrator] Unrecognized unsubscribe href format: "${e}". Defaulting to {{ins-unsubscribe-link}}`
|
|
116
|
+
), "{{ins-unsubscribe-link}}") : e;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async function M(l) {
|
|
120
|
+
return new C().migrate(l);
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
M as migrateUnsubscribe
|
|
124
|
+
};
|