@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,200 @@
|
|
|
1
|
+
const g = {
|
|
2
|
+
TITLE: "You May Also Like!"
|
|
3
|
+
}, h = `
|
|
4
|
+
<td align="left" class="ins-recommendation-v3-block-v2 esd-block-recommendation-v3-block">
|
|
5
|
+
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
6
|
+
<tr>
|
|
7
|
+
<td align="center" style="padding: 20px 0;">
|
|
8
|
+
<!-- Email Content Container -->
|
|
9
|
+
<table class="container"
|
|
10
|
+
width="600"
|
|
11
|
+
cellpadding="0"
|
|
12
|
+
cellspacing="0"
|
|
13
|
+
border="0"
|
|
14
|
+
style="max-width: 600px; width: 100%; background-color: #ffffff;">
|
|
15
|
+
<!-- Heading -->
|
|
16
|
+
<tr>
|
|
17
|
+
<td class="heading"
|
|
18
|
+
style="
|
|
19
|
+
font-size: 28px;
|
|
20
|
+
font-weight: bold;
|
|
21
|
+
color: #333333;
|
|
22
|
+
text-align: center;
|
|
23
|
+
padding: 30px 20px;">
|
|
24
|
+
{-{-TITLE-}-}
|
|
25
|
+
</td>
|
|
26
|
+
</tr>
|
|
27
|
+
|
|
28
|
+
<!-- Product Rows -->
|
|
29
|
+
{-{-PRODUCT_ROWS-}-}
|
|
30
|
+
</table>
|
|
31
|
+
<!-- End Email Content Container -->
|
|
32
|
+
</td>
|
|
33
|
+
</tr>
|
|
34
|
+
</table>
|
|
35
|
+
</td>
|
|
36
|
+
`, u = `
|
|
37
|
+
<tr>
|
|
38
|
+
<td style="padding: 0 20px;">
|
|
39
|
+
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
|
|
40
|
+
{-{-PRODUCTS-}-}
|
|
41
|
+
</table>
|
|
42
|
+
</td>
|
|
43
|
+
</tr>
|
|
44
|
+
`, m = `
|
|
45
|
+
<td width="{-{-COLUMN_WIDTH-}-}" style="padding: 0 5px;" valign="top" height="100%">
|
|
46
|
+
<table width="100%"
|
|
47
|
+
height="100%"
|
|
48
|
+
cellpadding="0"
|
|
49
|
+
cellspacing="0"
|
|
50
|
+
border="0"
|
|
51
|
+
class="product-card-wrapper"
|
|
52
|
+
style="background-color: #f8f8f8;">
|
|
53
|
+
<tr>
|
|
54
|
+
<td class="product-image-cell"
|
|
55
|
+
valign="top"
|
|
56
|
+
style="background-color: #e8f0f2; padding: 30px; text-align: center;">
|
|
57
|
+
<img src="{-{-PRODUCT_IMAGE-}-}"
|
|
58
|
+
alt="{-{-PRODUCT_NAME-}-}" width="120" style="max-width: 100%; height: auto; margin: 0 auto;">
|
|
59
|
+
</td>
|
|
60
|
+
</tr>
|
|
61
|
+
</table>
|
|
62
|
+
</td>
|
|
63
|
+
`, b = `
|
|
64
|
+
<td width="{-{-COLUMN_WIDTH-}-}" style="padding: 0 5px;" valign="top" height="100%">
|
|
65
|
+
<table width="100%"
|
|
66
|
+
height="100%"
|
|
67
|
+
cellpadding="0"
|
|
68
|
+
cellspacing="0"
|
|
69
|
+
border="0"
|
|
70
|
+
class="product-card-wrapper"
|
|
71
|
+
style="background-color: #f8f8f8;">
|
|
72
|
+
<tr>
|
|
73
|
+
<td class="product-name-cell"
|
|
74
|
+
valign="top"
|
|
75
|
+
style="font-size: 16px; color: #333333; font-weight: 600; padding: 15px 10px; text-align: center;">
|
|
76
|
+
{-{-PRODUCT_NAME-}-}
|
|
77
|
+
</td>
|
|
78
|
+
</tr>
|
|
79
|
+
</table>
|
|
80
|
+
</td>
|
|
81
|
+
`, x = `
|
|
82
|
+
<td width="{-{-COLUMN_WIDTH-}-}" style="padding: 0 5px;" valign="top" height="100%">
|
|
83
|
+
<table width="100%"
|
|
84
|
+
height="100%"
|
|
85
|
+
cellpadding="0"
|
|
86
|
+
cellspacing="0"
|
|
87
|
+
border="0"
|
|
88
|
+
class="product-card-wrapper"
|
|
89
|
+
style="background-color: #f8f8f8;">
|
|
90
|
+
<tr>
|
|
91
|
+
<td class="price-cell" valign="top" style="padding: 10px; text-align: center;">
|
|
92
|
+
<span class="current-price" style="font-size: 16px; color: #333333; font-weight: bold;">
|
|
93
|
+
18,00 TRY
|
|
94
|
+
</span>
|
|
95
|
+
<span class="old-price" style="font-size: 14px; color: #999999; text-decoration: line-through;">
|
|
96
|
+
20,00 TRY
|
|
97
|
+
</span>
|
|
98
|
+
</td>
|
|
99
|
+
</tr>
|
|
100
|
+
</table>
|
|
101
|
+
</td>
|
|
102
|
+
`, w = `
|
|
103
|
+
<td width="{-{-COLUMN_WIDTH-}-}" style="padding: 0 5px;" valign="top" height="100%">
|
|
104
|
+
<table width="100%"
|
|
105
|
+
height="100%"
|
|
106
|
+
cellpadding="0"
|
|
107
|
+
cellspacing="0"
|
|
108
|
+
border="0"
|
|
109
|
+
class="product-card-wrapper"
|
|
110
|
+
style="background-color: #f8f8f8;">
|
|
111
|
+
<tr>
|
|
112
|
+
<td class="button-cell" valign="top" style="padding: 15px 10px 20px 10px; text-align: center;">
|
|
113
|
+
<a href="#"
|
|
114
|
+
class="buy-button"
|
|
115
|
+
style="
|
|
116
|
+
display: inline-block;
|
|
117
|
+
width: 90%;
|
|
118
|
+
max-width: 150px;
|
|
119
|
+
padding: 12px 20px;
|
|
120
|
+
background-color: #ffffff;
|
|
121
|
+
color: #333333;
|
|
122
|
+
text-decoration: none;
|
|
123
|
+
border: 2px solid #cccccc;
|
|
124
|
+
font-size: 16px;
|
|
125
|
+
box-sizing: border-box;">
|
|
126
|
+
Buy
|
|
127
|
+
</a>
|
|
128
|
+
</td>
|
|
129
|
+
</tr>
|
|
130
|
+
</table>
|
|
131
|
+
</td>
|
|
132
|
+
`, f = `
|
|
133
|
+
<tr>
|
|
134
|
+
<td class="spacer" style="height: 20px;"></td>
|
|
135
|
+
</tr>
|
|
136
|
+
`;
|
|
137
|
+
function T() {
|
|
138
|
+
const c = [
|
|
139
|
+
{
|
|
140
|
+
name: "Beanie with Logo",
|
|
141
|
+
image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/08/beanie-with-logo-1.jpg",
|
|
142
|
+
price: "18,00 TRY",
|
|
143
|
+
oldPrice: "20,00 TRY",
|
|
144
|
+
url: "https://example.com/product/1"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "Belt",
|
|
148
|
+
image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/09/belt-2.jpg",
|
|
149
|
+
price: "55,00 TRY",
|
|
150
|
+
oldPrice: "65,00 TRY",
|
|
151
|
+
url: "https://example.com/product/2"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "Beanie",
|
|
155
|
+
image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/08/beanie-with-logo-1.jpg",
|
|
156
|
+
price: "18,00 TRY",
|
|
157
|
+
oldPrice: "20,00 TRY",
|
|
158
|
+
url: "https://example.com/product/3"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "Album",
|
|
162
|
+
image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/12/poster_2_up.jpg",
|
|
163
|
+
price: "15,00 TRY",
|
|
164
|
+
oldPrice: "15,00 TRY",
|
|
165
|
+
url: "https://example.com/product/4"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "Flying Ninja with a very long product name",
|
|
169
|
+
image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/09/belt-2.jpg",
|
|
170
|
+
price: "12,00 TRY",
|
|
171
|
+
oldPrice: "15,00 TRY",
|
|
172
|
+
url: "https://example.com/product/5"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "Single",
|
|
176
|
+
image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/12/poster_2_up.jpg",
|
|
177
|
+
price: "22.555,00 TRY",
|
|
178
|
+
oldPrice: "33.989,00 TRY",
|
|
179
|
+
url: "https://example.com/product/6"
|
|
180
|
+
}
|
|
181
|
+
], l = 3, d = (100 / l).toFixed(2), a = [];
|
|
182
|
+
for (let t = 0; t < c.length; t += l)
|
|
183
|
+
a.push(c.slice(t, t + l));
|
|
184
|
+
let e = "";
|
|
185
|
+
return a.forEach((t, s) => {
|
|
186
|
+
s > 0 && (e += f);
|
|
187
|
+
let p = "", r = "", n = "", i = "";
|
|
188
|
+
t.forEach((o) => {
|
|
189
|
+
p += m.replace("{-{-PRODUCT_IMAGE-}-}", o.image).replace("{-{-PRODUCT_NAME-}-}", o.name), r += b.replace("{-{-PRODUCT_NAME-}-}", o.name), n += x, i += w;
|
|
190
|
+
}), e += u.replace("{-{-PRODUCTS-}-}", `
|
|
191
|
+
<tr>${p}</tr>
|
|
192
|
+
<tr>${r}</tr>
|
|
193
|
+
<tr>${n}</tr>
|
|
194
|
+
<tr>${i}</tr>
|
|
195
|
+
`), e = e.replaceAll("{-{-COLUMN_WIDTH-}-}", `${d}%`);
|
|
196
|
+
}), h.replace("{-{-TITLE-}-}", g.TITLE).replace("{-{-PRODUCT_ROWS-}-}", e);
|
|
197
|
+
}
|
|
198
|
+
export {
|
|
199
|
+
T as getDefaultTemplate
|
|
200
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function l(t) {
|
|
2
|
+
if (t.length === 0)
|
|
3
|
+
return "";
|
|
4
|
+
const o = t.sort((r, e) => r.filterNumber - e.filterNumber), n = o.map((r) => `[${r.attribute}][${r.operatorReplace}][${r.value}]`), [s, ...p] = n;
|
|
5
|
+
let u = s;
|
|
6
|
+
for (let r = 0; r < p.length; r++) {
|
|
7
|
+
const e = o[r + 1].innerGroupOperator;
|
|
8
|
+
u += `${e}${p[r]}`;
|
|
9
|
+
}
|
|
10
|
+
return `(${u})`;
|
|
11
|
+
}
|
|
12
|
+
function m(t) {
|
|
13
|
+
if (!t || t.length === 0)
|
|
14
|
+
return "";
|
|
15
|
+
const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), n = Object.keys(o).map(Number).sort((r, e) => r - e), s = n.map((r) => {
|
|
16
|
+
const e = o[r];
|
|
17
|
+
return l(e);
|
|
18
|
+
}), [p, ...u] = s;
|
|
19
|
+
let i = p;
|
|
20
|
+
for (let r = 0; r < u.length; r++) {
|
|
21
|
+
const e = n[r + 1], c = o[e][0].outerGroupOperator;
|
|
22
|
+
i += `${c}${u[r]}`;
|
|
23
|
+
}
|
|
24
|
+
return console.debug("🎉 Complete query generated:", i), i.trim();
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
m as generateCompleteFilterQuery
|
|
28
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var d = (n, i, e) => i in n ? _(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
|
|
3
|
+
var u = (n, i, e) => d(n, typeof i != "symbol" ? i + "" : i, e);
|
|
4
|
+
import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
|
|
5
|
+
import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
|
|
6
|
+
import { Block as S, BlockCompositionType as h, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { getDefaultTemplate as L } from "./template.js";
|
|
8
|
+
import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
|
|
9
|
+
import { parsePageList as m } from "./utils/utils.js";
|
|
10
|
+
const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', B = ".unsubscribe-block-v2", f = "{{ins-unsubscribe-link}}", C = {
|
|
11
|
+
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
12
|
+
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
13
|
+
};
|
|
14
|
+
class D extends S {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
u(this, "selectEventListener", null);
|
|
18
|
+
u(this, "cancelEventListener", null);
|
|
19
|
+
u(this, "currentNode");
|
|
20
|
+
}
|
|
21
|
+
getId() {
|
|
22
|
+
return v;
|
|
23
|
+
}
|
|
24
|
+
getIcon() {
|
|
25
|
+
return "unsubscribe-icon";
|
|
26
|
+
}
|
|
27
|
+
getBlockCompositionType() {
|
|
28
|
+
return h.BLOCK;
|
|
29
|
+
}
|
|
30
|
+
getName() {
|
|
31
|
+
return this.api.translate("Unsubscribe Block");
|
|
32
|
+
}
|
|
33
|
+
getDescription() {
|
|
34
|
+
return this.api.translate("Unsubscribe Block Description");
|
|
35
|
+
}
|
|
36
|
+
getTemplate() {
|
|
37
|
+
return L();
|
|
38
|
+
}
|
|
39
|
+
onCreated(e) {
|
|
40
|
+
"getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
41
|
+
}
|
|
42
|
+
onSelect(e) {
|
|
43
|
+
this.currentNode = e, this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener();
|
|
44
|
+
}
|
|
45
|
+
onDelete(e) {
|
|
46
|
+
this._removeEventListeners(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
|
|
47
|
+
}
|
|
48
|
+
onDestroy() {
|
|
49
|
+
this._removeEventListeners(), this.currentNode = void 0;
|
|
50
|
+
}
|
|
51
|
+
_setupSelectEventListener() {
|
|
52
|
+
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
53
|
+
const r = e, { collectionType: t, selectedPages: s } = r.detail;
|
|
54
|
+
this._updateBlock(t, s.join(","));
|
|
55
|
+
}, document.addEventListener(a.SELECT, this.selectEventListener);
|
|
56
|
+
}
|
|
57
|
+
_removeSelectEventListener() {
|
|
58
|
+
this.selectEventListener && (document.removeEventListener(a.SELECT, this.selectEventListener), this.selectEventListener = null);
|
|
59
|
+
}
|
|
60
|
+
_setupCancelEventListener() {
|
|
61
|
+
this._removeCancelEventListener(), this.cancelEventListener = () => {
|
|
62
|
+
this._handleCancel();
|
|
63
|
+
}, document.addEventListener(a.CANCEL, this.cancelEventListener);
|
|
64
|
+
}
|
|
65
|
+
_removeCancelEventListener() {
|
|
66
|
+
this.cancelEventListener && (document.removeEventListener(a.CANCEL, this.cancelEventListener), this.cancelEventListener = null);
|
|
67
|
+
}
|
|
68
|
+
_handleCancel() {
|
|
69
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).delete().apply(new b("Removed unsubscribe block due to cancel"));
|
|
70
|
+
}
|
|
71
|
+
_removeEventListeners() {
|
|
72
|
+
this._removeSelectEventListener(), this._removeCancelEventListener();
|
|
73
|
+
}
|
|
74
|
+
_updateBlock(e, r) {
|
|
75
|
+
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
76
|
+
return;
|
|
77
|
+
const t = this.currentNode.querySelector(g);
|
|
78
|
+
if (!t)
|
|
79
|
+
return;
|
|
80
|
+
const s = this._getMergeTag(e);
|
|
81
|
+
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", s).apply(new b(`Updated unsubscribe link to ${s}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, r).apply(new b("Updated unsubscribe block metadata"));
|
|
82
|
+
}
|
|
83
|
+
_getMergeTag(e) {
|
|
84
|
+
return C[e] ?? f;
|
|
85
|
+
}
|
|
86
|
+
_openDrawer() {
|
|
87
|
+
try {
|
|
88
|
+
const e = c();
|
|
89
|
+
e.typeSelectionDrawerStatus = !0;
|
|
90
|
+
} catch (e) {
|
|
91
|
+
console.error("[UnsubscribeBlock] Failed to open drawer:", e);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
_checkExistingBlocks() {
|
|
95
|
+
const e = c();
|
|
96
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(B).forEach((t) => {
|
|
97
|
+
if ("getAttribute" in t) {
|
|
98
|
+
const s = t.getAttribute(o.PAGE_TYPE);
|
|
99
|
+
if (s) {
|
|
100
|
+
const l = Number(s);
|
|
101
|
+
l === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : l === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
_loadBlockState(e) {
|
|
107
|
+
if (!("getAttribute" in e))
|
|
108
|
+
return;
|
|
109
|
+
const r = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
|
|
110
|
+
if (!r || !t)
|
|
111
|
+
return;
|
|
112
|
+
const s = c(), l = Number(r), p = m(t);
|
|
113
|
+
s.setCollectionWithoutAutoSelection(l), s.loadSelectedTemplates(p);
|
|
114
|
+
}
|
|
115
|
+
_resetStoreState() {
|
|
116
|
+
c().$reset();
|
|
117
|
+
}
|
|
118
|
+
_removeBlockTemplatesFromStore(e) {
|
|
119
|
+
if (!("getAttribute" in e))
|
|
120
|
+
return;
|
|
121
|
+
const r = e.getAttribute(o.PAGE_LIST);
|
|
122
|
+
if (!r)
|
|
123
|
+
return;
|
|
124
|
+
const t = c(), s = m(r);
|
|
125
|
+
t.removeUnsubscribePages(s);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
v as UNSUBSCRIBE_BLOCK_ID,
|
|
130
|
+
D as UnsubscribeBlock
|
|
131
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var d = (a, s, e) => s in a ? h(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e;
|
|
3
|
+
var u = (a, s, e) => d(a, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
|
|
5
|
+
import { Control as T, UEAttr as i, UIElementType as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { DATA_ATTRIBUTES as p } from "./utils/constants.js";
|
|
7
|
+
import { parsePageList as _ } from "./utils/utils.js";
|
|
8
|
+
const g = "ui-elements-unsubscribe", r = {
|
|
9
|
+
SELECT_BUTTON: "selectTemplateButton",
|
|
10
|
+
PREV_BUTTON: "prevButton",
|
|
11
|
+
NEXT_BUTTON: "nextButton",
|
|
12
|
+
COUNTER_TEXT: "counterText",
|
|
13
|
+
PREVIEW_IMAGE: "previewImage"
|
|
14
|
+
};
|
|
15
|
+
class N extends T {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
u(this, "currentPreviewIndex", 0);
|
|
19
|
+
u(this, "currentNode");
|
|
20
|
+
u(this, "currentPages");
|
|
21
|
+
u(this, "valueChangeHandlers", []);
|
|
22
|
+
u(this, "lastParsedAttribute");
|
|
23
|
+
}
|
|
24
|
+
getId() {
|
|
25
|
+
return g;
|
|
26
|
+
}
|
|
27
|
+
getTemplate() {
|
|
28
|
+
return `
|
|
29
|
+
<div class="unsubscribe-controls-container container stretch widest-spacing">
|
|
30
|
+
${this._getPreview()}
|
|
31
|
+
${this._getButton()}
|
|
32
|
+
</div>
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
onTemplateNodeUpdated(e) {
|
|
36
|
+
if (this.currentNode = e, "getAttribute" in this.currentNode) {
|
|
37
|
+
const t = this.currentNode.getAttribute(p.PAGE_LIST);
|
|
38
|
+
t && (t !== this.lastParsedAttribute && (this.currentPages = _(t), this.lastParsedAttribute = t, this.currentPreviewIndex = 0), this._updatePreview(), this._updateCounter());
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
onRender() {
|
|
42
|
+
this._listenToFormUpdates(), this._updateCounter();
|
|
43
|
+
}
|
|
44
|
+
onDestroy() {
|
|
45
|
+
this.valueChangeHandlers.forEach((e) => {
|
|
46
|
+
typeof e == "function" && e();
|
|
47
|
+
}), this.valueChangeHandlers = [], this.currentNode = void 0, this.currentPages = void 0, this.currentPreviewIndex = 0, this.lastParsedAttribute = void 0;
|
|
48
|
+
}
|
|
49
|
+
get totalTemplates() {
|
|
50
|
+
var e;
|
|
51
|
+
return ((e = this.currentPages) == null ? void 0 : e.length) ?? 0;
|
|
52
|
+
}
|
|
53
|
+
_listenToFormUpdates() {
|
|
54
|
+
this.valueChangeHandlers.push(
|
|
55
|
+
this.api.onValueChanged(r.SELECT_BUTTON, () => this._onButtonClick())
|
|
56
|
+
), this.valueChangeHandlers.push(
|
|
57
|
+
this.api.onValueChanged(r.PREV_BUTTON, () => this._onPrevClick())
|
|
58
|
+
), this.valueChangeHandlers.push(
|
|
59
|
+
this.api.onValueChanged(r.NEXT_BUTTON, () => this._onNextClick())
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
_onButtonClick() {
|
|
63
|
+
try {
|
|
64
|
+
const e = l();
|
|
65
|
+
e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.error("[UnsubscribeControl] Failed to open drawer:", e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
_onPrevClick() {
|
|
71
|
+
this.currentPreviewIndex > 0 && (this.currentPreviewIndex--, this._updatePreview(), this._updateCounter());
|
|
72
|
+
}
|
|
73
|
+
_onNextClick() {
|
|
74
|
+
this.currentPreviewIndex < this.totalTemplates - 1 && (this.currentPreviewIndex++, this._updatePreview(), this._updateCounter());
|
|
75
|
+
}
|
|
76
|
+
_updatePreview() {
|
|
77
|
+
var e;
|
|
78
|
+
if ((e = this.currentPages) != null && e.length)
|
|
79
|
+
try {
|
|
80
|
+
const t = this.currentPages[this.currentPreviewIndex], o = l().getThumbnailByTemplateId(t);
|
|
81
|
+
if (!o) {
|
|
82
|
+
console.warn("[UnsubscribeControl] No thumbnail found for page:", t);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.api.updateValues({
|
|
86
|
+
[r.PREVIEW_IMAGE]: o
|
|
87
|
+
});
|
|
88
|
+
} catch (t) {
|
|
89
|
+
console.error("[UnsubscribeControl] Failed to update preview:", t);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
_updateCounter() {
|
|
93
|
+
const e = this.currentPreviewIndex + 1, t = this.totalTemplates, c = this.currentPreviewIndex === 0, o = this.currentPreviewIndex >= t - 1;
|
|
94
|
+
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(
|
|
95
|
+
r.COUNTER_TEXT,
|
|
96
|
+
i.LABEL.text,
|
|
97
|
+
`${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
_getPreview() {
|
|
101
|
+
return `
|
|
102
|
+
<div class="unsubscribe-preview-container">
|
|
103
|
+
<div class="unsubscribe-preview-header">
|
|
104
|
+
<div class="unsubscribe-preview-title">${this.api.translate("Unsubscribe Template")}</div>
|
|
105
|
+
<div class="unsubscribe-preview-controls">
|
|
106
|
+
${this._getPrevButton()}
|
|
107
|
+
${this._getCounterText()}
|
|
108
|
+
${this._getNextButton()}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<unsubscribe-preview name="${r.PREVIEW_IMAGE}"></unsubscribe-preview>
|
|
112
|
+
</div>
|
|
113
|
+
`;
|
|
114
|
+
}
|
|
115
|
+
_getButton() {
|
|
116
|
+
return `
|
|
117
|
+
<${n.BUTTON}
|
|
118
|
+
id="${r.SELECT_BUTTON}"
|
|
119
|
+
class="primary full-width"
|
|
120
|
+
${i.BUTTON.name}="${r.SELECT_BUTTON}"
|
|
121
|
+
${i.BUTTON.caption}="${this.api.translate("Select Template")}"
|
|
122
|
+
>
|
|
123
|
+
</${n.BUTTON}>
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
_getLabel(e, t) {
|
|
127
|
+
return `
|
|
128
|
+
<${n.LABEL}
|
|
129
|
+
${i.LABEL.text}="${e}"
|
|
130
|
+
${i.LABEL.name}="${t}"
|
|
131
|
+
>
|
|
132
|
+
</${n.LABEL}>
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
_getIconButton(e, t, c) {
|
|
136
|
+
const o = c ? `${i.BUTTON.disabled}="true"` : "";
|
|
137
|
+
return `
|
|
138
|
+
<${n.BUTTON}
|
|
139
|
+
id="${e}"
|
|
140
|
+
class="flat-inline flat-white"
|
|
141
|
+
${i.BUTTON.name}="${e}"
|
|
142
|
+
${o}
|
|
143
|
+
>
|
|
144
|
+
<${n.ICON}
|
|
145
|
+
src="${t}"
|
|
146
|
+
class="icon-button"
|
|
147
|
+
></${n.ICON}>
|
|
148
|
+
</${n.BUTTON}>
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
_getPrevButton() {
|
|
152
|
+
const e = this.currentPreviewIndex === 0;
|
|
153
|
+
return this._getIconButton(r.PREV_BUTTON, "arrow-back", e);
|
|
154
|
+
}
|
|
155
|
+
_getNextButton() {
|
|
156
|
+
const e = this.currentPreviewIndex >= this.totalTemplates - 1;
|
|
157
|
+
return this._getIconButton(r.NEXT_BUTTON, "arrow-right", e);
|
|
158
|
+
}
|
|
159
|
+
_getCounterText() {
|
|
160
|
+
const t = `Showing ${this.currentPreviewIndex + 1} of ${this.totalTemplates}`;
|
|
161
|
+
return this._getLabel(t, r.COUNTER_TEXT);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
export {
|
|
165
|
+
g as UNSUBSCRIBE_CONTROL_ID,
|
|
166
|
+
N as UnsubscribeControl
|
|
167
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var n = (i, t, e) => t in i ? r(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var s = (i, t, e) => n(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { UIElement as m } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
const E = "unsubscribe-preview", l = "img", c = "Unsubscribe page preview";
|
|
6
|
+
class o extends m {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
s(this, "imgElement");
|
|
10
|
+
}
|
|
11
|
+
getId() {
|
|
12
|
+
return E;
|
|
13
|
+
}
|
|
14
|
+
getTemplate() {
|
|
15
|
+
return `
|
|
16
|
+
<div class="unsubscribe-preview-image-container">
|
|
17
|
+
<img
|
|
18
|
+
src=""
|
|
19
|
+
alt="${c}"
|
|
20
|
+
class="unsubscribe-preview-image"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
onRender(e) {
|
|
26
|
+
this.imgElement = e.querySelector(l);
|
|
27
|
+
}
|
|
28
|
+
setValue(e) {
|
|
29
|
+
this.imgElement && (this.imgElement.src = e);
|
|
30
|
+
}
|
|
31
|
+
getValue() {
|
|
32
|
+
var e;
|
|
33
|
+
return ((e = this.imgElement) == null ? void 0 : e.src) ?? "";
|
|
34
|
+
}
|
|
35
|
+
onDestroy() {
|
|
36
|
+
this.imgElement = void 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
E as PREVIEW_UI_ELEMENT_ID,
|
|
41
|
+
o as PreviewUIElement
|
|
42
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ExtensionBuilder as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { UnsubscribeBlock as i } from "./block.js";
|
|
3
|
+
import { UnsubscribeControl as t } from "./control.js";
|
|
4
|
+
import { PreviewUIElement as o } from "./elements/preview.js";
|
|
5
|
+
import { UnsubscribeIconsRegistry as r } from "./iconsRegistry.js";
|
|
6
|
+
import { SettingsPanel as s } from "./settingsPanel.js";
|
|
7
|
+
import n from "./styles.css.js";
|
|
8
|
+
import { UnsubscribeTagRegistry as l } from "./tagRegistry.js";
|
|
9
|
+
const f = new e().addBlock(i).withSettingsPanelRegistry(s).addControl(t).addUiElement(o).addStyles(n).withLocalization({
|
|
10
|
+
en: {
|
|
11
|
+
"Unsubscribe Block": "Unsubscribe Block",
|
|
12
|
+
"Unsubscribe Block Description": "Add an unsubscribe link to your email",
|
|
13
|
+
"Select Template": "Select Template",
|
|
14
|
+
"Unsubscribe Template": "Unsubscribe Template",
|
|
15
|
+
Showing: "Showing",
|
|
16
|
+
of: "of"
|
|
17
|
+
}
|
|
18
|
+
}).withUiElementTagRegistry(l).withIconsRegistry(r).build();
|
|
19
|
+
export {
|
|
20
|
+
f as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IconsRegistry as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
class i extends s {
|
|
3
|
+
registerIconsSvg(C) {
|
|
4
|
+
C["unsubscribe-icon"] = `
|
|
5
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path d="M4.5 9C6.98528 9 9 11.0147 9 13.5C9 15.9853 6.98528 18 4.5 18C2.01472 18 0 15.9853 0 13.5C0
|
|
7
|
+
11.0147 2.01472 9 4.5 9ZM2.17383 12.5879C2.06286 12.8707 2 13.1778 2 13.5C2 14.8807 3.11929 16 4.5
|
|
8
|
+
16C4.82196 16 5.12848 15.936 5.41113 15.8252L2.17383 12.5879ZM4.5 11C4.17785 11 3.87068 11.0629 3.58789
|
|
9
|
+
11.1738L6.8252 14.4111C6.93604 14.1285 7 13.822 7 13.5C7 12.1193 5.88071 11 4.5 11ZM16 0C17.1046 0 18
|
|
10
|
+
0.895431 18 2L18 12C18 13.1046 17.1046 14 16 14H11C10.4477 14 10 13.5523 10 13C10 12.4477 10.4477 12 11
|
|
11
|
+
12H16L16 5.93262L9.49609 8.87305C9.35966 8.94801 9.20653 8.99125 9.04883 8.99805C9.03254 8.99891 9.01624
|
|
12
|
+
8.99895 9 8.99902C8.98344 8.99894 8.9668 8.99894 8.9502 8.99805C8.79257 8.99109 8.63925 8.9481 8.50293
|
|
13
|
+
8.87305L2 5.93262L2 8C2 8.55229 1.55228 9 1 9C0.447715 9 0 8.55229 0 8L0 2C0 0.895431 0.895431
|
|
14
|
+
9.69188e-09 2 0L16 0ZM2 3.80664L9 6.96973L16 3.80664V2L2 2L2 3.80664Z" fill="#666666"/>
|
|
15
|
+
</svg>
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
i as UnsubscribeIconsRegistry
|
|
21
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SettingsPanelRegistry as e, SettingsPanelTab as N, SettingsTab as t, TextControls as O } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { UNSUBSCRIBE_BLOCK_ID as I } from "./block.js";
|
|
3
|
+
import { UNSUBSCRIBE_CONTROL_ID as _ } from "./control.js";
|
|
4
|
+
class R extends e {
|
|
5
|
+
registerBlockControls(T) {
|
|
6
|
+
T[I] = [
|
|
7
|
+
new N(
|
|
8
|
+
t.SETTINGS,
|
|
9
|
+
[
|
|
10
|
+
_,
|
|
11
|
+
O.FORMAT,
|
|
12
|
+
O.ALIGN,
|
|
13
|
+
O.LINE_HEIGHT,
|
|
14
|
+
O.DIRECTION,
|
|
15
|
+
O.INTERNAL_INDENTS,
|
|
16
|
+
O.HIDDEN_NODE
|
|
17
|
+
]
|
|
18
|
+
),
|
|
19
|
+
new N(
|
|
20
|
+
t.STYLES,
|
|
21
|
+
[
|
|
22
|
+
O.TEXT_BLOCK_BACKGROUND_COLOR,
|
|
23
|
+
O.FONT_FAMILY,
|
|
24
|
+
O.FONT_SIZE,
|
|
25
|
+
O.FONT_COLOR,
|
|
26
|
+
O.FONT_BACKGROUND_COLOR,
|
|
27
|
+
O.LINKS_COLOR
|
|
28
|
+
]
|
|
29
|
+
)
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
R as SettingsPanel
|
|
35
|
+
};
|