@useinsider/guido 2.0.0-beta.81f9c55 → 2.0.0-beta.84d530c

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.
@@ -1,5 +1,5 @@
1
- import { object as o, number as p, optional as e, string as t, pipe as m, picklist as n, boolean as c, array as a, minLength as u, literal as r, custom as b, variant as S } from "../../node_modules/valibot/dist/index.js";
2
- const i = {
1
+ import { object as o, number as b, optional as e, string as t, pipe as u, picklist as n, custom as d, boolean as c, array as a, minLength as p, literal as r, variant as S } from "../../node_modules/valibot/dist/index.js";
2
+ const m = {
3
3
  /** Promotional/marketing emails */
4
4
  PROMOTIONAL: 1,
5
5
  /** Transactional/system emails */
@@ -13,22 +13,22 @@ const i = {
13
13
  UNSUBSCRIBE_PAGES: 97
14
14
  }, h = o({
15
15
  /** Unique identifier for the template being edited */
16
- templateId: m(
16
+ templateId: u(
17
17
  t(),
18
- u(1, "templateId is required")
18
+ p(1, "templateId is required")
19
19
  ),
20
20
  /** Unique identifier for the user editing the template */
21
- userId: m(
21
+ userId: u(
22
22
  t(),
23
- u(1, "userId is required")
23
+ p(1, "userId is required")
24
24
  ),
25
25
  /** Optional variation ID for A/B testing */
26
26
  variationId: e(t())
27
27
  }), k = o({
28
28
  /** Partner/organization name (required) */
29
- name: m(
29
+ name: u(
30
30
  t(),
31
- u(1, "partner.name is required")
31
+ p(1, "partner.name is required")
32
32
  ),
33
33
  /** Product type identifier */
34
34
  productType: e(
@@ -41,8 +41,8 @@ const i = {
41
41
  ),
42
42
  /** Message type (promotional or transactional) */
43
43
  messageType: e(
44
- n([i.PROMOTIONAL, i.TRANSACTIONAL]),
45
- i.PROMOTIONAL
44
+ n([m.PROMOTIONAL, m.TRANSACTIONAL]),
45
+ m.PROMOTIONAL
46
46
  ),
47
47
  /** Display name for the current user */
48
48
  username: e(t(), "Guido User")
@@ -60,7 +60,7 @@ const i = {
60
60
  value: t()
61
61
  })
62
62
  )
63
- }), R = o({
63
+ }), C = o({
64
64
  /** Initial HTML content */
65
65
  html: e(t(), ""),
66
66
  /** Initial CSS content */
@@ -71,8 +71,8 @@ const i = {
71
71
  []
72
72
  ),
73
73
  /** Selected unsubscribe page IDs */
74
- selectedUnsubscribePages: e(a(p()), [])
75
- }), C = o({
74
+ selectedUnsubscribePages: e(a(b()), [])
75
+ }), R = o({
76
76
  /** Sender display name */
77
77
  senderName: e(t(), ""),
78
78
  /** Email subject line */
@@ -83,15 +83,15 @@ const i = {
83
83
  /** Path to translations object */
84
84
  translationsPath: e(t(), "window.trans.en"),
85
85
  /** Migration date for template compatibility */
86
- migrationDate: e(p(), 1759696858),
86
+ migrationDate: e(b(), 1759696858),
87
87
  /** Email header settings */
88
- emailHeader: e(C, { senderName: "", subject: "" })
88
+ emailHeader: e(R, { senderName: "", subject: "" })
89
89
  }), T = o({
90
90
  /** Whether to show the header bar */
91
91
  showHeader: e(c(), !0),
92
92
  /** Custom label for back button (if shown) */
93
93
  backButtonLabel: e(t())
94
- }), A = o({
94
+ }), f = o({
95
95
  /** Enable dynamic content insertion */
96
96
  dynamicContent: e(c(), !0),
97
97
  /** Enable save as template functionality */
@@ -106,7 +106,7 @@ const i = {
106
106
  unsubscribe: e(c(), !0),
107
107
  /** Disable modules panel in the editor */
108
108
  modulesDisabled: e(c(), !1)
109
- }), f = n([
109
+ }), A = n([
110
110
  "amp-accordion",
111
111
  "amp-carousel",
112
112
  "amp-form-controls",
@@ -131,7 +131,7 @@ const i = {
131
131
  ]), E = o({
132
132
  /** Default blocks to exclude from the editor */
133
133
  excludeDefaults: e(
134
- a(f),
134
+ a(A),
135
135
  []
136
136
  ),
137
137
  /** Custom blocks to include in the editor */
@@ -145,7 +145,7 @@ const i = {
145
145
  /** Human-readable description */
146
146
  description: e(t()),
147
147
  /** Priority for rule ordering (lower = earlier) */
148
- priority: p()
148
+ priority: b()
149
149
  }), N = o({
150
150
  ...l.entries,
151
151
  type: r("replace"),
@@ -173,21 +173,32 @@ const i = {
173
173
  ...l.entries,
174
174
  type: r("custom"),
175
175
  /** Custom processor function */
176
- processor: b(
177
- (d) => typeof d == "function",
176
+ processor: d(
177
+ (i) => typeof i == "function",
178
178
  "processor must be a function"
179
179
  )
180
- }), B = S("type", [
180
+ }), x = S("type", [
181
181
  N,
182
182
  O,
183
183
  L,
184
184
  v
185
- ]), P = o({
185
+ ]), B = o({
186
186
  /** Custom compiler rules to apply */
187
- customRules: e(a(B), []),
187
+ customRules: e(a(x), []),
188
188
  /** Skip default compiler rules */
189
189
  ignoreDefaultRules: e(c(), !1)
190
- }), x = o({
190
+ }), P = o({
191
+ /**
192
+ * External validation handler called before save completes.
193
+ * Return false to cancel the save operation.
194
+ */
195
+ externalValidation: e(
196
+ d(
197
+ (i) => typeof i == "function",
198
+ "externalValidation must be a function"
199
+ )
200
+ )
201
+ }), D = o({
191
202
  // Required sections
192
203
  /** Identity configuration (required) */
193
204
  identity: h,
@@ -195,37 +206,40 @@ const i = {
195
206
  partner: k,
196
207
  // Optional sections (with defaults)
197
208
  /** Template content and presets */
198
- template: e(R, {}),
209
+ template: e(C, {}),
199
210
  /** Editor settings */
200
211
  editor: e(I, {}),
201
212
  /** UI configuration */
202
213
  ui: e(T, {}),
203
214
  /** Feature toggles */
204
- features: e(A, {}),
215
+ features: e(f, {}),
205
216
  /** Block configuration */
206
217
  blocks: e(E, {}),
207
218
  /** Compiler configuration */
208
- compiler: e(P, {})
219
+ compiler: e(B, {}),
220
+ /** Callbacks and event handlers */
221
+ callbacks: e(P, {})
209
222
  });
210
223
  export {
211
224
  E as BlocksSchema,
212
- B as CompilerRuleSchema,
213
- P as CompilerSchema,
225
+ P as CallbacksSchema,
226
+ x as CompilerRuleSchema,
227
+ B as CompilerSchema,
214
228
  g as CustomBlockTypeSchema,
215
229
  v as CustomRuleSchema,
216
- f as DefaultBlockTypeSchema,
230
+ A as DefaultBlockTypeSchema,
217
231
  y as DynamicContentSchema,
218
232
  I as EditorSchema,
219
- C as EmailHeaderSchema,
220
- A as FeaturesSchema,
221
- x as GuidoConfigSchema,
233
+ R as EmailHeaderSchema,
234
+ f as FeaturesSchema,
235
+ D as GuidoConfigSchema,
222
236
  h as IdentitySchema,
223
- i as MessageType,
237
+ m as MessageType,
224
238
  k as PartnerSchema,
225
239
  s as ProductType,
226
240
  O as RegexRuleSchema,
227
241
  L as RemoveRuleSchema,
228
242
  N as ReplaceRuleSchema,
229
- R as TemplateSchema,
243
+ C as TemplateSchema,
230
244
  T as UISchema
231
245
  };
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "9cd25be3"
15
+ "282ca4d1"
16
16
  );
17
17
  const v = s.exports;
18
18
  export {
@@ -1,55 +1,54 @@
1
- import { defineComponent as q, defineAsyncComponent as U, ref as W, computed as I, watch as z, onMounted as K, onUnmounted as M } from "vue";
2
- import { provideGuidoActions as j } from "../composables/useGuidoActions.js";
3
- import { usePartner as J } from "../composables/usePartner.js";
4
- import { useStripo as Q } from "../composables/useStripo.js";
5
- import { useTimerClone as V } from "../composables/useTimerClone.js";
6
- import { migrate as L } from "../config/migrator/index.js";
7
- import X from "./organisms/base/Toaster.vue.js";
8
- import Y from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
9
- import Z from "./organisms/header/HeaderWrapper.vue.js";
10
- import $ from "./organisms/LoadingWrapper.vue.js";
11
- import ee from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
12
- import oe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
13
- import { useStripoApi as te } from "../services/stripoApi.js";
14
- import { useConfigStore as ne } from "../stores/config.js";
15
- import { useDynamicContentStore as re } from "../stores/dynamic-content.js";
16
- import { useEditorStore as se } from "../stores/editor.js";
17
- import { usePreviewStore as ce } from "../stores/preview.js";
18
- import { useToasterStore as ie } from "../stores/toaster.js";
19
- import { useUnsubscribeStore as ae } from "../stores/unsubscribe.js";
20
- const Pe = /* @__PURE__ */ q({
1
+ import { defineComponent as x, defineAsyncComponent as P, ref as B, computed as U, watch as N, onMounted as z, onUnmounted as K } from "vue";
2
+ import { provideGuidoActions as M } from "../composables/useGuidoActions.js";
3
+ import { usePartner as j } from "../composables/usePartner.js";
4
+ import { useStripo as q } from "../composables/useStripo.js";
5
+ import { useTimerClone as J } from "../composables/useTimerClone.js";
6
+ import { migrate as W } from "../config/migrator/index.js";
7
+ import Q from "./organisms/base/Toaster.vue.js";
8
+ import V from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
9
+ import X from "./organisms/header/HeaderWrapper.vue.js";
10
+ import Y from "./organisms/LoadingWrapper.vue.js";
11
+ import Z from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
12
+ import $ from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
13
+ import { useStripoApi as ee } from "../services/stripoApi.js";
14
+ import { useConfigStore as oe } from "../stores/config.js";
15
+ import { useDynamicContentStore as te } from "../stores/dynamic-content.js";
16
+ import { useEditorStore as ne } from "../stores/editor.js";
17
+ import { usePreviewStore as re } from "../stores/preview.js";
18
+ import { useUnsubscribeStore as ce } from "../stores/unsubscribe.js";
19
+ const Ee = /* @__PURE__ */ x({
21
20
  __name: "Guido",
22
21
  props: {
23
22
  config: null
24
23
  },
25
24
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
26
- setup(A, { expose: R, emit: t }) {
27
- const u = A, F = U(
25
+ setup(_, { expose: I, emit: t }) {
26
+ const l = _, L = P(
28
27
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
29
- ), G = U(
28
+ ), A = P(
30
29
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
31
- ), p = W(), i = re(), v = ae(), f = ie(), n = ne();
32
- n.init(u.config);
33
- const a = se(), H = ce(), r = I(() => a.hasChanges), { isTestPartner: O } = J(), y = () => {
30
+ ), p = B(), s = te(), u = ce(), n = oe();
31
+ n.init(l.config);
32
+ const i = ne(), F = re(), r = U(() => i.hasChanges), { isTestPartner: G } = j(), v = () => {
34
33
  var e;
35
34
  return (e = p.value) == null ? void 0 : e.handleSave(!0);
36
- }, { templateId: m, userId: h, partnerName: b, productType: g, username: S, template: o } = n, s = (o == null ? void 0 : o.html) || "", w = (o == null ? void 0 : o.css) || "", d = (o == null ? void 0 : o.preselectedDynamicContent) || [];
37
- a.templateId = m;
38
- const c = W(!1), { initPlugin: C } = Q({
39
- emailId: m,
40
- userId: h,
41
- username: S,
42
- partnerName: b,
43
- productType: g,
44
- preselectedDynamicContentList: d,
35
+ }, { templateId: a, userId: y, partnerName: h, productType: f, username: b, template: o } = n, c = (o == null ? void 0 : o.html) || "", g = (o == null ? void 0 : o.css) || "", m = (o == null ? void 0 : o.preselectedDynamicContent) || [];
36
+ i.templateId = a;
37
+ const { initPlugin: S } = q({
38
+ emailId: a,
39
+ userId: y,
40
+ username: b,
41
+ partnerName: h,
42
+ productType: f,
43
+ preselectedDynamicContentList: m,
45
44
  onReady: () => {
46
45
  console.debug("guido:ready"), t("ready");
47
46
  }
48
- }), { getDefaultTemplate: D } = te(), { cloneTimersOnSave: E, hasTimerBlocks: T } = V(), x = I(() => {
47
+ }), { getDefaultTemplate: w } = ee(), { cloneTimersOnSave: C, hasTimerBlocks: D } = J(), H = U(() => {
49
48
  var e;
50
49
  return !((e = n.ui) != null && e.showHeader);
51
50
  });
52
- j({
51
+ M({
53
52
  onBack: () => {
54
53
  console.debug("guido:back"), t("back");
55
54
  },
@@ -63,52 +62,51 @@ const Pe = /* @__PURE__ */ q({
63
62
  console.debug("guido:test-email:click"), t("test-email:click");
64
63
  }
65
64
  });
66
- const k = (e) => {
67
- console.debug("dynamic-content:close", e), i.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
68
- }, _ = () => {
65
+ const E = (e) => {
66
+ console.debug("dynamic-content:close", e), s.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
67
+ }, k = () => {
69
68
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
70
69
  };
71
- z(() => r.value, () => {
70
+ N(() => r.value, () => {
72
71
  t("on-change", r.value);
73
72
  });
74
- const l = (e) => {
75
- const P = e, { attribute: B, position: N } = P.detail;
76
- console.debug("dynamic-content:open", P.detail), t("dynamic-content:open", B, N);
73
+ const d = (e) => {
74
+ const T = e, { attribute: O, position: R } = T.detail;
75
+ console.debug("dynamic-content:open", T.detail), t("dynamic-content:open", O, R);
77
76
  };
78
- return K(async () => {
77
+ return z(async () => {
79
78
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
80
79
  try {
81
- v.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
80
+ u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
82
81
  let e = {
83
- html: s && await L(s),
84
- css: w,
82
+ html: c && await W(c),
83
+ css: g,
85
84
  forceRecreate: !0
86
85
  // TODO: It should be false for old templates. We will communicate with Stripo
87
86
  };
88
- e.html || (e = await D(), e.html = await L(e.html)), T(e.html) && (e.html = await E(e.html)), await C(e), i.selectedDynamicContentList = d;
87
+ e.html || (e = await w(), e.html = await W(e.html)), D(e.html) && (e.html = await C(e.html)), await S(e), s.selectedDynamicContentList = m;
89
88
  } catch (e) {
90
89
  console.error("Failed to initialize Stripo editor:", e);
91
90
  }
92
- document.addEventListener("dynamic-content:open", l), c.value = !0;
93
- }), M(() => {
94
- var e;
95
- c.value && (f.hideToaster(), (e = document.querySelector("#guido__toaster")) == null || e.remove()), c.value = !1, document.removeEventListener("dynamic-content:open", l);
91
+ document.addEventListener("dynamic-content:open", d);
92
+ }), K(() => {
93
+ document.removeEventListener("dynamic-content:open", d);
96
94
  try {
97
95
  window.UIEditor.removeEditor();
98
96
  } catch {
99
97
  console.debug("Failed to remove Stripo editor: No editor found");
100
98
  }
101
99
  n.reset();
102
- }), R({
100
+ }), I({
103
101
  dynamicContent: {
104
- insert: k,
105
- close: _
102
+ insert: E,
103
+ close: k
106
104
  },
107
105
  hasChanges: r,
108
- saveSilent: y
109
- }), { __sfc: !0, PreviewContainer: F, OnboardingWrapper: G, headerWrapperRef: p, dynamicContentStore: i, unsubscribeStore: v, toasterStore: f, props: u, configStore: n, editorStore: a, previewStore: H, hasChanges: r, isTestPartner: O, saveSilent: y, templateId: m, userId: h, partnerName: b, productType: g, username: S, templateConfig: o, html: s, css: w, preselectedDynamicContentList: d, editorReady: c, emit: t, initPlugin: C, getDefaultTemplate: D, cloneTimersOnSave: E, hasTimerBlocks: T, noHeader: x, insertDynamicContent: k, closeDynamicContent: _, handleDynamicContentOpen: l, Toaster: X, FilterSelectionDrawer: Y, HeaderWrapper: Z, LoadingWrapper: $, SaveAsTemplateDrawer: ee, UnsubscribeWrapper: oe };
106
+ saveSilent: v
107
+ }), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: p, dynamicContentStore: s, unsubscribeStore: u, props: l, configStore: n, editorStore: i, previewStore: F, hasChanges: r, isTestPartner: G, saveSilent: v, templateId: a, userId: y, partnerName: h, productType: f, username: b, templateConfig: o, html: c, css: g, preselectedDynamicContentList: m, emit: t, initPlugin: S, getDefaultTemplate: w, cloneTimersOnSave: C, hasTimerBlocks: D, noHeader: H, insertDynamicContent: E, closeDynamicContent: k, handleDynamicContentOpen: d, Toaster: Q, FilterSelectionDrawer: V, HeaderWrapper: X, LoadingWrapper: Y, SaveAsTemplateDrawer: Z, UnsubscribeWrapper: $ };
110
108
  }
111
109
  });
112
110
  export {
113
- Pe as default
111
+ Ee as default
114
112
  };
@@ -1,17 +1,17 @@
1
- import n from "./Toaster.vue2.js";
1
+ import e from "./Toaster.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var r = function() {
4
- var o = this, e = o._self._c, t = o._self._setupProxy;
5
- return e(t.InToasts, { attrs: { id: "guido__toaster", "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
4
+ var o = this, n = o._self._c, t = o._self._setupProxy;
5
+ return n(t.InToasts, { attrs: { "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
6
6
  }, a = [], _ = /* @__PURE__ */ s(
7
- n,
7
+ e,
8
8
  r,
9
9
  a,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const f = _.exports;
14
+ const l = _.exports;
15
15
  export {
16
- f as default
16
+ l as default
17
17
  };
@@ -1,16 +1,16 @@
1
1
  import i from "./EmailSizeIndicator.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var r = function() {
3
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
5
  var s = this, e = s._self._c, t = s._self._setupProxy;
6
- return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.InTooltipV2, { attrs: { id: "email-size-tooltip", "icon-status": "", "static-position": "bottom center", "dynamic-position": !1, text: t.trans("email-editor.preview-design-size-tooltip") } })], 1);
7
- }, a = [], n = /* @__PURE__ */ o(
6
+ return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.InTooltip, { staticClass: "d-f ml-1", attrs: { id: "email-size-tooltip", align: "center", position: "bottom", text: t.trans("email-editor.preview-design-size-tooltip") } })], 1);
7
+ }, a = [], n = /* @__PURE__ */ r(
8
8
  i,
9
- r,
9
+ o,
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "eb2f9f20"
13
+ "c2adc57d"
14
14
  );
15
15
  const m = n.exports;
16
16
  export {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
2
2
  import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
3
  import { usePreviewStore as _ } from "../../../../stores/preview.js";
4
- import { InTooltipV2 as v, InProgress as f } from "@useinsider/design-system-vue";
4
+ import { InTooltip as v, InProgress as f } from "@useinsider/design-system-vue";
5
5
  const S = /* @__PURE__ */ c({
6
6
  __name: "EmailSizeIndicator",
7
7
  setup(w) {
@@ -17,7 +17,7 @@ const S = /* @__PURE__ */ c({
17
17
  }, i = p();
18
18
  return u(() => t.previewHtml, () => {
19
19
  r();
20
- }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltipV2: v };
20
+ }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltip: v };
21
21
  }
22
22
  });
23
23
  export {
@@ -1,4 +1,4 @@
1
- import { defineComponent as H, ref as m, computed as _ } from "vue";
1
+ import { defineComponent as H, ref as c, computed as _ } from "vue";
2
2
  import { useConfig as h } from "../../../composables/useConfig.js";
3
3
  import { useExport as V } from "../../../composables/useExport.js";
4
4
  import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
@@ -10,25 +10,25 @@ import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
10
10
  import { InButtonV2 as A } from "@useinsider/design-system-vue";
11
11
  const J = /* @__PURE__ */ H({
12
12
  __name: "RightSlot",
13
- setup(k, { expose: c }) {
14
- const { config: u } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = m(!1), s = m(!1), f = x(), v = () => {
13
+ setup(k, { expose: u }) {
14
+ const { config: f } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = c(!1), s = c(!1), v = x(), d = () => {
15
15
  if (o.isVersionHistoryOpen) {
16
16
  a();
17
17
  return;
18
18
  }
19
19
  i();
20
- }, d = async () => {
20
+ }, y = async () => {
21
21
  e.value = !0, await r(), e.value = !1;
22
- }, y = () => {
22
+ }, S = () => {
23
23
  o.isSaveAsTemplateDrawerOpen = !0;
24
- }, S = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
24
+ }, g = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
25
25
  s.value = !0, o.loadingStatus = !0;
26
- const g = await n(p);
27
- return s.value = !1, p && (o.loadingStatus = !1), g;
26
+ const m = await n(p);
27
+ return s.value = !1, (p || !m) && (o.loadingStatus = !1), m;
28
28
  };
29
- return c({
29
+ return u({
30
30
  handleSave: l
31
- }), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: f, handleVersionHistory: v, handleExport: d, handleSaveAs: y, versionHistoryTooltipText: S, handleSave: l, getTooltipOptions: O, InButtonV2: A };
31
+ }), { __sfc: !0, config: f, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: v, handleVersionHistory: d, handleExport: y, handleSaveAs: S, versionHistoryTooltipText: g, handleSave: l, getTooltipOptions: O, InButtonV2: A };
32
32
  }
33
33
  });
34
34
  export {
@@ -1,26 +1,27 @@
1
- import { useConfigStore as F } from "../stores/config.js";
2
- import { storeToRefs as I } from "pinia";
3
- const k = () => {
4
- const e = F(), {
1
+ import { useConfigStore as I } from "../stores/config.js";
2
+ import { storeToRefs as T } from "pinia";
3
+ const w = () => {
4
+ const e = I(), {
5
5
  config: t,
6
6
  initialized: o,
7
7
  identity: r,
8
8
  partner: i,
9
- template: n,
10
- editor: a,
9
+ template: a,
10
+ editor: n,
11
11
  ui: s,
12
- features: u,
13
- blocks: d,
14
- compiler: p,
15
- templateId: c,
12
+ features: c,
13
+ blocks: u,
14
+ compiler: d,
15
+ callbacks: l,
16
+ templateId: p,
16
17
  userId: f,
17
18
  variationId: m,
18
19
  partnerName: g,
19
- productType: l,
20
- messageType: b,
21
- username: C,
22
- showHeader: y
23
- } = I(e);
20
+ productType: b,
21
+ messageType: C,
22
+ username: y,
23
+ showHeader: E
24
+ } = T(e);
24
25
  return {
25
26
  // State refs
26
27
  config: t,
@@ -28,26 +29,27 @@ const k = () => {
28
29
  // Section refs
29
30
  identity: r,
30
31
  partner: i,
31
- template: n,
32
- editor: a,
32
+ template: a,
33
+ editor: n,
33
34
  ui: s,
34
- features: u,
35
- blocks: d,
36
- compiler: p,
35
+ features: c,
36
+ blocks: u,
37
+ compiler: d,
38
+ callbacks: l,
37
39
  // Convenience refs
38
- templateId: c,
40
+ templateId: p,
39
41
  userId: f,
40
42
  variationId: m,
41
43
  partnerName: g,
42
- productType: l,
43
- messageType: b,
44
- username: C,
45
- showHeader: y,
44
+ productType: b,
45
+ messageType: C,
46
+ username: y,
47
+ showHeader: E,
46
48
  // Methods
47
49
  getConfig: () => t.value,
48
- isFeatureEnabled: (E) => e.isFeatureEnabled(E)
50
+ isFeatureEnabled: (F) => e.isFeatureEnabled(F)
49
51
  };
50
52
  };
51
53
  export {
52
- k as useConfig
54
+ w as useConfig
53
55
  };
@@ -1,15 +1,17 @@
1
- import { useSaveStart as i, useSaveComplete as m } from "./useGuidoActions.js";
2
- import { useTemplatePreparation as n } from "../utils/templatePreparation.js";
3
- import { useHtmlValidator as l } from "./useHtmlValidator.js";
4
- const f = () => {
5
- const e = i(), a = m(), { validateHtml: s } = l();
6
- return { save: async (o = !1) => {
7
- e();
8
- const { prepareTemplateDetails: r } = n(), t = await r();
9
- if (await s(t.compiledHtml, t.dynamicContentList, !0))
10
- return o || a(t), t;
1
+ import { useConfig as l } from "./useConfig.js";
2
+ import { useSaveStart as m, useSaveComplete as c } from "./useGuidoActions.js";
3
+ import { useTemplatePreparation as d } from "../utils/templatePreparation.js";
4
+ import { useHtmlValidator as p } from "./useHtmlValidator.js";
5
+ const w = () => {
6
+ const i = m(), s = c(), { validateHtml: o } = p(), { callbacks: a } = l();
7
+ return { save: async (r = !1) => {
8
+ var e;
9
+ i();
10
+ const { prepareTemplateDetails: n } = d(), t = await n();
11
+ if (await o(t.compiledHtml, t.dynamicContentList, !0) && !((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)))
12
+ return r || s(t), t;
11
13
  } };
12
14
  };
13
15
  export {
14
- f as useSave
16
+ w as useSave
15
17
  };
@@ -1,21 +1,21 @@
1
1
  import { ExtensionBuilder as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { UnsubscribeBlock as i } from "./block.js";
3
3
  import { UnsubscribeControl as t } from "./control.js";
4
- import { PreviewUIElement as o } from "./elements/preview.js";
5
- import { UnsubscribeIconsRegistry as r } from "./iconsRegistry.js";
6
- import { SettingsPanel as s } from "./settingsPanel.js";
4
+ import { PreviewUIElement as s } from "./elements/preview.js";
5
+ import { UnsubscribeIconsRegistry as o } from "./iconsRegistry.js";
6
+ import { SettingsPanel as r } from "./settingsPanel.js";
7
7
  import n from "./styles.css.js";
8
- import { UnsubscribeTagRegistry as l } from "./tagRegistry.js";
9
- const f = new e().addBlock(i).withSettingsPanelRegistry(s).addControl(t).addUiElement(o).addStyles(n).withLocalization({
8
+ import { UnsubscribeTagRegistry as c } from "./tagRegistry.js";
9
+ const g = new e().addBlock(i).withSettingsPanelRegistry(r).addControl(t).addUiElement(s).addStyles(n).withLocalization({
10
10
  en: {
11
- "Unsubscribe Block": "Unsubscribe Block",
12
- "Unsubscribe Block Description": "Add an unsubscribe link to your email",
11
+ "Unsubscribe Block": "Unsubscribe",
12
+ "Unsubscribe Block Description": "Unsubscribe lets you add an Unsubscribe Link to direct users to opt out of receiving your messages.",
13
13
  "Select Template": "Select Template",
14
14
  "Unsubscribe Template": "Unsubscribe Template",
15
15
  Showing: "Showing",
16
16
  of: "of"
17
17
  }
18
- }).withUiElementTagRegistry(l).withIconsRegistry(r).build();
18
+ }).withUiElementTagRegistry(c).withIconsRegistry(o).build();
19
19
  export {
20
- f as default
20
+ g as default
21
21
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-06e6f7a7] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-9cd25be3]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-9cd25be3]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-9cd25be3]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-bb3bb07c] .guido__verion-history-view-option-selection-desktop svg,[data-v-bb3bb07c] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-bb3bb07c] .in-segments-wrapper__button_selected,[data-v-bb3bb07c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-eb2f9f20] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-4b876c1b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-06e6f7a7] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-282ca4d1]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-282ca4d1]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-282ca4d1]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-bb3bb07c] .guido__verion-history-view-option-selection-desktop svg,[data-v-bb3bb07c] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-bb3bb07c] .in-segments-wrapper__button_selected,[data-v-bb3bb07c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-4b876c1b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
@@ -7,8 +7,8 @@
7
7
  * - Default values for optional configuration
8
8
  * - Validation utilities
9
9
  */
10
- export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, DynamicContentSchema, EmailHeaderSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, CompilerRuleSchema, CompilerRuleTypeSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, } from './schemas';
11
- export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput, EmailHeader, DynamicContent, DefaultBlockType, CustomBlockType, BlockType, FeatureName, CompilerRule, ReplaceRule, RegexRule, RemoveRule, CustomRule, DeepPartial, ConfigOverrides, } from './types';
10
+ export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, CompilerRuleSchema, CompilerRuleTypeSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, } from './schemas';
11
+ export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput, CallbacksConfig, CallbacksConfigInput, ExternalValidationHandler, EmailHeader, DynamicContent, DefaultBlockType, CustomBlockType, BlockType, FeatureName, CompilerRule, ReplaceRule, RegexRule, RemoveRule, CustomRule, DeepPartial, ConfigOverrides, } from './types';
12
12
  export { DEFAULT_EMAIL_HEADER, DEFAULT_TEMPLATE, DEFAULT_EDITOR, DEFAULT_UI, DEFAULT_FEATURES, DEFAULT_BLOCKS, DEFAULT_COMPILER, DEFAULT_PRODUCT_TYPE, DEFAULT_MESSAGE_TYPE, DEFAULT_USERNAME, EDITOR_TYPE, TEST_PARTNERS, isTestPartner, } from './defaults';
13
13
  export { validateConfig, parseConfig, parseConfigSafe, getValidationErrors, isValidConfig, validateIdentity, validatePartner, } from './validator';
14
14
  export type { ValidationResult, ValidationError, } from './validator';
@@ -5,7 +5,14 @@
5
5
  * All types are inferred from these schemas to ensure single source of truth.
6
6
  * @module @types/config/schemas
7
7
  */
8
+ import type { SavedTemplateDetails } from '../stripo';
8
9
  import * as v from 'valibot';
10
+ /**
11
+ * Handler function for external validation before save
12
+ * @param data - The template details to validate
13
+ * @returns Promise<boolean> - true if valid, false to cancel save
14
+ */
15
+ export type ExternalValidationHandler = (data: SavedTemplateDetails) => Promise<boolean>;
9
16
  /**
10
17
  * Message type constants for email templates
11
18
  */
@@ -344,6 +351,16 @@ export declare const CompilerSchema: v.ObjectSchema<{
344
351
  /** Skip default compiler rules */
345
352
  readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
346
353
  }, undefined>;
354
+ /**
355
+ * Callbacks configuration - event handlers and hooks
356
+ */
357
+ export declare const CallbacksSchema: v.ObjectSchema<{
358
+ /**
359
+ * External validation handler called before save completes.
360
+ * Return false to cancel the save operation.
361
+ */
362
+ readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
363
+ }, undefined>;
347
364
  /**
348
365
  * Complete Guido configuration schema
349
366
  *
@@ -356,6 +373,7 @@ export declare const CompilerSchema: v.ObjectSchema<{
356
373
  * - features: Feature toggles
357
374
  * - blocks: Block configuration
358
375
  * - compiler: HTML compilation
376
+ * - callbacks: Event handlers and hooks
359
377
  */
360
378
  export declare const GuidoConfigSchema: v.ObjectSchema<{
361
379
  /** Identity configuration (required) */
@@ -506,4 +524,12 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
506
524
  /** Skip default compiler rules */
507
525
  readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
508
526
  }, undefined>, {}>;
527
+ /** Callbacks and event handlers */
528
+ readonly callbacks: v.OptionalSchema<v.ObjectSchema<{
529
+ /**
530
+ * External validation handler called before save completes.
531
+ * Return false to cancel the save operation.
532
+ */
533
+ readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
534
+ }, undefined>, {}>;
509
535
  }, undefined>;
@@ -5,7 +5,7 @@
5
5
  * This ensures type definitions are always in sync with validation.
6
6
  * @module @types/config/types
7
7
  */
8
- import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema } from './schemas';
8
+ import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, ExternalValidationHandler } from './schemas';
9
9
  import type * as v from 'valibot';
10
10
  /**
11
11
  * Complete validated Guido configuration.
@@ -41,6 +41,10 @@ export type FeaturesConfig = v.InferOutput<typeof FeaturesSchema>;
41
41
  export type BlocksConfig = v.InferOutput<typeof BlocksSchema>;
42
42
  /** Compiler configuration (custom rules, ignore defaults) */
43
43
  export type CompilerConfig = v.InferOutput<typeof CompilerSchema>;
44
+ /** Callbacks configuration (event handlers and hooks) */
45
+ export type CallbacksConfig = v.InferOutput<typeof CallbacksSchema>;
46
+ /** Re-export ExternalValidationHandler for convenience */
47
+ export type { ExternalValidationHandler };
44
48
  /** Email header configuration (senderName, subject) */
45
49
  export type EmailHeader = v.InferOutput<typeof EmailHeaderSchema>;
46
50
  /** Dynamic content item */
@@ -85,6 +89,8 @@ export type FeaturesConfigInput = v.InferInput<typeof FeaturesSchema>;
85
89
  export type BlocksConfigInput = v.InferInput<typeof BlocksSchema>;
86
90
  /** Input type for compiler configuration */
87
91
  export type CompilerConfigInput = v.InferInput<typeof CompilerSchema>;
92
+ /** Input type for callbacks configuration */
93
+ export type CallbacksConfigInput = v.InferInput<typeof CallbacksSchema>;
88
94
  /** Default Stripo block types */
89
95
  export type DefaultBlockType = v.InferOutput<typeof DefaultBlockTypeSchema>;
90
96
  /** Custom Guido block types */
@@ -90,6 +90,9 @@ export declare const useConfig: () => {
90
90
  })[];
91
91
  ignoreDefaultRules: boolean;
92
92
  };
93
+ callbacks: {
94
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
95
+ };
93
96
  } | null>;
94
97
  initialized: import("vue").Ref<boolean>;
95
98
  identity: import("vue").ComputedRef<{
@@ -175,6 +178,9 @@ export declare const useConfig: () => {
175
178
  })[];
176
179
  ignoreDefaultRules: boolean;
177
180
  } | null>;
181
+ callbacks: import("vue").ComputedRef<{
182
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
183
+ } | null>;
178
184
  templateId: import("vue").ComputedRef<string>;
179
185
  userId: import("vue").ComputedRef<string>;
180
186
  variationId: import("vue").ComputedRef<string>;
@@ -1,4 +1,4 @@
1
- import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig } from '@@/Types/config';
1
+ import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, CallbacksConfig } from '@@/Types/config';
2
2
  interface ConfigStoreState {
3
3
  /** Whether the config has been initialized */
4
4
  initialized: boolean;
@@ -95,6 +95,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
95
95
  })[];
96
96
  ignoreDefaultRules: boolean;
97
97
  };
98
+ callbacks: {
99
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
100
+ };
98
101
  } | null;
99
102
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => IdentityConfig | null;
100
103
  /**
@@ -186,6 +189,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
186
189
  })[];
187
190
  ignoreDefaultRules: boolean;
188
191
  };
192
+ callbacks: {
193
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
194
+ };
189
195
  } | null;
190
196
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => PartnerConfig | null;
191
197
  /**
@@ -277,6 +283,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
277
283
  })[];
278
284
  ignoreDefaultRules: boolean;
279
285
  };
286
+ callbacks: {
287
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
288
+ };
280
289
  } | null;
281
290
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => TemplateConfig | null;
282
291
  /**
@@ -368,6 +377,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
368
377
  })[];
369
378
  ignoreDefaultRules: boolean;
370
379
  };
380
+ callbacks: {
381
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
382
+ };
371
383
  } | null;
372
384
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => EditorConfig | null;
373
385
  /**
@@ -459,6 +471,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
459
471
  })[];
460
472
  ignoreDefaultRules: boolean;
461
473
  };
474
+ callbacks: {
475
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
476
+ };
462
477
  } | null;
463
478
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => UIConfig | null;
464
479
  /**
@@ -550,6 +565,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
550
565
  })[];
551
566
  ignoreDefaultRules: boolean;
552
567
  };
568
+ callbacks: {
569
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
570
+ };
553
571
  } | null;
554
572
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => FeaturesConfig | null;
555
573
  /**
@@ -641,6 +659,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
641
659
  })[];
642
660
  ignoreDefaultRules: boolean;
643
661
  };
662
+ callbacks: {
663
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
664
+ };
644
665
  } | null;
645
666
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => BlocksConfig | null;
646
667
  /**
@@ -732,8 +753,105 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
732
753
  })[];
733
754
  ignoreDefaultRules: boolean;
734
755
  };
756
+ callbacks: {
757
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
758
+ };
735
759
  } | null;
736
760
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CompilerConfig | null;
761
+ /**
762
+ * Get the callbacks configuration
763
+ */
764
+ callbacks: (state: {
765
+ initialized: boolean;
766
+ config: {
767
+ identity: {
768
+ templateId: string;
769
+ userId: string;
770
+ variationId?: string | undefined;
771
+ };
772
+ partner: {
773
+ name: string;
774
+ productType: 60 | 49 | 97;
775
+ messageType: 1 | 2;
776
+ username: string;
777
+ };
778
+ template: {
779
+ html: string;
780
+ css: string;
781
+ preselectedDynamicContent: {
782
+ text: string;
783
+ value: string;
784
+ fallback?: string | undefined;
785
+ format?: {
786
+ key: string;
787
+ value: string;
788
+ } | undefined;
789
+ }[];
790
+ selectedUnsubscribePages: number[];
791
+ };
792
+ editor: {
793
+ locale: string;
794
+ translationsPath: string;
795
+ migrationDate: number;
796
+ emailHeader: {
797
+ senderName: string;
798
+ subject: string;
799
+ };
800
+ };
801
+ ui: {
802
+ showHeader: boolean;
803
+ backButtonLabel?: string | undefined;
804
+ };
805
+ features: {
806
+ dynamicContent: boolean;
807
+ saveAsTemplate: boolean;
808
+ versionHistory: boolean;
809
+ testMessage: boolean;
810
+ displayConditions: boolean;
811
+ unsubscribe: boolean;
812
+ modulesDisabled: boolean;
813
+ };
814
+ blocks: {
815
+ excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
816
+ includeCustoms: ("dynamic-content" | "checkbox-block" | "radio-button-block" | "recommendation-block" | "unsubscribe-block" | "coupon-block" | "items-block")[];
817
+ };
818
+ compiler: {
819
+ customRules: ({
820
+ type: "replace";
821
+ search: string;
822
+ replacement: string;
823
+ replaceAll?: boolean | undefined;
824
+ id: string;
825
+ description?: string | undefined;
826
+ priority: number;
827
+ } | {
828
+ type: "regex";
829
+ pattern: string;
830
+ replacement: string;
831
+ flags?: string | undefined;
832
+ id: string;
833
+ description?: string | undefined;
834
+ priority: number;
835
+ } | {
836
+ type: "remove";
837
+ targets: string[];
838
+ id: string;
839
+ description?: string | undefined;
840
+ priority: number;
841
+ } | {
842
+ type: "custom";
843
+ processor: (html: string) => string;
844
+ id: string;
845
+ description?: string | undefined;
846
+ priority: number;
847
+ })[];
848
+ ignoreDefaultRules: boolean;
849
+ };
850
+ callbacks: {
851
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
852
+ };
853
+ } | null;
854
+ } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CallbacksConfig | null;
737
855
  /**
738
856
  * Get the template ID
739
857
  */
@@ -823,6 +941,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
823
941
  })[];
824
942
  ignoreDefaultRules: boolean;
825
943
  };
944
+ callbacks: {
945
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
946
+ };
826
947
  } | null;
827
948
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
828
949
  /**
@@ -914,6 +1035,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
914
1035
  })[];
915
1036
  ignoreDefaultRules: boolean;
916
1037
  };
1038
+ callbacks: {
1039
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1040
+ };
917
1041
  } | null;
918
1042
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
919
1043
  /**
@@ -1005,6 +1129,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1005
1129
  })[];
1006
1130
  ignoreDefaultRules: boolean;
1007
1131
  };
1132
+ callbacks: {
1133
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1134
+ };
1008
1135
  } | null;
1009
1136
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1010
1137
  /**
@@ -1096,6 +1223,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1096
1223
  })[];
1097
1224
  ignoreDefaultRules: boolean;
1098
1225
  };
1226
+ callbacks: {
1227
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1228
+ };
1099
1229
  } | null;
1100
1230
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1101
1231
  /**
@@ -1187,6 +1317,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1187
1317
  })[];
1188
1318
  ignoreDefaultRules: boolean;
1189
1319
  };
1320
+ callbacks: {
1321
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1322
+ };
1190
1323
  } | null;
1191
1324
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
1192
1325
  /**
@@ -1278,6 +1411,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1278
1411
  })[];
1279
1412
  ignoreDefaultRules: boolean;
1280
1413
  };
1414
+ callbacks: {
1415
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1416
+ };
1281
1417
  } | null;
1282
1418
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
1283
1419
  /**
@@ -1369,6 +1505,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1369
1505
  })[];
1370
1506
  ignoreDefaultRules: boolean;
1371
1507
  };
1508
+ callbacks: {
1509
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1510
+ };
1372
1511
  } | null;
1373
1512
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1374
1513
  /**
@@ -1460,6 +1599,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1460
1599
  })[];
1461
1600
  ignoreDefaultRules: boolean;
1462
1601
  };
1602
+ callbacks: {
1603
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1604
+ };
1463
1605
  } | null;
1464
1606
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
1465
1607
  /**
@@ -1551,6 +1693,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1551
1693
  })[];
1552
1694
  ignoreDefaultRules: boolean;
1553
1695
  };
1696
+ callbacks: {
1697
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1698
+ };
1554
1699
  } | null;
1555
1700
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => (feature: keyof FeaturesConfig) => boolean;
1556
1701
  }, {
@@ -48,7 +48,7 @@ const o = `.control-shadow-wrapper:has(.button) {
48
48
  }
49
49
 
50
50
  .e2e-text-insert-controls .control-shadow-wrapper:not(:last-of-type) {
51
- margin-right: 16px;
51
+ margin-right: 6px;
52
52
  }
53
53
 
54
54
  .flat-white > .button {
@@ -64,6 +64,13 @@ const s = o("guido-config", {
64
64
  var e;
65
65
  return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
66
66
  },
67
+ /**
68
+ * Get the callbacks configuration
69
+ */
70
+ callbacks: (i) => {
71
+ var e;
72
+ return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
73
+ },
67
74
  /**
68
75
  * Get the template ID
69
76
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.0.0-beta.81f9c55",
3
+ "version": "2.0.0-beta.84d530c",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",