@useinsider/guido 2.0.0-beta.a4f9fa2 → 2.0.0-beta.ab9d733

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 (101) hide show
  1. package/README.md +0 -2
  2. package/dist/@types/config/schemas.js +1 -3
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +17 -15
  5. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +3 -3
  6. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +8 -8
  7. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
  8. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +7 -8
  9. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
  10. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +10 -14
  11. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +18 -22
  12. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
  13. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +12 -11
  14. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
  15. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
  16. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
  17. package/dist/components/organisms/header/HeaderWrapper.vue.js +5 -5
  18. package/dist/components/organisms/header/LeftSlot.vue.js +9 -9
  19. package/dist/components/organisms/header/LeftSlot.vue2.js +13 -14
  20. package/dist/components/organisms/header/MiddleSlot.vue.js +5 -4
  21. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -13
  22. package/dist/components/organisms/header/RightSlot.vue.js +12 -12
  23. package/dist/components/organisms/header/RightSlot.vue2.js +27 -21
  24. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
  25. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
  26. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
  27. package/dist/composables/useStripo.js +40 -40
  28. package/dist/config/migrator/index.js +8 -9
  29. package/dist/enums/academy.js +8 -0
  30. package/dist/enums/onboarding.js +1 -2
  31. package/dist/enums/unsubscribe.js +20 -21
  32. package/dist/extensions/Blocks/Items/block.js +40 -39
  33. package/dist/extensions/Blocks/Items/controls/button/link.js +29 -22
  34. package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -66
  35. package/dist/extensions/Blocks/Items/controls/image/link.js +30 -23
  36. package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
  37. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +17 -19
  38. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +29 -31
  39. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +36 -36
  40. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +19 -21
  41. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +27 -29
  42. package/dist/extensions/Blocks/Items/controls/settingsControl.js +143 -152
  43. package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
  44. package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -43
  45. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +3 -4
  46. package/dist/extensions/Blocks/Items/extension.js +6 -7
  47. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +49 -58
  48. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +59 -48
  49. package/dist/extensions/Blocks/Items/settingsPanel.js +26 -27
  50. package/dist/extensions/Blocks/Items/store/items-block.js +7 -11
  51. package/dist/extensions/Blocks/Items/template.js +129 -366
  52. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +17 -0
  53. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +28 -0
  54. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +76 -0
  55. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +46 -0
  56. package/dist/extensions/Blocks/Recommendation/control.js +1 -1
  57. package/dist/extensions/Blocks/common-control.js +30 -29
  58. package/dist/extensions/Blocks/controlFactories.js +45 -55
  59. package/dist/guido.css +1 -1
  60. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +285 -364
  61. package/dist/package.json.js +1 -1
  62. package/dist/services/stripoApi.js +10 -6
  63. package/dist/src/@types/config/schemas.d.ts +0 -4
  64. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  65. package/dist/src/composables/useConfig.d.ts +0 -2
  66. package/dist/src/enums/academy.d.ts +12 -0
  67. package/dist/src/enums/onboarding.d.ts +0 -1
  68. package/dist/src/enums/unsubscribe.d.ts +0 -1
  69. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +2 -0
  70. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -9
  71. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +2 -0
  72. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
  73. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +4 -0
  74. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
  75. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +26 -24
  76. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -1
  77. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -2
  78. package/dist/src/extensions/Blocks/Items/template.d.ts +1 -22
  79. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +23 -0
  80. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +32 -0
  81. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +50 -0
  82. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +8 -0
  83. package/dist/src/extensions/Blocks/common-control.d.ts +10 -9
  84. package/dist/src/stores/config.d.ts +0 -17
  85. package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
  86. package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
  87. package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
  88. package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
  89. package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
  90. package/dist/utils/pairProductVariables.js +58 -61
  91. package/package.json +3 -3
  92. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  93. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
  94. package/dist/config/migrator/itemsBlockMigrator.js +0 -342
  95. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +0 -93
  96. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +0 -184
  97. package/dist/src/config/migrator/itemsBlockMigrator.d.ts +0 -6
  98. package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +0 -18
  99. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -73
  100. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  101. package/dist/static/assets/phone-mockup.svg.js +0 -4
@@ -1,4 +1,4 @@
1
- const o = { stripo: { version: "2.52.0" } }, s = {
1
+ const o = { stripo: { version: "2.47.0" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
@@ -1,8 +1,8 @@
1
1
  import { useHttp as m } from "../composables/useHttp.js";
2
- import { useToaster as i } from "../composables/useToaster.js";
3
- import { MAX_DEFAULT_TEMPLATE_ID as p } from "../enums/defaults.js";
2
+ import { useToaster as u } from "../composables/useToaster.js";
3
+ import { MAX_DEFAULT_TEMPLATE_ID as i } from "../enums/defaults.js";
4
4
  const y = () => {
5
- const { get: r } = m(), { handleError: o } = i();
5
+ const { get: r } = m(), { handleError: o } = u();
6
6
  return {
7
7
  getToken: async () => {
8
8
  try {
@@ -26,13 +26,17 @@ const y = () => {
26
26
  getDefaultTemplate: async () => {
27
27
  const t = {
28
28
  html: "",
29
- css: ""
29
+ css: "",
30
+ forceRecreate: !0
30
31
  };
31
32
  try {
32
- const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <= p ? s : 0, { data: n } = await r(
33
+ const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <= i ? s : 0, { data: n } = await r(
33
34
  `/stripo/default-template/${l}`
34
35
  ), a = typeof n == "string" ? JSON.parse(n) : n;
35
- return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? t : a;
36
+ return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? t : {
37
+ ...a,
38
+ forceRecreate: !0
39
+ };
36
40
  } catch (e) {
37
41
  return o(e, "Failed to fetch default template"), t;
38
42
  }
@@ -90,8 +90,6 @@ export declare const TemplateSchema: v.ObjectSchema<{
90
90
  }, undefined>, undefined>, readonly []>;
91
91
  /** Selected unsubscribe page IDs */
92
92
  readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
93
- /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
94
- readonly forceRecreate: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
95
93
  }, undefined>;
96
94
  /**
97
95
  * Email header configuration (sender name and subject)
@@ -402,8 +400,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
402
400
  }, undefined>, undefined>, readonly []>;
403
401
  /** Selected unsubscribe page IDs */
404
402
  readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
405
- /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
406
- readonly forceRecreate: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
407
403
  }, undefined>, {}>;
408
404
  /** Editor settings */
409
405
  readonly editor: v.OptionalSchema<v.ObjectSchema<{
@@ -1,4 +1,4 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
- handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo").SavedTemplateDetails | undefined>;
2
+ handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo.js").SavedTemplateDetails | undefined>;
3
3
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
4
4
  export default _default;
@@ -31,7 +31,6 @@ export declare const useConfig: () => {
31
31
  } | undefined;
32
32
  }[];
33
33
  selectedUnsubscribePages: number[];
34
- forceRecreate: boolean;
35
34
  };
36
35
  editor: {
37
36
  locale: string;
@@ -117,7 +116,6 @@ export declare const useConfig: () => {
117
116
  } | undefined;
118
117
  }[];
119
118
  selectedUnsubscribePages: number[];
120
- forceRecreate: boolean;
121
119
  } | null>;
122
120
  editor: import("vue").ComputedRef<{
123
121
  locale: string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Centralized Academy Links
3
+ *
4
+ * All external academy documentation links should be defined here
5
+ * for easy maintenance and domain migration.
6
+ */
7
+ export declare const ACADEMY_LINKS: {
8
+ readonly EMAIL_EDITOR: "https://academy.useinsider.com/docs/email-drag-drop-editor";
9
+ readonly GLOBAL_UNSUBSCRIBE: "https://academy.useinsider.com/docs/global-unsubscribe-preference-center";
10
+ readonly AMP_FOR_EMAILS: "https://academy.useinsider.com/docs/amp-for-emails";
11
+ };
12
+ export type AcademyLinkKey = keyof typeof ACADEMY_LINKS;
@@ -3,4 +3,3 @@ export declare const UI_EDITOR_SELECTOR = "ui-editor";
3
3
  export declare const CARD_COMPOSITION_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Card Composition\"]";
4
4
  export declare const SETTINGS_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Settings\"]";
5
5
  export declare const RIBBON_SELECTOR = ".in-ribbons-wrapper";
6
- export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/email-drag-drop-editor";
@@ -17,7 +17,6 @@ export declare const DEFAULT_UNSUBSCRIBE_GROUP: {
17
17
  readonly name: "Global Unsubscribe";
18
18
  readonly sendGridId: "G";
19
19
  };
20
- export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center";
21
20
  export declare const UNSUBSCRIBE_PAGES_LINK = "/email/unsubscribe-pages";
22
21
  export declare const PAGE_TYPES: {
23
22
  GLOBAL_UNSUBSCRIBE: number;
@@ -8,5 +8,7 @@ export declare class ButtonLinkControl extends CommonControl {
8
8
  getTemplate(): string;
9
9
  onRender(): void;
10
10
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
11
+ _listenToFormUpdates(): void;
12
+ _onLinkChange(value: string): void;
11
13
  _getLink(): string;
12
14
  }
@@ -29,14 +29,5 @@ export declare class ItemsBlockCardCompositionControl extends CommonControl {
29
29
  _onProductQuantityChange(value: boolean): void;
30
30
  _onProductPriceChange(value: boolean): void;
31
31
  _onProductOriginalPriceChange(value: boolean): void;
32
- /**
33
- * Updates both price cell widths in vertical layout based on priceOrientation and visibility.
34
- * - When priceOrientation is 'vertical': both cells are 100% (stacked layout)
35
- * - When priceOrientation is 'horizontal':
36
- * - When original price is hidden, price cell expands to 100%
37
- * - When price is hidden, original price cell expands to 100%
38
- * - When both are visible, they share 50% each
39
- */
40
- _updatePriceCellWidthsForVerticalLayout(): void;
41
32
  _onProductButtonChange(value: boolean): void;
42
33
  }
@@ -8,5 +8,7 @@ export declare class ImageLinkControl extends CommonControl {
8
8
  getTemplate(): string;
9
9
  onRender(): void;
10
10
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
11
+ _listenToFormUpdates(): void;
12
+ _onLinkChange(value: string): void;
11
13
  _getLink(): string;
12
14
  }
@@ -9,7 +9,7 @@ export declare class PriceOrientationControl extends CommonControl {
9
9
  onRender(): void;
10
10
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
11
11
  _onPriceOrientationChange(value: string): void;
12
- private _updateVerticalLayout;
13
12
  private _updateHorizontalLayout;
13
+ private _updateVerticalLayout;
14
14
  _getPriceOrientation(): string;
15
15
  }
@@ -31,6 +31,10 @@ export declare class ItemsBlockControl extends CommonControl {
31
31
  _updatePrice(price: string): void;
32
32
  _updateOriginalPrice(originalPrice: string): void;
33
33
  _updateQuantity(quantity: 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;
35
39
  _updateDataTypeAttributes(itemsType: ProductType): void;
36
40
  _updateDataNumberAttributes(itemId: string): void;
@@ -42,7 +42,6 @@ export declare enum ItemsBlockControlId {
42
42
  PRICE_PADDINGS = "items-block-price-paddings-control",
43
43
  PRICE_HIDE_DISCOUNT = "items-block-price-hide-discount-control",
44
44
  PRICE_FORMATTED_PRICE = "items-block-price-formatted-price-control",
45
- PRICE_SINGLE_PRICE = "items-block-price-single-price-control",
46
45
  PRICE_CURRENCY_SYMBOL = "items-block-price-currency-symbol-control",
47
46
  PRICE_CURRENCY_LOCATION = "items-block-price-currency-location-control",
48
47
  PRICE_ORIENTATION = "items-block-price-orientation-control",
@@ -1,4 +1,30 @@
1
1
  export declare const templateFirstLine = "<td align=\"center\" class=\"ins-product-td items-block items-block-v2\">";
2
+ export declare const configAttributes: {
3
+ TYPE: string;
4
+ ITEMS_INDEX_SELECT_CONTROL_VALUE: string;
5
+ ORIENTATION: string;
6
+ PRODUCT_NAME_TRIMMING: string;
7
+ PRODUCT_PRICE_HIDE_DISCOUNT: string;
8
+ PRODUCT_PRICE_FORMATTED: string;
9
+ PRODUCT_PRICE_CURRENCY_SYMBOL: string;
10
+ PRODUCT_PRICE_CURRENCY_LOCATION: string;
11
+ PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION: string;
12
+ PRODUCT_BUTTON_LINK: string;
13
+ PRODUCT_IMAGE_LINK: string;
14
+ PRODUCT_NAME_CONTROL_VALUE: string;
15
+ PRODUCT_QUANTITY_CONTROL_VALUE: string;
16
+ PRODUCT_PRICE_CONTROL_VALUE: string;
17
+ BLOCK_INSTANCE_ID: string;
18
+ NAME_CONTROL_ENABLED: string;
19
+ QUANTITY_CONTROL_ENABLED: string;
20
+ PRICE_CONTROL_OPENED: string;
21
+ PRODUCT_IMAGE_VISIBLE: string;
22
+ PRODUCT_NAME_VISIBLE: string;
23
+ PRODUCT_QUANTITY_VISIBLE: string;
24
+ PRODUCT_PRICE_VISIBLE: string;
25
+ PRODUCT_ORIGINAL_PRICE_VISIBLE: string;
26
+ PRODUCT_BUTTON_VISIBLE: string;
27
+ };
2
28
  export declare const productPairs: {
3
29
  PAIRS_FOR_EXTENSION: {
4
30
  imageSrc: {
@@ -53,37 +79,25 @@ export declare const productPairs: {
53
79
  CART_ITEMS: {
54
80
  PRICE: string;
55
81
  PRICE_FORMATTED: string;
56
- SINGLE_PRICE: string;
57
- SINGLE_PRICE_FORMATTED: string;
58
82
  CURRENCY: string;
59
83
  DEFAULT_PRICE: string;
60
84
  DEFAULT_PRICE_FORMATTED: string;
61
- DEFAULT_SINGLE_PRICE: string;
62
- DEFAULT_SINGLE_PRICE_FORMATTED: string;
63
85
  DEFAULT_CURRENCY: string;
64
86
  };
65
87
  BROWSED_ITEMS: {
66
88
  PRICE: string;
67
89
  PRICE_FORMATTED: string;
68
- SINGLE_PRICE: string;
69
- SINGLE_PRICE_FORMATTED: string;
70
90
  CURRENCY: string;
71
91
  DEFAULT_PRICE: string;
72
92
  DEFAULT_PRICE_FORMATTED: string;
73
- DEFAULT_SINGLE_PRICE: string;
74
- DEFAULT_SINGLE_PRICE_FORMATTED: string;
75
93
  DEFAULT_CURRENCY: string;
76
94
  };
77
95
  PURCHASED_ITEMS: {
78
96
  PRICE: string;
79
97
  PRICE_FORMATTED: string;
80
- SINGLE_PRICE: string;
81
- SINGLE_PRICE_FORMATTED: string;
82
98
  CURRENCY: string;
83
99
  DEFAULT_PRICE: string;
84
100
  DEFAULT_PRICE_FORMATTED: string;
85
- DEFAULT_SINGLE_PRICE: string;
86
- DEFAULT_SINGLE_PRICE_FORMATTED: string;
87
101
  DEFAULT_CURRENCY: string;
88
102
  };
89
103
  };
@@ -91,37 +105,25 @@ export declare const productPairs: {
91
105
  CART_ITEMS: {
92
106
  PRICE: string;
93
107
  PRICE_FORMATTED: string;
94
- SINGLE_PRICE: string;
95
- SINGLE_PRICE_FORMATTED: string;
96
108
  CURRENCY: string;
97
109
  DEFAULT_PRICE: string;
98
110
  DEFAULT_PRICE_FORMATTED: string;
99
- DEFAULT_SINGLE_PRICE: string;
100
- DEFAULT_SINGLE_PRICE_FORMATTED: string;
101
111
  DEFAULT_CURRENCY: string;
102
112
  };
103
113
  BROWSED_ITEMS: {
104
114
  PRICE: string;
105
115
  PRICE_FORMATTED: string;
106
- SINGLE_PRICE: string;
107
- SINGLE_PRICE_FORMATTED: string;
108
116
  CURRENCY: string;
109
117
  DEFAULT_PRICE: string;
110
118
  DEFAULT_PRICE_FORMATTED: string;
111
- DEFAULT_SINGLE_PRICE: string;
112
- DEFAULT_SINGLE_PRICE_FORMATTED: string;
113
119
  DEFAULT_CURRENCY: string;
114
120
  };
115
121
  PURCHASED_ITEMS: {
116
122
  PRICE: string;
117
123
  PRICE_FORMATTED: string;
118
- SINGLE_PRICE: string;
119
- SINGLE_PRICE_FORMATTED: string;
120
124
  CURRENCY: string;
121
125
  DEFAULT_PRICE: string;
122
126
  DEFAULT_PRICE_FORMATTED: string;
123
- DEFAULT_SINGLE_PRICE: string;
124
- DEFAULT_SINGLE_PRICE_FORMATTED: string;
125
127
  DEFAULT_CURRENCY: string;
126
128
  };
127
129
  };
@@ -41,7 +41,6 @@ export declare const DefaultConfigValues: {
41
41
  productOriginalPriceVisible: string;
42
42
  productButtonVisible: string;
43
43
  productImageWidth: string;
44
- productImageHeight: string;
45
44
  };
46
45
  export declare const ItemInCartOptions: {
47
46
  [x: string]: {
@@ -10,7 +10,6 @@ interface ItemsBlockState {
10
10
  currencySymbol: string;
11
11
  currencyLocation: string;
12
12
  formattedPrice: boolean;
13
- singlePrice: boolean;
14
13
  priceOrientation: 'vertical' | 'horizontal';
15
14
  templateData: {
16
15
  imageSrc: string;
@@ -32,7 +31,6 @@ export declare const useItemsBlockStore: import("pinia").StoreDefinition<"guidoI
32
31
  setCurrencySymbol(currencySymbol: string): void;
33
32
  setCurrencyLocation(currencyLocation: string): void;
34
33
  setFormattedPrice(formattedPrice: boolean): void;
35
- setSinglePrice(singlePrice: boolean): void;
36
34
  setPriceOrientation(priceOrientation: "vertical" | "horizontal"): void;
37
35
  setTemplateData(templateData: ItemsBlockState["templateData"]): void;
38
36
  updateFromAttributes(attributes: {
@@ -1,8 +1,6 @@
1
- import type { ItemsBlockConfig } from './utils/nodeConfigUtils';
2
1
  declare const migrationTemplate = "ADD YOUR MIGRATION HERE";
3
2
  type ProductType = 'CART_ITEMS' | 'BROWSED_ITEMS' | 'PURCHASED_ITEMS';
4
3
  type OrientationType = 'vertical' | 'horizontal';
5
- type PriceOrientationType = 'vertical' | 'horizontal';
6
4
  type TemplateParameters = {
7
5
  orientation: OrientationType;
8
6
  itemsType: ProductType;
@@ -10,25 +8,6 @@ type TemplateParameters = {
10
8
  currencySymbol?: string;
11
9
  currencyLocation?: string;
12
10
  formattedPrice?: boolean;
13
- /** Whether to show single product price (price divided by quantity) */
14
- singlePrice?: boolean;
15
- migrate?: boolean;
16
- /** Legacy config format (data-* attributes for migration) */
17
- configBlockAttributes?: Record<string, string>;
18
- /** New config format (Stripo V2 nodeConfig from esd-ext-config) */
19
- nodeConfig?: Partial<ItemsBlockConfig>;
20
- /** Extracted styles from a[product-attr="name"] for migration */
21
- nameStyles?: string;
22
- /** Extracted styles from a.es-button for migration */
23
- buttonStyles?: string;
24
- /** Extracted styles from p[product-attr="price"] for migration */
25
- priceStyles?: string;
26
- /** Extracted styles from p[product-attr="originalPrice"] for migration */
27
- originalPriceStyles?: string;
28
- /** Extracted styles from p[product-attr="quantity"] for migration */
29
- quantityStyles?: string;
30
- /** Price orientation within the card ('vertical' = stacked, 'horizontal' = side-by-side) */
31
- priceOrientation?: PriceOrientationType;
32
11
  };
33
12
  /**
34
13
  * Generates the default template for the Items Block.
@@ -41,5 +20,5 @@ type TemplateParameters = {
41
20
  * @param params.formattedPrice - Whether to use formatted price display
42
21
  * @returns HTML template string for the Items Block
43
22
  */
44
- export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, migrate, formattedPrice, configBlockAttributes, nodeConfig, nameStyles, buttonStyles, priceStyles, originalPriceStyles, quantityStyles, priceOrientation, }: TemplateParameters): string;
23
+ export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, formattedPrice, }: TemplateParameters): string;
45
24
  export default migrationTemplate;
@@ -0,0 +1,23 @@
1
+ import { ImmutableHtmlElementNode, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ /**
3
+ * Gets the esd-config-block element from the current node.
4
+ * Searches within the closest .items-block-v2 container.
5
+ * @param currentNode - The current node from the control (usually this.currentNode)
6
+ * @returns The config block element or null if not found
7
+ */
8
+ export declare function getConfigBlock(currentNode: ImmutableHtmlNode | undefined): ImmutableHtmlElementNode | null;
9
+ /**
10
+ * Converts an attribute value to a boolean.
11
+ * Handles string values '1', 'true', and null/undefined cases.
12
+ * @param value - The attribute value (string or null)
13
+ * @param defaultValue - Default value to return if value is null/undefined (default: false)
14
+ * @returns The boolean value
15
+ */
16
+ export declare function attributeToBoolean(value: string | null, defaultValue?: boolean): boolean;
17
+ /**
18
+ * Gets a string attribute value with a default fallback.
19
+ * @param value - The attribute value (string or null)
20
+ * @param defaultValue - Default value to return if value is null/undefined (default: '')
21
+ * @returns The string value or default
22
+ */
23
+ export declare function attributeToString(value: string | null, defaultValue?: string): string;
@@ -0,0 +1,32 @@
1
+ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ import { configAttributes } from '../enums/productEnums';
3
+ type StoreSetter<T> = (value: T) => void;
4
+ interface SyncConfig<T> {
5
+ attributeName: keyof typeof configAttributes;
6
+ storeSetter: StoreSetter<T>;
7
+ converter: (value: string | null) => T;
8
+ }
9
+ /**
10
+ * Generic utility to sync an attribute value from esd-config-block to the store.
11
+ * This makes attribute values mutable by syncing them from the DOM.
12
+ * @param currentNode - The current node from the control (usually this.currentNode)
13
+ * @param config - Configuration object with attribute name, store setter, and value converter
14
+ */
15
+ export declare function syncAttributeFromConfigBlock<T>(currentNode: ImmutableHtmlNode | undefined, config: SyncConfig<T>): void;
16
+ /**
17
+ * Helper to create a sync config for boolean attributes.
18
+ * @param attributeName - The attribute name from configAttributes
19
+ * @param storeSetter - The store setter function
20
+ * @param defaultValue - Default value if attribute is not set (default: false)
21
+ * @returns Sync configuration object
22
+ */
23
+ export declare function createBooleanSyncConfig(attributeName: keyof typeof configAttributes, storeSetter: StoreSetter<boolean>, defaultValue?: boolean): SyncConfig<boolean>;
24
+ /**
25
+ * Helper to create a sync config for string attributes.
26
+ * @param attributeName - The attribute name from configAttributes
27
+ * @param storeSetter - The store setter function
28
+ * @param defaultValue - Default value if attribute is not set (default: '')
29
+ * @returns Sync configuration object
30
+ */
31
+ export declare function createStringSyncConfig(attributeName: keyof typeof configAttributes, storeSetter: StoreSetter<string>, defaultValue?: string): SyncConfig<string>;
32
+ export {};
@@ -0,0 +1,50 @@
1
+ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ /**
3
+ * Reads name trimming value from esd-config-block attribute and updates the store.
4
+ * This makes the trimming value mutable by syncing it from the DOM.
5
+ * @param currentNode - The current node from the control (usually this.currentNode)
6
+ */
7
+ export declare function syncNameTrimmingFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
8
+ /**
9
+ * Reads hide discount value from esd-config-block attribute and updates the store.
10
+ * This makes the hide discount value mutable by syncing it from the DOM.
11
+ * @param currentNode - The current node from the control (usually this.currentNode)
12
+ */
13
+ export declare function syncHideDiscountFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
14
+ /**
15
+ * Reads formatted price value from esd-config-block attribute and updates the store.
16
+ * This makes the formatted price value mutable by syncing it from the DOM.
17
+ * Defaults to true if not set, since formatted is the default.
18
+ * @param currentNode - The current node from the control (usually this.currentNode)
19
+ */
20
+ export declare function syncFormattedPriceFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
21
+ /**
22
+ * Reads currency symbol value from esd-config-block attribute and updates the store.
23
+ * This makes the currency symbol value mutable by syncing it from the DOM.
24
+ * @param currentNode - The current node from the control (usually this.currentNode)
25
+ */
26
+ export declare function syncCurrencySymbolFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
27
+ /**
28
+ * Reads currency location value from esd-config-block attribute and updates the store.
29
+ * This makes the currency location value mutable by syncing it from the DOM.
30
+ * @param currentNode - The current node from the control (usually this.currentNode)
31
+ */
32
+ export declare function syncCurrencyLocationFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
33
+ /**
34
+ * Reads button link value from esd-config-block attribute and updates the store.
35
+ * This makes the button link value mutable by syncing it from the DOM.
36
+ * @param currentNode - The current node from the control (usually this.currentNode)
37
+ */
38
+ export declare function syncButtonLinkFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
39
+ /**
40
+ * Reads image link value from esd-config-block attribute and updates the store.
41
+ * This makes the image link value mutable by syncing it from the DOM.
42
+ * @param currentNode - The current node from the control (usually this.currentNode)
43
+ */
44
+ export declare function syncImageLinkFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
45
+ /**
46
+ * Reads price orientation value from esd-config-block attribute and updates the store.
47
+ * This makes the price orientation value mutable by syncing it from the DOM.
48
+ * @param currentNode - The current node from the control (usually this.currentNode)
49
+ */
50
+ export declare function syncPriceOrientationFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
@@ -0,0 +1,8 @@
1
+ import { ImmutableHtmlNode, ControlApi } from '@stripoinc/ui-editor-extensions';
2
+ /**
3
+ * Updates attributes on the esd-config-block element based on current store state.
4
+ * This utility can be called from controls whenever they change values that affect attributes.
5
+ * @param currentNode - The current node from the control (usually this.currentNode)
6
+ * @param api - The API object from the control (usually this.api)
7
+ */
8
+ export declare function updateConfigBlockAttributes(currentNode: ImmutableHtmlNode | undefined, api: ControlApi): void;
@@ -56,24 +56,25 @@ export declare abstract class CommonControl extends Control {
56
56
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
57
57
  onDestroy(): void;
58
58
  /**
59
- * Gets the Items block container element from the current node.
60
- * @returns The container element or null if not found
59
+ * Gets the config block element from the current node.
60
+ * @returns The config block element or null if not found
61
61
  */
62
- protected getItemsBlockContainer(): ImmutableHtmlElementNode | null;
62
+ protected getConfigBlock(): ImmutableHtmlElementNode | null;
63
63
  /**
64
- * Gets the current block instance ID from the node config (Stripo V2).
64
+ * Gets the current block instance ID from the config block.
65
+ * @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
65
66
  * @returns The block instance ID or null if not found
66
67
  */
67
- protected getBlockInstanceId(): string | null;
68
+ protected getBlockInstanceId(blockInstanceIdAttribute?: string): string | null;
68
69
  /**
69
70
  * Handles block instance change detection and syncing.
70
- * This is a helper method for controls that need to sync config when switching between block instances.
71
- * Uses Stripo V2 nodeConfig API for block instance tracking.
72
- * @param syncFunction - Function to call when block instance changes (to sync from node config)
71
+ * This is a helper method for controls that need to sync attributes when switching between block instances.
72
+ * @param syncFunction - Function to call when block instance changes (to sync from attributes)
73
73
  * @param updateUI - Function to call to update the UI (called both on change and when same block)
74
+ * @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
74
75
  * @returns true if block instance changed, false otherwise
75
76
  */
76
- protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void): boolean;
77
+ protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void, blockInstanceIdAttribute?: string): boolean;
77
78
  _GuLabel({ text, name, position }: LabelProps): string;
78
79
  _GuToggle(name: string): string;
79
80
  _GuSelectItem({ text, value }: {
@@ -36,7 +36,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
36
36
  } | undefined;
37
37
  }[];
38
38
  selectedUnsubscribePages: number[];
39
- forceRecreate: boolean;
40
39
  };
41
40
  editor: {
42
41
  locale: string;
@@ -128,7 +127,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
128
127
  } | undefined;
129
128
  }[];
130
129
  selectedUnsubscribePages: number[];
131
- forceRecreate: boolean;
132
130
  };
133
131
  editor: {
134
132
  locale: string;
@@ -220,7 +218,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
220
218
  } | undefined;
221
219
  }[];
222
220
  selectedUnsubscribePages: number[];
223
- forceRecreate: boolean;
224
221
  };
225
222
  editor: {
226
223
  locale: string;
@@ -312,7 +309,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
312
309
  } | undefined;
313
310
  }[];
314
311
  selectedUnsubscribePages: number[];
315
- forceRecreate: boolean;
316
312
  };
317
313
  editor: {
318
314
  locale: string;
@@ -404,7 +400,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
404
400
  } | undefined;
405
401
  }[];
406
402
  selectedUnsubscribePages: number[];
407
- forceRecreate: boolean;
408
403
  };
409
404
  editor: {
410
405
  locale: string;
@@ -496,7 +491,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
496
491
  } | undefined;
497
492
  }[];
498
493
  selectedUnsubscribePages: number[];
499
- forceRecreate: boolean;
500
494
  };
501
495
  editor: {
502
496
  locale: string;
@@ -588,7 +582,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
588
582
  } | undefined;
589
583
  }[];
590
584
  selectedUnsubscribePages: number[];
591
- forceRecreate: boolean;
592
585
  };
593
586
  editor: {
594
587
  locale: string;
@@ -680,7 +673,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
680
673
  } | undefined;
681
674
  }[];
682
675
  selectedUnsubscribePages: number[];
683
- forceRecreate: boolean;
684
676
  };
685
677
  editor: {
686
678
  locale: string;
@@ -772,7 +764,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
772
764
  } | undefined;
773
765
  }[];
774
766
  selectedUnsubscribePages: number[];
775
- forceRecreate: boolean;
776
767
  };
777
768
  editor: {
778
769
  locale: string;
@@ -864,7 +855,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
864
855
  } | undefined;
865
856
  }[];
866
857
  selectedUnsubscribePages: number[];
867
- forceRecreate: boolean;
868
858
  };
869
859
  editor: {
870
860
  locale: string;
@@ -956,7 +946,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
956
946
  } | undefined;
957
947
  }[];
958
948
  selectedUnsubscribePages: number[];
959
- forceRecreate: boolean;
960
949
  };
961
950
  editor: {
962
951
  locale: string;
@@ -1048,7 +1037,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1048
1037
  } | undefined;
1049
1038
  }[];
1050
1039
  selectedUnsubscribePages: number[];
1051
- forceRecreate: boolean;
1052
1040
  };
1053
1041
  editor: {
1054
1042
  locale: string;
@@ -1140,7 +1128,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1140
1128
  } | undefined;
1141
1129
  }[];
1142
1130
  selectedUnsubscribePages: number[];
1143
- forceRecreate: boolean;
1144
1131
  };
1145
1132
  editor: {
1146
1133
  locale: string;
@@ -1232,7 +1219,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1232
1219
  } | undefined;
1233
1220
  }[];
1234
1221
  selectedUnsubscribePages: number[];
1235
- forceRecreate: boolean;
1236
1222
  };
1237
1223
  editor: {
1238
1224
  locale: string;
@@ -1324,7 +1310,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1324
1310
  } | undefined;
1325
1311
  }[];
1326
1312
  selectedUnsubscribePages: number[];
1327
- forceRecreate: boolean;
1328
1313
  };
1329
1314
  editor: {
1330
1315
  locale: string;
@@ -1416,7 +1401,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1416
1401
  } | undefined;
1417
1402
  }[];
1418
1403
  selectedUnsubscribePages: number[];
1419
- forceRecreate: boolean;
1420
1404
  };
1421
1405
  editor: {
1422
1406
  locale: string;
@@ -1508,7 +1492,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1508
1492
  } | undefined;
1509
1493
  }[];
1510
1494
  selectedUnsubscribePages: number[];
1511
- forceRecreate: boolean;
1512
1495
  };
1513
1496
  editor: {
1514
1497
  locale: string;
@@ -0,0 +1,4 @@
1
+ const e = "data:image/svg+xml,%3csvg%20width='229'%20height='79'%20viewBox='0%200%20229%2079'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d_9705_75344)'%3e%3crect%20y='42'%20width='229'%20height='36'%20fill='white'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip0_9705_75344)'%3e%3crect%20y='46'%20width='229'%20height='28'%20fill='%23F0F3F4'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_9705_75344)'%3e%3cpath%20d='M0%200H229V42H0V0Z'%20fill='%23DFE1E5'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_9705_75344'%20x='0'%20y='42'%20width='229'%20height='37'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.858824%200%200%200%200%200.862745%200%200%200%200%200.866667%200%200%200%201%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_9705_75344'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_9705_75344'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_9705_75344'%3e%3crect%20width='229'%20height='28'%20fill='white'%20transform='translate(0%2046)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_9705_75344'%3e%3crect%20width='229'%20height='42'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
2
+ export {
3
+ e as default
4
+ };