@useinsider/guido 1.0.3-beta.fb2b45b → 1.0.3-beta.ff71e68

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.
Files changed (69) hide show
  1. package/dist/@types/generic.d.ts +0 -9
  2. package/dist/components/Guido.vue.d.ts +2 -2
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +69 -74
  5. package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
  6. package/dist/components/wrappers/WpDrawer.vue.js +4 -6
  7. package/dist/composables/useStripo.js +13 -17
  8. package/dist/config/compiler/unsubscribeCompilerRules.js +29 -42
  9. package/dist/config/migrator/couponBlockMigrator.d.ts +1 -0
  10. package/dist/config/migrator/couponBlockMigrator.js +67 -0
  11. package/dist/config/migrator/index.d.ts +1 -1
  12. package/dist/config/migrator/index.js +7 -7
  13. package/dist/enums/defaults.js +3 -6
  14. package/dist/enums/unsubscribe.d.ts +0 -19
  15. package/dist/enums/unsubscribe.js +6 -39
  16. package/dist/extensions/Blocks/Checkbox/control.js +41 -43
  17. package/dist/extensions/Blocks/CouponBlock/block.d.ts +12 -0
  18. package/dist/extensions/Blocks/CouponBlock/block.js +33 -0
  19. package/dist/extensions/Blocks/CouponBlock/extension.js +8 -0
  20. package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/iconsRegistry.d.ts +1 -1
  21. package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +33 -0
  22. package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/settingsPanel.d.ts +1 -1
  23. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +24 -0
  24. package/dist/extensions/Blocks/CouponBlock/template.d.ts +3 -0
  25. package/dist/extensions/Blocks/CouponBlock/template.js +18 -0
  26. package/dist/extensions/Blocks/RadioButton/control.js +23 -25
  27. package/dist/guido.css +1 -1
  28. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +1 -2
  29. package/dist/stores/unsubscribe.d.ts +5 -253
  30. package/dist/stores/unsubscribe.js +6 -126
  31. package/dist/utils/templatePreparation.js +16 -17
  32. package/package.json +1 -1
  33. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
  34. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
  35. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
  36. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
  37. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
  38. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
  39. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
  40. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
  41. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
  42. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
  43. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
  44. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
  45. package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
  46. package/dist/config/migrator/unsubscribeMigrator.js +0 -124
  47. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -32
  48. package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
  49. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
  50. package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
  51. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
  52. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
  53. package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
  54. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
  55. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
  56. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
  57. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
  58. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
  59. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
  60. package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
  61. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
  62. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
  63. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
  64. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
  65. package/dist/services/unsubscribeApi.d.ts +0 -4
  66. package/dist/services/unsubscribeApi.js +0 -16
  67. package/dist/stores/config.d.ts +0 -96
  68. package/dist/stores/config.js +0 -17
  69. /package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/extension.d.ts +0 -0
@@ -1,42 +0,0 @@
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
- };
@@ -1,21 +0,0 @@
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
- };
@@ -1,21 +0,0 @@
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
- };
@@ -1,35 +0,0 @@
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
- };
@@ -1,42 +0,0 @@
1
- const n = `/* Unsubscribe Extension Styles */
2
-
3
- .unsubscribe-preview-container {
4
- /* Container styling handled by parent classes */
5
- }
6
-
7
- .unsubscribe-preview-header {
8
- display: flex;
9
- justify-content: space-between;
10
- margin-bottom: 8px;
11
- }
12
-
13
- .unsubscribe-preview-title {
14
- font-weight: 500;
15
- }
16
-
17
- .unsubscribe-preview-controls {
18
- display: flex;
19
- gap: 2px;
20
- align-items: center;
21
- color: #666;
22
- }
23
-
24
- /* Preview image container and image */
25
- .unsubscribe-preview-image-container {
26
- width: 100%;
27
- max-height: 400px;
28
- overflow: hidden;
29
- display: flex;
30
- align-items: center;
31
- justify-content: center;
32
- }
33
-
34
- .unsubscribe-preview-image {
35
- object-fit: cover;
36
- width: 100%;
37
- height: auto;
38
- }
39
- `;
40
- export {
41
- n as default
42
- };
@@ -1,4 +0,0 @@
1
- import { UIElementTagRegistry } from '@stripoinc/ui-editor-extensions';
2
- export declare class UnsubscribeTagRegistry extends UIElementTagRegistry {
3
- registerUiElements(uiElementsTagsMap: Record<string, string>): void;
4
- }
@@ -1,10 +0,0 @@
1
- import { UIElementTagRegistry as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { PREVIEW_UI_ELEMENT_ID as e } from "./elements/preview.js";
3
- class m extends s {
4
- registerUiElements(r) {
5
- r[e] = e;
6
- }
7
- }
8
- export {
9
- m as UnsubscribeTagRegistry
10
- };
@@ -1,12 +0,0 @@
1
- /**
2
- * Migration template for legacy unsubscribe blocks.
3
- * This template is used to identify and migrate older versions of the unsubscribe block
4
- * that may exist in saved email templates. The migration is detected in the Block's
5
- * onCreated() lifecycle method via the 'data-migration' attribute check.
6
- *
7
- * Note: This template is currently exported but not actively used in the codebase.
8
- * It serves as a reference for the expected structure of legacy blocks during migration.
9
- */
10
- declare const migrationTemplate = "\n <td\n esd-extension-block-id=\"unsubscribe-block\"\n class=\"esd-block-text unsubscribe-block-v2 esd-block-unsubscribe esd-unsubscribe-block esd-extension-block\"\n >\n {-{-TITLE-}-}\n </td>\n";
11
- export declare function getDefaultTemplate(): string;
12
- export default migrationTemplate;
@@ -1,22 +0,0 @@
1
- import { BlockType as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- const s = "unsubscribe", n = "{{ins-unsubscribe-link}}", t = `
3
- <${e.BLOCK_TEXT}
4
- class="unsubscribe-block-v2 esd-block-unsubscribe es-p0"
5
- align="center"
6
- data-unsubscribe-page-type=""
7
- data-unsubscribe-page-list=""
8
- >
9
- <p>You can <strong><a
10
- href="${n}"
11
- class="unsubscribe-link"
12
- target="_blank"
13
- data-unsubscribe-link="true"
14
- >${s}</a></strong> from our emails, if you need to.</p>
15
- </${e.BLOCK_TEXT}>
16
- `;
17
- function r() {
18
- return t;
19
- }
20
- export {
21
- r as getDefaultTemplate
22
- };
@@ -1,9 +0,0 @@
1
- export declare const UNSUBSCRIBE_EVENTS: {
2
- readonly SELECT: "unsubscribe:select";
3
- readonly CANCEL: "unsubscribe:cancel";
4
- };
5
- export type UnsubscribeEvent = typeof UNSUBSCRIBE_EVENTS[keyof typeof UNSUBSCRIBE_EVENTS];
6
- export declare const DATA_ATTRIBUTES: {
7
- readonly PAGE_TYPE: "data-unsubscribe-page-type";
8
- readonly PAGE_LIST: "data-unsubscribe-page-list";
9
- };
@@ -1,11 +0,0 @@
1
- const s = {
2
- SELECT: "unsubscribe:select",
3
- CANCEL: "unsubscribe:cancel"
4
- }, e = {
5
- PAGE_TYPE: "data-unsubscribe-page-type",
6
- PAGE_LIST: "data-unsubscribe-page-list"
7
- };
8
- export {
9
- e as DATA_ATTRIBUTES,
10
- s as UNSUBSCRIBE_EVENTS
11
- };
@@ -1,7 +0,0 @@
1
- /**
2
- * Parses a comma-separated list of page IDs into an array of numbers.
3
- * Filters out invalid values (NaN, empty strings, negative numbers).
4
- * @param pageList - Comma-separated string of page IDs
5
- * @returns Array of valid page IDs
6
- */
7
- export declare function parsePageList(pageList: string): number[];
@@ -1,6 +0,0 @@
1
- function t(e) {
2
- return e.split(",").map((r) => Number(r.trim())).filter((r) => !Number.isNaN(r) && r > 0);
3
- }
4
- export {
5
- t as parsePageList
6
- };
@@ -1,4 +0,0 @@
1
- import type { UnsubscribePage } from '@@/Types/unsubscribe';
2
- export declare const useUnsubscribeApi: () => {
3
- getUnsubscribePages: () => Promise<UnsubscribePage[]>;
4
- };
@@ -1,16 +0,0 @@
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,96 +0,0 @@
1
- import type { GuidoConfig, TemplateConfig } from '@@/Types/generic';
2
- interface StoreState {
3
- guidoConfig: GuidoConfig;
4
- templateConfig?: TemplateConfig;
5
- }
6
- export declare const useConfigStore: import("pinia").StoreDefinition<"config", StoreState, {
7
- getVariationId: (state: {
8
- guidoConfig: {
9
- translationsPath: string;
10
- htmlCompilerRules?: ({
11
- type: "replace";
12
- search: string;
13
- replacement: string;
14
- replaceAll?: boolean | undefined;
15
- id: string;
16
- description?: string | undefined;
17
- priority: number;
18
- } | {
19
- type: "regex";
20
- pattern: string;
21
- replacement: string;
22
- flags?: string | undefined;
23
- id: string;
24
- description?: string | undefined;
25
- priority: number;
26
- } | {
27
- type: "remove";
28
- targets: string[] | {
29
- exec: (string: string) => RegExpExecArray | null;
30
- test: (string: string) => boolean;
31
- readonly source: string;
32
- readonly global: boolean;
33
- readonly ignoreCase: boolean;
34
- readonly multiline: boolean;
35
- lastIndex: number;
36
- compile: (pattern: string, flags?: string) => RegExp;
37
- readonly flags: string;
38
- readonly sticky: boolean;
39
- readonly unicode: boolean;
40
- readonly dotAll: boolean;
41
- readonly hasIndices: boolean;
42
- [Symbol.match]: (string: string) => RegExpMatchArray | null;
43
- [Symbol.replace]: {
44
- (string: string, replaceValue: string): string;
45
- (string: string, replacer: (substring: string, ...args: any[]) => string): string;
46
- };
47
- [Symbol.search]: (string: string) => number;
48
- [Symbol.split]: (string: string, limit?: number) => string[];
49
- [Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
50
- }[];
51
- id: string;
52
- description?: string | undefined;
53
- priority: number;
54
- } | {
55
- type: "custom";
56
- processor: (html: string) => string;
57
- id: string;
58
- description?: string | undefined;
59
- priority: number;
60
- })[] | undefined;
61
- ignoreDefaultHtmlCompilerRules?: boolean | undefined;
62
- useHeader?: boolean | undefined;
63
- emailHeader: {
64
- senderName: string;
65
- subject: string;
66
- };
67
- partner?: {
68
- partnerName: string;
69
- productType: number;
70
- messageType: number;
71
- } | undefined;
72
- extensions?: {
73
- unsubscribe?: boolean | undefined;
74
- } | undefined;
75
- features?: {
76
- dynamicContent?: boolean | undefined;
77
- saveAsTemplate?: boolean | undefined;
78
- versionHistory?: boolean | undefined;
79
- } | undefined;
80
- };
81
- templateConfig?: {
82
- preselectedDynamicContentList?: {
83
- value: string;
84
- text: string;
85
- fallback?: string | undefined;
86
- format?: {
87
- key: string;
88
- value: string;
89
- } | undefined;
90
- }[] | undefined;
91
- selectedUnsubscribePages?: number[] | undefined;
92
- variationId?: string | undefined;
93
- } | undefined;
94
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => string;
95
- }, {}>;
96
- export {};
@@ -1,17 +0,0 @@
1
- import { DefaultGuidoConfig as e } from "../enums/defaults.js";
2
- import { defineStore as i } from "pinia";
3
- const r = i("config", {
4
- state: () => ({
5
- guidoConfig: e,
6
- templateConfig: {}
7
- }),
8
- getters: {
9
- getVariationId: (t) => {
10
- var o;
11
- return ((o = t.templateConfig) == null ? void 0 : o.variationId) ?? "";
12
- }
13
- }
14
- });
15
- export {
16
- r as useConfigStore
17
- };