@useinsider/guido 1.0.2-beta.ab357f5 → 1.0.2-beta.ad1dcd9
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 +1 -1
- package/dist/@types/generic.d.ts +8 -0
- package/dist/components/Guido.vue.d.ts +2 -2
- package/dist/components/Guido.vue.js +2 -2
- package/dist/components/Guido.vue2.js +66 -61
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -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.d.ts +2 -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.d.ts +2 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +108 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -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.d.ts +6 -4
- package/dist/components/wrappers/WpDrawer.vue.js +6 -4
- package/dist/composables/useHtmlValidator.d.ts +2 -1
- package/dist/composables/useHtmlValidator.js +114 -95
- package/dist/composables/useSave.js +6 -6
- package/dist/composables/useStripo.js +35 -29
- package/dist/config/compiler/unsubscribeCompilerRules.js +19 -19
- package/dist/config/migrator/checkboxMigrator.d.ts +1 -0
- package/dist/config/migrator/checkboxMigrator.js +83 -0
- package/dist/config/migrator/index.d.ts +1 -0
- package/dist/config/migrator/index.js +9 -0
- package/dist/config/migrator/unsubscribeMigrator.d.ts +1 -0
- package/dist/config/migrator/unsubscribeMigrator.js +112 -0
- package/dist/enums/defaults.js +6 -3
- package/dist/enums/unsubscribe.d.ts +19 -0
- package/dist/enums/unsubscribe.js +39 -6
- package/dist/extensions/Blocks/Checkbox/block.d.ts +10 -0
- package/dist/extensions/Blocks/Checkbox/block.js +39 -0
- package/dist/extensions/Blocks/Checkbox/control.d.ts +22 -0
- package/dist/extensions/Blocks/Checkbox/control.js +104 -0
- package/dist/extensions/Blocks/Checkbox/extension.d.ts +2 -0
- package/dist/extensions/Blocks/Checkbox/extension.js +20 -0
- package/dist/extensions/Blocks/Checkbox/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +38 -0
- package/dist/extensions/Blocks/Checkbox/template.d.ts +6 -0
- package/dist/extensions/Blocks/Checkbox/template.js +75 -0
- package/dist/extensions/Blocks/Unsubscribe/block.d.ts +30 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +141 -0
- package/dist/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
- package/dist/extensions/Blocks/Unsubscribe/control.js +180 -0
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +54 -0
- package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +2 -0
- package/dist/extensions/Blocks/Unsubscribe/extension.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +32 -0
- package/dist/extensions/Blocks/Unsubscribe/template.d.ts +3 -0
- package/dist/extensions/Blocks/Unsubscribe/template.js +28 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +6 -0
- package/dist/extensions/Blocks/_Boilerplate/block.d.ts +10 -0
- package/dist/extensions/Blocks/_Boilerplate/control.d.ts +17 -0
- package/dist/extensions/Blocks/_Boilerplate/extension.d.ts +2 -0
- package/dist/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/_Boilerplate/template.d.ts +6 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +41 -27
- package/dist/extensions/DynamicContent/extension.js +18 -6
- package/dist/guido.css +1 -1
- package/dist/mock/api/unsubscribe.d.ts +2 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +72 -48
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +74 -49
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +120 -38
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +12 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +116 -101
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +12 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +5 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +23 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +21 -17
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +8 -15
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +30 -29
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +19 -23
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +37 -19
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +2 -15
- package/dist/services/unsubscribeApi.d.ts +4 -0
- package/dist/services/unsubscribeApi.js +16 -0
- package/dist/stores/unsubscribe.d.ts +183 -5
- package/dist/stores/unsubscribe.js +125 -6
- package/package.json +2 -2
- package/dist/_virtual/AddCustomFont.js +0 -4
- package/dist/_virtual/AiAssistantValueType.js +0 -4
- package/dist/_virtual/BackgroundColorBuiltInControl.js +0 -4
- package/dist/_virtual/BackgroundImageBuiltInControl.js +0 -4
- package/dist/_virtual/Block.js +0 -4
- package/dist/_virtual/BlockAttributes.js +0 -4
- package/dist/_virtual/BlockCompositionType.js +0 -4
- package/dist/_virtual/BlockPaddingsBuiltInControl.js +0 -4
- package/dist/_virtual/BlockRenderer.js +0 -4
- package/dist/_virtual/BlockType.js +0 -4
- package/dist/_virtual/BlocksPanel.js +0 -4
- package/dist/_virtual/BuiltInControl.js +0 -4
- package/dist/_virtual/BuiltInControlTypes.js +0 -4
- package/dist/_virtual/ButtonBorderBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonColorBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonFontColorBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonTextBuiltInControl.js +0 -4
- package/dist/_virtual/ContextAction.js +0 -4
- package/dist/_virtual/ContextActionType.js +0 -4
- package/dist/_virtual/Control.js +0 -4
- package/dist/_virtual/EditorStatePropertyType.js +0 -4
- package/dist/_virtual/Extension.js +0 -4
- package/dist/_virtual/ExtensionBuilder.js +0 -4
- package/dist/_virtual/FontFamilyBuiltInControl.js +0 -4
- package/dist/_virtual/LinkColorBuiltInControl.js +0 -4
- package/dist/_virtual/ModificationDescription.js +0 -4
- package/dist/_virtual/PanelPosition.js +0 -4
- package/dist/_virtual/PreviewDeviceMode.js +0 -4
- package/dist/_virtual/SettingsPanelRegistry.js +0 -4
- package/dist/_virtual/SettingsPanelTab.js +0 -4
- package/dist/_virtual/SettingsTab.js +0 -4
- package/dist/_virtual/StructureBorderBuiltInControl.js +0 -4
- package/dist/_virtual/StructurePaddingsBuiltInControl.js +0 -4
- package/dist/_virtual/TextColorBuiltInControl.js +0 -4
- package/dist/_virtual/TextLineSpacingBuiltInControl.js +0 -4
- package/dist/_virtual/TextSizeBuiltInControl.js +0 -4
- package/dist/_virtual/TextStyleBuiltInControl.js +0 -4
- package/dist/_virtual/UIElement.js +0 -4
- package/dist/_virtual/UIElementTagRegistry.js +0 -4
- package/dist/_virtual/UIElementType.js +0 -4
- package/dist/_virtual/UIElementsAttributes.js +0 -4
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index2.js +0 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +0 -18
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +0 -32
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +0 -18
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +0 -8
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +0 -34
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +0 -44
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +0 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +0 -44
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +0 -266
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
var r;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var n = (e, s, t) => s in e ? r(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
3
|
+
var l = (e, s, t) => n(e, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
class o {
|
|
5
|
+
constructor(s, t) {
|
|
6
|
+
l(this, "tabId");
|
|
7
|
+
l(this, "label");
|
|
8
|
+
l(this, "controlsIds");
|
|
9
|
+
this.tabId = s, this.controlsIds = t;
|
|
10
|
+
}
|
|
11
|
+
getTabId() {
|
|
12
|
+
return this.tabId;
|
|
13
|
+
}
|
|
14
|
+
getLabel() {
|
|
15
|
+
return this.label;
|
|
16
|
+
}
|
|
17
|
+
getControlsIds() {
|
|
18
|
+
return this.controlsIds;
|
|
19
|
+
}
|
|
20
|
+
withLabel(s) {
|
|
21
|
+
return this.label = s, this;
|
|
22
|
+
}
|
|
23
|
+
addControl(s, t) {
|
|
24
|
+
return t < 0 ? this.controlsIds.unshift(s) : t > this.controlsIds.length ? this.controlsIds.push(s) : this.controlsIds.splice(t, 0, s), this;
|
|
25
|
+
}
|
|
26
|
+
deleteControl(s) {
|
|
27
|
+
const t = this.controlsIds.indexOf(s);
|
|
28
|
+
t !== -1 && this.controlsIds.splice(t, 1);
|
|
29
|
+
}
|
|
29
30
|
}
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
o as SettingsPanelTab
|
|
32
33
|
};
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}, t;
|
|
20
|
-
})()
|
|
21
|
-
);
|
|
22
|
-
return i.ModificationDescription = e, i;
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var e = (t, s, a) => s in t ? i(t, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[s] = a;
|
|
3
|
+
var r = (t, s, a) => e(t, typeof s != "symbol" ? s + "" : s, a);
|
|
4
|
+
class o {
|
|
5
|
+
constructor(s) {
|
|
6
|
+
r(this, "key");
|
|
7
|
+
r(this, "params");
|
|
8
|
+
this.key = s;
|
|
9
|
+
}
|
|
10
|
+
withParams(s) {
|
|
11
|
+
return this.params = s, this;
|
|
12
|
+
}
|
|
13
|
+
getValue() {
|
|
14
|
+
return {
|
|
15
|
+
key: this.key,
|
|
16
|
+
params: this.params
|
|
17
|
+
};
|
|
18
|
+
}
|
|
23
19
|
}
|
|
24
20
|
export {
|
|
25
|
-
|
|
21
|
+
o as ModificationDescription
|
|
26
22
|
};
|
|
@@ -1,22 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
var n;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var n = (t, e, a) => e in t ? u(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
3
|
+
var l = (t, e, a) => n(t, typeof e != "symbol" ? e + "" : e, a);
|
|
4
|
+
class s {
|
|
5
|
+
constructor() {
|
|
6
|
+
/** Provides access to editor functionalities specific to this UI element instance. */
|
|
7
|
+
l(this, "api");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Optional cleanup hook called when the UI element is being destroyed.
|
|
11
|
+
* Use this to remove event listeners or perform other cleanup tasks.
|
|
12
|
+
*/
|
|
13
|
+
onDestroy() {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Optional method to get the current value of the UI element.
|
|
17
|
+
* Implement this if the element manages a state or value (e.g., input fields).
|
|
18
|
+
* @returns The current value of the element.
|
|
19
|
+
*/
|
|
20
|
+
getValue() {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Optional method to set the value of the UI element.
|
|
24
|
+
* Implement this if the element manages a state or value and needs to be updated externally.
|
|
25
|
+
* @param value - The new value to set.
|
|
26
|
+
*/
|
|
27
|
+
setValue(e) {
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @description Optional hook called when one of the element's supported attributes ({@link UEAttr}) gets updated externally.
|
|
31
|
+
* Implement this to react to attribute changes (e.g., visibility, disabled state).
|
|
32
|
+
* @param name - The name of the attribute that was updated.
|
|
33
|
+
* @param value - The new value of the attribute.
|
|
34
|
+
*/
|
|
35
|
+
onAttributeUpdated(e, a) {
|
|
36
|
+
}
|
|
19
37
|
}
|
|
20
38
|
export {
|
|
21
|
-
|
|
39
|
+
s as UIElement
|
|
22
40
|
};
|
package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var r;
|
|
3
|
-
function g() {
|
|
4
|
-
if (r) return e;
|
|
5
|
-
r = 1, Object.defineProperty(e, "__esModule", { value: !0 }), e.UIElementTagRegistry = void 0;
|
|
6
|
-
var t = (
|
|
7
|
-
/** @class */
|
|
8
|
-
/* @__PURE__ */ (function() {
|
|
9
|
-
function i() {
|
|
10
|
-
}
|
|
11
|
-
return i;
|
|
12
|
-
})()
|
|
13
|
-
);
|
|
14
|
-
return e.UIElementTagRegistry = t, e;
|
|
1
|
+
class s {
|
|
15
2
|
}
|
|
16
3
|
export {
|
|
17
|
-
|
|
4
|
+
s as UIElementTagRegistry
|
|
18
5
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useHttp as t } from "../composables/useHttp.js";
|
|
2
|
+
import { useToaster as n } from "../composables/useToaster.js";
|
|
3
|
+
const u = () => {
|
|
4
|
+
const { get: r } = t(), { handleError: s } = n();
|
|
5
|
+
return { getUnsubscribePages: async () => {
|
|
6
|
+
try {
|
|
7
|
+
const { data: e = [] } = await r("/unsubscribe-pages/get-all");
|
|
8
|
+
return e;
|
|
9
|
+
} catch (e) {
|
|
10
|
+
return s(e, "Failed to fetch unsubscribe pages"), [];
|
|
11
|
+
}
|
|
12
|
+
} };
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
u as useUnsubscribeApi
|
|
16
|
+
};
|
|
@@ -1,8 +1,186 @@
|
|
|
1
|
-
type UnsubscribePage
|
|
2
|
-
type: number;
|
|
3
|
-
};
|
|
1
|
+
import type { UnsubscribePage } from '@@/Types/unsubscribe';
|
|
4
2
|
interface StoreState {
|
|
5
|
-
|
|
3
|
+
templates: UnsubscribePage[];
|
|
4
|
+
selectedTemplates: Record<number, number>;
|
|
5
|
+
selectedUnsubscribePages: number[];
|
|
6
|
+
selectedCollectionType: number;
|
|
7
|
+
activeType: number;
|
|
8
|
+
pageSelectionUpdateStatus: boolean;
|
|
9
|
+
pageSelectionDrawerStatus: boolean;
|
|
10
|
+
typeSelectionDrawerStatus: boolean;
|
|
11
|
+
isGlobalUnsubscribeDisabled: boolean;
|
|
12
|
+
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
6
13
|
}
|
|
7
|
-
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {
|
|
14
|
+
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {
|
|
15
|
+
getSelectedCollection: (state: {
|
|
16
|
+
templates: {
|
|
17
|
+
id: number;
|
|
18
|
+
name: string;
|
|
19
|
+
type: number;
|
|
20
|
+
isVisible: number;
|
|
21
|
+
html: string;
|
|
22
|
+
originalHtml: string;
|
|
23
|
+
css: string;
|
|
24
|
+
thumbnail: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
status: number;
|
|
28
|
+
}[];
|
|
29
|
+
selectedTemplates: Record<number, number>;
|
|
30
|
+
selectedUnsubscribePages: number[];
|
|
31
|
+
selectedCollectionType: number;
|
|
32
|
+
activeType: number;
|
|
33
|
+
pageSelectionUpdateStatus: boolean;
|
|
34
|
+
pageSelectionDrawerStatus: boolean;
|
|
35
|
+
typeSelectionDrawerStatus: boolean;
|
|
36
|
+
isGlobalUnsubscribeDisabled: boolean;
|
|
37
|
+
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
38
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>) => number[];
|
|
39
|
+
getSelectedTemplateByActiveType: (state: {
|
|
40
|
+
templates: {
|
|
41
|
+
id: number;
|
|
42
|
+
name: string;
|
|
43
|
+
type: number;
|
|
44
|
+
isVisible: number;
|
|
45
|
+
html: string;
|
|
46
|
+
originalHtml: string;
|
|
47
|
+
css: string;
|
|
48
|
+
thumbnail: string;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
status: number;
|
|
52
|
+
}[];
|
|
53
|
+
selectedTemplates: Record<number, number>;
|
|
54
|
+
selectedUnsubscribePages: number[];
|
|
55
|
+
selectedCollectionType: number;
|
|
56
|
+
activeType: number;
|
|
57
|
+
pageSelectionUpdateStatus: boolean;
|
|
58
|
+
pageSelectionDrawerStatus: boolean;
|
|
59
|
+
typeSelectionDrawerStatus: boolean;
|
|
60
|
+
isGlobalUnsubscribeDisabled: boolean;
|
|
61
|
+
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
62
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>) => number;
|
|
63
|
+
getTemplatesByActiveType: (state: {
|
|
64
|
+
templates: {
|
|
65
|
+
id: number;
|
|
66
|
+
name: string;
|
|
67
|
+
type: number;
|
|
68
|
+
isVisible: number;
|
|
69
|
+
html: string;
|
|
70
|
+
originalHtml: string;
|
|
71
|
+
css: string;
|
|
72
|
+
thumbnail: string;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
updatedAt: string;
|
|
75
|
+
status: number;
|
|
76
|
+
}[];
|
|
77
|
+
selectedTemplates: Record<number, number>;
|
|
78
|
+
selectedUnsubscribePages: number[];
|
|
79
|
+
selectedCollectionType: number;
|
|
80
|
+
activeType: number;
|
|
81
|
+
pageSelectionUpdateStatus: boolean;
|
|
82
|
+
pageSelectionDrawerStatus: boolean;
|
|
83
|
+
typeSelectionDrawerStatus: boolean;
|
|
84
|
+
isGlobalUnsubscribeDisabled: boolean;
|
|
85
|
+
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
86
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
87
|
+
id: number;
|
|
88
|
+
name: string;
|
|
89
|
+
type: number;
|
|
90
|
+
isVisible: number;
|
|
91
|
+
html: string;
|
|
92
|
+
originalHtml: string;
|
|
93
|
+
css: string;
|
|
94
|
+
thumbnail: string;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
updatedAt: string;
|
|
97
|
+
status: number;
|
|
98
|
+
}[];
|
|
99
|
+
isActiveTypeFirstInCollection: (state: {
|
|
100
|
+
templates: {
|
|
101
|
+
id: number;
|
|
102
|
+
name: string;
|
|
103
|
+
type: number;
|
|
104
|
+
isVisible: number;
|
|
105
|
+
html: string;
|
|
106
|
+
originalHtml: string;
|
|
107
|
+
css: string;
|
|
108
|
+
thumbnail: string;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
updatedAt: string;
|
|
111
|
+
status: number;
|
|
112
|
+
}[];
|
|
113
|
+
selectedTemplates: Record<number, number>;
|
|
114
|
+
selectedUnsubscribePages: number[];
|
|
115
|
+
selectedCollectionType: number;
|
|
116
|
+
activeType: number;
|
|
117
|
+
pageSelectionUpdateStatus: boolean;
|
|
118
|
+
pageSelectionDrawerStatus: boolean;
|
|
119
|
+
typeSelectionDrawerStatus: boolean;
|
|
120
|
+
isGlobalUnsubscribeDisabled: boolean;
|
|
121
|
+
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
122
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
123
|
+
isActiveTypeLastInCollection: (state: {
|
|
124
|
+
templates: {
|
|
125
|
+
id: number;
|
|
126
|
+
name: string;
|
|
127
|
+
type: number;
|
|
128
|
+
isVisible: number;
|
|
129
|
+
html: string;
|
|
130
|
+
originalHtml: string;
|
|
131
|
+
css: string;
|
|
132
|
+
thumbnail: string;
|
|
133
|
+
createdAt: string;
|
|
134
|
+
updatedAt: string;
|
|
135
|
+
status: number;
|
|
136
|
+
}[];
|
|
137
|
+
selectedTemplates: Record<number, number>;
|
|
138
|
+
selectedUnsubscribePages: number[];
|
|
139
|
+
selectedCollectionType: number;
|
|
140
|
+
activeType: number;
|
|
141
|
+
pageSelectionUpdateStatus: boolean;
|
|
142
|
+
pageSelectionDrawerStatus: boolean;
|
|
143
|
+
typeSelectionDrawerStatus: boolean;
|
|
144
|
+
isGlobalUnsubscribeDisabled: boolean;
|
|
145
|
+
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
146
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
147
|
+
hasTemplatesByCollectionType: (state: {
|
|
148
|
+
templates: {
|
|
149
|
+
id: number;
|
|
150
|
+
name: string;
|
|
151
|
+
type: number;
|
|
152
|
+
isVisible: number;
|
|
153
|
+
html: string;
|
|
154
|
+
originalHtml: string;
|
|
155
|
+
css: string;
|
|
156
|
+
thumbnail: string;
|
|
157
|
+
createdAt: string;
|
|
158
|
+
updatedAt: string;
|
|
159
|
+
status: number;
|
|
160
|
+
}[];
|
|
161
|
+
selectedTemplates: Record<number, number>;
|
|
162
|
+
selectedUnsubscribePages: number[];
|
|
163
|
+
selectedCollectionType: number;
|
|
164
|
+
activeType: number;
|
|
165
|
+
pageSelectionUpdateStatus: boolean;
|
|
166
|
+
pageSelectionDrawerStatus: boolean;
|
|
167
|
+
typeSelectionDrawerStatus: boolean;
|
|
168
|
+
isGlobalUnsubscribeDisabled: boolean;
|
|
169
|
+
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
170
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>) => Record<number, boolean>;
|
|
171
|
+
}, {
|
|
172
|
+
$reset(): void;
|
|
173
|
+
fetchTemplates(): Promise<void>;
|
|
174
|
+
setCollection(collectionType: number): void;
|
|
175
|
+
setCollectionWithoutAutoSelection(collectionType: number): void;
|
|
176
|
+
setSelectedTemplate(template: number): void;
|
|
177
|
+
setNextType(): void;
|
|
178
|
+
setPreviousType(): void;
|
|
179
|
+
loadSelectedTemplates(templates: number[]): void;
|
|
180
|
+
getThumbnailByTemplateId(id: number): string;
|
|
181
|
+
getSelectedTemplatesByCollection(type: number): number[];
|
|
182
|
+
addUnsubscribePages(pageIds: number[]): void;
|
|
183
|
+
removeUnsubscribePages(pageIds: number[]): void;
|
|
184
|
+
getSelectedUnsubscribePagesByCollection(collectionType: number): number[];
|
|
185
|
+
}>;
|
|
8
186
|
export {};
|
|
@@ -1,9 +1,128 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { TYPE_COLLECTIONS as l, PAGE_TYPES as o } from "../enums/unsubscribe.js";
|
|
2
|
+
import { useUnsubscribeApi as p } from "../services/unsubscribeApi.js";
|
|
3
|
+
import { defineStore as r } from "pinia";
|
|
4
|
+
const a = () => ({
|
|
5
|
+
templates: [],
|
|
6
|
+
selectedTemplates: {},
|
|
7
|
+
selectedUnsubscribePages: [],
|
|
8
|
+
selectedCollectionType: o.GLOBAL_UNSUBSCRIBE,
|
|
9
|
+
activeType: o.GLOBAL_UNSUBSCRIBE,
|
|
10
|
+
pageSelectionUpdateStatus: !1,
|
|
11
|
+
pageSelectionDrawerStatus: !1,
|
|
12
|
+
typeSelectionDrawerStatus: !1,
|
|
13
|
+
isGlobalUnsubscribeDisabled: !1,
|
|
14
|
+
isSubscriptionPreferencesCenterDisabled: !1
|
|
15
|
+
}), u = r("unsubscribe", {
|
|
16
|
+
state: () => a(),
|
|
17
|
+
getters: {
|
|
18
|
+
getSelectedCollection: (e) => l[e.selectedCollectionType],
|
|
19
|
+
getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
|
|
20
|
+
getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
|
|
21
|
+
isActiveTypeFirstInCollection: (e) => {
|
|
22
|
+
const t = l[e.selectedCollectionType];
|
|
23
|
+
return e.activeType === t[0];
|
|
24
|
+
},
|
|
25
|
+
isActiveTypeLastInCollection: (e) => {
|
|
26
|
+
const t = l[e.selectedCollectionType];
|
|
27
|
+
return e.activeType === t[t.length - 1];
|
|
28
|
+
},
|
|
29
|
+
hasTemplatesByCollectionType: (e) => {
|
|
30
|
+
const t = {};
|
|
31
|
+
return l[e.selectedCollectionType].forEach((s) => {
|
|
32
|
+
t[s] = e.templates.some((i) => i.type === s);
|
|
33
|
+
}), t;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
actions: {
|
|
37
|
+
$reset() {
|
|
38
|
+
const { templates: e, selectedUnsubscribePages: t } = this;
|
|
39
|
+
Object.assign(this, {
|
|
40
|
+
...a(),
|
|
41
|
+
templates: e,
|
|
42
|
+
selectedUnsubscribePages: t
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
async fetchTemplates() {
|
|
46
|
+
if (this.templates.length)
|
|
47
|
+
return;
|
|
48
|
+
const { getUnsubscribePages: e } = p(), t = await e();
|
|
49
|
+
this.templates = t;
|
|
50
|
+
},
|
|
51
|
+
setCollection(e) {
|
|
52
|
+
this.selectedCollectionType = e;
|
|
53
|
+
const t = l[e];
|
|
54
|
+
if (t && t.length > 0) {
|
|
55
|
+
[this.activeType] = t;
|
|
56
|
+
const c = { ...this.selectedTemplates };
|
|
57
|
+
t.forEach((s) => {
|
|
58
|
+
if (!c[s]) {
|
|
59
|
+
const i = this.templates.find((n) => n.type === s);
|
|
60
|
+
i && (c[s] = i.id);
|
|
61
|
+
}
|
|
62
|
+
}), this.selectedTemplates = c;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
setCollectionWithoutAutoSelection(e) {
|
|
66
|
+
this.selectedCollectionType = e;
|
|
67
|
+
const t = l[e];
|
|
68
|
+
t && t.length > 0 && ([this.activeType] = t);
|
|
69
|
+
},
|
|
70
|
+
setSelectedTemplate(e) {
|
|
71
|
+
this.selectedTemplates = {
|
|
72
|
+
...this.selectedTemplates,
|
|
73
|
+
[this.activeType]: e
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
setNextType() {
|
|
77
|
+
const t = this.getSelectedCollection.indexOf(this.activeType) + 1;
|
|
78
|
+
t < this.getSelectedCollection.length && (this.activeType = this.getSelectedCollection[t]);
|
|
79
|
+
},
|
|
80
|
+
setPreviousType() {
|
|
81
|
+
const t = this.getSelectedCollection.indexOf(this.activeType) - 1;
|
|
82
|
+
t >= 0 && (this.activeType = this.getSelectedCollection[t]);
|
|
83
|
+
},
|
|
84
|
+
loadSelectedTemplates(e) {
|
|
85
|
+
const t = new Map(this.templates.map((s) => [s.id, s.type])), c = { ...this.selectedTemplates };
|
|
86
|
+
e.forEach((s) => {
|
|
87
|
+
const i = t.get(s);
|
|
88
|
+
i !== void 0 && (c[i] = s);
|
|
89
|
+
}), this.selectedTemplates = c;
|
|
90
|
+
},
|
|
91
|
+
getThumbnailByTemplateId(e) {
|
|
92
|
+
var t;
|
|
93
|
+
return ((t = this.templates.find((c) => c.id === e)) == null ? void 0 : t.thumbnail) ?? "";
|
|
94
|
+
},
|
|
95
|
+
getSelectedTemplatesByCollection(e) {
|
|
96
|
+
const t = l[e], c = [];
|
|
97
|
+
return t.forEach((s) => {
|
|
98
|
+
this.selectedTemplates[s] && c.push(this.selectedTemplates[s]);
|
|
99
|
+
}), c;
|
|
100
|
+
},
|
|
101
|
+
addUnsubscribePages(e) {
|
|
102
|
+
const t = /* @__PURE__ */ new Set([...this.selectedUnsubscribePages, ...e]);
|
|
103
|
+
this.selectedUnsubscribePages = Array.from(t);
|
|
104
|
+
},
|
|
105
|
+
removeUnsubscribePages(e) {
|
|
106
|
+
this.selectedUnsubscribePages = this.selectedUnsubscribePages.filter(
|
|
107
|
+
(t) => !e.includes(t)
|
|
108
|
+
);
|
|
109
|
+
},
|
|
110
|
+
getSelectedUnsubscribePagesByCollection(e) {
|
|
111
|
+
const t = l[e];
|
|
112
|
+
if (!t)
|
|
113
|
+
return [];
|
|
114
|
+
const c = /* @__PURE__ */ new Map();
|
|
115
|
+
this.templates.forEach((i) => {
|
|
116
|
+
c.set(i.id, i.type);
|
|
117
|
+
});
|
|
118
|
+
const s = new Set(t);
|
|
119
|
+
return this.selectedUnsubscribePages.filter((i) => {
|
|
120
|
+
const n = c.get(i);
|
|
121
|
+
return n !== void 0 && s.has(n);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
6
125
|
});
|
|
7
126
|
export {
|
|
8
|
-
|
|
127
|
+
u as useUnsubscribeStore
|
|
9
128
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.2-beta.
|
|
3
|
+
"version": "1.0.2-beta.ad1dcd9",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"author": "",
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@stripoinc/ui-editor-extensions": "
|
|
34
|
+
"@stripoinc/ui-editor-extensions": "2.0.2",
|
|
35
35
|
"@useinsider/design-system-vue": "0.14.8",
|
|
36
36
|
"@vueuse/core": "11.3.0",
|
|
37
37
|
"lodash-es": "4.17.21",
|
package/dist/_virtual/Block.js
DELETED