@useinsider/guido 1.0.3-beta.8646ecc → 1.0.3-beta.87cb92a

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 (149) hide show
  1. package/README.md +6 -32
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +79 -73
  4. package/dist/components/organisms/header/RightSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
  6. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +21 -0
  7. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +99 -0
  8. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
  9. package/dist/composables/useActionsApi.js +1 -1
  10. package/dist/composables/useGuidoActions.js +19 -9
  11. package/dist/composables/useHtmlCompiler.js +15 -13
  12. package/dist/composables/useHtmlValidator.js +36 -35
  13. package/dist/composables/useStripo.js +46 -40
  14. package/dist/config/compiler/itemsCompilerRules.js +14 -0
  15. package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
  16. package/dist/enums/defaults.js +2 -1
  17. package/dist/enums/onboarding.js +7 -3
  18. package/dist/enums/unsubscribe.js +27 -25
  19. package/dist/extensions/Blocks/Checkbox/control.js +15 -14
  20. package/dist/extensions/Blocks/Checkbox/template.js +14 -9
  21. package/dist/extensions/Blocks/Items/block.js +29 -28
  22. package/dist/extensions/Blocks/Items/controls/cardComposition.js +151 -57
  23. package/dist/extensions/Blocks/Items/controls/name/trimming.js +2 -2
  24. package/dist/extensions/Blocks/Items/controls/settingsControl.js +149 -117
  25. package/dist/extensions/Blocks/Items/enums/productEnums.js +83 -5
  26. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +7 -1
  27. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +57 -56
  28. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +54 -55
  29. package/dist/extensions/Blocks/Items/settingsPanel.js +56 -31
  30. package/dist/extensions/Blocks/Items/template.js +138 -59
  31. package/dist/extensions/Blocks/RadioButton/control.js +18 -17
  32. package/dist/extensions/Blocks/RadioButton/template.js +18 -9
  33. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  34. package/dist/extensions/Blocks/Unsubscribe/block.js +27 -27
  35. package/dist/extensions/DynamicContent/dynamic-content-modal.js +25 -19
  36. package/dist/extensions/DynamicContent/dynamic-content.js +128 -33
  37. package/dist/guido.css +1 -1
  38. package/dist/node_modules/lodash-es/_DataView.js +6 -0
  39. package/dist/node_modules/lodash-es/_Promise.js +6 -0
  40. package/dist/node_modules/lodash-es/_Set.js +6 -0
  41. package/dist/node_modules/lodash-es/_SetCache.js +13 -0
  42. package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
  43. package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
  44. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +13 -12
  45. package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
  46. package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
  47. package/dist/node_modules/lodash-es/_arraySome.js +9 -0
  48. package/dist/node_modules/lodash-es/_baseEach.js +6 -0
  49. package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
  50. package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
  51. package/dist/node_modules/lodash-es/_baseGet.js +11 -0
  52. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  53. package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
  54. package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
  55. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
  56. package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
  57. package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
  58. package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
  59. package/dist/node_modules/lodash-es/_baseMap.js +11 -0
  60. package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
  61. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  62. package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
  63. package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  64. package/dist/node_modules/lodash-es/_baseRange.js +9 -0
  65. package/dist/node_modules/lodash-es/_baseToString.js +18 -0
  66. package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
  67. package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
  68. package/dist/node_modules/lodash-es/_castPath.js +10 -0
  69. package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
  70. package/dist/node_modules/lodash-es/_createRange.js +11 -0
  71. package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
  72. package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
  73. package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
  74. package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
  75. package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
  76. package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
  77. package/dist/node_modules/lodash-es/_getTag.js +28 -0
  78. package/dist/node_modules/lodash-es/_hasPath.js +19 -0
  79. package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
  80. package/dist/node_modules/lodash-es/_isKey.js +12 -0
  81. package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
  82. package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
  83. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  84. package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
  85. package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
  86. package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
  87. package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
  88. package/dist/node_modules/lodash-es/_setToArray.js +9 -0
  89. package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
  90. package/dist/node_modules/lodash-es/_toKey.js +10 -0
  91. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
  92. package/dist/node_modules/lodash-es/flatMap.js +8 -0
  93. package/dist/node_modules/lodash-es/get.js +8 -0
  94. package/dist/node_modules/lodash-es/hasIn.js +8 -0
  95. package/dist/node_modules/lodash-es/isSymbol.js +9 -0
  96. package/dist/node_modules/lodash-es/keys.js +9 -0
  97. package/dist/node_modules/lodash-es/keysIn.js +3 -3
  98. package/dist/node_modules/lodash-es/map.js +11 -0
  99. package/dist/node_modules/lodash-es/property.js +10 -0
  100. package/dist/node_modules/lodash-es/range.js +5 -0
  101. package/dist/node_modules/lodash-es/stubArray.js +6 -0
  102. package/dist/node_modules/lodash-es/toFinite.js +14 -0
  103. package/dist/node_modules/lodash-es/toNumber.js +22 -0
  104. package/dist/node_modules/lodash-es/toString.js +7 -0
  105. package/dist/package.json.js +1 -1
  106. package/dist/src/@types/generic.d.ts +27 -6
  107. package/dist/src/components/Guido.vue.d.ts +3 -2
  108. package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +2 -0
  109. package/dist/src/composables/useGuidoActions.d.ts +9 -0
  110. package/dist/src/config/compiler/itemsCompilerRules.d.ts +2 -0
  111. package/dist/src/enums/onboarding.d.ts +4 -0
  112. package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
  113. package/dist/src/extensions/Blocks/Items/block.d.ts +14 -0
  114. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +20 -7
  115. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +8 -2
  116. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +8 -0
  117. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +6 -0
  118. package/dist/src/extensions/Blocks/Items/template.d.ts +9 -1
  119. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  120. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  121. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +9 -2
  122. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +52 -2
  123. package/dist/src/stores/config.d.ts +3 -2
  124. package/dist/src/stores/dynamic-content.d.ts +3 -3
  125. package/dist/src/stores/editor.d.ts +1 -1
  126. package/dist/src/stores/onboarding.d.ts +335 -1
  127. package/dist/src/stores/preview.d.ts +1 -1
  128. package/dist/src/stores/recommendation.d.ts +1 -1
  129. package/dist/src/stores/save-as-template.d.ts +1 -1
  130. package/dist/src/stores/toaster.d.ts +1 -1
  131. package/dist/src/stores/unsubscribe.d.ts +1 -1
  132. package/dist/src/stores/version-history.d.ts +1 -1
  133. package/dist/src/utils/environmentUtil.d.ts +5 -0
  134. package/dist/src/utils/genericUtil.d.ts +1 -0
  135. package/dist/src/utils/pairProductVariables.d.ts +7 -0
  136. package/dist/stores/config.js +5 -5
  137. package/dist/stores/dynamic-content.js +2 -2
  138. package/dist/stores/editor.js +1 -1
  139. package/dist/stores/onboarding.js +44 -36
  140. package/dist/stores/preview.js +1 -1
  141. package/dist/stores/recommendation.js +3 -3
  142. package/dist/stores/save-as-template.js +2 -2
  143. package/dist/stores/toaster.js +1 -1
  144. package/dist/stores/unsubscribe.js +1 -1
  145. package/dist/stores/version-history.js +4 -4
  146. package/dist/utils/environmentUtil.js +4 -0
  147. package/dist/utils/genericUtil.js +17 -6
  148. package/dist/utils/pairProductVariables.js +136 -0
  149. package/package.json +4 -11
@@ -0,0 +1,22 @@
1
+ import n from "./_baseTrim.js";
2
+ import f from "./isObject.js";
3
+ import o from "./isSymbol.js";
4
+ var s = NaN, m = /^[-+]0x[0-9a-f]+$/i, p = /^0b[01]+$/i, e = /^0o[0-7]+$/i, b = parseInt;
5
+ function O(r) {
6
+ if (typeof r == "number")
7
+ return r;
8
+ if (o(r))
9
+ return s;
10
+ if (f(r)) {
11
+ var t = typeof r.valueOf == "function" ? r.valueOf() : r;
12
+ r = f(t) ? t + "" : t;
13
+ }
14
+ if (typeof r != "string")
15
+ return r === 0 ? r : +r;
16
+ r = n(r);
17
+ var i = p.test(r);
18
+ return i || e.test(r) ? b(r.slice(2), i ? 2 : 8) : m.test(r) ? s : +r;
19
+ }
20
+ export {
21
+ O as default
22
+ };
@@ -0,0 +1,7 @@
1
+ import r from "./_baseToString.js";
2
+ function o(t) {
3
+ return t == null ? "" : r(t);
4
+ }
5
+ export {
6
+ o as default
7
+ };
@@ -1,4 +1,4 @@
1
- const o = { stripo: { version: "2.42.0" } }, s = {
1
+ const o = { stripo: { version: "2.47.0" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
@@ -7,6 +7,7 @@ type Features = {
7
7
  saveAsTemplate?: boolean;
8
8
  versionHistory?: boolean;
9
9
  testMessage?: boolean;
10
+ displayConditions?: boolean;
10
11
  };
11
12
  type Partner = {
12
13
  partnerName: string;
@@ -37,15 +38,39 @@ export type TemplateConfig = {
37
38
  selectedUnsubscribePages?: number[];
38
39
  variationId?: string;
39
40
  };
40
- export type DynamicContent = {
41
+ export type BaseDynamicContent = {
41
42
  value: string;
42
- text: string;
43
43
  fallback?: string;
44
44
  format?: {
45
45
  key: string;
46
46
  value: string;
47
47
  };
48
48
  };
49
+ export type DynamicContent = BaseDynamicContent & {
50
+ text: string;
51
+ };
52
+ export type MergeTag = BaseDynamicContent & {
53
+ label: string;
54
+ selStart?: number;
55
+ selEnd?: number;
56
+ hidden?: boolean;
57
+ };
58
+ export type PositionData = {
59
+ x: number;
60
+ y: number;
61
+ width?: number;
62
+ height?: number;
63
+ };
64
+ export type DynamicContentEvent = {
65
+ attribute: DynamicContent;
66
+ position?: PositionData;
67
+ };
68
+ export type MergeTagClickEvent = {
69
+ position: PositionData;
70
+ element: HTMLElement;
71
+ tagValue: string | null;
72
+ tagLabel: string | null;
73
+ };
49
74
  export interface EmailHeader {
50
75
  senderName: string;
51
76
  subject: string;
@@ -61,10 +86,6 @@ export interface TooltipOptions {
61
86
  };
62
87
  preventXss?: boolean;
63
88
  }
64
- export type MergeTag = {
65
- label: string;
66
- value: string;
67
- };
68
89
  export type TextValueObject = {
69
90
  text: string;
70
91
  value: string;
@@ -1,4 +1,4 @@
1
- import type { DynamicContent, GuidoConfig, TemplateConfig } from '@@/Types/generic';
1
+ import type { DynamicContent, GuidoConfig, PositionData, TemplateConfig } from '@@/Types/generic';
2
2
  import type { SavedTemplateDetails } from '@@/Types/stripo';
3
3
  type __VLS_Props = {
4
4
  templateId: string;
@@ -20,13 +20,14 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
20
20
  hasChanges: import("vue").ComputedRef<boolean>;
21
21
  saveSilent: () => Promise<SavedTemplateDetails | undefined> | undefined;
22
22
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
23
- "dynamic-content:open": (detail: DynamicContent | null) => void;
23
+ "dynamic-content:open": (detail: DynamicContent | null, position?: PositionData | undefined) => void;
24
24
  back: () => void;
25
25
  "save:start": () => void;
26
26
  "save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
27
27
  "on-change": (hasChanges: boolean) => void;
28
28
  ready: () => void;
29
29
  "onboarding:finished": () => void;
30
+ "test-email:click": () => void;
30
31
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
31
32
  export default _default;
32
33
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -3,9 +3,11 @@ import type { InjectionKey } from 'vue';
3
3
  export type BackHandler = () => void;
4
4
  export type SaveStartHandler = () => void;
5
5
  export type SaveCompleteHandler = (template: Omit<SavedTemplateDetails, 'forceRecreate'>) => void;
6
+ export type TestEmailClickHandler = () => void;
6
7
  export declare const BACK_KEY: InjectionKey<BackHandler>;
7
8
  export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
8
9
  export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
10
+ export declare const TEST_EMAIL_CLICK_KEY: InjectionKey<TestEmailClickHandler>;
9
11
  /**
10
12
  * Provides Guido action handlers to child components
11
13
  */
@@ -13,6 +15,7 @@ export declare const provideGuidoActions: (actions: {
13
15
  onBack: BackHandler;
14
16
  onSaveStart: SaveStartHandler;
15
17
  onSaveComplete: SaveCompleteHandler;
18
+ onTestEmailClick: TestEmailClickHandler;
16
19
  }) => void;
17
20
  /**
18
21
  * Provides individual Guido action handlers
@@ -35,6 +38,11 @@ export declare const useSaveStart: () => SaveStartHandler;
35
38
  * @returns Save complete function
36
39
  */
37
40
  export declare const useSaveComplete: () => SaveCompleteHandler;
41
+ /**
42
+ * Hook to use the test email click handler
43
+ * @returns Test email click function
44
+ */
45
+ export declare const useTestEmailClick: () => TestEmailClickHandler;
38
46
  /**
39
47
  * Convenience hook to get all Guido actions
40
48
  * @returns Object containing all action handlers
@@ -43,4 +51,5 @@ export declare const useGuidoActions: () => {
43
51
  back: BackHandler;
44
52
  saveStart: SaveStartHandler;
45
53
  saveComplete: SaveCompleteHandler;
54
+ testEmailClick: TestEmailClickHandler;
46
55
  };
@@ -0,0 +1,2 @@
1
+ import type { CompilerRule } from '@@/Types/html-compiler';
2
+ export declare const itemsCompilerRules: CompilerRule[];
@@ -1,2 +1,6 @@
1
1
  export declare const SERVICE_HOVER_SELECTORS: string[];
2
+ export declare const UI_EDITOR_SELECTOR = "ui-editor";
3
+ export declare const CARD_COMPOSITION_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Card Composition\"]";
4
+ export declare const SETTINGS_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Settings\"]";
5
+ export declare const RIBBON_SELECTOR = ".in-ribbons-wrapper";
2
6
  export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/email-drag-drop-editor";
@@ -1,4 +1,4 @@
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";
1
+ declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"checkbox-block\"\n class=\"\n checkbox-block\n checkbox-block-v2\n esd-block-checkbox\n esd-checkbox-block\n 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
2
  /**
3
3
  * @returns The template for the default checkbox block
4
4
  */
@@ -1,5 +1,19 @@
1
1
  import { Block, BlockCompositionType, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
2
  export declare const BLOCK_ID = "items-block";
3
+ /**
4
+ * Items Block extension for Stripo email editor.
5
+ *
6
+ * Displays personalized product items (cart items, browsed items, or purchased items)
7
+ * in a configurable card layout with horizontal or vertical orientation.
8
+ *
9
+ * Features:
10
+ * - Multiple product data sources (cart, browsed, purchased)
11
+ * - Configurable card composition (image, name, price, quantity, button)
12
+ * - Orientation control (horizontal/vertical)
13
+ * - Price formatting and currency display options
14
+ * - Product name trimming
15
+ * - Onboarding support
16
+ */
3
17
  export declare class ItemsBlock extends Block {
4
18
  getId(): string;
5
19
  getIcon(): string;
@@ -1,20 +1,33 @@
1
+ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
1
2
  import { CommonControl } from '../../common-control';
2
3
  export declare const COMPOSITION_CONTROL_BLOCK_ID = "ui-elements-items-card-composition-block";
3
4
  export declare class ItemsBlockCardCompositionControl extends CommonControl {
5
+ private store;
6
+ private visibilityState;
4
7
  getId(): string;
5
8
  getTemplate(): string;
6
9
  onRender(): void;
7
- onDestroy(): void;
10
+ onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
8
11
  _getToggleContainer({ name, label }: {
9
12
  name: string;
10
13
  label: string;
11
14
  }): string;
12
15
  _initializeToggles(): void;
16
+ _updateTogglesFromState(): void;
17
+ _syncVisibilityFromAttributes(): void;
18
+ /**
19
+ * If itemsType is not BROWSED_ITEMS, show quantity
20
+ * If itemsType is BROWSED_ITEMS, hide quantity
21
+ * and mark it as '0'
22
+ */
23
+ _handleBrowsedItemsQuantity(): void;
24
+ _applyVisibilityStyles(): void;
25
+ _updateVisibilityAttribute(elementName: string, isVisible: boolean): void;
13
26
  _listenToFormUpdates(): void;
14
- _onProductImageChange(value: string): void;
15
- _onProductNameChange(value: string): void;
16
- _onProductQuantityChange(value: string): void;
17
- _onProductPriceChange(value: string): void;
18
- _onProductOriginalPriceChange(value: string): void;
19
- _onProductButtonChange(value: string): void;
27
+ _onProductImageChange(value: boolean): void;
28
+ _onProductNameChange(value: boolean): void;
29
+ _onProductQuantityChange(value: boolean): void;
30
+ _onProductPriceChange(value: boolean): void;
31
+ _onProductOriginalPriceChange(value: boolean): void;
32
+ _onProductButtonChange(value: boolean): void;
20
33
  }
@@ -1,3 +1,4 @@
1
+ import { ProductType } from '@@/Types/extensions/items';
1
2
  import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
3
  import { CommonControl } from '../../common-control';
3
4
  export declare const CONTROL_BLOCK_ID = "ui-elements-items-block";
@@ -12,7 +13,7 @@ export declare class ItemsBlockControl extends CommonControl {
12
13
  _getOrientation(): string;
13
14
  _getItemInCart(): string;
14
15
  _onOrientationChange(value: string): void;
15
- _onItemsTypeChange(value: string, oldValue: string): void;
16
+ _onItemsTypeChange(value: string): void;
16
17
  _onItemIdsChange(value: string): void;
17
18
  _initializeSelectItems(): void;
18
19
  _listenToFormUpdates(): void;
@@ -30,8 +31,13 @@ export declare class ItemsBlockControl extends CommonControl {
30
31
  _updatePrice(price: string): void;
31
32
  _updateOriginalPrice(originalPrice: string): void;
32
33
  _updateQuantity(quantity: string): void;
33
- _updateButton(button: string): void;
34
+ /**
35
+ * @todo Optimize template reordering for performance.
36
+ * @description Reorders the template structure based on current orientation and visibility settings.
37
+ */
34
38
  _reOrderTemplate(): void;
39
+ _updateDataTypeAttributes(itemsType: ProductType): void;
40
+ _updateDataNumberAttributes(itemId: string): void;
35
41
  _reFillTemplate(): void;
36
42
  _recalculateTrimming(): void;
37
43
  private _getParagraphFromBlock;
@@ -1,3 +1,4 @@
1
+ export declare const templateFirstLine = "<td align=\"center\" class=\"ins-product-td items-block items-block-v2\">";
1
2
  export declare const configAttributes: {
2
3
  TYPE: string;
3
4
  ITEMS_INDEX_SELECT_CONTROL_VALUE: string;
@@ -16,6 +17,12 @@ export declare const configAttributes: {
16
17
  NAME_CONTROL_ENABLED: string;
17
18
  QUANTITY_CONTROL_ENABLED: string;
18
19
  PRICE_CONTROL_OPENED: string;
20
+ PRODUCT_IMAGE_VISIBLE: string;
21
+ PRODUCT_NAME_VISIBLE: string;
22
+ PRODUCT_QUANTITY_VISIBLE: string;
23
+ PRODUCT_PRICE_VISIBLE: string;
24
+ PRODUCT_ORIGINAL_PRICE_VISIBLE: string;
25
+ PRODUCT_BUTTON_VISIBLE: string;
19
26
  };
20
27
  export declare const productPairs: {
21
28
  PAIRS_FOR_EXTENSION: {
@@ -152,3 +159,4 @@ export declare const productPairs: {
152
159
  };
153
160
  };
154
161
  };
162
+ export declare const itemsBlockDynamicVariables: string[];
@@ -34,6 +34,12 @@ export declare const DefaultConfigValues: {
34
34
  productNameControlTrim: string;
35
35
  productQuantityControlEnabled: string;
36
36
  productPriceControlOpened: string;
37
+ productImageVisible: string;
38
+ productNameVisible: string;
39
+ productQuantityVisible: string;
40
+ productPriceVisible: string;
41
+ productOriginalPriceVisible: string;
42
+ productButtonVisible: string;
37
43
  };
38
44
  export declare const ItemInCartOptions: {
39
45
  [x: string]: {
@@ -10,7 +10,15 @@ type TemplateParameters = {
10
10
  formattedPrice?: boolean;
11
11
  };
12
12
  /**
13
- * @returns The template for the default checkbox block
13
+ * Generates the default template for the Items Block.
14
+ * @param params - Template parameters including orientation, items type, item ID, and formatting options
15
+ * @param params.orientation - Layout orientation ('vertical' or 'horizontal')
16
+ * @param params.itemsType - Product data source type ('CART_ITEMS', 'BROWSED_ITEMS', or 'PURCHASED_ITEMS')
17
+ * @param params.itemId - The merge tag for the item (e.g., '{{Abandoned Cart Item (1) Url}}')
18
+ * @param params.currencySymbol - Currency symbol to display (e.g., 'USD')
19
+ * @param params.currencyLocation - Currency position ('0' for before, '1' for after)
20
+ * @param params.formattedPrice - Whether to use formatted price display
21
+ * @returns HTML template string for the Items Block
14
22
  */
15
23
  export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, formattedPrice, }: TemplateParameters): string;
16
24
  export default migrationTemplate;
@@ -1,4 +1,4 @@
1
- declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"radio-button-block\" \n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"radio-button-v2 esd-block-ra esd-radio-button-block esd-extension-block es-p10t es-p10b es-p30r es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" 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 <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;>\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
1
+ declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"radio-button-block\"\n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"\n radio-button\n radio-button-v2\n esd-block-ra\n esd-radio-button-block\n esd-extension-block\n es-p10t\n es-p10b\n es-p30r\n es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" 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 <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;>\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
2
2
  /**
3
3
  * @returns The template for the default checkbox block
4
4
  */
@@ -34,7 +34,7 @@ interface StoreState {
34
34
  filterList: FiltersResponse;
35
35
  filterGroup: number;
36
36
  }
37
- export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"recommendationExtension", StoreState, {
37
+ export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
38
38
  hasFilters: (state: {
39
39
  recommendationCampaignUrls: Record<string, string>;
40
40
  recommendationConfigs: {
@@ -1,6 +1,13 @@
1
- import type { DynamicContent } from '@@/Types/generic';
1
+ import type { DynamicContent, PositionData } from '@@/Types/generic';
2
2
  export declare class ExternalMergeTagsLibrary {
3
3
  selectedDynamicContent: DynamicContent | null;
4
4
  dataSelectCallback: (data: DynamicContent) => void;
5
- openMergeTagsLibrary(dynamicContent: DynamicContent, onDataSelectCallback: (data: DynamicContent) => void): void;
5
+ private closeDynamicContentHandler;
6
+ /**
7
+ * Opens the merge tags library modal
8
+ * @param dynamicContent - Currently selected dynamic content (if any)
9
+ * @param onDataSelectCallback - Callback invoked when user selects a merge tag
10
+ * @param position - Optional position data to place the modal
11
+ */
12
+ openMergeTagsLibrary(dynamicContent: DynamicContent, onDataSelectCallback: (data: DynamicContent) => void, position?: PositionData): void;
6
13
  }
@@ -1,16 +1,66 @@
1
+ import type { MergeTag } from '@@/Types/generic';
1
2
  import { UIElementType, UIElement, UIElementTagRegistry } from '@stripoinc/ui-editor-extensions';
2
3
  export declare class DynamicContentTagRegistry extends UIElementTagRegistry {
3
4
  registerUiElements(uiElementsTagsMap: Record<UIElementType, string>): void;
4
5
  }
5
6
  export declare class DynamicContentUiElementExtension extends UIElement {
6
7
  private mergeTagsButton;
7
- private listener;
8
8
  private mergeTagsLibrary;
9
- private selectedDynamicContent;
9
+ private clickListener;
10
+ private lastClickedElement;
11
+ private lastClickedFrame;
12
+ private mousedownListener;
10
13
  getId(): string;
11
14
  onRender(container: HTMLElement): void;
12
15
  onDestroy(): void;
13
16
  _onClick(): void;
17
+ /**
18
+ * Called when Stripo detects merge tag interactions
19
+ * This is the key method that receives notifications about merge tag clicks
20
+ * @param name - Attribute name (e.g., 'mergeTag')
21
+ * @param value - MergeTag object with label, value, selStart, selEnd, etc.
22
+ */
23
+ onAttributeUpdated(name: string, value: MergeTag | null | undefined): void;
14
24
  openMergeTagLibrary(): void;
25
+ /**
26
+ * Opens the dynamic content library for external apps
27
+ * Dispatches event with dynamic content data and position
28
+ */
29
+ private _openDynamicContentLibrary;
30
+ /**
31
+ * Gets the button's position on the screen
32
+ * Used to position the modal or anything else near the button
33
+ */
34
+ private _getButtonPosition;
35
+ /**
36
+ * Sets up coordinate tracking for merge tag clicks in the iframe
37
+ * Workaround from Stripo intercepting click events - tracks mousedown events instead
38
+ */
39
+ private _setupCoordinateTracking;
40
+ /**
41
+ * Gets the editor iframe element
42
+ */
43
+ private _getEditorFrame;
44
+ /**
45
+ * Finds merge tag element in the element tree
46
+ */
47
+ private _findMergeTagElement;
48
+ /**
49
+ * Gets the position of the last clicked element, calculated on-demand
50
+ * This ensures we always use the correct element's position even with rapid clicks
51
+ */
52
+ private _getLastClickedPosition;
53
+ /**
54
+ * Calculates absolute position of element relative to page
55
+ */
56
+ private _calculateAbsolutePosition;
57
+ /**
58
+ * Cleans up the coordinate tracking event listener
59
+ */
60
+ private _cleanupCoordinateTracking;
61
+ /**
62
+ * Returns the HTML template for the "Add Dynamic Content" button
63
+ * This button is placed in the merge tags selector UI
64
+ */
15
65
  getTemplate(): string;
16
66
  }
@@ -3,7 +3,7 @@ interface StoreState {
3
3
  guidoConfig: GuidoConfig;
4
4
  templateConfig?: TemplateConfig;
5
5
  }
6
- export declare const useConfigStore: import("pinia").StoreDefinition<"config", StoreState, {
6
+ export declare const useConfigStore: import("pinia").StoreDefinition<"guidoConfig", StoreState, {
7
7
  getVariationId: (state: {
8
8
  guidoConfig: {
9
9
  translationsPath: string;
@@ -78,6 +78,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"config", S
78
78
  saveAsTemplate?: boolean | undefined;
79
79
  versionHistory?: boolean | undefined;
80
80
  testMessage?: boolean | undefined;
81
+ displayConditions?: boolean | undefined;
81
82
  } | undefined;
82
83
  blocks?: {
83
84
  excludeDefaults?: import("@@/Types/generic").GuidoBlockType[] | undefined;
@@ -88,12 +89,12 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"config", S
88
89
  templateConfig?: {
89
90
  preselectedDynamicContentList?: {
90
91
  value: string;
91
- text: string;
92
92
  fallback?: string | undefined;
93
93
  format?: {
94
94
  key: string;
95
95
  value: string;
96
96
  } | undefined;
97
+ text: string;
97
98
  }[] | undefined;
98
99
  selectedUnsubscribePages?: number[] | undefined;
99
100
  variationId?: string | undefined;
@@ -1,26 +1,26 @@
1
1
  import type { DynamicContent } from '@@/Types/generic';
2
- export declare const useDynamicContentStore: import("pinia").StoreDefinition<"dynamicContent", {
2
+ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"guidoDynamicContent", {
3
3
  selectedDynamicContent: DynamicContent;
4
4
  selectedDynamicContentList: DynamicContent[];
5
5
  }, {
6
6
  getSelectedDynamicContentList: (state: {
7
7
  selectedDynamicContent: {
8
8
  value: string;
9
- text: string;
10
9
  fallback?: string | undefined;
11
10
  format?: {
12
11
  key: string;
13
12
  value: string;
14
13
  } | undefined;
14
+ text: string;
15
15
  };
16
16
  selectedDynamicContentList: {
17
17
  value: string;
18
- text: string;
19
18
  fallback?: string | undefined;
20
19
  format?: {
21
20
  key: string;
22
21
  value: string;
23
22
  } | undefined;
23
+ text: string;
24
24
  }[];
25
25
  } & import("pinia").PiniaCustomStateProperties<{
26
26
  selectedDynamicContent: DynamicContent;
@@ -1,4 +1,4 @@
1
- export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
1
+ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEditor", {
2
2
  loadingStatus: boolean;
3
3
  isCodeEditorOpen: boolean;
4
4
  isSaveAsTemplateDrawerOpen: boolean;