@useinsider/guido 1.0.2-beta.ad1dcd9 → 1.0.2-beta.b3c5fc9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -44
- package/dist/@types/events.d.ts +0 -6
- package/dist/@types/generic.d.ts +0 -13
- package/dist/_virtual/AddCustomFont.js +4 -0
- package/dist/_virtual/AiAssistantValueType.js +4 -0
- package/dist/_virtual/BackgroundColorBuiltInControl.js +4 -0
- package/dist/_virtual/BackgroundImageBuiltInControl.js +4 -0
- package/dist/_virtual/Block.js +4 -0
- package/dist/_virtual/BlockAttributes.js +4 -0
- package/dist/_virtual/BlockCompositionType.js +4 -0
- package/dist/_virtual/BlockPaddingsBuiltInControl.js +4 -0
- package/dist/_virtual/BlockRenderer.js +4 -0
- package/dist/_virtual/BlockType.js +4 -0
- package/dist/_virtual/BlocksPanel.js +4 -0
- package/dist/_virtual/BuiltInControl.js +4 -0
- package/dist/_virtual/BuiltInControlTypes.js +4 -0
- package/dist/_virtual/ButtonBorderBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonColorBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonFontColorBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonTextBuiltInControl.js +4 -0
- package/dist/_virtual/ContextAction.js +4 -0
- package/dist/_virtual/ContextActionType.js +4 -0
- package/dist/_virtual/Control.js +4 -0
- package/dist/_virtual/EditorStatePropertyType.js +4 -0
- package/dist/_virtual/Extension.js +4 -0
- package/dist/_virtual/ExtensionBuilder.js +4 -0
- package/dist/_virtual/FontFamilyBuiltInControl.js +4 -0
- package/dist/_virtual/LinkColorBuiltInControl.js +4 -0
- package/dist/_virtual/ModificationDescription.js +4 -0
- package/dist/_virtual/PanelPosition.js +4 -0
- package/dist/_virtual/PreviewDeviceMode.js +4 -0
- package/dist/_virtual/SettingsPanelRegistry.js +4 -0
- package/dist/_virtual/SettingsPanelTab.js +4 -0
- package/dist/_virtual/SettingsTab.js +4 -0
- package/dist/_virtual/StructureBorderBuiltInControl.js +4 -0
- package/dist/_virtual/StructurePaddingsBuiltInControl.js +4 -0
- package/dist/_virtual/TextColorBuiltInControl.js +4 -0
- package/dist/_virtual/TextLineSpacingBuiltInControl.js +4 -0
- package/dist/_virtual/TextSizeBuiltInControl.js +4 -0
- package/dist/_virtual/TextStyleBuiltInControl.js +4 -0
- package/dist/_virtual/UIElement.js +4 -0
- package/dist/_virtual/UIElementTagRegistry.js +4 -0
- package/dist/_virtual/UIElementType.js +4 -0
- package/dist/_virtual/UIElementsAttributes.js +4 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/components/Guido.vue.d.ts +2 -5
- package/dist/components/Guido.vue.js +10 -10
- package/dist/components/Guido.vue2.js +61 -85
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +12 -12
- package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +8 -7
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +2 -3
- package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -15
- package/dist/components/organisms/header/LeftSlot.vue.js +9 -10
- package/dist/components/organisms/header/MiddleSlot.vue.js +6 -6
- package/dist/components/organisms/header/MiddleSlot.vue2.js +16 -15
- package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -3
- package/dist/components/organisms/header/RightSlot.vue.js +4 -6
- package/dist/components/organisms/header/RightSlot.vue2.js +28 -26
- package/dist/components/organisms/header/ViewOptions.vue.js +11 -11
- package/dist/components/organisms/header/ViewOptions.vue2.js +15 -14
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +11 -11
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +5 -5
- package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
- package/dist/components/wrappers/WpDrawer.vue.js +4 -6
- package/dist/composables/useCustomInterfaceAppearance.js +19 -25
- package/dist/composables/useHtmlCompiler.js +9 -17
- package/dist/composables/usePartner.d.ts +0 -1
- package/dist/composables/usePartner.js +9 -16
- package/dist/composables/usePreviewMode.js +13 -13
- package/dist/composables/useStripo.js +52 -61
- package/dist/composables/useToaster.js +17 -17
- package/dist/config/compiler/outlookCompilerRules.d.ts +0 -2
- package/dist/enums/defaults.d.ts +1 -6
- package/dist/enums/defaults.js +10 -50
- package/dist/extensions/DynamicContent/dynamic-content.js +27 -41
- package/dist/extensions/DynamicContent/extension.js +6 -18
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +48 -72
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +49 -74
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +38 -120
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +18 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +32 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +18 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +8 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +34 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +101 -116
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +11 -5
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +43 -23
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +44 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +22 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +17 -21
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +15 -8
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +29 -30
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +44 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +266 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +23 -19
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +19 -37
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +15 -2
- package/dist/static/styles/components/alert-message.css.js +2 -32
- package/dist/static/styles/components/button.css.js +2 -32
- package/dist/static/styles/components/wide-panel.css.js +2 -15
- package/dist/static/styles/variables.css.js +0 -10
- package/dist/stores/dynamic-content.d.ts +0 -12
- package/dist/stores/dynamic-content.js +6 -7
- package/dist/stores/editor.d.ts +1 -194
- package/dist/stores/editor.js +2 -18
- package/dist/stores/preview.d.ts +8 -0
- package/dist/stores/preview.js +20 -12
- package/dist/utils/genericUtil.js +6 -9
- package/dist/utils/templatePreparation.js +14 -21
- package/package.json +3 -5
- package/dist/components/organisms/LoadingWrapper.vue.d.ts +0 -2
- package/dist/components/organisms/LoadingWrapper.vue.js +0 -18
- package/dist/components/organisms/LoadingWrapper.vue2.js +0 -12
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +0 -20
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +0 -37
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +0 -83
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +0 -17
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +0 -30
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +0 -19
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +0 -43
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +0 -74
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +0 -20
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +0 -37
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -108
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
- package/dist/composables/useHtmlValidator.d.ts +0 -4
- package/dist/composables/useHtmlValidator.js +0 -139
- package/dist/composables/useRecommendation.d.ts +0 -19
- package/dist/composables/useRecommendation.js +0 -27
- package/dist/composables/useSave.d.ts +0 -4
- package/dist/composables/useSave.js +0 -15
- package/dist/composables/useStripoEventHandler.d.ts +0 -3
- package/dist/composables/useStripoEventHandler.js +0 -20
- package/dist/config/compiler/outlookCompilerRules.js +0 -36
- package/dist/config/compiler/recommendationCompilerRules.d.ts +0 -2
- package/dist/config/compiler/recommendationCompilerRules.js +0 -83
- package/dist/config/compiler/socialCompilerRules.d.ts +0 -2
- package/dist/config/compiler/socialCompilerRules.js +0 -21
- package/dist/config/compiler/unsubscribeCompilerRules.d.ts +0 -2
- package/dist/config/compiler/unsubscribeCompilerRules.js +0 -64
- package/dist/config/migrator/checkboxMigrator.d.ts +0 -1
- package/dist/config/migrator/checkboxMigrator.js +0 -83
- package/dist/config/migrator/index.d.ts +0 -1
- package/dist/config/migrator/index.js +0 -9
- package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
- package/dist/config/migrator/unsubscribeMigrator.js +0 -112
- package/dist/enums/html-validator.d.ts +0 -6
- package/dist/enums/html-validator.js +0 -7
- package/dist/enums/onboarding.d.ts +0 -1
- package/dist/enums/onboarding.js +0 -8
- package/dist/enums/recommendation.d.ts +0 -54
- package/dist/enums/recommendation.js +0 -56
- package/dist/enums/unsubscribe.d.ts +0 -34
- package/dist/enums/unsubscribe.js +0 -50
- package/dist/extensions/Blocks/Checkbox/block.d.ts +0 -10
- package/dist/extensions/Blocks/Checkbox/block.js +0 -39
- package/dist/extensions/Blocks/Checkbox/control.d.ts +0 -22
- package/dist/extensions/Blocks/Checkbox/control.js +0 -104
- package/dist/extensions/Blocks/Checkbox/extension.d.ts +0 -2
- package/dist/extensions/Blocks/Checkbox/extension.js +0 -20
- package/dist/extensions/Blocks/Checkbox/settingsPanel.d.ts +0 -4
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +0 -38
- package/dist/extensions/Blocks/Checkbox/template.d.ts +0 -6
- package/dist/extensions/Blocks/Checkbox/template.js +0 -75
- package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -30
- package/dist/extensions/Blocks/Unsubscribe/block.js +0 -141
- package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +0 -180
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -54
- package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +0 -2
- package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +0 -4
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -32
- package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -3
- package/dist/extensions/Blocks/Unsubscribe/template.js +0 -28
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
- package/dist/extensions/Blocks/_Boilerplate/block.d.ts +0 -10
- package/dist/extensions/Blocks/_Boilerplate/control.d.ts +0 -17
- package/dist/extensions/Blocks/_Boilerplate/extension.d.ts +0 -2
- package/dist/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +0 -4
- package/dist/extensions/Blocks/_Boilerplate/template.d.ts +0 -6
- package/dist/mock/api/unsubscribe.d.ts +0 -2
- package/dist/mock/api/user-modal-state.d.ts +0 -2
- package/dist/mock/api/validator.d.ts +0 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +0 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +0 -12
- package/dist/services/onboardingApi.d.ts +0 -4
- package/dist/services/onboardingApi.js +0 -23
- package/dist/services/unsubscribeApi.d.ts +0 -4
- package/dist/services/unsubscribeApi.js +0 -16
- package/dist/static/assets/onboarding-img.svg.js +0 -4
- package/dist/static/styles/components/loader.css.js +0 -10
- package/dist/static/styles/components/notification.css.js +0 -55
- package/dist/static/styles/components/popup.css.js +0 -68
- package/dist/static/styles/customEditorStyle.css.js +0 -24
- package/dist/stores/onboarding.d.ts +0 -1068
- package/dist/stores/onboarding.js +0 -95
- package/dist/stores/recommendation.d.ts +0 -10
- package/dist/stores/recommendation.js +0 -9
- package/dist/stores/unsubscribe.d.ts +0 -186
- package/dist/stores/unsubscribe.js +0 -128
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
var E = Object.defineProperty;
|
|
2
|
-
var c = (o, s, t) => s in o ? E(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
|
-
var a = (o, s, t) => c(o, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import { useHttp as p } from "../../../composables/useHttp.js";
|
|
5
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js";
|
|
6
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
7
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
8
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
9
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
10
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
11
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
12
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
13
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
14
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
15
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
16
|
-
import { UEAttr as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js";
|
|
17
|
-
import { UIElementType as r } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
18
|
-
import { Control as m } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js";
|
|
19
|
-
import { ModificationDescription as l } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js";
|
|
20
|
-
const d = "ui-elements-checkbox", n = "select", { get: L } = p();
|
|
21
|
-
class K extends m {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...arguments);
|
|
24
|
-
a(this, "currentNode");
|
|
25
|
-
a(this, "selectedUnsubGroup");
|
|
26
|
-
a(this, "unsubList", []);
|
|
27
|
-
}
|
|
28
|
-
getId() {
|
|
29
|
-
return d;
|
|
30
|
-
}
|
|
31
|
-
_setFormValues() {
|
|
32
|
-
this.api.updateValues({
|
|
33
|
-
[n]: ""
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
_getLabel(t, i = `${Math.random()}`) {
|
|
37
|
-
return `
|
|
38
|
-
<${r.LABEL}
|
|
39
|
-
${e.LABEL.text}="${t}"
|
|
40
|
-
${e.LABEL.name}="${i}">
|
|
41
|
-
</${r.LABEL}>
|
|
42
|
-
`;
|
|
43
|
-
}
|
|
44
|
-
_getSelectItem(t, i) {
|
|
45
|
-
return `
|
|
46
|
-
<${r.SELECT_ITEM}
|
|
47
|
-
${e.SELECT_ITEM.text}="${t}"
|
|
48
|
-
${e.SELECT_ITEM.value}="${i}">
|
|
49
|
-
</${r.SELECT_ITEM}>`;
|
|
50
|
-
}
|
|
51
|
-
_getSelect() {
|
|
52
|
-
return this.unsubList.map((t) => this._getSelectItem(t.name, t.sendGridId)).join("");
|
|
53
|
-
}
|
|
54
|
-
getTemplate() {
|
|
55
|
-
return `
|
|
56
|
-
<div class="checkbox-controls-container">
|
|
57
|
-
<div class="checkbox-select-container container two-columns stretch">
|
|
58
|
-
<${r.LABEL}
|
|
59
|
-
${e.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
|
|
60
|
-
${e.LABEL.name}="${Math.random()}">
|
|
61
|
-
</${r.LABEL}>
|
|
62
|
-
|
|
63
|
-
<${r.SELECTPICKER}
|
|
64
|
-
${e.SELECTPICKER.name}="${n}"
|
|
65
|
-
${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
66
|
-
${this._getSelect()}
|
|
67
|
-
</${r.SELECTPICKER}>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
`;
|
|
71
|
-
}
|
|
72
|
-
_onSelectChange(t) {
|
|
73
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new l(`Updated text to ${t}`));
|
|
74
|
-
}
|
|
75
|
-
_listenToFormUpdates() {
|
|
76
|
-
this.api.onValueChanged(n, (t) => this._onSelectChange(t));
|
|
77
|
-
}
|
|
78
|
-
onTemplateNodeUpdated(t) {
|
|
79
|
-
if (this.currentNode = t, "getAttribute" in t) {
|
|
80
|
-
const i = Number(t.getAttribute("id"));
|
|
81
|
-
i && (this.selectedUnsubGroup = i, this.api.updateValues({
|
|
82
|
-
[n]: this.selectedUnsubGroup
|
|
83
|
-
}));
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
87
|
-
async onRender() {
|
|
88
|
-
const t = await L(
|
|
89
|
-
"/unsubscribe-groups/unsubscribe-list"
|
|
90
|
-
), i = t.data.map((u) => ({
|
|
91
|
-
[e.SELECT_ITEM.text]: u.name,
|
|
92
|
-
[e.SELECT_ITEM.value]: u.sendGridId
|
|
93
|
-
}));
|
|
94
|
-
this.unsubList = t.data, this.api.setUIEAttribute(
|
|
95
|
-
n,
|
|
96
|
-
e.SELECTPICKER.items,
|
|
97
|
-
i
|
|
98
|
-
), this._setFormValues(), this._listenToFormUpdates();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
export {
|
|
102
|
-
d as CHECKBOX_CONTROL_BLOCK_ID,
|
|
103
|
-
K as CheckboxControl
|
|
104
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js";
|
|
2
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
3
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
4
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
5
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
6
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
7
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
8
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
9
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
10
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
11
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
12
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
13
|
-
import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js";
|
|
14
|
-
import { CheckboxBlock as t } from "./block.js";
|
|
15
|
-
import { CheckboxControl as r } from "./control.js";
|
|
16
|
-
import { CheckboxBlockSettings as i } from "./settingsPanel.js";
|
|
17
|
-
const g = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(r).build();
|
|
18
|
-
export {
|
|
19
|
-
g as default
|
|
20
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js";
|
|
2
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
3
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
4
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
5
|
-
import { ContainerControls as i, TextControls as m } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
6
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
7
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
8
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
9
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
10
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
11
|
-
import { SettingsTab as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
12
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
13
|
-
import { SettingsPanelRegistry as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js";
|
|
14
|
-
import { SettingsPanelTab as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js";
|
|
15
|
-
import { CHECKBOX_BLOCK_ID as p } from "./block.js";
|
|
16
|
-
import { CHECKBOX_CONTROL_BLOCK_ID as C } from "./control.js";
|
|
17
|
-
class x extends e {
|
|
18
|
-
registerBlockControls(r) {
|
|
19
|
-
r[p] = [
|
|
20
|
-
new t(
|
|
21
|
-
o.SETTINGS,
|
|
22
|
-
[
|
|
23
|
-
C,
|
|
24
|
-
i.EXTERNAL_INDENTS
|
|
25
|
-
]
|
|
26
|
-
),
|
|
27
|
-
new t(
|
|
28
|
-
o.STYLES,
|
|
29
|
-
[
|
|
30
|
-
m.TEXT_BLOCK_BACKGROUND_COLOR
|
|
31
|
-
]
|
|
32
|
-
)
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
x as CheckboxBlockSettings
|
|
38
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"checkbox-block\" \n class=\"checkbox-block-v2 esd-block-checkbox esd-checkbox-block esd-extension-block es-p20\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"39\" style=\"vertical-align: top\">\n <input type=\"checkbox\">\n </td>\n <td align=\"left\" width=\"816\" style=\"vertical-align: top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
|
|
2
|
-
/**
|
|
3
|
-
* @returns The template for the default checkbox block
|
|
4
|
-
*/
|
|
5
|
-
export declare function getDefaultTemplate(): string;
|
|
6
|
-
export default migrationTemplate;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js";
|
|
2
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
3
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
4
|
-
import { BlockType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
5
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
6
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
7
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
8
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
9
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
10
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
11
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
12
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
13
|
-
const e = {
|
|
14
|
-
TITLE: "Unsubscribe From All Email Lists",
|
|
15
|
-
DESCRIPTION: "You will still receive important transactional and billing-related emails."
|
|
16
|
-
}, l = `
|
|
17
|
-
<td align="left" class="checkbox-block-v2 esd-block-checkbox es-p20">
|
|
18
|
-
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
19
|
-
<tbody>
|
|
20
|
-
<tr>
|
|
21
|
-
<td align="left" width="39" style="vertical-align: top;">
|
|
22
|
-
<input type="checkbox">
|
|
23
|
-
</td>
|
|
24
|
-
<td align="left" width="816" style="vertical-align: top;">
|
|
25
|
-
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
26
|
-
<tbody>
|
|
27
|
-
<${t.BLOCK_TEXT}>
|
|
28
|
-
{-{-TITLE-}-}
|
|
29
|
-
</${t.BLOCK_TEXT}>
|
|
30
|
-
<${t.BLOCK_TEXT}>
|
|
31
|
-
{-{-DESCRIPTION-}-}
|
|
32
|
-
</${t.BLOCK_TEXT}>
|
|
33
|
-
</tbody>
|
|
34
|
-
</table>
|
|
35
|
-
</td>
|
|
36
|
-
</tr>
|
|
37
|
-
</tbody>
|
|
38
|
-
</table>
|
|
39
|
-
</td>
|
|
40
|
-
`, m = `
|
|
41
|
-
<td
|
|
42
|
-
align="left"
|
|
43
|
-
esd-extension-block-id="checkbox-block"
|
|
44
|
-
class="checkbox-block-v2 esd-block-checkbox esd-checkbox-block esd-extension-block es-p20"
|
|
45
|
-
>
|
|
46
|
-
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
47
|
-
<tbody>
|
|
48
|
-
<tr>
|
|
49
|
-
<td align="left" width="39" style="vertical-align: top">
|
|
50
|
-
<input type="checkbox">
|
|
51
|
-
</td>
|
|
52
|
-
<td align="left" width="816" style="vertical-align: top">
|
|
53
|
-
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
54
|
-
<tbody>
|
|
55
|
-
<tr>
|
|
56
|
-
{-{-TITLE-}-}
|
|
57
|
-
</tr>
|
|
58
|
-
<tr>
|
|
59
|
-
{-{-DESCRIPTION-}-}
|
|
60
|
-
</tr>
|
|
61
|
-
</tbody>
|
|
62
|
-
</table>
|
|
63
|
-
</td>
|
|
64
|
-
</tr>
|
|
65
|
-
</tbody>
|
|
66
|
-
</table>
|
|
67
|
-
</td>
|
|
68
|
-
`;
|
|
69
|
-
function h() {
|
|
70
|
-
return l.replace("{-{-TITLE-}-}", `<p path="1">${e.TITLE}</p>`).replace("{-{-DESCRIPTION-}-}", `<p path="1">${e.DESCRIPTION}</p>`);
|
|
71
|
-
}
|
|
72
|
-
export {
|
|
73
|
-
m as default,
|
|
74
|
-
h as getDefaultTemplate
|
|
75
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
|
|
3
|
-
export declare const UNSUBSCRIBE_BLOCK_ID = "unsubscribe-block";
|
|
4
|
-
export declare class UnsubscribeBlock extends Block {
|
|
5
|
-
private selectEventListener;
|
|
6
|
-
private cancelEventListener;
|
|
7
|
-
private currentNode?;
|
|
8
|
-
getId(): string;
|
|
9
|
-
getIcon(): string;
|
|
10
|
-
getBlockCompositionType(): BlockCompositionType;
|
|
11
|
-
getName(): string;
|
|
12
|
-
getDescription(): string;
|
|
13
|
-
getTemplate(): string;
|
|
14
|
-
onCreated(node: ImmutableHtmlNode): void;
|
|
15
|
-
onSelect(node: ImmutableHtmlNode): undefined;
|
|
16
|
-
onDelete(node: ImmutableHtmlNode): undefined;
|
|
17
|
-
private _setupSelectEventListener;
|
|
18
|
-
private _removeSelectEventListener;
|
|
19
|
-
private _setupCancelEventListener;
|
|
20
|
-
private _removeCancelEventListener;
|
|
21
|
-
private _handleCancel;
|
|
22
|
-
private _removeEventListeners;
|
|
23
|
-
private _updateBlock;
|
|
24
|
-
private _getMergeTag;
|
|
25
|
-
private _openDrawer;
|
|
26
|
-
private _checkExistingBlocks;
|
|
27
|
-
private _loadBlockState;
|
|
28
|
-
private _resetStoreState;
|
|
29
|
-
private _removeBlockTemplatesFromStore;
|
|
30
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
var S = Object.defineProperty;
|
|
2
|
-
var _ = (n, s, e) => s in n ? S(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
|
|
3
|
-
var u = (n, s, e) => _(n, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
-
import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
|
|
5
|
-
import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
|
|
6
|
-
import { Block as d } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js";
|
|
7
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js";
|
|
8
|
-
import { BlockCompositionType as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
9
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
10
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
11
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
12
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
13
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
14
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
15
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
16
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
17
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
18
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
19
|
-
import { ModificationDescription as m } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js";
|
|
20
|
-
import { getDefaultTemplate as L } from "./template.js";
|
|
21
|
-
import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
|
|
22
|
-
import { parsePageList as p } from "./utils/utils.js";
|
|
23
|
-
const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', f = ".unsubscribe-block-v2", B = "{{ins-unsubscribe-link}}", C = {
|
|
24
|
-
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
25
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
26
|
-
};
|
|
27
|
-
class $ extends d {
|
|
28
|
-
constructor() {
|
|
29
|
-
super(...arguments);
|
|
30
|
-
u(this, "selectEventListener", null);
|
|
31
|
-
u(this, "cancelEventListener", null);
|
|
32
|
-
u(this, "currentNode");
|
|
33
|
-
}
|
|
34
|
-
getId() {
|
|
35
|
-
return v;
|
|
36
|
-
}
|
|
37
|
-
getIcon() {
|
|
38
|
-
return "mail-info";
|
|
39
|
-
}
|
|
40
|
-
getBlockCompositionType() {
|
|
41
|
-
return h.BLOCK;
|
|
42
|
-
}
|
|
43
|
-
getName() {
|
|
44
|
-
return this.api.translate("Unsubscribe Block");
|
|
45
|
-
}
|
|
46
|
-
getDescription() {
|
|
47
|
-
return this.api.translate("Unsubscribe Block Description");
|
|
48
|
-
}
|
|
49
|
-
getTemplate() {
|
|
50
|
-
return L();
|
|
51
|
-
}
|
|
52
|
-
onCreated(e) {
|
|
53
|
-
console.debug("on created", e), !("getAttribute" in e && e.getAttribute("data-migration")) && (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
54
|
-
}
|
|
55
|
-
onSelect(e) {
|
|
56
|
-
this.currentNode = e, this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener();
|
|
57
|
-
}
|
|
58
|
-
onDelete(e) {
|
|
59
|
-
this._removeEventListeners(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
|
|
60
|
-
}
|
|
61
|
-
_setupSelectEventListener() {
|
|
62
|
-
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
63
|
-
const i = e, { collectionType: t, selectedPages: r } = i.detail;
|
|
64
|
-
this._updateBlock(t, r.join(","));
|
|
65
|
-
}, document.addEventListener(a.SELECT, this.selectEventListener);
|
|
66
|
-
}
|
|
67
|
-
_removeSelectEventListener() {
|
|
68
|
-
this.selectEventListener && (document.removeEventListener(a.SELECT, this.selectEventListener), this.selectEventListener = null);
|
|
69
|
-
}
|
|
70
|
-
_setupCancelEventListener() {
|
|
71
|
-
this._removeCancelEventListener(), this.cancelEventListener = () => {
|
|
72
|
-
this._handleCancel();
|
|
73
|
-
}, document.addEventListener(a.CANCEL, this.cancelEventListener);
|
|
74
|
-
}
|
|
75
|
-
_removeCancelEventListener() {
|
|
76
|
-
this.cancelEventListener && (document.removeEventListener(a.CANCEL, this.cancelEventListener), this.cancelEventListener = null);
|
|
77
|
-
}
|
|
78
|
-
_handleCancel() {
|
|
79
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).delete().apply(new m("Removed unsubscribe block due to cancel"));
|
|
80
|
-
}
|
|
81
|
-
_removeEventListeners() {
|
|
82
|
-
this._removeSelectEventListener(), this._removeCancelEventListener();
|
|
83
|
-
}
|
|
84
|
-
_updateBlock(e, i) {
|
|
85
|
-
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
86
|
-
return;
|
|
87
|
-
const t = this.currentNode.querySelector(g);
|
|
88
|
-
if (!t)
|
|
89
|
-
return;
|
|
90
|
-
const r = this._getMergeTag(e);
|
|
91
|
-
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", r).apply(new m(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, i).apply(new m("Updated unsubscribe block metadata"));
|
|
92
|
-
}
|
|
93
|
-
_getMergeTag(e) {
|
|
94
|
-
return C[e] ?? B;
|
|
95
|
-
}
|
|
96
|
-
_openDrawer() {
|
|
97
|
-
try {
|
|
98
|
-
const e = c();
|
|
99
|
-
e.typeSelectionDrawerStatus = !0;
|
|
100
|
-
} catch (e) {
|
|
101
|
-
console.error("[UnsubscribeBlock] Failed to open drawer:", e);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
_checkExistingBlocks() {
|
|
105
|
-
const e = c();
|
|
106
|
-
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(f).forEach((t) => {
|
|
107
|
-
if ("getAttribute" in t) {
|
|
108
|
-
const r = t.getAttribute(o.PAGE_TYPE);
|
|
109
|
-
if (r) {
|
|
110
|
-
const l = Number(r);
|
|
111
|
-
l === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : l === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
_loadBlockState(e) {
|
|
117
|
-
if (!("getAttribute" in e))
|
|
118
|
-
return;
|
|
119
|
-
const i = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
|
|
120
|
-
if (!i || !t)
|
|
121
|
-
return;
|
|
122
|
-
const r = c(), l = Number(i), b = p(t);
|
|
123
|
-
r.setCollectionWithoutAutoSelection(l), r.loadSelectedTemplates(b);
|
|
124
|
-
}
|
|
125
|
-
_resetStoreState() {
|
|
126
|
-
c().$reset();
|
|
127
|
-
}
|
|
128
|
-
_removeBlockTemplatesFromStore(e) {
|
|
129
|
-
if (!("getAttribute" in e))
|
|
130
|
-
return;
|
|
131
|
-
const i = e.getAttribute(o.PAGE_LIST);
|
|
132
|
-
if (!i)
|
|
133
|
-
return;
|
|
134
|
-
const t = c(), r = p(i);
|
|
135
|
-
t.removeUnsubscribePages(r);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
export {
|
|
139
|
-
v as UNSUBSCRIBE_BLOCK_ID,
|
|
140
|
-
$ as UnsubscribeBlock
|
|
141
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { Control } from '@stripoinc/ui-editor-extensions';
|
|
3
|
-
export declare const UNSUBSCRIBE_CONTROL_ID = "ui-elements-unsubscribe";
|
|
4
|
-
export declare class UnsubscribeControl extends Control {
|
|
5
|
-
private currentPreviewIndex;
|
|
6
|
-
private currentNode?;
|
|
7
|
-
private currentPages?;
|
|
8
|
-
private valueChangeHandlers;
|
|
9
|
-
private lastParsedAttribute?;
|
|
10
|
-
getId(): string;
|
|
11
|
-
getTemplate(): string;
|
|
12
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
13
|
-
onRender(): void;
|
|
14
|
-
onDestroy(): void;
|
|
15
|
-
private get totalTemplates();
|
|
16
|
-
private _listenToFormUpdates;
|
|
17
|
-
private _onButtonClick;
|
|
18
|
-
private _onPrevClick;
|
|
19
|
-
private _onNextClick;
|
|
20
|
-
private _updatePreview;
|
|
21
|
-
private _updateCounter;
|
|
22
|
-
private _getPreview;
|
|
23
|
-
private _getButton;
|
|
24
|
-
private _getLabel;
|
|
25
|
-
private _getIconButton;
|
|
26
|
-
private _getPrevButton;
|
|
27
|
-
private _getNextButton;
|
|
28
|
-
private _getCounterText;
|
|
29
|
-
}
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
var d = Object.defineProperty;
|
|
2
|
-
var h = (o, n, t) => n in o ? d(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
|
|
3
|
-
var u = (o, n, t) => h(o, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
-
import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
|
|
5
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js";
|
|
6
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
7
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
8
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
9
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
10
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
11
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
12
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
13
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
14
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
15
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
16
|
-
import { UEAttr as i } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js";
|
|
17
|
-
import { UIElementType as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
18
|
-
import { Control as T } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js";
|
|
19
|
-
import { DATA_ATTRIBUTES as p } from "./utils/constants.js";
|
|
20
|
-
import { parsePageList as g } from "./utils/utils.js";
|
|
21
|
-
const _ = "ui-elements-unsubscribe", r = {
|
|
22
|
-
SELECT_BUTTON: "selectTemplateButton",
|
|
23
|
-
PREV_BUTTON: "prevButton",
|
|
24
|
-
NEXT_BUTTON: "nextButton",
|
|
25
|
-
COUNTER_TEXT: "counterText",
|
|
26
|
-
PREVIEW_IMAGE: "previewImage"
|
|
27
|
-
};
|
|
28
|
-
class y extends T {
|
|
29
|
-
constructor() {
|
|
30
|
-
super(...arguments);
|
|
31
|
-
u(this, "currentPreviewIndex", 0);
|
|
32
|
-
u(this, "currentNode");
|
|
33
|
-
u(this, "currentPages");
|
|
34
|
-
u(this, "valueChangeHandlers", []);
|
|
35
|
-
u(this, "lastParsedAttribute");
|
|
36
|
-
}
|
|
37
|
-
getId() {
|
|
38
|
-
return _;
|
|
39
|
-
}
|
|
40
|
-
getTemplate() {
|
|
41
|
-
return `
|
|
42
|
-
<div class="unsubscribe-controls-container container stretch widest-spacing">
|
|
43
|
-
${this._getPreview()}
|
|
44
|
-
${this._getButton()}
|
|
45
|
-
</div>
|
|
46
|
-
`;
|
|
47
|
-
}
|
|
48
|
-
onTemplateNodeUpdated(t) {
|
|
49
|
-
if (this.currentNode = t, "getAttribute" in this.currentNode) {
|
|
50
|
-
const e = this.currentNode.getAttribute(p.PAGE_LIST);
|
|
51
|
-
e && (e !== this.lastParsedAttribute && (this.currentPages = g(e), this.lastParsedAttribute = e, this.currentPreviewIndex = 0), this._updatePreview(), this._updateCounter());
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
onRender() {
|
|
55
|
-
this._listenToFormUpdates(), this._updateCounter();
|
|
56
|
-
}
|
|
57
|
-
onDestroy() {
|
|
58
|
-
this.valueChangeHandlers.forEach((t) => {
|
|
59
|
-
typeof t == "function" && t();
|
|
60
|
-
}), this.valueChangeHandlers = [], this.currentNode = void 0, this.currentPages = void 0, this.currentPreviewIndex = 0, this.lastParsedAttribute = void 0;
|
|
61
|
-
}
|
|
62
|
-
get totalTemplates() {
|
|
63
|
-
var t;
|
|
64
|
-
return ((t = this.currentPages) == null ? void 0 : t.length) ?? 0;
|
|
65
|
-
}
|
|
66
|
-
_listenToFormUpdates() {
|
|
67
|
-
this.valueChangeHandlers.push(
|
|
68
|
-
this.api.onValueChanged(r.SELECT_BUTTON, () => this._onButtonClick())
|
|
69
|
-
), this.valueChangeHandlers.push(
|
|
70
|
-
this.api.onValueChanged(r.PREV_BUTTON, () => this._onPrevClick())
|
|
71
|
-
), this.valueChangeHandlers.push(
|
|
72
|
-
this.api.onValueChanged(r.NEXT_BUTTON, () => this._onNextClick())
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
_onButtonClick() {
|
|
76
|
-
try {
|
|
77
|
-
const t = l();
|
|
78
|
-
t.activeType = t.getSelectedCollection[this.currentPreviewIndex], t.pageSelectionUpdateStatus = !0, t.pageSelectionDrawerStatus = !0;
|
|
79
|
-
} catch (t) {
|
|
80
|
-
console.error("[UnsubscribeControl] Failed to open drawer:", t);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
_onPrevClick() {
|
|
84
|
-
this.currentPreviewIndex > 0 && (this.currentPreviewIndex--, this._updatePreview(), this._updateCounter());
|
|
85
|
-
}
|
|
86
|
-
_onNextClick() {
|
|
87
|
-
this.currentPreviewIndex < this.totalTemplates - 1 && (this.currentPreviewIndex++, this._updatePreview(), this._updateCounter());
|
|
88
|
-
}
|
|
89
|
-
_updatePreview() {
|
|
90
|
-
var t;
|
|
91
|
-
if ((t = this.currentPages) != null && t.length)
|
|
92
|
-
try {
|
|
93
|
-
const e = this.currentPages[this.currentPreviewIndex], a = l().getThumbnailByTemplateId(e);
|
|
94
|
-
if (!a) {
|
|
95
|
-
console.warn("[UnsubscribeControl] No thumbnail found for page:", e);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
this.api.updateValues({
|
|
99
|
-
[r.PREVIEW_IMAGE]: a
|
|
100
|
-
});
|
|
101
|
-
} catch (e) {
|
|
102
|
-
console.error("[UnsubscribeControl] Failed to update preview:", e);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
_updateCounter() {
|
|
106
|
-
const t = this.currentPreviewIndex + 1, e = this.totalTemplates, c = this.currentPreviewIndex === 0, a = this.currentPreviewIndex >= e - 1;
|
|
107
|
-
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, a), this.api.setUIEAttribute(
|
|
108
|
-
r.COUNTER_TEXT,
|
|
109
|
-
i.LABEL.text,
|
|
110
|
-
`Showing ${t} of ${e}`
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
_getPreview() {
|
|
114
|
-
return `
|
|
115
|
-
<div class="unsubscribe-preview-container">
|
|
116
|
-
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
|
|
117
|
-
<div style="font-weight: 500;">Unsubscribe Template</div>
|
|
118
|
-
<div style="display: flex; gap: 2px; align-items: center; color: #666;">
|
|
119
|
-
${this._getPrevButton()}
|
|
120
|
-
${this._getCounterText()}
|
|
121
|
-
${this._getNextButton()}
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
<unsubscribe-preview name="${r.PREVIEW_IMAGE}"></unsubscribe-preview>
|
|
125
|
-
</div>
|
|
126
|
-
`;
|
|
127
|
-
}
|
|
128
|
-
_getButton() {
|
|
129
|
-
return `
|
|
130
|
-
<${s.BUTTON}
|
|
131
|
-
id="${r.SELECT_BUTTON}"
|
|
132
|
-
class="primary full-width"
|
|
133
|
-
${i.BUTTON.name}="${r.SELECT_BUTTON}"
|
|
134
|
-
${i.BUTTON.caption}="${this.api.translate("Select Template")}"
|
|
135
|
-
>
|
|
136
|
-
</${s.BUTTON}>
|
|
137
|
-
`;
|
|
138
|
-
}
|
|
139
|
-
_getLabel(t, e) {
|
|
140
|
-
return `
|
|
141
|
-
<${s.LABEL}
|
|
142
|
-
${i.LABEL.text}="${t}"
|
|
143
|
-
${i.LABEL.name}="${e}"
|
|
144
|
-
>
|
|
145
|
-
</${s.LABEL}>
|
|
146
|
-
`;
|
|
147
|
-
}
|
|
148
|
-
_getIconButton(t, e, c) {
|
|
149
|
-
const a = c ? `${i.BUTTON.disabled}="true"` : "";
|
|
150
|
-
return `
|
|
151
|
-
<${s.BUTTON}
|
|
152
|
-
id="${t}"
|
|
153
|
-
class="flat-inline flat-white"
|
|
154
|
-
${i.BUTTON.name}="${t}"
|
|
155
|
-
${a}
|
|
156
|
-
>
|
|
157
|
-
<${s.ICON}
|
|
158
|
-
src="${e}"
|
|
159
|
-
class="icon-button"
|
|
160
|
-
></${s.ICON}>
|
|
161
|
-
</${s.BUTTON}>
|
|
162
|
-
`;
|
|
163
|
-
}
|
|
164
|
-
_getPrevButton() {
|
|
165
|
-
const t = this.currentPreviewIndex === 0;
|
|
166
|
-
return this._getIconButton(r.PREV_BUTTON, "arrow-back", t);
|
|
167
|
-
}
|
|
168
|
-
_getNextButton() {
|
|
169
|
-
const t = this.currentPreviewIndex >= this.totalTemplates - 1;
|
|
170
|
-
return this._getIconButton(r.NEXT_BUTTON, "arrow-right", t);
|
|
171
|
-
}
|
|
172
|
-
_getCounterText() {
|
|
173
|
-
const e = `Showing ${this.currentPreviewIndex + 1} of ${this.totalTemplates}`;
|
|
174
|
-
return this._getLabel(e, r.COUNTER_TEXT);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
export {
|
|
178
|
-
_ as UNSUBSCRIBE_CONTROL_ID,
|
|
179
|
-
y as UnsubscribeControl
|
|
180
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { UIElement } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
export declare const PREVIEW_UI_ELEMENT_ID = "unsubscribe-preview";
|
|
3
|
-
export declare class PreviewUIElement extends UIElement {
|
|
4
|
-
private imgElement?;
|
|
5
|
-
getId(): string;
|
|
6
|
-
getTemplate(): string;
|
|
7
|
-
onRender(container: HTMLElement): void;
|
|
8
|
-
setValue(value: string): void;
|
|
9
|
-
getValue(): string;
|
|
10
|
-
onDestroy(): void;
|
|
11
|
-
}
|