@useinsider/guido 3.19.0-beta.5355c3f → 3.19.0-beta.6f88fb4

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.
@@ -12,9 +12,9 @@ var t = function() {
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "7674b645"
15
+ "bb2a5f2c"
16
16
  );
17
- const v = n.exports;
17
+ const f = n.exports;
18
18
  export {
19
- v as default
19
+ f as default
20
20
  };
@@ -1,131 +1,138 @@
1
- import { useEmailTemplateApplier as k, resetEmailTemplateApplier as N } from "./useEmailTemplateApplier.js";
2
- import { useToaster as X } from "./useToaster.js";
3
- import { useTranslations as j } from "./useTranslations.js";
4
- import { ToasterTypeOptions as z } from "../enums/toaster.js";
5
- import { useGuidoEmailEditorStore as J } from "../stores/guido-email-editor.js";
6
- import { getActivePinia as Q } from "pinia";
7
- import { onUnmounted as V, watch as Z } from "vue";
8
- const W = "email_template", tt = "chat", et = "guido:debug:ai", rt = 2, nt = 500, ot = (A, p) => `${A}:${p ?? 1}`;
9
- let v = null;
10
- const it = () => {
1
+ import { useEmailTemplateApplier as z, resetEmailTemplateApplier as J } from "./useEmailTemplateApplier.js";
2
+ import { useToaster as Q } from "./useToaster.js";
3
+ import { useTranslations as V } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as Z } from "../enums/toaster.js";
5
+ import { useGuidoEmailEditorStore as W } from "../stores/guido-email-editor.js";
6
+ import { getActivePinia as k } from "pinia";
7
+ import { onUnmounted as tt, watch as et } from "vue";
8
+ const rt = "email_template", nt = "chat", ot = "guido:debug:ai", it = 2, lt = 500, ct = (b, p) => `${b}:${p ?? 1}`;
9
+ let S = null;
10
+ const at = () => {
11
11
  if (typeof window > "u")
12
12
  return !1;
13
13
  try {
14
- return window.localStorage.getItem(et) === "1";
14
+ return window.localStorage.getItem(ot) === "1";
15
15
  } catch {
16
16
  return !1;
17
17
  }
18
- }, ft = () => {
19
- const A = Q();
20
- if (!A)
18
+ }, bt = () => {
19
+ const b = k();
20
+ if (!b)
21
21
  return;
22
- const p = J(), y = Symbol("cortexBlueprintBridge");
23
- v = y, p.$patch((t) => {
22
+ const p = W(), M = Symbol("cortexBlueprintBridge");
23
+ S = M, p.$patch((t) => {
24
24
  t.bridgeActive = !0;
25
25
  });
26
- const { markPending: x, applyTemplate: F, applyTemplateDebounced: I } = k(), { showToaster: C } = X(), H = j(), h = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Set(), M = it();
27
- let T = null, b = null, f;
28
- const O = (t, e) => {
29
- M && console.debug(`[guido:cortex] msg=${t ?? "?"} type=${(e == null ? void 0 : e.type) ?? "?"}`, e);
30
- }, G = () => new Set((f == null ? void 0 : f.appliedBlueprintKeys) ?? []), K = (t) => t instanceof Error ? t.message : String(t), D = (t, e, o, r) => {
31
- if (v !== y)
26
+ const { markPending: F, applyTemplate: H, applyTemplateDebounced: O } = z(), { showToaster: C } = Q(), G = V(), E = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
27
+ let s = null;
28
+ const d = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), B = at();
29
+ let w = null, m = null, A;
30
+ const K = (t, r) => {
31
+ B && console.debug(`[guido:cortex] msg=${t ?? "?"} type=${(r == null ? void 0 : r.type) ?? "?"}`, r);
32
+ }, U = () => new Set((A == null ? void 0 : A.appliedBlueprintKeys) ?? []), Y = (t) => t instanceof Error ? t.message : String(t), D = (t, r, n, e) => {
33
+ if (S !== M)
32
34
  return;
33
- const n = p.applyAcks[t], l = Math.max(Date.now(), ((n == null ? void 0 : n.ackAt) ?? 0) + 1), c = { status: e, requestedAt: o, ackAt: l };
34
- r !== void 0 && (c.error = K(r)), p.$patch((a) => {
35
- a.applyAcks = { ...a.applyAcks, [t]: c };
35
+ const o = p.applyAcks[t], c = Math.max(Date.now(), ((o == null ? void 0 : o.ackAt) ?? 0) + 1), a = { status: r, requestedAt: n, ackAt: c };
36
+ e !== void 0 && (a.error = Y(e)), p.$patch((l) => {
37
+ l.applyAcks = { ...l.applyAcks, [t]: a };
36
38
  });
37
- }, B = (t) => (d.get(t) ?? 0) > 0, w = async (t, e, o, r) => {
38
- var a, i, q;
39
- const n = ((a = o.blueprintData) == null ? void 0 : a.html) ?? "", l = ((i = o.blueprintData) == null ? void 0 : i.css) ?? "", c = o.applyRequestedAt ?? 0;
39
+ }, I = (t) => (d.get(t) ?? 0) > 0, P = (t) => (s == null ? void 0 : s.key) === t, v = async (t, r, n) => {
40
+ var a, l, h;
41
+ const e = ((a = r.blueprintData) == null ? void 0 : a.html) ?? "", o = ((l = r.blueprintData) == null ? void 0 : l.css) ?? "", c = r.applyRequestedAt ?? 0;
40
42
  d.set(t, (d.get(t) ?? 0) + 1);
41
43
  try {
42
- const s = r === "debounced" ? await I(e, { html: n, css: l }) : await F(e, { html: n, css: l });
43
- if (s.status === "superseded")
44
+ const i = n === "debounced" ? await O(t, { html: e, css: o }) : await H(t, { html: e, css: o });
45
+ if (i.status === "superseded")
44
46
  return;
45
- if (s.status === "applied") {
46
- h.set(e, n), u.delete(t), D(t, "applied", c);
47
+ if (i.status === "applied") {
48
+ E.set(t, e), u.delete(t), D(t, "applied", c);
47
49
  return;
48
50
  }
49
- const m = u.get(t);
50
- u.set(t, { html: n, count: (m == null ? void 0 : m.html) === n ? m.count + 1 : 1 }), D(t, "failed", c, s.error);
51
+ const y = u.get(t), j = (y == null ? void 0 : y.html) === e ? y.count + 1 : 1;
52
+ u.set(t, { html: e, count: j }), D(t, "failed", c, i.error);
53
+ } catch (i) {
54
+ console.error("[guido:apply] apply threw before it could settle", i), D(t, "failed", c, i);
51
55
  } finally {
52
56
  d.set(t, (d.get(t) ?? 1) - 1);
53
- const s = E.get(t);
54
- s && !B(t) && (E.delete(t), (((q = s.blueprintData) == null ? void 0 : q.html) ?? "") !== n && w(t, e, s, r));
57
+ const i = T.get(t);
58
+ i && !I(t) && (T.delete(t), P(t) && (((h = i.blueprintData) == null ? void 0 : h.html) ?? "") !== e && v(t, i, n));
55
59
  }
56
- }, U = (t) => {
57
- var a;
58
- if (t.blueprintType !== W)
60
+ }, N = (t) => {
61
+ var h;
62
+ if (t.blueprintType !== rt)
59
63
  return;
60
- const { blueprintId: e } = t, o = (a = t.blueprintData) == null ? void 0 : a.html;
61
- if (!e || !o)
64
+ const { blueprintId: r } = t, n = (h = t.blueprintData) == null ? void 0 : h.html;
65
+ if (!r || !n)
62
66
  return;
67
+ const e = ct(r, t.version);
63
68
  if (!t.applyRequested) {
64
- x(e);
69
+ F(e);
65
70
  return;
66
71
  }
67
- const r = ot(e, t.version), n = t.applyRequestedAt ?? 0, l = S.get(r);
68
- if (l === void 0 || n > l) {
69
- const i = l === void 0;
70
- if (S.set(r, n), u.delete(r), i && G().has(r)) {
71
- h.set(e, o);
72
+ const o = t.applyRequestedAt ?? 0, c = _.get(e);
73
+ if (c === void 0 || o > c) {
74
+ const i = c === void 0;
75
+ if (_.set(e, o), u.delete(e), (!s || o >= s.requestedAt) && (s = { key: e, requestedAt: o }), i && U().has(e)) {
76
+ E.set(e, n);
72
77
  return;
73
78
  }
74
- w(r, e, t, "immediate");
79
+ v(e, t, "immediate");
75
80
  return;
76
81
  }
77
- const c = h.get(e);
78
- if (c !== o) {
79
- if (c === void 0) {
80
- if (B(r)) {
81
- E.set(r, t);
82
+ const a = E.get(e);
83
+ if (a === n || !P(e))
84
+ return;
85
+ const l = u.get(e);
86
+ if (!((l == null ? void 0 : l.html) === n && l.count >= it)) {
87
+ if (a === void 0) {
88
+ if (I(e)) {
89
+ T.set(e, t);
82
90
  return;
83
91
  }
84
- const i = u.get(r);
85
- if ((i == null ? void 0 : i.html) === o && i.count >= rt)
86
- return;
87
- w(r, e, t, "immediate");
92
+ v(e, t, "immediate");
88
93
  return;
89
94
  }
90
- w(r, e, t, "debounced");
95
+ f.get(e) !== n && (f.set(e, n), v(e, t, "debounced").finally(() => {
96
+ f.get(e) === n && f.delete(e);
97
+ }));
91
98
  }
92
- }, g = (t) => t === void 0 || _.has(t) ? !1 : (_.add(t), C({
93
- type: z.Error,
94
- message: H("newsletter.ai-template-failed")
95
- }), !0), Y = (t) => {
96
- Array.isArray(t) && t.forEach((e) => {
97
- const o = e == null ? void 0 : e.id;
98
- (e == null ? void 0 : e.isError) === !0 && g(o) && M && console.debug(`[guido:cortex] message-level error id=${o}`, e);
99
- const r = e == null ? void 0 : e.segments;
100
- Array.isArray(r) && r.forEach((n) => {
101
- if (n)
102
- switch (O(o, n), n.type) {
99
+ }, R = (t) => t === void 0 || g.has(t) ? !1 : (g.add(t), C({
100
+ type: Z.Error,
101
+ message: G("newsletter.ai-template-failed")
102
+ }), !0), X = (t) => {
103
+ Array.isArray(t) && t.forEach((r) => {
104
+ const n = r == null ? void 0 : r.id;
105
+ (r == null ? void 0 : r.isError) === !0 && R(n) && B && console.debug(`[guido:cortex] message-level error id=${n}`, r);
106
+ const e = r == null ? void 0 : r.segments;
107
+ Array.isArray(e) && e.forEach((o) => {
108
+ if (o)
109
+ switch (K(n, o), o.type) {
103
110
  case "blueprint":
104
- U(n);
111
+ N(o);
105
112
  break;
106
113
  case "error":
107
- g(o);
114
+ R(n);
108
115
  break;
109
116
  }
110
117
  });
111
118
  });
112
- }, P = () => {
113
- T !== null && (clearInterval(T), T = null);
114
119
  }, $ = () => {
120
+ w !== null && (clearInterval(w), w = null);
121
+ }, q = () => {
115
122
  var t;
116
- return (t = A._s) == null ? void 0 : t.get(tt);
123
+ return (t = b._s) == null ? void 0 : t.get(nt);
117
124
  }, L = (t) => {
118
- f = t, b = Z(() => t.messages, Y, { deep: !0, immediate: !0 });
119
- }, R = $();
120
- R ? L(R) : T = setInterval(() => {
121
- const t = $();
122
- t && (P(), L(t));
123
- }, nt), V(() => {
124
- P(), b == null || b(), f = void 0, h.clear(), S.clear(), u.clear(), d.clear(), E.clear(), _.clear(), v === y && (v = null, p.$patch((t) => {
125
+ A = t, m = et(() => t.messages, X, { deep: !0, immediate: !0 });
126
+ }, x = q();
127
+ x ? L(x) : w = setInterval(() => {
128
+ const t = q();
129
+ t && ($(), L(t));
130
+ }, lt), tt(() => {
131
+ $(), m == null || m(), A = void 0, E.clear(), f.clear(), _.clear(), u.clear(), s = null, d.clear(), T.clear(), g.clear(), S === M && (S = null, p.$patch((t) => {
125
132
  t.bridgeActive = !1, t.applyAcks = {};
126
- }), N());
133
+ }), J());
127
134
  });
128
135
  };
129
136
  export {
130
- ft as useCortexBlueprintBridge
137
+ bt as useCortexBlueprintBridge
131
138
  };
@@ -1,102 +1,115 @@
1
- import { useActionsApi as Q } from "./useActionsApi.js";
2
- import { useConfig as x } from "./useConfig.js";
3
- import { useEditorLock as z } from "./useEditorLock.js";
4
- import { useToaster as N } from "./useToaster.js";
5
- import { useTranslations as q } from "./useTranslations.js";
6
- import { ToasterTypeOptions as D } from "../enums/toaster.js";
7
- import { useDynamicContentStore as R } from "../stores/dynamic-content.js";
8
- import { useEditorStore as F } from "../stores/editor.js";
9
- import { flattenDynamicContentList as G } from "../utils/genericUtil.js";
10
- import { extractUsedDynamicContent as $ } from "../utils/registerUsedDynamicContent.js";
11
- import { ref as j, watch as J } from "vue";
12
- const K = 250, S = 12e4, c = { status: "superseded" }, h = { status: "failed", error: new Error("Blueprint has no html to apply") }, i = j({}), v = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), ie = () => {
13
- const { updateHtmlAndCss: a } = Q(), { runExclusive: M } = z(), { showToaster: d } = N(), y = q(), { template: U } = x(), A = R(), E = F(), T = (e, t) => {
14
- u.get(e) !== t && (u.set(e, t), d({
15
- type: D.Error,
16
- message: y("newsletter.ai-template-failed-apply")
1
+ import { useActionsApi as x } from "./useActionsApi.js";
2
+ import { useConfig as z } from "./useConfig.js";
3
+ import { useEditorLock as N } from "./useEditorLock.js";
4
+ import { useToaster as K } from "./useToaster.js";
5
+ import { useTranslations as R } from "./useTranslations.js";
6
+ import { ToasterTypeOptions as U } from "../enums/toaster.js";
7
+ import { useDynamicContentStore as F } from "../stores/dynamic-content.js";
8
+ import { useEditorStore as G } from "../stores/editor.js";
9
+ import { flattenDynamicContentList as $ } from "../utils/genericUtil.js";
10
+ import { extractUsedDynamicContent as j } from "../utils/registerUsedDynamicContent.js";
11
+ import { ref as J, watch as V } from "vue";
12
+ const W = 250, M = 12e4, X = 1e3, p = { status: "superseded" }, A = { status: "failed", error: new Error("Blueprint has no html to apply") }, a = J({}), O = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
13
+ let d = null;
14
+ const E = () => {
15
+ d && (clearInterval(d), d = null);
16
+ }, ue = () => {
17
+ const { updateHtmlAndCss: i } = x(), { runExclusive: P } = N(), { showToaster: T } = K(), w = R(), { template: _ } = z(), b = F(), g = G(), y = (e, t) => {
18
+ m.get(e) !== t && (m.set(e, t), T({
19
+ type: U.Error,
20
+ message: w("newsletter.ai-template-failed-apply")
17
21
  }));
18
- }, O = () => {
22
+ }, C = () => {
19
23
  var e, t;
20
- return E.isStripoInitialized && typeof ((t = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : t.updateHtmlAndCss) == "function";
21
- }, P = (e) => {
22
- i.value[e] === void 0 && (i.value = { ...i.value, [e]: "pending" });
23
- }, m = (e, t) => {
24
- i.value = { ...i.value, [e]: t };
25
- }, _ = (e) => {
24
+ return g.isStripoInitialized && typeof ((t = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : t.updateHtmlAndCss) == "function";
25
+ }, L = (e) => {
26
+ a.value[e] === void 0 && (a.value = { ...a.value, [e]: "pending" });
27
+ }, l = (e, t) => {
28
+ a.value = { ...a.value, [e]: t };
29
+ }, Q = (e) => {
26
30
  var t;
27
31
  try {
28
- const o = G((t = U.value) == null ? void 0 : t.dynamicContentList), s = $(e, o);
29
- s.length > 0 && A.registerDynamicContent(s);
32
+ const r = $((t = _.value) == null ? void 0 : t.dynamicContentList), n = j(e, r);
33
+ n.length > 0 && b.registerDynamicContent(n);
30
34
  } catch {
31
35
  }
32
36
  }, H = (e, t) => {
33
- u.delete(e), v.get(e) !== t && (v.set(e, t), d({
34
- type: D.Success,
35
- message: y("newsletter.ai-template-applied")
37
+ m.delete(e), O.get(e) !== t && (O.set(e, t), T({
38
+ type: U.Success,
39
+ message: w("newsletter.ai-template-applied")
36
40
  }));
37
- }, g = async (e, t, o) => {
38
- const s = (l.get(e) ?? 0) + 1;
39
- l.set(e, s), m(e, "applying");
41
+ }, D = async (e, t, r) => {
42
+ const n = (u.get(e) ?? 0) + 1;
43
+ u.set(e, n), l(e, "applying");
40
44
  try {
41
- await M(() => a(t, o));
42
- } catch (n) {
43
- return l.get(e) !== s ? c : (console.error("[guido:apply] editor did not acknowledge the template apply", n), m(e, "failed"), T(e, t), { status: "failed", error: n });
45
+ await P(() => i(t, r));
46
+ } catch (o) {
47
+ return u.get(e) !== n ? p : (console.error("[guido:apply] editor did not acknowledge the template apply", o), l(e, "failed"), y(e, t), { status: "failed", error: o });
44
48
  }
45
- return l.get(e) !== s ? c : (m(e, "applied"), _(t), H(e, t), { status: "applied" });
46
- }, k = (e) => {
47
- const t = r.get(e);
48
- t && (clearTimeout(t.timer), r.delete(e), t.settle(c));
49
- }, w = (e) => {
50
- const t = p.get(e);
51
- t && (clearTimeout(t.timer), p.delete(e), t.settle(c));
52
- }, B = (e, t, o) => new Promise((s) => {
53
- k(e);
54
- const n = setTimeout(() => {
55
- r.delete(e), m(e, "failed"), T(e, t), s({
56
- status: "failed",
57
- error: new Error(`Editor did not become ready within ${S}ms`)
58
- });
59
- }, S);
60
- r.set(e, { html: t, css: o, timer: n, settle: s }), m(e, "applying");
61
- }), C = (e, t, o) => O() ? g(e, t, o) : B(e, t, o), L = async () => {
62
- if (r.size === 0)
49
+ return u.get(e) !== n ? p : (l(e, "applied"), Q(t), H(e, t), { status: "applied" });
50
+ }, I = (e) => {
51
+ const t = s.get(e);
52
+ t && (clearTimeout(t.timer), s.delete(e), t.settle(p));
53
+ }, S = (e) => {
54
+ const t = c.get(e);
55
+ t && (clearTimeout(t.timer), c.delete(e), t.settle(p));
56
+ }, B = () => {
57
+ [...c.keys()].forEach(S);
58
+ }, h = async () => {
59
+ if (s.size === 0) {
60
+ E();
61
+ return;
62
+ }
63
+ if (!C())
63
64
  return;
64
- const e = [...r.entries()];
65
- r.clear(), e.forEach(([, n]) => clearTimeout(n.timer));
65
+ E();
66
+ const e = [...s.entries()];
67
+ s.clear(), e.forEach(([, o]) => clearTimeout(o.timer));
66
68
  const t = e.pop();
67
- if (e.forEach(([n, f]) => {
68
- m(n, "pending"), f.settle(c);
69
+ if (e.forEach(([o, f]) => {
70
+ l(o, "failed"), f.settle({ status: "failed", error: new Error("Displaced by a newer apply") });
69
71
  }), !t)
70
72
  return;
71
- const [o, s] = t;
72
- s.settle(await g(o, s.html, s.css));
73
- };
74
- return J(() => E.isStripoInitialized, (e) => {
75
- e && L();
76
- }, { immediate: !0 }), { applyStatus: i, markPending: P, applyTemplate: (e, t) => {
77
- const { html: o } = t;
78
- return o ? (w(e), C(e, o, t.css ?? "")) : Promise.resolve(h);
73
+ const [r, n] = t;
74
+ n.settle(await D(r, n.html, n.css));
75
+ }, q = (e, t, r) => new Promise((n) => {
76
+ I(e);
77
+ const o = setTimeout(() => {
78
+ s.delete(e), l(e, "failed"), y(e, t), n({
79
+ status: "failed",
80
+ error: new Error(`Editor did not become ready within ${M}ms`)
81
+ });
82
+ }, M);
83
+ s.set(e, { html: t, css: r, timer: o, settle: n }), l(e, "applying"), d ?? (d = setInterval(() => {
84
+ h();
85
+ }, X));
86
+ }), v = (e, t, r) => C() ? D(e, t, r) : q(e, t, r);
87
+ return V(() => g.isStripoInitialized, (e) => {
88
+ e && h();
89
+ }, { immediate: !0 }), { applyStatus: a, markPending: L, applyTemplate: (e, t) => {
90
+ const { html: r } = t;
91
+ return r ? (B(), v(e, r, t.css ?? "")) : Promise.resolve(A);
79
92
  }, applyTemplateDebounced: (e, t) => {
80
- const { html: o } = t;
81
- if (!o)
82
- return Promise.resolve(h);
83
- const s = t.css ?? "";
84
- return new Promise((n) => {
85
- w(e);
93
+ const { html: r } = t;
94
+ if (!r)
95
+ return Promise.resolve(A);
96
+ const n = t.css ?? "";
97
+ return new Promise((o) => {
98
+ S(e);
86
99
  const f = setTimeout(() => {
87
- p.delete(e), C(e, o, s).then(n);
88
- }, K);
89
- p.set(e, { timer: f, settle: n });
100
+ c.delete(e), v(e, r, n).then(o);
101
+ }, W);
102
+ c.set(e, { timer: f, settle: o });
90
103
  });
91
104
  } };
92
- }, ce = () => {
93
- p.forEach((a) => {
94
- clearTimeout(a.timer), a.settle(c);
95
- }), p.clear(), r.forEach((a) => {
96
- clearTimeout(a.timer), a.settle(c);
97
- }), r.clear(), l.clear(), u.clear(), i.value = {};
105
+ }, me = () => {
106
+ c.forEach((i) => {
107
+ clearTimeout(i.timer), i.settle(p);
108
+ }), c.clear(), s.forEach((i) => {
109
+ clearTimeout(i.timer), i.settle(p);
110
+ }), s.clear(), E(), m.clear(), a.value = {};
98
111
  };
99
112
  export {
100
- ce as resetEmailTemplateApplier,
101
- ie as useEmailTemplateApplier
113
+ me as resetEmailTemplateApplier,
114
+ ue as useEmailTemplateApplier
102
115
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-7674b645]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-7674b645]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-7674b645]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}
1
+ @charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-bb2a5f2c]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-bb2a5f2c]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-bb2a5f2c]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}
@@ -17,9 +17,7 @@
17
17
  * - `error` segments (and message-level `isError` / `isCancelled`) trigger
18
18
  * a localized toaster.
19
19
  *
20
- * Every apply settles into a terminal `applyAcks` entry on the public store, so
21
- * cortex can move its Apply button on the truth of the editor write rather than
22
- * on the click.
20
+ * Every apply settles into a terminal `applyAcks` entry, so cortex moves its button on the write, not the click.
23
21
  *
24
22
  * In dev (`import.meta.env.DEV`) every observed segment + message-level flag
25
23
  * change is also `console.debug`-logged with the prefix `[guido:cortex]` so a
@@ -1,11 +1,7 @@
1
1
  type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
2
2
  /**
3
- * Terminal outcome of an apply. Every promise this composable hands out settles
4
- * with exactly one of these — callers (the cortex bridge) ack on it, so a
5
- * never-settling promise would strand cortex's Apply button forever.
6
- *
7
- * `superseded` means a newer payload for the same blueprint replaced this one:
8
- * not a success, not a failure, and deliberately never acked.
3
+ * Terminal outcome of an apply; every promise here settles with one, since the bridge acks on it.
4
+ * `superseded`: a newer payload for the same key replaced this one and owns the ack.
9
5
  */
10
6
  export type ApplyOutcome = {
11
7
  status: 'applied';
@@ -25,19 +21,16 @@ export type ApplyOutcome = {
25
21
  * - manual Apply click (first apply): immediate.
26
22
  * - blueprint_update after the user has applied once: debounced 250 ms trailing
27
23
  * so rapid mid-stream updates don't thrash updateHtmlAndCss.
28
- *
29
- * A click that lands before Stripo finished initializing is queued rather than
30
- * dropped, and flushed when `isStripoInitialized` flips — the user does not
31
- * have to click again.
24
+ * - a click before Stripo is ready is queued and flushed when `isStripoInitialized` flips.
32
25
  */
33
26
  export declare const useEmailTemplateApplier: () => {
34
27
  applyStatus: import("vue").Ref<Record<string, ApplyStatus>>;
35
- markPending: (blueprintId: string) => void;
36
- applyTemplate: (blueprintId: string, data: {
28
+ markPending: (key: string) => void;
29
+ applyTemplate: (key: string, data: {
37
30
  html?: string;
38
31
  css?: string;
39
32
  }) => Promise<ApplyOutcome>;
40
- applyTemplateDebounced: (blueprintId: string, data: {
33
+ applyTemplateDebounced: (key: string, data: {
41
34
  html?: string;
42
35
  css?: string;
43
36
  }) => Promise<ApplyOutcome>;
@@ -32,23 +32,11 @@ export interface GuidoEmailEditorState {
32
32
  * Published as `@useinsider/guido/editor-state` and from the root barrel, so a
33
33
  * consumer imports this store instead of re-declaring one under the same id.
34
34
  *
35
- * This store is **state-only, by contract**. It declares no actions and no
36
- * non-trivial getters, so `pinia.state.value['guidoEmailEditor']` is a complete
37
- * view of it. cortex-fe reads it through that public path; adding an action or
38
- * a getter that cortex needs would silently break that read. Keep it
39
- * state-only. (`hasSnapshot` stays — cortex does not read it.)
35
+ * State-only by contract: cortex-fe reads `pinia.state.value['guidoEmailEditor']`, which misses
36
+ * actions and getters. Intended writers: `useGuidoStateBridge` and `useCortexBlueprintBridge`.
40
37
  *
41
- * `useGuidoStateBridge` (the snapshot) and `useCortexBlueprintBridge` (the
42
- * apply handshake) are the only intended writers, but that is Guido's own
43
- * convention rather than something the store enforces: publishing the
44
- * definition hands a consumer `$patch` as well, exactly as the runtime
45
- * `pinia._s` probe always did.
46
- *
47
- * Store id `guidoEmailEditor` is cross-MFE: cortex-fe reads it at runtime rather
48
- * than importing it, so the id stays part of the contract. The internal Guido
49
- * editor store keeps id `guidoEditor` — these are intentionally separate. The
50
- * internal store carries UI state a consumer should not see; this public store
51
- * carries the contract Guido is willing to share.
38
+ * The id `guidoEmailEditor` is part of the cross-MFE contract; the internal
39
+ * store `guidoEditor` is intentionally separate.
52
40
  */
53
41
  export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"guidoEmailEditor", GuidoEmailEditorState, {
54
42
  /** True once the bridge has published at least one snapshot. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.19.0-beta.5355c3f",
3
+ "version": "3.19.0-beta.6f88fb4",
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",