@useinsider/guido 3.16.0-beta.cbe0707 → 3.16.0-beta.d7c8e2a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/components/Guido.vue.js +8 -8
  2. package/dist/components/Guido.vue2.js +76 -78
  3. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  4. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  5. package/dist/components/organisms/header/EditorActions.vue2.js +43 -74
  6. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  7. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -45
  8. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  9. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  10. package/dist/composables/useHtmlValidator.js +0 -1
  11. package/dist/composables/useSave.js +41 -84
  12. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  13. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  14. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +24 -31
  15. package/dist/guido.css +1 -1
  16. package/dist/src/components/Guido.vue.d.ts +1 -17
  17. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  18. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  19. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  20. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  21. package/dist/src/composables/useHtmlValidator.d.ts +0 -14
  22. package/dist/src/composables/useSave.d.ts +1 -6
  23. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  24. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  25. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  26. package/dist/src/stores/config.d.ts +0 -5
  27. package/dist/src/utils/dynamicContentFormat.d.ts +33 -0
  28. package/dist/src/utils/templatePreparation.d.ts +0 -30
  29. package/dist/stores/config.js +6 -13
  30. package/dist/utils/dynamicContentFormat.js +35 -0
  31. package/dist/utils/genericUtil.js +43 -49
  32. package/dist/utils/templatePreparation.js +25 -28
  33. package/package.json +1 -1
  34. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  35. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -61
  36. package/dist/composables/useSaveValidation.js +0 -276
  37. package/dist/composables/useSaveValidationRollout.js +0 -9
  38. package/dist/enums/save-validation.js +0 -4
  39. package/dist/src/@types/save-validation.d.ts +0 -19
  40. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
  41. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  42. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  43. package/dist/src/enums/save-validation.d.ts +0 -27
  44. package/dist/src/stores/save-validation.d.ts +0 -22
  45. package/dist/stores/save-validation.js +0 -30
@@ -2106,11 +2106,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2106
2106
  };
2107
2107
  } | null;
2108
2108
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
2109
- /**
2110
- * Transactional campaigns keep the hard save block. Reactive getter, so
2111
- * consumers stay safe in setup where a raw config read snapshots null (SD-147945).
2112
- */
2113
- isTransactional(): boolean;
2114
2109
  /**
2115
2110
  * Get the username
2116
2111
  */
@@ -0,0 +1,33 @@
1
+ import type { BaseDynamicContent } from '@@/Types/generic';
2
+ /** Format key the dynamic-content picker sends for a custom date/time format. */
3
+ export declare const TIME_FORMAT_KEY = "time-format";
4
+ /** Liquid filter that renders a date/time value in a custom pattern. */
5
+ export declare const TIME_FORMAT_FILTER = "time_format";
6
+ /** Liquid filter that renders a fallback when the value is empty. */
7
+ export declare const DEFAULT_FILTER = "default";
8
+ export type DynamicContentFormat = NonNullable<BaseDynamicContent['format']>;
9
+ /** Unwraps a quoted Liquid literal — the exact inverse of `toLiquidLiteral`. */
10
+ export declare const stripQuotes: (literal: string) => string;
11
+ /** Liquid string literal — numbers stay unquoted so `default: 0` keeps its type. */
12
+ export declare const toLiquidLiteral: (value: string) => string;
13
+ /**
14
+ * `{ key: 'time-format', value: 'YYYY-MM-DD' }` → `time_format: "YYYY-MM-DD"`.
15
+ * Returns null when the format has no Liquid equivalent, which is the caller's
16
+ * signal to keep the legacy tail instead.
17
+ */
18
+ export declare const formatToLiquidFilter: (format: DynamicContentFormat | undefined) => string | null;
19
+ /** Inverse of `formatToLiquidFilter` — reads the picker format back out of one filter segment. */
20
+ export declare const liquidFilterToFormat: (segment: string) => DynamicContentFormat | null;
21
+ /**
22
+ * The full Liquid expression for a dynamic-content selection, e.g.
23
+ * `{{ signup_date | time_format: "YYYY-MM-DD" | default: "-" }}`.
24
+ * A format with no Liquid filter is dropped rather than emitted as invalid syntax —
25
+ * callers that must preserve it fall back to the legacy tag form.
26
+ */
27
+ export declare const buildLiquidTag: ({ value, format, fallback }: BaseDynamicContent) => string;
28
+ /** Whether the selection can be expressed in Liquid without losing its format. */
29
+ export declare const hasLiquidEquivalent: (format: DynamicContentFormat | undefined) => boolean;
30
+ /** Whether one `{{ … }}` segment is a `default:` filter. */
31
+ export declare const isLiquidDefaultFilter: (segment: string) => boolean;
32
+ /** Reads the fallback out of a `default: "…"` filter segment. */
33
+ export declare const readLiquidDefault: (segment: string) => string;
@@ -15,36 +15,6 @@ import type { SavedTemplateDetails } from '@@/Types/stripo';
15
15
  * same source), so it is reliably present regardless of how the block was added.
16
16
  */
17
17
  export declare function getHtmlReferencedUnsubscribePages(html: string): number[];
18
- /**
19
- * Hydrates the recommendation extension store from the persisted `esd-ext-config`
20
- * JSON blob on each `.recommendation-block-v2` element in the raw editor HTML.
21
- *
22
- * Why this runs before `compileHtml`:
23
- * The HTML compiler's `prepareRecommendationBlocks` rule asks
24
- * `useRecommendation.buildCampaignUrl(id)` to assemble each block's API URL
25
- * from `blockStates[id].recommendationConfigs`. That Pinia entry is normally
26
- * populated by `RecommendationBlockControl._syncNodeConfigToStore`, which
27
- * only fires when the user *selects* the block. Saving without ever
28
- * selecting a migrated block would otherwise build the URL from empty/
29
- * default state and the campaign URL would not be saved.
30
- *
31
- * Why we read raw HTML, not compiled HTML:
32
- * Stripo's `compileEmail()` strips editor-only attributes (`esd-*`) from the
33
- * compiled output, so `esd-ext-config` is gone by the time the compiler
34
- * pipeline sees the HTML. The raw HTML from `getTemplateData()` preserves
35
- * the attribute as the migrator wrote it.
36
- *
37
- * Reference data pre-load:
38
- * When the template has recommendation blocks, this also pre-loads the
39
- * shared reference data (languages / currency list) so the save-time
40
- * required-fields validator can check each block's locale and currency
41
- * against the partner's real options. Best-effort — on a fetch failure the
42
- * validator degrades to its empty-list guard (`requiredFields.ts`) instead
43
- * of blocking the save or stranding the Save button.
44
- */
45
- declare function hydrateRecommendationStoreFromRawHtml(rawHtml: string): Promise<void>;
46
18
  export declare const useTemplatePreparation: () => {
47
19
  prepareTemplateDetails: () => Promise<Omit<SavedTemplateDetails, "metadata">>;
48
- hydrateRecommendationStore: typeof hydrateRecommendationStoreFromRawHtml;
49
20
  };
50
- export {};
@@ -1,8 +1,8 @@
1
- import { MessageType as o } from "../@types/config/schemas.js";
1
+ import "../@types/config/schemas.js";
2
2
  import "../@types/config/defaults.js";
3
- import { parseConfig as r } from "../@types/config/validator.js";
4
- import { defineStore as a } from "pinia";
5
- const g = a("guido-config", {
3
+ import { parseConfig as o } from "../@types/config/validator.js";
4
+ import { defineStore as r } from "pinia";
5
+ const f = r("guido-config", {
6
6
  state: () => ({
7
7
  initialized: !1,
8
8
  config: null
@@ -113,13 +113,6 @@ const g = a("guido-config", {
113
113
  var e, n;
114
114
  return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.messageType) ?? 1;
115
115
  },
116
- /**
117
- * Transactional campaigns keep the hard save block. Reactive getter, so
118
- * consumers stay safe in setup where a raw config read snapshots null (SD-147945).
119
- */
120
- isTransactional() {
121
- return this.messageType === o.TRANSACTIONAL;
122
- },
123
116
  /**
124
117
  * Get the username
125
118
  */
@@ -150,7 +143,7 @@ const g = a("guido-config", {
150
143
  * Initialize the config store with validated configuration
151
144
  */
152
145
  init(i) {
153
- const e = r(i);
146
+ const e = o(i);
154
147
  this.config = e, this.initialized = !0;
155
148
  },
156
149
  /**
@@ -162,5 +155,5 @@ const g = a("guido-config", {
162
155
  }
163
156
  });
164
157
  export {
165
- g as useConfigStore
158
+ f as useConfigStore
166
159
  };
@@ -0,0 +1,35 @@
1
+ const l = "time-format", _ = "time_format", s = "default", u = {
2
+ [l]: _
3
+ }, L = Object.fromEntries(
4
+ Object.entries(u).map(([t, i]) => [i, t])
5
+ ), E = /^([a-z_]+)\s*:\s*(.+)$/, c = (t) => {
6
+ const i = t.slice(0, 1);
7
+ return (i === '"' || i === "'") && t.endsWith(i) && t.length > 1 ? t.slice(1, -1).replace(/\\(["'\\])/g, "$1") : t;
8
+ }, o = (t) => !Number.isNaN(Number(t)) && t.trim() !== "" ? t : `"${t.replace(/(["\\])/g, "\\$1")}"`, r = (t) => {
9
+ const i = t != null && t.key ? u[t.key] : void 0;
10
+ return !i || !(t != null && t.value) ? null : `${i}: ${o(t.value)}`;
11
+ }, T = (t) => {
12
+ const i = t.trim().match(E);
13
+ if (!i)
14
+ return null;
15
+ const e = L[i[1]];
16
+ return e ? { key: e, value: c(i[2].trim()) } : null;
17
+ }, d = ({ value: t, format: i, fallback: e }) => {
18
+ const n = [r(i)];
19
+ return e && n.push(`${s}: ${o(e)}`), `{{ ${[t, ...n.filter(Boolean)].join(" | ")} }}`;
20
+ }, F = (t) => !t || r(t) !== null, I = (t) => t.startsWith(`${s}:`), $ = (t) => c(
21
+ t.slice(`${s}:`.length).trim()
22
+ );
23
+ export {
24
+ s as DEFAULT_FILTER,
25
+ _ as TIME_FORMAT_FILTER,
26
+ l as TIME_FORMAT_KEY,
27
+ d as buildLiquidTag,
28
+ r as formatToLiquidFilter,
29
+ F as hasLiquidEquivalent,
30
+ I as isLiquidDefaultFilter,
31
+ T as liquidFilterToFormat,
32
+ $ as readLiquidDefault,
33
+ c as stripQuotes,
34
+ o as toLiquidLiteral
35
+ };
@@ -1,68 +1,62 @@
1
- const o = (l) => {
2
- const a = l.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((t) => t.trim()), [c] = a, r = {
3
- text: l.label,
4
- value: c || ""
1
+ import { hasLiquidEquivalent as v, buildLiquidTag as b, isLiquidDefaultFilter as o, readLiquidDefault as f, liquidFilterToFormat as h } from "./dynamicContentFormat.js";
2
+ const d = (e) => {
3
+ const a = e.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((t) => t.trim()), [n] = a, r = {
4
+ text: e.label,
5
+ value: n || ""
5
6
  };
6
7
  if (a.length >= 2) {
7
- const [, t, e] = a;
8
- if (t.startsWith("default:")) {
9
- let n = t.slice(8).trim();
10
- n.startsWith('"') && n.endsWith('"') && (n = n.slice(1, -1)), r.fallback = n;
11
- } else {
12
- const n = t.includes("=") ? { key: t.split("=")[0].trim(), value: t.split("=")[1].trim() } : null;
13
- n ? r.format = n : e || (r.fallback = t), e && (r.fallback = e);
8
+ const [, t, l] = a;
9
+ if (o(t))
10
+ r.fallback = f(t);
11
+ else {
12
+ const s = h(t) ?? (t.includes("=") ? { key: t.split("=")[0].trim(), value: t.split("=")[1].trim() } : null);
13
+ s ? r.format = s : l || (r.fallback = t), l && (r.fallback = o(l) ? f(l) : l);
14
14
  }
15
15
  }
16
16
  return r;
17
- }, f = (l, s = !1) => l.map((a) => {
18
- if (a.format)
17
+ }, i = (e, u = !1) => e.map((a) => {
18
+ var n;
19
+ if (u && v(a.format)) {
20
+ const r = [(n = a.format) == null ? void 0 : n.value, a.fallback].filter(Boolean);
19
21
  return {
20
- label: `${a.text} | ${a.format.key}=${a.format.value}`,
21
- value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
22
- };
23
- if (s) {
24
- if (!a.fallback)
25
- return {
26
- label: a.text,
27
- value: `{{ ${a.value} }}`
28
- };
29
- const r = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
30
- return {
31
- label: `${a.text} | ${a.fallback}`,
32
- value: `{{ ${a.value} | default: ${r} }}`
22
+ label: [a.text, ...r].join(" | "),
23
+ value: b(a)
33
24
  };
34
25
  }
35
- return {
26
+ return a.format ? {
27
+ label: `${a.text} | ${a.format.key}=${a.format.value}`,
28
+ value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
29
+ } : {
36
30
  label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
37
31
  value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
38
32
  };
39
- }), b = (l) => {
40
- const s = [], a = /* @__PURE__ */ new Set(), c = (t) => {
41
- Array.isArray(t) && t.forEach((e) => {
42
- const n = [...e.children ?? [], ...e.select_items ?? []];
43
- if (n.length > 0) {
44
- c(n);
33
+ }), $ = (e) => {
34
+ const u = [], a = /* @__PURE__ */ new Set(), n = (t) => {
35
+ Array.isArray(t) && t.forEach((l) => {
36
+ const s = [...l.children ?? [], ...l.select_items ?? []];
37
+ if (s.length > 0) {
38
+ n(s);
45
39
  return;
46
40
  }
47
- const u = e.text || e.tag_text;
48
- u && e.value && !a.has(e.value) && (a.add(e.value), s.push({ text: u, value: e.value }));
41
+ const c = l.text || l.tag_text;
42
+ c && l.value && !a.has(l.value) && (a.add(l.value), u.push({ text: c, value: l.value }));
49
43
  });
50
- }, [r] = Object.values(l ?? {});
51
- return c(r), s;
52
- }, v = (l, s, a = !1) => {
53
- const c = new Set(l.map((t) => t.value)), r = s.filter((t) => c.has(t.value) ? !1 : (c.add(t.value), !0));
44
+ }, [r] = Object.values(e ?? {});
45
+ return n(r), u;
46
+ }, g = (e, u, a = !1) => {
47
+ const n = new Set(e.map((t) => t.value)), r = u.filter((t) => n.has(t.value) ? !1 : (n.add(t.value), !0));
54
48
  return [
55
- ...f(l, a),
56
- ...f(r, a)
49
+ ...i(e, a),
50
+ ...i(r, a)
57
51
  ];
58
- }, i = () => {
59
- var l;
60
- return ((l = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : l.getAttribute("content")) ?? "";
52
+ }, y = () => {
53
+ var e;
54
+ return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
61
55
  };
62
56
  export {
63
- v as buildMergeTagEntries,
64
- f as dynamicContentToMergeTags,
65
- b as flattenDynamicContentList,
66
- i as getCsrfToken,
67
- o as mergeTagToDynamicContent
57
+ g as buildMergeTagEntries,
58
+ i as dynamicContentToMergeTags,
59
+ $ as flattenDynamicContentList,
60
+ y as getCsrfToken,
61
+ d as mergeTagToDynamicContent
68
62
  };
@@ -1,27 +1,27 @@
1
- import { useActionsApi as R } from "../composables/useActionsApi.js";
1
+ import { useActionsApi as k } from "../composables/useActionsApi.js";
2
2
  import { useConfig as U } from "../composables/useConfig.js";
3
3
  import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
4
4
  import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
- import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
6
  import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
7
  import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
- import { parsePageList as N } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
- import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
10
- import { useEditorStore as _ } from "../stores/editor.js";
11
- import { useUnsubscribeStore as v } from "../stores/unsubscribe.js";
12
- import { assignTrackingIds as O } from "./linkTrackingIds.js";
13
- function M(m) {
8
+ import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
+ import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
10
+ import { useEditorStore as z } from "../stores/editor.js";
11
+ import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
12
+ import { assignTrackingIds as v } from "./linkTrackingIds.js";
13
+ function O(m) {
14
14
  const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
15
15
  return n.forEach((i) => {
16
16
  const o = i.getAttribute(A.PAGE_LIST);
17
- o && t.push(...N(o));
17
+ o && t.push(...R(o));
18
18
  }), [...new Set(t)];
19
19
  }
20
- async function C(m) {
20
+ async function M(m) {
21
21
  const a = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
22
  if (a.length === 0)
23
23
  return;
24
- const n = T();
24
+ const n = C();
25
25
  a.forEach((t) => {
26
26
  var r, l, g, f, c;
27
27
  const i = t.getAttribute("recommendation-id"), o = i ? Number(i) : NaN;
@@ -68,39 +68,39 @@ async function C(m) {
68
68
  }
69
69
  }
70
70
  const Z = () => {
71
- const m = z(), u = _(), a = v(), { getCompiledEmail: n, getTemplateData: t, updateHtmlAndCss: i } = R(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
71
+ const m = N(), u = z(), a = _(), { getCompiledEmail: n, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
72
72
  return {
73
73
  prepareTemplateDetails: async () => {
74
74
  let { html: r, css: l, syncModulesIds: g = [] } = await t();
75
75
  if (e("linkTrackingIds"))
76
76
  try {
77
- const { html: y, changed: I, nextSeq: k } = O(r, u.trackIdSessionFloor);
78
- u.trackIdSessionFloor = k, I && (r = y, await i(y, l));
77
+ const { html: y, changed: H, nextSeq: I } = v(r, u.trackIdSessionFloor);
78
+ u.trackIdSessionFloor = I, H && (r = y, await i(y, l));
79
79
  } catch (y) {
80
80
  console.error("Tracking-id step failed, saving anyway:", y);
81
81
  }
82
- const { html: f, ampHtml: c = "", ampErrors: w = [] } = await n({
82
+ const { html: f, ampHtml: c = "", ampErrors: T = [] } = await n({
83
83
  minimize: !0,
84
84
  resetDataSavedFlag: !1
85
85
  });
86
- a.selectedUnsubscribePages.length && await a.fetchTemplates(), await C(r);
87
- const { compiledHtml: D, stats: S, appliedRules: E } = o(f), P = c && p(c).compiledHtml, F = m.getSelectedDynamicContentList, H = T(), b = M(r);
86
+ a.selectedUnsubscribePages.length && await a.fetchTemplates(), await M(r);
87
+ const { compiledHtml: w, stats: S, appliedRules: D } = o(f), E = c && p(c).compiledHtml, P = m.getSelectedDynamicContentList, F = C(), b = O(r);
88
88
  return console.debug("HTML Compilation Stats:", {
89
89
  originalSize: S.originalSize,
90
90
  compiledSize: S.compiledSize,
91
91
  reduction: `${S.reductionPercentage.toFixed(2)}%`,
92
- appliedRules: E,
92
+ appliedRules: D,
93
93
  executionTime: `${S.executionTime.toFixed(2)}ms`
94
94
  }), {
95
- dynamicContentList: F,
96
- compiledHtml: D,
95
+ dynamicContentList: P,
96
+ compiledHtml: w,
97
97
  rawHtml: r,
98
98
  css: l,
99
- ampHtml: P,
100
- ampErrors: w,
99
+ ampHtml: E,
100
+ ampErrors: T,
101
101
  modules: g.map(Number),
102
102
  recommendation: {
103
- campaignUrls: H.recommendationCampaignUrls,
103
+ campaignUrls: F.recommendationCampaignUrls,
104
104
  configs: {}
105
105
  },
106
106
  unsubscribe: {
@@ -108,13 +108,10 @@ const Z = () => {
108
108
  config: b
109
109
  }
110
110
  };
111
- },
112
- // Exposed so the back/test validate-only path can seed the reco store the
113
- // same way a full save does (required-field findings depend on it).
114
- hydrateRecommendationStore: C
111
+ }
115
112
  };
116
113
  };
117
114
  export {
118
- M as getHtmlReferencedUnsubscribePages,
115
+ O as getHtmlReferencedUnsubscribePages,
119
116
  Z as useTemplatePreparation
120
117
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.16.0-beta.cbe0707",
3
+ "version": "3.16.0-beta.d7c8e2a",
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",
@@ -1,20 +0,0 @@
1
- import n from "./ValidationErrorDrawer.vue2.js";
2
- /* empty css */
3
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var i = function() {
5
- var r = this, o = r._self._c, t = r._self._setupProxy;
6
- return o(t.WpDrawer, { attrs: { id: "guido__validation-error-drawer", size: "small", "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.isDrawerOpen, "title-text": t.titleText }, on: { onCloseEvent: t.handleClose, primaryButtonEvent: t.handleClose, secondaryButtonEvent: t.handleSecondary } }, [o("div", { staticClass: "d-f f-d-c validation-error-list" }, r._l(t.rows, function(e, a) {
7
- return o("div", { key: a, staticClass: "d-f a-i-c validation-error-row" }, [o(t.InIcons, { staticClass: "validation-error-row__icon i-c-12", attrs: { name: "filled-caution-triangle" } }), o("span", { staticClass: "validation-error-row__text" }, [r._v(r._s(e))])], 1);
8
- }), 0)]);
9
- }, l = [], _ = /* @__PURE__ */ s(
10
- n,
11
- i,
12
- l,
13
- !1,
14
- null,
15
- "31b677b4"
16
- );
17
- const u = _.exports;
18
- export {
19
- u as default
20
- };
@@ -1,61 +0,0 @@
1
- import { defineComponent as S, ref as v, computed as a } from "vue";
2
- import g from "../../wrappers/WpDrawer.vue.js";
3
- import { useBack as h } from "../../../composables/useGuidoActions.js";
4
- import { useSave as _ } from "../../../composables/useSave.js";
5
- import { useTranslations as b } from "../../../composables/useTranslations.js";
6
- import { useConfigStore as w } from "../../../stores/config.js";
7
- import { useEditorStore as B } from "../../../stores/editor.js";
8
- import { useSaveValidationStore as T } from "../../../stores/save-validation.js";
9
- import { InIcons as x } from "@useinsider/design-system-vue";
10
- const L = /* @__PURE__ */ S({
11
- __name: "ValidationErrorDrawer",
12
- setup(C) {
13
- const o = b(), t = T(), n = B(), s = w(), { saveWithErrors: i } = _(), l = h(), r = v(!1), d = a(() => `${o("email-editor.validation-errors")} (${t.errorCount})`), m = a(() => {
14
- const e = {
15
- primaryButton: {
16
- styling: "solid",
17
- type: "primary",
18
- labelText: o("email-editor.update-design")
19
- }
20
- };
21
- return t.intent === "back" ? e.secondaryButton = {
22
- styling: "solid",
23
- type: "subtle-primary",
24
- labelText: o("email-editor.leave-without-saving")
25
- } : !s.isTransactional && t.intent !== "test" && (e.secondaryButton = {
26
- styling: "solid",
27
- type: "subtle-primary",
28
- labelText: o("email-editor.save-and-continue"),
29
- loadingStatus: r.value
30
- }), e;
31
- }), p = a(() => t.errors.map((e) => {
32
- const y = e.detail ? ` (${e.detail})` : "";
33
- return `${e.message}${y}`;
34
- })), f = () => {
35
- t.isDrawerOpen && t.close();
36
- }, c = async () => {
37
- if (!r.value) {
38
- r.value = !0, n.loadingStatus = !0;
39
- try {
40
- await i() ? t.close() : n.loadingStatus = !1;
41
- } catch {
42
- n.loadingStatus = !1;
43
- } finally {
44
- r.value = !1;
45
- }
46
- }
47
- }, u = () => {
48
- t.close(), l();
49
- };
50
- return { __sfc: !0, trans: o, store: t, editorStore: n, configStore: s, saveWithErrors: i, handleBack: l, isSaving: r, titleText: d, footerButtonGroupOptions: m, rows: p, handleClose: f, handleSaveAndContinue: c, handleDiscardAndLeave: u, handleSecondary: () => {
51
- if (t.intent === "back") {
52
- u();
53
- return;
54
- }
55
- c();
56
- }, WpDrawer: g, InIcons: x };
57
- }
58
- });
59
- export {
60
- L as default
61
- };