@useinsider/guido 3.23.0-beta.2595053 → 3.23.0-beta.2df7606

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 (79) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +9 -8
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +111 -100
  5. package/dist/components/organisms/AutoSaveController.vue2.js +20 -10
  6. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +1 -1
  7. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +28 -28
  8. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +1 -1
  9. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +25 -25
  10. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  11. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
  12. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  13. package/dist/components/organisms/header/EditorActions.vue2.js +58 -73
  14. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  15. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +99 -0
  16. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  17. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
  18. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  19. package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
  20. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  21. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  22. package/dist/components/organisms/header/RightSlot.vue.js +11 -10
  23. package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
  24. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  25. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  26. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
  27. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  28. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
  29. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
  30. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  31. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +60 -35
  32. package/dist/composables/useAccessibilityApi.js +51 -0
  33. package/dist/composables/useCustomInterfaceAppearance.js +42 -41
  34. package/dist/composables/useDisplayConditions.js +42 -41
  35. package/dist/composables/useTranslations.js +2 -1
  36. package/dist/config/i18n/en/labels.json.js +36 -4
  37. package/dist/config/i18n/en/tooltips.json.js +2 -1
  38. package/dist/extensions/DisplayConditions/control.js +32 -22
  39. package/dist/extensions/LinkTracking/writer.js +29 -23
  40. package/dist/guido.css +1 -1
  41. package/dist/package.json.js +1 -1
  42. package/dist/sprite.svg +10 -0
  43. package/dist/src/@types/config/schemas.d.ts +2 -0
  44. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +19 -1
  45. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  46. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -19
  47. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -19
  48. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  49. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  50. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  51. package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
  52. package/dist/src/composables/useActionsApi.d.ts +2 -2
  53. package/dist/src/composables/useConfig.d.ts +2 -0
  54. package/dist/src/composables/useDisplayConditions.d.ts +1 -0
  55. package/dist/src/extensions/DisplayConditions/control.d.ts +1 -0
  56. package/dist/src/extensions/LinkTracking/writer.d.ts +1 -1
  57. package/dist/src/stores/autosave.d.ts +73 -1
  58. package/dist/src/stores/config.d.ts +21 -0
  59. package/dist/src/stores/editor.d.ts +109 -0
  60. package/dist/src/stores/onboarding.d.ts +966 -35
  61. package/dist/src/stores/version-history.d.ts +1 -1
  62. package/dist/src/utils/displayCondition.d.ts +2 -2
  63. package/dist/src/utils/linkTrackingIds.d.ts +2 -0
  64. package/dist/src/utils/templatePreparation.d.ts +1 -1
  65. package/dist/src/utils/timeUtil.d.ts +5 -8
  66. package/dist/static/stripo-runtime-manifest.json.js +1 -1
  67. package/dist/static/styles/components/accessibility.css.js +234 -0
  68. package/dist/static/styles/variables.css.js +2 -0
  69. package/dist/stores/autosave.js +12 -7
  70. package/dist/stores/editor.js +8 -3
  71. package/dist/stores/onboarding.js +48 -22
  72. package/dist/utils/displayCondition.js +11 -11
  73. package/dist/utils/linkTrackingIds.js +60 -59
  74. package/dist/utils/templatePreparation.js +61 -52
  75. package/dist/utils/timeUtil.js +6 -17
  76. package/package.json +2 -2
  77. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  78. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  79. /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
@@ -1,89 +1,90 @@
1
- const A = "data-ins-track-id", E = "data-ins-track-seq", g = `(?:[^>"']|"[^"]*"|'[^']*')*`, R = new RegExp(`<a\\b${g}>`, "gi"), _ = new RegExp(`<body\\b${g}>`, "i"), f = new RegExp(`<html\\b${g}>`, "i"), S = new RegExp(`\\b${A}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"), l = new RegExp(`\\b${E}\\s*=\\s*(?:"(\\d+)"|'(\\d+)'|(\\d+))`, "i"), I = "ins-track-seq", d = new RegExp(`<!--\\s*${I}:(\\d+)\\s*-->`, "i"), $ = /^[1-9][0-9]{0,14}$/, k = 999999999999999;
2
- function p(t) {
3
- const e = S.exec(t), n = e ? e[1] ?? e[2] ?? e[3] ?? "" : "";
4
- return { attrMatch: e, rawValue: n };
1
+ const A = "data-ins-track-id", E = "data-ins-track-seq", g = `(?:[^>"']|"[^"]*"|'[^']*')*`, R = new RegExp(`<a\\b${g}>`, "gi"), _ = new RegExp(`<body\\b${g}>`, "i"), l = new RegExp(`<html\\b${g}>`, "i"), m = new RegExp(`\\b${A}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"), f = new RegExp(`\\b${E}\\s*=\\s*(?:"(\\d+)"|'(\\d+)'|(\\d+))`, "i"), p = "ins-track-seq", d = new RegExp(`<!--\\s*${p}:(\\d+)\\s*-->`, "i"), I = /^[1-9][0-9]{0,14}$/, S = 999999999999999;
2
+ function $(e) {
3
+ const t = m.exec(e), n = t ? t[1] ?? t[2] ?? t[3] ?? "" : "";
4
+ return { attrMatch: t, rawValue: n };
5
5
  }
6
- function m(t) {
7
- const e = Number(t);
8
- return Number.isSafeInteger(e) && e > 0 ? e : 0;
6
+ function k(e) {
7
+ const t = Number(e);
8
+ return Number.isSafeInteger(t) && t > 0 ? t : 0;
9
9
  }
10
- function b(t) {
10
+ function N(e) {
11
11
  var s;
12
- const e = (a) => {
13
- var o;
14
- const r = (o = a.exec(t)) == null ? void 0 : o[0];
15
- return r ? l.exec(r) : null;
16
- }, n = e(_) ?? e(f), c = (n == null ? void 0 : n[1]) ?? (n == null ? void 0 : n[2]) ?? (n == null ? void 0 : n[3]) ?? ((s = d.exec(t)) == null ? void 0 : s[1]) ?? "";
17
- return m(c);
12
+ const t = (o) => {
13
+ var r;
14
+ const a = (r = o.exec(e)) == null ? void 0 : r[0];
15
+ return a ? f.exec(a) : null;
16
+ }, n = t(_) ?? t(l), c = (n == null ? void 0 : n[1]) ?? (n == null ? void 0 : n[2]) ?? (n == null ? void 0 : n[3]) ?? ((s = d.exec(e)) == null ? void 0 : s[1]) ?? "";
17
+ return k(c);
18
18
  }
19
- function D(t, e = 0) {
19
+ function K(e, t = 0) {
20
20
  let n = 0;
21
- [...t.matchAll(R)].forEach(([s]) => {
22
- const { rawValue: a } = p(s);
23
- $.test(a) && (n = Math.max(n, Number(a)));
21
+ [...e.matchAll(R)].forEach(([s]) => {
22
+ const { rawValue: o } = $(s);
23
+ I.test(o) && (n = Math.max(n, Number(o)));
24
24
  });
25
- const c = Number.isSafeInteger(e) && e > 0 ? e : 0;
26
- return Math.max(b(t), n, c);
25
+ const c = Number.isSafeInteger(t) && t > 0 ? t : 0;
26
+ return Math.max(N(e), n, c);
27
27
  }
28
- function q(t, e) {
29
- const n = `${E}="${e}"`, c = _.exec(t) ?? f.exec(t);
28
+ function M(e, t) {
29
+ const n = `${E}="${t}"`, c = _.exec(e) ?? l.exec(e);
30
30
  if (c) {
31
- const [a] = c, r = l.exec(a), o = r ? a.replace(r[0], n) : a.replace(/\/?>$/, (u) => ` ${n}${u}`);
32
- return t.slice(0, c.index) + o + t.slice(c.index + a.length);
31
+ const [o] = c, a = f.exec(o), r = a ? o.replace(a[0], n) : o.replace(/\/?>$/, (i) => ` ${n}${i}`);
32
+ return e.slice(0, c.index) + r + e.slice(c.index + o.length);
33
33
  }
34
- const s = `<!--${I}:${e}-->`;
35
- return d.test(t) ? t.replace(d, s) : `${s}${t}`;
34
+ const s = `<!--${p}:${t}-->`;
35
+ return d.test(e) ? e.replace(d, s) : `${s}${e}`;
36
36
  }
37
- function w(t, e, n) {
37
+ function q(e, t, n) {
38
38
  const c = `${A}="${n}"`;
39
- return e ? t.replace(e[0], c) : t.replace(/^<a\b/i, (s) => `${s} ${c}`);
39
+ return t ? e.replace(t[0], c) : e.replace(/^<a\b/i, (s) => `${s} ${c}`);
40
40
  }
41
- function M(t, e, n = 0) {
41
+ function w(e, t, n = 0) {
42
42
  const c = /* @__PURE__ */ new Set();
43
43
  let s = 0;
44
- const a = t.map((i) => {
45
- if (i !== null && $.test(i) && !c.has(Number(i))) {
46
- const T = Number(i);
44
+ const o = e.map((u) => {
45
+ if (u !== null && I.test(u) && !c.has(Number(u))) {
46
+ const T = Number(u);
47
47
  return c.add(T), s = Math.max(s, T), T;
48
48
  }
49
49
  return null;
50
- }), r = Number.isSafeInteger(n) && n > 0 && n < k ? n : 0;
51
- let o = Math.max(e, s, r);
52
- const u = /* @__PURE__ */ new Map();
53
- a.forEach((i, T) => {
54
- i === null && (o += 1, u.set(T, o));
50
+ }), a = Number.isSafeInteger(n) && n > 0 && n < S ? n : 0;
51
+ let r = Math.max(t, s, a);
52
+ const i = /* @__PURE__ */ new Map();
53
+ o.forEach((u, T) => {
54
+ u === null && (r += 1, i.set(T, r));
55
55
  });
56
- const x = o > 0 && e !== o;
57
- return { assignments: u, nextSeq: o, seqChanged: x, changed: u.size > 0 || x };
56
+ const x = r > 0 && t !== r;
57
+ return { assignments: i, nextSeq: r, seqChanged: x, changed: i.size > 0 || x };
58
58
  }
59
- function N(t) {
60
- return [...t.matchAll(R)].map((e) => {
61
- const [n] = e;
62
- return { index: e.index, tag: n, ...p(n) };
59
+ function b(e) {
60
+ return [...e.matchAll(R)].map((t) => {
61
+ const [n] = t;
62
+ return { index: t.index, tag: n, ...$(n) };
63
63
  });
64
64
  }
65
- function P(t, e = 0) {
66
- const n = N(t).map((c) => c.rawValue);
67
- return { anchorIds: n, plan: M(n, b(t), e) };
65
+ const C = /<!--[\s\S]*?-->/g;
66
+ function P(e, t = 0) {
67
+ const n = b(e), c = n.map((a) => a.rawValue), s = [...e.matchAll(C)].map((a) => [a.index, a.index + a[0].length]), o = n.map(({ index: a }) => s.some(([r, i]) => a > r && a < i));
68
+ return { anchorIds: c, inComment: o, plan: w(c, N(e), t) };
68
69
  }
69
- function C(t, { plan: e }) {
70
+ function D(e, { plan: t }) {
70
71
  let n = "", c = 0;
71
- return N(t).forEach((s, a) => {
72
- const r = e.assignments.get(a);
73
- n += t.slice(c, s.index), n += r === void 0 ? s.tag : w(s.tag, s.attrMatch, r), c = s.index + s.tag.length;
74
- }), n += t.slice(c), e.seqChanged ? q(n, e.nextSeq) : n;
72
+ return b(e).forEach((s, o) => {
73
+ const a = t.assignments.get(o);
74
+ n += e.slice(c, s.index), n += a === void 0 ? s.tag : q(s.tag, s.attrMatch, a), c = s.index + s.tag.length;
75
+ }), n += e.slice(c), t.seqChanged ? M(n, t.nextSeq) : n;
75
76
  }
76
- function K(t, e = 0) {
77
- const n = P(t, e), { changed: c, nextSeq: s } = n.plan;
78
- return { html: c ? C(t, n) : t, changed: c, nextSeq: s };
77
+ function O(e, t = 0) {
78
+ const n = P(e, t), { changed: c, nextSeq: s } = n.plan;
79
+ return { html: c ? D(e, n) : e, changed: c, nextSeq: s };
79
80
  }
80
81
  export {
81
82
  A as TRACK_ID_ATTRIBUTE,
82
83
  E as TRACK_SEQ_ATTRIBUTE,
83
- K as assignTrackingIds,
84
+ O as assignTrackingIds,
84
85
  P as planDocumentTrackingIds,
85
- M as planTrackingIds,
86
- D as readTrackFloor,
87
- b as readTrackSeq,
88
- C as renderTrackingIdPlan
86
+ w as planTrackingIds,
87
+ K as readTrackFloor,
88
+ N as readTrackSeq,
89
+ D as renderTrackingIdPlan
89
90
  };
@@ -1,31 +1,31 @@
1
- import { useActionsApi as F } from "../composables/useActionsApi.js";
2
- import { useConfig as x } from "../composables/useConfig.js";
3
- import { useHtmlCompiler as D } from "../composables/useHtmlCompiler.js";
4
- import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { toBlockUrlConfig as E } from "../extensions/Blocks/Recommendation/utils/blockUrlConfig.js";
6
- import { DATA_ATTRIBUTES as S } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
7
- import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
8
- import { writeTrackingIdsInPlace as U } from "../extensions/LinkTracking/writer.js";
9
- import { useDynamicContentStore as L } from "../stores/dynamic-content.js";
10
- import { useEditorStore as N } from "../stores/editor.js";
11
- import { useUnsubscribeStore as v } from "../stores/unsubscribe.js";
12
- import { isPlainObject as z } from "./genericUtil.js";
13
- import { planDocumentTrackingIds as b, renderTrackingIdPlan as q } from "./linkTrackingIds.js";
14
- function M(c) {
15
- const a = new DOMParser().parseFromString(c, "text/html").querySelectorAll(`[${S.PAGE_LIST}]`), e = [];
16
- return a.forEach((s) => {
17
- const r = s.getAttribute(S.PAGE_LIST);
18
- r && e.push(...R(r));
1
+ import { useActionsApi as E } from "../composables/useActionsApi.js";
2
+ import { useConfig as R } from "../composables/useConfig.js";
3
+ import { useHtmlCompiler as U } from "../composables/useHtmlCompiler.js";
4
+ import { useRecommendationExtensionStore as k } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { toBlockUrlConfig as L } from "../extensions/Blocks/Recommendation/utils/blockUrlConfig.js";
6
+ import { DATA_ATTRIBUTES as b } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
7
+ import { parsePageList as v } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
8
+ import { writeTrackingIdsInPlace as N } from "../extensions/LinkTracking/writer.js";
9
+ import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
10
+ import { useEditorStore as q } from "../stores/editor.js";
11
+ import { useUnsubscribeStore as M } from "../stores/unsubscribe.js";
12
+ import { isPlainObject as O } from "./genericUtil.js";
13
+ import { planDocumentTrackingIds as T, renderTrackingIdPlan as B } from "./linkTrackingIds.js";
14
+ function _(c) {
15
+ const i = new DOMParser().parseFromString(c, "text/html").querySelectorAll(`[${b.PAGE_LIST}]`), e = [];
16
+ return i.forEach((s) => {
17
+ const o = s.getAttribute(b.PAGE_LIST);
18
+ o && e.push(...v(o));
19
19
  }), [...new Set(e)];
20
20
  }
21
- async function h(c) {
22
- const i = new DOMParser().parseFromString(c, "text/html").querySelectorAll(".recommendation-block-v2");
23
- if (i.length === 0)
21
+ async function w(c) {
22
+ const a = new DOMParser().parseFromString(c, "text/html").querySelectorAll(".recommendation-block-v2");
23
+ if (a.length === 0)
24
24
  return;
25
- const a = T();
26
- i.forEach((e) => {
27
- const s = e.getAttribute("recommendation-id"), r = s ? Number(s) : NaN;
28
- if (!Number.isFinite(r))
25
+ const i = k();
26
+ a.forEach((e) => {
27
+ const s = e.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
28
+ if (!Number.isFinite(o))
29
29
  return;
30
30
  const l = e.getAttribute("esd-ext-config");
31
31
  if (!l)
@@ -36,10 +36,10 @@ async function h(c) {
36
36
  } catch {
37
37
  return;
38
38
  }
39
- z(m) && a.seedBlockUrlConfig(r, E(m));
39
+ O(m) && i.seedBlockUrlConfig(o, L(m));
40
40
  });
41
41
  try {
42
- await a.fetchRecommendationCreateData();
42
+ await i.fetchRecommendationCreateData();
43
43
  } catch (e) {
44
44
  console.warn(
45
45
  "Recommendation reference data pre-load failed; validator will skip the availability check.",
@@ -47,54 +47,63 @@ async function h(c) {
47
47
  );
48
48
  }
49
49
  }
50
- const ee = () => {
51
- const c = L(), n = N(), i = v(), { getCompiledEmail: a, getTemplateData: e, updateHtmlAndCss: s } = F(), { compileHtml: r, compileAmpHtml: l } = D(), { isFeatureEnabled: m } = x();
50
+ const oe = () => {
51
+ const c = z(), n = q(), a = M(), { getCompiledEmail: i, getTemplateData: e, updateHtmlAndCss: s } = E(), { compileHtml: o, compileAmpHtml: l } = U(), { isFeatureEnabled: m } = R();
52
52
  return {
53
- prepareTemplateDetails: async (w) => {
54
- let { html: t, css: p, syncModulesIds: f = [] } = w ?? await e();
53
+ prepareTemplateDetails: async (y) => {
54
+ let { html: r, css: u, syncModulesIds: g = [] } = y ?? await e();
55
55
  if (m("linkTrackingIds"))
56
56
  try {
57
- let o = b(t, n.trackIdSessionFloor);
58
- n.trackIdSessionFloor = o.plan.nextSeq, o.plan.changed && U(o) && ({ html: t, css: p, syncModulesIds: f = [] } = await e(), o = b(t, n.trackIdSessionFloor), n.trackIdSessionFloor = o.plan.nextSeq), o.plan.changed && (t = q(t, o), await s(t, p));
59
- } catch (o) {
60
- console.error("Tracking-id step failed, saving anyway:", o);
57
+ let t = T(r, n.trackIdSessionFloor);
58
+ n.trackIdSessionFloor = t.plan.nextSeq;
59
+ let p = t.plan.changed;
60
+ if (p && N(t)) {
61
+ const h = await e().catch((x) => (console.warn(
62
+ "Tracking-id re-read failed, saving the planned ids without a replacement:",
63
+ x
64
+ ), null));
65
+ h ? ({ html: r, css: u, syncModulesIds: g = [] } = h, t = T(r, n.trackIdSessionFloor), n.trackIdSessionFloor = t.plan.nextSeq, p = t.plan.changed) : p = !1;
66
+ }
67
+ t.plan.changed && (r = B(r, t)), p && await s(r, u);
68
+ } catch (t) {
69
+ console.error("Tracking-id step failed, saving anyway:", t);
61
70
  }
62
- const { html: y, ampHtml: u = "", ampErrors: k = [] } = await a({
71
+ const { html: A, ampHtml: f = "", ampErrors: P = [] } = await i({
63
72
  minimize: !0,
64
73
  resetDataSavedFlag: !1
65
74
  });
66
- i.selectedUnsubscribePages.length && await i.fetchTemplates(), await h(t);
67
- const { compiledHtml: A, stats: d, appliedRules: P } = r(y), C = u && l(u).compiledHtml, I = c.getSelectedDynamicContentList, H = T(), g = M(t);
75
+ a.selectedUnsubscribePages.length && await a.fetchTemplates(), await w(r);
76
+ const { compiledHtml: C, stats: d, appliedRules: I } = o(A), H = f && l(f).compiledHtml, D = c.getSelectedDynamicContentList, F = k(), S = _(r);
68
77
  return console.debug("HTML Compilation Stats:", {
69
78
  originalSize: d.originalSize,
70
79
  compiledSize: d.compiledSize,
71
80
  reduction: `${d.reductionPercentage.toFixed(2)}%`,
72
- appliedRules: P,
81
+ appliedRules: I,
73
82
  executionTime: `${d.executionTime.toFixed(2)}ms`
74
83
  }), {
75
- dynamicContentList: I,
76
- compiledHtml: A,
77
- rawHtml: t,
78
- css: p,
79
- ampHtml: C,
80
- ampErrors: k,
81
- modules: f.map(Number),
84
+ dynamicContentList: D,
85
+ compiledHtml: C,
86
+ rawHtml: r,
87
+ css: u,
88
+ ampHtml: H,
89
+ ampErrors: P,
90
+ modules: g.map(Number),
82
91
  recommendation: {
83
- campaignUrls: H.recommendationCampaignUrls,
92
+ campaignUrls: F.recommendationCampaignUrls,
84
93
  configs: {}
85
94
  },
86
95
  unsubscribe: {
87
- status: g.length > 0,
88
- config: g
96
+ status: S.length > 0,
97
+ config: S
89
98
  }
90
99
  };
91
100
  },
92
101
  // Exposed so the back/test validate-only path can seed the reco store the
93
102
  // same way a full save does (required-field findings depend on it).
94
- hydrateRecommendationStore: h
103
+ hydrateRecommendationStore: w
95
104
  };
96
105
  };
97
106
  export {
98
- M as getHtmlReferencedUnsubscribePages,
99
- ee as useTemplatePreparation
107
+ _ as getHtmlReferencedUnsubscribePages,
108
+ oe as useTemplatePreparation
100
109
  };
@@ -1,19 +1,8 @@
1
- const r = (t) => {
2
- const e = -t.getTimezoneOffset(), o = e >= 0 ? "+" : "-", n = Math.abs(e), s = Math.floor(n / 60), i = n % 60;
3
- return i === 0 ? `UTC${o}${s}` : `UTC${o}${s}:${String(i).padStart(2, "0")}`;
4
- }, a = () => {
5
- var e;
6
- const { timeZone: t } = new Intl.DateTimeFormat().resolvedOptions();
7
- return ((e = t.split("/").pop()) == null ? void 0 : e.replace(/_/g, " ")) ?? t;
8
- }, c = (t, e = !1) => {
9
- const o = t.toLocaleTimeString([], {
10
- hour: "2-digit",
11
- hour12: !1,
12
- minute: "2-digit",
13
- second: "2-digit"
14
- });
15
- return e ? `${o} (${r(t)} ${a()})` : o;
16
- };
1
+ const g = (t) => String(t).padStart(2, "0"), a = (t, e) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate(), o = (t, e = /* @__PURE__ */ new Date()) => ({
2
+ isToday: a(t, e),
3
+ time: `${g(t.getHours())}:${g(t.getMinutes())}`,
4
+ date: `${g(t.getDate())}.${g(t.getMonth() + 1)}.${t.getFullYear()}`
5
+ });
17
6
  export {
18
- c as formatLocalTime
7
+ o as autoSaveTimestamp
19
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.23.0-beta.2595053",
3
+ "version": "3.23.0-beta.2df7606",
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",
@@ -128,7 +128,7 @@
128
128
  },
129
129
  "guido": {
130
130
  "stripo": {
131
- "version": "2.81.1"
131
+ "version": "2.83.1"
132
132
  }
133
133
  }
134
134
  }
@@ -1,22 +0,0 @@
1
- import o from "./AutoSaveToggle.vue2.js";
2
- /* empty css */
3
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
5
- var e = this, a = e._self._c, t = e._self._setupProxy;
6
- return t.isFeatureEnabled("autosave") ? a("div", { staticClass: "d-f a-i-c mr-3 auto-save-toggle", on: { mouseenter: function(s) {
7
- t.isHovered = !0;
8
- }, mouseleave: function(s) {
9
- t.isHovered = !1;
10
- } } }, [a(t.InToggle, { attrs: { id: "guido__autosave-toggle", name: "guido-autosave-toggle", checked: t.autosaveStore.isOn, disable: t.editorStore.loadingStatus }, on: { click: t.toggle } }), a("span", { staticClass: "ml-2 auto-save-toggle__label t-c-55" }, [e._v(" " + e._s(t.trans("email-editor.auto-save")) + " ")]), t.autosaveStore.status === t.AUTOSAVE_STATUS.SAVING ? a("span", { staticClass: "ml-2 d-f a-i-c f-s-1" }, [a(t.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), a("span", { staticClass: "ml-1 t-c-53" }, [e._v(" " + e._s(t.trans("newsletter.saving")) + " ")])], 1) : t.lastSavedLabel ? a("span", { staticClass: "ml-2 f-s-1 t-c-53" }, [e._v(" " + e._s(t.lastSavedLabel) + " ")]) : e._e(), t.isHovered ? a(t.InInfoBox, { staticClass: "auto-save-toggle__info-box", attrs: { id: "guido__autosave-info-box", size: "small", variant: "information", "description-text": t.trans("email-editor.auto-save-description"), "title-text": t.trans("email-editor.auto-save-title") } }) : e._e()], 1) : e._e();
11
- }, l = [], r = /* @__PURE__ */ i(
12
- o,
13
- n,
14
- l,
15
- !1,
16
- null,
17
- "2c964af4"
18
- );
19
- const d = r.exports;
20
- export {
21
- d as default
22
- };
@@ -1,19 +0,0 @@
1
- import { defineComponent as i, ref as f, computed as u } from "vue";
2
- import { useConfig as l } from "../../../composables/useConfig.js";
3
- import { useTranslations as p } from "../../../composables/useTranslations.js";
4
- import { useAutosaveStore as c, AUTOSAVE_STATUS as t } from "../../../stores/autosave.js";
5
- import { useEditorStore as S } from "../../../stores/editor.js";
6
- import { formatLocalTime as d } from "../../../utils/timeUtil.js";
7
- import { InToggle as g, InLoading as _, InInfoBox as A } from "@useinsider/design-system-vue";
8
- const U = /* @__PURE__ */ i({
9
- __name: "AutoSaveToggle",
10
- setup(v) {
11
- const { isFeatureEnabled: e } = l(), r = S(), o = c(), s = p(), n = f(!1), a = u(() => o.status !== t.SAVED || !o.lastSavedAt ? "" : d(o.lastSavedAt));
12
- return { __sfc: !0, isFeatureEnabled: e, editorStore: r, autosaveStore: o, trans: s, isHovered: n, lastSavedLabel: a, toggle: (m) => {
13
- o.isOn = m;
14
- }, AUTOSAVE_STATUS: t, InInfoBox: A, InLoading: _, InToggle: g };
15
- }
16
- });
17
- export {
18
- U as default
19
- };