@useinsider/guido 3.9.1-beta.8a96896 → 3.9.1-beta.bde1a34
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.
- package/dist/components/organisms/header/EditorToolbar.vue.js +2 -2
- package/dist/components/organisms/header/EditorToolbar.vue2.js +6 -7
- package/dist/composables/useCortexBlueprintBridge.js +42 -49
- package/dist/config/i18n/en/labels.json.js +4 -1
- package/dist/enums/unsubscribe.js +41 -36
- package/dist/extensions/Blocks/Checkbox/block.js +5 -3
- package/dist/extensions/Blocks/Checkbox/control.js +41 -27
- package/dist/extensions/Blocks/RadioButton/block.js +9 -7
- package/dist/extensions/Blocks/RadioButton/control.js +63 -49
- package/dist/guido.css +1 -1
- package/dist/src/enums/unsubscribe.d.ts +2 -0
- package/dist/static/styles/components/dropdown-menu.css.js +12 -0
- package/package.json +1 -1
- package/dist/components/organisms/header/AiStatusPill.vue.js +0 -18
- package/dist/components/organisms/header/AiStatusPill.vue2.js +0 -17
- package/dist/composables/useAiStatus.js +0 -13
- package/dist/src/components/organisms/header/AiStatusPill.vue.d.ts +0 -2
- package/dist/src/composables/useAiStatus.d.ts +0 -11
- package/dist/src/stores/guido-ai-status.d.ts +0 -10
- package/dist/stores/guido-ai-status.js +0 -12
|
@@ -3,14 +3,14 @@ import i from "./EditorToolbar.vue2.js";
|
|
|
3
3
|
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var n = function() {
|
|
5
5
|
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
6
|
-
return o("div", { staticClass: "d-f editor-toolbar" }, [o(t.
|
|
6
|
+
return o("div", { staticClass: "d-f editor-toolbar" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isUndoButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__undo-button"), "tooltip-text": t.trans("action-builder.undo") } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isRedoButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__redo-button"), "tooltip-text": t.trans("action-builder.redo") } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isCodeEditorButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button"), "tooltip-text": t.codeEditorTooltipText } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isPreviewButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreviewToggle } }), o(t.ViewOptions, { staticClass: "ml-2" })], 1);
|
|
7
7
|
}, d = [], l = /* @__PURE__ */ s(
|
|
8
8
|
i,
|
|
9
9
|
n,
|
|
10
10
|
d,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"173c3a40"
|
|
14
14
|
);
|
|
15
15
|
const _ = l.exports;
|
|
16
16
|
export {
|
|
@@ -4,15 +4,14 @@ import { useTranslations as l } from "../../../composables/useTranslations.js";
|
|
|
4
4
|
import { useEditorStore as d } from "../../../stores/editor.js";
|
|
5
5
|
import { getTooltipOptions as w } from "../../../utils/tooltipUtils.js";
|
|
6
6
|
import { InButtonV2 as c } from "@useinsider/design-system-vue";
|
|
7
|
-
import a from "./
|
|
8
|
-
|
|
9
|
-
const x = /* @__PURE__ */ p({
|
|
7
|
+
import a from "./ViewOptions.vue.js";
|
|
8
|
+
const h = /* @__PURE__ */ p({
|
|
10
9
|
__name: "EditorToolbar",
|
|
11
|
-
setup(
|
|
12
|
-
const o = d(), e = l(), { openPreviewMode: t, closePreviewMode: r } = m(),
|
|
13
|
-
return { __sfc: !0, editorStore: o, trans: e, openPreviewMode: t, closePreviewMode: r, previewTooltipText:
|
|
10
|
+
setup(f) {
|
|
11
|
+
const o = d(), e = l(), { openPreviewMode: t, closePreviewMode: r } = m(), n = i(() => o.isPreviewModeOpen ? e("newsletter.close-email-preview") : e("newsletter.email-preview")), s = i(() => o.isCodeEditorOpen ? e("newsletter.close-html-editor") : e("newsletter.html-editor"));
|
|
12
|
+
return { __sfc: !0, editorStore: o, trans: e, openPreviewMode: t, closePreviewMode: r, previewTooltipText: n, codeEditorTooltipText: s, handlePreviewToggle: () => o.isPreviewModeOpen ? r() : t(), getTooltipOptions: w, InButtonV2: c, ViewOptions: a };
|
|
14
13
|
}
|
|
15
14
|
});
|
|
16
15
|
export {
|
|
17
|
-
|
|
16
|
+
h as default
|
|
18
17
|
};
|
|
@@ -1,77 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const C = "email_template", F = "chat", U = "guido:debug:ai", $ = () => {
|
|
1
|
+
import { useEmailTemplateApplier as w, resetEmailTemplateApplier as _ } from "./useEmailTemplateApplier.js";
|
|
2
|
+
import { useToaster as I } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as P } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as S } from "../enums/toaster.js";
|
|
5
|
+
import { getActivePinia as v } from "pinia";
|
|
6
|
+
import { watch as B, onUnmounted as D } from "vue";
|
|
7
|
+
const x = "email_template", L = "chat", M = "guido:debug:ai", R = () => {
|
|
9
8
|
if (typeof window > "u")
|
|
10
9
|
return !1;
|
|
11
10
|
try {
|
|
12
|
-
return window.localStorage.getItem(
|
|
11
|
+
return window.localStorage.getItem(M) === "1";
|
|
13
12
|
} catch {
|
|
14
13
|
return !1;
|
|
15
14
|
}
|
|
16
|
-
},
|
|
17
|
-
const c =
|
|
15
|
+
}, H = () => {
|
|
16
|
+
const c = v();
|
|
18
17
|
if (!c)
|
|
19
18
|
return;
|
|
20
|
-
const
|
|
19
|
+
const l = c._s, p = l == null ? void 0 : l.get(L);
|
|
21
20
|
if (!p)
|
|
22
21
|
return;
|
|
23
|
-
const { markPending:
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
if (
|
|
22
|
+
const { markPending: d, applyTemplate: f, applyTemplateDebounced: T } = w(), { showToaster: h } = I(), y = P(), A = (r, t) => {
|
|
23
|
+
const e = y(r);
|
|
24
|
+
return e === r ? t : e;
|
|
25
|
+
}, i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), u = R(), E = (r, t) => {
|
|
26
|
+
u && console.debug(`[guido:cortex] msg=${r ?? "?"} type=${(t == null ? void 0 : t.type) ?? "?"}`, t);
|
|
27
|
+
}, b = (r) => {
|
|
28
|
+
if (r.blueprintType !== x)
|
|
30
29
|
return;
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
30
|
+
const t = r.blueprintId, e = r.blueprintData;
|
|
31
|
+
if (!t || !(e != null && e.html))
|
|
33
32
|
return;
|
|
34
|
-
if (!
|
|
35
|
-
|
|
33
|
+
if (!r.applyRequested) {
|
|
34
|
+
d(t);
|
|
36
35
|
return;
|
|
37
36
|
}
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
}, s = (
|
|
41
|
-
type:
|
|
42
|
-
message:
|
|
43
|
-
}), !0),
|
|
37
|
+
const o = i.get(t);
|
|
38
|
+
o === void 0 ? (i.set(t, e.html), f(t, e)) : o !== e.html && (i.set(t, e.html), T(t, e));
|
|
39
|
+
}, s = (r) => r === void 0 || a.has(r) ? !1 : (a.add(r), h({
|
|
40
|
+
type: S.Alert,
|
|
41
|
+
message: A("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
|
|
42
|
+
}), !0), m = B(
|
|
44
43
|
() => p.messages,
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Array.isArray(T) && T.forEach((i) => {
|
|
54
|
-
if (i)
|
|
55
|
-
switch (S(l, i), i.type) {
|
|
44
|
+
(r) => {
|
|
45
|
+
Array.isArray(r) && r.forEach((t) => {
|
|
46
|
+
const e = t == null ? void 0 : t.id;
|
|
47
|
+
(t == null ? void 0 : t.isError) === !0 && s(e) && u && console.debug(`[guido:cortex] message-level error id=${e}`, t);
|
|
48
|
+
const o = t == null ? void 0 : t.segments;
|
|
49
|
+
Array.isArray(o) && o.forEach((n) => {
|
|
50
|
+
if (n)
|
|
51
|
+
switch (E(e, n), n.type) {
|
|
56
52
|
case "blueprint":
|
|
57
|
-
|
|
58
|
-
break;
|
|
59
|
-
case "tool":
|
|
60
|
-
!P && i.isRunning === !0 && (r = !0, o = i.name ?? "");
|
|
53
|
+
b(n);
|
|
61
54
|
break;
|
|
62
55
|
case "error":
|
|
63
|
-
s(
|
|
56
|
+
s(e);
|
|
64
57
|
break;
|
|
65
58
|
}
|
|
66
59
|
});
|
|
67
|
-
})
|
|
60
|
+
});
|
|
68
61
|
},
|
|
69
62
|
{ deep: !0, immediate: !0 }
|
|
70
63
|
);
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
D(() => {
|
|
65
|
+
m(), i.clear(), a.clear(), _();
|
|
73
66
|
});
|
|
74
67
|
};
|
|
75
68
|
export {
|
|
76
|
-
|
|
69
|
+
H as useCortexBlueprintBridge
|
|
77
70
|
};
|
|
@@ -4,7 +4,10 @@ const e = "Items", o = {
|
|
|
4
4
|
"Recommendation Block": "Recommendation",
|
|
5
5
|
Items: e,
|
|
6
6
|
"This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.",
|
|
7
|
-
"This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly."
|
|
7
|
+
"This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.",
|
|
8
|
+
"Pixel Tracking Opt-in": "Pixel Tracking Opt-in",
|
|
9
|
+
"OPT-IN SELECTION": "OPT-IN SELECTION",
|
|
10
|
+
"UNSUBSCRIBE GROUPS": "UNSUBSCRIBE GROUPS"
|
|
8
11
|
};
|
|
9
12
|
export {
|
|
10
13
|
e as Items,
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import { useTranslations as R } from "../composables/useTranslations.js";
|
|
2
|
-
import { ProductType as
|
|
2
|
+
import { ProductType as s } from "../@types/config/schemas.js";
|
|
3
3
|
import "../@types/config/defaults.js";
|
|
4
|
-
import { getEnvironmentPrefix as
|
|
5
|
-
const
|
|
4
|
+
import { getEnvironmentPrefix as _ } from "../utils/environmentUtil.js";
|
|
5
|
+
const B = {
|
|
6
6
|
UNSUBSCRIBE_LINK_TYPE: 1,
|
|
7
7
|
PREFERENCES_LINK_TYPE: 3
|
|
8
|
-
},
|
|
8
|
+
}, C = {
|
|
9
9
|
UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
|
|
10
10
|
DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
|
|
11
11
|
GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
|
|
12
12
|
PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
|
|
13
|
-
},
|
|
14
|
-
UNSUBSCRIBE_URL: `https://mail.${
|
|
15
|
-
PREFERENCES_URL: `https://mail.${
|
|
16
|
-
},
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
},
|
|
13
|
+
}, e = _(), U = {
|
|
14
|
+
UNSUBSCRIBE_URL: `https://mail.${e}.com/user/v1/unsub`,
|
|
15
|
+
PREFERENCES_URL: `https://mail.${e}.com/user/v1/prefs`
|
|
16
|
+
}, o = {
|
|
17
|
+
[s.EMAIL]: "email",
|
|
18
|
+
[s.ARCHITECT]: "journey",
|
|
19
|
+
[s.UNSUBSCRIBE_PAGES]: "email"
|
|
20
|
+
}, c = "iid", S = "G", N = "P", u = [
|
|
21
|
+
S,
|
|
22
|
+
N
|
|
23
|
+
], T = () => ({
|
|
21
24
|
name: R()("onboarding-center.email-subscribers-global-unsub-card-title"),
|
|
22
|
-
sendGridId:
|
|
23
|
-
}),
|
|
25
|
+
sendGridId: S
|
|
26
|
+
}), b = "/email/unsubscribe-pages", E = {
|
|
24
27
|
GLOBAL_UNSUBSCRIBE: 1,
|
|
25
28
|
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
|
|
26
29
|
SUBSCRIPTION_PREFERENCE_CENTER: 3,
|
|
27
30
|
SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
|
|
28
31
|
RESUBSCRIBE: 5
|
|
29
|
-
},
|
|
32
|
+
}, P = {
|
|
30
33
|
[E.GLOBAL_UNSUBSCRIBE]: "custom-unsubscribe",
|
|
31
34
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "custom-preferences"
|
|
32
|
-
},
|
|
35
|
+
}, L = {
|
|
33
36
|
[E.GLOBAL_UNSUBSCRIBE]: [
|
|
34
37
|
E.GLOBAL_UNSUBSCRIBE,
|
|
35
38
|
E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
|
|
@@ -39,32 +42,34 @@ const i = {
|
|
|
39
42
|
E.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
40
43
|
E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
|
|
41
44
|
]
|
|
42
|
-
},
|
|
43
|
-
const
|
|
45
|
+
}, O = () => {
|
|
46
|
+
const n = R();
|
|
44
47
|
return {
|
|
45
|
-
[E.GLOBAL_UNSUBSCRIBE]:
|
|
46
|
-
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]:
|
|
47
|
-
[E.RESUBSCRIBE]:
|
|
48
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]:
|
|
49
|
-
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]:
|
|
48
|
+
[E.GLOBAL_UNSUBSCRIBE]: n("unsubscription-preference.type-global-unsubscribe"),
|
|
49
|
+
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: n("unsubscription-preference.type-global-unsubscription-confirmation"),
|
|
50
|
+
[E.RESUBSCRIBE]: n("unsubscription-preference.type-resubscribe"),
|
|
51
|
+
[E.SUBSCRIPTION_PREFERENCE_CENTER]: n("unsubscription-preference.type-subscription-preferences-center"),
|
|
52
|
+
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: n("unsubscription-preference.type-subscription-preferences-confirmation")
|
|
50
53
|
};
|
|
51
|
-
},
|
|
54
|
+
}, p = {
|
|
52
55
|
default: "{{ins-unsubscribe-link}}",
|
|
53
56
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
54
57
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
55
58
|
};
|
|
56
59
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
S as DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID,
|
|
61
|
+
c as INSIDER_ID,
|
|
62
|
+
C as LINK_REGEXES,
|
|
63
|
+
B as LINK_TYPES,
|
|
64
|
+
p as MERGE_TAGS,
|
|
62
65
|
E as PAGE_TYPES,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
b as
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
N as PIXEL_TRACKING_SEND_GRID_ID,
|
|
67
|
+
o as PRODUCT_TYPE_URL_SEGMENTS,
|
|
68
|
+
L as TYPE_COLLECTIONS,
|
|
69
|
+
b as UNSUBSCRIBE_PAGES_LINK,
|
|
70
|
+
u as UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS,
|
|
71
|
+
P as UNSUBSCRIBE_SYNC_MODULE_TYPES,
|
|
72
|
+
U as URLS,
|
|
73
|
+
T as getDefaultUnsubscribeGroup,
|
|
74
|
+
O as getTypeTranslations
|
|
70
75
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Block as e, BlockCompositionType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { getDefaultTemplate as o } from "./template.js";
|
|
3
3
|
const r = "checkbox-block";
|
|
4
|
-
class
|
|
4
|
+
class l extends e {
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
}
|
|
@@ -18,7 +18,9 @@ class s extends e {
|
|
|
18
18
|
return this.api.translate("Checkbox Block");
|
|
19
19
|
}
|
|
20
20
|
getDescription() {
|
|
21
|
-
return this.api.translate(
|
|
21
|
+
return this.api.translate(
|
|
22
|
+
"Checkbox lets you select Unsubscribe and Preference Type for users to manage their opt-in or opt-out preferences."
|
|
23
|
+
);
|
|
22
24
|
}
|
|
23
25
|
getTemplate() {
|
|
24
26
|
return o();
|
|
@@ -29,5 +31,5 @@ class s extends e {
|
|
|
29
31
|
}
|
|
30
32
|
export {
|
|
31
33
|
r as CHECKBOX_BLOCK_ID,
|
|
32
|
-
|
|
34
|
+
l as CheckboxBlock
|
|
33
35
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import { getDefaultUnsubscribeGroup as
|
|
6
|
-
import { Control as
|
|
7
|
-
const b = "ui-elements-checkbox",
|
|
8
|
-
class
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var L = (i, n, e) => n in i ? p(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
|
+
var a = (i, n, e) => L(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { useHttp as h } from "../../../composables/useHttp.js";
|
|
5
|
+
import { getDefaultUnsubscribeGroup as T, PIXEL_TRACKING_SEND_GRID_ID as C, UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS as I } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as m, UIElementType as r, UEAttr as t, ModificationDescription as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const b = "ui-elements-checkbox", E = "select", { get: _ } = h();
|
|
8
|
+
class G extends m {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
a(this, "currentNode");
|
|
12
|
+
a(this, "selectedUnsubGroup");
|
|
13
|
+
a(this, "unsubList", []);
|
|
14
14
|
}
|
|
15
15
|
getId() {
|
|
16
16
|
return b;
|
|
@@ -19,12 +19,12 @@ class I extends p {
|
|
|
19
19
|
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
20
|
const e = this.currentNode.getAttribute("id");
|
|
21
21
|
if (e) {
|
|
22
|
-
const s = e
|
|
22
|
+
const s = I.includes(e) ? e : Number(e);
|
|
23
23
|
s && (this.selectedUnsubGroup = s);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
this.api.updateValues({
|
|
27
|
-
[
|
|
27
|
+
[E]: this.selectedUnsubGroup
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
_getLabel(e, s = `${Math.random()}`) {
|
|
@@ -46,17 +46,19 @@ class I extends p {
|
|
|
46
46
|
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
47
47
|
}
|
|
48
48
|
getTemplate() {
|
|
49
|
+
const e = this.api.translate("Unsubscribe & Preference Center Type"), s = this.api.translate("Select Unsubscribe and Preference Type");
|
|
49
50
|
return `
|
|
50
51
|
<div class="checkbox-controls-container">
|
|
51
52
|
<div class="checkbox-select-container container two-columns stretch">
|
|
52
53
|
<${r.LABEL}
|
|
53
|
-
${t.LABEL.text}="${
|
|
54
|
+
${t.LABEL.text}="${e}"
|
|
54
55
|
${t.LABEL.name}="${Math.random()}">
|
|
55
56
|
</${r.LABEL}>
|
|
56
57
|
|
|
57
58
|
<${r.SELECTPICKER}
|
|
58
|
-
${t.SELECTPICKER.name}="${
|
|
59
|
-
${t.SELECTPICKER.
|
|
59
|
+
${t.SELECTPICKER.name}="${E}"
|
|
60
|
+
${t.SELECTPICKER.searchable}="true"
|
|
61
|
+
${t.SELECTPICKER.placeholder}="${s}">
|
|
60
62
|
${this._getSelect()}
|
|
61
63
|
</${r.SELECTPICKER}>
|
|
62
64
|
</div>
|
|
@@ -64,30 +66,42 @@ class I extends p {
|
|
|
64
66
|
`;
|
|
65
67
|
}
|
|
66
68
|
_onSelectChange(e) {
|
|
67
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new
|
|
69
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new S(`Updated text to ${e}`));
|
|
68
70
|
}
|
|
69
71
|
_listenToFormUpdates() {
|
|
70
|
-
this.api.onValueChanged(
|
|
72
|
+
this.api.onValueChanged(E, (e) => this._onSelectChange(e));
|
|
71
73
|
}
|
|
72
74
|
onTemplateNodeUpdated(e) {
|
|
73
75
|
this.currentNode = e, this._setFormValues();
|
|
74
76
|
}
|
|
75
77
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
76
78
|
async onRender() {
|
|
77
|
-
const e = await
|
|
79
|
+
const e = await _(
|
|
78
80
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}))
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
), s = {
|
|
82
|
+
name: this.api.translate("Pixel Tracking Opt-in"),
|
|
83
|
+
sendGridId: C
|
|
84
|
+
}, c = [T(), ...e.data], u = (o) => ({
|
|
85
|
+
[t.SELECT_ITEM.text]: o.name,
|
|
86
|
+
[t.SELECT_ITEM.value]: o.sendGridId
|
|
87
|
+
}), l = (o) => ({
|
|
88
|
+
[t.SELECT_ITEM.text]: o,
|
|
89
|
+
[t.SELECT_ITEM.value]: `header:${o}`,
|
|
90
|
+
[t.SELECT_ITEM.disabled]: !0
|
|
91
|
+
}), d = [
|
|
92
|
+
l(this.api.translate("OPT-IN SELECTION")),
|
|
93
|
+
u(s),
|
|
94
|
+
l(this.api.translate("UNSUBSCRIBE GROUPS")),
|
|
95
|
+
...c.map(u)
|
|
96
|
+
];
|
|
97
|
+
this.unsubList = [s, ...c], this.api.setUIEAttribute(
|
|
98
|
+
E,
|
|
85
99
|
t.SELECTPICKER.items,
|
|
86
|
-
|
|
100
|
+
d
|
|
87
101
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
102
|
}
|
|
89
103
|
}
|
|
90
104
|
export {
|
|
91
105
|
b as CHECKBOX_CONTROL_BLOCK_ID,
|
|
92
|
-
|
|
106
|
+
G as CheckboxControl
|
|
93
107
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Block as t, BlockCompositionType as
|
|
2
|
-
import { getDefaultTemplate as
|
|
1
|
+
import { Block as t, BlockCompositionType as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { getDefaultTemplate as o } from "./template.js";
|
|
3
3
|
const r = "radio-button-block";
|
|
4
|
-
class
|
|
4
|
+
class i extends t {
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
}
|
|
@@ -12,16 +12,18 @@ class l extends t {
|
|
|
12
12
|
return "radio-button-icon";
|
|
13
13
|
}
|
|
14
14
|
getBlockCompositionType() {
|
|
15
|
-
return
|
|
15
|
+
return e.CONTAINER;
|
|
16
16
|
}
|
|
17
17
|
getName() {
|
|
18
18
|
return this.api.translate("Radio Button Block");
|
|
19
19
|
}
|
|
20
20
|
getDescription() {
|
|
21
|
-
return this.api.translate(
|
|
21
|
+
return this.api.translate(
|
|
22
|
+
"Radio button lets you select Unsubscribe and Preference Type for users to manage their opt-in or opt-out preferences."
|
|
23
|
+
);
|
|
22
24
|
}
|
|
23
25
|
getTemplate() {
|
|
24
|
-
return
|
|
26
|
+
return o();
|
|
25
27
|
}
|
|
26
28
|
allowInnerBlocksDND() {
|
|
27
29
|
return !1;
|
|
@@ -29,5 +31,5 @@ class l extends t {
|
|
|
29
31
|
}
|
|
30
32
|
export {
|
|
31
33
|
r as BLOCK_ID,
|
|
32
|
-
|
|
34
|
+
i as RadioButtonCustomBlock
|
|
33
35
|
};
|
|
@@ -1,93 +1,107 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import { getDefaultUnsubscribeGroup as
|
|
6
|
-
import { Control as
|
|
7
|
-
const b = "ui-elements-radio-button",
|
|
8
|
-
class
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var L = (i, n, e) => n in i ? p(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
|
+
var a = (i, n, e) => L(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { useHttp as T } from "../../../composables/useHttp.js";
|
|
5
|
+
import { getDefaultUnsubscribeGroup as h, PIXEL_TRACKING_SEND_GRID_ID as I, UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS as m } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as C, UIElementType as r, UEAttr as t, ModificationDescription as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const b = "ui-elements-radio-button", E = "select", { get: _ } = T();
|
|
8
|
+
class G extends C {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
a(this, "currentNode");
|
|
12
|
+
a(this, "selectedUnsubGroup");
|
|
13
|
+
a(this, "unsubList", []);
|
|
14
14
|
}
|
|
15
15
|
getId() {
|
|
16
16
|
return b;
|
|
17
17
|
}
|
|
18
18
|
_setFormValues() {
|
|
19
19
|
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const s =
|
|
20
|
+
const e = this.currentNode.getAttribute("id");
|
|
21
|
+
if (e) {
|
|
22
|
+
const s = m.includes(e) ? e : Number(e);
|
|
23
23
|
s && (this.selectedUnsubGroup = s);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
this.api.updateValues({
|
|
27
|
-
[
|
|
27
|
+
[E]: this.selectedUnsubGroup
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
_getLabel(
|
|
30
|
+
_getLabel(e, s = `${Math.random()}`) {
|
|
31
31
|
return `
|
|
32
|
-
<${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
</${
|
|
32
|
+
<${r.LABEL}
|
|
33
|
+
${t.LABEL.text}="${e}"
|
|
34
|
+
${t.LABEL.name}="${s}">
|
|
35
|
+
</${r.LABEL}>
|
|
36
36
|
`;
|
|
37
37
|
}
|
|
38
|
-
_getSelectItem(
|
|
38
|
+
_getSelectItem(e, s) {
|
|
39
39
|
return `
|
|
40
|
-
<${
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
</${
|
|
40
|
+
<${r.SELECT_ITEM}
|
|
41
|
+
${t.SELECT_ITEM.text}="${e}"
|
|
42
|
+
${t.SELECT_ITEM.value}="${s}">
|
|
43
|
+
</${r.SELECT_ITEM}>`;
|
|
44
44
|
}
|
|
45
45
|
_getSelect() {
|
|
46
|
-
return this.unsubList.map((
|
|
46
|
+
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
47
47
|
}
|
|
48
48
|
getTemplate() {
|
|
49
|
+
const e = this.api.translate("Unsubscribe & Preference Center Type"), s = this.api.translate("Select Unsubscribe and Preference Type");
|
|
49
50
|
return `
|
|
50
51
|
<div class="checkbox-controls-container">
|
|
51
52
|
<div class="checkbox-select-container container two-columns stretch">
|
|
52
|
-
<${
|
|
53
|
-
${
|
|
54
|
-
${
|
|
55
|
-
</${
|
|
53
|
+
<${r.LABEL}
|
|
54
|
+
${t.LABEL.text}="${e}"
|
|
55
|
+
${t.LABEL.name}="${Math.random()}">
|
|
56
|
+
</${r.LABEL}>
|
|
56
57
|
|
|
57
|
-
<${
|
|
58
|
-
${
|
|
59
|
-
${
|
|
58
|
+
<${r.SELECTPICKER}
|
|
59
|
+
${t.SELECTPICKER.name}="${E}"
|
|
60
|
+
${t.SELECTPICKER.searchable}="true"
|
|
61
|
+
${t.SELECTPICKER.placeholder}="${s}">
|
|
60
62
|
${this._getSelect()}
|
|
61
|
-
</${
|
|
63
|
+
</${r.SELECTPICKER}>
|
|
62
64
|
</div>
|
|
63
65
|
</div>
|
|
64
66
|
`;
|
|
65
67
|
}
|
|
66
|
-
_onSelectChange(
|
|
67
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id",
|
|
68
|
+
_onSelectChange(e) {
|
|
69
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new S(`Updated text to ${e}`));
|
|
68
70
|
}
|
|
69
71
|
_listenToFormUpdates() {
|
|
70
|
-
this.api.onValueChanged(
|
|
72
|
+
this.api.onValueChanged(E, (e) => this._onSelectChange(e));
|
|
71
73
|
}
|
|
72
|
-
onTemplateNodeUpdated(
|
|
73
|
-
this.currentNode =
|
|
74
|
+
onTemplateNodeUpdated(e) {
|
|
75
|
+
this.currentNode = e, this._setFormValues();
|
|
74
76
|
}
|
|
75
77
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
76
78
|
async onRender() {
|
|
77
|
-
const
|
|
79
|
+
const e = await _(
|
|
78
80
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}))
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
), s = {
|
|
82
|
+
name: this.api.translate("Pixel Tracking Opt-in"),
|
|
83
|
+
sendGridId: I
|
|
84
|
+
}, u = [h(), ...e.data], c = (o) => ({
|
|
85
|
+
[t.SELECT_ITEM.text]: o.name,
|
|
86
|
+
[t.SELECT_ITEM.value]: o.sendGridId
|
|
87
|
+
}), d = (o) => ({
|
|
88
|
+
[t.SELECT_ITEM.text]: o,
|
|
89
|
+
[t.SELECT_ITEM.value]: `header:${o}`,
|
|
90
|
+
[t.SELECT_ITEM.disabled]: !0
|
|
91
|
+
}), l = [
|
|
92
|
+
d(this.api.translate("OPT-IN SELECTION")),
|
|
93
|
+
c(s),
|
|
94
|
+
d(this.api.translate("UNSUBSCRIBE GROUPS")),
|
|
95
|
+
...u.map(c)
|
|
96
|
+
];
|
|
97
|
+
this.unsubList = [s, ...u], this.api.setUIEAttribute(
|
|
98
|
+
E,
|
|
99
|
+
t.SELECTPICKER.items,
|
|
100
|
+
l
|
|
87
101
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
102
|
}
|
|
89
103
|
}
|
|
90
104
|
export {
|
|
91
105
|
b as CONTROL_BLOCK_ID,
|
|
92
|
-
|
|
106
|
+
G as RadioButtonControl
|
|
93
107
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.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}.
|
|
1
|
+
.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-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.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-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-669fe7cf]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-669fe7cf]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-669fe7cf]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-669fe7cf]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-669fe7cf]{object-fit:cover;transform:scale(1)}[data-v-7a305bb2] .guido__verion-history-view-option-selection-desktop svg,[data-v-7a305bb2] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-7a305bb2] .in-segments-wrapper__button_selected,[data-v-7a305bb2] .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-06afaecb]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-06afaecb]{min-height:504px}.iframe-wrapper[data-v-cbafc185]{width:258px}.iframe-scaled[data-v-cbafc185]{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-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -19,6 +19,8 @@ export declare const PRODUCT_TYPE_URL_SEGMENTS: {
|
|
|
19
19
|
};
|
|
20
20
|
export declare const INSIDER_ID = "iid";
|
|
21
21
|
export declare const DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID = "G";
|
|
22
|
+
export declare const PIXEL_TRACKING_SEND_GRID_ID = "P";
|
|
23
|
+
export declare const UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS: string[];
|
|
22
24
|
/**
|
|
23
25
|
* Get the default unsubscribe group lazily so the translated name resolves at access time.
|
|
24
26
|
* Must be called within a Vue component context or after Pinia is initialized.
|
|
@@ -39,6 +39,18 @@ ue-dropdown .service-element.padding-t-3 {
|
|
|
39
39
|
color: var(--guido-color-primary-500);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
/*
|
|
43
|
+
* SD-145233: the pixel-tracking preference dropdown has no native option groups,
|
|
44
|
+
* so its section titles are rendered as disabled items. Present them as
|
|
45
|
+
* non-interactive group headers instead of options: no hover/cursor affordance
|
|
46
|
+
* and a little extra vertical spacing.
|
|
47
|
+
*/
|
|
48
|
+
.dropdown__menu .dropdown__item.disabled {
|
|
49
|
+
padding-top: 14px;
|
|
50
|
+
padding-bottom: 8px;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
42
54
|
.menu {
|
|
43
55
|
padding: 8px 0px;
|
|
44
56
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.9.1-beta.
|
|
3
|
+
"version": "3.9.1-beta.bde1a34",
|
|
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,18 +0,0 @@
|
|
|
1
|
-
import e from "./AiStatusPill.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var l = function() {
|
|
5
|
-
var s = this, t = s._self._c, a = s._self._setupProxy;
|
|
6
|
-
return a.isGenerating ? t("span", { staticClass: "d-f a-i-c ml-2 f-s-1 ai-status-pill", attrs: { "data-testid": "ai-status-pill" } }, [t(a.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), t("span", { staticClass: "ml-1 t-c-53 ai-status-pill__label" }, [s._v(" " + s._s(a.label) + " ")])], 1) : s._e();
|
|
7
|
-
}, r = [], _ = /* @__PURE__ */ i(
|
|
8
|
-
e,
|
|
9
|
-
l,
|
|
10
|
-
r,
|
|
11
|
-
!1,
|
|
12
|
-
null,
|
|
13
|
-
"ee17b74e"
|
|
14
|
-
);
|
|
15
|
-
const f = _.exports;
|
|
16
|
-
export {
|
|
17
|
-
f as default
|
|
18
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { defineComponent as i, computed as a } from "vue";
|
|
2
|
-
import { useAiStatus as m } from "../../../composables/useAiStatus.js";
|
|
3
|
-
import { useTranslations as _ } from "../../../composables/useTranslations.js";
|
|
4
|
-
import { InLoading as u } from "@useinsider/design-system-vue";
|
|
5
|
-
const g = /* @__PURE__ */ i({
|
|
6
|
-
__name: "AiStatusPill",
|
|
7
|
-
setup(c) {
|
|
8
|
-
const t = "newsletter.ai-generating", n = "AI is generating…", { isGenerating: o } = m(), e = _(), r = a(() => {
|
|
9
|
-
const s = e(t);
|
|
10
|
-
return s === t ? n : s;
|
|
11
|
-
});
|
|
12
|
-
return { __sfc: !0, AI_GENERATING_KEY: t, AI_GENERATING_FALLBACK: n, isGenerating: o, trans: e, label: r, InLoading: u };
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
export {
|
|
16
|
-
g as default
|
|
17
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useAiStatusStore as i } from "../stores/guido-ai-status.js";
|
|
2
|
-
import { storeToRefs as o } from "pinia";
|
|
3
|
-
const G = () => {
|
|
4
|
-
const t = i(), { isGenerating: n, activeTool: r } = o(t);
|
|
5
|
-
return { isGenerating: n, activeTool: r, startGenerating: (e = "") => {
|
|
6
|
-
t.isGenerating && t.activeTool === e || t.$patch({ isGenerating: !0, activeTool: e });
|
|
7
|
-
}, stopGenerating: () => {
|
|
8
|
-
!t.isGenerating && t.activeTool === "" || t.$patch({ isGenerating: !1, activeTool: "" });
|
|
9
|
-
} };
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
G as useAiStatus
|
|
13
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Thin accessor over the guidoAiStatus store: the bridge calls the mutators,
|
|
3
|
-
* AiStatusPill reads the refs. Mutations are idempotent so the bridge's deep
|
|
4
|
-
* watcher re-firing per stream chunk doesn't thrash the store.
|
|
5
|
-
*/
|
|
6
|
-
export declare const useAiStatus: () => {
|
|
7
|
-
isGenerating: import("vue").Ref<boolean>;
|
|
8
|
-
activeTool: import("vue").Ref<string>;
|
|
9
|
-
startGenerating: (tool?: string) => void;
|
|
10
|
-
stopGenerating: () => void;
|
|
11
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI status-pill state — set by useCortexBlueprintBridge while a qmechanics
|
|
3
|
-
* tool runs, cleared on done/error. State-only; useAiStatus mutates via $patch.
|
|
4
|
-
*/
|
|
5
|
-
export declare const useAiStatusStore: import("pinia").StoreDefinition<"guidoAiStatus", {
|
|
6
|
-
/** True while at least one agent tool is actively running. */
|
|
7
|
-
isGenerating: boolean;
|
|
8
|
-
/** Name/slug of the running tool, '' when idle. */
|
|
9
|
-
activeTool: string;
|
|
10
|
-
}, {}, {}>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineStore as t } from "pinia";
|
|
2
|
-
const o = t("guidoAiStatus", {
|
|
3
|
-
state: () => ({
|
|
4
|
-
/** True while at least one agent tool is actively running. */
|
|
5
|
-
isGenerating: !1,
|
|
6
|
-
/** Name/slug of the running tool, '' when idle. */
|
|
7
|
-
activeTool: ""
|
|
8
|
-
})
|
|
9
|
-
});
|
|
10
|
-
export {
|
|
11
|
-
o as useAiStatusStore
|
|
12
|
-
};
|