@useinsider/guido 1.0.3-beta.2cf8046 → 1.0.3-beta.2dd7b80

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 (80) hide show
  1. package/README.md +0 -32
  2. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
  3. package/dist/composables/useBlocksConfig.js +2 -1
  4. package/dist/composables/useStripo.js +9 -9
  5. package/dist/enums/extensions/recommendationBlock.js +2 -2
  6. package/dist/enums/onboarding.js +3 -7
  7. package/dist/enums/unsubscribe.js +27 -26
  8. package/dist/extensions/Blocks/Checkbox/block.js +2 -5
  9. package/dist/extensions/Blocks/RadioButton/block.js +2 -5
  10. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +43 -43
  11. package/dist/extensions/Blocks/common-control.js +110 -174
  12. package/dist/guido.css +1 -1
  13. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +168 -213
  14. package/dist/package.json.js +1 -1
  15. package/dist/services/recommendationApi.js +19 -13
  16. package/dist/src/enums/onboarding.d.ts +0 -4
  17. package/dist/src/extensions/Blocks/Checkbox/block.d.ts +0 -1
  18. package/dist/src/extensions/Blocks/RadioButton/block.d.ts +0 -1
  19. package/dist/src/extensions/Blocks/common-control.d.ts +7 -44
  20. package/dist/src/stores/onboarding.d.ts +0 -334
  21. package/dist/src/utils/environmentUtil.d.ts +5 -0
  22. package/dist/static/styles/customEditorStyle.css.js +1 -1
  23. package/dist/stores/onboarding.js +12 -20
  24. package/dist/utils/environmentUtil.js +4 -0
  25. package/dist/utils/genericUtil.js +17 -16
  26. package/package.json +5 -12
  27. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +0 -21
  28. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +0 -99
  29. package/dist/extensions/Blocks/Items/block.js +0 -67
  30. package/dist/extensions/Blocks/Items/controls/button/link.js +0 -68
  31. package/dist/extensions/Blocks/Items/controls/cardComposition.js +0 -193
  32. package/dist/extensions/Blocks/Items/controls/image/link.js +0 -68
  33. package/dist/extensions/Blocks/Items/controls/index.js +0 -217
  34. package/dist/extensions/Blocks/Items/controls/name/trimming.js +0 -70
  35. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +0 -107
  36. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +0 -123
  37. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +0 -76
  38. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +0 -61
  39. package/dist/extensions/Blocks/Items/controls/settingsControl.js +0 -280
  40. package/dist/extensions/Blocks/Items/enums/controlEnums.js +0 -5
  41. package/dist/extensions/Blocks/Items/enums/productEnums.js +0 -201
  42. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +0 -76
  43. package/dist/extensions/Blocks/Items/extension.js +0 -19
  44. package/dist/extensions/Blocks/Items/iconsRegistry.js +0 -32
  45. package/dist/extensions/Blocks/Items/items.css.js +0 -23
  46. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +0 -61
  47. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +0 -61
  48. package/dist/extensions/Blocks/Items/settingsPanel.js +0 -106
  49. package/dist/extensions/Blocks/Items/store/items-block.js +0 -71
  50. package/dist/extensions/Blocks/Items/template.js +0 -110
  51. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +0 -17
  52. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +0 -28
  53. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +0 -67
  54. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +0 -44
  55. package/dist/extensions/Blocks/controlFactories.js +0 -223
  56. package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +0 -2
  57. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -13
  58. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -14
  59. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -33
  60. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -14
  61. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +0 -501
  62. package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +0 -14
  63. package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +0 -19
  64. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -21
  65. package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +0 -14
  66. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +0 -13
  67. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -42
  68. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -61
  69. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -160
  70. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -49
  71. package/dist/src/extensions/Blocks/Items/extension.d.ts +0 -2
  72. package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +0 -4
  73. package/dist/src/extensions/Blocks/Items/settingsPanel.d.ts +0 -4
  74. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -41
  75. package/dist/src/extensions/Blocks/Items/template.d.ts +0 -16
  76. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +0 -23
  77. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +0 -32
  78. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -44
  79. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +0 -8
  80. package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -312
@@ -1,32 +0,0 @@
1
- import { IconsRegistry as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- class i extends o {
3
- registerIconsSvg(t) {
4
- t["items-icon"] = `
5
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
6
- <path d="M1.00195 6.5C1.55424 6.5 2.00195 6.94772 2.00195 7.5V14.5C2.00195 15.0523 2.44967 15.5
7
- 3.00195 15.5H15C15.5523 15.5 16 15.9477 16 16.5C16 17.0523 15.5523 17.5 15 17.5H3.00195C1.3451
8
- 17.5 0.00195312 16.1569 0.00195312 14.5V7.5C0.00195312 6.94772 0.449668 6.5 1.00195 6.5ZM17.998
9
- 2.5C19.1026 2.5 19.998 3.39543 19.998 4.5V11.5L19.9873 11.7041C19.885 12.7128 19.0337 13.5 17.998
10
- 13.5H5.99805C4.9624 13.5 4.11105 12.7128 4.00879 11.7041L3.99805 11.5V4.5C3.99805 3.39543 4.89348
11
- 2.5 5.99805 2.5H17.998ZM5.99805 11.5H17.998V4.5H5.99805V11.5Z" fill="currentColor"/>
12
- </svg>
13
- `, t["vertical-orientation"] = `
14
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
15
- <path d="M19 10V16C19 16.5523 18.5523 17 18 17H2C1.44772 17 1 16.5523 1 16V10H19Z"
16
- stroke="currentColor" stroke-width="2" fill="none"/>
17
- <path d="M2 3H18C18.5523 3 19 3.44772 19 4V10H1V4C1 3.44772 1.44772 3 2 3Z" stroke="currentColor"
18
- stroke-width="2" fill="none"/>
19
- </svg>
20
- `, t["horizontal-orientation"] = `
21
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
22
- <path d="M10 19H4C3.44772 19 3 18.5523 3 18V2C3 1.44772 3.44772 1 4 1H10V19Z" stroke="currentColor"
23
- stroke-width="2" fill="none"/>
24
- <path d="M17 2V18C17 18.5523 16.5523 19 16 19H10V1H16C16.5523 1 17 1.44772 17 2Z" stroke="currentColor"
25
- stroke-width="2" fill="none"/>
26
- </svg>
27
- `;
28
- }
29
- }
30
- export {
31
- i as ItemsIconsRegistry
32
- };
@@ -1,23 +0,0 @@
1
- const n = `/* Utils */
2
- .es-180w { width: 180px; }
3
- .es-100 { width: 100%; }
4
- .display-flex { display: flex; }
5
- .align-items-center { align-items: center; }
6
- .justify-content-between { justify-content: space-between; }
7
-
8
- /* Items Controls */
9
- .items-controls-container > .container {
10
- padding: 16px;
11
- }
12
-
13
- .items-controls-container > .container:first-child {
14
- padding-top: 0;
15
- }
16
-
17
- .container:has(.items-controls-container) {
18
- padding: 0
19
- }
20
- `;
21
- export {
22
- n as default
23
- };
@@ -1,61 +0,0 @@
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
- };
@@ -1,61 +0,0 @@
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
- };
@@ -1,106 +0,0 @@
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
- };
@@ -1,71 +0,0 @@
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
- };
@@ -1,110 +0,0 @@
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
- };
@@ -1,17 +0,0 @@
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
- };
@@ -1,28 +0,0 @@
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
- };
@@ -1,67 +0,0 @@
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
- };
@@ -1,44 +0,0 @@
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
- };