@useinsider/guido 3.20.1 → 3.21.0-beta.1bd7edd

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 (109) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +41 -39
  3. package/dist/@types/display-condition.js +25 -0
  4. package/dist/components/Guido.vue.js +6 -6
  5. package/dist/components/Guido.vue2.js +86 -83
  6. package/dist/components/organisms/AutoSaveController.vue2.js +10 -9
  7. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +20 -0
  8. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +30 -0
  9. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
  10. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +71 -0
  11. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +34 -0
  12. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +57 -0
  13. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
  14. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
  15. package/dist/components/organisms/header/EditorActions.vue.js +4 -4
  16. package/dist/components/organisms/header/EditorActions.vue2.js +53 -51
  17. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
  18. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +23 -22
  19. package/dist/composables/useAutoSave.js +46 -44
  20. package/dist/composables/useBlocksConfig.js +32 -24
  21. package/dist/composables/useDisplayConditions.js +102 -0
  22. package/dist/composables/useLegacyStrategyConversion.js +16 -16
  23. package/dist/composables/useSave.js +26 -23
  24. package/dist/composables/useSaveValidation.js +113 -114
  25. package/dist/composables/useSaveValidationRollout.js +17 -6
  26. package/dist/composables/useStripo.js +4 -3
  27. package/dist/enums/academy.js +1 -0
  28. package/dist/enums/display-condition.js +12 -0
  29. package/dist/extensions/Blocks/Items/block.js +43 -42
  30. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +296 -223
  31. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +221 -203
  32. package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +19 -0
  33. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +51 -36
  34. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +31 -35
  35. package/dist/extensions/Blocks/Unsubscribe/block.js +70 -75
  36. package/dist/extensions/DisplayConditions/bridge.js +17 -0
  37. package/dist/extensions/DisplayConditions/constants.js +17 -0
  38. package/dist/extensions/DisplayConditions/control.js +178 -0
  39. package/dist/extensions/DisplayConditions/display-conditions.css.js +201 -0
  40. package/dist/extensions/DisplayConditions/extension.js +28 -0
  41. package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
  42. package/dist/extensions/DisplayConditions/library.js +27 -0
  43. package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
  44. package/dist/guido.css +1 -1
  45. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +272 -192
  46. package/dist/node_modules/valibot/dist/index.js +297 -261
  47. package/dist/package.json.js +1 -1
  48. package/dist/services/displayConditionApi.js +39 -0
  49. package/dist/services/settingsApi.js +11 -0
  50. package/dist/src/@types/config/schemas.d.ts +4 -0
  51. package/dist/src/@types/display-condition.d.ts +59 -0
  52. package/dist/src/components/Guido.vue.d.ts +1 -1
  53. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
  54. package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +2 -0
  55. package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +2 -0
  56. package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
  57. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  58. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  59. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  60. package/dist/src/composables/useAutoSave.d.ts +4 -1
  61. package/dist/src/composables/useConfig.d.ts +2 -0
  62. package/dist/src/composables/useDisplayConditions.d.ts +16 -0
  63. package/dist/src/composables/useSaveValidationRollout.d.ts +1 -0
  64. package/dist/src/enums/academy.d.ts +1 -0
  65. package/dist/src/enums/display-condition.d.ts +15 -0
  66. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
  67. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
  68. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
  69. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
  70. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
  71. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
  72. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
  73. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
  74. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +18 -3
  75. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
  76. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
  77. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
  78. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
  79. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
  80. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
  81. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +9 -1
  82. package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +17 -0
  83. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +7 -0
  84. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +1 -6
  85. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
  86. package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
  87. package/dist/src/extensions/DisplayConditions/bridge.d.ts +6 -0
  88. package/dist/src/extensions/DisplayConditions/constants.d.ts +14 -0
  89. package/dist/src/extensions/DisplayConditions/control.d.ts +23 -0
  90. package/dist/src/extensions/DisplayConditions/extension.d.ts +2 -0
  91. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +4 -0
  92. package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
  93. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
  94. package/dist/src/mock/api/display-conditions.d.ts +2 -0
  95. package/dist/src/services/displayConditionApi.d.ts +8 -0
  96. package/dist/src/services/settingsApi.d.ts +6 -0
  97. package/dist/src/stores/config.d.ts +166 -0
  98. package/dist/src/stores/display-condition.d.ts +81 -0
  99. package/dist/src/stores/setup-settings.d.ts +4 -0
  100. package/dist/src/utils/displayCondition.d.ts +10 -0
  101. package/dist/src/utils/protectTableText.d.ts +2 -0
  102. package/dist/static/styles/components/button.css.js +5 -0
  103. package/dist/stores/config.js +13 -6
  104. package/dist/stores/display-condition.js +28 -0
  105. package/dist/stores/setup-settings.js +10 -0
  106. package/dist/utils/displayCondition.js +26 -0
  107. package/dist/utils/pairProductVariables.js +15 -14
  108. package/dist/utils/protectTableText.js +22 -0
  109. package/package.json +4 -4
package/README.md CHANGED
@@ -150,6 +150,7 @@ const config: GuidoConfigInput = {
150
150
  ui?: {
151
151
  showHeader?: boolean, // Default: true
152
152
  backButtonLabel?: string,
153
+ externalDisplayConditions?: boolean, // Default: false - Replace Stripo's display-condition UI with a Conditions tab in the settings panel and create/select drawers for reusable Liquid/Pongo display conditions.
153
154
  },
154
155
 
155
156
  // Optional: Feature toggles (defaults apply once initialized — see `ready` prop below)
@@ -1,5 +1,5 @@
1
- import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
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";
1
+ import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
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 n, 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 */
5
5
  PROMOTIONAL: 1,
@@ -76,30 +76,30 @@ const p = {
76
76
  value: t()
77
77
  })
78
78
  )
79
- }), S = T(() => C({
79
+ }), f = 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(S)),
84
+ children: e(n(f)),
85
85
  // eslint-disable-next-line camelcase -- backend field name
86
- select_items: e(c(S))
87
- })), N = g(
86
+ select_items: e(n(f))
87
+ })), x = g(
88
88
  t(),
89
- R(c(S), [])
90
- ), P = C({
89
+ R(n(f), [])
90
+ ), D = C({
91
91
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
92
92
  id: e(s()),
93
93
  /** Decimal places for price display (legacy data may use string or number) */
94
94
  decimalCount: e(h([t(), s()])),
95
95
  /** Pinned product IDs (empty array when filter-driven) */
96
- productIds: e(c(r())),
96
+ productIds: e(n(r())),
97
97
  /** Whether the block requested live products at send time */
98
98
  sendProductRequestFlag: e(o()),
99
99
  /** Whether to randomize product order */
100
100
  shuffleProducts: e(o()),
101
101
  /** Filter rules driving product selection */
102
- filters: e(c(r())),
102
+ filters: e(n(r())),
103
103
  /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
104
104
  currency: e(t()),
105
105
  /** Currency display settings (separators, alignment, decimals) */
@@ -109,7 +109,7 @@ const p = {
109
109
  /** Recommendation strategy key (e.g. 'newArrivals') */
110
110
  strategy: e(t()),
111
111
  /** Snapshot of products as rendered by the legacy block */
112
- recommendedProducts: e(c(r())),
112
+ recommendedProducts: e(n(r())),
113
113
  /** Number of product cards per row */
114
114
  cardsInRow: e(s()),
115
115
  /** Mobile-only padding (right) */
@@ -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
- }), v = a({
135
+ }), N = 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
@@ -140,17 +140,17 @@ const p = {
140
140
  * strategy, currency, locale, and layout data.
141
141
  */
142
142
  recommendationConfigs: e(
143
- g(t(), P),
143
+ g(t(), D),
144
144
  {}
145
145
  )
146
- }), x = a({
146
+ }), P = 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(M),
153
+ n(M),
154
154
  []
155
155
  ),
156
156
  /**
@@ -159,11 +159,11 @@ const p = {
159
159
  * (first) partner's leaf attributes into the label→token map that repairs
160
160
  * label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
161
161
  */
162
- dynamicContentList: e(N, {}),
162
+ dynamicContentList: e(x, {}),
163
163
  /** Valid custom field attribute names from the partner's categorized fields */
164
- customFieldAttributes: e(c(t()), []),
164
+ customFieldAttributes: e(n(t()), []),
165
165
  /** Selected unsubscribe page IDs */
166
- selectedUnsubscribePages: e(c(s()), []),
166
+ selectedUnsubscribePages: e(n(s()), []),
167
167
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
168
168
  forceRecreate: e(o(), !1),
169
169
  /**
@@ -176,7 +176,7 @@ const p = {
176
176
  trackIdCounter: e(
177
177
  i(
178
178
  s(),
179
- y((n) => Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 0)
179
+ y((c) => Number.isFinite(c) ? Math.max(0, Math.floor(c)) : 0)
180
180
  ),
181
181
  0
182
182
  ),
@@ -190,12 +190,12 @@ const p = {
190
190
  recommendationCampaignUrls: e(
191
191
  i(
192
192
  r(),
193
- y((n) => n && typeof n == "object" ? { ...n } : void 0)
193
+ y((c) => c && typeof c == "object" ? { ...c } : void 0)
194
194
  )
195
195
  ),
196
196
  /** Migration-only inputs (legacy block configs) */
197
- migration: e(v, {})
198
- }), D = a({
197
+ migration: e(N, {})
198
+ }), v = a({
199
199
  /** Sender display name */
200
200
  senderName: e(t(), ""),
201
201
  /** Email subject line */
@@ -208,16 +208,18 @@ const p = {
208
208
  /** Migration date for template compatibility */
209
209
  migrationDate: e(s(), 1759696858),
210
210
  /** Email header settings */
211
- emailHeader: e(D, { senderName: "", subject: "" }),
211
+ emailHeader: e(v, { senderName: "", subject: "" }),
212
212
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
213
- savedModulesFolderName: e(t(), f.SAVED_MODULES),
213
+ savedModulesFolderName: e(t(), S.SAVED_MODULES),
214
214
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
215
- defaultModulesFolderName: e(t(), f.DEFAULT_MODULES)
215
+ defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
216
216
  }), F = a({
217
217
  /** Whether to show the header bar */
218
218
  showHeader: e(o(), !0),
219
219
  /** Custom label for back button (if shown) */
220
- backButtonLabel: e(t())
220
+ backButtonLabel: e(t()),
221
+ /** Replace Stripo's display-condition UI with the Conditions tab and create/select drawers */
222
+ externalDisplayConditions: e(o(), !1)
221
223
  }), U = a({
222
224
  /** Enable dynamic content insertion */
223
225
  dynamicContent: e(o(), !0),
@@ -269,12 +271,12 @@ const p = {
269
271
  ]), j = a({
270
272
  /** Default blocks to exclude from the editor */
271
273
  excludeDefaults: e(
272
- c(w),
274
+ n(w),
273
275
  []
274
276
  ),
275
277
  /** Custom blocks to include in the editor */
276
278
  includeCustoms: e(
277
- c(B),
279
+ n(B),
278
280
  []
279
281
  )
280
282
  }), d = a({
@@ -306,13 +308,13 @@ const p = {
306
308
  ...d.entries,
307
309
  type: u("remove"),
308
310
  /** Strings or patterns to remove */
309
- targets: c(t())
311
+ targets: n(t())
310
312
  }), G = a({
311
313
  ...d.entries,
312
314
  type: u("custom"),
313
315
  /** Custom processor function */
314
316
  processor: k(
315
- (n) => typeof n == "function",
317
+ (c) => typeof c == "function",
316
318
  "processor must be a function"
317
319
  )
318
320
  }), V = I("type", [
@@ -322,7 +324,7 @@ const p = {
322
324
  G
323
325
  ]), z = a({
324
326
  /** Custom compiler rules to apply */
325
- customRules: e(c(V), []),
327
+ customRules: e(n(V), []),
326
328
  /** Skip default compiler rules */
327
329
  ignoreDefaultRules: e(o(), !1)
328
330
  }), W = a({
@@ -332,7 +334,7 @@ const p = {
332
334
  */
333
335
  externalValidation: e(
334
336
  k(
335
- (n) => typeof n == "function",
337
+ (c) => typeof c == "function",
336
338
  "externalValidation must be a function"
337
339
  )
338
340
  )
@@ -344,7 +346,7 @@ const p = {
344
346
  partner: E,
345
347
  // Optional sections (with defaults)
346
348
  /** Template content and presets */
347
- template: e(x, {}),
349
+ template: e(P, {}),
348
350
  /** Editor settings */
349
351
  editor: e(O, {}),
350
352
  /** UI configuration */
@@ -366,23 +368,23 @@ export {
366
368
  B as CustomBlockTypeSchema,
367
369
  G as CustomRuleSchema,
368
370
  w as DefaultBlockTypeSchema,
369
- N as DynamicContentListSchema,
370
- S as DynamicContentNodeSchema,
371
+ x as DynamicContentListSchema,
372
+ f as DynamicContentNodeSchema,
371
373
  M as DynamicContentSchema,
372
374
  O as EditorSchema,
373
- D as EmailHeaderSchema,
375
+ v as EmailHeaderSchema,
374
376
  L as FallbackFontSchema,
375
377
  U as FeaturesSchema,
376
378
  K as GuidoConfigSchema,
377
379
  A as IdentitySchema,
378
- P as LegacyRecommendationConfigSchema,
380
+ D as LegacyRecommendationConfigSchema,
379
381
  p as MessageType,
380
382
  E as PartnerSchema,
381
383
  l as ProductType,
382
384
  _ as RegexRuleSchema,
383
385
  q as RemoveRuleSchema,
384
386
  H as ReplaceRuleSchema,
385
- v as TemplateMigrationSchema,
386
- x as TemplateSchema,
387
+ N as TemplateMigrationSchema,
388
+ P as TemplateSchema,
387
389
  F as UISchema
388
390
  };
@@ -0,0 +1,25 @@
1
+ import { object as e, optional as a, string as o, nullish as i, number as t, picklist as n, array as c } from "../node_modules/valibot/dist/index.js";
2
+ const s = n(["liquid", "pongo"]), d = n(["codeOnly", "logicBuilder"]), r = e({
3
+ id: t(),
4
+ name: o(),
5
+ description: i(o(), ""),
6
+ syntax: s,
7
+ method: d,
8
+ codeBefore: o(),
9
+ codeAfter: i(o(), ""),
10
+ createdAt: a(o())
11
+ }), p = e({
12
+ data: c(r),
13
+ meta: e({
14
+ totalCount: t(),
15
+ perPage: t(),
16
+ currentPage: t(),
17
+ lastPage: t()
18
+ })
19
+ });
20
+ export {
21
+ p as DisplayConditionListResponseSchema,
22
+ d as DisplayConditionMethodSchema,
23
+ s as DisplayConditionSyntaxSchema,
24
+ r as SavedDisplayConditionSchema
25
+ };
@@ -1,18 +1,18 @@
1
- import o from "./Guido.vue2.js";
1
+ import i from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import i from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import o 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.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(_) {
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.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : 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
- }, s = [], n = /* @__PURE__ */ i(
10
- o,
9
+ }, s = [], n = /* @__PURE__ */ o(
10
+ i,
11
11
  t,
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "1b5c844a"
15
+ "5d5e32de"
16
16
  );
17
17
  const v = n.exports;
18
18
  export {
@@ -1,61 +1,64 @@
1
- import { defineComponent as se, defineAsyncComponent as m, ref as W, computed as p, watch as G, onMounted as ie, onUnmounted as ce } from "vue";
2
- import { useCortexBlueprintBridge as de } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as me } from "../composables/useEditorLock.js";
4
- import { provideGuidoActions as le } from "../composables/useGuidoActions.js";
5
- import { useGuidoStateBridge as ue } from "../composables/useGuidoStateBridge.js";
6
- import { usePartner as pe } from "../composables/usePartner.js";
7
- import { useSaveValidationRollout as fe } from "../composables/useSaveValidationRollout.js";
8
- import { useStripo as ye } from "../composables/useStripo.js";
9
- import { useTimerClone as ge } 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 Se } from "../enums/onboarding.js";
13
- import { useRecommendationExtensionStore as E } from "../extensions/Blocks/Recommendation/store/recommendation.js";
14
- import ve from "./organisms/AutoSaveController.vue.js";
15
- import be from "./organisms/base/AuthErrorModal.vue.js";
16
- import he from "./organisms/base/Toaster.vue.js";
17
- import Ee from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
18
- import we from "./organisms/header/HeaderWrapper.vue.js";
19
- import De from "./organisms/LoadingWrapper.vue.js";
20
- import Ce from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
21
- import ke from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
22
- import Fe from "./organisms/validation/ValidationErrorDrawer.vue.js";
23
- import { useStripoApi as Re } from "../services/stripoApi.js";
24
- import { useConfigStore as Me } from "../stores/config.js";
25
- import { useDynamicContentStore as Te } from "../stores/dynamic-content.js";
26
- import { useEditorStore as w } from "../stores/editor.js";
27
- import { usePreviewStore as Ie } from "../stores/preview.js";
28
- import { useSaveValidationStore as Le } from "../stores/save-validation.js";
29
- import { useTemplateStore as Ue } from "../stores/template.js";
30
- import { useUnsubscribeStore as Ae } from "../stores/unsubscribe.js";
1
+ import { defineComponent as de, defineAsyncComponent as c, ref as W, computed as l, watch as G, onMounted as me, onUnmounted as le } from "vue";
2
+ import { useCortexBlueprintBridge as ue } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as pe } from "../composables/useEditorLock.js";
4
+ import { provideGuidoActions as fe } from "../composables/useGuidoActions.js";
5
+ import { useGuidoStateBridge as ye } from "../composables/useGuidoStateBridge.js";
6
+ import { usePartner as ge } from "../composables/usePartner.js";
7
+ import { useSaveValidationRollout as Se } from "../composables/useSaveValidationRollout.js";
8
+ import { useStripo as ve } from "../composables/useStripo.js";
9
+ import { useTimerClone as be } from "../composables/useTimerClone.js";
10
+ import { migrate as H } from "../config/migrator/index.js";
11
+ import { ModuleFolderDefaults as V } from "../enums/defaults.js";
12
+ import { RIBBON_SELECTOR as he } from "../enums/onboarding.js";
13
+ import { useRecommendationExtensionStore as $, disposeStrategyPageReturnListeners as Ee } from "../extensions/Blocks/Recommendation/store/recommendation.js";
14
+ import { disposeUnsubscribeListeners as De } from "../extensions/Blocks/Unsubscribe/block.js";
15
+ import we from "./organisms/AutoSaveController.vue.js";
16
+ import Ce from "./organisms/base/AuthErrorModal.vue.js";
17
+ import ke from "./organisms/base/Toaster.vue.js";
18
+ import Re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
19
+ import Fe from "./organisms/header/HeaderWrapper.vue.js";
20
+ import Le from "./organisms/LoadingWrapper.vue.js";
21
+ import Me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
22
+ import Te from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
23
+ import Ie from "./organisms/validation/ValidationErrorDrawer.vue.js";
24
+ import { useStripoApi as Ue } from "../services/stripoApi.js";
25
+ import { useConfigStore as Ae } from "../stores/config.js";
26
+ import { useDynamicContentStore as Be } from "../stores/dynamic-content.js";
27
+ import { useEditorStore as E } from "../stores/editor.js";
28
+ import { usePreviewStore as Ne } from "../stores/preview.js";
29
+ import { useSaveValidationStore as xe } from "../stores/save-validation.js";
30
+ import { useTemplateStore as Pe } from "../stores/template.js";
31
+ import { useUnsubscribeStore as _e } from "../stores/unsubscribe.js";
31
32
  import { readTrackFloor as z } from "../utils/linkTrackingIds.js";
32
- const lt = /* @__PURE__ */ se({
33
+ const St = /* @__PURE__ */ de({
33
34
  __name: "Guido",
34
35
  props: {
35
36
  config: null,
36
37
  ready: { type: Boolean, default: !0 }
37
38
  },
38
39
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
39
- setup(H, { expose: q, emit: r }) {
40
- const s = H, K = m(
40
+ setup(q, { expose: K, emit: r }) {
41
+ const a = q, j = c(
41
42
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
42
- ), j = m(
43
+ ), J = c(
43
44
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
44
- ), J = m(
45
+ ), Q = c(
45
46
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
46
- ), Q = m(
47
+ ), X = c(
47
48
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
48
- ), X = m(
49
+ ), Y = c(
50
+ () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
51
+ ), Z = c(
49
52
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
50
- ), D = W(), f = W(), y = Te(), C = Ae(), o = Me();
51
- s.ready && o.init(s.config);
52
- const c = w(), Y = Ie(), l = p(() => c.hasChanges), { isTestPartner: Z } = pe(), { isEnabled: ee } = fe(), k = () => {
53
+ ), D = W(), f = W(), y = Be(), w = _e(), o = Ae();
54
+ a.ready && o.init(a.config);
55
+ const d = E(), ee = Ne(), u = l(() => d.hasChanges), { isTestPartner: te } = ge(), { isEnabled: oe, loadRollout: C } = Se(), k = () => {
53
56
  var t;
54
57
  return (t = D.value) == null ? void 0 : t.handleSave(!0);
55
- }, F = (t) => {
56
- c.loadingStatus = t;
58
+ }, R = (t) => {
59
+ d.loadingStatus = t;
57
60
  };
58
- de(), ue();
61
+ ue(), ye();
59
62
  const g = () => {
60
63
  var t, e;
61
64
  return {
@@ -63,18 +66,18 @@ const lt = /* @__PURE__ */ se({
63
66
  userId: o.userId,
64
67
  username: o.username,
65
68
  partnerName: o.partnerName,
66
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
67
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
69
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || V.SAVED_MODULES,
70
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || V.DEFAULT_MODULES
68
71
  };
69
- }, { initPlugin: R, preloadRuntime: M } = ye(), { runExclusive: T, beginMount: I, isCurrentMount: S } = me();
70
- let u = 0;
71
- const { getDefaultTemplate: L } = Re(), { cloneTimersOnSave: U, hasTimerBlocks: A } = ge(), te = p(() => {
72
+ }, { initPlugin: F, preloadRuntime: L } = ve(), { runExclusive: M, beginMount: T, isCurrentMount: S } = pe();
73
+ let p = 0;
74
+ const { getDefaultTemplate: I } = Ue(), { cloneTimersOnSave: U, hasTimerBlocks: A } = be(), ne = l(() => {
72
75
  var t;
73
76
  return !((t = o.ui) != null && t.showHeader);
74
- }), oe = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ne = p(
75
- () => !!E().recommendationConfigs.strategyId
77
+ }), re = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), se = l(() => o.externalDisplayConditions), ae = l(
78
+ () => !!$().recommendationConfigs.strategyId
76
79
  );
77
- le({
80
+ fe({
78
81
  onBack: () => {
79
82
  console.debug("guido:back"), r("back");
80
83
  },
@@ -94,85 +97,85 @@ const lt = /* @__PURE__ */ se({
94
97
  }, N = () => {
95
98
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
96
99
  };
97
- G(() => l.value, () => {
98
- r("on-change", l.value);
100
+ G(() => u.value, () => {
101
+ r("on-change", u.value);
99
102
  });
100
103
  const v = (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);
104
+ const e = t, { attribute: s, position: m } = e.detail;
105
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, m);
103
106
  };
104
107
  let i = null;
105
108
  const b = () => {
106
109
  var e;
107
- const t = document.querySelector(Se);
110
+ const t = document.querySelector(he);
108
111
  (e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
109
112
  }, h = async () => {
110
113
  var t;
111
114
  try {
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) || [];
114
- C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
115
- const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds"), x = {
115
+ o.initialized || o.init(a.config), d.templateId = o.templateId;
116
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", x = (e == null ? void 0 : e.preselectedDynamicContent) || [];
117
+ w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
118
+ const P = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds"), O = {
116
119
  partnerName: o.partnerName,
117
120
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
118
121
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
119
122
  };
120
123
  let n = {
121
- html: a && await V(a, _, x),
122
- css: d
124
+ html: s && await H(s, P, O),
125
+ css: m
123
126
  };
124
- n.html || (n = await L(), n.html = await V(n.html, _, x));
125
- const re = 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(re, z(n.html)));
127
- const ae = {
128
- preselectedDynamicContentList: P,
127
+ n.html || (n = await I(), n.html = await H(n.html, P, O));
128
+ const ie = _ ? z(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
129
+ A(n.html) && (n.html = await U(n.html)), _ && (d.trackIdSessionFloor = Math.max(ie, z(n.html)));
130
+ const ce = {
131
+ preselectedDynamicContentList: x,
129
132
  onReady: () => {
130
133
  console.debug("guido:ready"), r("ready");
131
134
  }
132
135
  };
133
- u = I(), await R(n, g(), ae), y.selectedDynamicContentList = P;
136
+ p = T(), await F(n, g(), ce), y.selectedDynamicContentList = x;
134
137
  } catch (e) {
135
138
  console.error("Failed to initialize Stripo editor:", e);
136
139
  }
137
140
  };
138
- return ie(async () => {
141
+ return me(async () => {
139
142
  var e;
140
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E().$reset(), w().$reset(), Ue().$reset(), Le().$reset(), b();
143
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), $().$reset(), E().$reset(), Pe().$reset(), xe().$reset(), C(), b();
141
144
  const t = (e = f.value) == null ? void 0 : e.parentElement;
142
- if (t && (i = new ResizeObserver(b), i.observe(t)), M(), s.ready)
145
+ if (t && (i = new ResizeObserver(b), i.observe(t)), L(), a.ready)
143
146
  await h();
144
147
  else {
145
- const a = G(() => s.ready, (d) => {
146
- d && (a(), h());
148
+ const s = G(() => a.ready, (m) => {
149
+ m && (s(), h());
147
150
  });
148
151
  }
149
152
  document.addEventListener("dynamic-content:open", v);
150
- }), ce(() => {
151
- if (i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), E().disposeStrategyPageReturn(), S(u))
153
+ }), le(() => {
154
+ if (De(), Ee(), i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), S(p))
152
155
  try {
153
- w().isStripoInitialized = !1;
156
+ E().isStripoInitialized = !1;
154
157
  } catch (t) {
155
158
  console.debug("Failed to close the editor readiness gate on unmount", t);
156
159
  }
157
- T(async () => {
158
- if (S(u))
160
+ M(async () => {
161
+ if (S(p))
159
162
  try {
160
163
  window.UIEditor.removeEditor();
161
164
  } catch {
162
165
  console.debug("Failed to remove Stripo editor: No editor found");
163
166
  }
164
167
  }), o.reset();
165
- }), q({
168
+ }), K({
166
169
  dynamicContent: {
167
170
  insert: B,
168
171
  close: N
169
172
  },
170
- hasChanges: l,
173
+ hasChanges: u,
171
174
  saveSilent: k,
172
- setLoading: F
173
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, headerWrapperRef: D, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: C, props: s, configStore: o, editorStore: c, previewStore: Y, hasChanges: l, isTestPartner: Z, isSaveValidationEnabled: ee, saveSilent: k, setLoading: F, emit: r, buildMetadata: g, initPlugin: R, preloadRuntime: M, runExclusive: T, beginMount: I, isCurrentMount: S, mountGeneration: u, getDefaultTemplate: L, cloneTimersOnSave: U, hasTimerBlocks: A, noHeader: te, isRrsEnabled: oe, hasAssignedStrategy: ne, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: b, startEditor: h, AutoSaveController: ve, AuthErrorModal: be, Toaster: he, FilterSelectionDrawer: Ee, HeaderWrapper: we, LoadingWrapper: De, SaveAsTemplateDrawer: Ce, UnsubscribeWrapper: ke, ValidationErrorDrawer: Fe };
175
+ setLoading: R
176
+ }), { __sfc: !0, PreviewContainer: j, OnboardingWrapper: J, AssignStrategyDrawer: Q, RemoveStrategyModal: X, DisplayConditionsHost: Y, LegacyStrategyUpdatedModal: Z, headerWrapperRef: D, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: w, props: a, configStore: o, editorStore: d, previewStore: ee, hasChanges: u, isTestPartner: te, isSaveValidationEnabled: oe, loadRollout: C, saveSilent: k, setLoading: R, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: L, runExclusive: M, beginMount: T, isCurrentMount: S, mountGeneration: p, getDefaultTemplate: I, cloneTimersOnSave: U, hasTimerBlocks: A, noHeader: ne, isRrsEnabled: re, isExternalDisplayConditionsEnabled: se, hasAssignedStrategy: ae, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: b, startEditor: h, AutoSaveController: we, AuthErrorModal: Ce, Toaster: ke, FilterSelectionDrawer: Re, HeaderWrapper: Fe, LoadingWrapper: Le, SaveAsTemplateDrawer: Me, UnsubscribeWrapper: Te, ValidationErrorDrawer: Ie };
174
177
  }
175
178
  });
176
179
  export {
177
- lt as default
180
+ St as default
178
181
  };
@@ -1,14 +1,15 @@
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({
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({
6
7
  __name: "AutoSaveController",
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 };
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 };
10
11
  }
11
12
  });
12
13
  export {
13
- v as default
14
+ d as default
14
15
  };
@@ -0,0 +1,20 @@
1
+ import i from "./CodeEditorField.vue2.js";
2
+ /* empty css */
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var e = this, r = e._self._c, o = e._self._setupProxy;
6
+ return r("div", { staticClass: "guido-code-editor-field", attrs: { id: e.id } }, [r("p", { staticClass: "guido-code-editor-field__label" }, [e._v(" " + e._s(e.label) + " ")]), r(o.InCodeSnippet, { attrs: { code: e.value, disable: e.disabled, "focus-editor": !1, invalid: !!e.error, "invalid-message": e.error, options: o.options, size: { height: e.error ? 196 : 216 }, "syntax-check": !1 }, on: { input: function(t) {
7
+ return o.emit("input", t);
8
+ }, ready: o.onReady } })], 1);
9
+ }, n = [], d = /* @__PURE__ */ s(
10
+ i,
11
+ a,
12
+ n,
13
+ !1,
14
+ null,
15
+ "e96c7aa3"
16
+ );
17
+ const p = d.exports;
18
+ export {
19
+ p as default
20
+ };
@@ -0,0 +1,30 @@
1
+ import { defineComponent as s, computed as u } from "vue";
2
+ import { InCodeSnippet as i } from "@useinsider/design-system-vue";
3
+ const m = /* @__PURE__ */ s({
4
+ __name: "CodeEditorField",
5
+ props: {
6
+ id: null,
7
+ label: null,
8
+ value: null,
9
+ placeholder: { default: "" },
10
+ error: { default: "" },
11
+ disabled: { type: Boolean, default: !1 }
12
+ },
13
+ emits: ["input"],
14
+ setup(t, { expose: n, emit: d }) {
15
+ const l = t;
16
+ let e = null;
17
+ const a = u(() => ({
18
+ mode: "liquid",
19
+ lint: !1,
20
+ foldGutter: !1,
21
+ placeholder: l.placeholder
22
+ })), r = (p) => {
23
+ e = p;
24
+ }, o = () => (e == null ? void 0 : e.state.doc.toString()) ?? l.value;
25
+ return n({ read: o }), { __sfc: !0, props: l, emit: d, view: e, options: a, onReady: r, read: o, InCodeSnippet: i };
26
+ }
27
+ });
28
+ export {
29
+ m as default
30
+ };