@useinsider/guido 2.1.0-beta.01eaf27 → 2.1.0-beta.13ada05

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.
@@ -1,13 +1,13 @@
1
1
  import { ModificationDescription as b } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { DefaultConfigValues as o, SETTINGS_ENUMS as n, ItemInCartOptions as g } from "../enums/settingsEnums.js";
3
- function d() {
3
+ function _() {
4
4
  return String(Date.now() + Math.floor(Math.random() * 1e3));
5
5
  }
6
6
  const E = (r) => r.replace(/\$/g, "$$$$");
7
7
  function S() {
8
8
  return {
9
9
  initialized: !0,
10
- blockInstanceId: d(),
10
+ blockInstanceId: _(),
11
11
  source: n.ITEMS_TYPE.CART_ITEMS,
12
12
  type: n.ITEMS_TYPE.CART_ITEMS,
13
13
  itemsSelectValue: o.cartItemsSelectControlValue,
@@ -33,7 +33,7 @@ function S() {
33
33
  buttonVisible: o.productButtonVisible === "1"
34
34
  };
35
35
  }
36
- function s(r) {
36
+ function p(r) {
37
37
  if (!r)
38
38
  return null;
39
39
  const t = r.closest(".items-block-v2");
@@ -66,16 +66,16 @@ function C(r) {
66
66
  const t = r.querySelector("esd-config-block");
67
67
  if (!t)
68
68
  return null;
69
- const e = (c, a) => c == null ? a : c === "1" || c === "true", i = (c, a) => c || a, l = t.getAttribute("data-type"), u = m(l), _ = t.getAttribute("data-cart_items_select_control_value"), p = I(_, u);
69
+ const e = (c, s) => c == null ? s : c === "1" || c === "true", i = (c, s) => c || s, u = t.getAttribute("data-type"), a = m(u), d = t.getAttribute("data-cart_items_select_control_value"), l = I(d, a);
70
70
  return {
71
71
  initialized: e(t.getAttribute("data-initialized"), !1),
72
72
  blockInstanceId: i(
73
73
  t.getAttribute("data-block-instance-id"),
74
- d()
74
+ _()
75
75
  ),
76
- source: u,
77
- type: u,
78
- itemsSelectValue: p,
76
+ source: a,
77
+ type: a,
78
+ itemsSelectValue: l,
79
79
  orientation: t.getAttribute("data-card_orientation_control_value") || n.ORIENTATION.VERTICAL,
80
80
  nameTrimming: e(
81
81
  t.getAttribute("data-product_name_control_trim"),
@@ -150,7 +150,7 @@ function C(r) {
150
150
  };
151
151
  }
152
152
  function y(r) {
153
- const t = s(r);
153
+ const t = p(r);
154
154
  if (!t)
155
155
  return null;
156
156
  const e = t.getNodeConfig();
@@ -159,18 +159,18 @@ function y(r) {
159
159
  const i = C(t);
160
160
  return i || null;
161
161
  }
162
- function A(r, t, e) {
163
- const i = s(r);
164
- if (!i)
162
+ function A(r, t, e, i) {
163
+ const u = p(r);
164
+ if (!u)
165
165
  return;
166
- const u = { ...i.getNodeConfig() || {}, ...e };
167
- t.getDocumentModifier().modifyHtml(i).setNodeConfig(u).apply(new b("Update Items block configuration"));
166
+ const d = { ...u.getNodeConfig() || {}, ...e }, l = i ?? t.getDocumentModifier();
167
+ l.modifyHtml(u).setNodeConfig(d), i || l.apply(new b("Update Items block configuration"));
168
168
  }
169
169
  export {
170
170
  E as escapeReplacement,
171
- d as generateBlockInstanceId,
171
+ _ as generateBlockInstanceId,
172
172
  S as getDefaultItemsBlockConfig,
173
173
  y as getItemsBlockConfig,
174
- s as getItemsBlockContainer,
174
+ p as getItemsBlockContainer,
175
175
  A as setItemsBlockConfig
176
176
  };
@@ -1,4 +1,4 @@
1
- const o = { stripo: { version: "2.52.0" } }, s = {
1
+ const o = { stripo: { version: "2.54.0" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
@@ -18,10 +18,11 @@ export declare class ItemsBlockCardCompositionControl extends CommonControl {
18
18
  * If itemsType is not BROWSED_ITEMS, show quantity
19
19
  * If itemsType is BROWSED_ITEMS, hide quantity
20
20
  * and mark it as '0'
21
+ * @param syncOnly - If true, only sync local state and UI without modifying the document
21
22
  */
22
- _handleBrowsedItemsQuantity(): void;
23
- _applyVisibilityStyles(): void;
24
- _updateVisibilityAttribute(elementName: string, isVisible: boolean): void;
23
+ _handleBrowsedItemsQuantity(syncOnly?: boolean): void;
24
+ _applyVisibilityStyles(modifier?: ReturnType<typeof this.api.getDocumentModifier>): void;
25
+ _updateVisibilityAttribute(elementName: string, isVisible: boolean, modifier?: ReturnType<typeof this.api.getDocumentModifier>): void;
25
26
  _listenToFormUpdates(): void;
26
27
  _onProductImageChange(value: boolean): void;
27
28
  _onProductNameChange(value: boolean): void;
@@ -36,6 +37,6 @@ export declare class ItemsBlockCardCompositionControl extends CommonControl {
36
37
  * - When price is hidden, original price cell expands to 100%
37
38
  * - When both are visible, they share 50% each
38
39
  */
39
- _updatePriceCellWidthsForVerticalLayout(): void;
40
+ _updatePriceCellWidthsForVerticalLayout(modifier?: ReturnType<typeof this.api.getDocumentModifier>): void;
40
41
  _onProductButtonChange(value: boolean): void;
41
42
  }
@@ -16,7 +16,7 @@ export declare class ItemsBlockControl extends CommonControl {
16
16
  _initializeSelectItems(): void;
17
17
  _listenToFormUpdates(): void;
18
18
  _renderTemplate(): void;
19
- _getTemplateData(itemsTypeOverride?: ProductType): {
19
+ _getTemplateData(itemsTypeOverride?: ProductType, itemIdOverride?: string): {
20
20
  imageSrc: string;
21
21
  name: string;
22
22
  price: string;
@@ -24,14 +24,14 @@ export declare class ItemsBlockControl extends CommonControl {
24
24
  quantity: string;
25
25
  button: string;
26
26
  };
27
- _updateImageSrc(imageSrc: string): void;
28
- _updateName(name: string): void;
29
- _updatePrice(price: string): void;
30
- _updateOriginalPrice(originalPrice: string): void;
31
- _updateQuantity(quantity: string, itemsTypeOverride?: ProductType): void;
32
- _reOrderTemplate(): void;
33
- _updateDataTypeAttributes(itemsType: ProductType): void;
34
- _updateDataNumberAttributes(itemId: string): void;
27
+ _updateImageSrc(imageSrc: string, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
28
+ _updateName(name: string, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
29
+ _updatePrice(price: string, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
30
+ _updateOriginalPrice(originalPrice: string, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
31
+ _updateQuantity(quantity: string, itemsTypeOverride: ProductType | undefined, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
32
+ _reOrderTemplate(modifier?: ReturnType<typeof this.api.getDocumentModifier>): void;
33
+ _updateDataTypeAttributes(itemsType: ProductType, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
34
+ _updateDataNumberAttributes(itemId: string, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
35
35
  _reFillTemplate(itemsType?: ProductType): void;
36
36
  _recalculateTrimming(): void;
37
37
  private _getParagraphFromBlock;
@@ -66,8 +66,9 @@ export declare function getItemsBlockConfig(currentNode: ImmutableHtmlNode | und
66
66
  * @param currentNode - The current node from the control
67
67
  * @param api - The API object (ControlApi or BlockApi)
68
68
  * @param config - The configuration to set (partial update supported)
69
+ * @param modifier - Optional document modifier for batching updates
69
70
  */
70
- export declare function setItemsBlockConfig(currentNode: ImmutableHtmlNode | undefined, api: ControlApi | BlockApi, config: Partial<ItemsBlockConfig>): void;
71
+ export declare function setItemsBlockConfig(currentNode: ImmutableHtmlNode | undefined, api: ControlApi | BlockApi, config: Partial<ItemsBlockConfig>, modifier?: ReturnType<typeof api.getDocumentModifier>): void;
71
72
  /**
72
73
  * Gets the block instance ID from the node config.
73
74
  * @param currentNode - The current node from the control
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.1.0-beta.01eaf27",
3
+ "version": "2.1.0-beta.13ada05",
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",
@@ -85,7 +85,7 @@
85
85
  },
86
86
  "guido": {
87
87
  "stripo": {
88
- "version": "2.52.0"
88
+ "version": "2.54.0"
89
89
  }
90
90
  }
91
91
  }