@useinsider/guido 2.1.0-beta.42f5dfa → 2.1.0-beta.486ee9c

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 (112) hide show
  1. package/README.md +36 -0
  2. package/dist/@types/config/schemas.js +70 -65
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +69 -58
  5. package/dist/components/organisms/base/Toaster.vue.js +4 -4
  6. package/dist/components/organisms/base/Toaster.vue2.js +12 -9
  7. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +5 -5
  8. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
  9. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +11 -13
  10. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +54 -23
  11. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +7 -5
  12. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +34 -21
  13. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +11 -11
  14. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +48 -36
  15. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +11 -9
  16. package/dist/components/organisms/header/HeaderWrapper.vue.js +9 -9
  17. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
  18. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
  19. package/dist/composables/useBlocksConfig.js +26 -16
  20. package/dist/composables/useHtmlValidator.js +107 -119
  21. package/dist/composables/useRecommendation.js +9 -9
  22. package/dist/composables/useStripo.js +25 -23
  23. package/dist/composables/useVersionHistoryApi.js +1 -1
  24. package/dist/config/compiler/utils/recommendationCompilerUtils.js +28 -23
  25. package/dist/config/i18n/en/index.js +11 -0
  26. package/dist/config/i18n/en/labels.json.js +7 -0
  27. package/dist/config/i18n/en/toasters.json.js +56 -0
  28. package/dist/config/i18n/en/tooltips.json.js +82 -0
  29. package/dist/config/i18n/index.js +7 -0
  30. package/dist/config/migrator/itemsBlockMigrator.js +127 -122
  31. package/dist/config/migrator/recommendationMigrator.js +1 -1
  32. package/dist/enums/defaults.js +8 -4
  33. package/dist/extensions/Blocks/Recommendation/block.js +26 -23
  34. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +37 -33
  35. package/dist/extensions/Blocks/Recommendation/constants/layout.js +16 -12
  36. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -11
  37. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +9 -9
  38. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +1 -1
  39. package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +41 -29
  40. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +16 -16
  41. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +30 -32
  42. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +217 -94
  43. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +9 -9
  44. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +97 -39
  45. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +16 -16
  46. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +304 -209
  47. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
  48. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +10 -10
  49. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -5
  50. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +14 -14
  51. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +9 -9
  52. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +3 -3
  53. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +1 -1
  54. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +9 -9
  55. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +3 -3
  56. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +13 -13
  57. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +3 -3
  58. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +223 -99
  59. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +237 -140
  60. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +27 -32
  61. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +1 -1
  62. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -30
  63. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +22 -27
  64. package/dist/extensions/Blocks/Recommendation/templates/utils.js +50 -38
  65. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +8 -8
  66. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +29 -0
  67. package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
  68. package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
  69. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
  70. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
  71. package/dist/extensions/ModulesTabIcons/extension.js +17 -0
  72. package/dist/guido.css +1 -1
  73. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +257 -187
  74. package/dist/services/recommendationApi.js +11 -9
  75. package/dist/services/stripoApi.js +20 -17
  76. package/dist/src/@types/config/schemas.d.ts +8 -0
  77. package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +1 -0
  78. package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +17 -1
  79. package/dist/src/composables/useConfig.d.ts +4 -0
  80. package/dist/src/config/i18n/en/index.d.ts +1 -0
  81. package/dist/src/config/i18n/index.d.ts +16 -0
  82. package/dist/src/enums/defaults.d.ts +4 -0
  83. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -0
  84. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +3 -3
  85. package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +12 -2
  86. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -1
  87. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +50 -11
  88. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +22 -4
  89. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +36 -16
  90. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
  91. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +50 -17
  92. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +26 -2
  93. package/dist/src/extensions/Blocks/Recommendation/templates/grid/migration.d.ts +1 -1
  94. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +1 -1
  95. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +4 -0
  96. package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +1 -1
  97. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -3
  98. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +14 -0
  99. package/dist/src/extensions/Blocks/Recommendation/validation/filterSchema.d.ts +15 -0
  100. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  101. package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
  102. package/dist/src/stores/config.d.ts +36 -0
  103. package/dist/static/styles/components/notification.css.js +19 -0
  104. package/dist/static/styles/components/tools.css.js +6 -2
  105. package/dist/static/styles/components/version-history.css.js +10 -2
  106. package/dist/static/styles/components/wide-panel.css.js +18 -2
  107. package/dist/static/styles/customEditorStyle.css.js +59 -31
  108. package/dist/static/styles/variables.css.js +2 -0
  109. package/dist/static/templates/empty/index.html.js +74 -0
  110. package/dist/static/templates/empty/style.css.js +779 -0
  111. package/dist/stores/unsubscribe.js +37 -34
  112. package/package.json +2 -2
@@ -0,0 +1,82 @@
1
+ const e = {
2
+ "Add template/pre-built modules, or structures with containers": "Structures and Modules lets you add templates, pre-built modules or structures with containers.",
3
+ "Allows uploading and editing images": "Image lets you add and edit images.",
4
+ "Allows working on text styles, adding merge tags and lists": "Text lets you edit text styles, add merge tags and lists.",
5
+ "Allows designing buttons of any shape, size, and color": "Button lets you edit the shape, size, and color of the buttons.",
6
+ "Meant to visually separate elements with a horizontal line": "Spacer lets you separate elements with a horizontal line.",
7
+ "Offers 70+ social media icons and chats of different design styles": "Social Networks lets you add social media icons and chat options in different design styles.",
8
+ "Helps taking users from emails to necessary pages on your site": "Menu lets you direct users from emails to the respective website.",
9
+ "Allows adding elements with custom code in emails": "HTML lets you add elements with custom code in emails.",
10
+ "Allows applying filters to images and placing text over them": "Banner lets you apply filters to images and add text over them.",
11
+ "Allows setting thumbnail images & play buttons for videos": "Video lets you set thumbnail images, add video links and play buttons for videos.",
12
+ "Adds a countdown to a specific date. Use the timer in emails for promotions, launches, and events": "Timer lets you add a countdown in your emails for promotions, launches or events.",
13
+ 'The "AMP Carousel" block is currently being developed. Switch to the Old version of the Editor to access the full functionality needed to continue working on this email. Please note, that all changes you have already made to this email will be saved and available in the Old version': "Carousel lets you add templates, prebuilt modules or container-based structures via AMP HTML and HTML.",
14
+ 'The "AMP Accordion" block is currently being development. Switch to the Old version of the Editor to access the full functionality needed to continue working on this email. Please note, that all changes you have already made to this email will be saved and available in the Old version': "AMP Accordion lets you add a collapsible accordion with customizable sections via AMP HTML.",
15
+ "An AMP Form block lets users collect feedback or run surveys directly in an email. It includes input fields and can be added in the Editor, allowing recipients to respond right from their inbox": "AMP Form Block lets you add input fields to collect feedback or run surveys via AMP HTML.",
16
+ "Will be applied to the entire email": "General Background Color lets you set the background color applied to the entire email.",
17
+ "Background image for the entire email. Some email clients (Windows 10 Mail, Android 4.4, the Gmail app for iOS, and Android for non-Gmail accounts) do not support background images. Thus, we recommend choosing a background color for the entire email similar to the selected image as a fallback.": "Background Image lets you upload an image for the entire email.",
18
+ "Repetition of the email background image. In Outlook for Windows, the image will be repeated in any case, regardless of whether this option is enabled or not. To bypass the Outlook limitation, you need to create an image in a third-party editor of the needed color and size so that it fits the entire background size, apply the required graphics to it, upload it, and center-align it in the email. The dimensions of such a background image should be at least 1,920 pixels in width, and the height should be equal to the height of the email.": "Background Image Repeat lets you enable the repetition of the background image.",
19
+ 'The standard width of the email varies between 540-700 pixels. <a href="https://stripo.email/blog/email-template-size-width-height/" target="_blank" aria-label="Read more about the message width in our blog.">Read more here</a>': "Message Content Width lets you set the standard width of the email between 540 and 700 pixels.",
20
+ "Alignment of the email content area ": "Message Alignment lets you set the alignment of the email content area.",
21
+ "Your email will automatically adjust for smaller screens by displaying content in a single column. Side-by-side blocks will be stacked vertically": "Responsive Design lets your email adjust to smaller screens.",
22
+ "Your email will display the desktop version on mobile devices. Mobile-specific settings will be turned off in the Editor": "Note that Responsive Design can only be visible on the desktop version of mobile devices, and mobile settings will also be turned off when Responsive Design is disabled.",
23
+ "Enable the right-to-left (RTL) text direction to build emails easily without coding for recipients using RTL scripts, such as Arabic, Hebrew, Persian, Urdu, etc.": "Right to Left Text Direction lets you build emails in right-to-left (RTL) languages like Arabic, Hebrew, or Persian without coding.",
24
+ "Margins around the email message area": "Message on Desktop lets you set the margins around the message area.",
25
+ "The background image of the stripe. The image will not be displayed in an Outlook app on Windows email clients. We recommend choosing a stripe background color similar to the selected image as a fallback": "Background Image lets you drag and drop or add an image URL as a background image.",
26
+ 'We automatically calculate the optimal indentation for your text. It depends on font size and line spacing <a href="https://en.wikipedia.org/wiki/Leading" target="_blank">leading<a/>': "Bottom Space lets you add space automatically depending on font size and line spacing.",
27
+ 'Padding in the "Text" block makes space around the added text.': "Padding on Desktop lets you add space around the text in the Text block for desktop.",
28
+ "If an email client doesn't support the non-standard font, a similar standard font will be used instead.": "Note that a similar Safe font will be used instead of the selected font if users' devices don't support it.",
29
+ "This option ensures the most accurate display of your buttons in MS Outlook email clients by inserting a special VML-code. When this option is activated, the email message size can be increased up to kilobyte for each added button.": "Support for Outlook lets you display buttons accurately in Outlook by adding VML code, which may increase your email size.",
30
+ "Outlook for Windows does not have support for a separate button border width setting": "Style is not supported in Outlook for Windows as it doesn't allow separate button border width settings.",
31
+ "Outlook for Windows does not have a support for the border radius property. We recommend enabling the Outlook support option.": "Border is not supported in Outlook for Windows as it doesn't allow the border radius property. We recommend enabling Outlook Support.",
32
+ 'The option "hover button styles" (changing colors upon a mouseover) is supported by a limited number of email clients. <a href="{link}" target="_blank">Learn more</a>': "Hover Button Styles can be supported by a limited number of users. For more information, you can visit Academy.",
33
+ "Button padding that makes the space around the button text": "Padding on Desktop lets you set the space around the button text for desktop.",
34
+ "The icon inside the button will not show in Outlook 2002, 2007, 2010, 2013, 2016, 2019 on Windows.": "The Icon won't be visible in Outlook 2002–2019 on Windows.",
35
+ "Margins around the button": "Margins on Desktop lets you set the space around the button.",
36
+ "It only works with CSS styles, so it is not supported by Outlook on Windows. We recommend enabling the Support for Outlook option.": "Border Radius lets you round the corners of the button. Note that it only works with CSS styles, so it's not supported by Outlook on Windows. We recommend enable the Support for Outlook.",
37
+ "Not supported by Outlook on Windows, so we recommend enabling the Support for Outlook option in the General Settings tab.": "Border lets you add an outline around the element. Note that it's not supported by Outlook on Windows. We recommend you enable the Support for Outlook in the General Settings.",
38
+ "Add content to the email, click it, and choose “Save as a module”. Stripes, Structures, and Containers can be saved as a module.": "Make sure you save modules once content is added. Note that Stripes, Structures, and Containers can be saved as a module.",
39
+ "This feature is only supported by Yahoo! Mail, Ukr.net, AOL, Gmail, iCloud Mail, Outlook 2003, Outlook for Mac and macOS Apple Mail": "Rollover Effect is supported by Yahoo Mail, Ukr.net, AOL, Gmail, iCloud Mail, Outlook 2003, Outlook for Mac and Apple Mail.",
40
+ "The aspect ratio of the added image does not match the others. Please replace it to match the {ratio} format": "Note that the aspect ratio of the secondary image doesn't match the aspect ratio of the primary one. Make sure you edit the ratio of the secondary image to ensure the Rollover Effect works properly.",
41
+ "Margins around the image": "Margins on Desktop lets you set the space around the image for desktop view.",
42
+ "The image will automatically adjust to the width of the screen on mobile devices that support it": "Responsive Image lets you adjust the screen width automatically on supported mobile devices.",
43
+ "Images won't be adjusted to the width of the screen on mobile devices, which may lead to poor display of images and content": "Make sure you enable Responsive Image to adjust the width of the screen on mobile devices to display images and content properly.",
44
+ "Make the image to fit to the width of a mobile screen. Please note: It only works on devices that have support for media queries.": "Responsive Image lets you make the image fit the width of a mobile screen. Note that it only works on supported devices.",
45
+ "You have the option of displaying a different image when your countdown timer expires.": "Display a different image when the countdown timer expires.",
46
+ "Margins around the timer": "Margin on Desktop lets you adjust the spacing around the timer on desktop screens.",
47
+ 'Not all email clients support the selected link protocol. Check the <a href="https://support.stripo.email/en/articles/5332466-what-are-link-protocols-compatible-with-emails" target="_blank">compatibility guide</a> to learn more about supported clients.': "Note that not all user devices can support the selected link protocol. For more information about supported clients, you can visit Academy.",
48
+ "This forces the accordion to only allow one expanded section at any given time. Expanding one section will cause any other open sections to close.": "Ensure only one accordion section stays open by automatically collapsing the others when a new one is expanded.",
49
+ "Outlook for Windows does not have support for dashed and dotted borders": "Style lets you customize the border style of the element. Note that dashed and dotted borders aren't supported by Outlook on Windows.",
50
+ "Internal padding creates space around containers and blocks": "Padding on Desktop lets you create space around containers and blocks.",
51
+ "Margins around the separator line": "Margins on Desktop let you set the space around the separator line.",
52
+ "Use your own title and alternative text to each icon": "Title and Alternate Text Customization lets you add your own title and alternative text to each icon.",
53
+ "Margins around social network icons": "Margins on Desktop lets you set the space around social network icons.",
54
+ "Makes the menu fit to the container width": "Fit to Container lets you make the menu fit the container width.",
55
+ "Margins around elements formed by custom code": "Margins on Desktop lets you set margins around elements formed by custom code.",
56
+ "Margins around the banner": "Margins on Desktop lets you set margins around the banner.",
57
+ 'Creates an anchor for this element. Anchor links in emails are designed to make navigation easier. They help take readers to specific places in the email without the need to scroll. <a href="https://support.stripo.email/en/articles/3174098-how-to-apply-anchor-hyperlinks" target="_blank">Learn more</a> about how it works and how to create one with Stripo.': "Anchor Link lets you create a link that takes users to a specific part of the email without scrolling.",
58
+ 'Include the element in the necessary version of the email, or in both. <a target="_blank" href="https://stripo.email/blog/how-to-build-amp-emails-with-stripo/">Learn more about ⚡ HTML (AMP HTML).</a>': "Include In lets you include the element in the selected version of the email or in both versions.",
59
+ "The element will be included in both MIME versions of the email: classic HTML and AMP HTML": "The element will be included in both MIME versions of the email: classic HTML and AMP HTML",
60
+ "The element will be included only in the HTML MIME version of the email message. The item will be hidden in the AMP HTML version": "The element will be included only in the HTML MIME version of the email message. The item will be hidden in the AMP HTML version",
61
+ "The element will be included only in the AMP HTML MIME version of the email message. The item will be hidden in the HTML version": "The element will be included only in the AMP HTML MIME version of the email message. The item will be hidden in the HTML version",
62
+ "This element will not be hidden in email clients which do not support media queries.": "Hide Element on Mobile lets you hide the selected content from appearing on mobile.",
63
+ "The element will be hidden on Yahoo mobile App, as well as in mobile email client which do not support media queries.": "Hide on Desktop lets you hide the element on desktop devices that support media queries.",
64
+ "The element already hidden on Desktop. Activating this option you turning off hidden state for Desktop.": "Note that this element is already hidden on Desktop, it will be visible on desktop when you enable this.",
65
+ "The element already hidden on Mobile. Activating this option you turning off hidden state for Mobile.": "Note that this element is already hidden on mobile, it will be visible on mobile when you enable this.",
66
+ "An anchor link should not exceed more than 150 characters": "Enter an Anchor Link up to 150 characters.",
67
+ "An alternate text should not exceed more than 255 characters": "Enter an Alternate Text up to 255 characters.",
68
+ "A HEX color value should not exceed more than 8 symbols": "Enter a Hex Color value up to 8 characters to continue.",
69
+ "A keyword must have at least 2 characters": "Enter a keyword of 2 or more characters to continue.",
70
+ "Button label should not exceed more than 255 characters": "Enter a button label up to 255 characters to continue.",
71
+ "Link Name should not exceed more than 500 characters": "Enter a Link Name up to 500 characters to continue.",
72
+ "Menu Item Name should not exceed more than 255 characters": "Enter a Menu Item Name up to 255 characters to continue.",
73
+ "It is not possible to upload more than 50 files simultaneously. If possible, please try to complete this over a few iterations.": "Up to 50 files can be added at once.",
74
+ "Please enter a valid link": "Enter a valid link to continue.",
75
+ "The image with the invalid link cannot be saved to the image gallery": "Enter a valid image link to continue.",
76
+ "The data source link is unavailable. Please, make sure there is an access to the data source.": "Enter an accessible Data Source Link to contiue.",
77
+ "The file should not exceed the maximum resolution of {maxImageResolution}px.": "Upload files up to 1024x512 pixels to continue.",
78
+ "The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor."
79
+ };
80
+ export {
81
+ e as default
82
+ };
@@ -0,0 +1,7 @@
1
+ import { en as o } from "./en/index.js";
2
+ const c = {
3
+ en: o
4
+ };
5
+ export {
6
+ c as localePatch
7
+ };
@@ -1,8 +1,8 @@
1
- var B = Object.defineProperty;
2
- var U = (r, t, e) => t in r ? B(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var M = (r, t, e) => U(r, typeof t != "symbol" ? t + "" : t, e);
4
- import { productPairs as v } from "../../extensions/Blocks/Items/enums/productEnums.js";
5
- import { ItemInCartOptions as E, DefaultConfigValues as g, SETTINGS_ENUMS as d } from "../../extensions/Blocks/Items/enums/settingsEnums.js";
1
+ var v = Object.defineProperty;
2
+ var B = (e, t, r) => t in e ? v(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var M = (e, t, r) => B(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { productPairs as U } from "../../extensions/Blocks/Items/enums/productEnums.js";
5
+ import { ItemInCartOptions as T, DefaultConfigValues as g, SETTINGS_ENUMS as u } from "../../extensions/Blocks/Items/enums/settingsEnums.js";
6
6
  import { getDefaultTemplate as K } from "../../extensions/Blocks/Items/template.js";
7
7
  const w = {
8
8
  img: {
@@ -74,76 +74,77 @@ const w = {
74
74
  function F() {
75
75
  return String(Date.now() + Math.floor(Math.random() * 1e3));
76
76
  }
77
- function q(r) {
78
- return r ? {
79
- CartItems: d.ITEMS_TYPE.CART_ITEMS,
80
- BrowsedItems: d.ITEMS_TYPE.BROWSED_ITEMS,
81
- PurchasedItems: d.ITEMS_TYPE.PURCHASED_ITEMS,
82
- CART_ITEMS: d.ITEMS_TYPE.CART_ITEMS,
83
- BROWSED_ITEMS: d.ITEMS_TYPE.BROWSED_ITEMS,
84
- PURCHASED_ITEMS: d.ITEMS_TYPE.PURCHASED_ITEMS
85
- }[r] || d.ITEMS_TYPE.CART_ITEMS : d.ITEMS_TYPE.CART_ITEMS;
77
+ function q(e) {
78
+ return e ? {
79
+ CartItems: u.ITEMS_TYPE.CART_ITEMS,
80
+ BrowsedItems: u.ITEMS_TYPE.BROWSED_ITEMS,
81
+ PurchasedItems: u.ITEMS_TYPE.PURCHASED_ITEMS,
82
+ CART_ITEMS: u.ITEMS_TYPE.CART_ITEMS,
83
+ BROWSED_ITEMS: u.ITEMS_TYPE.BROWSED_ITEMS,
84
+ PURCHASED_ITEMS: u.ITEMS_TYPE.PURCHASED_ITEMS
85
+ }[e] || u.ITEMS_TYPE.CART_ITEMS : u.ITEMS_TYPE.CART_ITEMS;
86
86
  }
87
- function R(r) {
88
- const t = (a, o) => a == null ? o : a === "1" || a === "true", e = (a, o) => a || o, i = r["data-type"] || r["data-source"], l = q(i);
89
- let n = r["data-cart_items_select_control_value"] || g.cartItemsSelectControlValue;
90
- if (n && !n.includes("{{") && /^\d+$/.test(n)) {
91
- const a = parseInt(n) - 1, o = E[l];
92
- o && o[a] && (n = o[a].value);
87
+ function R(e) {
88
+ var a;
89
+ const t = (_, c) => _ == null ? c : _ === "1" || _ === "true", r = (_, c) => _ || c, l = e["data-type"] || e["data-source"], i = q(l), n = T[i];
90
+ let o = e["data-cart_items_select_control_value"] || ((a = n == null ? void 0 : n[0]) == null ? void 0 : a.value) || g.cartItemsSelectControlValue;
91
+ if (o && !o.includes("{{") && /^\d+$/.test(o)) {
92
+ const _ = parseInt(o) - 1, c = T[i];
93
+ c && c[_] && (o = c[_].value);
93
94
  }
94
95
  return {
95
96
  initialized: !0,
96
- blockInstanceId: e(r["data-block-instance-id"], F()),
97
- source: l,
98
- type: l,
99
- itemsSelectValue: n,
100
- orientation: r["data-card_orientation_control_value"] || d.ORIENTATION.VERTICAL,
101
- nameTrimming: t(r["data-product_name_control_trim"], !0),
102
- priceHideDiscount: t(r["data-product_price_control_nodup"], !0),
103
- priceFormatted: t(r["data-product_price_control_formated"], !0),
104
- priceSinglePrice: t(r["data-product_price_control_single_price"], !1),
105
- priceCurrencySymbol: e(
106
- r["data-product_price_control_currency_symbol"],
97
+ blockInstanceId: r(e["data-block-instance-id"], F()),
98
+ source: i,
99
+ type: i,
100
+ itemsSelectValue: o,
101
+ orientation: e["data-card_orientation_control_value"] || u.ORIENTATION.VERTICAL,
102
+ nameTrimming: t(e["data-product_name_control_trim"], !0),
103
+ priceHideDiscount: t(e["data-product_price_control_nodup"], !0),
104
+ priceFormatted: t(e["data-product_price_control_formated"], !0),
105
+ priceSinglePrice: t(e["data-product_price_control_single_price"], !1),
106
+ priceCurrencySymbol: r(
107
+ e["data-product_price_control_currency_symbol"],
107
108
  g.productPriceCurrencySymbolControlValue
108
109
  ),
109
- priceCurrencyLocation: e(
110
- r["data-product_price_currency_location"],
110
+ priceCurrencyLocation: r(
111
+ e["data-product_price_currency_location"],
111
112
  g.productPriceCurrencyLocationControlValue
112
113
  ),
113
- priceOrientation: r["data-product_original_price_control_orientation"] || "horizontal",
114
- quantityControlEnabled: t(r["data-product_quantity_control_enabled"], !0),
115
- buttonLink: e(r["data-product_button_link"], g.productButtonLinkControlValue),
116
- imageLink: e(r["data-product_image_link"], g.productImageLinkControlValue),
117
- buttonLabel: e(r["data-product_button_control_label"], "Buy"),
118
- buttonFullWidth: t(r["data-product_button_control_atw"], !0),
119
- imageVisible: t(r["data-product_image_control_enabled"], !0),
120
- nameVisible: t(r["data-product_name_control_enabled"], !0),
121
- quantityVisible: t(r["data-product_quantity_control_enabled"], !0),
122
- priceVisible: t(r["data-product_price_control_enabled"], !0),
123
- originalPriceVisible: t(r["data-product_original_price_control_enabled"], !0),
124
- buttonVisible: t(r["data-product_button_control_enabled"], !0)
114
+ priceOrientation: e["data-product_original_price_control_orientation"] || "horizontal",
115
+ quantityControlEnabled: t(e["data-product_quantity_control_enabled"], !0),
116
+ buttonLink: r(e["data-product_button_link"], g.productButtonLinkControlValue),
117
+ imageLink: r(e["data-product_image_link"], g.productImageLinkControlValue),
118
+ buttonLabel: r(e["data-product_button_control_label"], "Buy"),
119
+ buttonFullWidth: t(e["data-product_button_control_atw"], !0),
120
+ imageVisible: t(e["data-product_image_control_enabled"], !0),
121
+ nameVisible: t(e["data-product_name_control_enabled"], !0),
122
+ quantityVisible: t(e["data-product_quantity_control_enabled"], !0),
123
+ priceVisible: t(e["data-product_price_control_enabled"], !0),
124
+ originalPriceVisible: t(e["data-product_original_price_control_enabled"], !0),
125
+ buttonVisible: t(e["data-product_button_control_enabled"], !0)
125
126
  };
126
127
  }
127
- const $ = {
128
+ const O = {
128
129
  ins_apr: "CART_ITEMS",
129
130
  browsed_item: "BROWSED_ITEMS",
130
131
  purchased_item: "PURCHASED_ITEMS"
131
132
  };
132
- function x(r, t) {
133
- const e = {
133
+ function $(e, t) {
134
+ const r = {
134
135
  CART_ITEMS: `{{Abandoned Cart Item (${t}) Image}}`,
135
136
  BROWSED_ITEMS: `{{Browsed Item (${t}) Image}}`,
136
137
  PURCHASED_ITEMS: `{{Purchased Item (${t}) Image}}`
137
138
  };
138
- return e[r] || e.CART_ITEMS;
139
+ return r[e] || r.CART_ITEMS;
139
140
  }
140
- function O(r, t) {
141
- const e = {
141
+ function x(e, t) {
142
+ const r = {
142
143
  CART_ITEMS: `{{Abandoned Cart Item (${t}) Url}}`,
143
144
  BROWSED_ITEMS: `{{Browsed Item (${t}) Url}}`,
144
145
  PURCHASED_ITEMS: `{{Purchased Item (${t}) Url}}`
145
146
  };
146
- return e[r] || e.CART_ITEMS;
147
+ return r[e] || r.CART_ITEMS;
147
148
  }
148
149
  class V {
149
150
  constructor() {
@@ -152,40 +153,40 @@ class V {
152
153
  }
153
154
  migrate(t) {
154
155
  try {
155
- let e = this.removeJinjaConditionals(t);
156
- e = this.replaceTemplateVariables(e);
157
- const i = this.parser.parseFromString(e, "text/html"), l = i.querySelectorAll(
156
+ let r = this.removeJinjaConditionals(t);
157
+ r = this.replaceTemplateVariables(r);
158
+ const l = this.parser.parseFromString(r, "text/html"), i = l.querySelectorAll(
158
159
  "td.esd-cart-items-block, td.esd-browsed-items-block, td.esd-purchased-items-block"
159
160
  );
160
- return l.length === 0 ? (console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), e) : (l.forEach((n) => {
161
- const a = this.extractConfiguration(n), o = K({
162
- orientation: a.orientation,
163
- itemsType: a.itemsType,
164
- itemId: a.itemId,
165
- currencySymbol: a.currencySymbol,
166
- currencyLocation: a.currencyLocation,
167
- formattedPrice: a.formattedPrice,
168
- configBlockAttributes: a.configBlockAttributes,
161
+ return i.length === 0 ? (console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), r) : (i.forEach((n) => {
162
+ const o = this.extractConfiguration(n), a = K({
163
+ orientation: o.orientation,
164
+ itemsType: o.itemsType,
165
+ itemId: o.itemId,
166
+ currencySymbol: o.currencySymbol,
167
+ currencyLocation: o.currencyLocation,
168
+ formattedPrice: o.formattedPrice,
169
+ configBlockAttributes: o.configBlockAttributes,
169
170
  migrate: !0,
170
- nameStyles: a.nameStyles,
171
- buttonStyles: a.buttonStyles,
172
- priceStyles: a.priceStyles,
173
- originalPriceStyles: a.originalPriceStyles,
174
- quantityStyles: a.quantityStyles,
175
- nodeConfig: R(a.configBlockAttributes)
171
+ nameStyles: o.nameStyles,
172
+ buttonStyles: o.buttonStyles,
173
+ priceStyles: o.priceStyles,
174
+ originalPriceStyles: o.originalPriceStyles,
175
+ quantityStyles: o.quantityStyles,
176
+ nodeConfig: R(o.configBlockAttributes)
176
177
  }), c = this.parser.parseFromString(
177
- `<table><tbody><tr>${o}</tr></tbody></table>`,
178
+ `<table><tbody><tr>${a}</tr></tbody></table>`,
178
179
  "text/html"
179
180
  ).querySelector("td");
180
181
  if (c && n.parentNode) {
181
- const f = R(a.configBlockAttributes);
182
+ const f = R(o.configBlockAttributes);
182
183
  c.setAttribute("esd-ext-config", JSON.stringify(f));
183
- const u = c.querySelector("esd-config-block");
184
- u && u.remove(), n.parentNode.replaceChild(c, n);
184
+ const d = c.querySelector("esd-config-block");
185
+ d && d.remove(), n.parentNode.replaceChild(c, n);
185
186
  }
186
- }), i.documentElement.outerHTML);
187
- } catch (e) {
188
- return console.error("ItemsBlockMigrator failed:", e), t;
187
+ }), l.documentElement.outerHTML);
188
+ } catch (r) {
189
+ return console.error("ItemsBlockMigrator failed:", r), t;
189
190
  }
190
191
  }
191
192
  /**
@@ -196,22 +197,22 @@ class V {
196
197
  */
197
198
  extractConfiguration(t) {
198
199
  var C, D, P;
199
- const e = ((C = t.querySelector("[data-type]")) == null ? void 0 : C.getAttribute("data-type")) || "CART_ITEMS", i = ((D = t.querySelector("[data-number]")) == null ? void 0 : D.getAttribute("data-number")) || "1", l = parseInt(i) - 1, n = E[e], a = ((P = n == null ? void 0 : n[l]) == null ? void 0 : P.value) || n[0].value, o = t.querySelector('[product-attr="price"]'), _ = (o == null ? void 0 : o.getAttribute("data-currency_symbol")) || "USD", f = ((o == null ? void 0 : o.getAttribute("data-curency")) || "before") === "after" ? "1" : "0", u = (o == null ? void 0 : o.getAttribute("data-formated")) !== "false", s = this.extractConfigBlockAttributes(t, e, i), b = s["data-card_orientation_control_value"];
200
- let S;
201
- b ? S = b === "horizontal" ? "horizontal" : "vertical" : S = t.querySelector('[colspan="2"]') !== null ? "vertical" : "horizontal";
202
- const p = t.querySelector('a[product-attr="name"]'), T = (p == null ? void 0 : p.getAttribute("style")) || void 0, y = t.querySelector('a[product-attr="button"]'), m = (y == null ? void 0 : y.getAttribute("style")) || void 0, k = (o == null ? void 0 : o.getAttribute("style")) || void 0, I = t.querySelector("p.original-price"), h = (I == null ? void 0 : I.getAttribute("style")) || void 0, A = t.querySelector('[product-attr="quantity"]'), L = (A == null ? void 0 : A.getAttribute("style")) || void 0;
200
+ const r = ((C = t.querySelector("[data-type]")) == null ? void 0 : C.getAttribute("data-type")) || "CART_ITEMS", l = ((D = t.querySelector("[data-number]")) == null ? void 0 : D.getAttribute("data-number")) || "1", i = parseInt(l) - 1, n = T[r], o = ((P = n == null ? void 0 : n[i]) == null ? void 0 : P.value) || n[0].value, a = t.querySelector('[product-attr="price"]'), _ = (a == null ? void 0 : a.getAttribute("data-currency_symbol")) || "USD", f = ((a == null ? void 0 : a.getAttribute("data-curency")) || "before") === "after" ? "1" : "0", d = (a == null ? void 0 : a.getAttribute("data-formated")) !== "false", s = this.extractConfigBlockAttributes(t, r, l), S = s["data-card_orientation_control_value"];
201
+ let b;
202
+ S ? b = S === "horizontal" ? "horizontal" : "vertical" : b = t.querySelector('[colspan="2"]') !== null ? "vertical" : "horizontal";
203
+ const p = t.querySelector('a[product-attr="name"]'), I = (p == null ? void 0 : p.getAttribute("style")) || void 0, y = t.querySelector('a[product-attr="button"]'), m = (y == null ? void 0 : y.getAttribute("style")) || void 0, h = (a == null ? void 0 : a.getAttribute("style")) || void 0, A = t.querySelector("p.original-price"), k = (A == null ? void 0 : A.getAttribute("style")) || void 0, E = t.querySelector('[product-attr="quantity"]'), L = (E == null ? void 0 : E.getAttribute("style")) || void 0;
203
204
  return {
204
- orientation: S,
205
- itemsType: e,
206
- itemId: a,
205
+ orientation: b,
206
+ itemsType: r,
207
+ itemId: o,
207
208
  currencySymbol: _,
208
209
  currencyLocation: f,
209
- formattedPrice: u,
210
+ formattedPrice: d,
210
211
  configBlockAttributes: s,
211
- nameStyles: T,
212
+ nameStyles: I,
212
213
  buttonStyles: m,
213
- priceStyles: k,
214
- originalPriceStyles: h,
214
+ priceStyles: h,
215
+ originalPriceStyles: k,
215
216
  quantityStyles: L
216
217
  };
217
218
  }
@@ -222,27 +223,27 @@ class V {
222
223
  * @param itemsType - The type of items (CART_ITEMS, BROWSED_ITEMS, PURCHASED_ITEMS)
223
224
  * @param itemNumber - The item number (1-based index)
224
225
  */
225
- extractConfigBlockAttributes(t, e, i) {
226
- const l = t.querySelector("esd-config-block"), n = {};
227
- if (!l)
226
+ extractConfigBlockAttributes(t, r, l) {
227
+ const i = t.querySelector("esd-config-block"), n = {};
228
+ if (!i)
228
229
  return this.getDefaultConfigBlockAttributes();
229
- if (Array.from(l.attributes).forEach((o) => {
230
- o.name.startsWith("data-") && (n[o.name] = o.value);
230
+ if (Array.from(i.attributes).forEach((a) => {
231
+ a.name.startsWith("data-") && (n[a.name] = a.value);
231
232
  }), n["data-cart_items_select_control_value"]) {
232
- const o = n["data-cart_items_select_control_value"];
233
- if (/^\d+$/.test(o)) {
234
- const _ = parseInt(o) - 1, c = E[e];
233
+ const a = n["data-cart_items_select_control_value"];
234
+ if (/^\d+$/.test(a)) {
235
+ const _ = parseInt(a) - 1, c = T[r];
235
236
  c && c[_] && (n["data-cart_items_select_control_value"] = c[_].value);
236
237
  }
237
238
  }
238
239
  if (n["data-product_price_control_curency"]) {
239
- const o = n["data-product_price_control_curency"];
240
- let _ = o;
241
- o === "before" ? _ = "0" : o === "after" && (_ = "1"), n["data-product_price_control_curency"] = _, n["data-product_price_currency_location"] = _;
240
+ const a = n["data-product_price_control_curency"];
241
+ let _ = a;
242
+ a === "before" ? _ = "0" : a === "after" && (_ = "1"), n["data-product_price_control_curency"] = _, n["data-product_price_currency_location"] = _;
242
243
  }
243
244
  (!n["data-product_price_control_currency_symbol"] || n["data-product_price_control_currency_symbol"].trim() === "") && (n["data-product_price_control_currency_symbol"] = "USD");
244
- const a = { ...this.getDefaultConfigBlockAttributes(), ...n };
245
- return a["data-type"] = e, a["data-source"] = e, a["data-product_image_link"] = x(e, i), a["data-product_button_link"] = O(e, i), a;
245
+ const o = { ...this.getDefaultConfigBlockAttributes(), ...n };
246
+ return o["data-type"] = r, o["data-source"] = r, o["data-product_image_link"] = $(r, l), o["data-product_button_link"] = x(r, l), o;
246
247
  }
247
248
  /**
248
249
  * Returns default esd-config-block attributes based on the old template structure
@@ -297,18 +298,22 @@ class V {
297
298
  * - Cart Items: ins_apr_total_product_kind, ins_apr_price_N, ins_apr_originalprice_N
298
299
  * - Browsed Items: browsed_item_total_product_kind, browsed_item_price_N, browsed_item_originalprice_N
299
300
  * - Purchased Items: purchased_item_total_product_kind, purchased_item_price_N, purchased_item_originalprice_N
301
+ *
302
+ * IMPORTANT: Preserves the esd-custom-display-conditions attribute on <body> which
303
+ * contains display condition Jinja scripts that should NOT be removed.
300
304
  */
301
305
  removeJinjaConditionals(t) {
302
- let e = t.replace(
306
+ const r = "__ESD_DISPLAY_CONDITIONS_PLACEHOLDER__", l = t.match(/esd-custom-display-conditions="[^"]*"/);
307
+ let i = l ? t.replace(l[0], r) : t;
308
+ return i = i.replace(
303
309
  /\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_total_product_kind\s*(&gt;|>)\s*\d+\s*%\}/g,
304
310
  ""
305
- );
306
- return e = e.replace(
311
+ ), i = i.replace(
307
312
  /\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_price_\d+\s*(!&#61;|!=)\s*\1_originalprice_\d+\s*%\}/g,
308
313
  ""
309
- ), e = e.replace(/\{%\s*endif\s*%\}/g, ""), e = e.replace(/\n\s*\n\s*\n/g, `
314
+ ), i = i.replace(/\{%\s*endif\s*%\}/g, ""), l && (i = i.replace(r, l[0])), i = i.replace(/\n\s*\n\s*\n/g, `
310
315
 
311
- `), e;
316
+ `), i;
312
317
  }
313
318
  /**
314
319
  * Replaces template variables with default values from productPairs
@@ -320,31 +325,31 @@ class V {
320
325
  * - {{purchased_item_formattedprice_5}} → '1,490.49' (PURCHASED_ITEMS)
321
326
  */
322
327
  replaceTemplateVariables(t) {
323
- const { PAIRS_FOR_EXTENSION: e } = v;
324
- return t.replace(/{{([^}]+)}}/g, (i, l) => {
325
- const n = l.match(/^(ins_apr|browsed_item|purchased_item)_([a-z_]+)_(\d+)$/);
328
+ const { PAIRS_FOR_EXTENSION: r } = U;
329
+ return t.replace(/{{([^}]+)}}/g, (l, i) => {
330
+ const n = i.match(/^(ins_apr|browsed_item|purchased_item)_([a-z_]+)_(\d+)$/);
326
331
  if (!n)
327
- return i;
328
- const [, a, o, _] = n, c = $[a];
332
+ return l;
333
+ const [, o, a, _] = n, c = O[o];
329
334
  if (!c)
330
- return console.warn(`Unknown variable prefix: ${a}`), i;
331
- const f = w[o];
335
+ return console.warn(`Unknown variable prefix: ${o}`), l;
336
+ const f = w[a];
332
337
  if (!f)
333
- return console.warn(`Unknown variable suffix mapping for: ${o}`), i;
334
- const { pairsKey: u, defaultKey: s, isArray: b } = f, p = e[u][c];
338
+ return console.warn(`Unknown variable suffix mapping for: ${a}`), l;
339
+ const { pairsKey: d, defaultKey: s, isArray: S } = f, p = r[d][c];
335
340
  if (!p)
336
- return console.warn(`No data found for: ${u}.${c}`), i;
337
- if (b) {
341
+ return console.warn(`No data found for: ${d}.${c}`), l;
342
+ if (S) {
338
343
  const y = parseInt(_) - 1, m = p[s];
339
- return Array.isArray(m) && m[y] ? m[y] : (console.warn(`Array value not found: ${u}.${c}.${s}[${y}]`), i);
344
+ return Array.isArray(m) && m[y] ? m[y] : (console.warn(`Array value not found: ${d}.${c}.${s}[${y}]`), l);
340
345
  }
341
- const T = p[s];
342
- return T !== void 0 ? String(T) : (console.warn(`Default value not found: ${u}.${c}.${s}`), i);
346
+ const I = p[s];
347
+ return I !== void 0 ? String(I) : (console.warn(`Default value not found: ${d}.${c}.${s}`), l);
343
348
  });
344
349
  }
345
350
  }
346
- function G(r) {
347
- return new V().migrate(r);
351
+ function G(e) {
352
+ return new V().migrate(e);
348
353
  }
349
354
  export {
350
355
  G as migrateItemsBlock
@@ -17,7 +17,7 @@ class w {
17
17
  const l = o.getAttribute("id"), r = this.extractBgColor(o), i = this.extractTitle(o), u = this.extractProductRows(o), c = P.replace("{-{-TITLE-}-}", i).replace("{-{-PRODUCT_ROWS-}-}", u), a = this.parser.parseFromString(
18
18
  `<table id="tempDoc"><tbody><tr>${c}</tr></tbody></table>`,
19
19
  "text/html"
20
- ).querySelector(".ins-recommendation-v3-block-v2");
20
+ ).querySelector(".recommendation-block-v2");
21
21
  a && o.parentNode && (l && a.setAttribute("id", l), r && a.setAttribute("bgcolor", r), o.parentNode.replaceChild(a, o));
22
22
  }), t.documentElement.outerHTML);
23
23
  } catch (t) {
@@ -1,8 +1,12 @@
1
- const t = {
1
+ const e = {
2
2
  transactional: 2
3
- }, o = 2, T = 13;
3
+ }, o = 2, t = 13, s = {
4
+ SAVED_MODULES: "savedModules",
5
+ DEFAULT_MODULES: "defaultModules"
6
+ };
4
7
  export {
5
8
  o as EditorType,
6
- T as MAX_DEFAULT_TEMPLATE_ID,
7
- t as TemplateTypes
9
+ t as MAX_DEFAULT_TEMPLATE_ID,
10
+ s as ModuleFolderDefaults,
11
+ e as TemplateTypes
8
12
  };
@@ -1,12 +1,13 @@
1
- var u = Object.defineProperty;
2
- var p = (r, i, t) => i in r ? u(r, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[i] = t;
3
- var g = (r, i, t) => p(r, typeof i != "symbol" ? i + "" : i, t);
4
- import { Block as f, BlockCompositionType as I, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ var p = Object.defineProperty;
2
+ var f = (r, o, t) => o in r ? p(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t;
3
+ var g = (r, o, t) => f(r, typeof o != "symbol" ? o + "" : o, t);
4
+ import { Block as h, BlockCompositionType as I, ModificationDescription as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { ensureMobileCssRulesExist as d } from "./controls/mobileLayout/cssRules.js";
5
6
  import { RecommendationConfigService as s } from "./services/configService.js";
6
- import { useRecommendationExtensionStore as d } from "./store/recommendation.js";
7
- import { getDefaultTemplate as _ } from "./templates/grid/template.js";
8
- const k = "recommendation-block", c = "ins-recommendation-v3-block-v2", m = "recommendation-id";
9
- class b extends f {
7
+ import { useRecommendationExtensionStore as u } from "./store/recommendation.js";
8
+ import { getDefaultTemplate as k } from "./templates/grid/template.js";
9
+ const B = "recommendation-block", c = "recommendation-block-v2", a = "recommendation-id";
10
+ class y extends h {
10
11
  constructor() {
11
12
  super();
12
13
  /**
@@ -16,7 +17,7 @@ class b extends f {
16
17
  g(this, "_pendingBlockId", null);
17
18
  }
18
19
  getId() {
19
- return k;
20
+ return B;
20
21
  }
21
22
  getIcon() {
22
23
  return "recommendation-icon";
@@ -39,7 +40,7 @@ class b extends f {
39
40
  */
40
41
  getTemplate() {
41
42
  const t = this._generateNextId();
42
- return this._pendingBlockId = t, _(t);
43
+ return this._pendingBlockId = t, k(t);
43
44
  }
44
45
  /**
45
46
  * Called when a new block is dropped into the template
@@ -50,7 +51,9 @@ class b extends f {
50
51
  */
51
52
  onCreated(t) {
52
53
  const e = this._pendingBlockId ?? this._generateNextId();
53
- this._pendingBlockId = null, this._assignRecommendationId(t, e), s.initializeConfig(this.api, t, { recommendationId: e }), d().setCurrentBlock(e);
54
+ this._pendingBlockId = null, this._assignRecommendationId(t, e);
55
+ const n = s.initializeConfig(this.api, t, { recommendationId: e }), i = u();
56
+ i.setCurrentBlock(e), d(this.api), i.patchCurrentBlockConfig({ language: n.language }, { triggerRefetch: !1 });
54
57
  }
55
58
  /**
56
59
  * Called when the document changes or template is loaded
@@ -70,7 +73,7 @@ class b extends f {
70
73
  "Assign recommendation ID to legacy block"
71
74
  );
72
75
  }
73
- s.needsMigration(t) && this._migrateFromLegacy(t);
76
+ s.needsMigration(t) && this._migrateFromLegacy(t), d(this.api);
74
77
  }
75
78
  }
76
79
  /**
@@ -81,7 +84,7 @@ class b extends f {
81
84
  */
82
85
  onDelete(t) {
83
86
  const e = this._getRecommendationId(t);
84
- e && d().removeBlockState(e);
87
+ e && u().removeBlockState(e);
85
88
  }
86
89
  /**
87
90
  * Generates the next unique recommendation ID by scanning all existing blocks
@@ -91,9 +94,9 @@ class b extends f {
91
94
  let t = 0;
92
95
  try {
93
96
  const e = this.api.getDocumentRoot();
94
- e && "querySelectorAll" in e && e.querySelectorAll(`.${c}`).forEach((o) => {
95
- if ("getAttribute" in o) {
96
- const a = o.getAttribute(m), l = a ? parseInt(a) : 0;
97
+ e && "querySelectorAll" in e && e.querySelectorAll(`.${c}`).forEach((i) => {
98
+ if ("getAttribute" in i) {
99
+ const m = i.getAttribute(a), l = m ? parseInt(m) : 0;
97
100
  l > t && (t = l);
98
101
  }
99
102
  });
@@ -111,8 +114,8 @@ class b extends f {
111
114
  const n = this._getBlockElement(t);
112
115
  if (!n)
113
116
  return;
114
- const o = this.api.getDocumentModifier();
115
- o.modifyHtml(n).setAttribute(m, e.toString()), o.apply(new h(`Assign recommendation ID ${e}`));
117
+ const i = this.api.getDocumentModifier();
118
+ i.modifyHtml(n).setAttribute(a, e.toString()), i.apply(new _(`Assign recommendation ID ${e}`));
116
119
  }
117
120
  /**
118
121
  * Gets the recommendation-id from a block node
@@ -121,11 +124,11 @@ class b extends f {
121
124
  const e = this._getBlockElement(t);
122
125
  if (!e || !("getAttribute" in e))
123
126
  return null;
124
- const n = e.getAttribute(m);
127
+ const n = e.getAttribute(a);
125
128
  if (!n)
126
129
  return null;
127
- const o = parseInt(n);
128
- return Number.isNaN(o) ? null : o;
130
+ const i = parseInt(n);
131
+ return Number.isNaN(i) ? null : i;
129
132
  }
130
133
  /**
131
134
  * Gets the block element (the element with BLOCK_CLASS)
@@ -146,6 +149,6 @@ class b extends f {
146
149
  }
147
150
  }
148
151
  export {
149
- k as BLOCK_ID,
150
- b as RecommendationBlock
152
+ B as BLOCK_ID,
153
+ y as RecommendationBlock
151
154
  };