@useinsider/guido 3.21.2-beta.1cc8327 → 3.21.2-beta.9538c35
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/useActionsApi.js +21 -22
- package/dist/composables/useFullStoryBridge.js +9 -10
- package/dist/config/migrator/index.js +10 -11
- package/package.json +2 -2
- package/dist/config/migrator/fullStoryScriptMigrator.js +0 -5
- package/dist/src/config/migrator/fullStoryScriptMigrator.d.ts +0 -1
- package/dist/src/utils/fullStoryScripts.d.ts +0 -6
- package/dist/utils/fullStoryScripts.js +0 -8
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { filterAmpErrors as
|
|
2
|
-
import {
|
|
3
|
-
import { getEditorApi as r } from "../utils/stripoEditorApi.js";
|
|
1
|
+
import { filterAmpErrors as y } from "../utils/ampErrorFilter.js";
|
|
2
|
+
import { getEditorApi as s } from "../utils/stripoEditorApi.js";
|
|
4
3
|
import { useToaster as D } from "./useToaster.js";
|
|
5
|
-
const
|
|
4
|
+
const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
|
|
6
5
|
const f = setTimeout(
|
|
7
6
|
() => p(new Error(`${n} did not report completion within ${l}ms`)),
|
|
8
7
|
l
|
|
@@ -14,8 +13,8 @@ const H = 1e4, T = 3e4, m = (n, l, A) => new Promise((C, p) => {
|
|
|
14
13
|
} catch (t) {
|
|
15
14
|
d(t);
|
|
16
15
|
}
|
|
17
|
-
}),
|
|
18
|
-
const { handleError: n } = D(), l = (t = {}) =>
|
|
16
|
+
}), P = () => {
|
|
17
|
+
const { handleError: n } = D(), l = (t = {}) => r(
|
|
19
18
|
"compileEmail",
|
|
20
19
|
T,
|
|
21
20
|
(e, i) => {
|
|
@@ -39,38 +38,38 @@ const H = 1e4, T = 3e4, m = (n, l, A) => new Promise((C, p) => {
|
|
|
39
38
|
resetDataSavedFlag: !1,
|
|
40
39
|
disableLineHeightsReplace: !0
|
|
41
40
|
}, ...t }, u = {
|
|
42
|
-
callback: (
|
|
43
|
-
|
|
41
|
+
callback: (m, g, w, S, v) => {
|
|
42
|
+
m ? i(m) : e({
|
|
44
43
|
html: g,
|
|
45
44
|
ampHtml: w,
|
|
46
|
-
ampErrors:
|
|
47
|
-
displayConditions:
|
|
45
|
+
ampErrors: y(S ?? []),
|
|
46
|
+
displayConditions: v
|
|
48
47
|
});
|
|
49
48
|
},
|
|
50
49
|
...o
|
|
51
50
|
};
|
|
52
|
-
|
|
51
|
+
s().actionsApi.compileEmail(u);
|
|
53
52
|
}
|
|
54
53
|
);
|
|
55
54
|
return {
|
|
56
55
|
getCompiledEmail: l,
|
|
57
|
-
getTemplateData: () =>
|
|
56
|
+
getTemplateData: () => r(
|
|
58
57
|
"getTemplateData",
|
|
59
58
|
T,
|
|
60
59
|
(t) => {
|
|
61
|
-
const e = ({ html: i, css: a, width: o, height: E, utmParams: u, syncModulesIds:
|
|
62
|
-
html:
|
|
60
|
+
const e = ({ html: i, css: a, width: o, height: E, utmParams: u, syncModulesIds: m }) => t({
|
|
61
|
+
html: i,
|
|
63
62
|
css: a,
|
|
64
63
|
width: o,
|
|
65
64
|
height: E,
|
|
66
65
|
utmParams: u,
|
|
67
|
-
syncModulesIds:
|
|
66
|
+
syncModulesIds: m
|
|
68
67
|
});
|
|
69
|
-
|
|
68
|
+
s().actionsApi.getTemplateData(e);
|
|
70
69
|
}
|
|
71
70
|
),
|
|
72
71
|
activateCustomViewStyles: (t = !0) => {
|
|
73
|
-
|
|
72
|
+
s().actionsApi.activateCustomViewStyles(t);
|
|
74
73
|
},
|
|
75
74
|
getPreviewData: async (t) => {
|
|
76
75
|
try {
|
|
@@ -110,16 +109,16 @@ const H = 1e4, T = 3e4, m = (n, l, A) => new Promise((C, p) => {
|
|
|
110
109
|
}
|
|
111
110
|
}),
|
|
112
111
|
updateHtmlAndCss: (t, e) => {
|
|
113
|
-
const { actionsApi: i } =
|
|
114
|
-
return
|
|
112
|
+
const { actionsApi: i } = s();
|
|
113
|
+
return r("updateHtmlAndCss", h, (a) => {
|
|
115
114
|
i.updateHtmlAndCss(t, e, () => a());
|
|
116
115
|
});
|
|
117
116
|
},
|
|
118
|
-
editorSave: () =>
|
|
117
|
+
editorSave: () => r(
|
|
119
118
|
"save",
|
|
120
119
|
T,
|
|
121
120
|
(t) => {
|
|
122
|
-
|
|
121
|
+
s().actionsApi.save((e) => {
|
|
123
122
|
if (e) {
|
|
124
123
|
n(e, "Failed to save template"), t(!1);
|
|
125
124
|
return;
|
|
@@ -131,5 +130,5 @@ const H = 1e4, T = 3e4, m = (n, l, A) => new Promise((C, p) => {
|
|
|
131
130
|
};
|
|
132
131
|
};
|
|
133
132
|
export {
|
|
134
|
-
|
|
133
|
+
P as useActionsApi
|
|
135
134
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (typeof n._fs_org != "string" || !n._fs_org)
|
|
1
|
+
const c = "https://email-static.useinsider.com/guido/guido-fs.js", u = () => ({ injectFullStory: () => {
|
|
2
|
+
var n;
|
|
3
|
+
const s = window;
|
|
4
|
+
if (typeof s._fs_org != "string" || !s._fs_org)
|
|
6
5
|
return;
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
6
|
+
const r = document.querySelector("ui-editor"), o = (n = r == null ? void 0 : r.shadowRoot) == null ? void 0 : n.querySelector("iframe"), e = o == null ? void 0 : o.contentDocument;
|
|
7
|
+
if (!e || e.querySelector('script[data-fullstory-bridge="true"]'))
|
|
9
8
|
return;
|
|
10
|
-
const t =
|
|
11
|
-
t.src =
|
|
9
|
+
const t = e.createElement("script");
|
|
10
|
+
t.src = c, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", e.head.appendChild(t);
|
|
12
11
|
} });
|
|
13
12
|
export {
|
|
14
|
-
|
|
13
|
+
u as useFullStoryBridge
|
|
15
14
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { migrateCheckbox as i } from "./checkboxMigrator.js";
|
|
2
2
|
import { migrateCouponBlock as e } from "./couponBlockMigrator.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { migrateRecommendation as p } from "./recommendationMigrator.js";
|
|
3
|
+
import { migrateItemsBlock as a } from "./itemsBlockMigrator.js";
|
|
4
|
+
import { migrateProductNameLink as n } from "./productNameLinkMigrator.js";
|
|
5
|
+
import { migrateRadioButton as c } from "./radioButtonMigrator.js";
|
|
6
|
+
import { migrateRecommendation as g } from "./recommendationMigrator.js";
|
|
8
7
|
import { migrateRecommendationPartnerScope as f } from "./recommendationPartnerMigrator.js";
|
|
9
|
-
import { migrateRecommendationTitle as
|
|
10
|
-
import { migrateSocialIcons as
|
|
11
|
-
import { migrateUnsubscribe as
|
|
12
|
-
const h = async (
|
|
13
|
-
let m =
|
|
14
|
-
return m = i(m), m =
|
|
8
|
+
import { migrateRecommendationTitle as p } from "./recommendationTitleMigrator.js";
|
|
9
|
+
import { migrateSocialIcons as d } from "./socialIconMigrator.js";
|
|
10
|
+
import { migrateUnsubscribe as l } from "./unsubscribeMigrator.js";
|
|
11
|
+
const h = async (r, t = {}, o) => {
|
|
12
|
+
let m = r;
|
|
13
|
+
return m = i(m), m = c(m), m = await l(m), m = e(m), m = g(m, t), o && (m = f(m, o)), m = p(m), m = a(m), m = n(m), m = d(m), m;
|
|
15
14
|
};
|
|
16
15
|
export {
|
|
17
16
|
h as migrate
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.21.2-beta.
|
|
3
|
+
"version": "3.21.2-beta.9538c35",
|
|
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",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@stripoinc/ui-editor-extensions": "3.11.0",
|
|
56
56
|
"@useinsider/design-system-organisms": "0.0.3-beta.d816f06",
|
|
57
|
-
"@useinsider/design-system-vue": "2.
|
|
57
|
+
"@useinsider/design-system-vue": "2.5.0",
|
|
58
58
|
"@vueuse/core": "11.3.0",
|
|
59
59
|
"lodash-es": "4.17.21",
|
|
60
60
|
"pinia": "2.3.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const migrateFullStoryScripts: (html: string) => string;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const FULLSTORY_BRIDGE_SCRIPT_URL = "https://email-static.useinsider.com/guido/guido-fs.js";
|
|
2
|
-
/**
|
|
3
|
-
* Removes FullStory `<script>` elements that the panel / bridge leave in the editor iframe head,
|
|
4
|
-
* which Stripo then serializes into the stored source. Other scripts are left untouched.
|
|
5
|
-
*/
|
|
6
|
-
export declare function stripFullStoryScripts(html: string): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const o = "https://email-static.useinsider.com/guido/guido-fs.js", E = new RegExp("<script\\b([^>]*?)(?<!\\/)>([\\s\\S]*?)<\\/script\\s*>", "gi"), _ = /<script\b([^>]*?)\/>/gi, e = /\bsrc\s*=\s*["']?(?:https?:)?\/\/(?:[\w-]+\.)*fullstory\.com[/"'\s>]/i, R = /\bdata-fullstory-bridge\b/i, S = /\b_fs_(?:script|namespace)\b/, i = (s, t = "") => e.test(`${s} `) || R.test(s) || s.includes(o) || S.test(t);
|
|
2
|
-
function n(s) {
|
|
3
|
-
return !s || !/fullstory|_fs_|guido-fs\.js/i.test(s) ? s : s.replace(E, (t, c, r) => i(c, r) ? "" : t).replace(_, (t, c) => i(c) ? "" : t);
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
o as FULLSTORY_BRIDGE_SCRIPT_URL,
|
|
7
|
-
n as stripFullStoryScripts
|
|
8
|
-
};
|