@useinsider/guido 3.12.0-beta.b73c720 → 3.12.0-beta.b94f28c

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 (104) hide show
  1. package/README.md +16 -1
  2. package/dist/@types/config/schemas.js +24 -27
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +111 -103
  5. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
  6. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
  7. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  8. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
  9. package/dist/composables/useAllowlist.js +50 -0
  10. package/dist/composables/usePreviewInteractionGuard.js +36 -11
  11. package/dist/composables/useRecommendation.js +51 -82
  12. package/dist/composables/useRecommendationPreview.js +61 -60
  13. package/dist/composables/useSave.js +42 -23
  14. package/dist/composables/useStripo.js +72 -69
  15. package/dist/composables/useUserRole.js +12 -0
  16. package/dist/config/migrator/recommendationMigrator.js +4 -7
  17. package/dist/enums/date.js +3 -4
  18. package/dist/enums/extensions/recommendationBlock.js +22 -28
  19. package/dist/enums/roles.js +4 -0
  20. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  21. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +11 -12
  22. package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
  23. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +109 -123
  24. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +12 -12
  25. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +12 -12
  26. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +12 -12
  27. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +12 -12
  28. package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
  29. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +1 -1
  30. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
  31. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +102 -256
  32. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +7 -7
  33. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -24
  34. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
  35. package/dist/extensions/Blocks/controlFactories.js +125 -75
  36. package/dist/guido.css +1 -1
  37. package/dist/services/allowlistApi.js +15 -0
  38. package/dist/services/recommendationApi.js +27 -65
  39. package/dist/services/stripoApi.js +18 -18
  40. package/dist/src/@types/config/schemas.d.ts +10 -10
  41. package/dist/src/components/Guido.vue.d.ts +18 -2
  42. package/dist/src/composables/useAllowlist.d.ts +6 -0
  43. package/dist/src/composables/useConfig.d.ts +2 -2
  44. package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
  45. package/dist/src/composables/useRecommendation.d.ts +0 -2
  46. package/dist/src/composables/useStripo.d.ts +3 -2
  47. package/dist/src/composables/useUserRole.d.ts +3 -0
  48. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -10
  49. package/dist/src/enums/roles.d.ts +9 -0
  50. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  51. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
  52. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  53. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
  54. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -606
  55. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -7
  56. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +1 -3
  57. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
  58. package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
  59. package/dist/src/services/allowlistApi.d.ts +4 -0
  60. package/dist/src/services/recommendationApi.d.ts +1 -7
  61. package/dist/src/stores/config.d.ts +21 -19
  62. package/dist/src/utils/genericUtil.d.ts +0 -9
  63. package/dist/src/utils/urlSchemes.d.ts +6 -0
  64. package/dist/static/styles/base.css.js +0 -15
  65. package/dist/static/styles/components/base-input.css.js +6 -7
  66. package/dist/stores/config.js +21 -19
  67. package/dist/utils/dateUtil.js +10 -23
  68. package/dist/utils/genericUtil.js +1 -10
  69. package/dist/utils/pairProductVariables.js +44 -43
  70. package/dist/{extensions/Blocks/Recommendation/utils → utils}/preserveTextStyles.js +1 -1
  71. package/dist/utils/templatePreparation.js +58 -62
  72. package/dist/utils/urlSchemes.js +4 -0
  73. package/package.json +1 -1
  74. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +0 -36
  75. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +0 -244
  76. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +0 -18
  77. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +0 -42
  78. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +0 -20
  79. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +0 -18
  80. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +0 -20
  81. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +0 -60
  82. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +0 -19
  83. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +0 -19
  84. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +0 -22
  85. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +0 -29
  86. package/dist/composables/useStrategyFilters.js +0 -16
  87. package/dist/enums/extensions/filteringV2.js +0 -8
  88. package/dist/enums/extensions/strategyDetail.js +0 -148
  89. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -146
  90. package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +0 -97
  91. package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +0 -10
  92. package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +0 -2
  93. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +0 -43
  94. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +0 -29
  95. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +0 -40
  96. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +0 -38
  97. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +0 -51
  98. package/dist/src/composables/useStrategyFilters.d.ts +0 -24
  99. package/dist/src/enums/extensions/filteringV2.d.ts +0 -72
  100. package/dist/src/enums/extensions/strategyDetail.d.ts +0 -90
  101. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -61
  102. package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +0 -50
  103. package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +0 -34
  104. /package/dist/src/{extensions/Blocks/Recommendation/utils → utils}/preserveTextStyles.d.ts +0 -0
package/README.md CHANGED
@@ -150,7 +150,7 @@ const config: GuidoConfigInput = {
150
150
  backButtonLabel?: string,
151
151
  },
152
152
 
153
- // Optional: Feature toggles
153
+ // Optional: Feature toggles (defaults apply once initialized — see `ready` prop below)
154
154
  features?: {
155
155
  dynamicContent?: boolean, // Default: true
156
156
  saveAsTemplate?: boolean, // Default: true
@@ -161,6 +161,7 @@ const config: GuidoConfigInput = {
161
161
  modulesDisabled?: boolean, // Default: false - Disable modules panel
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
+ 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).
164
165
  },
165
166
 
166
167
  // Optional: Callbacks
@@ -182,6 +183,19 @@ const config: GuidoConfigInput = {
182
183
  };
183
184
  ```
184
185
 
186
+ ### `ready` prop
187
+
188
+ ```vue
189
+ <Guido :config="config" :ready="isConfigLoaded" />
190
+ ```
191
+
192
+ Optional, defaults to `true` — existing call sites need no change. Pass `false` to mount
193
+ Guido *before* `config` is fetched: it preloads the ~8 MB editor runtime immediately and
194
+ defers config validation + editor init until `ready` flips to `true`.
195
+
196
+ `config` must be final at that flip (later mutations don't re-initialize), and the flip is
197
+ one-way. While `ready` is `false` every `features` toggle reads as disabled.
198
+
185
199
  ---
186
200
 
187
201
  ## Events
@@ -637,6 +651,7 @@ bun run lint
637
651
  VITE_STRIPO_PLUGIN_ID=your_plugin_id
638
652
  VITE_STRIPO_SECRET_KEY=your_secret_key
639
653
  VITE_STRIPO_ROLE=your_role
654
+ VITE_STRIPO_USER=your_user
640
655
  ```
641
656
 
642
657
  ---
@@ -1,11 +1,11 @@
1
1
  import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, fallback as R, literal as i, looseObject as g, variant as C, union as f, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as r, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as f, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
3
3
  const d = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
6
6
  /** Transactional/system emails */
7
7
  TRANSACTIONAL: 2
8
- }, r = {
8
+ }, l = {
9
9
  /** Standard email campaigns */
10
10
  EMAIL: 60,
11
11
  /** Architect journey builder */
@@ -38,16 +38,16 @@ const d = {
38
38
  ),
39
39
  /** Product type identifier */
40
40
  productType: e(
41
- l([
42
- r.EMAIL,
43
- r.ARCHITECT,
44
- r.UNSUBSCRIBE_PAGES
41
+ r([
42
+ l.EMAIL,
43
+ l.ARCHITECT,
44
+ l.UNSUBSCRIBE_PAGES
45
45
  ]),
46
- r.EMAIL
46
+ l.EMAIL
47
47
  ),
48
48
  /** Message type (promotional or transactional) */
49
49
  messageType: e(
50
- l([d.PROMOTIONAL, d.TRANSACTIONAL]),
50
+ r([d.PROMOTIONAL, d.TRANSACTIONAL]),
51
51
  d.PROMOTIONAL
52
52
  ),
53
53
  /** Display name for the current user */
@@ -76,10 +76,10 @@ const d = {
76
76
  children: e(c(S)),
77
77
  // eslint-disable-next-line camelcase -- backend field name
78
78
  select_items: e(c(S))
79
- })), P = k(
79
+ })), E = k(
80
80
  t(),
81
- R(c(S), [])
82
- ), D = g({
81
+ C(c(S), [])
82
+ ), P = g({
83
83
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
84
84
  id: e(n()),
85
85
  /** Decimal places for price display (legacy data may use string or number) */
@@ -124,7 +124,7 @@ const d = {
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
- }), E = a({
127
+ }), D = 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 d = {
132
132
  * strategy, currency, locale, and layout data.
133
133
  */
134
134
  recommendationConfigs: e(
135
- k(t(), D),
135
+ k(t(), P),
136
136
  {}
137
137
  )
138
138
  }), M = a({
@@ -151,7 +151,7 @@ const d = {
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(P, {}),
154
+ dynamicContentList: e(E, {}),
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 */
@@ -159,7 +159,7 @@ const d = {
159
159
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
160
160
  forceRecreate: e(o(), !1),
161
161
  /** Migration-only inputs (legacy block configs) */
162
- migration: e(E, {})
162
+ migration: e(D, {})
163
163
  }), N = a({
164
164
  /** Sender display name */
165
165
  senderName: e(t(), ""),
@@ -202,12 +202,9 @@ const d = {
202
202
  liquidSyntax: e(o(), !1),
203
203
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
204
204
  autosave: e(o(), !1),
205
- /**
206
- * Select a Reusable Recommendation Strategy (RRS) instead of a per-block algorithm.
207
- * Replaces the algorithm dropdown with a strategy dropdown fed from Smart Recommender.
208
- */
209
- reusableRecommendationStrategy: e(o(), !1)
210
- }), U = l([
205
+ /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
206
+ allowlistEnabled: e(o(), !1)
207
+ }), U = r([
211
208
  "amp-accordion",
212
209
  "amp-carousel",
213
210
  "amp-form-controls",
@@ -221,7 +218,7 @@ const d = {
221
218
  "text-block",
222
219
  "timer-block",
223
220
  "video-block"
224
- ]), B = l([
221
+ ]), B = r([
225
222
  "dynamic-content",
226
223
  "checkbox-block",
227
224
  "radio-button-block",
@@ -278,7 +275,7 @@ const d = {
278
275
  (u) => typeof u == "function",
279
276
  "processor must be a function"
280
277
  )
281
- }), G = C("type", [
278
+ }), G = R("type", [
282
279
  H,
283
280
  _,
284
281
  j,
@@ -329,7 +326,7 @@ export {
329
326
  B as CustomBlockTypeSchema,
330
327
  q as CustomRuleSchema,
331
328
  U as DefaultBlockTypeSchema,
332
- P as DynamicContentListSchema,
329
+ E as DynamicContentListSchema,
333
330
  S as DynamicContentNodeSchema,
334
331
  v as DynamicContentSchema,
335
332
  O as EditorSchema,
@@ -338,14 +335,14 @@ export {
338
335
  F as FeaturesSchema,
339
336
  K as GuidoConfigSchema,
340
337
  A as IdentitySchema,
341
- D as LegacyRecommendationConfigSchema,
338
+ P as LegacyRecommendationConfigSchema,
342
339
  d as MessageType,
343
340
  L as PartnerSchema,
344
- r as ProductType,
341
+ l as ProductType,
345
342
  _ as RegexRuleSchema,
346
343
  j as RemoveRuleSchema,
347
344
  H as ReplaceRuleSchema,
348
- E as TemplateMigrationSchema,
345
+ D as TemplateMigrationSchema,
349
346
  M as TemplateSchema,
350
347
  x as UISchema
351
348
  };
@@ -1,18 +1,18 @@
1
- import a 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 a from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
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.StrategyDetailDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
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) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, n = [], s = /* @__PURE__ */ i(
10
- a,
9
+ }, n = [], s = /* @__PURE__ */ a(
10
+ i,
11
11
  t,
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "f96d1003"
15
+ "5079a1c8"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -1,141 +1,149 @@
1
- import { defineComponent as X, defineAsyncComponent as I, ref as W, computed as x, watch as Y, onMounted as Z, onUnmounted as ee } from "vue";
2
- import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as oe } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as ne } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as re } from "../composables/usePartner.js";
6
- import { useStripo as se } from "../composables/useStripo.js";
7
- import { useTimerClone as ae } from "../composables/useTimerClone.js";
8
- import { migrate as G } from "../config/migrator/index.js";
9
- import { ModuleFolderDefaults as H } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as ie } from "../enums/onboarding.js";
11
- import { useRecommendationExtensionStore as ce } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
- import me from "./organisms/AutoSaveController.vue.js";
13
- import de from "./organisms/base/Toaster.vue.js";
14
- import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import ue from "./organisms/extensions/recommendation/StrategyDetailDrawer.vue.js";
16
- import pe from "./organisms/header/HeaderWrapper.vue.js";
17
- import fe from "./organisms/LoadingWrapper.vue.js";
18
- import ve from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import Se from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import { useStripoApi as ye } from "../services/stripoApi.js";
21
- import { useConfigStore as ge } from "../stores/config.js";
22
- import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
23
- import { useEditorStore as $ } from "../stores/editor.js";
24
- import { usePreviewStore as be } from "../stores/preview.js";
25
- import { useTemplateStore as we } from "../stores/template.js";
26
- import { useUnsubscribeStore as De } from "../stores/unsubscribe.js";
27
- const Je = /* @__PURE__ */ X({
1
+ import { defineComponent as q, defineAsyncComponent as M, ref as U, computed as _, watch as B, onMounted as K, onUnmounted as V } from "vue";
2
+ import { useCortexBlueprintBridge as j } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as J } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as Q } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as X } from "../composables/usePartner.js";
6
+ import { useStripo as Y } from "../composables/useStripo.js";
7
+ import { useTimerClone as Z } from "../composables/useTimerClone.js";
8
+ import { migrate as I } from "../config/migrator/index.js";
9
+ import { ModuleFolderDefaults as N } from "../enums/defaults.js";
10
+ import { RIBBON_SELECTOR as ee } from "../enums/onboarding.js";
11
+ import { useRecommendationExtensionStore as te } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
+ import oe from "./organisms/AutoSaveController.vue.js";
13
+ import ne from "./organisms/base/Toaster.vue.js";
14
+ import re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
+ import se from "./organisms/header/HeaderWrapper.vue.js";
16
+ import ie from "./organisms/LoadingWrapper.vue.js";
17
+ import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import ce from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as de } from "../services/stripoApi.js";
20
+ import { useConfigStore as me } from "../stores/config.js";
21
+ import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
22
+ import { useEditorStore as O } from "../stores/editor.js";
23
+ import { usePreviewStore as ue } from "../stores/preview.js";
24
+ import { useTemplateStore as pe } from "../stores/template.js";
25
+ import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
26
+ const xe = /* @__PURE__ */ q({
28
27
  __name: "Guido",
29
28
  props: {
30
- config: null
29
+ config: null,
30
+ ready: { type: Boolean, default: !0 }
31
31
  },
32
32
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
33
- setup(z, { expose: q, emit: n }) {
34
- const b = z, K = I(
33
+ setup(P, { expose: A, emit: n }) {
34
+ const i = P, W = M(
35
35
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
36
- ), V = I(
36
+ ), x = M(
37
37
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
38
- ), w = W(), p = W(), f = he(), D = De(), c = ge();
39
- c.init(b.config);
40
- const m = $(), j = be(), d = x(() => m.hasChanges), { isTestPartner: J } = re(), E = () => {
41
- var e;
42
- return (e = w.value) == null ? void 0 : e.handleSave(!0);
43
- }, C = (e) => {
44
- m.loadingStatus = e;
45
- }, {
46
- templateId: v,
47
- userId: T,
48
- partnerName: L,
49
- username: k,
50
- template: t,
51
- editor: s
52
- } = c, l = (t == null ? void 0 : t.html) || "", F = (t == null ? void 0 : t.css) || "", S = (t == null ? void 0 : t.preselectedDynamicContent) || [], U = (s == null ? void 0 : s.savedModulesFolderName) || H.SAVED_MODULES, _ = (s == null ? void 0 : s.defaultModulesFolderName) || H.DEFAULT_MODULES;
53
- te(), ne();
54
- const y = {
55
- emailId: v,
56
- userId: T,
57
- username: k,
58
- partnerName: L,
59
- savedModulesFolderName: U,
60
- defaultModulesFolderName: _
61
- }, M = {
62
- preselectedDynamicContentList: S,
63
- onReady: () => {
64
- console.debug("guido:ready"), n("ready");
65
- }
66
- }, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } = ye(), { cloneTimersOnSave: R, hasTimerBlocks: A } = ae(), Q = x(() => {
67
- var e;
68
- return !((e = c.ui) != null && e.showHeader);
38
+ ), g = U(), l = U(), u = le(), S = fe(), o = me();
39
+ i.ready && o.init(i.config);
40
+ const d = O(), G = ue(), m = _(() => d.hasChanges), { isTestPartner: H } = X(), h = () => {
41
+ var t;
42
+ return (t = g.value) == null ? void 0 : t.handleSave(!0);
43
+ }, b = (t) => {
44
+ d.loadingStatus = t;
45
+ };
46
+ j(), Q();
47
+ const p = () => {
48
+ var t, e;
49
+ return {
50
+ emailId: o.templateId,
51
+ userId: o.userId,
52
+ username: o.username,
53
+ partnerName: o.partnerName,
54
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
55
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
56
+ };
57
+ }, { initPlugin: E, preloadRuntime: w } = Y(), { getDefaultTemplate: C } = de(), { cloneTimersOnSave: D, hasTimerBlocks: T } = Z(), $ = _(() => {
58
+ var t;
59
+ return !((t = o.ui) != null && t.showHeader);
69
60
  });
70
- oe({
61
+ J({
71
62
  onBack: () => {
72
63
  console.debug("guido:back"), n("back");
73
64
  },
74
65
  onSaveStart: () => {
75
66
  console.debug("guido:save:start"), n("save:start");
76
67
  },
77
- onSaveComplete: (e) => {
78
- const o = { ...e, metadata: y };
79
- console.debug("guido:save:complete", o), n("save:complete", o);
68
+ onSaveComplete: (t) => {
69
+ const e = { ...t, metadata: p() };
70
+ console.debug("guido:save:complete", e), n("save:complete", e);
80
71
  },
81
72
  onTestEmailClick: () => {
82
73
  console.debug("guido:test-email:click"), n("test-email:click");
83
74
  }
84
75
  });
85
- const B = (e) => {
86
- console.debug("dynamic-content:close", e), f.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
87
- }, N = () => {
76
+ const L = (t) => {
77
+ console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
78
+ }, R = () => {
88
79
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
89
80
  };
90
- Y(() => d.value, () => {
91
- n("on-change", d.value);
81
+ B(() => m.value, () => {
82
+ n("on-change", m.value);
92
83
  });
93
- const g = (e) => {
94
- const o = e, { attribute: u, position: i } = o.detail;
95
- console.debug("dynamic-content:open", o.detail), n("dynamic-content:open", u, i);
84
+ const f = (t) => {
85
+ const e = t, { attribute: s, position: c } = e.detail;
86
+ console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", s, c);
96
87
  };
97
88
  let a = null;
98
- const h = () => {
99
- var o;
100
- const e = document.querySelector(ie);
101
- (o = p.value) == null || o.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
102
- };
103
- return Z(async () => {
104
- var o, u;
105
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ce().$reset(), $().$reset(), m.templateId = v, we().$reset(), h();
106
- const e = (o = p.value) == null ? void 0 : o.parentElement;
107
- e && (a = new ResizeObserver(h), a.observe(e));
89
+ const y = () => {
90
+ var e;
91
+ const t = document.querySelector(ee);
92
+ (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
93
+ }, v = async () => {
94
+ var t;
108
95
  try {
109
- D.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
110
- const i = ((u = t == null ? void 0 : t.migration) == null ? void 0 : u.recommendationConfigs) ?? {};
96
+ o.initialized || o.init(i.config), d.templateId = o.templateId;
97
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", c = (e == null ? void 0 : e.css) || "", k = (e == null ? void 0 : e.preselectedDynamicContent) || [];
98
+ S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
99
+ const F = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {};
111
100
  let r = {
112
- html: l && await G(l, i),
113
- css: F
101
+ html: s && await I(s, F),
102
+ css: c
103
+ };
104
+ r.html || (r = await C(), r.html = await I(r.html, F)), T(r.html) && (r.html = await D(r.html));
105
+ const z = {
106
+ preselectedDynamicContentList: k,
107
+ onReady: () => {
108
+ console.debug("guido:ready"), n("ready");
109
+ }
114
110
  };
115
- r.html || (r = await P(), r.html = await G(r.html, i)), A(r.html) && (r.html = await R(r.html)), await O(r), f.selectedDynamicContentList = S;
116
- } catch (i) {
117
- console.error("Failed to initialize Stripo editor:", i);
111
+ await E(r, p(), z), u.selectedDynamicContentList = k;
112
+ } catch (e) {
113
+ console.error("Failed to initialize Stripo editor:", e);
114
+ }
115
+ };
116
+ return K(async () => {
117
+ var e;
118
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), O().$reset(), pe().$reset(), y();
119
+ const t = (e = l.value) == null ? void 0 : e.parentElement;
120
+ if (t && (a = new ResizeObserver(y), a.observe(t)), w(), i.ready)
121
+ await v();
122
+ else {
123
+ const s = B(() => i.ready, (c) => {
124
+ c && (s(), v());
125
+ });
118
126
  }
119
- document.addEventListener("dynamic-content:open", g);
120
- }), ee(() => {
121
- a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", g);
127
+ document.addEventListener("dynamic-content:open", f);
128
+ }), V(() => {
129
+ a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f);
122
130
  try {
123
131
  window.UIEditor.removeEditor();
124
132
  } catch {
125
133
  console.debug("Failed to remove Stripo editor: No editor found");
126
134
  }
127
- c.reset();
128
- }), q({
135
+ o.reset();
136
+ }), A({
129
137
  dynamicContent: {
130
- insert: B,
131
- close: N
138
+ insert: L,
139
+ close: R
132
140
  },
133
- hasChanges: d,
134
- saveSilent: E,
135
- setLoading: C
136
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, headerWrapperRef: w, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: D, props: b, configStore: c, editorStore: m, previewStore: j, hasChanges: d, isTestPartner: J, saveSilent: E, setLoading: C, templateId: v, userId: T, partnerName: L, username: k, templateConfig: t, editorConfig: s, html: l, css: F, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: n, metadata: y, options: M, initPlugin: O, getDefaultTemplate: P, cloneTimersOnSave: R, hasTimerBlocks: A, noHeader: Q, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: g, ribbonObserver: a, updateRibbonOffset: h, AutoSaveController: me, Toaster: de, FilterSelectionDrawer: le, StrategyDetailDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ve, UnsubscribeWrapper: Se };
141
+ hasChanges: m,
142
+ saveSilent: h,
143
+ setLoading: b
144
+ }), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: x, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: d, previewStore: G, hasChanges: m, isTestPartner: H, saveSilent: h, setLoading: b, emit: n, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: $, insertDynamicContent: L, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: y, startEditor: v, AutoSaveController: oe, Toaster: ne, FilterSelectionDrawer: re, HeaderWrapper: se, LoadingWrapper: ie, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ce };
137
145
  }
138
146
  });
139
147
  export {
140
- Je as default
148
+ xe as default
141
149
  };
@@ -15,7 +15,7 @@ var a = function() {
15
15
  i,
16
16
  !1,
17
17
  null,
18
- "06afaecb"
18
+ "cf946232"
19
19
  );
20
20
  const f = n.exports;
21
21
  export {
@@ -1,24 +1,24 @@
1
- import { defineComponent as u, ref as a, onMounted as p, onBeforeUnmount as l, nextTick as v } from "vue";
2
- import { usePreviewInteractionGuard as d } from "../../../../composables/usePreviewInteractionGuard.js";
1
+ import { defineComponent as u, ref as a, onMounted as p, onBeforeUnmount as l, nextTick as d } from "vue";
2
+ import { usePreviewInteractionGuard as v } from "../../../../composables/usePreviewInteractionGuard.js";
3
3
  import { useTranslations as _ } from "../../../../composables/useTranslations.js";
4
4
  import { usePreviewStore as w } from "../../../../stores/preview.js";
5
5
  import I from "./DesktopBrowserHeader.vue.js";
6
6
  const C = /* @__PURE__ */ u({
7
7
  __name: "DesktopPreview",
8
- setup(k) {
9
- const i = _(), { blockPreviewInteractions: t } = d(), o = a(), n = a(!1), c = w();
8
+ setup(P) {
9
+ const i = _(), { guardPreviewInteractions: t } = v(), o = a(), r = a(!1), c = w();
10
10
  let e = null;
11
11
  const f = (m) => {
12
12
  t(m.target);
13
- }, r = () => {
13
+ }, n = () => {
14
14
  o.value && (e = new ResizeObserver(() => {
15
- }), e.observe(o.value), v(() => {
16
- n.value = !0;
15
+ }), e.observe(o.value), d(() => {
16
+ r.value = !0;
17
17
  }));
18
18
  }, s = () => {
19
19
  e == null || e.disconnect();
20
20
  };
21
- return p(r), l(s), { __sfc: !0, trans: i, blockPreviewInteractions: t, containerRef: o, isContainerReady: n, previewStore: c, resizeObserver: e, onIframeLoad: f, initIframe: r, cleanIframe: s, DesktopBrowserHeader: I };
21
+ return p(n), l(s), { __sfc: !0, trans: i, guardPreviewInteractions: t, containerRef: o, isContainerReady: r, previewStore: c, resizeObserver: e, onIframeLoad: f, initIframe: n, cleanIframe: s, DesktopBrowserHeader: I };
22
22
  }
23
23
  });
24
24
  export {
@@ -1,20 +1,20 @@
1
1
  import e from "./ContentView.vue2.js";
2
2
  /* empty css */
3
3
  import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var c = function() {
4
+ var o = function() {
5
5
  var t = this, s = t._self._c, a = t._self._setupProxy;
6
6
  return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
7
7
  return t.$emit("back-to-inbox");
8
8
  } } }, [s(a.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [t._v(t._s(a.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(a.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(a.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("div", { staticClass: "iframe-wrapper f-g-1 o-h" }, [s("iframe", { ref: "iframeRef", staticClass: "iframe-scaled d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: a.previewStore.previewHtml }, on: { load: a.onLoad } })])]);
9
- }, o = [], i = /* @__PURE__ */ n(
9
+ }, i = [], r = /* @__PURE__ */ n(
10
10
  e,
11
- c,
12
11
  o,
12
+ i,
13
13
  !1,
14
14
  null,
15
- "cbafc185"
15
+ "f255b2bb"
16
16
  );
17
- const d = i.exports;
17
+ const d = r.exports;
18
18
  export {
19
19
  d as default
20
20
  };
@@ -1,24 +1,24 @@
1
- import { defineComponent as m, ref as a } from "vue";
1
+ import { defineComponent as c, ref as a } from "vue";
2
2
  import { usePreviewInteractionGuard as f } from "../../../../composables/usePreviewInteractionGuard.js";
3
3
  import { useResponsivePreview as p } from "../../../../composables/useResponsivePreview.js";
4
4
  import { useTranslations as u } from "../../../../composables/useTranslations.js";
5
5
  import { usePreviewStore as v } from "../../../../stores/preview.js";
6
- import { InIcons as P } from "@useinsider/design-system-vue";
7
- const g = /* @__PURE__ */ m({
6
+ import { InIcons as d } from "@useinsider/design-system-vue";
7
+ const b = /* @__PURE__ */ c({
8
8
  __name: "ContentView",
9
9
  emits: ["back-to-inbox"],
10
- setup(_) {
11
- const c = u(), t = v(), r = a(), { setupResponsivePreview: n } = p(), { blockPreviewInteractions: s } = f(), i = (e) => {
10
+ setup(P) {
11
+ const m = u(), r = v(), t = a(), { setupResponsivePreview: n } = p(), { guardPreviewInteractions: s } = f(), i = (e) => {
12
12
  ["transform", "transform-origin", "height"].forEach((o) => {
13
13
  e.documentElement.style.removeProperty(o);
14
14
  });
15
15
  };
16
- return { __sfc: !0, trans: c, previewStore: t, iframeRef: r, setupResponsivePreview: n, blockPreviewInteractions: s, clearAMPTransforms: i, onLoad: () => {
17
- const e = r.value, o = e == null ? void 0 : e.contentDocument;
18
- o && (n(e), s(e), t.isAMPResponsive && i(o));
19
- }, InIcons: P };
16
+ return { __sfc: !0, trans: m, previewStore: r, iframeRef: t, setupResponsivePreview: n, guardPreviewInteractions: s, clearAMPTransforms: i, onLoad: () => {
17
+ const e = t.value, o = e == null ? void 0 : e.contentDocument;
18
+ o && (n(e), s(e), r.isAMPResponsive && i(o));
19
+ }, InIcons: d };
20
20
  }
21
21
  });
22
22
  export {
23
- g as default
23
+ b as default
24
24
  };
@@ -0,0 +1,50 @@
1
+ import { useAllowlistApi as A } from "../services/allowlistApi.js";
2
+ import { base64EncodeWithSpecialChars as p } from "../utils/base64.js";
3
+ import { useTranslations as h } from "./useTranslations.js";
4
+ import { useUserRole as D } from "./useUserRole.js";
5
+ const f = /(?:https?:\/\/|www\.)[^\s"'<>()]+/gi, E = /&quot;\/\//gi, i = {
6
+ MANAGE: "journey-builder.domain-allowlist-warning",
7
+ NON_MANAGE: "settings.allow-list-warning-not-admin-architect",
8
+ ADD_BUTTON: "settings.allow-list-warning-add-button"
9
+ }, w = /* @__PURE__ */ new Set(), O = (n) => `/settings?openAddModal=true&type=domain&values=${p(n)}#security`, M = () => {
10
+ const { checkDomain: n } = A(), { getIsManageUser: l } = D(), a = h(), d = (t, s) => {
11
+ const c = `${t || ""} ${s || ""}`.replace(E, "https://").match(f) || [], e = /* @__PURE__ */ new Set();
12
+ return c.forEach((r) => {
13
+ const g = /^https?:\/\//i.test(r) ? r : `https://${r}`;
14
+ try {
15
+ const { hostname: u } = new URL(g);
16
+ u && e.add(u.replace(/^www\./i, "").toLowerCase());
17
+ } catch {
18
+ }
19
+ }), [...e];
20
+ }, m = async (t) => {
21
+ if (w.has(t))
22
+ return !0;
23
+ try {
24
+ const s = await n(t);
25
+ return s && w.add(t), s;
26
+ } catch (s) {
27
+ return console.error("[GUIDO_ALLOWLIST] isDomainAllowlisted failed", t, s), !0;
28
+ }
29
+ };
30
+ return { getBlockedDomains: async (t, s) => {
31
+ try {
32
+ const o = d(t, s);
33
+ return o.length ? (await Promise.all(
34
+ o.map(async (e) => ({ domain: e, allowlisted: await m(e) }))
35
+ )).filter((e) => !e.allowlisted).map((e) => e.domain) : [];
36
+ } catch (o) {
37
+ return console.error("[GUIDO_ALLOWLIST] getBlockedDomains failed", o), [];
38
+ }
39
+ }, resolveToast: async (t) => await l() ? {
40
+ message: a(i.MANAGE),
41
+ actionButton: {
42
+ text: a(i.ADD_BUTTON),
43
+ onClick: () => window.open(O(t.join(",")), "_blank")
44
+ }
45
+ } : { message: a(i.NON_MANAGE) } };
46
+ };
47
+ export {
48
+ O as buildAllowlistSettingsUrl,
49
+ M as useAllowlist
50
+ };