@useinsider/guido 1.0.3-beta.72dd3c0 → 1.0.3-beta.734efde

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 (109) hide show
  1. package/README.md +32 -3
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +73 -79
  4. package/dist/components/organisms/header/RightSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/RightSlot.vue2.js +22 -23
  6. package/dist/composables/useBlocksConfig.js +1 -2
  7. package/dist/composables/useGuidoActions.js +9 -19
  8. package/dist/composables/useStripo.js +36 -38
  9. package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
  10. package/dist/enums/defaults.js +1 -2
  11. package/dist/enums/extensions/recommendationBlock.js +2 -2
  12. package/dist/enums/unsubscribe.js +25 -27
  13. package/dist/extensions/Blocks/Checkbox/block.js +5 -2
  14. package/dist/extensions/Blocks/Items/block.js +66 -0
  15. package/dist/extensions/Blocks/Items/controls/button/link.js +68 -0
  16. package/dist/extensions/Blocks/Items/controls/cardComposition.js +99 -0
  17. package/dist/extensions/Blocks/Items/controls/image/link.js +68 -0
  18. package/dist/extensions/Blocks/Items/controls/index.js +217 -0
  19. package/dist/extensions/Blocks/Items/controls/name/trimming.js +70 -0
  20. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +107 -0
  21. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +123 -0
  22. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +76 -0
  23. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +61 -0
  24. package/dist/extensions/Blocks/Items/controls/settingsControl.js +280 -0
  25. package/dist/extensions/Blocks/Items/enums/controlEnums.js +5 -0
  26. package/dist/extensions/Blocks/Items/enums/productEnums.js +195 -0
  27. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +70 -0
  28. package/dist/extensions/Blocks/Items/extension.js +19 -0
  29. package/dist/extensions/Blocks/Items/iconsRegistry.js +32 -0
  30. package/dist/extensions/Blocks/Items/items.css.js +23 -0
  31. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +61 -0
  32. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +61 -0
  33. package/dist/extensions/Blocks/Items/settingsPanel.js +106 -0
  34. package/dist/extensions/Blocks/Items/store/items-block.js +71 -0
  35. package/dist/extensions/Blocks/Items/template.js +110 -0
  36. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +17 -0
  37. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +28 -0
  38. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +67 -0
  39. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +44 -0
  40. package/dist/extensions/Blocks/RadioButton/block.js +5 -2
  41. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +43 -43
  42. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  43. package/dist/extensions/Blocks/common-control.js +174 -110
  44. package/dist/extensions/Blocks/controlFactories.js +223 -0
  45. package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
  46. package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
  47. package/dist/guido.css +1 -1
  48. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +213 -168
  49. package/dist/package.json.js +1 -1
  50. package/dist/services/recommendationApi.js +13 -19
  51. package/dist/src/@types/generic.d.ts +6 -27
  52. package/dist/src/components/Guido.vue.d.ts +2 -3
  53. package/dist/src/composables/useGuidoActions.d.ts +0 -9
  54. package/dist/src/extensions/Blocks/Checkbox/block.d.ts +1 -0
  55. package/dist/src/extensions/Blocks/Items/block.d.ts +13 -0
  56. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +14 -0
  57. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +20 -0
  58. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +14 -0
  59. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +501 -0
  60. package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +14 -0
  61. package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +19 -0
  62. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +21 -0
  63. package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +14 -0
  64. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +13 -0
  65. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +42 -0
  66. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +61 -0
  67. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +154 -0
  68. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +43 -0
  69. package/dist/src/extensions/Blocks/Items/extension.d.ts +2 -0
  70. package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +4 -0
  71. package/dist/src/extensions/Blocks/Items/settingsPanel.d.ts +4 -0
  72. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +41 -0
  73. package/dist/src/extensions/Blocks/Items/template.d.ts +16 -0
  74. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +23 -0
  75. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +32 -0
  76. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +44 -0
  77. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +8 -0
  78. package/dist/src/extensions/Blocks/RadioButton/block.d.ts +1 -0
  79. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  80. package/dist/src/extensions/Blocks/common-control.d.ts +44 -7
  81. package/dist/src/extensions/Blocks/controlFactories.d.ts +312 -0
  82. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
  83. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
  84. package/dist/src/stores/config.d.ts +2 -3
  85. package/dist/src/stores/dynamic-content.d.ts +3 -3
  86. package/dist/src/stores/editor.d.ts +1 -1
  87. package/dist/src/stores/onboarding.d.ts +1 -1
  88. package/dist/src/stores/preview.d.ts +1 -1
  89. package/dist/src/stores/recommendation.d.ts +1 -1
  90. package/dist/src/stores/save-as-template.d.ts +1 -1
  91. package/dist/src/stores/toaster.d.ts +1 -1
  92. package/dist/src/stores/unsubscribe.d.ts +1 -1
  93. package/dist/src/stores/version-history.d.ts +1 -1
  94. package/dist/src/utils/genericUtil.d.ts +0 -1
  95. package/dist/static/styles/customEditorStyle.css.js +1 -1
  96. package/dist/stores/config.js +5 -5
  97. package/dist/stores/dynamic-content.js +2 -2
  98. package/dist/stores/editor.js +1 -1
  99. package/dist/stores/onboarding.js +27 -27
  100. package/dist/stores/preview.js +1 -1
  101. package/dist/stores/recommendation.js +3 -3
  102. package/dist/stores/save-as-template.js +2 -2
  103. package/dist/stores/toaster.js +1 -1
  104. package/dist/stores/unsubscribe.js +1 -1
  105. package/dist/stores/version-history.js +4 -4
  106. package/dist/utils/genericUtil.js +11 -23
  107. package/package.json +12 -5
  108. package/dist/src/utils/environmentUtil.d.ts +0 -5
  109. package/dist/utils/environmentUtil.js +0 -4
@@ -0,0 +1,61 @@
1
+ const t = `<td align="center" class="ins-product-td items-block items-block-v2">
2
+ <table class="es-left ins-product-wrapper" cellspacing="0" cellpadding="0" align="left" width="100%">
3
+ {-{-CONFIG_BLOCK-}-}
4
+ <tbody>
5
+ <tr>
6
+ <td class="es-p20b es-p10r es-p10l es-m-p20b es-p10t" width="100%" align="center">
7
+ <table class="ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
8
+ <tr style="vertical-align: top">
9
+ <td colspan="2" width="100%" align="center" data-slot-1>
10
+ <table width="100%">
11
+ <tbody>
12
+ {-{-PRODUCT_IMAGE-}-}
13
+ </tbody>
14
+ </table>
15
+ </td>
16
+ </tr>
17
+ {-{-PRODUCT_NAME-}-}
18
+ <tr>
19
+ <td width="50%" style=" width: 50%;display: block;float: left;">
20
+ <table width="100%">
21
+ <tbody>
22
+ {-{-PRODUCT_PRICE-}-}
23
+ </tbody>
24
+ </table>
25
+ </td>
26
+ <td width="50%" style=" width: 50%;display: block;float: left;">
27
+ <table width="100%">
28
+ <tbody>
29
+ {-{-PRODUCT_ORIGINAL_PRICE-}-}
30
+ </tbody>
31
+ </table>
32
+ </td>
33
+ </tr>
34
+ <tr>
35
+ <td width="100%">
36
+ <table width="100%">
37
+ <tbody>
38
+ {-{-PRODUCT_QUANTITY-}-}
39
+ </tbody>
40
+ </table>
41
+ </td>
42
+ </tr>
43
+ <tr>
44
+ <td width="100%">
45
+ <table width="100%">
46
+ <tbody>
47
+ {-{-PRODUCT_BUTTON-}-}
48
+ </tbody>
49
+ </table>
50
+ </td>
51
+ </tr>
52
+ </table>
53
+ </td>
54
+ </tr>
55
+ </tbody>
56
+ </table>
57
+ </td>
58
+ `;
59
+ export {
60
+ t as default
61
+ };
@@ -0,0 +1,61 @@
1
+ const t = `<td align="center" class="ins-product-td items-block items-block-v2">
2
+ <table class="es-left ins-product-wrapper ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
3
+ {-{-CONFIG_BLOCK-}-}
4
+ <tbody>
5
+ <tr>
6
+ <td style="padding: 16px 9px;">
7
+ <table class="es-left esdev-disable-select" cellspacing="0" cellpadding="0" align="left"
8
+ width="100%">
9
+ <tbody>
10
+ <tr>
11
+ <td class="product-image-class" data-slot-1>
12
+ {-{-PRODUCT_IMAGE-}-}
13
+ </td>
14
+ <td class="product-name-class" data-slot-2 width="130px">
15
+ <table width="130">
16
+ <tbody>
17
+ {-{-PRODUCT_NAME-}-}
18
+ </tbody>
19
+ </table>
20
+ </td>
21
+ <td class="product-quantity-class" data-slot-3>
22
+ <table width="100%">
23
+ <tbody>
24
+ {-{-PRODUCT_QUANTITY-}-}
25
+ </tbody>
26
+ </table>
27
+ </td>
28
+ <td class="product-price-class" data-slot-4>
29
+
30
+ <table width="100%">
31
+ <tbody>
32
+ {-{-PRODUCT_PRICE-}-}
33
+ </tbody>
34
+ </table>
35
+ </td>
36
+ <td class="product-original-price-class" data-slot-5>
37
+ <table width="100%">
38
+ <tbody>
39
+ {-{-PRODUCT_ORIGINAL_PRICE-}-}
40
+ </tbody>
41
+ </table>
42
+ </td>
43
+ <td class="product-button-class" data-slot-6>
44
+ <table width="100%">
45
+ <tbody>
46
+ {-{-PRODUCT_BUTTON-}-}
47
+ </tbody>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </tbody>
52
+ </table>
53
+ </td>
54
+ </tr>
55
+ </tbody>
56
+ </table>
57
+ </td>
58
+ `;
59
+ export {
60
+ t as default
61
+ };
@@ -0,0 +1,106 @@
1
+ import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as _, ContainerControls as R } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { BLOCK_ID as A } from "./block.js";
3
+ import { COMPOSITION_CONTROL_BLOCK_ID as S } from "./controls/cardComposition.js";
4
+ import { CONTROL_BLOCK_ID as C } from "./controls/settingsControl.js";
5
+ import { ItemsBlockId as E, ItemsBlockControlId as I } from "./enums/controlEnums.js";
6
+ class t extends O {
7
+ registerBlockControls(N) {
8
+ N[A] = [
9
+ new T(
10
+ _.SETTINGS,
11
+ [
12
+ C,
13
+ R.EXTERNAL_INDENTS
14
+ ]
15
+ ),
16
+ new T(
17
+ "Card Composition",
18
+ [
19
+ S
20
+ ]
21
+ ).withLabel("Card Composition")
22
+ ], N[E.ORIGINAL_PRICE] = [
23
+ new T(
24
+ _.SETTINGS,
25
+ [
26
+ I.ORIGINAL_PRICE_COLOR,
27
+ I.ORIGINAL_PRICE_ALIGN,
28
+ I.ORIGINAL_PRICE_FONT_FAMILY,
29
+ I.ORIGINAL_PRICE_SIZE,
30
+ I.ORIGINAL_PRICE_STYLE,
31
+ I.ORIGINAL_PRICE_PADDINGS
32
+ ]
33
+ )
34
+ ], N[E.PRICE] = [
35
+ new T(
36
+ _.SETTINGS,
37
+ [
38
+ I.PRICE_COLOR,
39
+ I.PRICE_ALIGN,
40
+ I.PRICE_FONT_FAMILY,
41
+ I.PRICE_SIZE,
42
+ I.PRICE_STYLE,
43
+ I.PRICE_HIDE_DISCOUNT,
44
+ I.PRICE_FORMATTED_PRICE,
45
+ I.PRICE_CURRENCY_SYMBOL,
46
+ I.PRICE_CURRENCY_LOCATION,
47
+ I.PRICE_PADDINGS
48
+ ]
49
+ )
50
+ ], N[E.NAME] = [
51
+ new T(
52
+ _.SETTINGS,
53
+ [
54
+ I.NAME_COLOR,
55
+ I.NAME_ALIGN,
56
+ I.NAME_FONT_FAMILY,
57
+ I.NAME_SIZE,
58
+ I.NAME_STYLE,
59
+ I.NAME_TRIMMING,
60
+ I.NAME_PADDINGS
61
+ ]
62
+ )
63
+ ], N[E.QUANTITY] = [
64
+ new T(
65
+ _.SETTINGS,
66
+ [
67
+ I.QUANTITY_COLOR,
68
+ I.QUANTITY_ALIGN,
69
+ I.QUANTITY_FONT_FAMILY,
70
+ I.QUANTITY_SIZE,
71
+ I.QUANTITY_STYLE,
72
+ I.QUANTITY_PADDINGS
73
+ ]
74
+ )
75
+ ], N[E.IMAGE] = [
76
+ new T(
77
+ _.SETTINGS,
78
+ [
79
+ I.IMAGE_LINK,
80
+ I.IMAGE_SIZE,
81
+ I.IMAGE_MARGINS
82
+ ]
83
+ )
84
+ ], N[E.BUTTON] = [
85
+ new T(
86
+ _.SETTINGS,
87
+ [
88
+ I.BUTTON_LINK,
89
+ I.BUTTON_TEXT,
90
+ I.BUTTON_FONT_FAMILY,
91
+ I.BUTTON_TEXT_SIZE,
92
+ I.BUTTON_COLOR,
93
+ I.BUTTON_BORDER,
94
+ I.BUTTON_BORDER_RADIUS,
95
+ I.BUTTON_ALIGN,
96
+ I.BUTTON_FIT_TO_CONTENT,
97
+ I.BUTTON_PADDINGS,
98
+ I.BUTTON_MARGINS
99
+ ]
100
+ )
101
+ ];
102
+ }
103
+ }
104
+ export {
105
+ t as SettingsPanel
106
+ };
@@ -0,0 +1,71 @@
1
+ import { defineStore as s } from "pinia";
2
+ import { DefaultConfigValues as e } from "../enums/settingsEnums.js";
3
+ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "Url}"), i = () => {
4
+ const t = e.cartItemsSelectControlValue;
5
+ return {
6
+ itemsType: e.itemsType,
7
+ itemIds: t,
8
+ imageLink: n(t),
9
+ buttonLink: o(t),
10
+ orientation: e.cardOrientationControlValue,
11
+ nameTrimming: !1,
12
+ hideDiscount: !1,
13
+ currencySymbol: "USD",
14
+ currencyLocation: "0",
15
+ formattedPrice: !0,
16
+ templateData: {
17
+ imageSrc: "",
18
+ name: "",
19
+ price: "",
20
+ originalPrice: "",
21
+ quantity: "",
22
+ button: ""
23
+ }
24
+ };
25
+ }, a = s("guidoItemsBlock", {
26
+ state: () => i(),
27
+ actions: {
28
+ setItemsType(t) {
29
+ this.itemsType = t;
30
+ },
31
+ setItemIds(t) {
32
+ this.itemIds = t, this.imageLink = n(t), this.buttonLink = o(t);
33
+ },
34
+ setImageLink(t) {
35
+ this.imageLink = t;
36
+ },
37
+ setButtonLink(t) {
38
+ this.buttonLink = t;
39
+ },
40
+ setOrientation(t) {
41
+ this.orientation = t;
42
+ },
43
+ setNameTrimming(t) {
44
+ this.nameTrimming = t;
45
+ },
46
+ setHideDiscount(t) {
47
+ this.hideDiscount = t;
48
+ },
49
+ setCurrencySymbol(t) {
50
+ this.currencySymbol = t;
51
+ },
52
+ setCurrencyLocation(t) {
53
+ this.currencyLocation = t;
54
+ },
55
+ setFormattedPrice(t) {
56
+ this.formattedPrice = t;
57
+ },
58
+ setTemplateData(t) {
59
+ this.templateData = t;
60
+ },
61
+ updateFromAttributes(t) {
62
+ t.itemsType && (this.itemsType = t.itemsType), t.itemIds && this.setItemIds(t.itemIds), t.orientation && (this.orientation = t.orientation);
63
+ },
64
+ reset() {
65
+ Object.assign(this, i());
66
+ }
67
+ }
68
+ });
69
+ export {
70
+ a as useItemsBlockStore
71
+ };
@@ -0,0 +1,110 @@
1
+ import { BlockType as i, BlockAttr as l } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { ItemsBlockId as n } from "./enums/controlEnums.js";
3
+ import { productPairs as e } from "./enums/productEnums.js";
4
+ import { ItemInCartOptions as N, SETTINGS_ENUMS as r } from "./enums/settingsEnums.js";
5
+ import d from "./layouts/horizontal.html.js";
6
+ import P from "./layouts/vertical.html.js";
7
+ let [R] = e.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [A] = e.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [I] = e.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [a] = e.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [p] = e.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
8
+ const $ = () => `
9
+ <${i.BLOCK_IMAGE}
10
+ ${l.BLOCK_IMAGE.src}="${R}"
11
+ ${l.BLOCK_IMAGE.alt}="Product Image"
12
+ ${l.BLOCK_IMAGE.href}="#"
13
+ ${l.BLOCK_IMAGE.width}="70"
14
+ esd-extension-block-id="${n.IMAGE}"
15
+ data-type="CART_ITEMS"
16
+ data-number="1"
17
+ />
18
+ `, B = () => `
19
+ <${i.BLOCK_TEXT}
20
+ width="100%"
21
+ align="center"
22
+ class="es-p10"
23
+ esd-extension-block-id="${n.NAME}"
24
+ >
25
+ <p
26
+ data-slot-2
27
+ width="100%">
28
+ ${A}
29
+ </p>
30
+ </${i.BLOCK_TEXT}>
31
+ `, S = (T, t) => {
32
+ let o = I;
33
+ if (T && T.trim()) {
34
+ const E = `&nbsp;${T.trim()}&nbsp;`;
35
+ o = (t || "0") === "1" ? `${I}${E}` : `${E}${I}`;
36
+ }
37
+ return `
38
+ <${i.BLOCK_TEXT}
39
+ esd-extension-block-id="${n.PRICE}"
40
+ class="items-block-price"
41
+ width="100%"
42
+ align="center"
43
+ >
44
+ <p contenteditable="false">
45
+ ${o}
46
+ </p>
47
+ </${i.BLOCK_TEXT}>
48
+ `;
49
+ }, F = (T, t) => {
50
+ let o = a;
51
+ if (T && T.trim()) {
52
+ const E = `&nbsp;${T.trim()}&nbsp;`;
53
+ o = (t || "0") === "1" ? `${a}${E}` : `${E}${a}`;
54
+ }
55
+ return `
56
+ <${i.BLOCK_TEXT}
57
+ class="items-block-price"
58
+ esd-extension-block-id="${n.ORIGINAL_PRICE}"
59
+ width="100%"
60
+ align="center"
61
+ >
62
+ <p
63
+ contenteditable="false"
64
+ style="color: #cc0000"
65
+ >
66
+ <s>${o}</s>
67
+ </p>
68
+ </${i.BLOCK_TEXT}>
69
+ `;
70
+ }, L = () => `
71
+ <${i.BLOCK_TEXT}
72
+ width="100%"
73
+ align="center"
74
+ class="es-p10"
75
+ esd-extension-block-id="${n.QUANTITY}"
76
+ >
77
+ <p
78
+ data-slot-3
79
+ contenteditable="false"
80
+ width="100%">
81
+ ${p}
82
+ </p>
83
+ </${i.BLOCK_TEXT}>
84
+ `, g = () => `
85
+ <${i.BLOCK_BUTTON}
86
+ width="100%"
87
+ class="ins-button"
88
+ name="buy-button"
89
+ caption="Buy"
90
+ align="center"
91
+ esd-extension-block-id="${n.BUTTON}"
92
+ >Buy
93
+ </${i.BLOCK_BUTTON}>
94
+ `, U = () => `
95
+ <esd-config-block style="display: none;"></esd-config-block>
96
+ `, s = (T, t, o) => T.replace("{-{-PRODUCT_IMAGE-}-}", $()).replace("{-{-PRODUCT_NAME-}-}", B()).replace("{-{-PRODUCT_PRICE-}-}", S(t, o)).replace("{-{-PRODUCT_ORIGINAL_PRICE-}-}", F(t, o)).replace("{-{-PRODUCT_QUANTITY-}-}", L()).replace("{-{-PRODUCT_BUTTON-}-}", g()).replace("{-{-CONFIG_BLOCK-}-}", U());
97
+ function u({
98
+ orientation: T,
99
+ itemsType: t = r.ITEMS_TYPE.CART_ITEMS,
100
+ itemId: o,
101
+ currencySymbol: E,
102
+ currencyLocation: c,
103
+ formattedPrice: _ = !0
104
+ }) {
105
+ const O = N[t].findIndex((C) => C.value === o);
106
+ return R = e.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[O], A = e.PAIRS_FOR_EXTENSION.name[t].DEFAULT[O], I = _ ? e.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : e.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, a = _ ? e.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : e.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, p = e.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, T === r.ORIENTATION.VERTICAL ? s(P, E, c) : s(d, E, c);
107
+ }
108
+ export {
109
+ u as getDefaultTemplate
110
+ };
@@ -0,0 +1,17 @@
1
+ function r(t) {
2
+ if (!t)
3
+ return null;
4
+ const n = t.closest(".items-block-v2");
5
+ return n ? n.querySelector("esd-config-block") : null;
6
+ }
7
+ function o(t, n = !1) {
8
+ return t == null ? n : t === "1" || t === "true";
9
+ }
10
+ function e(t, n = "") {
11
+ return t || n;
12
+ }
13
+ export {
14
+ o as attributeToBoolean,
15
+ e as attributeToString,
16
+ r as getConfigBlock
17
+ };
@@ -0,0 +1,28 @@
1
+ import { configAttributes as i } from "../enums/productEnums.js";
2
+ import { getConfigBlock as c, attributeToBoolean as u, attributeToString as a } from "./configBlockUtils.js";
3
+ function l(r, t) {
4
+ const e = c(r);
5
+ if (!e)
6
+ return;
7
+ const o = e.getAttribute(i[t.attributeName]), n = t.converter(o);
8
+ t.storeSetter(n);
9
+ }
10
+ function b(r, t, e = !1) {
11
+ return {
12
+ attributeName: r,
13
+ storeSetter: t,
14
+ converter: (o) => u(o, e)
15
+ };
16
+ }
17
+ function s(r, t, e = "") {
18
+ return {
19
+ attributeName: r,
20
+ storeSetter: t,
21
+ converter: (o) => a(o, e)
22
+ };
23
+ }
24
+ export {
25
+ b as createBooleanSyncConfig,
26
+ s as createStringSyncConfig,
27
+ l as syncAttributeFromConfigBlock
28
+ };
@@ -0,0 +1,67 @@
1
+ import { useItemsBlockStore as s } from "../store/items-block.js";
2
+ import { syncAttributeFromConfigBlock as e, createBooleanSyncConfig as i, createStringSyncConfig as r } from "./syncAttributeFromConfigBlock.js";
3
+ function C(t) {
4
+ const o = s(), n = i(
5
+ "PRODUCT_NAME_TRIMMING",
6
+ (c) => o.setNameTrimming(c),
7
+ !1
8
+ );
9
+ e(t, n);
10
+ }
11
+ function f(t) {
12
+ const o = s(), n = i(
13
+ "PRODUCT_PRICE_HIDE_DISCOUNT",
14
+ (c) => o.setHideDiscount(c),
15
+ !1
16
+ );
17
+ e(t, n);
18
+ }
19
+ function R(t) {
20
+ const o = s(), n = i(
21
+ "PRODUCT_PRICE_FORMATTED",
22
+ (c) => o.setFormattedPrice(c),
23
+ !0
24
+ );
25
+ e(t, n);
26
+ }
27
+ function _(t) {
28
+ const o = s(), n = r(
29
+ "PRODUCT_PRICE_CURRENCY_SYMBOL",
30
+ (c) => o.setCurrencySymbol(c),
31
+ ""
32
+ );
33
+ e(t, n);
34
+ }
35
+ function y(t) {
36
+ const o = s(), n = r(
37
+ "PRODUCT_PRICE_CURRENCY_LOCATION",
38
+ (c) => o.setCurrencyLocation(c),
39
+ "0"
40
+ );
41
+ e(t, n);
42
+ }
43
+ function T(t) {
44
+ const o = s(), n = r(
45
+ "PRODUCT_BUTTON_LINK",
46
+ (c) => o.setButtonLink(c),
47
+ ""
48
+ );
49
+ e(t, n);
50
+ }
51
+ function g(t) {
52
+ const o = s(), n = r(
53
+ "PRODUCT_IMAGE_LINK",
54
+ (c) => o.setImageLink(c),
55
+ ""
56
+ );
57
+ e(t, n);
58
+ }
59
+ export {
60
+ T as syncButtonLinkFromAttributes,
61
+ y as syncCurrencyLocationFromAttributes,
62
+ _ as syncCurrencySymbolFromAttributes,
63
+ R as syncFormattedPriceFromAttributes,
64
+ f as syncHideDiscountFromAttributes,
65
+ g as syncImageLinkFromAttributes,
66
+ C as syncNameTrimmingFromAttributes
67
+ };
@@ -0,0 +1,44 @@
1
+ import { ModificationDescription as D } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { configAttributes as t } from "../enums/productEnums.js";
3
+ import { DefaultConfigValues as e } from "../enums/settingsEnums.js";
4
+ import { useItemsBlockStore as l } from "../store/items-block.js";
5
+ import { getConfigBlock as p } from "./configBlockUtils.js";
6
+ function b(n, c) {
7
+ const i = p(n);
8
+ if (!i)
9
+ return;
10
+ const C = l(), {
11
+ itemsType: r,
12
+ itemIds: E,
13
+ orientation: T,
14
+ nameTrimming: _,
15
+ hideDiscount: O,
16
+ formattedPrice: m,
17
+ currencySymbol: R,
18
+ currencyLocation: N,
19
+ buttonLink: a,
20
+ imageLink: f
21
+ } = C, u = {
22
+ "data-source": r,
23
+ [t.TYPE]: r,
24
+ [t.ITEMS_INDEX_SELECT_CONTROL_VALUE]: E,
25
+ [t.ORIENTATION]: T,
26
+ [t.PRODUCT_NAME_TRIMMING]: _ ? "1" : "0",
27
+ [t.PRODUCT_PRICE_HIDE_DISCOUNT]: O ? "1" : "0",
28
+ [t.PRODUCT_PRICE_FORMATTED]: m ? "1" : "0",
29
+ [t.PRODUCT_PRICE_CURRENCY_SYMBOL]: R || "",
30
+ [t.PRODUCT_PRICE_CURRENCY_LOCATION]: N || "0",
31
+ [t.PRODUCT_BUTTON_LINK]: a || "",
32
+ [t.PRODUCT_IMAGE_LINK]: f || "",
33
+ [t.NAME_CONTROL_ENABLED]: e.productNameControlEnabled,
34
+ [t.QUANTITY_CONTROL_ENABLED]: e.productQuantityControlEnabled,
35
+ [t.PRICE_CONTROL_OPENED]: e.productPriceControlOpened
36
+ };
37
+ let o = c.getDocumentModifier().modifyHtml(i);
38
+ Object.entries(u).forEach(([I, s]) => {
39
+ o = o.setAttribute(I, s);
40
+ }), o.apply(new D("Update config block attributes from control"));
41
+ }
42
+ export {
43
+ b as updateConfigBlockAttributes
44
+ };
@@ -1,7 +1,7 @@
1
1
  import { Block as t, BlockCompositionType as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { getDefaultTemplate as e } from "./template.js";
3
3
  const r = "radio-button-block";
4
- class c extends t {
4
+ class l extends t {
5
5
  constructor() {
6
6
  super();
7
7
  }
@@ -23,8 +23,11 @@ class c extends t {
23
23
  getTemplate() {
24
24
  return e();
25
25
  }
26
+ allowInnerBlocksDND() {
27
+ return !1;
28
+ }
26
29
  }
27
30
  export {
28
31
  r as BLOCK_ID,
29
- c as RadioButtonCustomBlock
32
+ l as RadioButtonCustomBlock
30
33
  };