@useinsider/guido 3.19.0-beta.cac604e → 3.19.0-beta.cd75ff0

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 (77) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +39 -37
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +83 -75
  5. package/dist/components/organisms/AutoSaveController.vue2.js +10 -8
  6. package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
  7. package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
  8. package/dist/components/organisms/header/EditorActions.vue.js +5 -5
  9. package/dist/components/organisms/header/EditorActions.vue2.js +83 -46
  10. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
  12. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
  13. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +50 -0
  14. package/dist/components/wrappers/WpDrawer.vue.js +9 -7
  15. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  16. package/dist/components/wrappers/WpModal.vue.js +1 -1
  17. package/dist/components/wrappers/WpModal.vue2.js +4 -3
  18. package/dist/composables/useAuthError.js +52 -0
  19. package/dist/composables/useAutoSave.js +44 -42
  20. package/dist/composables/useHtmlCompiler.js +37 -26
  21. package/dist/composables/useHtmlValidator.js +2 -0
  22. package/dist/composables/useHttp.js +64 -54
  23. package/dist/composables/useLegacyStrategyConversion.js +23 -19
  24. package/dist/composables/useSave.js +92 -45
  25. package/dist/composables/useSaveValidation.js +284 -0
  26. package/dist/composables/useSaveValidationRollout.js +20 -0
  27. package/dist/composables/useStripo.js +24 -20
  28. package/dist/composables/useToaster.js +17 -15
  29. package/dist/composables/validators/useCouponBlockValidator.js +24 -21
  30. package/dist/composables/validators/useLiquidValidator.js +15 -15
  31. package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
  32. package/dist/config/migrator/index.js +14 -13
  33. package/dist/config/migrator/recommendationPartnerMigrator.js +50 -0
  34. package/dist/enums/extensions/recommendationBlock.js +30 -29
  35. package/dist/enums/save-validation.js +4 -0
  36. package/dist/extensions/Blocks/Recommendation/block.js +54 -88
  37. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +32 -51
  38. package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +11 -12
  39. package/dist/guido.css +1 -1
  40. package/dist/services/settingsApi.js +11 -0
  41. package/dist/src/@types/config/schemas.d.ts +4 -0
  42. package/dist/src/@types/save-validation.d.ts +19 -0
  43. package/dist/src/components/Guido.vue.d.ts +17 -1
  44. package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
  45. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
  46. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
  47. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
  48. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
  49. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
  50. package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
  51. package/dist/src/composables/useAuthError.d.ts +12 -0
  52. package/dist/src/composables/useAutoSave.d.ts +4 -1
  53. package/dist/src/composables/useConfig.d.ts +2 -0
  54. package/dist/src/composables/useHtmlValidator.d.ts +21 -0
  55. package/dist/src/composables/useHttp.d.ts +2 -0
  56. package/dist/src/composables/useSave.d.ts +6 -1
  57. package/dist/src/composables/useSaveValidation.d.ts +6 -0
  58. package/dist/src/composables/useSaveValidationRollout.d.ts +4 -0
  59. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  60. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
  61. package/dist/src/config/migrator/index.d.ts +2 -1
  62. package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
  63. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
  64. package/dist/src/enums/save-validation.d.ts +27 -0
  65. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -6
  66. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  67. package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +13 -7
  68. package/dist/src/services/settingsApi.d.ts +6 -0
  69. package/dist/src/stores/config.d.ts +32 -0
  70. package/dist/src/stores/save-validation.d.ts +22 -0
  71. package/dist/src/stores/setup-settings.d.ts +4 -0
  72. package/dist/src/utils/templatePreparation.d.ts +30 -0
  73. package/dist/stores/config.js +84 -67
  74. package/dist/stores/save-validation.js +30 -0
  75. package/dist/stores/setup-settings.js +10 -0
  76. package/dist/utils/templatePreparation.js +39 -36
  77. package/package.json +1 -1
package/README.md CHANGED
@@ -164,6 +164,7 @@ const config: GuidoConfigInput = {
164
164
  liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
165
165
  autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
166
166
  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).
167
+ allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
167
168
  reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
168
169
  },
169
170
 
@@ -1,4 +1,4 @@
1
- import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
1
+ import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
2
2
  import { object as a, number as s, optional as e, string as t, picklist as m, pipe as i, minLength as b, custom as k, boolean as o, array as c, transform as y, unknown as r, record as g, fallback as R, literal as u, looseObject as C, variant as I, union as h, lazy as T } from "../../node_modules/valibot/dist/index.js";
3
3
  const p = {
4
4
  /** Promotional/marketing emails */
@@ -38,7 +38,7 @@ const p = {
38
38
  name: t(),
39
39
  /** Fallback font family (e.g., "serif" or "sans-serif") */
40
40
  family: t()
41
- }), M = a({
41
+ }), E = a({
42
42
  /** Partner/organization name (required) */
43
43
  name: i(
44
44
  t(),
@@ -62,7 +62,7 @@ const p = {
62
62
  username: e(t(), "Guido User"),
63
63
  /** Fallback font settings from partner settings — used to match backend size calculation */
64
64
  fallbackFont: e(L)
65
- }), E = a({
65
+ }), M = a({
66
66
  /** Display text for the dynamic content */
67
67
  text: t(),
68
68
  /** Template variable value (e.g., {{username}}) */
@@ -76,17 +76,17 @@ const p = {
76
76
  value: t()
77
77
  })
78
78
  )
79
- }), f = T(() => C({
79
+ }), S = T(() => C({
80
80
  text: e(t()),
81
81
  // eslint-disable-next-line camelcase -- backend field name
82
82
  tag_text: e(t()),
83
83
  value: e(t()),
84
- children: e(c(f)),
84
+ children: e(c(S)),
85
85
  // eslint-disable-next-line camelcase -- backend field name
86
- select_items: e(c(f))
86
+ select_items: e(c(S))
87
87
  })), N = g(
88
88
  t(),
89
- R(c(f), [])
89
+ R(c(S), [])
90
90
  ), P = C({
91
91
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
92
92
  id: e(s()),
@@ -132,7 +132,7 @@ const p = {
132
132
  isPriceMovedToNextLine: e(o()),
133
133
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
134
134
  isPriceDeletedForZeroSale: e(o())
135
- }), x = a({
135
+ }), v = a({
136
136
  /**
137
137
  * Legacy recommendation block configs keyed by block ID.
138
138
  * Pass this when loading a template authored with the v1
@@ -143,14 +143,14 @@ const p = {
143
143
  g(t(), P),
144
144
  {}
145
145
  )
146
- }), D = a({
146
+ }), x = a({
147
147
  /** Initial HTML content */
148
148
  html: e(t(), ""),
149
149
  /** Initial CSS content */
150
150
  css: e(t(), ""),
151
151
  /** Preselected dynamic content items */
152
152
  preselectedDynamicContent: e(
153
- c(E),
153
+ c(M),
154
154
  []
155
155
  ),
156
156
  /**
@@ -194,13 +194,13 @@ const p = {
194
194
  )
195
195
  ),
196
196
  /** Migration-only inputs (legacy block configs) */
197
- migration: e(x, {})
198
- }), O = a({
197
+ migration: e(v, {})
198
+ }), D = a({
199
199
  /** Sender display name */
200
200
  senderName: e(t(), ""),
201
201
  /** Email subject line */
202
202
  subject: e(t(), "")
203
- }), v = a({
203
+ }), O = a({
204
204
  /** Locale for the editor UI */
205
205
  locale: e(t(), "en"),
206
206
  /** Path to translations object */
@@ -208,11 +208,11 @@ const p = {
208
208
  /** Migration date for template compatibility */
209
209
  migrationDate: e(s(), 1759696858),
210
210
  /** Email header settings */
211
- emailHeader: e(O, { senderName: "", subject: "" }),
211
+ emailHeader: e(D, { senderName: "", subject: "" }),
212
212
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
213
- savedModulesFolderName: e(t(), S.SAVED_MODULES),
213
+ savedModulesFolderName: e(t(), f.SAVED_MODULES),
214
214
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
215
- defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
215
+ defaultModulesFolderName: e(t(), f.DEFAULT_MODULES)
216
216
  }), F = a({
217
217
  /** Whether to show the header bar */
218
218
  showHeader: e(o(), !0),
@@ -241,8 +241,10 @@ const p = {
241
241
  allowlistEnabled: e(o(), !1),
242
242
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
243
243
  linkTrackingIds: e(o(), !1),
244
+ /** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
245
+ allowSaveWithErrors: e(o(), !0),
244
246
  reusableRecommendationStrategy: e(o(), !1)
245
- }), B = m([
247
+ }), w = m([
246
248
  "amp-accordion",
247
249
  "amp-carousel",
248
250
  "amp-form-controls",
@@ -256,7 +258,7 @@ const p = {
256
258
  "text-block",
257
259
  "timer-block",
258
260
  "video-block"
259
- ]), w = m([
261
+ ]), B = m([
260
262
  "dynamic-content",
261
263
  "checkbox-block",
262
264
  "radio-button-block",
@@ -267,12 +269,12 @@ const p = {
267
269
  ]), j = a({
268
270
  /** Default blocks to exclude from the editor */
269
271
  excludeDefaults: e(
270
- c(B),
272
+ c(w),
271
273
  []
272
274
  ),
273
275
  /** Custom blocks to include in the editor */
274
276
  includeCustoms: e(
275
- c(w),
277
+ c(B),
276
278
  []
277
279
  )
278
280
  }), d = a({
@@ -323,7 +325,7 @@ const p = {
323
325
  customRules: e(c(V), []),
324
326
  /** Skip default compiler rules */
325
327
  ignoreDefaultRules: e(o(), !1)
326
- }), Z = a({
328
+ }), W = a({
327
329
  /**
328
330
  * External validation handler called before save completes.
329
331
  * Return false to cancel the save operation.
@@ -334,17 +336,17 @@ const p = {
334
336
  "externalValidation must be a function"
335
337
  )
336
338
  )
337
- }), Q = a({
339
+ }), K = a({
338
340
  // Required sections
339
341
  /** Identity configuration (required) */
340
342
  identity: A,
341
343
  /** Partner configuration (required) */
342
- partner: M,
344
+ partner: E,
343
345
  // Optional sections (with defaults)
344
346
  /** Template content and presets */
345
- template: e(D, {}),
347
+ template: e(x, {}),
346
348
  /** Editor settings */
347
- editor: e(v, {}),
349
+ editor: e(O, {}),
348
350
  /** UI configuration */
349
351
  ui: e(F, {}),
350
352
  /** Feature toggles */
@@ -354,33 +356,33 @@ const p = {
354
356
  /** Compiler configuration */
355
357
  compiler: e(z, {}),
356
358
  /** Callbacks and event handlers */
357
- callbacks: e(Z, {})
359
+ callbacks: e(W, {})
358
360
  });
359
361
  export {
360
362
  j as BlocksSchema,
361
- Z as CallbacksSchema,
363
+ W as CallbacksSchema,
362
364
  V as CompilerRuleSchema,
363
365
  z as CompilerSchema,
364
- w as CustomBlockTypeSchema,
366
+ B as CustomBlockTypeSchema,
365
367
  G as CustomRuleSchema,
366
- B as DefaultBlockTypeSchema,
368
+ w as DefaultBlockTypeSchema,
367
369
  N as DynamicContentListSchema,
368
- f as DynamicContentNodeSchema,
369
- E as DynamicContentSchema,
370
- v as EditorSchema,
371
- O as EmailHeaderSchema,
370
+ S as DynamicContentNodeSchema,
371
+ M as DynamicContentSchema,
372
+ O as EditorSchema,
373
+ D as EmailHeaderSchema,
372
374
  L as FallbackFontSchema,
373
375
  U as FeaturesSchema,
374
- Q as GuidoConfigSchema,
376
+ K as GuidoConfigSchema,
375
377
  A as IdentitySchema,
376
378
  P as LegacyRecommendationConfigSchema,
377
379
  p as MessageType,
378
- M as PartnerSchema,
380
+ E as PartnerSchema,
379
381
  l as ProductType,
380
382
  _ as RegexRuleSchema,
381
383
  q as RemoveRuleSchema,
382
384
  H as ReplaceRuleSchema,
383
- x as TemplateMigrationSchema,
384
- D as TemplateSchema,
385
+ v as TemplateMigrationSchema,
386
+ x as TemplateSchema,
385
387
  F as UISchema
386
388
  };
@@ -3,7 +3,7 @@ import o from "./Guido.vue2.js";
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
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(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
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.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : 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
9
  }, s = [], n = /* @__PURE__ */ i(
@@ -12,9 +12,9 @@ var t = function() {
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "36867e2e"
15
+ "8c74109f"
16
16
  );
17
- const g = n.exports;
17
+ const v = n.exports;
18
18
  export {
19
- g as default
19
+ v as default
20
20
  };
@@ -1,57 +1,61 @@
1
- import { defineComponent as re, defineAsyncComponent as m, ref as O, computed as u, watch as x, onMounted as se, onUnmounted as ae } from "vue";
2
- import { useCortexBlueprintBridge as ie } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as ce } from "../composables/useEditorLock.js";
4
- import { provideGuidoActions as de } from "../composables/useGuidoActions.js";
5
- import { useGuidoStateBridge as me } from "../composables/useGuidoStateBridge.js";
6
- import { usePartner as le } from "../composables/usePartner.js";
7
- import { useStripo as ue } from "../composables/useStripo.js";
8
- import { useTimerClone as pe } from "../composables/useTimerClone.js";
9
- import { migrate as W } from "../config/migrator/index.js";
10
- import { ModuleFolderDefaults as G } from "../enums/defaults.js";
11
- import { RIBBON_SELECTOR as fe } from "../enums/onboarding.js";
1
+ import { defineComponent as ie, defineAsyncComponent as m, ref as W, computed as u, watch as G, onMounted as ce, onUnmounted as de } from "vue";
2
+ import { useCortexBlueprintBridge as me } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as le } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as ue } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as pe } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as fe } from "../composables/usePartner.js";
7
+ import { useSaveValidationRollout as ye } from "../composables/useSaveValidationRollout.js";
8
+ import { useStripo as ge } from "../composables/useStripo.js";
9
+ import { useTimerClone as Se } from "../composables/useTimerClone.js";
10
+ import { migrate as V } from "../config/migrator/index.js";
11
+ import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
12
+ import { RIBBON_SELECTOR as ve } from "../enums/onboarding.js";
12
13
  import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
- import ye from "./organisms/AutoSaveController.vue.js";
14
- import ge from "./organisms/base/Toaster.vue.js";
15
- import ve from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
- import Se from "./organisms/header/HeaderWrapper.vue.js";
17
- import be from "./organisms/LoadingWrapper.vue.js";
18
- import he from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import Ee from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import { useStripoApi as we } from "../services/stripoApi.js";
21
- import { useConfigStore as Ce } from "../stores/config.js";
22
- import { useDynamicContentStore as De } from "../stores/dynamic-content.js";
14
+ import be from "./organisms/AutoSaveController.vue.js";
15
+ import he from "./organisms/base/AuthErrorModal.vue.js";
16
+ import Ee from "./organisms/base/Toaster.vue.js";
17
+ import we from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
18
+ import De from "./organisms/header/HeaderWrapper.vue.js";
19
+ import Ce from "./organisms/LoadingWrapper.vue.js";
20
+ import ke from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
21
+ import Re from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
22
+ import Fe from "./organisms/validation/ValidationErrorDrawer.vue.js";
23
+ import { useStripoApi as Me } from "../services/stripoApi.js";
24
+ import { useConfigStore as Te } from "../stores/config.js";
25
+ import { useDynamicContentStore as Ie } from "../stores/dynamic-content.js";
23
26
  import { useEditorStore as H } from "../stores/editor.js";
24
- import { usePreviewStore as ke } from "../stores/preview.js";
25
- import { useTemplateStore as Te } from "../stores/template.js";
26
- import { useUnsubscribeStore as Fe } from "../stores/unsubscribe.js";
27
- import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
28
- const tt = /* @__PURE__ */ re({
27
+ import { usePreviewStore as Le } from "../stores/preview.js";
28
+ import { useSaveValidationStore as Ue } from "../stores/save-validation.js";
29
+ import { useTemplateStore as Ae } from "../stores/template.js";
30
+ import { useUnsubscribeStore as Be } from "../stores/unsubscribe.js";
31
+ import { readTrackFloor as z } from "../utils/linkTrackingIds.js";
32
+ const ut = /* @__PURE__ */ ie({
29
33
  __name: "Guido",
30
34
  props: {
31
35
  config: null,
32
36
  ready: { type: Boolean, default: !0 }
33
37
  },
34
38
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
35
- setup(z, { expose: q, emit: r }) {
36
- const a = z, K = m(
39
+ setup(q, { expose: K, emit: r }) {
40
+ const s = q, j = m(
37
41
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
- ), V = m(
42
+ ), J = m(
39
43
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
- ), j = m(
44
+ ), Q = m(
41
45
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
42
- ), J = m(
46
+ ), X = m(
43
47
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
44
- ), Q = m(
48
+ ), Y = m(
45
49
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
46
- ), E = O(), p = O(), f = De(), w = Fe(), o = Ce();
47
- a.ready && o.init(a.config);
48
- const c = H(), X = ke(), l = u(() => c.hasChanges), { isTestPartner: Y } = le(), C = () => {
50
+ ), E = W(), p = W(), f = Ie(), w = Be(), o = Te();
51
+ s.ready && o.init(s.config);
52
+ const c = H(), Z = Le(), l = u(() => c.hasChanges), { isTestPartner: ee } = fe(), { isEnabled: te, loadRollout: D } = ye(), C = () => {
49
53
  var t;
50
54
  return (t = E.value) == null ? void 0 : t.handleSave(!0);
51
- }, D = (t) => {
55
+ }, k = (t) => {
52
56
  c.loadingStatus = t;
53
57
  };
54
- ie(), me();
58
+ me(), pe();
55
59
  const y = () => {
56
60
  var t, e;
57
61
  return {
@@ -59,18 +63,18 @@ const tt = /* @__PURE__ */ re({
59
63
  userId: o.userId,
60
64
  username: o.username,
61
65
  partnerName: o.partnerName,
62
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
63
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
66
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
67
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
64
68
  };
65
- }, { initPlugin: k, preloadRuntime: T } = ue(), { runExclusive: F, beginMount: M, isCurrentMount: R } = ce();
69
+ }, { initPlugin: R, preloadRuntime: F } = ge(), { runExclusive: M, beginMount: T, isCurrentMount: I } = le();
66
70
  let g = 0;
67
- const { getDefaultTemplate: I } = we(), { cloneTimersOnSave: L, hasTimerBlocks: B } = pe(), Z = u(() => {
71
+ const { getDefaultTemplate: L } = Me(), { cloneTimersOnSave: U, hasTimerBlocks: A } = Se(), oe = u(() => {
68
72
  var t;
69
73
  return !((t = o.ui) != null && t.showHeader);
70
- }), ee = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), te = u(
74
+ }), ne = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = u(
71
75
  () => !!h().recommendationConfigs.strategyId
72
76
  );
73
- de({
77
+ ue({
74
78
  onBack: () => {
75
79
  console.debug("guido:back"), r("back");
76
80
  },
@@ -85,80 +89,84 @@ const tt = /* @__PURE__ */ re({
85
89
  console.debug("guido:test-email:click"), r("test-email:click");
86
90
  }
87
91
  });
88
- const U = (t) => {
92
+ const B = (t) => {
89
93
  console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
90
- }, A = () => {
94
+ }, N = () => {
91
95
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
92
96
  };
93
- x(() => l.value, () => {
97
+ G(() => l.value, () => {
94
98
  r("on-change", l.value);
95
99
  });
96
- const v = (t) => {
97
- const e = t, { attribute: s, position: d } = e.detail;
98
- console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
100
+ const S = (t) => {
101
+ const e = t, { attribute: a, position: d } = e.detail;
102
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, d);
99
103
  };
100
104
  let i = null;
101
- const S = () => {
105
+ const v = () => {
102
106
  var e;
103
- const t = document.querySelector(fe);
107
+ const t = document.querySelector(ve);
104
108
  (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
105
109
  }, b = async () => {
106
110
  var t;
107
111
  try {
108
- o.initialized || o.init(a.config), c.templateId = o.templateId;
109
- const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
112
+ o.initialized || o.init(s.config), c.templateId = o.templateId;
113
+ const e = o.template, a = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
110
114
  w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
111
- const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, N = o.isFeatureEnabled("linkTrackingIds");
115
+ const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds"), x = {
116
+ partnerName: o.partnerName,
117
+ campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
118
+ rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
119
+ };
112
120
  let n = {
113
- html: s && await W(s, _),
121
+ html: a && await V(a, _, x),
114
122
  css: d
115
123
  };
116
- n.html || (n = await I(), n.html = await W(n.html, _));
117
- const oe = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
118
- B(n.html) && (n.html = await L(n.html)), N && (c.trackIdSessionFloor = Math.max(oe, $(n.html)));
119
- const ne = {
124
+ n.html || (n = await L(), n.html = await V(n.html, _, x));
125
+ const ae = O ? z(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
126
+ A(n.html) && (n.html = await U(n.html)), O && (c.trackIdSessionFloor = Math.max(ae, z(n.html)));
127
+ const se = {
120
128
  preselectedDynamicContentList: P,
121
129
  onReady: () => {
122
130
  console.debug("guido:ready"), r("ready");
123
131
  }
124
132
  };
125
- g = M(), await k(n, y(), ne), f.selectedDynamicContentList = P;
133
+ g = T(), await R(n, y(), se), f.selectedDynamicContentList = P;
126
134
  } catch (e) {
127
135
  console.error("Failed to initialize Stripo editor:", e);
128
136
  }
129
137
  };
130
- return se(async () => {
138
+ return ce(async () => {
131
139
  var e;
132
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), H().$reset(), Te().$reset(), S();
140
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), H().$reset(), Ae().$reset(), Ue().$reset(), D(), v();
133
141
  const t = (e = p.value) == null ? void 0 : e.parentElement;
134
- if (t && (i = new ResizeObserver(S), i.observe(t)), T(), a.ready)
142
+ if (t && (i = new ResizeObserver(v), i.observe(t)), F(), s.ready)
135
143
  await b();
136
144
  else {
137
- const s = x(() => a.ready, (d) => {
138
- d && (s(), b());
145
+ const a = G(() => s.ready, (d) => {
146
+ d && (a(), b());
139
147
  });
140
148
  }
141
- document.addEventListener("dynamic-content:open", v);
142
- }), ae(() => {
143
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), h().disposeStrategyPageReturn(), F(async () => {
144
- if (R(g))
149
+ document.addEventListener("dynamic-content:open", S);
150
+ }), de(() => {
151
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", S), h().disposeStrategyPageReturn(), M(async () => {
152
+ if (I(g))
145
153
  try {
146
154
  window.UIEditor.removeEditor();
147
155
  } catch {
148
156
  console.debug("Failed to remove Stripo editor: No editor found");
149
157
  }
150
158
  }), o.reset();
151
- }), q({
159
+ }), K({
152
160
  dynamicContent: {
153
- insert: U,
154
- close: A
161
+ insert: B,
162
+ close: N
155
163
  },
156
164
  hasChanges: l,
157
165
  saveSilent: C,
158
- setLoading: D
159
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, LegacyStrategyUpdatedModal: Q, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: a, configStore: o, editorStore: c, previewStore: X, hasChanges: l, isTestPartner: Y, saveSilent: C, setLoading: D, emit: r, buildMetadata: y, initPlugin: k, preloadRuntime: T, runExclusive: F, beginMount: M, isCurrentMount: R, mountGeneration: g, getDefaultTemplate: I, cloneTimersOnSave: L, hasTimerBlocks: B, noHeader: Z, isRrsEnabled: ee, hasAssignedStrategy: te, insertDynamicContent: U, closeDynamicContent: A, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: ye, Toaster: ge, FilterSelectionDrawer: ve, HeaderWrapper: Se, LoadingWrapper: be, SaveAsTemplateDrawer: he, UnsubscribeWrapper: Ee };
166
+ setLoading: k
167
+ }), { __sfc: !0, PreviewContainer: j, OnboardingWrapper: J, AssignStrategyDrawer: Q, RemoveStrategyModal: X, LegacyStrategyUpdatedModal: Y, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: s, configStore: o, editorStore: c, previewStore: Z, hasChanges: l, isTestPartner: ee, isSaveValidationEnabled: te, loadRollout: D, saveSilent: C, setLoading: k, emit: r, buildMetadata: y, initPlugin: R, preloadRuntime: F, runExclusive: M, beginMount: T, isCurrentMount: I, mountGeneration: g, getDefaultTemplate: L, cloneTimersOnSave: U, hasTimerBlocks: A, noHeader: oe, isRrsEnabled: ne, hasAssignedStrategy: re, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: S, ribbonObserver: i, updateRibbonOffset: v, startEditor: b, AutoSaveController: be, AuthErrorModal: he, Toaster: Ee, FilterSelectionDrawer: we, HeaderWrapper: De, LoadingWrapper: Ce, SaveAsTemplateDrawer: ke, UnsubscribeWrapper: Re, ValidationErrorDrawer: Fe };
160
168
  }
161
169
  });
162
170
  export {
163
- tt as default
171
+ ut as default
164
172
  };
@@ -1,13 +1,15 @@
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 n } from "vue";
2
+ import { useAutoSave as u } from "../../composables/useAutoSave.js";
3
+ import { useSave as i } from "../../composables/useSave.js";
4
+ import { useSaveValidationRollout as l } from "../../composables/useSaveValidationRollout.js";
5
+ import { useConfigStore as m } from "../../stores/config.js";
6
+ const d = /* @__PURE__ */ n({
5
7
  __name: "AutoSaveController",
6
- setup(a) {
7
- const { save: e } = s(), o = () => e(!1, !0);
8
- return r(o), { __sfc: !0, save: e, backgroundSave: o };
8
+ setup(f) {
9
+ const { save: e, saveRawOnly: t } = i(), { isEnabled: r } = l(), a = m(), o = () => r.value && a.allowSaveWithErrors, s = () => o() ? t() : e(!1, !0);
10
+ return u(s, { clearsChanges: () => !o() }), { __sfc: !0, save: e, saveRawOnly: t, isEnabled: r, configStore: a, isRawAutosave: o, backgroundSave: s };
9
11
  }
10
12
  });
11
13
  export {
12
- f as default
14
+ d as default
13
15
  };
@@ -0,0 +1,18 @@
1
+ import e from "./AuthErrorModal.vue2.js";
2
+ /* empty css */
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var o = this, r = o._self._c, t = o._self._setupProxy;
6
+ return t.authError ? r("div", { staticClass: "auth-error-modal" }, [r(t.WpModal, { attrs: { id: "guido__auth-error-modal", state: "warning", "close-button-status": !1, "close-on-outside-click": !1, "footer-button-options": t.footerButtonOptions, title: t.title }, on: { close: t.dismiss, "primary-action": t.recover } }, [r("p", [o._v(o._s(t.message))])])], 1) : o._e();
7
+ }, n = [], i = /* @__PURE__ */ s(
8
+ e,
9
+ a,
10
+ n,
11
+ !1,
12
+ null,
13
+ "b4d7ae51"
14
+ );
15
+ const m = i.exports;
16
+ export {
17
+ m as default
18
+ };
@@ -0,0 +1,42 @@
1
+ import { defineComponent as c, computed as n } from "vue";
2
+ import p from "../../wrappers/WpModal.vue.js";
3
+ import { useAuthError as d } from "../../../composables/useAuthError.js";
4
+ import { useTranslations as m } from "../../../composables/useTranslations.js";
5
+ const _ = /* @__PURE__ */ c({
6
+ __name: "AuthErrorModal",
7
+ setup(v) {
8
+ const e = m(), { authError: t } = d(), r = n(() => {
9
+ var o;
10
+ return ((o = t.value) == null ? void 0 : o.status) === 419 && t.value.data !== null;
11
+ }), s = n(() => {
12
+ var o;
13
+ return ((o = t.value) == null ? void 0 : o.status) === 419 && t.value.data === null;
14
+ }), i = n(() => r.value ? e("integration-hub.reload-this-page") : e("action-builder.session-expired")), u = n(() => r.value ? e("auth.error-occurred-refresh") : s.value ? e("settings.session-on-another-device") : e("journey-builder.login-session-expired")), l = n(() => ({
15
+ primaryButton: {
16
+ type: "primary",
17
+ labelText: r.value ? e("integration-hub.reload") : e("journey-builder.login-popup-button")
18
+ },
19
+ cancelOrBackButton: {
20
+ type: "secondary",
21
+ styling: "ghost",
22
+ labelText: e("settings.cancel")
23
+ }
24
+ })), a = () => {
25
+ if (r.value) {
26
+ window.location.reload();
27
+ return;
28
+ }
29
+ window.location.replace("/");
30
+ };
31
+ return { __sfc: !0, trans: e, authError: t, isPageExpired: r, isTakenOver: s, title: i, message: u, footerButtonOptions: l, recover: a, dismiss: () => {
32
+ if (r.value) {
33
+ t.value = null;
34
+ return;
35
+ }
36
+ a();
37
+ }, WpModal: p };
38
+ }
39
+ });
40
+ export {
41
+ _ as default
42
+ };
@@ -4,20 +4,20 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var u = function() {
5
5
  var s, i, n, a;
6
6
  var o = this, e = o._self._c, t = o._self._setupProxy;
7
- return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
7
+ return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "label-text": t.saveLabel, "loading-status": t.isSaving }, on: { click: function(r) {
8
8
  return t.handleSave(!1);
9
9
  } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
10
10
  return t.executeSave(!1);
11
11
  } } })], 1);
12
- }, c = [], p = /* @__PURE__ */ d(
12
+ }, p = [], c = /* @__PURE__ */ d(
13
13
  l,
14
14
  u,
15
- c,
15
+ p,
16
16
  !1,
17
17
  null,
18
- "c61cc8ea"
18
+ "baf7a5dd"
19
19
  );
20
- const v = p.exports;
20
+ const v = c.exports;
21
21
  export {
22
22
  v as default
23
23
  };