@useinsider/guido 3.17.0-beta.77567eb → 3.17.0-beta.7c9fc24

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 (123) hide show
  1. package/README.md +2 -0
  2. package/dist/@types/config/schemas.js +33 -30
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +85 -77
  5. package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  9. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  10. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  11. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  12. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  13. package/dist/components/organisms/header/EditorActions.vue2.js +74 -43
  14. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
  16. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
  17. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +48 -0
  18. package/dist/components/wrappers/WpDrawer.vue.js +9 -7
  19. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  20. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  21. package/dist/composables/useHtmlCompiler.js +37 -26
  22. package/dist/composables/useHtmlValidator.js +2 -0
  23. package/dist/composables/useRecommendation.js +41 -34
  24. package/dist/composables/useSave.js +84 -41
  25. package/dist/composables/useSaveValidation.js +279 -0
  26. package/dist/composables/useSaveValidationRollout.js +9 -0
  27. package/dist/composables/useStripo.js +14 -14
  28. package/dist/composables/validators/useCouponBlockValidator.js +24 -21
  29. package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
  30. package/dist/config/i18n/en/labels.json.js +1 -1
  31. package/dist/config/migrator/index.js +9 -8
  32. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  33. package/dist/config/migrator/recommendation/extractors.js +29 -24
  34. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  35. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  36. package/dist/config/migrator/recommendationMigrator.js +31 -25
  37. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  38. package/dist/enums/academy.js +2 -1
  39. package/dist/enums/date.js +5 -3
  40. package/dist/enums/extensions/recommendationBlock.js +3 -1
  41. package/dist/enums/save-validation.js +4 -0
  42. package/dist/extensions/Blocks/Recommendation/block.js +35 -29
  43. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  44. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  45. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
  46. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  47. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
  48. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +241 -180
  49. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  50. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  51. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  52. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  53. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  54. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  55. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +182 -79
  56. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  57. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  58. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  59. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  60. package/dist/extensions/Blocks/common-control.js +22 -19
  61. package/dist/guido.css +1 -1
  62. package/dist/package.json.js +1 -1
  63. package/dist/services/recommendationApi.js +69 -30
  64. package/dist/src/@types/config/schemas.d.ts +6 -0
  65. package/dist/src/@types/save-validation.d.ts +19 -0
  66. package/dist/src/components/Guido.vue.d.ts +17 -1
  67. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  68. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  69. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  70. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
  71. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
  72. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
  73. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
  74. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
  75. package/dist/src/composables/useConfig.d.ts +4 -0
  76. package/dist/src/composables/useHtmlValidator.d.ts +21 -0
  77. package/dist/src/composables/useRecommendation.d.ts +1 -0
  78. package/dist/src/composables/useSave.d.ts +6 -1
  79. package/dist/src/composables/useSaveValidation.d.ts +6 -0
  80. package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
  81. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  82. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
  83. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  84. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  85. package/dist/src/enums/academy.d.ts +1 -0
  86. package/dist/src/enums/date.d.ts +1 -0
  87. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  88. package/dist/src/enums/save-validation.d.ts +27 -0
  89. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  90. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  91. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
  92. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  93. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  94. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  95. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  96. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
  97. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  98. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  99. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  100. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  101. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +181 -10
  102. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  103. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  104. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  105. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  106. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  107. package/dist/src/services/recommendationApi.d.ts +4 -1
  108. package/dist/src/stores/config.d.ts +48 -0
  109. package/dist/src/stores/save-as-template.d.ts +4 -3
  110. package/dist/src/stores/save-validation.d.ts +22 -0
  111. package/dist/src/utils/genericUtil.d.ts +5 -0
  112. package/dist/src/utils/templatePreparation.d.ts +30 -0
  113. package/dist/static/assets/icons/line-change.svg.js +5 -0
  114. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  115. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  116. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  117. package/dist/static/styles/customEditorStyle.css.js +3 -1
  118. package/dist/stores/config.js +39 -22
  119. package/dist/stores/save-validation.js +30 -0
  120. package/dist/utils/dateUtil.js +23 -10
  121. package/dist/utils/genericUtil.js +28 -27
  122. package/dist/utils/templatePreparation.js +46 -42
  123. package/package.json +3 -2
package/README.md CHANGED
@@ -162,6 +162,8 @@ const config: GuidoConfigInput = {
162
162
  liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
163
163
  autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
164
164
  allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
165
+ allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
166
+ reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
165
167
  },
166
168
 
167
169
  // Optional: Callbacks
@@ -1,5 +1,5 @@
1
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 k, boolean as o, array as c, transform as C, record as y, 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";
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";
3
3
  const p = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -30,7 +30,7 @@ const p = {
30
30
  name: t(),
31
31
  /** Fallback font family (e.g., "serif" or "sans-serif") */
32
32
  family: t()
33
- }), M = a({
33
+ }), E = a({
34
34
  /** Partner/organization name (required) */
35
35
  name: m(
36
36
  t(),
@@ -54,7 +54,7 @@ const p = {
54
54
  username: e(t(), "Guido User"),
55
55
  /** Fallback font settings from partner settings — used to match backend size calculation */
56
56
  fallbackFont: e(L)
57
- }), E = a({
57
+ }), M = a({
58
58
  /** Display text for the dynamic content */
59
59
  text: t(),
60
60
  /** Template variable value (e.g., {{username}}) */
@@ -76,10 +76,10 @@ const p = {
76
76
  children: e(c(S)),
77
77
  // eslint-disable-next-line camelcase -- backend field name
78
78
  select_items: e(c(S))
79
- })), N = y(
79
+ })), v = k(
80
80
  t(),
81
81
  R(c(S), [])
82
- ), P = g({
82
+ ), N = 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) */
@@ -124,7 +124,7 @@ const p = {
124
124
  isPriceMovedToNextLine: e(o()),
125
125
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
126
126
  isPriceDeletedForZeroSale: e(o())
127
- }), v = a({
127
+ }), P = a({
128
128
  /**
129
129
  * Legacy recommendation block configs keyed by block ID.
130
130
  * Pass this when loading a template authored with the v1
@@ -132,7 +132,7 @@ const p = {
132
132
  * strategy, currency, locale, and layout data.
133
133
  */
134
134
  recommendationConfigs: e(
135
- y(t(), P),
135
+ k(t(), N),
136
136
  {}
137
137
  )
138
138
  }), x = a({
@@ -142,7 +142,7 @@ const p = {
142
142
  css: e(t(), ""),
143
143
  /** Preselected dynamic content items */
144
144
  preselectedDynamicContent: e(
145
- c(E),
145
+ c(M),
146
146
  []
147
147
  ),
148
148
  /**
@@ -151,7 +151,7 @@ const p = {
151
151
  * (first) partner's leaf attributes into the label→token map that repairs
152
152
  * label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
153
153
  */
154
- dynamicContentList: e(N, {}),
154
+ dynamicContentList: e(v, {}),
155
155
  /** Valid custom field attribute names from the partner's categorized fields */
156
156
  customFieldAttributes: e(c(t()), []),
157
157
  /** Selected unsubscribe page IDs */
@@ -173,7 +173,7 @@ const p = {
173
173
  0
174
174
  ),
175
175
  /** Migration-only inputs (legacy block configs) */
176
- migration: e(v, {})
176
+ migration: e(P, {})
177
177
  }), D = a({
178
178
  /** Sender display name */
179
179
  senderName: e(t(), ""),
@@ -219,8 +219,11 @@ const p = {
219
219
  /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
220
220
  allowlistEnabled: e(o(), !1),
221
221
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
222
- linkTrackingIds: e(o(), !1)
223
- }), B = i([
222
+ linkTrackingIds: e(o(), !1),
223
+ /** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
224
+ allowSaveWithErrors: e(o(), !0),
225
+ reusableRecommendationStrategy: e(o(), !1)
226
+ }), w = i([
224
227
  "amp-accordion",
225
228
  "amp-carousel",
226
229
  "amp-form-controls",
@@ -234,7 +237,7 @@ const p = {
234
237
  "text-block",
235
238
  "timer-block",
236
239
  "video-block"
237
- ]), w = i([
240
+ ]), B = i([
238
241
  "dynamic-content",
239
242
  "checkbox-block",
240
243
  "radio-button-block",
@@ -245,12 +248,12 @@ const p = {
245
248
  ]), H = a({
246
249
  /** Default blocks to exclude from the editor */
247
250
  excludeDefaults: e(
248
- c(B),
251
+ c(w),
249
252
  []
250
253
  ),
251
254
  /** Custom blocks to include in the editor */
252
255
  includeCustoms: e(
253
- c(w),
256
+ c(B),
254
257
  []
255
258
  )
256
259
  }), d = a({
@@ -287,7 +290,7 @@ const p = {
287
290
  ...d.entries,
288
291
  type: u("custom"),
289
292
  /** Custom processor function */
290
- processor: k(
293
+ processor: y(
291
294
  (s) => typeof s == "function",
292
295
  "processor must be a function"
293
296
  )
@@ -301,23 +304,23 @@ const p = {
301
304
  customRules: e(c(V), []),
302
305
  /** Skip default compiler rules */
303
306
  ignoreDefaultRules: e(o(), !1)
304
- }), Z = a({
307
+ }), W = a({
305
308
  /**
306
309
  * External validation handler called before save completes.
307
310
  * Return false to cancel the save operation.
308
311
  */
309
312
  externalValidation: e(
310
- k(
313
+ y(
311
314
  (s) => typeof s == "function",
312
315
  "externalValidation must be a function"
313
316
  )
314
317
  )
315
- }), Q = a({
318
+ }), K = a({
316
319
  // Required sections
317
320
  /** Identity configuration (required) */
318
321
  identity: A,
319
322
  /** Partner configuration (required) */
320
- partner: M,
323
+ partner: E,
321
324
  // Optional sections (with defaults)
322
325
  /** Template content and presets */
323
326
  template: e(x, {}),
@@ -332,33 +335,33 @@ const p = {
332
335
  /** Compiler configuration */
333
336
  compiler: e(z, {}),
334
337
  /** Callbacks and event handlers */
335
- callbacks: e(Z, {})
338
+ callbacks: e(W, {})
336
339
  });
337
340
  export {
338
341
  H as BlocksSchema,
339
- Z as CallbacksSchema,
342
+ W as CallbacksSchema,
340
343
  V as CompilerRuleSchema,
341
344
  z as CompilerSchema,
342
- w as CustomBlockTypeSchema,
345
+ B as CustomBlockTypeSchema,
343
346
  G as CustomRuleSchema,
344
- B as DefaultBlockTypeSchema,
345
- N as DynamicContentListSchema,
347
+ w as DefaultBlockTypeSchema,
348
+ v as DynamicContentListSchema,
346
349
  S as DynamicContentNodeSchema,
347
- E as DynamicContentSchema,
350
+ M as DynamicContentSchema,
348
351
  O as EditorSchema,
349
352
  D as EmailHeaderSchema,
350
353
  L as FallbackFontSchema,
351
354
  U as FeaturesSchema,
352
- Q as GuidoConfigSchema,
355
+ K as GuidoConfigSchema,
353
356
  A as IdentitySchema,
354
- P as LegacyRecommendationConfigSchema,
357
+ N as LegacyRecommendationConfigSchema,
355
358
  p as MessageType,
356
- M as PartnerSchema,
359
+ E as PartnerSchema,
357
360
  l as ProductType,
358
361
  j as RegexRuleSchema,
359
362
  q as RemoveRuleSchema,
360
363
  _ as ReplaceRuleSchema,
361
- v as TemplateMigrationSchema,
364
+ P as TemplateMigrationSchema,
362
365
  x as TemplateSchema,
363
366
  F as UISchema
364
367
  };
@@ -1,20 +1,20 @@
1
1
  import i from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import o 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), 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.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), 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(
9
+ }, s = [], n = /* @__PURE__ */ o(
10
10
  i,
11
11
  t,
12
- n,
12
+ s,
13
13
  !1,
14
14
  null,
15
- "b0d3b445"
15
+ "2db79b8f"
16
16
  );
17
- const l = s.exports;
17
+ const c = n.exports;
18
18
  export {
19
- l as default
19
+ c as default
20
20
  };
@@ -1,65 +1,73 @@
1
- import { defineComponent as j, defineAsyncComponent as R, ref as B, computed as U, watch as _, onMounted as J, onUnmounted as Q } from "vue";
2
- import { useCortexBlueprintBridge as X } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as Z } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as ee } from "../composables/usePartner.js";
6
- import { useStripo as te } from "../composables/useStripo.js";
7
- import { useTimerClone as oe } from "../composables/useTimerClone.js";
8
- import { migrate as N } from "../config/migrator/index.js";
9
- import { ModuleFolderDefaults as O } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
11
- import { useRecommendationExtensionStore as re } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
- import se from "./organisms/AutoSaveController.vue.js";
13
- import ae from "./organisms/base/Toaster.vue.js";
14
- import ie from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import ce from "./organisms/header/HeaderWrapper.vue.js";
16
- import de from "./organisms/LoadingWrapper.vue.js";
17
- import me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
- import le from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
- import { useStripoApi as ue } from "../services/stripoApi.js";
20
- import { useConfigStore as pe } from "../stores/config.js";
21
- import { useDynamicContentStore as fe } from "../stores/dynamic-content.js";
1
+ import { defineComponent as ee, defineAsyncComponent as l, ref as A, computed as u, watch as U, onMounted as te, onUnmounted as oe } from "vue";
2
+ import { useCortexBlueprintBridge as ne } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as re } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as se } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as ae } from "../composables/usePartner.js";
6
+ import { useSaveValidationRollout as ie } from "../composables/useSaveValidationRollout.js";
7
+ import { useStripo as ce } from "../composables/useStripo.js";
8
+ import { useTimerClone as de } from "../composables/useTimerClone.js";
9
+ import { migrate as _ } from "../config/migrator/index.js";
10
+ import { ModuleFolderDefaults as N } from "../enums/defaults.js";
11
+ import { RIBBON_SELECTOR as me } from "../enums/onboarding.js";
12
+ import { useRecommendationExtensionStore as O } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
+ import le from "./organisms/AutoSaveController.vue.js";
14
+ import ue from "./organisms/base/Toaster.vue.js";
15
+ import pe from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
+ import fe from "./organisms/header/HeaderWrapper.vue.js";
17
+ import ye from "./organisms/LoadingWrapper.vue.js";
18
+ import ge from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
+ import ve from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
+ import Se from "./organisms/validation/ValidationErrorDrawer.vue.js";
21
+ import { useStripoApi as be } from "../services/stripoApi.js";
22
+ import { useConfigStore as he } from "../stores/config.js";
23
+ import { useDynamicContentStore as Ee } from "../stores/dynamic-content.js";
22
24
  import { useEditorStore as P } from "../stores/editor.js";
23
- import { usePreviewStore as ye } from "../stores/preview.js";
24
- import { useTemplateStore as ve } from "../stores/template.js";
25
- import { useUnsubscribeStore as he } from "../stores/unsubscribe.js";
26
- import { readTrackFloor as A } from "../utils/linkTrackingIds.js";
27
- const ze = /* @__PURE__ */ j({
25
+ import { usePreviewStore as we } from "../stores/preview.js";
26
+ import { useTemplateStore as De } from "../stores/template.js";
27
+ import { useUnsubscribeStore as Ce } from "../stores/unsubscribe.js";
28
+ import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
29
+ const Ze = /* @__PURE__ */ ee({
28
30
  __name: "Guido",
29
31
  props: {
30
32
  config: null,
31
33
  ready: { type: Boolean, default: !0 }
32
34
  },
33
35
  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 = R(
36
+ setup(x, { expose: G, emit: r }) {
37
+ const a = x, H = l(
36
38
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
37
- ), H = R(
39
+ ), V = l(
38
40
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
39
- ), h = B(), l = B(), u = fe(), S = he(), o = pe();
41
+ ), $ = l(
42
+ () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
43
+ ), z = l(
44
+ () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
45
+ ), b = A(), p = A(), f = Ee(), h = Ce(), o = he();
40
46
  a.ready && o.init(a.config);
41
- const c = P(), $ = ye(), m = U(() => c.hasChanges), { isTestPartner: z } = ee(), g = () => {
47
+ const c = P(), q = we(), m = u(() => c.hasChanges), { isTestPartner: K } = ae(), { isEnabled: j } = ie(), E = () => {
42
48
  var t;
43
- return (t = h.value) == null ? void 0 : t.handleSave(!0);
44
- }, b = (t) => {
49
+ return (t = b.value) == null ? void 0 : t.handleSave(!0);
50
+ }, w = (t) => {
45
51
  c.loadingStatus = t;
46
52
  };
47
- X(), Z();
48
- const p = () => {
53
+ ne(), se();
54
+ const y = () => {
49
55
  var t, e;
50
56
  return {
51
57
  emailId: o.templateId,
52
58
  userId: o.userId,
53
59
  username: o.username,
54
60
  partnerName: o.partnerName,
55
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || O.SAVED_MODULES,
56
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || O.DEFAULT_MODULES
61
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
62
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
57
63
  };
58
- }, { initPlugin: E, preloadRuntime: w } = te(), { getDefaultTemplate: C } = ue(), { cloneTimersOnSave: D, hasTimerBlocks: k } = oe(), q = U(() => {
64
+ }, { initPlugin: D, preloadRuntime: C } = ce(), { getDefaultTemplate: k } = be(), { cloneTimersOnSave: T, hasTimerBlocks: F } = de(), J = u(() => {
59
65
  var t;
60
66
  return !((t = o.ui) != null && t.showHeader);
61
- });
62
- Y({
67
+ }), Q = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), X = u(
68
+ () => !!O().recommendationConfigs.strategyId
69
+ );
70
+ re({
63
71
  onBack: () => {
64
72
  console.debug("guido:back"), r("back");
65
73
  },
@@ -67,86 +75,86 @@ const ze = /* @__PURE__ */ j({
67
75
  console.debug("guido:save:start"), r("save:start");
68
76
  },
69
77
  onSaveComplete: (t) => {
70
- const e = { ...t, metadata: p() };
78
+ const e = { ...t, metadata: y() };
71
79
  console.debug("guido:save:complete", e), r("save:complete", e);
72
80
  },
73
81
  onTestEmailClick: () => {
74
82
  console.debug("guido:test-email:click"), r("test-email:click");
75
83
  }
76
84
  });
77
- const T = (t) => {
78
- console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
79
- }, F = () => {
85
+ const R = (t) => {
86
+ console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
87
+ }, I = () => {
80
88
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
81
89
  };
82
- _(() => m.value, () => {
90
+ U(() => m.value, () => {
83
91
  r("on-change", m.value);
84
92
  });
85
- const f = (t) => {
93
+ const g = (t) => {
86
94
  const e = t, { attribute: s, position: d } = e.detail;
87
95
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
88
96
  };
89
97
  let i = null;
90
- const y = () => {
98
+ const v = () => {
91
99
  var e;
92
- const t = document.querySelector(ne);
93
- (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
94
- }, v = async () => {
100
+ const t = document.querySelector(me);
101
+ (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
102
+ }, S = async () => {
95
103
  var t;
96
104
  try {
97
105
  o.initialized || o.init(a.config), c.templateId = o.templateId;
98
- const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", I = (e == null ? void 0 : e.preselectedDynamicContent) || [];
99
- S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
100
- const L = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, M = o.isFeatureEnabled("linkTrackingIds");
106
+ 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) || [];
107
+ h.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
108
+ const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, B = o.isFeatureEnabled("linkTrackingIds");
101
109
  let n = {
102
- html: s && await N(s, L),
110
+ html: s && await _(s, M),
103
111
  css: d
104
112
  };
105
- n.html || (n = await C(), n.html = await N(n.html, L));
106
- const K = M ? A(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
107
- k(n.html) && (n.html = await D(n.html)), M && (c.trackIdSessionFloor = Math.max(K, A(n.html)));
108
- const V = {
109
- preselectedDynamicContentList: I,
113
+ n.html || (n = await k(), n.html = await _(n.html, M));
114
+ const Y = B ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
115
+ F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(Y, W(n.html)));
116
+ const Z = {
117
+ preselectedDynamicContentList: L,
110
118
  onReady: () => {
111
119
  console.debug("guido:ready"), r("ready");
112
120
  }
113
121
  };
114
- await E(n, p(), V), u.selectedDynamicContentList = I;
122
+ await D(n, y(), Z), f.selectedDynamicContentList = L;
115
123
  } catch (e) {
116
124
  console.error("Failed to initialize Stripo editor:", e);
117
125
  }
118
126
  };
119
- return J(async () => {
127
+ return te(async () => {
120
128
  var e;
121
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), re().$reset(), P().$reset(), ve().$reset(), y();
122
- const t = (e = l.value) == null ? void 0 : e.parentElement;
123
- if (t && (i = new ResizeObserver(y), i.observe(t)), w(), a.ready)
124
- await v();
129
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), De().$reset(), v();
130
+ const t = (e = p.value) == null ? void 0 : e.parentElement;
131
+ if (t && (i = new ResizeObserver(v), i.observe(t)), C(), a.ready)
132
+ await S();
125
133
  else {
126
- const s = _(() => a.ready, (d) => {
127
- d && (s(), v());
134
+ const s = U(() => a.ready, (d) => {
135
+ d && (s(), S());
128
136
  });
129
137
  }
130
- document.addEventListener("dynamic-content:open", f);
131
- }), Q(() => {
132
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", f);
138
+ document.addEventListener("dynamic-content:open", g);
139
+ }), oe(() => {
140
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", g);
133
141
  try {
134
142
  window.UIEditor.removeEditor();
135
143
  } catch {
136
144
  console.debug("Failed to remove Stripo editor: No editor found");
137
145
  }
138
146
  o.reset();
139
- }), x({
147
+ }), G({
140
148
  dynamicContent: {
141
- insert: T,
142
- close: F
149
+ insert: R,
150
+ close: I
143
151
  },
144
152
  hasChanges: m,
145
- saveSilent: g,
146
- setLoading: b
147
- }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: a, configStore: o, editorStore: c, previewStore: $, hasChanges: m, isTestPartner: z, saveSilent: g, setLoading: b, emit: r, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: k, noHeader: q, insertDynamicContent: T, closeDynamicContent: F, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: y, startEditor: v, AutoSaveController: se, Toaster: ae, FilterSelectionDrawer: ie, HeaderWrapper: ce, LoadingWrapper: de, SaveAsTemplateDrawer: me, UnsubscribeWrapper: le };
153
+ saveSilent: E,
154
+ setLoading: w
155
+ }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: V, AssignStrategyDrawer: $, RemoveStrategyModal: z, headerWrapperRef: b, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: h, props: a, configStore: o, editorStore: c, previewStore: q, hasChanges: m, isTestPartner: K, isSaveValidationEnabled: j, saveSilent: E, setLoading: w, emit: r, buildMetadata: y, initPlugin: D, preloadRuntime: C, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: J, isRrsEnabled: Q, hasAssignedStrategy: X, insertDynamicContent: R, closeDynamicContent: I, handleDynamicContentOpen: g, ribbonObserver: i, updateRibbonOffset: v, startEditor: S, AutoSaveController: le, Toaster: ue, FilterSelectionDrawer: pe, HeaderWrapper: fe, LoadingWrapper: ye, SaveAsTemplateDrawer: ge, UnsubscribeWrapper: ve, ValidationErrorDrawer: Se };
148
156
  }
149
157
  });
150
158
  export {
151
- ze as default
159
+ Ze as default
152
160
  };
@@ -1,13 +1,14 @@
1
- import { defineComponent as t } from "vue";
2
- import { useAutoSave as r } from "../../composables/useAutoSave.js";
3
- import { useSave as s } from "../../composables/useSave.js";
4
- const f = /* @__PURE__ */ t({
1
+ import { defineComponent as r } from "vue";
2
+ import { useAutoSave as s } from "../../composables/useAutoSave.js";
3
+ import { useSave as n } from "../../composables/useSave.js";
4
+ import { useSaveValidationRollout as u } from "../../composables/useSaveValidationRollout.js";
5
+ const v = /* @__PURE__ */ r({
5
6
  __name: "AutoSaveController",
6
- setup(a) {
7
- const { save: e } = s(), o = () => e(!1, !0);
8
- return r(o), { __sfc: !0, save: e, backgroundSave: o };
7
+ setup(m) {
8
+ const { save: e, saveRawOnly: o } = n(), { isEnabled: t } = u(), a = () => t.value ? o() : e(!1, !0);
9
+ return s(a), { __sfc: !0, save: e, saveRawOnly: o, isEnabled: t, backgroundSave: a };
9
10
  }
10
11
  });
11
12
  export {
12
- f as default
13
+ v as default
13
14
  };
@@ -0,0 +1,21 @@
1
+ import r from "./AssignStrategyDrawer.vue2.js";
2
+ /* empty css */
3
+ /* empty css */
4
+ import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
+ var o = function() {
6
+ var e = this, s = e._self._c, t = e._self._setupProxy;
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, "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
+ r,
12
+ o,
13
+ n,
14
+ !1,
15
+ null,
16
+ "2580a7d9"
17
+ );
18
+ const y = i.exports;
19
+ export {
20
+ y as default
21
+ };
@@ -0,0 +1,106 @@
1
+ import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } from "vue";
2
+ import "@useinsider/design-system-organisms/style";
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({
15
+ __name: "AssignStrategyDrawer",
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) => {
29
+ if (!t)
30
+ return;
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")
36
+ });
37
+ });
38
+ });
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) => ({
46
+ text: t.name,
47
+ value: t.strategy_id,
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 ?? ""));
61
+ return t ? { ...t, fallback_config: null } : null;
62
+ }), w = l(() => ({
63
+ primaryButton: {
64
+ styling: "solid",
65
+ type: "primary",
66
+ labelText: o("products.assign-btn")
67
+ },
68
+ cancelOrBackButton: {
69
+ styling: "ghost",
70
+ type: "secondary",
71
+ labelText: o("products.cancel")
72
+ }
73
+ }));
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: () => {
75
+ e.closeAssignStrategyDrawer();
76
+ }, assignStrategy: async () => {
77
+ const t = d.value;
78
+ if (!t) {
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
+ });
93
+ return;
94
+ }
95
+ e.assignStrategy(t), s({
96
+ type: m.Success,
97
+ message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
98
+ }), e.closeAssignStrategyDrawer();
99
+ }, onSelect: (t) => {
100
+ n.value = t.value, i.value = !1;
101
+ } };
102
+ }
103
+ });
104
+ export {
105
+ W as default
106
+ };