@useinsider/guido 3.18.0 → 3.18.1-beta.5cddb72

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,52 +1,55 @@
1
- import { useActionsApi as x } from "./useActionsApi.js";
2
- import { useConfig as T } from "./useConfig.js";
3
- import { useSaveStart as E, useSaveComplete as q } from "./useGuidoActions.js";
4
- import { useSyncModuleExtractor as C } from "./useSyncModuleExtractor.js";
5
- import { ToasterTypeOptions as M } from "../enums/toaster.js";
6
- import { useStripoApi as D } from "../services/stripoApi.js";
7
- import { useTemplatePreparation as L } from "../utils/templatePreparation.js";
8
- import { useAllowlist as P } from "./useAllowlist.js";
9
- import { useHtmlValidator as U } from "./useHtmlValidator.js";
10
- import { useToaster as A } from "./useToaster.js";
11
- import { useCouponBlockValidator as h } from "./validators/useCouponBlockValidator.js";
12
- import { useLiquidValidator as F } from "./validators/useLiquidValidator.js";
13
- import { useSyncModuleBlockValidator as O } from "./validators/useSyncModuleBlockValidator.js";
14
- import { useUnsubscribeBlockValidator as W } from "./validators/useUnsubscribeBlockValidator.js";
15
- const it = () => {
16
- const l = E(), n = q(), { validateHtml: c } = U(), { validateLiquidSyntax: d } = F(), { validateCouponBlockTags: m } = h(), { validateUnsubscribeBlockUniqueness: u, validateUnsubscribeBlockHasTemplate: p } = W(), { validateSyncModuleBlocks: f } = O(), { callbacks: a, isFeatureEnabled: s } = T(), { extractSyncModuleData: v } = C(), { setSyncModuleUnsubscriptionPages: S } = D(), { editorSave: b } = x(), { showToaster: w } = A(), { getBlockedDomains: V, resolveToast: y } = P();
17
- return { save: async (H = !1, e = !1) => {
18
- var r;
19
- l();
20
- const { prepareTemplateDetails: k } = L(), t = await k();
21
- if (!f(t.rawHtml, e) || !m(t.compiledHtml) || !u(t.compiledHtml) || !p(t.compiledHtml))
1
+ import { useActionsApi as T } from "./useActionsApi.js";
2
+ import { useConfig as q } from "./useConfig.js";
3
+ import { useEditorLock as C } from "./useEditorLock.js";
4
+ import { useSaveStart as L, useSaveComplete as M } from "./useGuidoActions.js";
5
+ import { useSyncModuleExtractor as D } from "./useSyncModuleExtractor.js";
6
+ import { ToasterTypeOptions as P } from "../enums/toaster.js";
7
+ import { useStripoApi as U } from "../services/stripoApi.js";
8
+ import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
9
+ import { useAllowlist as h } from "./useAllowlist.js";
10
+ import { useHtmlValidator as F } from "./useHtmlValidator.js";
11
+ import { useToaster as O } from "./useToaster.js";
12
+ import { useCouponBlockValidator as W } from "./validators/useCouponBlockValidator.js";
13
+ import { useLiquidValidator as j } from "./validators/useLiquidValidator.js";
14
+ import { useSyncModuleBlockValidator as z } from "./validators/useSyncModuleBlockValidator.js";
15
+ import { useUnsubscribeBlockValidator as G } from "./validators/useUnsubscribeBlockValidator.js";
16
+ const rt = () => {
17
+ const n = L(), c = M(), { validateHtml: d } = F(), { validateLiquidSyntax: m } = j(), { validateCouponBlockTags: u } = W(), { validateUnsubscribeBlockUniqueness: p, validateUnsubscribeBlockHasTemplate: f } = G(), { validateSyncModuleBlocks: v } = z(), { callbacks: s, isFeatureEnabled: r } = q(), { extractSyncModuleData: S } = D(), { setSyncModuleUnsubscriptionPages: b } = U(), { editorSave: w } = T(), { showToaster: V } = O(), { getBlockedDomains: y, resolveToast: k } = h(), { runExclusive: x } = C(), H = async (a, o) => {
18
+ var l;
19
+ n();
20
+ const { prepareTemplateDetails: B } = A(), t = await B();
21
+ if (!v(t.rawHtml, o) || !u(t.compiledHtml) || !p(t.compiledHtml) || !f(t.compiledHtml))
22
22
  return;
23
- if (s("liquidSyntax")) {
24
- if (!await d(t.compiledHtml))
23
+ if (r("liquidSyntax")) {
24
+ if (!await m(t.compiledHtml))
25
25
  return;
26
- } else if (!await c(t.compiledHtml, t.dynamicContentList, !0))
26
+ } else if (!await d(t.compiledHtml, t.dynamicContentList, !0))
27
27
  return;
28
- if ((r = a.value) != null && r.externalValidation && !await a.value.externalValidation(t))
28
+ if ((l = s.value) != null && l.externalValidation && !await s.value.externalValidation(t))
29
29
  return;
30
- if (s("allowlistEnabled")) {
31
- const o = await V(t.compiledHtml, t.css);
32
- if (o.length) {
33
- if (!e) {
34
- const i = await y(o);
35
- i != null && i.message && w({
36
- type: M.Warning,
37
- message: i.message,
38
- actionButton: i.actionButton
30
+ if (r("allowlistEnabled")) {
31
+ const i = await y(t.compiledHtml, t.css);
32
+ if (i.length) {
33
+ if (!o) {
34
+ const e = await k(i);
35
+ e != null && e.message && V({
36
+ type: P.Warning,
37
+ message: e.message,
38
+ actionButton: e.actionButton
39
39
  });
40
40
  }
41
41
  return;
42
42
  }
43
43
  }
44
- if (!await b())
44
+ if (!await w())
45
45
  return;
46
- const { unsubscribePayload: B, stripoModules: g } = v(t.rawHtml);
47
- return await S(B), t.modules = g, H || n({ ...t, silent: e }), t;
48
- } };
46
+ const { unsubscribePayload: E, stripoModules: g } = S(t.rawHtml);
47
+ return await b(E), t.modules = g, a || c({ ...t, silent: o }), t;
48
+ };
49
+ return { save: (a = !1, o = !1) => x(
50
+ () => H(a, o)
51
+ ) };
49
52
  };
50
53
  export {
51
- it as useSave
54
+ rt as useSave
52
55
  };
@@ -4,19 +4,26 @@ import memoize from "../node_modules/lodash-es/memoize.js";
4
4
  import { ref } from "vue";
5
5
  import { useConfig } from "./useConfig.js";
6
6
  const useTranslations = () => {
7
- var o, e;
8
- const { config } = useConfig(), translationsPath = ((e = (o = config.value) == null ? void 0 : o.editor) == null ? void 0 : e.translationsPath) || DEFAULT_EDITOR.translationsPath, translations = ref(eval(translationsPath)), trans = (t, n) => {
9
- const r = translations.value[t];
10
- return r ? n ? Object.entries(n).reduce(
11
- (s, [i, a]) => s.replace(new RegExp(`{${i}}`, "g"), String(a)),
12
- r
13
- ) : r : (console.warn(`Translation key not found: ${t}`), t);
7
+ var o, r;
8
+ const { config } = useConfig(), translationsPath = ((r = (o = config.value) == null ? void 0 : o.editor) == null ? void 0 : r.translationsPath) || DEFAULT_EDITOR.translationsPath, translations = ref(eval(translationsPath)), trans = (n, t) => {
9
+ const s = translations.value[n];
10
+ return s ? t ? Object.entries(t).reduce(
11
+ (e, [a, i]) => e.replace(new RegExp(`{${a}}`, "g"), String(i)),
12
+ s
13
+ ) : s : (console.warn(`Translation key not found: ${n}`), n);
14
14
  };
15
15
  return memoize(
16
16
  trans,
17
- (t, n) => !n || Object.keys(n).length === 0 ? t : JSON.stringify({ key: t, params: n })
17
+ (n, t) => !t || Object.keys(t).length === 0 ? n : JSON.stringify({ key: n, params: t })
18
18
  );
19
+ }, useTranslationWithFallback = () => {
20
+ const o = useTranslations();
21
+ return (r, n) => {
22
+ const t = o(r);
23
+ return t === r ? n : t;
24
+ };
19
25
  };
20
26
  export {
27
+ useTranslationWithFallback,
21
28
  useTranslations
22
29
  };
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-6e711fd7]{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-5c588dc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-5c588dc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-5c588dc5]{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-7de301b5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-7de301b5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-7de301b5]{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,4 +1,4 @@
1
- const o = { stripo: { version: "2.72.1" } }, s = {
1
+ const o = { stripo: { version: "2.73.0" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
@@ -17,12 +17,13 @@
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.
23
+ *
20
24
  * In dev (`import.meta.env.DEV`) every observed segment + message-level flag
21
25
  * change is also `console.debug`-logged with the prefix `[guido:cortex]` so a
22
26
  * developer can watch the agent stream in real time. In production this is
23
27
  * gated behind `localStorage.guido:debug:ai === '1'`.
24
- *
25
- * If cortex-fe isn't loaded the chat store is undefined and the bridge is a
26
- * no-op (intentional — Guido must still work standalone).
27
28
  */
28
29
  export declare const useCortexBlueprintBridge: () => void;
@@ -0,0 +1,10 @@
1
+ export declare const isEditorBusy: () => boolean;
2
+ export declare const beginMount: () => number;
3
+ export declare const isCurrentMount: (generation: number) => boolean;
4
+ export declare const runExclusive: <T>(task: () => Promise<T>) => Promise<T>;
5
+ export declare const useEditorLock: () => {
6
+ runExclusive: <T>(task: () => Promise<T>) => Promise<T>;
7
+ isEditorBusy: () => boolean;
8
+ beginMount: () => number;
9
+ isCurrentMount: (generation: number) => boolean;
10
+ };
@@ -1,4 +1,20 @@
1
1
  type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
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.
9
+ */
10
+ export type ApplyOutcome = {
11
+ status: 'applied';
12
+ } | {
13
+ status: 'failed';
14
+ error: unknown;
15
+ } | {
16
+ status: 'superseded';
17
+ };
2
18
  /**
3
19
  * Applies email_template blueprints from the chat agent to the Stripo editor.
4
20
  *
@@ -9,6 +25,10 @@ type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
9
25
  * - manual Apply click (first apply): immediate.
10
26
  * - blueprint_update after the user has applied once: debounced 250 ms trailing
11
27
  * 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.
12
32
  */
13
33
  export declare const useEmailTemplateApplier: () => {
14
34
  applyStatus: import("vue").Ref<Record<string, ApplyStatus>>;
@@ -16,11 +36,11 @@ export declare const useEmailTemplateApplier: () => {
16
36
  applyTemplate: (blueprintId: string, data: {
17
37
  html?: string;
18
38
  css?: string;
19
- }) => void;
39
+ }) => Promise<ApplyOutcome>;
20
40
  applyTemplateDebounced: (blueprintId: string, data: {
21
41
  html?: string;
22
42
  css?: string;
23
- }) => void;
43
+ }) => Promise<ApplyOutcome>;
24
44
  };
25
45
  export declare const resetEmailTemplateApplier: () => void;
26
46
  export {};
@@ -2,4 +2,9 @@ interface TranslationValues {
2
2
  [key: string]: string | number | boolean;
3
3
  }
4
4
  export declare const useTranslations: () => ((key: string, params?: TranslationValues) => string) & import("lodash").MemoizedFunction;
5
+ /**
6
+ * `trans()` echoes the key back when the host catalog has no entry, so a caller
7
+ * shipping ahead of its i18n rows can substitute an English default.
8
+ */
9
+ export declare const useTranslationWithFallback: () => (key: string, fallback: string) => string;
5
10
  export {};
@@ -1,16 +1,28 @@
1
+ /** Terminal outcome of an editor write, keyed by `${blueprintId}:${version}`. */
2
+ export interface ApplyAck {
3
+ status: 'applied' | 'failed';
4
+ /** The `applyRequestedAt` of the click this ack answers — lets cortex drop stale acks. */
5
+ requestedAt: number;
6
+ /** Strictly increasing per key, so two acks in the same millisecond still order. */
7
+ ackAt: number;
8
+ /** Stringified — cortex JSON-clones store-derived payloads, an Error would not survive. */
9
+ error?: string;
10
+ }
1
11
  /**
2
12
  * Outbound contract Guido publishes to the host's shared Pinia singleton so
3
13
  * cortex-fe can pick up the current editor state and forward it as
4
14
  * `clientState.editor` on the next chat-stream POST.
5
15
  *
6
- * State + getters only `useGuidoStateBridge` writes via `$patch`, no actions
7
- * live here (architecture invariant).
16
+ * This store is **state-only, by contract**. It declares no actions and no
17
+ * non-trivial getters, so `pinia.state.value['guidoEmailEditor']` is a complete
18
+ * view of it. cortex-fe reads it through that public path; adding an action or
19
+ * a getter that cortex needs would silently break that read. Keep it
20
+ * state-only. (`hasSnapshot` stays — cortex does not read it.)
8
21
  *
9
- * Store id `guidoEmailEditor` is cross-MFE: cortex-fe reads it via
10
- * `pinia._s.get('guidoEmailEditor')` at runtime. The internal Guido editor
11
- * store keeps id `guidoEditor` these are intentionally separate. The
12
- * internal store carries UI state that cortex-fe should not see; this public
13
- * store carries the contract Guido is willing to share.
22
+ * Store id `guidoEmailEditor` is cross-MFE. The internal Guido editor store
23
+ * keeps id `guidoEditor` these are intentionally separate. The internal store
24
+ * carries UI state that cortex-fe should not see; this public store carries the
25
+ * contract Guido is willing to share.
14
26
  */
15
27
  export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"guidoEmailEditor", {
16
28
  /** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
@@ -21,6 +33,10 @@ export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"
21
33
  lastUpdatedAt: number;
22
34
  /** Template id from the editor config, for cortex-fe to scope per-template. */
23
35
  templateId: string;
36
+ /** True while a mounted Guido bridge is consuming the chat store. Gates cortex's Apply button. */
37
+ bridgeActive: boolean;
38
+ /** `${blueprintId}:${version}` → terminal outcome of the editor write, written only after it settles. */
39
+ applyAcks: Record<string, ApplyAck>;
24
40
  }, {
25
41
  /** True once the bridge has published at least one snapshot. */
26
42
  hasSnapshot: (state: {
@@ -28,6 +44,8 @@ export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"
28
44
  css: string;
29
45
  lastUpdatedAt: number;
30
46
  templateId: string;
47
+ bridgeActive: boolean;
48
+ applyAcks: Record<string, ApplyAck>;
31
49
  } & import("pinia").PiniaCustomStateProperties<{
32
50
  /** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
33
51
  html: string;
@@ -37,5 +55,9 @@ export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"
37
55
  lastUpdatedAt: number;
38
56
  /** Template id from the editor config, for cortex-fe to scope per-template. */
39
57
  templateId: string;
58
+ /** True while a mounted Guido bridge is consuming the chat store. Gates cortex's Apply button. */
59
+ bridgeActive: boolean;
60
+ /** `${blueprintId}:${version}` → terminal outcome of the editor write, written only after it settles. */
61
+ applyAcks: Record<string, ApplyAck>;
40
62
  }>) => boolean;
41
63
  }, {}>;
@@ -8,7 +8,11 @@ const d = e("guidoEmailEditor", {
8
8
  /** Wall-clock ms when html/css were last written by the bridge. */
9
9
  lastUpdatedAt: 0,
10
10
  /** Template id from the editor config, for cortex-fe to scope per-template. */
11
- templateId: ""
11
+ templateId: "",
12
+ /** True while a mounted Guido bridge is consuming the chat store. Gates cortex's Apply button. */
13
+ bridgeActive: !1,
14
+ /** `${blueprintId}:${version}` → terminal outcome of the editor write, written only after it settles. */
15
+ applyAcks: {}
12
16
  }),
13
17
  getters: {
14
18
  /** 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.18.0",
3
+ "version": "3.18.1-beta.5cddb72",
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",
@@ -118,7 +118,7 @@
118
118
  },
119
119
  "guido": {
120
120
  "stripo": {
121
- "version": "2.72.1"
121
+ "version": "2.73.0"
122
122
  }
123
123
  }
124
124
  }