@useinsider/guido 3.17.0-beta.bdc7d25 → 3.17.0-beta.c3ab4de

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 (122) hide show
  1. package/README.md +5 -5
  2. package/dist/@types/config/schemas.js +15 -18
  3. package/dist/components/Guido.vue.js +10 -10
  4. package/dist/components/Guido.vue2.js +70 -66
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +7 -7
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +76 -39
  7. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +11 -11
  10. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +56 -6
  11. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  12. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +21 -0
  13. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  14. package/dist/components/organisms/header/EditorActions.vue2.js +34 -50
  15. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  16. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +39 -0
  17. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  18. package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
  19. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  20. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  21. package/dist/components/organisms/header/RightSlot.vue.js +7 -6
  22. package/dist/components/organisms/header/RightSlot.vue2.js +17 -15
  23. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  24. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  25. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
  26. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  27. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +18 -0
  28. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +74 -0
  29. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +43 -34
  30. package/dist/composables/useAccessibilityApi.js +31 -0
  31. package/dist/composables/useCustomInterfaceAppearance.js +31 -28
  32. package/dist/composables/useRecommendation.js +29 -30
  33. package/dist/composables/useStripo.js +14 -14
  34. package/dist/config/i18n/en/labels.json.js +29 -5
  35. package/dist/config/migrator/index.js +9 -8
  36. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  37. package/dist/config/migrator/recommendation/extractors.js +29 -24
  38. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  39. package/dist/config/migrator/recommendation/settingsMapper.js +0 -2
  40. package/dist/config/migrator/recommendationMigrator.js +30 -26
  41. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  42. package/dist/enums/date.js +5 -4
  43. package/dist/enums/extensions/recommendationBlock.js +0 -1
  44. package/dist/extensions/Blocks/Recommendation/block.js +12 -11
  45. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  46. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  47. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +24 -24
  48. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  49. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +329 -257
  50. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +180 -133
  51. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +1 -19
  52. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  53. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  54. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  55. package/dist/extensions/Blocks/Recommendation/services/configService.js +34 -16
  56. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  57. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +83 -128
  58. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  59. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  60. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  61. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  62. package/dist/guido.css +1 -1
  63. package/dist/node_modules/@vueuse/core/index.js +102 -0
  64. package/dist/node_modules/@vueuse/shared/index.js +40 -28
  65. package/dist/services/recommendationApi.js +10 -16
  66. package/dist/sprite.svg +6 -0
  67. package/dist/src/@types/config/schemas.d.ts +4 -10
  68. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +2 -4
  69. package/dist/src/components/organisms/header/AutoSaveStatus.vue.d.ts +2 -0
  70. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  71. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  72. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  73. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  74. package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
  75. package/dist/src/composables/useActionsApi.d.ts +2 -2
  76. package/dist/src/composables/useConfig.d.ts +2 -0
  77. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  78. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  79. package/dist/src/enums/date.d.ts +1 -0
  80. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  81. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  82. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -5
  83. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  84. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  85. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  86. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  87. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +39 -15
  88. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -14
  89. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  90. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  91. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  92. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +26 -56
  93. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  94. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -5
  95. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  96. package/dist/src/mock/api/recommendation-strategies.d.ts +0 -61
  97. package/dist/src/services/recommendationApi.d.ts +1 -1
  98. package/dist/src/stores/config.d.ts +18 -0
  99. package/dist/src/stores/editor.d.ts +76 -0
  100. package/dist/src/stores/onboarding.d.ts +377 -0
  101. package/dist/src/stores/save-as-template.d.ts +4 -3
  102. package/dist/src/stores/version-history.d.ts +1 -1
  103. package/dist/src/utils/genericUtil.d.ts +5 -0
  104. package/dist/src/utils/timeUtil.d.ts +10 -0
  105. package/dist/static/assets/icons/line-delete.svg.js +2 -2
  106. package/dist/static/assets/icons/line-plus.svg.js +2 -2
  107. package/dist/static/styles/components/accessibility.css.js +137 -0
  108. package/dist/static/styles/components/recommendation-strategy.css.js +2 -35
  109. package/dist/static/styles/customEditorStyle.css.js +3 -1
  110. package/dist/static/styles/variables.css.js +1 -0
  111. package/dist/stores/editor.js +4 -1
  112. package/dist/stores/onboarding.js +16 -11
  113. package/dist/utils/dateUtil.js +18 -24
  114. package/dist/utils/genericUtil.js +28 -27
  115. package/dist/utils/templatePreparation.js +0 -2
  116. package/dist/utils/timeUtil.js +6 -17
  117. package/package.json +3 -3
  118. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  119. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  120. package/dist/src/utils/strategyInfoBox.d.ts +0 -35
  121. package/dist/utils/strategyInfoBox.js +0 -68
  122. /package/dist/src/components/organisms/{header/AutoSaveToggle.vue.d.ts → extensions/recommendation/RemoveStrategyModal.vue.d.ts} +0 -0
package/README.md CHANGED
@@ -634,16 +634,16 @@ toaster fires (useful before the host has wired the catalog).
634
634
 
635
635
  ```bash
636
636
  # Install
637
- bun install
637
+ npm install
638
638
 
639
639
  # Start dev server
640
- bun start
640
+ npm start
641
641
 
642
642
  # Build
643
- bun run build
643
+ npm run build
644
644
 
645
645
  # Lint & type-check
646
- bun run lint
646
+ npm run lint
647
647
  ```
648
648
 
649
649
  ### Environment Variables
@@ -661,7 +661,7 @@ VITE_STRIPO_USER=your_user
661
661
 
662
662
  ```bash
663
663
  # Build the package
664
- bun run build
664
+ npm run build
665
665
 
666
666
  # Create tarball
667
667
  npm pack
@@ -1,5 +1,5 @@
1
- import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as y, boolean as o, array as c, transform as C, record as k, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
1
+ import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as h, boolean as o, array as c, transform as C, record as k, fallback as R, literal as u, looseObject as g, variant as T, union as y, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
3
3
  const p = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -68,22 +68,22 @@ const p = {
68
68
  value: t()
69
69
  })
70
70
  )
71
- }), S = I(() => g({
71
+ }), f = I(() => g({
72
72
  text: e(t()),
73
73
  // eslint-disable-next-line camelcase -- backend field name
74
74
  tag_text: e(t()),
75
75
  value: e(t()),
76
- children: e(c(S)),
76
+ children: e(c(f)),
77
77
  // eslint-disable-next-line camelcase -- backend field name
78
- select_items: e(c(S))
78
+ select_items: e(c(f))
79
79
  })), N = k(
80
80
  t(),
81
- R(c(S), [])
81
+ R(c(f), [])
82
82
  ), P = g({
83
83
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
84
84
  id: e(n()),
85
85
  /** Decimal places for price display (legacy data may use string or number) */
86
- decimalCount: e(h([t(), n()])),
86
+ decimalCount: e(y([t(), n()])),
87
87
  /** Pinned product IDs (empty array when filter-driven) */
88
88
  productIds: e(c(r())),
89
89
  /** Whether the block requested live products at send time */
@@ -117,7 +117,7 @@ const p = {
117
117
  /** Block type marker used by some legacy variants */
118
118
  blockType: e(t()),
119
119
  /** Size variant marker (legacy data may use string or number) */
120
- size: e(h([t(), n()])),
120
+ size: e(y([t(), n()])),
121
121
  /** Vertical responsiveness flag (legacy size=1 variants) */
122
122
  verticalResponsiveness: e(o()),
123
123
  /** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
@@ -189,9 +189,9 @@ const p = {
189
189
  /** Email header settings */
190
190
  emailHeader: e(D, { senderName: "", subject: "" }),
191
191
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
192
- savedModulesFolderName: e(t(), f.SAVED_MODULES),
192
+ savedModulesFolderName: e(t(), S.SAVED_MODULES),
193
193
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
194
- defaultModulesFolderName: e(t(), f.DEFAULT_MODULES)
194
+ defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
195
195
  }), F = a({
196
196
  /** Whether to show the header bar */
197
197
  showHeader: e(o(), !0),
@@ -216,15 +216,12 @@ const p = {
216
216
  liquidSyntax: e(o(), !1),
217
217
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
218
218
  autosave: e(o(), !1),
219
+ /** Enable the Stripo Accessibility Checker control in the editor toolbar. */
220
+ accessibilityTesting: e(o(), !1),
219
221
  /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
220
222
  allowlistEnabled: e(o(), !1),
221
223
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
222
224
  linkTrackingIds: e(o(), !1),
223
- /**
224
- * Assign a Reusable Recommendation Strategy (RRS) to recommendation blocks instead of
225
- * per-block algorithm settings. Hides Algorithm, Filters, Shuffle and Number of Products
226
- * (they live on the strategy) and adds the Assign Strategy flow.
227
- */
228
225
  reusableRecommendationStrategy: e(o(), !1)
229
226
  }), B = i([
230
227
  "amp-accordion",
@@ -293,7 +290,7 @@ const p = {
293
290
  ...d.entries,
294
291
  type: u("custom"),
295
292
  /** Custom processor function */
296
- processor: y(
293
+ processor: h(
297
294
  (s) => typeof s == "function",
298
295
  "processor must be a function"
299
296
  )
@@ -313,7 +310,7 @@ const p = {
313
310
  * Return false to cancel the save operation.
314
311
  */
315
312
  externalValidation: e(
316
- y(
313
+ h(
317
314
  (s) => typeof s == "function",
318
315
  "externalValidation must be a function"
319
316
  )
@@ -349,7 +346,7 @@ export {
349
346
  G as CustomRuleSchema,
350
347
  B as DefaultBlockTypeSchema,
351
348
  N as DynamicContentListSchema,
352
- S as DynamicContentNodeSchema,
349
+ f as DynamicContentNodeSchema,
353
350
  E as DynamicContentSchema,
354
351
  O as EditorSchema,
355
352
  D as EmailHeaderSchema,
@@ -1,20 +1,20 @@
1
- import i from "./Guido.vue2.js";
1
+ import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
- var o = this, r = o._self._c, e = o._self._setupProxy;
6
- return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled ? r(e.AssignStrategyDrawer) : o._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
5
+ var a = this, r = a._self._c, e = a._self._setupProxy;
6
+ return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, n = [], s = /* @__PURE__ */ a(
10
- i,
9
+ }, s = [], n = /* @__PURE__ */ i(
10
+ o,
11
11
  t,
12
- n,
12
+ s,
13
13
  !1,
14
14
  null,
15
- "b13f0cfc"
15
+ "5c588dc5"
16
16
  );
17
- const l = s.exports;
17
+ const v = n.exports;
18
18
  export {
19
- l as default
19
+ v as default
20
20
  };
@@ -1,53 +1,55 @@
1
- import { defineComponent as Q, defineAsyncComponent as g, ref as U, computed as S, watch as _, onMounted as X, onUnmounted as Y } from "vue";
2
- import { useCortexBlueprintBridge as Z } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as ee } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as te } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as oe } from "../composables/usePartner.js";
6
- import { useStripo as ne } from "../composables/useStripo.js";
7
- import { useTimerClone as re } from "../composables/useTimerClone.js";
8
- import { migrate as A } from "../config/migrator/index.js";
1
+ import { defineComponent as Z, defineAsyncComponent as l, ref as A, computed as u, watch as U, onMounted as ee, onUnmounted as te } from "vue";
2
+ import { useCortexBlueprintBridge as oe } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as ne } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as re } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as se } from "../composables/usePartner.js";
6
+ import { useStripo as ae } from "../composables/useStripo.js";
7
+ import { useTimerClone as ie } from "../composables/useTimerClone.js";
8
+ import { migrate as _ } from "../config/migrator/index.js";
9
9
  import { ModuleFolderDefaults as N } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
11
- import { useRecommendationExtensionStore as ae } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
- import ie from "./organisms/AutoSaveController.vue.js";
13
- import ce from "./organisms/base/Toaster.vue.js";
14
- import de from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import me from "./organisms/header/HeaderWrapper.vue.js";
16
- import le from "./organisms/LoadingWrapper.vue.js";
17
- import ue from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
- import pe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
- import { useStripoApi as fe } from "../services/stripoApi.js";
20
- import { useConfigStore as ye } from "../stores/config.js";
21
- import { useDynamicContentStore as ve } from "../stores/dynamic-content.js";
22
- import { useEditorStore as O } from "../stores/editor.js";
23
- import { usePreviewStore as ge } from "../stores/preview.js";
24
- import { useTemplateStore as Se } from "../stores/template.js";
25
- import { useUnsubscribeStore as be } from "../stores/unsubscribe.js";
26
- import { readTrackFloor as P } from "../utils/linkTrackingIds.js";
27
- const Ke = /* @__PURE__ */ Q({
10
+ import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
11
+ import { useRecommendationExtensionStore as O } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
+ import de from "./organisms/AutoSaveController.vue.js";
13
+ import me from "./organisms/base/Toaster.vue.js";
14
+ import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
+ import ue from "./organisms/header/HeaderWrapper.vue.js";
16
+ import pe from "./organisms/LoadingWrapper.vue.js";
17
+ import fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import ye from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as ge } from "../services/stripoApi.js";
20
+ import { useConfigStore as ve } from "../stores/config.js";
21
+ import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
22
+ import { useEditorStore as P } from "../stores/editor.js";
23
+ import { usePreviewStore as he } from "../stores/preview.js";
24
+ import { useTemplateStore as be } from "../stores/template.js";
25
+ import { useUnsubscribeStore as Ee } from "../stores/unsubscribe.js";
26
+ import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
27
+ const je = /* @__PURE__ */ Z({
28
28
  __name: "Guido",
29
29
  props: {
30
30
  config: null,
31
31
  ready: { type: Boolean, default: !0 }
32
32
  },
33
33
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
34
- setup(W, { expose: x, emit: r }) {
35
- const a = W, G = g(
34
+ setup(x, { expose: G, emit: r }) {
35
+ const a = x, H = l(
36
36
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
37
- ), H = g(
37
+ ), $ = l(
38
38
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
39
- ), $ = g(
39
+ ), z = l(
40
40
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
41
- ), b = U(), l = U(), u = ve(), h = be(), o = ye();
41
+ ), q = l(
42
+ () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
43
+ ), h = A(), p = A(), f = Se(), b = Ee(), o = ve();
42
44
  a.ready && o.init(a.config);
43
- const c = O(), z = ge(), m = S(() => c.hasChanges), { isTestPartner: q } = oe(), E = () => {
45
+ const c = P(), K = he(), m = u(() => c.hasChanges), { isTestPartner: V } = se(), E = () => {
44
46
  var t;
45
- return (t = b.value) == null ? void 0 : t.handleSave(!0);
47
+ return (t = h.value) == null ? void 0 : t.handleSave(!0);
46
48
  }, w = (t) => {
47
49
  c.loadingStatus = t;
48
50
  };
49
- Z(), te();
50
- const p = () => {
51
+ oe(), re();
52
+ const y = () => {
51
53
  var t, e;
52
54
  return {
53
55
  emailId: o.templateId,
@@ -57,11 +59,13 @@ const Ke = /* @__PURE__ */ Q({
57
59
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
58
60
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
59
61
  };
60
- }, { initPlugin: D, preloadRuntime: C } = ne(), { getDefaultTemplate: k } = fe(), { cloneTimersOnSave: T, hasTimerBlocks: F } = re(), K = S(() => {
62
+ }, { initPlugin: C, preloadRuntime: D } = ae(), { getDefaultTemplate: k } = ge(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ie(), j = u(() => {
61
63
  var t;
62
64
  return !((t = o.ui) != null && t.showHeader);
63
- }), V = S(() => o.isFeatureEnabled("reusableRecommendationStrategy"));
64
- ee({
65
+ }), J = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), Q = u(
66
+ () => !!O().recommendationConfigs.strategyId
67
+ );
68
+ ne({
65
69
  onBack: () => {
66
70
  console.debug("guido:back"), r("back");
67
71
  },
@@ -69,7 +73,7 @@ const Ke = /* @__PURE__ */ Q({
69
73
  console.debug("guido:save:start"), r("save:start");
70
74
  },
71
75
  onSaveComplete: (t) => {
72
- const e = { ...t, metadata: p() };
76
+ const e = { ...t, metadata: y() };
73
77
  console.debug("guido:save:complete", e), r("save:complete", e);
74
78
  },
75
79
  onTestEmailClick: () => {
@@ -77,68 +81,68 @@ const Ke = /* @__PURE__ */ Q({
77
81
  }
78
82
  });
79
83
  const I = (t) => {
80
- console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
84
+ console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
81
85
  }, R = () => {
82
86
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
83
87
  };
84
- _(() => m.value, () => {
88
+ U(() => m.value, () => {
85
89
  r("on-change", m.value);
86
90
  });
87
- const f = (t) => {
91
+ const g = (t) => {
88
92
  const e = t, { attribute: s, position: d } = e.detail;
89
93
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
90
94
  };
91
95
  let i = null;
92
- const y = () => {
96
+ const v = () => {
93
97
  var e;
94
- const t = document.querySelector(se);
95
- (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
96
- }, v = async () => {
98
+ const t = document.querySelector(ce);
99
+ (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
100
+ }, S = async () => {
97
101
  var t;
98
102
  try {
99
103
  o.initialized || o.init(a.config), c.templateId = o.templateId;
100
104
  const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
101
- h.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
105
+ b.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
102
106
  const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, B = o.isFeatureEnabled("linkTrackingIds");
103
107
  let n = {
104
- html: s && await A(s, M),
108
+ html: s && await _(s, M),
105
109
  css: d
106
110
  };
107
- n.html || (n = await k(), n.html = await A(n.html, M));
108
- const j = B ? P(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
109
- F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(j, P(n.html)));
110
- const J = {
111
+ n.html || (n = await k(), n.html = await _(n.html, M));
112
+ const X = B ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
113
+ F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(X, W(n.html)));
114
+ const Y = {
111
115
  preselectedDynamicContentList: L,
112
116
  onReady: () => {
113
117
  console.debug("guido:ready"), r("ready");
114
118
  }
115
119
  };
116
- await D(n, p(), J), u.selectedDynamicContentList = L;
120
+ await C(n, y(), Y), f.selectedDynamicContentList = L;
117
121
  } catch (e) {
118
122
  console.error("Failed to initialize Stripo editor:", e);
119
123
  }
120
124
  };
121
- return X(async () => {
125
+ return ee(async () => {
122
126
  var e;
123
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ae().$reset(), O().$reset(), Se().$reset(), y();
124
- const t = (e = l.value) == null ? void 0 : e.parentElement;
125
- if (t && (i = new ResizeObserver(y), i.observe(t)), C(), a.ready)
126
- await v();
127
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), be().$reset(), v();
128
+ const t = (e = p.value) == null ? void 0 : e.parentElement;
129
+ if (t && (i = new ResizeObserver(v), i.observe(t)), D(), a.ready)
130
+ await S();
127
131
  else {
128
- const s = _(() => a.ready, (d) => {
129
- d && (s(), v());
132
+ const s = U(() => a.ready, (d) => {
133
+ d && (s(), S());
130
134
  });
131
135
  }
132
- document.addEventListener("dynamic-content:open", f);
133
- }), Y(() => {
134
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", f);
136
+ document.addEventListener("dynamic-content:open", g);
137
+ }), te(() => {
138
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", g);
135
139
  try {
136
140
  window.UIEditor.removeEditor();
137
141
  } catch {
138
142
  console.debug("Failed to remove Stripo editor: No editor found");
139
143
  }
140
144
  o.reset();
141
- }), x({
145
+ }), G({
142
146
  dynamicContent: {
143
147
  insert: I,
144
148
  close: R
@@ -146,9 +150,9 @@ const Ke = /* @__PURE__ */ Q({
146
150
  hasChanges: m,
147
151
  saveSilent: E,
148
152
  setLoading: w
149
- }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, AssignStrategyDrawer: $, headerWrapperRef: b, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: h, props: a, configStore: o, editorStore: c, previewStore: z, hasChanges: m, isTestPartner: q, saveSilent: E, setLoading: w, emit: r, buildMetadata: p, initPlugin: D, preloadRuntime: C, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: K, isRrsEnabled: V, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: y, startEditor: v, AutoSaveController: ie, Toaster: ce, FilterSelectionDrawer: de, HeaderWrapper: me, LoadingWrapper: le, SaveAsTemplateDrawer: ue, UnsubscribeWrapper: pe };
153
+ }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, RemoveStrategyModal: q, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: b, props: a, configStore: o, editorStore: c, previewStore: K, hasChanges: m, isTestPartner: V, saveSilent: E, setLoading: w, emit: r, buildMetadata: y, initPlugin: C, preloadRuntime: D, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: j, isRrsEnabled: J, hasAssignedStrategy: Q, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: g, ribbonObserver: i, updateRibbonOffset: v, startEditor: S, AutoSaveController: de, Toaster: me, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ye };
150
154
  }
151
155
  });
152
156
  export {
153
- Ke as default
157
+ je as default
154
158
  };
@@ -1,19 +1,19 @@
1
1
  import r from "./AssignStrategyDrawer.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
- var a = function() {
4
+ import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
+ var o = function() {
6
6
  var e = this, s = e._self._c, t = e._self._setupProxy;
7
7
  return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
8
- return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading, "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { select: t.onSelect } })], 1)];
9
- }, proxy: !0 }], null, !1, 5799417) }) : e._e();
10
- }, n = [], i = /* @__PURE__ */ o(
8
+ return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { select: t.onSelect } })], 1)];
9
+ }, proxy: !0 }], null, !1, 2542767044) }) : e._e();
10
+ }, n = [], i = /* @__PURE__ */ a(
11
11
  r,
12
- a,
12
+ o,
13
13
  n,
14
14
  !1,
15
15
  null,
16
- "43e684f6"
16
+ "2580a7d9"
17
17
  );
18
18
  const y = i.exports;
19
19
  export {
@@ -1,69 +1,106 @@
1
- import { defineComponent as f, defineAsyncComponent as g, ref as l, computed as a, watch as w } from "vue";
1
+ import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } from "vue";
2
2
  import "@useinsider/design-system-organisms/style";
3
- import { useToaster as _ } from "../../../../composables/useToaster.js";
4
- import { useTranslations as D } from "../../../../composables/useTranslations.js";
5
- import { URLS as v } from "../../../../enums/extensions/recommendationBlock.js";
6
- import { ToasterTypeOptions as p } from "../../../../enums/toaster.js";
7
- import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
8
- import O from "./StrategyInfoBoxContent.vue.js";
9
- import { buildStrategyInfoBoxProps as x } from "../../../../utils/strategyInfoBox.js";
10
- const L = /* @__PURE__ */ f({
3
+ import { useToaster as x } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as A } from "../../../../composables/useTranslations.js";
5
+ import { DOTTED_DATE_LOCALE as E } from "../../../../enums/date.js";
6
+ import { URLS as h } from "../../../../enums/extensions/recommendationBlock.js";
7
+ import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
8
+ import { useRecommendationExtensionStore as C } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import B from "./StrategyInfoBoxContent.vue.js";
10
+ import { formatShortDate as I } from "../../../../utils/dateUtil.js";
11
+ import { asText as f } from "../../../../utils/genericUtil.js";
12
+ import { escapeHtml as N } from "../../../../utils/htmlEscape.js";
13
+ import { InSkeleton as b } from "@useinsider/design-system-vue";
14
+ const W = /* @__PURE__ */ v({
11
15
  __name: "AssignStrategyDrawer",
12
- setup(A) {
13
- const m = g(
14
- async () => (await import("@useinsider/design-system-organisms")).OrgStrategyDetailModal
15
- ), y = g(
16
- async () => (await import("@useinsider/design-system-organisms")).OrgStrategyDropdown
17
- ), r = D(), e = T(), { showToaster: n } = _(), s = l(null), o = l(!1), u = a(() => e.assignStrategyDrawerStatus ? r("email-editor.assign-strategy-description", { url: v.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
18
- w(() => e.assignStrategyDrawerStatus, (t) => {
16
+ setup(k) {
17
+ const c = () => import("@useinsider/design-system-organisms"), g = (t, r) => ({
18
+ render: (a) => a(b, { props: { sizing: { width: t, height: r } } })
19
+ }), S = y({
20
+ loader: async () => (await c()).OrgStrategyDetailModal,
21
+ loadingComponent: g(480, 240),
22
+ delay: 0
23
+ }), T = y({
24
+ loader: async () => (await c()).OrgStrategyDropdown,
25
+ loadingComponent: g(240, 42),
26
+ delay: 0
27
+ }), o = A(), e = C(), { showToaster: s } = x(), n = u(null), i = u(!1), _ = l(() => e.assignStrategyDrawerStatus ? o("email-editor.assign-strategy-description", { url: h.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
28
+ O(() => e.assignStrategyDrawerStatus, (t) => {
19
29
  if (!t)
20
30
  return;
21
- const { strategyId: i } = e.recommendationConfigs;
22
- s.value = i || null, o.value = !1, e.fetchStrategies().catch(() => {
23
- n({
24
- type: p.Error,
25
- message: r("discovery-strategy.error-description")
31
+ const { strategyId: r } = e.recommendationConfigs;
32
+ n.value = r || null, i.value = !1, e.fetchStrategies().catch(() => {
33
+ s({
34
+ type: m.Error,
35
+ message: o("discovery-strategy.error-description")
26
36
  });
27
37
  });
28
38
  });
29
- const d = a(() => e.strategies.map((t) => ({
39
+ const p = (t) => {
40
+ const r = f(t.updated_at || t.created_at);
41
+ if (!r)
42
+ return "";
43
+ const a = I(r, E);
44
+ return o("recommendation-strategy.last-updated-on", { value: a });
45
+ }, D = l(() => e.strategies.map((t) => ({
30
46
  text: t.name,
31
47
  value: t.strategy_id,
32
- // `slot` lives here, not in the util: the design system renders it with
33
- // `<component :is>` inside its own info box, and a util must not import one.
34
- infoBoxProps: { ...x(t, r), slot: O }
35
- }))), c = a(() => {
36
- const t = e.strategies.find((i) => String(i.strategy_id) === String(s.value ?? ""));
48
+ infoBoxProps: {
49
+ id: `strategy-info-${t.strategy_id}`,
50
+ theme: "light",
51
+ variant: "information",
52
+ className: "assign-strategy-info-box",
53
+ titleText: N(f(t.name)),
54
+ descriptionStatus: !0,
55
+ descriptionText: p(t),
56
+ slot: B,
57
+ slotProps: { strategy: t }
58
+ }
59
+ }))), d = l(() => {
60
+ const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
37
61
  return t ? { ...t, fallback_config: null } : null;
38
- }), S = a(() => ({
62
+ }), w = l(() => ({
39
63
  primaryButton: {
40
64
  styling: "solid",
41
65
  type: "primary",
42
- labelText: r("products.assign-btn")
66
+ labelText: o("products.assign-btn")
43
67
  },
44
68
  cancelOrBackButton: {
45
69
  styling: "ghost",
46
70
  type: "secondary",
47
- labelText: r("products.cancel")
71
+ labelText: o("products.cancel")
48
72
  }
49
73
  }));
50
- return { __sfc: !0, OrgStrategyDetailModal: m, OrgStrategyDropdown: y, trans: r, store: e, showToaster: n, selectedStrategyId: s, showSelectionError: o, drawerDescription: u, strategyOptions: d, selectedStrategy: c, footerButtonGroupOptions: S, closeDrawer: () => {
74
+ return { __sfc: !0, loadOrganisms: c, skeleton: g, OrgStrategyDetailModal: S, OrgStrategyDropdown: T, trans: o, store: e, showToaster: s, selectedStrategyId: n, showSelectionError: i, drawerDescription: _, lastUpdatedText: p, strategyOptions: D, selectedStrategy: d, footerButtonGroupOptions: w, closeDrawer: () => {
51
75
  e.closeAssignStrategyDrawer();
52
- }, assignStrategy: () => {
53
- const t = c.value;
76
+ }, assignStrategy: async () => {
77
+ const t = d.value;
54
78
  if (!t) {
55
- o.value = !0;
79
+ i.value = !0;
80
+ return;
81
+ }
82
+ let r = "";
83
+ try {
84
+ r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
85
+ } catch (a) {
86
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
87
+ }
88
+ if (!r) {
89
+ s({
90
+ type: m.Error,
91
+ message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
92
+ });
56
93
  return;
57
94
  }
58
- e.assignStrategy(t), n({
59
- type: p.Success,
60
- message: r("email-editor.strategy-assigned-success", { strategyName: t.name })
95
+ e.assignStrategy(t), s({
96
+ type: m.Success,
97
+ message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
61
98
  }), e.closeAssignStrategyDrawer();
62
99
  }, onSelect: (t) => {
63
- s.value = t.value, o.value = !1;
100
+ n.value = t.value, i.value = !1;
64
101
  } };
65
102
  }
66
103
  });
67
104
  export {
68
- L as default
105
+ W as default
69
106
  };
@@ -0,0 +1,17 @@
1
+ import s from "./RemoveStrategyModal.vue2.js";
2
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var a = function() {
4
+ var t = this, o = t._self._c, e = t._self._setupProxy;
5
+ return e.store.removeStrategyModalStatus ? o(e.WpModal, { attrs: { id: "guido__remove-strategy-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.remove-strategy-confirm-title") }, on: { close: e.close, "primary-action": e.handleConfirm, "secondary-action": e.close } }, [o("p", [t._v(t._s(e.messageParts[0])), o("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])]) : t._e();
6
+ }, n = [], _ = /* @__PURE__ */ r(
7
+ s,
8
+ a,
9
+ n,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = _.exports;
15
+ export {
16
+ c as default
17
+ };