@useinsider/guido 3.9.1-beta.734031d → 3.9.1-beta.8a96896
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/AiStatusPill.vue.js +18 -0
- package/dist/components/organisms/header/AiStatusPill.vue2.js +17 -0
- package/dist/components/organisms/header/EditorToolbar.vue.js +2 -2
- package/dist/components/organisms/header/EditorToolbar.vue2.js +7 -6
- package/dist/composables/useAiStatus.js +13 -0
- package/dist/composables/useCortexBlueprintBridge.js +49 -42
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +106 -119
- package/dist/enums/defaults.js +7 -4
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +75 -69
- package/dist/guido.css +1 -1
- package/dist/services/blankTemplate.js +34 -0
- package/dist/services/stripoApi.js +13 -18
- package/dist/src/components/organisms/header/AiStatusPill.vue.d.ts +2 -0
- package/dist/src/composables/useAiStatus.d.ts +11 -0
- package/dist/src/enums/defaults.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +6 -0
- package/dist/src/services/blankTemplate.d.ts +11 -0
- package/dist/src/stores/guido-ai-status.d.ts +10 -0
- package/dist/stores/guido-ai-status.js +12 -0
- package/package.json +1 -5
- package/dist/static/templates/empty/index.html.js +0 -74
- package/dist/static/templates/empty/style.css.js +0 -779
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RecommendationBlockId as c } from "../constants/blockIds.js";
|
|
2
|
-
import { DESKTOP_CONTAINER_SELECTOR as S, ATTR_PRODUCT_NAME as
|
|
2
|
+
import { DESKTOP_CONTAINER_SELECTOR as S, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_PRICE as p, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_BUTTON as P, ATTR_PRODUCT_IMAGE as q, ATTR_PRODUCT_ATTR as x } from "../constants/selectors.js";
|
|
3
3
|
import { CSS_CLASS_TEXT_TRIM as B } from "../controls/shared/textTrimCssRules.js";
|
|
4
|
-
import { toCustomCompositionKey as
|
|
5
|
-
import { extractWrapperTags as
|
|
6
|
-
import { hasQuerySelectorAll as
|
|
4
|
+
import { toCustomCompositionKey as v } from "../templates/utils.js";
|
|
5
|
+
import { extractWrapperTags as R } from "./preserveTextStyles.js";
|
|
6
|
+
import { hasQuerySelectorAll as _, hasGetAttribute as l, hasGetStyle as I, hasGetComputedStyle as U } from "./tagName.js";
|
|
7
7
|
const s = [
|
|
8
8
|
"font-size",
|
|
9
9
|
"font-family",
|
|
@@ -39,94 +39,94 @@ const s = [
|
|
|
39
39
|
"border-radius",
|
|
40
40
|
"margin"
|
|
41
41
|
], b = /* @__PURE__ */ new Set(["transparent", "rgba(0, 0, 0, 0)"]), G = [
|
|
42
|
-
{ attrKey:
|
|
43
|
-
{ attrKey:
|
|
44
|
-
{ attrKey:
|
|
45
|
-
{ attrKey:
|
|
46
|
-
{ attrKey:
|
|
42
|
+
{ attrKey: E, blockId: c.NAME, kind: "text" },
|
|
43
|
+
{ attrKey: p, blockId: c.PRICE, kind: "text" },
|
|
44
|
+
{ attrKey: y, blockId: c.OLD_PRICE, kind: "text" },
|
|
45
|
+
{ attrKey: C, blockId: c.OMNIBUS_PRICE, kind: "text" },
|
|
46
|
+
{ attrKey: A, blockId: c.OMNIBUS_DISCOUNT, kind: "text" },
|
|
47
47
|
{ attrKey: P, blockId: c.BUTTON, kind: "button" },
|
|
48
|
-
{ attrKey:
|
|
48
|
+
{ attrKey: q, blockId: c.IMAGE, kind: "image" }
|
|
49
49
|
];
|
|
50
|
-
function
|
|
50
|
+
function O(t) {
|
|
51
51
|
return t && "getInnerHTML" in t && typeof t.getInnerHTML == "function" ? t.getInnerHTML().trim() : "";
|
|
52
52
|
}
|
|
53
53
|
function L(t) {
|
|
54
54
|
return t && "getInnerText" in t && typeof t.getInnerText == "function" ? t.getInnerText().trim() : "";
|
|
55
55
|
}
|
|
56
56
|
function a(t, e, r) {
|
|
57
|
-
!e || !
|
|
58
|
-
const
|
|
59
|
-
|
|
57
|
+
!e || !I(e) || r.forEach((n) => {
|
|
58
|
+
const o = e.getStyle(n);
|
|
59
|
+
o && o !== "inherit" && o !== "initial" && (t[n] = o);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function h(t) {
|
|
63
63
|
return Object.entries(t).map(([e, r]) => `${e}: ${r};`).join(" ");
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
if (!t || !
|
|
65
|
+
function k(t) {
|
|
66
|
+
if (!t || !I(t))
|
|
67
67
|
return;
|
|
68
68
|
const e = t.getStyle("background-color") || t.getStyle("background");
|
|
69
69
|
return e && !b.has(e) ? e : void 0;
|
|
70
70
|
}
|
|
71
71
|
function g(t, e) {
|
|
72
72
|
const r = {};
|
|
73
|
-
return a(r, t, e),
|
|
73
|
+
return a(r, t, e), h(r);
|
|
74
74
|
}
|
|
75
75
|
function w(t) {
|
|
76
76
|
const e = t.querySelector("p"), r = {};
|
|
77
77
|
a(r, t, s), a(r, e, s), a(r, t.querySelector("strong"), s), a(r, t.querySelector("em"), s), a(r, t.querySelector("s"), s);
|
|
78
|
-
const n =
|
|
79
|
-
return !n && !
|
|
78
|
+
const n = h(r), { openTags: o, closeTags: i } = R(O(e));
|
|
79
|
+
return !n && !o ? null : { pStyle: n || void 0, openTags: o, closeTags: i };
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const e = t.querySelector(".es-button-border"), r = t.querySelector("a.es-button") ?? t.querySelector("a"), n = g(e, N),
|
|
83
|
-
return !n && !
|
|
81
|
+
function $(t) {
|
|
82
|
+
const e = t.querySelector(".es-button-border"), r = t.querySelector("a.es-button") ?? t.querySelector("a"), n = g(e, N), o = g(r, M), i = e && "getAttribute" in e ? e.getAttribute("class") ?? "" : "", u = /\bes-fw\b/.test(i), { openTags: T, closeTags: d } = R(O(r)), m = L(r);
|
|
83
|
+
return !n && !o && !u && !T && !m ? null : {
|
|
84
84
|
buttonBorderStyle: n || void 0,
|
|
85
|
-
buttonAnchorStyle:
|
|
85
|
+
buttonAnchorStyle: o || void 0,
|
|
86
86
|
buttonFitToContainer: u || void 0,
|
|
87
|
-
buttonText:
|
|
87
|
+
buttonText: m || void 0,
|
|
88
88
|
openTags: T,
|
|
89
89
|
closeTags: d
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function K(t) {
|
|
93
93
|
const e = g(t.querySelector("img"), D);
|
|
94
94
|
return e ? { imgStyle: e } : null;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
return e === "button" ?
|
|
96
|
+
function H(t, e) {
|
|
97
|
+
return e === "button" ? $(t) : e === "image" ? K(t) : w(t);
|
|
98
98
|
}
|
|
99
99
|
function f(t, e) {
|
|
100
100
|
if (!t || !("querySelector" in t))
|
|
101
101
|
return;
|
|
102
102
|
const r = t.querySelector(S) ?? t;
|
|
103
|
-
if (G.forEach(({ attrKey:
|
|
103
|
+
if (G.forEach(({ attrKey: i, blockId: u, kind: T }) => {
|
|
104
104
|
const d = r.querySelector(`[esd-extension-block-id="${u}"]`);
|
|
105
|
-
d && e(d,
|
|
106
|
-
}), !
|
|
105
|
+
d && e(d, i, T);
|
|
106
|
+
}), !_(r))
|
|
107
107
|
return;
|
|
108
108
|
const n = /* @__PURE__ */ new Set();
|
|
109
109
|
r.querySelectorAll(
|
|
110
110
|
`[esd-extension-block-id="${c.CUSTOM_ATTRIBUTE}"]`
|
|
111
|
-
).forEach((
|
|
112
|
-
const u = l(
|
|
113
|
-
!u || n.has(u) || (n.add(u), e(
|
|
111
|
+
).forEach((i) => {
|
|
112
|
+
const u = l(i) ? i.getAttribute(x) : null;
|
|
113
|
+
!u || n.has(u) || (n.add(u), e(i, v(u), "text"));
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
function F(t) {
|
|
117
117
|
const e = {};
|
|
118
|
-
return f(t, (r, n,
|
|
118
|
+
return f(t, (r, n, o) => {
|
|
119
119
|
if (!("querySelector" in r))
|
|
120
120
|
return;
|
|
121
|
-
const
|
|
122
|
-
|
|
121
|
+
const i = H(r, o);
|
|
122
|
+
i && (e[n] = i);
|
|
123
123
|
}), e;
|
|
124
124
|
}
|
|
125
125
|
function j(t) {
|
|
126
126
|
if (!t || !("querySelector" in t))
|
|
127
127
|
return;
|
|
128
128
|
const e = t.querySelector(S) ?? t, r = e.querySelector(".product-card-segment") ?? e.querySelector(".product-card-wrapper");
|
|
129
|
-
return
|
|
129
|
+
return k(r);
|
|
130
130
|
}
|
|
131
131
|
function X(t) {
|
|
132
132
|
if (!t)
|
|
@@ -134,28 +134,28 @@ function X(t) {
|
|
|
134
134
|
const e = l(t) ? t.getAttribute("bgcolor") : null;
|
|
135
135
|
if (e && !b.has(e))
|
|
136
136
|
return e;
|
|
137
|
-
const r =
|
|
137
|
+
const r = k(t);
|
|
138
138
|
if (r)
|
|
139
139
|
return r;
|
|
140
|
-
const n =
|
|
140
|
+
const n = U(t) ? t.getComputedStyle("background-color") : void 0;
|
|
141
141
|
return n && !b.has(n) ? n : void 0;
|
|
142
142
|
}
|
|
143
143
|
function z(t) {
|
|
144
144
|
const e = {};
|
|
145
|
-
return f(t, (r, n,
|
|
146
|
-
if (
|
|
145
|
+
return f(t, (r, n, o) => {
|
|
146
|
+
if (o !== "text")
|
|
147
147
|
return;
|
|
148
|
-
const
|
|
149
|
-
|
|
148
|
+
const i = X(r);
|
|
149
|
+
i && (e[n] = i);
|
|
150
150
|
}), e;
|
|
151
151
|
}
|
|
152
152
|
function Q(t) {
|
|
153
153
|
const e = {};
|
|
154
|
-
return f(t, (r, n,
|
|
155
|
-
if (
|
|
154
|
+
return f(t, (r, n, o) => {
|
|
155
|
+
if (o === "image")
|
|
156
156
|
return;
|
|
157
|
-
const
|
|
158
|
-
|
|
157
|
+
const i = l(r) ? r.getAttribute("align") : null;
|
|
158
|
+
i && (e[n] = i);
|
|
159
159
|
}), e;
|
|
160
160
|
}
|
|
161
161
|
const V = /^es-[pm]\d+[trbl]?$/;
|
|
@@ -167,44 +167,50 @@ function W(t) {
|
|
|
167
167
|
return r.length ? r.join(" ") : void 0;
|
|
168
168
|
}
|
|
169
169
|
function Y(t) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
if (!t || !("querySelector" in t))
|
|
171
|
+
return !1;
|
|
172
|
+
const e = t.querySelector(S) ?? t, r = (n) => !!(n && "querySelector" in n && n.querySelector(".product-price") && n.querySelector(".product-old-price"));
|
|
173
|
+
return r(e.querySelector(`[data-attribute-type="${p}"]`)) || r(e.querySelector(`[data-attribute-type="${y}"]`));
|
|
174
|
+
}
|
|
175
|
+
function J(t) {
|
|
176
|
+
const e = {}, r = Y(t);
|
|
177
|
+
return f(t, (n, o, i) => {
|
|
178
|
+
if (i === "image" || r && (o === p || o === y))
|
|
173
179
|
return;
|
|
174
|
-
const
|
|
175
|
-
|
|
180
|
+
const u = W(n);
|
|
181
|
+
u && (e[o] = u);
|
|
176
182
|
}), e;
|
|
177
183
|
}
|
|
178
|
-
function
|
|
184
|
+
function Z(t) {
|
|
179
185
|
const e = {};
|
|
180
186
|
return f(t, (r, n) => {
|
|
181
|
-
if (n !==
|
|
187
|
+
if (n !== C && n !== A || !l(r))
|
|
182
188
|
return;
|
|
183
|
-
const
|
|
184
|
-
(
|
|
189
|
+
const o = r.getAttribute("data-text-before"), i = r.getAttribute("data-text-after");
|
|
190
|
+
(o != null || i != null) && (e[n] = { before: o ?? void 0, after: i ?? void 0 });
|
|
185
191
|
}), e;
|
|
186
192
|
}
|
|
187
|
-
function
|
|
193
|
+
function tt(t) {
|
|
188
194
|
const e = {};
|
|
189
195
|
if (!t || !("querySelector" in t))
|
|
190
196
|
return e;
|
|
191
197
|
const r = t.querySelector(S) ?? t;
|
|
192
|
-
return
|
|
198
|
+
return _(r) && r.querySelectorAll(".recommendation-attribute-row").forEach((n) => {
|
|
193
199
|
if (!l(n))
|
|
194
200
|
return;
|
|
195
|
-
const
|
|
196
|
-
|
|
201
|
+
const o = n.getAttribute("data-attribute-type"), i = n.getAttribute("data-visibility");
|
|
202
|
+
o && i != null && (e[o] = i !== "0");
|
|
197
203
|
}), e;
|
|
198
204
|
}
|
|
199
|
-
function
|
|
205
|
+
function ct(t) {
|
|
200
206
|
return {
|
|
201
207
|
styleTemplates: F(t),
|
|
202
208
|
cardBackgroundColor: j(t),
|
|
203
209
|
cellBackgroundColors: z(t),
|
|
204
210
|
cellAlignments: Q(t),
|
|
205
|
-
cellClasses:
|
|
206
|
-
omnibusTexts:
|
|
207
|
-
visibility:
|
|
211
|
+
cellClasses: J(t),
|
|
212
|
+
omnibusTexts: Z(t),
|
|
213
|
+
visibility: tt(t)
|
|
208
214
|
};
|
|
209
215
|
}
|
|
210
216
|
export {
|
|
@@ -212,8 +218,8 @@ export {
|
|
|
212
218
|
j as captureCardBackgroundColor,
|
|
213
219
|
Q as captureCellAlignments,
|
|
214
220
|
z as captureCellBackgroundColors,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
221
|
+
J as captureCellClasses,
|
|
222
|
+
Z as captureOmnibusTexts,
|
|
223
|
+
ct as captureStyles,
|
|
224
|
+
tt as captureVisibility
|
|
219
225
|
};
|
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}.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-
|
|
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}.ai-status-pill[data-v-ee17b74e]{white-space:nowrap}.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-f2eb03d4]{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}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useToaster as m } from "../composables/useToaster.js";
|
|
2
|
+
import { useTranslations as c } from "../composables/useTranslations.js";
|
|
3
|
+
import { BLANK_TEMPLATE_HTML_URL as T, BLANK_TEMPLATE_CSS_URL as i } from "../enums/defaults.js";
|
|
4
|
+
import { ToasterTypeOptions as p } from "../enums/toaster.js";
|
|
5
|
+
const a = 3, f = 1e3;
|
|
6
|
+
let s = null;
|
|
7
|
+
const u = (e) => new Promise((t) => {
|
|
8
|
+
setTimeout(t, e);
|
|
9
|
+
}), n = async (e) => {
|
|
10
|
+
const t = await fetch(e);
|
|
11
|
+
if (!t.ok)
|
|
12
|
+
throw new Error(`Blank template request failed: ${t.status}`);
|
|
13
|
+
return t.text();
|
|
14
|
+
}, k = () => {
|
|
15
|
+
const { showToaster: e } = m(), t = c();
|
|
16
|
+
return { getBlankTemplate: async () => {
|
|
17
|
+
if (s)
|
|
18
|
+
return s;
|
|
19
|
+
for (let r = 1; r <= a; r++)
|
|
20
|
+
try {
|
|
21
|
+
const [o, l] = await Promise.all([
|
|
22
|
+
n(T),
|
|
23
|
+
n(i)
|
|
24
|
+
]);
|
|
25
|
+
return s = { html: o, css: l }, s;
|
|
26
|
+
} catch (o) {
|
|
27
|
+
console.error(`Failed to fetch blank template (attempt ${r}/${a}):`, o), r < a && await u(r * f);
|
|
28
|
+
}
|
|
29
|
+
return e({ type: p.Alert, message: t("errors-pages.undefined-response") }), { html: "", css: "" };
|
|
30
|
+
} };
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
k as useBlankTemplate
|
|
34
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useHttp as d } from "../composables/useHttp.js";
|
|
2
2
|
import { useToaster as m } from "../composables/useToaster.js";
|
|
3
3
|
import { MAX_DEFAULT_TEMPLATE_ID as y } from "../enums/defaults.js";
|
|
4
|
-
import f from "
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const { get: s, post: c } = d(), { handleError: r } = m();
|
|
4
|
+
import { useBlankTemplate as f } from "./blankTemplate.js";
|
|
5
|
+
const D = () => {
|
|
6
|
+
const { get: s, post: u } = d(), { handleError: r } = m(), { getBlankTemplate: o } = f();
|
|
8
7
|
return {
|
|
9
8
|
getToken: async () => {
|
|
10
9
|
try {
|
|
@@ -26,18 +25,14 @@ const E = () => {
|
|
|
26
25
|
}
|
|
27
26
|
},
|
|
28
27
|
getDefaultTemplate: async () => {
|
|
29
|
-
const t = {
|
|
30
|
-
html: f,
|
|
31
|
-
css: g
|
|
32
|
-
};
|
|
33
28
|
try {
|
|
34
|
-
const
|
|
35
|
-
if (!i && !
|
|
36
|
-
return
|
|
37
|
-
const
|
|
38
|
-
return !
|
|
39
|
-
} catch (
|
|
40
|
-
return r(
|
|
29
|
+
const t = new URLSearchParams(window.location.search), e = t.get("default-template"), l = t.get("master"), n = e ? parseInt(e) : 0, i = n >= 1 && n <= y ? n : 0;
|
|
30
|
+
if (!i && !l)
|
|
31
|
+
return await o();
|
|
32
|
+
const p = `/stripo/default-template/${i}`, { data: c } = await s(p), a = typeof c == "string" ? JSON.parse(c) : c;
|
|
33
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await o() : a;
|
|
34
|
+
} catch (t) {
|
|
35
|
+
return r(t, "Failed to fetch default template"), o();
|
|
41
36
|
}
|
|
42
37
|
},
|
|
43
38
|
getSyncModulesStatus: async () => {
|
|
@@ -50,7 +45,7 @@ const E = () => {
|
|
|
50
45
|
},
|
|
51
46
|
updateSyncModule: async (t) => {
|
|
52
47
|
try {
|
|
53
|
-
return await
|
|
48
|
+
return await u(`/stripo/stripo-modules/${t.moduleId}/update`), !0;
|
|
54
49
|
} catch (e) {
|
|
55
50
|
return r(e, "Failed to update sync module"), !1;
|
|
56
51
|
}
|
|
@@ -71,7 +66,7 @@ const E = () => {
|
|
|
71
66
|
if (t.length === 0)
|
|
72
67
|
return !0;
|
|
73
68
|
try {
|
|
74
|
-
return await
|
|
69
|
+
return await u("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
|
|
75
70
|
} catch (e) {
|
|
76
71
|
return r(e, "Failed to set unsubscription preference pages"), !1;
|
|
77
72
|
}
|
|
@@ -79,5 +74,5 @@ const E = () => {
|
|
|
79
74
|
};
|
|
80
75
|
};
|
|
81
76
|
export {
|
|
82
|
-
|
|
77
|
+
D as useStripoApi
|
|
83
78
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
};
|
|
@@ -8,6 +8,9 @@ export declare const TemplateTypes: {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const EditorType: number;
|
|
10
10
|
export declare const MAX_DEFAULT_TEMPLATE_ID = 13;
|
|
11
|
+
export declare const EMAIL_STATIC_BASE_URL = "https://email-static.useinsider.com";
|
|
12
|
+
export declare const BLANK_TEMPLATE_HTML_URL = "https://email-static.useinsider.com/templates/campaign/default.html";
|
|
13
|
+
export declare const BLANK_TEMPLATE_CSS_URL = "https://email-static.useinsider.com/templates/campaign/default.css";
|
|
11
14
|
export declare const ProductIds: Record<string, number>;
|
|
12
15
|
export declare const ModuleFolderDefaults: {
|
|
13
16
|
readonly SAVED_MODULES: "savedModules";
|
|
@@ -51,6 +51,12 @@ export declare function captureCellAlignments(node: ImmutableHtmlNode | null | u
|
|
|
51
51
|
* text-trim) keyed by composition key, so a regeneration can re-bake them
|
|
52
52
|
* instead of resetting to the renderer's hardcoded spacing classes. Stripo stores padding
|
|
53
53
|
* and margin as these classes (NOT inline style), so an inline-style capture misses them.
|
|
54
|
+
*
|
|
55
|
+
* Inline price mode: the merged columns carry POSITIONAL spacing classes
|
|
56
|
+
* (`es-p15l es-p5r` / `es-p5l es-p15r`) that build the side-by-side gap — layout
|
|
57
|
+
* mechanics, not user padding. Skip the price cells then, so toggling back to
|
|
58
|
+
* stacked resets them to the renderer defaults instead of baking the lopsided
|
|
59
|
+
* inline paddings (SD-145161).
|
|
54
60
|
*/
|
|
55
61
|
export declare function captureCellClasses(node: ImmutableHtmlNode | null | undefined): Record<string, string>;
|
|
56
62
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Template } from '@@/Types/stripo';
|
|
2
|
+
/**
|
|
3
|
+
* Fetches the blank starter template (html + css) from the email CDN — the single
|
|
4
|
+
* source of truth shared with email-fe. Retries a few times, caches the result for
|
|
5
|
+
* the session, and on persistent failure returns an empty template (the editor still
|
|
6
|
+
* opens) plus a toaster. Kept separate from stripoApi: this is a CDN asset fetch, not
|
|
7
|
+
* a Stripo backend call.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useBlankTemplate: () => {
|
|
10
|
+
getBlankTemplate: () => Promise<Template>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
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.8a96896",
|
|
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",
|
|
@@ -29,8 +29,6 @@
|
|
|
29
29
|
"test:visual-update": "npx playwright test --update-snapshots --reporter html",
|
|
30
30
|
"test:e2e:coverage": "E2E_COVERAGE=true playwright test",
|
|
31
31
|
"coverage:e2e:report": "nyc report --reporter=lcov --reporter=text-summary --report-dir=coverage/e2e",
|
|
32
|
-
"test:mutation": "stryker run",
|
|
33
|
-
"test:mutation:since": "stryker run --since=origin/develop --incremental",
|
|
34
32
|
"prepare": "husky",
|
|
35
33
|
"preinstall": "rm -rf ./node_modules/.vite"
|
|
36
34
|
},
|
|
@@ -54,8 +52,6 @@
|
|
|
54
52
|
"@eslint/eslintrc": "3.3.0",
|
|
55
53
|
"@eslint/js": "8.57.1",
|
|
56
54
|
"@playwright/test": "1.57.0",
|
|
57
|
-
"@stryker-mutator/core": "9.6.1",
|
|
58
|
-
"@stryker-mutator/vitest-runner": "9.6.1",
|
|
59
55
|
"@stylistic/eslint-plugin": "3.1.0",
|
|
60
56
|
"@stylistic/eslint-plugin-migrate": "3.1.0",
|
|
61
57
|
"@types/eslint": "8.56.12",
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const t = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
-
<html>
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta content="width=device-width, initial-scale=1" name="viewport">
|
|
7
|
-
<meta name="x-apple-disable-message-reformatting">
|
|
8
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
9
|
-
<meta content="telephone=no" name="format-detection">
|
|
10
|
-
<title></title>
|
|
11
|
-
<!--[if (mso 16)]><style type="text/css">a{text-decoration:none}</style><![endif]-->
|
|
12
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
13
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
14
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
15
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
16
|
-
<!--[if gte mso 9]><style>sup { font-size: 100% !important; }</style><![endif]-->
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class="es-wrapper-color">
|
|
21
|
-
<!--[if gte mso 9]>
|
|
22
|
-
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t">
|
|
23
|
-
<v:fill type="tile" color="#f6f6f6"></v:fill>
|
|
24
|
-
</v:background>
|
|
25
|
-
<![endif]-->
|
|
26
|
-
<table class="es-wrapper" width="100%" cellspacing="0" cellpadding="0">
|
|
27
|
-
<tbody>
|
|
28
|
-
<tr>
|
|
29
|
-
<td class="esd-email-paddings" valign="top">
|
|
30
|
-
<table class="es-content esd-footer-popover" cellspacing="0" cellpadding="0" align="center">
|
|
31
|
-
<tbody>
|
|
32
|
-
<tr>
|
|
33
|
-
<td class="esd-stripe" align="center">
|
|
34
|
-
<table class="es-content-body" width="600" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center">
|
|
35
|
-
<tbody>
|
|
36
|
-
<tr>
|
|
37
|
-
<td class="esd-structure es-p20" align="left">
|
|
38
|
-
<table cellpadding="0" cellspacing="0" width="100%">
|
|
39
|
-
<tbody>
|
|
40
|
-
<tr>
|
|
41
|
-
<td width="560" class="esd-container-frame" align="center" valign="top">
|
|
42
|
-
<table cellpadding="0" cellspacing="0" width="100%">
|
|
43
|
-
<tbody>
|
|
44
|
-
<tr>
|
|
45
|
-
<td align="center" class="esd-empty-container" style="display: none;"></td>
|
|
46
|
-
</tr>
|
|
47
|
-
</tbody>
|
|
48
|
-
</table>
|
|
49
|
-
</td>
|
|
50
|
-
</tr>
|
|
51
|
-
</tbody>
|
|
52
|
-
</table>
|
|
53
|
-
</td>
|
|
54
|
-
</tr>
|
|
55
|
-
</tbody>
|
|
56
|
-
</table>
|
|
57
|
-
</td>
|
|
58
|
-
</tr>
|
|
59
|
-
</tbody>
|
|
60
|
-
</table>
|
|
61
|
-
</td>
|
|
62
|
-
</tr>
|
|
63
|
-
</tbody>
|
|
64
|
-
</table>
|
|
65
|
-
</div>
|
|
66
|
-
<div style="position: absolute; left: -9999px; top: -9999px; margin: 0px;"></div>
|
|
67
|
-
<div style="position: absolute; left: -9999px; top: -9999px; margin: 0px; padding: 0px; border: 0px none; width: 1px;"></div>
|
|
68
|
-
</body>
|
|
69
|
-
|
|
70
|
-
</html>
|
|
71
|
-
`;
|
|
72
|
-
export {
|
|
73
|
-
t as default
|
|
74
|
-
};
|