@useinsider/guido 2.0.0-beta.e66a90a → 2.0.0-beta.e73ba15

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 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 = {
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 = {
3
3
  /** Promotional/marketing emails */
4
4
  PROMOTIONAL: 1,
5
5
  /** Transactional/system emails */
@@ -13,22 +13,22 @@ const m = {
13
13
  UNSUBSCRIBE_PAGES: 97
14
14
  }, h = o({
15
15
  /** Unique identifier for the template being edited */
16
- templateId: u(
16
+ templateId: m(
17
17
  t(),
18
- p(1, "templateId is required")
18
+ u(1, "templateId is required")
19
19
  ),
20
20
  /** Unique identifier for the user editing the template */
21
- userId: u(
21
+ userId: m(
22
22
  t(),
23
- p(1, "userId is required")
23
+ u(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: u(
29
+ name: m(
30
30
  t(),
31
- p(1, "partner.name is required")
31
+ u(1, "partner.name is required")
32
32
  ),
33
33
  /** Product type identifier */
34
34
  productType: e(
@@ -41,8 +41,8 @@ const m = {
41
41
  ),
42
42
  /** Message type (promotional or transactional) */
43
43
  messageType: e(
44
- n([m.PROMOTIONAL, m.TRANSACTIONAL]),
45
- m.PROMOTIONAL
44
+ n([i.PROMOTIONAL, i.TRANSACTIONAL]),
45
+ i.PROMOTIONAL
46
46
  ),
47
47
  /** Display name for the current user */
48
48
  username: e(t(), "Guido User")
@@ -71,29 +71,29 @@ const m = {
71
71
  []
72
72
  ),
73
73
  /** Selected unsubscribe page IDs */
74
- selectedUnsubscribePages: e(a(b()), []),
74
+ selectedUnsubscribePages: e(a(p()), []),
75
75
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
76
76
  forceRecreate: e(c(), !1)
77
- }), f = o({
77
+ }), C = o({
78
78
  /** Sender display name */
79
79
  senderName: e(t(), ""),
80
80
  /** Email subject line */
81
81
  subject: e(t(), "")
82
- }), C = o({
82
+ }), I = o({
83
83
  /** Locale for the editor UI */
84
84
  locale: e(t(), "en"),
85
85
  /** Path to translations object */
86
86
  translationsPath: e(t(), "window.trans.en"),
87
87
  /** Migration date for template compatibility */
88
- migrationDate: e(b(), 1759696858),
88
+ migrationDate: e(p(), 1759696858),
89
89
  /** Email header settings */
90
- emailHeader: e(f, { senderName: "", subject: "" })
91
- }), I = o({
90
+ emailHeader: e(C, { senderName: "", subject: "" })
91
+ }), T = o({
92
92
  /** Whether to show the header bar */
93
93
  showHeader: e(c(), !0),
94
94
  /** Custom label for back button (if shown) */
95
95
  backButtonLabel: e(t())
96
- }), T = o({
96
+ }), A = o({
97
97
  /** Enable dynamic content insertion */
98
98
  dynamicContent: e(c(), !0),
99
99
  /** Enable save as template functionality */
@@ -108,7 +108,7 @@ const m = {
108
108
  unsubscribe: e(c(), !0),
109
109
  /** Disable modules panel in the editor */
110
110
  modulesDisabled: e(c(), !1)
111
- }), A = n([
111
+ }), f = n([
112
112
  "amp-accordion",
113
113
  "amp-carousel",
114
114
  "amp-form-controls",
@@ -133,7 +133,7 @@ const m = {
133
133
  ]), E = o({
134
134
  /** Default blocks to exclude from the editor */
135
135
  excludeDefaults: e(
136
- a(A),
136
+ a(f),
137
137
  []
138
138
  ),
139
139
  /** Custom blocks to include in the editor */
@@ -147,7 +147,7 @@ const m = {
147
147
  /** Human-readable description */
148
148
  description: e(t()),
149
149
  /** Priority for rule ordering (lower = earlier) */
150
- priority: b()
150
+ priority: p()
151
151
  }), N = o({
152
152
  ...l.entries,
153
153
  type: r("replace"),
@@ -175,32 +175,21 @@ const m = {
175
175
  ...l.entries,
176
176
  type: r("custom"),
177
177
  /** Custom processor function */
178
- processor: d(
179
- (i) => typeof i == "function",
178
+ processor: b(
179
+ (d) => typeof d == "function",
180
180
  "processor must be a function"
181
181
  )
182
- }), x = S("type", [
182
+ }), B = S("type", [
183
183
  N,
184
184
  O,
185
185
  L,
186
186
  v
187
- ]), B = o({
187
+ ]), P = o({
188
188
  /** Custom compiler rules to apply */
189
- customRules: e(a(x), []),
189
+ customRules: e(a(B), []),
190
190
  /** Skip default compiler rules */
191
191
  ignoreDefaultRules: e(c(), !1)
192
- }), P = o({
193
- /**
194
- * External validation handler called before save completes.
195
- * Return false to cancel the save operation.
196
- */
197
- externalValidation: e(
198
- d(
199
- (i) => typeof i == "function",
200
- "externalValidation must be a function"
201
- )
202
- )
203
- }), D = o({
192
+ }), x = o({
204
193
  // Required sections
205
194
  /** Identity configuration (required) */
206
195
  identity: h,
@@ -210,38 +199,35 @@ const m = {
210
199
  /** Template content and presets */
211
200
  template: e(R, {}),
212
201
  /** Editor settings */
213
- editor: e(C, {}),
202
+ editor: e(I, {}),
214
203
  /** UI configuration */
215
- ui: e(I, {}),
204
+ ui: e(T, {}),
216
205
  /** Feature toggles */
217
- features: e(T, {}),
206
+ features: e(A, {}),
218
207
  /** Block configuration */
219
208
  blocks: e(E, {}),
220
209
  /** Compiler configuration */
221
- compiler: e(B, {}),
222
- /** Callbacks and event handlers */
223
- callbacks: e(P, {})
210
+ compiler: e(P, {})
224
211
  });
225
212
  export {
226
213
  E as BlocksSchema,
227
- P as CallbacksSchema,
228
- x as CompilerRuleSchema,
229
- B as CompilerSchema,
214
+ B as CompilerRuleSchema,
215
+ P as CompilerSchema,
230
216
  g as CustomBlockTypeSchema,
231
217
  v as CustomRuleSchema,
232
- A as DefaultBlockTypeSchema,
218
+ f as DefaultBlockTypeSchema,
233
219
  y as DynamicContentSchema,
234
- C as EditorSchema,
235
- f as EmailHeaderSchema,
236
- T as FeaturesSchema,
237
- D as GuidoConfigSchema,
220
+ I as EditorSchema,
221
+ C as EmailHeaderSchema,
222
+ A as FeaturesSchema,
223
+ x as GuidoConfigSchema,
238
224
  h as IdentitySchema,
239
- m as MessageType,
225
+ i as MessageType,
240
226
  k as PartnerSchema,
241
227
  s as ProductType,
242
228
  O as RegexRuleSchema,
243
229
  L as RemoveRuleSchema,
244
230
  N as ReplaceRuleSchema,
245
231
  R as TemplateSchema,
246
- I as UISchema
232
+ T as UISchema
247
233
  };
@@ -3,7 +3,7 @@ import o from "./AmpToggle.vue2.js";
3
3
  import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
5
  var r = this, t = r._self._c, e = r._self._setupProxy;
6
- return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-3 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11 bor-r-2", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: function(l) {
6
+ return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-2 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11 bor-r-2", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: function(l) {
7
7
  return e.previewStore.openErrorModal();
8
8
  } } }) : r._e()], 1)]);
9
9
  }, a = [], i = /* @__PURE__ */ n(
@@ -12,7 +12,7 @@ var s = function() {
12
12
  a,
13
13
  !1,
14
14
  null,
15
- "5196584c"
15
+ "b5997368"
16
16
  );
17
17
  const d = i.exports;
18
18
  export {
@@ -1,4 +1,4 @@
1
- import { defineComponent as H, ref as c, computed as _ } from "vue";
1
+ import { defineComponent as H, ref as m, 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: 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 = () => {
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 = () => {
15
15
  if (o.isVersionHistoryOpen) {
16
16
  a();
17
17
  return;
18
18
  }
19
19
  i();
20
- }, y = async () => {
20
+ }, d = async () => {
21
21
  e.value = !0, await r(), e.value = !1;
22
- }, S = () => {
22
+ }, y = () => {
23
23
  o.isSaveAsTemplateDrawerOpen = !0;
24
- }, g = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
24
+ }, S = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
25
25
  s.value = !0, o.loadingStatus = !0;
26
- const m = await n(p);
27
- return s.value = !1, (p || !m) && (o.loadingStatus = !1), m;
26
+ const g = await n(p);
27
+ return s.value = !1, p && (o.loadingStatus = !1), g;
28
28
  };
29
- return u({
29
+ return c({
30
30
  handleSave: l
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 };
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 };
32
32
  }
33
33
  });
34
34
  export {
@@ -1,27 +1,26 @@
1
- import { useConfigStore as I } from "../stores/config.js";
2
- import { storeToRefs as T } from "pinia";
3
- const w = () => {
4
- const e = I(), {
1
+ import { useConfigStore as F } from "../stores/config.js";
2
+ import { storeToRefs as I } from "pinia";
3
+ const k = () => {
4
+ const e = F(), {
5
5
  config: t,
6
6
  initialized: o,
7
7
  identity: r,
8
8
  partner: i,
9
- template: a,
10
- editor: n,
9
+ template: n,
10
+ editor: a,
11
11
  ui: s,
12
- features: c,
13
- blocks: u,
14
- compiler: d,
15
- callbacks: l,
16
- templateId: p,
12
+ features: u,
13
+ blocks: d,
14
+ compiler: p,
15
+ templateId: c,
17
16
  userId: f,
18
17
  variationId: m,
19
18
  partnerName: g,
20
- productType: b,
21
- messageType: C,
22
- username: y,
23
- showHeader: E
24
- } = T(e);
19
+ productType: l,
20
+ messageType: b,
21
+ username: C,
22
+ showHeader: y
23
+ } = I(e);
25
24
  return {
26
25
  // State refs
27
26
  config: t,
@@ -29,27 +28,26 @@ const w = () => {
29
28
  // Section refs
30
29
  identity: r,
31
30
  partner: i,
32
- template: a,
33
- editor: n,
31
+ template: n,
32
+ editor: a,
34
33
  ui: s,
35
- features: c,
36
- blocks: u,
37
- compiler: d,
38
- callbacks: l,
34
+ features: u,
35
+ blocks: d,
36
+ compiler: p,
39
37
  // Convenience refs
40
- templateId: p,
38
+ templateId: c,
41
39
  userId: f,
42
40
  variationId: m,
43
41
  partnerName: g,
44
- productType: b,
45
- messageType: C,
46
- username: y,
47
- showHeader: E,
42
+ productType: l,
43
+ messageType: b,
44
+ username: C,
45
+ showHeader: y,
48
46
  // Methods
49
47
  getConfig: () => t.value,
50
- isFeatureEnabled: (F) => e.isFeatureEnabled(F)
48
+ isFeatureEnabled: (E) => e.isFeatureEnabled(E)
51
49
  };
52
50
  };
53
51
  export {
54
- w as useConfig
52
+ k as useConfig
55
53
  };
@@ -1,17 +1,15 @@
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;
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;
13
11
  } };
14
12
  };
15
13
  export {
16
- w as useSave
14
+ f as useSave
17
15
  };
@@ -0,0 +1,7 @@
1
+ const _ = 3, R = 3, O = 9, D = 4;
2
+ export {
3
+ R as DEFAULT_CARDS_IN_ROW,
4
+ _ as DEFAULT_PRODUCTS_PER_ROW,
5
+ D as MAX_PRODUCTS_PER_ROW,
6
+ O as MAX_PRODUCT_COUNT
7
+ };
@@ -3,35 +3,36 @@ var d = (i, o, t) => o in i ? u(i, o, { enumerable: !0, configurable: !0, writab
3
3
  var s = (i, o, t) => d(i, typeof o != "symbol" ? o + "" : o, t);
4
4
  import { UEAttr as a } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as c } from "../../../common-control.js";
6
- import { useRecommendationExtensionStore as _ } from "../../store/recommendation.js";
7
- import { getCurrentLayout as m, regenerateProductRows as R, reapplySpacing as C } from "./utils.js";
8
- import { useDebounceFn as h } from "../../../../../node_modules/@vueuse/shared/index.js";
9
- const l = "recommendation-product-layout-control", e = {
6
+ import { MAX_PRODUCT_COUNT as _, MAX_PRODUCTS_PER_ROW as R } from "../../constants/layout.js";
7
+ import { useRecommendationExtensionStore as m } from "../../store/recommendation.js";
8
+ import { getCurrentLayout as C, regenerateProductRows as h, reapplySpacing as l } from "./utils.js";
9
+ import { useDebounceFn as p } from "../../../../../node_modules/@vueuse/shared/index.js";
10
+ const O = "recommendation-product-layout-control", e = {
10
11
  PRODUCT_COUNT: "size",
11
12
  PRODUCT_IN_ROW: "cardsInRow",
12
13
  PRODUCT_IN_ROW_LABEL: "cardsInRowLabel"
13
14
  };
14
- class I extends c {
15
+ class D extends c {
15
16
  constructor() {
16
17
  super(...arguments);
17
- s(this, "store", _());
18
+ s(this, "store", m());
18
19
  s(this, "storeUnsubscription", () => {
19
20
  });
20
- s(this, "_debouncedRegenerateProductRows", h(() => {
21
+ s(this, "_debouncedRegenerateProductRows", p(() => {
21
22
  this._regenerateProductRows();
22
23
  }, 500));
23
24
  }
24
25
  getId() {
25
- return l;
26
+ return O;
26
27
  }
27
28
  getTemplate() {
28
29
  return `
29
30
  <div class="product-layout-control-container">
30
31
  ${this._GuTwoColumns([
31
32
  this._GuLabel({ text: "Number of Products" }),
32
- this._GuCounter({ name: e.PRODUCT_COUNT, maxValue: 9 }),
33
+ this._GuCounter({ name: e.PRODUCT_COUNT, maxValue: _ }),
33
34
  this._GuLabel({ text: "Products in One Row", name: e.PRODUCT_IN_ROW_LABEL }),
34
- this._GuCounter({ name: e.PRODUCT_IN_ROW, maxValue: 4 })
35
+ this._GuCounter({ name: e.PRODUCT_IN_ROW, maxValue: R })
35
36
  ])}
36
37
  </div>
37
38
  `;
@@ -70,7 +71,7 @@ class I extends c {
70
71
  * Reads from store first (reliable during state transitions), falls back to DOM
71
72
  */
72
73
  _updateProductsInRowVisibility() {
73
- const r = (this.store.recommendationConfigs.orientation || m(this.currentNode)) === "vertical";
74
+ const r = (this.store.recommendationConfigs.orientation || C(this.currentNode)) === "vertical";
74
75
  this.api.setVisibility(e.PRODUCT_IN_ROW, r), this.api.setVisibility(e.PRODUCT_IN_ROW_LABEL, r);
75
76
  }
76
77
  _onProductCountChange(t) {
@@ -88,11 +89,11 @@ class I extends c {
88
89
  }), this._debouncedRegenerateProductRows();
89
90
  }
90
91
  _regenerateProductRows() {
91
- R({
92
+ h({
92
93
  currentNode: this.currentNode,
93
94
  documentModifier: this.api.getDocumentModifier(),
94
95
  afterRegenerate: () => {
95
- C({
96
+ l({
96
97
  currentNode: this.currentNode,
97
98
  documentModifier: this.api.getDocumentModifier()
98
99
  });
@@ -118,6 +119,6 @@ class I extends c {
118
119
  }
119
120
  }
120
121
  export {
121
- l as PRODUCT_LAYOUT_CONTROL_ID,
122
- I as ProductLayoutControl
122
+ O as PRODUCT_LAYOUT_CONTROL_ID,
123
+ D as ProductLayoutControl
123
124
  };
@@ -2,12 +2,13 @@ import { RecommendationFeedSourceMaps as u, PriceAttributes as c } from "../../.
2
2
  import { useRecommendationApi as p } from "../../../../services/recommendationApi.js";
3
3
  import { useConfigStore as m } from "../../../../stores/config.js";
4
4
  import { defineStore as d } from "pinia";
5
+ import { DEFAULT_CARDS_IN_ROW as f } from "../constants/layout.js";
5
6
  import { generateCompleteFilterQuery as l } from "../utils/filterUtil.js";
6
- const n = p(), f = () => ({
7
+ const n = p(), g = () => ({
7
8
  recommendationCampaignUrls: {},
8
9
  recommendationProducts: [],
9
10
  recommendationConfigs: {
10
- cardsInRow: 3,
11
+ cardsInRow: f,
11
12
  currencySettings: {
12
13
  name: "USD",
13
14
  value: "USD",
@@ -134,8 +135,8 @@ const n = p(), f = () => ({
134
135
  filterSelectionDrawerStatus: !1,
135
136
  filterList: {},
136
137
  filterGroup: 1
137
- }), C = d("guidoRecommendationExtension", {
138
- state: () => f(),
138
+ }), S = d("guidoRecommendationExtension", {
139
+ state: () => g(),
139
140
  getters: {
140
141
  hasFilters: (e) => !!e.recommendationConfigs.filters.length,
141
142
  getFilterGroupCount: (e) => {
@@ -263,5 +264,5 @@ const n = p(), f = () => ({
263
264
  }
264
265
  });
265
266
  export {
266
- C as useRecommendationExtensionStore
267
+ S as useRecommendationExtensionStore
267
268
  };
@@ -1,12 +1,12 @@
1
- import { prepareProductRows as s } from "./horizontal/template.js";
2
- import { prepareProductRows as c } from "./vertical/template.js";
3
- const R = 3;
4
- function u(r, o, t = {}) {
1
+ import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
2
+ import { prepareProductRows as R } from "./horizontal/template.js";
3
+ import { prepareProductRows as a } from "./vertical/template.js";
4
+ function P(r, o, p = {}) {
5
5
  if (o === "horizontal")
6
- return s(r);
7
- const { productsPerRow: e = R, composition: p } = t;
8
- return c(r, e, p);
6
+ return R(r);
7
+ const { productsPerRow: t = s, composition: e } = p;
8
+ return a(r, t, e);
9
9
  }
10
10
  export {
11
- u as prepareProductRows
11
+ P as prepareProductRows
12
12
  };
@@ -1,6 +1,7 @@
1
- import { DEFAULT_CARD_COMPOSITION as u, spacer as d, createBlockTemplate as R, DEFAULTS as m, getDefaultProducts as I, DEFAULT_CARD_VISIBILITY as L } from "../utils.js";
2
- import { verticalElementRenderer as w } from "./elementRenderer.js";
3
- const E = `
1
+ import { DEFAULT_PRODUCTS_PER_ROW as u } from "../../constants/layout.js";
2
+ import { DEFAULT_CARD_COMPOSITION as d, spacer as m, createBlockTemplate as R, DEFAULTS as I, getDefaultProducts as L, DEFAULT_CARD_VISIBILITY as w } from "../utils.js";
3
+ import { verticalElementRenderer as E } from "./elementRenderer.js";
4
+ const S = `
4
5
  <tr class="recommendation-product-row">
5
6
  <td>
6
7
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="product-card-wrapper">
@@ -10,7 +11,7 @@ const E = `
10
11
  </table>
11
12
  </td>
12
13
  </tr>
13
- `, S = `
14
+ `, b = `
14
15
  <tr
15
16
  class="recommendation-attribute-row"
16
17
  data-attribute-type="{-{-ATTR_TYPE-}-}"
@@ -18,15 +19,15 @@ const E = `
18
19
  {-{-DISPLAY_STYLE-}-}>
19
20
  {-{-CELLS-}-}
20
21
  </tr>
21
- `, b = 3;
22
- function _(r, e, o, n = u) {
22
+ `;
23
+ function _(r, e, o, n = d) {
23
24
  const c = (100 / e).toFixed(2);
24
25
  return n.filter((t) => o[t]).map((t) => {
25
- const l = L[t] ?? !0, i = l ? "" : 'style="display: none;"', a = r.map((p) => {
26
+ const l = w[t] ?? !0, i = l ? "" : 'style="display: none;"', a = r.map((p) => {
26
27
  const T = o[t];
27
28
  return T(p).replace("<td", `<td width="${c}%"`);
28
29
  }).join("");
29
- return S.replace("{-{-ATTR_TYPE-}-}", t).replace("{-{-VISIBILITY-}-}", l ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", i).replace("{-{-CELLS-}-}", a);
30
+ return b.replace("{-{-ATTR_TYPE-}-}", t).replace("{-{-VISIBILITY-}-}", l ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", i).replace("{-{-CELLS-}-}", a);
30
31
  }).join("");
31
32
  }
32
33
  function A(r, e, o, n) {
@@ -39,22 +40,22 @@ function A(r, e, o, n) {
39
40
  e,
40
41
  o,
41
42
  n
42
- ), a = E.replace("{-{-ATTRIBUTE_ROWS-}-}", i);
43
- return l > 0 ? d + a : a;
43
+ ), a = S.replace("{-{-ATTRIBUTE_ROWS-}-}", i);
44
+ return l > 0 ? m + a : a;
44
45
  }).join("");
45
46
  }
46
47
  function D(r, e, o) {
47
- return A(r, e, w, o);
48
+ return A(r, e, E, o);
48
49
  }
49
- function Y() {
50
+ function U() {
50
51
  const r = R("vertical"), e = D(
51
- I(),
52
- b
52
+ L(),
53
+ u
53
54
  );
54
- return r.replace("{-{-TITLE-}-}", m.TITLE).replace("{-{-PRODUCT_ROWS-}-}", e);
55
+ return r.replace("{-{-TITLE-}-}", I.TITLE).replace("{-{-PRODUCT_ROWS-}-}", e);
55
56
  }
56
57
  export {
57
- Y as getDefaultTemplate,
58
+ U as getDefaultTemplate,
58
59
  D as prepareProductRows,
59
60
  _ as prepareVerticalAttributeRows,
60
61
  A as prepareVerticalProductRows
@@ -1,28 +1,28 @@
1
1
  function l(t) {
2
2
  if (t.length === 0)
3
3
  return "";
4
- const o = t.sort((r, e) => r.filterNumber - e.filterNumber), n = o.map((r) => `[${r.attribute}][${r.operatorReplace}][${r.value}]`), [s, ...p] = n;
5
- let u = s;
4
+ const o = t.sort((r, e) => r.filterNumber - e.filterNumber), n = o.map((r) => `[${r.attribute}][${r.operatorReplace}][${r.value}]`), [i, ...p] = n;
5
+ let u = i;
6
6
  for (let r = 0; r < p.length; r++) {
7
7
  const e = o[r + 1].innerGroupOperator;
8
8
  u += `${e}${p[r]}`;
9
9
  }
10
10
  return `(${u})`;
11
11
  }
12
- function m(t) {
12
+ function f(t) {
13
13
  if (!t || t.length === 0)
14
14
  return "";
15
- const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), n = Object.keys(o).map(Number).sort((r, e) => r - e), s = n.map((r) => {
15
+ const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), n = Object.keys(o).map(Number).sort((r, e) => r - e), i = n.map((r) => {
16
16
  const e = o[r];
17
17
  return l(e);
18
- }), [p, ...u] = s;
19
- let i = p;
18
+ }), [p, ...u] = i;
19
+ let s = p;
20
20
  for (let r = 0; r < u.length; r++) {
21
21
  const e = n[r + 1], c = o[e][0].outerGroupOperator;
22
- i += `${c}${u[r]}`;
22
+ s += `${c}${u[r]}`;
23
23
  }
24
- return console.debug("🎉 Complete query generated:", i), i.trim();
24
+ return s.trim();
25
25
  }
26
26
  export {
27
- m as generateCompleteFilterQuery
27
+ f as generateCompleteFilterQuery
28
28
  };
@@ -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 s } from "./elements/preview.js";
5
- import { UnsubscribeIconsRegistry as o } from "./iconsRegistry.js";
6
- import { SettingsPanel as r } from "./settingsPanel.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";
7
7
  import n from "./styles.css.js";
8
- import { UnsubscribeTagRegistry as c } from "./tagRegistry.js";
9
- const g = new e().addBlock(i).withSettingsPanelRegistry(r).addControl(t).addUiElement(s).addStyles(n).withLocalization({
8
+ import { UnsubscribeTagRegistry as l } from "./tagRegistry.js";
9
+ const f = new e().addBlock(i).withSettingsPanelRegistry(s).addControl(t).addUiElement(o).addStyles(n).withLocalization({
10
10
  en: {
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.",
11
+ "Unsubscribe Block": "Unsubscribe Block",
12
+ "Unsubscribe Block Description": "Add an unsubscribe link to your email",
13
13
  "Select Template": "Select Template",
14
14
  "Unsubscribe Template": "Unsubscribe Template",
15
15
  Showing: "Showing",
16
16
  of: "of"
17
17
  }
18
- }).withUiElementTagRegistry(c).withIconsRegistry(o).build();
18
+ }).withUiElementTagRegistry(l).withIconsRegistry(r).build();
19
19
  export {
20
- g as default
20
+ f as default
21
21
  };
@@ -1,12 +1,12 @@
1
1
  var c = Object.defineProperty;
2
2
  var I = (a, r, e) => r in a ? c(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e;
3
- var u = (a, r, e) => I(a, typeof r != "symbol" ? r + "" : r, e);
3
+ var l = (a, r, e) => I(a, typeof r != "symbol" ? r + "" : r, e);
4
4
  import { Control as O, UIElementType as t, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  class _ extends O {
6
6
  constructor() {
7
7
  super(...arguments);
8
- u(this, "currentNode");
9
- u(this, "lastBlockInstanceId", null);
8
+ l(this, "currentNode");
9
+ l(this, "lastBlockInstanceId", null);
10
10
  }
11
11
  getContainer() {
12
12
  var e;
@@ -52,9 +52,10 @@ class _ extends O {
52
52
  const T = o !== this.lastBlockInstanceId;
53
53
  return T ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = o) : n(), T;
54
54
  }
55
- _GuLabel({ text: e, name: n = "" }) {
55
+ _GuLabel({ text: e, name: n = "", position: E = "top" }) {
56
56
  return `
57
57
  <${t.LABEL}
58
+ style="${E === "top" ? "margin-bottom: 8px;" : ""}"
58
59
  ${$.LABEL.text}="${e}"
59
60
  ${$.LABEL.name}="${n || `${e} Label`}">
60
61
  </${t.LABEL}>
@@ -169,9 +170,9 @@ class _ extends O {
169
170
  _GuOrderable(e, n) {
170
171
  let E = "";
171
172
  n.forEach((T) => {
172
- const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
173
+ const u = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
173
174
  E += `
174
- <${t.ORDERABLE_ITEM} ${l}="${T.key}">
175
+ <${t.ORDERABLE_ITEM} ${u}="${T.key}">
175
176
  ${T.content}
176
177
  </${t.ORDERABLE_ITEM}>
177
178
  `;
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-5196584c] .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-890b5336]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-890b5336]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-890b5336]{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}
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-890b5336]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-890b5336]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-890b5336]{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, 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';
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';
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,14 +5,7 @@
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';
9
8
  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>;
16
9
  /**
17
10
  * Message type constants for email templates
18
11
  */
@@ -353,16 +346,6 @@ export declare const CompilerSchema: v.ObjectSchema<{
353
346
  /** Skip default compiler rules */
354
347
  readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
355
348
  }, undefined>;
356
- /**
357
- * Callbacks configuration - event handlers and hooks
358
- */
359
- export declare const CallbacksSchema: v.ObjectSchema<{
360
- /**
361
- * External validation handler called before save completes.
362
- * Return false to cancel the save operation.
363
- */
364
- readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
365
- }, undefined>;
366
349
  /**
367
350
  * Complete Guido configuration schema
368
351
  *
@@ -375,7 +358,6 @@ export declare const CallbacksSchema: v.ObjectSchema<{
375
358
  * - features: Feature toggles
376
359
  * - blocks: Block configuration
377
360
  * - compiler: HTML compilation
378
- * - callbacks: Event handlers and hooks
379
361
  */
380
362
  export declare const GuidoConfigSchema: v.ObjectSchema<{
381
363
  /** Identity configuration (required) */
@@ -528,12 +510,4 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
528
510
  /** Skip default compiler rules */
529
511
  readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
530
512
  }, undefined>, {}>;
531
- /** Callbacks and event handlers */
532
- readonly callbacks: v.OptionalSchema<v.ObjectSchema<{
533
- /**
534
- * External validation handler called before save completes.
535
- * Return false to cancel the save operation.
536
- */
537
- readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
538
- }, undefined>, {}>;
539
513
  }, 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, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, ExternalValidationHandler } from './schemas';
8
+ import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema } from './schemas';
9
9
  import type * as v from 'valibot';
10
10
  /**
11
11
  * Complete validated Guido configuration.
@@ -41,10 +41,6 @@ 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 };
48
44
  /** Email header configuration (senderName, subject) */
49
45
  export type EmailHeader = v.InferOutput<typeof EmailHeaderSchema>;
50
46
  /** Dynamic content item */
@@ -89,8 +85,6 @@ export type FeaturesConfigInput = v.InferInput<typeof FeaturesSchema>;
89
85
  export type BlocksConfigInput = v.InferInput<typeof BlocksSchema>;
90
86
  /** Input type for compiler configuration */
91
87
  export type CompilerConfigInput = v.InferInput<typeof CompilerSchema>;
92
- /** Input type for callbacks configuration */
93
- export type CallbacksConfigInput = v.InferInput<typeof CallbacksSchema>;
94
88
  /** Default Stripo block types */
95
89
  export type DefaultBlockType = v.InferOutput<typeof DefaultBlockTypeSchema>;
96
90
  /** Custom Guido block types */
@@ -91,9 +91,6 @@ export declare const useConfig: () => {
91
91
  })[];
92
92
  ignoreDefaultRules: boolean;
93
93
  };
94
- callbacks: {
95
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
96
- };
97
94
  } | null>;
98
95
  initialized: import("vue").Ref<boolean>;
99
96
  identity: import("vue").ComputedRef<{
@@ -180,9 +177,6 @@ export declare const useConfig: () => {
180
177
  })[];
181
178
  ignoreDefaultRules: boolean;
182
179
  } | null>;
183
- callbacks: import("vue").ComputedRef<{
184
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
185
- } | null>;
186
180
  templateId: import("vue").ComputedRef<string>;
187
181
  userId: import("vue").ComputedRef<string>;
188
182
  variationId: import("vue").ComputedRef<string>;
@@ -9,3 +9,4 @@
9
9
  export { RecommendationBlockId } from './blockIds';
10
10
  export { RecommendationControlId } from './controlIds';
11
11
  export { CONTAINER_SELECTOR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, } from './selectors';
12
+ export { DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, } from './layout';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Layout-related constants for Recommendation block
3
+ *
4
+ * Centralizes magic numbers for product grid/layout configuration
5
+ */
6
+ /** Default number of products displayed per row in vertical layout */
7
+ export declare const DEFAULT_PRODUCTS_PER_ROW = 3;
8
+ /** Default number of cards in a row (used in store initialization) */
9
+ export declare const DEFAULT_CARDS_IN_ROW = 3;
10
+ /** Maximum number of products that can be displayed */
11
+ export declare const MAX_PRODUCT_COUNT = 9;
12
+ /** Minimum number of products that can be displayed */
13
+ export declare const MIN_PRODUCT_COUNT = 1;
14
+ /** Maximum number of products per row in vertical layout */
15
+ export declare const MAX_PRODUCTS_PER_ROW = 4;
16
+ /** Minimum number of products per row in vertical layout */
17
+ export declare const MIN_PRODUCTS_PER_ROW = 1;
@@ -75,7 +75,7 @@ export declare abstract class CommonControl extends Control {
75
75
  * @returns true if block instance changed, false otherwise
76
76
  */
77
77
  protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void, blockInstanceIdAttribute?: string): boolean;
78
- _GuLabel({ text, name }: LabelProps): string;
78
+ _GuLabel({ text, name, position }: LabelProps): string;
79
79
  _GuToggle(name: string): string;
80
80
  _GuSelectItem({ text, value }: {
81
81
  text: string;
@@ -1,4 +1,4 @@
1
- import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, CallbacksConfig } from '@@/Types/config';
1
+ import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig } from '@@/Types/config';
2
2
  interface ConfigStoreState {
3
3
  /** Whether the config has been initialized */
4
4
  initialized: boolean;
@@ -96,9 +96,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
96
96
  })[];
97
97
  ignoreDefaultRules: boolean;
98
98
  };
99
- callbacks: {
100
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
101
- };
102
99
  } | null;
103
100
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => IdentityConfig | null;
104
101
  /**
@@ -191,9 +188,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
191
188
  })[];
192
189
  ignoreDefaultRules: boolean;
193
190
  };
194
- callbacks: {
195
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
196
- };
197
191
  } | null;
198
192
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => PartnerConfig | null;
199
193
  /**
@@ -286,9 +280,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
286
280
  })[];
287
281
  ignoreDefaultRules: boolean;
288
282
  };
289
- callbacks: {
290
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
291
- };
292
283
  } | null;
293
284
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => TemplateConfig | null;
294
285
  /**
@@ -381,9 +372,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
381
372
  })[];
382
373
  ignoreDefaultRules: boolean;
383
374
  };
384
- callbacks: {
385
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
386
- };
387
375
  } | null;
388
376
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => EditorConfig | null;
389
377
  /**
@@ -476,9 +464,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
476
464
  })[];
477
465
  ignoreDefaultRules: boolean;
478
466
  };
479
- callbacks: {
480
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
481
- };
482
467
  } | null;
483
468
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => UIConfig | null;
484
469
  /**
@@ -571,9 +556,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
571
556
  })[];
572
557
  ignoreDefaultRules: boolean;
573
558
  };
574
- callbacks: {
575
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
576
- };
577
559
  } | null;
578
560
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => FeaturesConfig | null;
579
561
  /**
@@ -666,9 +648,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
666
648
  })[];
667
649
  ignoreDefaultRules: boolean;
668
650
  };
669
- callbacks: {
670
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
671
- };
672
651
  } | null;
673
652
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => BlocksConfig | null;
674
653
  /**
@@ -761,106 +740,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
761
740
  })[];
762
741
  ignoreDefaultRules: boolean;
763
742
  };
764
- callbacks: {
765
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
766
- };
767
743
  } | null;
768
744
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CompilerConfig | null;
769
- /**
770
- * Get the callbacks configuration
771
- */
772
- callbacks: (state: {
773
- initialized: boolean;
774
- config: {
775
- identity: {
776
- templateId: string;
777
- userId: string;
778
- variationId?: string | undefined;
779
- };
780
- partner: {
781
- name: string;
782
- productType: 60 | 49 | 97;
783
- messageType: 1 | 2;
784
- username: string;
785
- };
786
- template: {
787
- html: string;
788
- css: string;
789
- preselectedDynamicContent: {
790
- text: string;
791
- value: string;
792
- fallback?: string | undefined;
793
- format?: {
794
- key: string;
795
- value: string;
796
- } | undefined;
797
- }[];
798
- selectedUnsubscribePages: number[];
799
- forceRecreate: boolean;
800
- };
801
- editor: {
802
- locale: string;
803
- translationsPath: string;
804
- migrationDate: number;
805
- emailHeader: {
806
- senderName: string;
807
- subject: string;
808
- };
809
- };
810
- ui: {
811
- showHeader: boolean;
812
- backButtonLabel?: string | undefined;
813
- };
814
- features: {
815
- dynamicContent: boolean;
816
- saveAsTemplate: boolean;
817
- versionHistory: boolean;
818
- testMessage: boolean;
819
- displayConditions: boolean;
820
- unsubscribe: boolean;
821
- modulesDisabled: boolean;
822
- };
823
- blocks: {
824
- 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")[];
825
- includeCustoms: ("dynamic-content" | "checkbox-block" | "radio-button-block" | "recommendation-block" | "unsubscribe-block" | "coupon-block" | "items-block")[];
826
- };
827
- compiler: {
828
- customRules: ({
829
- type: "replace";
830
- search: string;
831
- replacement: string;
832
- replaceAll?: boolean | undefined;
833
- id: string;
834
- description?: string | undefined;
835
- priority: number;
836
- } | {
837
- type: "regex";
838
- pattern: string;
839
- replacement: string;
840
- flags?: string | undefined;
841
- id: string;
842
- description?: string | undefined;
843
- priority: number;
844
- } | {
845
- type: "remove";
846
- targets: string[];
847
- id: string;
848
- description?: string | undefined;
849
- priority: number;
850
- } | {
851
- type: "custom";
852
- processor: (html: string) => string;
853
- id: string;
854
- description?: string | undefined;
855
- priority: number;
856
- })[];
857
- ignoreDefaultRules: boolean;
858
- };
859
- callbacks: {
860
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
861
- };
862
- } | null;
863
- } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CallbacksConfig | null;
864
745
  /**
865
746
  * Get the template ID
866
747
  */
@@ -951,9 +832,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
951
832
  })[];
952
833
  ignoreDefaultRules: boolean;
953
834
  };
954
- callbacks: {
955
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
956
- };
957
835
  } | null;
958
836
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
959
837
  /**
@@ -1046,9 +924,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1046
924
  })[];
1047
925
  ignoreDefaultRules: boolean;
1048
926
  };
1049
- callbacks: {
1050
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1051
- };
1052
927
  } | null;
1053
928
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1054
929
  /**
@@ -1141,9 +1016,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1141
1016
  })[];
1142
1017
  ignoreDefaultRules: boolean;
1143
1018
  };
1144
- callbacks: {
1145
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1146
- };
1147
1019
  } | null;
1148
1020
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1149
1021
  /**
@@ -1236,9 +1108,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1236
1108
  })[];
1237
1109
  ignoreDefaultRules: boolean;
1238
1110
  };
1239
- callbacks: {
1240
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1241
- };
1242
1111
  } | null;
1243
1112
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1244
1113
  /**
@@ -1331,9 +1200,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1331
1200
  })[];
1332
1201
  ignoreDefaultRules: boolean;
1333
1202
  };
1334
- callbacks: {
1335
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1336
- };
1337
1203
  } | null;
1338
1204
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
1339
1205
  /**
@@ -1426,9 +1292,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1426
1292
  })[];
1427
1293
  ignoreDefaultRules: boolean;
1428
1294
  };
1429
- callbacks: {
1430
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1431
- };
1432
1295
  } | null;
1433
1296
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
1434
1297
  /**
@@ -1521,9 +1384,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1521
1384
  })[];
1522
1385
  ignoreDefaultRules: boolean;
1523
1386
  };
1524
- callbacks: {
1525
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1526
- };
1527
1387
  } | null;
1528
1388
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
1529
1389
  /**
@@ -1616,9 +1476,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1616
1476
  })[];
1617
1477
  ignoreDefaultRules: boolean;
1618
1478
  };
1619
- callbacks: {
1620
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1621
- };
1622
1479
  } | null;
1623
1480
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
1624
1481
  /**
@@ -1711,9 +1568,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1711
1568
  })[];
1712
1569
  ignoreDefaultRules: boolean;
1713
1570
  };
1714
- callbacks: {
1715
- externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1716
- };
1717
1571
  } | null;
1718
1572
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => (feature: keyof FeaturesConfig) => boolean;
1719
1573
  }, {
@@ -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: 6px;
51
+ margin-right: 16px;
52
52
  }
53
53
 
54
54
  .flat-white > .button {
@@ -64,13 +64,6 @@ 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
- },
74
67
  /**
75
68
  * Get the template ID
76
69
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.0.0-beta.e66a90a",
3
+ "version": "2.0.0-beta.e73ba15",
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",