@useinsider/guido 3.18.1-beta.9b8b7ac → 3.18.1-beta.c52722e
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/composables/usePreviewMode.js +8 -11
- package/dist/config/compiler/htmlCompilerRules.js +6 -14
- package/dist/src/mock/cortexChatStore.d.ts +12 -0
- package/dist/static/styles/customEditorStyle.css.js +0 -8
- package/package.json +1 -1
- package/dist/src/utils/preventMobileWordOverflow.d.ts +0 -12
- package/dist/utils/preventMobileWordOverflow.js +0 -15
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { useEditorStore as n } from "../stores/editor.js";
|
|
2
2
|
import { usePreviewStore as p } from "../stores/preview.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const t = n(), e = p(), { closeCodeEditor: a } = v(), { getPreviewData: m, getCompiledEmail: s } = u(), { compileHtml: l } = w(), { substituteRecommendationPreview: r } = f(), i = () => {
|
|
3
|
+
import { useActionsApi as c } from "./useActionsApi.js";
|
|
4
|
+
import { useCodeEditorApi as u } from "./useCodeEditorApi.js";
|
|
5
|
+
import { useHtmlCompiler as v } from "./useHtmlCompiler.js";
|
|
6
|
+
import { useRecommendationPreview as w } from "./useRecommendationPreview.js";
|
|
7
|
+
const C = () => {
|
|
8
|
+
const t = n(), e = p(), { closeCodeEditor: a } = u(), { getPreviewData: m, getCompiledEmail: s } = c(), { compileHtml: l } = v(), { substituteRecommendationPreview: r } = w(), i = () => {
|
|
10
9
|
t.isPreviewModeOpen = !1, e.$reset();
|
|
11
10
|
};
|
|
12
11
|
return {
|
|
@@ -22,9 +21,7 @@ const z = () => {
|
|
|
22
21
|
m(),
|
|
23
22
|
s({ minimize: !0, resetDataSavedFlag: !1 })
|
|
24
23
|
]);
|
|
25
|
-
e.templateHtml =
|
|
26
|
-
r(o.html || "")
|
|
27
|
-
), e.ampHtml = r(o.ampHtml || ""), e.ampErrors = o.ampErrors || [], e.setEmailFormat(o.ampHtml ? "AMP" : "html"), e.emailSizeKB = l(d.html).estimatedSizeKB, e.isLoaded = !0;
|
|
24
|
+
e.templateHtml = r(o.html || ""), e.ampHtml = r(o.ampHtml || ""), e.ampErrors = o.ampErrors || [], e.setEmailFormat(o.ampHtml ? "AMP" : "html"), e.emailSizeKB = l(d.html).estimatedSizeKB, e.isLoaded = !0;
|
|
28
25
|
} catch (o) {
|
|
29
26
|
console.error("Failed to load preview data:", o), i();
|
|
30
27
|
} finally {
|
|
@@ -35,5 +32,5 @@ const z = () => {
|
|
|
35
32
|
};
|
|
36
33
|
};
|
|
37
34
|
export {
|
|
38
|
-
|
|
35
|
+
C as usePreviewMode
|
|
39
36
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const f = [
|
|
1
|
+
import { stripFontTags as p } from "../../utils/stripFontTags.js";
|
|
2
|
+
const d = [
|
|
4
3
|
{
|
|
5
4
|
id: "fix-url-encoding-start",
|
|
6
5
|
description: "Replace {%22 with %7B%22 to fix URL encoding",
|
|
@@ -55,18 +54,11 @@ const f = [
|
|
|
55
54
|
replaceAll: !0,
|
|
56
55
|
priority: 14
|
|
57
56
|
},
|
|
58
|
-
{
|
|
59
|
-
id: "prevent-mobile-word-overflow",
|
|
60
|
-
description: "SD-151345: let long words break on mobile so non-responsive containers keep their own width.",
|
|
61
|
-
type: "custom",
|
|
62
|
-
processor: (e) => c(e),
|
|
63
|
-
priority: 15
|
|
64
|
-
},
|
|
65
57
|
{
|
|
66
58
|
id: "strip-font-tags",
|
|
67
59
|
description: 'Unwrap browser-translate-injected <font dir="auto"> tags, keeping inner content; other <font> elements are left intact.',
|
|
68
60
|
type: "custom",
|
|
69
|
-
processor: (e) =>
|
|
61
|
+
processor: (e) => p(e),
|
|
70
62
|
priority: 15
|
|
71
63
|
},
|
|
72
64
|
{
|
|
@@ -165,8 +157,8 @@ const f = [
|
|
|
165
157
|
processor: (e) => {
|
|
166
158
|
const t = (i) => i.toString(16).padStart(2, "0");
|
|
167
159
|
return e.replace(/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/gi, (i, o, n, r) => {
|
|
168
|
-
const [s, a,
|
|
169
|
-
return s > 255 || a > 255 ||
|
|
160
|
+
const [s, a, c] = [Number(o), Number(n), Number(r)];
|
|
161
|
+
return s > 255 || a > 255 || c > 255 ? i : `#${t(s)}${t(a)}${t(c)}`;
|
|
170
162
|
}).replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3\b/gi, "#$1$2$3");
|
|
171
163
|
},
|
|
172
164
|
priority: 44
|
|
@@ -208,5 +200,5 @@ const f = [
|
|
|
208
200
|
}
|
|
209
201
|
];
|
|
210
202
|
export {
|
|
211
|
-
|
|
203
|
+
d as defaultHtmlCompilerRules
|
|
212
204
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev-harness stand-in for the cortex-fe MFE's shared `chat` store.
|
|
3
|
+
*
|
|
4
|
+
* `useCortexBlueprintBridge` resolves that store by id off the host's pinia at
|
|
5
|
+
* Guido's setup time, so a store registered after mount is never seen. Installing
|
|
6
|
+
* it here — before `<Guido>` renders — lets e2e drive the bridge through its real
|
|
7
|
+
* registration path instead of re-invoking the composable by hand.
|
|
8
|
+
*
|
|
9
|
+
* Activated with `?chatStore=true`; the instance is exposed on `window` so a test
|
|
10
|
+
* can push agent messages into it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const installMockChatStore: () => void;
|
|
@@ -106,14 +106,6 @@ const n = `.esd-x,
|
|
|
106
106
|
.ue-mobile-mode .ins-recommendation-no-mobile-layout .ins-recommendation-mobile-container {
|
|
107
107
|
display: none !important;
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
/* SD-151345: mirror the compiled-email fix in the editor's mobile preview.
|
|
111
|
-
The editor simulates mobile with .ue-mobile-mode, not a viewport media query. */
|
|
112
|
-
.ue-mobile-mode .esd-block-text:not(.ins-coupon-code),
|
|
113
|
-
.ue-mobile-mode .esd-block-text:not(.ins-coupon-code) p {
|
|
114
|
-
word-break: break-word !important;
|
|
115
|
-
overflow-wrap: anywhere !important;
|
|
116
|
-
}
|
|
117
109
|
`;
|
|
118
110
|
export {
|
|
119
111
|
n as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.18.1-beta.
|
|
3
|
+
"version": "3.18.1-beta.c52722e",
|
|
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,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SD-151345 — long unbreakable words steal width from sibling containers on mobile.
|
|
3
|
-
*
|
|
4
|
-
* When a structure is not responsive its containers stay side by side on mobile.
|
|
5
|
-
* A word that cannot wrap forces its own cell wider than its share, and CSS table
|
|
6
|
-
* auto-layout takes that width from its siblings — so identical images render at
|
|
7
|
-
* different sizes and the long-word container spills past the mobile canvas.
|
|
8
|
-
* Letting the word break restores the intended per-container widths.
|
|
9
|
-
*
|
|
10
|
-
* Coupon codes are excluded: a promo code must stay readable as one token.
|
|
11
|
-
*/
|
|
12
|
-
export declare function preventMobileWordOverflow(html: string): string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const r = "ins-mobile-word-break", n = `<style type="text/css">/* ${r} */
|
|
2
|
-
@media only screen and (max-width:600px){
|
|
3
|
-
.esd-block-text:not(.ins-coupon-code),
|
|
4
|
-
.esd-block-text:not(.ins-coupon-code) p
|
|
5
|
-
{word-break:break-word !important;overflow-wrap:anywhere !important}
|
|
6
|
-
}</style>`, t = /<\/head\s*>/i;
|
|
7
|
-
function c(e) {
|
|
8
|
-
if (!e || e.includes(r))
|
|
9
|
-
return e;
|
|
10
|
-
const o = t.exec(e);
|
|
11
|
-
return o ? e.slice(0, o.index) + n + e.slice(o.index) : n + e;
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
c as preventMobileWordOverflow
|
|
15
|
-
};
|