@useinsider/guido 3.21.2-beta.cfc5be2 → 3.21.2-beta.d2a272e
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/README.md +35 -5
- package/dist/@types/config/schemas.js +39 -41
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +107 -99
- package/dist/composables/useBlocksConfig.js +24 -32
- package/dist/composables/useEditorOpenMetrics.js +167 -0
- package/dist/composables/useSave.js +75 -68
- package/dist/composables/useStripo.js +93 -82
- package/dist/composables/validators/useHtmlDocumentCountValidator.js +22 -0
- package/dist/enums/academy.js +0 -1
- package/dist/guido.css +1 -1
- package/dist/library.js +12 -10
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +92 -93
- package/dist/node_modules/valibot/dist/index.js +261 -297
- package/dist/package.json.js +6 -4
- package/dist/public/prefetchRuntime.js +4 -0
- package/dist/services/templateLibraryApi.js +36 -31
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
- package/dist/src/composables/useStripo.d.ts +2 -1
- package/dist/src/composables/validators/useHtmlDocumentCountValidator.d.ts +3 -0
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/library.d.ts +1 -0
- package/dist/src/public/prefetchRuntime.d.ts +1 -0
- package/dist/src/stores/config.d.ts +0 -166
- package/dist/src/utils/runtimePrefetch.d.ts +4 -0
- package/dist/src/utils/stripoRuntime.d.ts +3 -0
- package/dist/src/utils/templatePreparation.d.ts +2 -1
- package/dist/static/stripo-runtime-manifest.json.js +9 -0
- package/dist/stores/config.js +6 -13
- package/dist/utils/pairProductVariables.js +98 -91
- package/dist/utils/runtimePrefetch.js +26 -0
- package/dist/utils/stripoRuntime.js +13 -0
- package/dist/utils/templatePreparation.js +30 -30
- package/package.json +6 -1
- package/dist/@types/display-condition.js +0 -25
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +0 -20
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +0 -30
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +0 -30
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +0 -71
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +0 -34
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +0 -57
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +0 -17
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +0 -22
- package/dist/composables/useDisplayConditions.js +0 -102
- package/dist/enums/display-condition.js +0 -12
- package/dist/extensions/DisplayConditions/bridge.js +0 -17
- package/dist/extensions/DisplayConditions/constants.js +0 -17
- package/dist/extensions/DisplayConditions/control.js +0 -178
- package/dist/extensions/DisplayConditions/display-conditions.css.js +0 -201
- package/dist/extensions/DisplayConditions/extension.js +0 -28
- package/dist/extensions/DisplayConditions/iconsRegistry.js +0 -20
- package/dist/extensions/DisplayConditions/library.js +0 -27
- package/dist/extensions/DisplayConditions/settingsPanel.js +0 -17
- package/dist/services/displayConditionApi.js +0 -39
- package/dist/src/@types/display-condition.d.ts +0 -59
- package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +0 -43
- package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +0 -2
- package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +0 -2
- package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +0 -2
- package/dist/src/composables/useDisplayConditions.d.ts +0 -16
- package/dist/src/enums/display-condition.d.ts +0 -15
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +0 -6
- package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -14
- package/dist/src/extensions/DisplayConditions/control.d.ts +0 -23
- package/dist/src/extensions/DisplayConditions/extension.d.ts +0 -2
- package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/DisplayConditions/library.d.ts +0 -8
- package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +0 -5
- package/dist/src/mock/api/display-conditions.d.ts +0 -2
- package/dist/src/services/displayConditionApi.d.ts +0 -8
- package/dist/src/stores/display-condition.d.ts +0 -81
- package/dist/src/utils/displayCondition.d.ts +0 -10
- package/dist/src/utils/protectTableText.d.ts +0 -2
- package/dist/stores/display-condition.js +0 -28
- package/dist/utils/displayCondition.js +0 -26
- package/dist/utils/protectTableText.js +0 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useConfigStore as
|
|
3
|
-
const
|
|
1
|
+
import r from "../extensions/ModulesTabIcons/extension.js";
|
|
2
|
+
import { useConfigStore as l } from "../stores/config.js";
|
|
3
|
+
const a = {
|
|
4
4
|
"amp-accordion": "ampAccordionEnabled",
|
|
5
5
|
"amp-carousel": "ampCarouselEnabled",
|
|
6
6
|
"amp-form-controls": "ampFormControlsEnabled",
|
|
@@ -14,7 +14,7 @@ const s = {
|
|
|
14
14
|
"text-block": "textEnabled",
|
|
15
15
|
"timer-block": "timerEnabled",
|
|
16
16
|
"video-block": "videoEnabled"
|
|
17
|
-
},
|
|
17
|
+
}, s = {
|
|
18
18
|
"dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
|
|
19
19
|
"checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
|
|
20
20
|
"radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
|
|
@@ -22,48 +22,40 @@ const s = {
|
|
|
22
22
|
"unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
|
|
23
23
|
"coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
|
|
24
24
|
"items-block": () => import("../extensions/Blocks/Items/extension.js")
|
|
25
|
-
},
|
|
26
|
-
if (!
|
|
25
|
+
}, i = (n) => {
|
|
26
|
+
if (!n || !n.length)
|
|
27
27
|
return {};
|
|
28
28
|
const t = {};
|
|
29
|
-
return
|
|
30
|
-
const e =
|
|
29
|
+
return n.forEach((o) => {
|
|
30
|
+
const e = a[o];
|
|
31
31
|
e && (t[e] = !1);
|
|
32
32
|
}), t;
|
|
33
|
-
}, m = async (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return n;
|
|
42
|
-
const e = await Promise.all(
|
|
43
|
-
o.map(async (r) => {
|
|
44
|
-
const a = i[r];
|
|
45
|
-
return a ? (await a()).default : null;
|
|
33
|
+
}, b = () => [r], m = async (n) => {
|
|
34
|
+
const t = b();
|
|
35
|
+
if (!n || !n.length)
|
|
36
|
+
return t;
|
|
37
|
+
const o = await Promise.all(
|
|
38
|
+
n.map(async (e) => {
|
|
39
|
+
const c = s[e];
|
|
40
|
+
return c ? (await c()).default : null;
|
|
46
41
|
})
|
|
47
42
|
);
|
|
48
43
|
return [
|
|
49
|
-
...
|
|
50
|
-
...
|
|
44
|
+
...t,
|
|
45
|
+
...o.filter((e) => e !== null)
|
|
51
46
|
];
|
|
52
|
-
},
|
|
53
|
-
const
|
|
47
|
+
}, E = () => {
|
|
48
|
+
const n = l();
|
|
54
49
|
return {
|
|
55
50
|
getStripoBlocksConfig: async () => {
|
|
56
|
-
const
|
|
51
|
+
const o = n.blocks;
|
|
57
52
|
return {
|
|
58
|
-
baseBlocks:
|
|
59
|
-
extensions: await
|
|
60
|
-
n == null ? void 0 : n.includeCustoms,
|
|
61
|
-
o.externalDisplayConditions
|
|
62
|
-
)
|
|
53
|
+
baseBlocks: i(o == null ? void 0 : o.excludeDefaults),
|
|
54
|
+
extensions: await m(o == null ? void 0 : o.includeCustoms)
|
|
63
55
|
};
|
|
64
56
|
}
|
|
65
57
|
};
|
|
66
58
|
};
|
|
67
59
|
export {
|
|
68
|
-
|
|
60
|
+
E as useBlocksConfig
|
|
69
61
|
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { SYNC_MODULE_CLASS as w } from "./useSyncModuleExtractor.js";
|
|
2
|
+
import { readRuntimePrefetchState as S } from "../utils/runtimePrefetch.js";
|
|
3
|
+
import { getStripoVersion as R } from "../utils/stripoRuntime.js";
|
|
4
|
+
import M from "../package.json.js";
|
|
5
|
+
const A = [
|
|
6
|
+
"setup",
|
|
7
|
+
"host_ready",
|
|
8
|
+
"migration_start",
|
|
9
|
+
"migration_end",
|
|
10
|
+
"default_template_start",
|
|
11
|
+
"default_template_end",
|
|
12
|
+
"timer_clone_start",
|
|
13
|
+
"timer_clone_end",
|
|
14
|
+
"plugin_start",
|
|
15
|
+
"script_ready",
|
|
16
|
+
"fonts_sync_ready",
|
|
17
|
+
"blocks_config_ready",
|
|
18
|
+
"init_editor",
|
|
19
|
+
"token_start",
|
|
20
|
+
"token_end",
|
|
21
|
+
"ready"
|
|
22
|
+
], m = "guido:open:", h = "total", p = [
|
|
23
|
+
["host_wait", "setup", "host_ready"],
|
|
24
|
+
["migration", "migration_start", "migration_end"],
|
|
25
|
+
["default_template", "default_template_start", "default_template_end"],
|
|
26
|
+
["timer_clone", "timer_clone_start", "timer_clone_end"],
|
|
27
|
+
["script", "plugin_start", "script_ready"],
|
|
28
|
+
["fonts_sync", "script_ready", "fonts_sync_ready"],
|
|
29
|
+
["blocks_config", "fonts_sync_ready", "blocks_config_ready"],
|
|
30
|
+
["editor_config", "blocks_config_ready", "init_editor"],
|
|
31
|
+
["stripo_load", "init_editor", "ready"],
|
|
32
|
+
["token", "token_start", "token_end"]
|
|
33
|
+
], b = (e) => new RegExp(`(?:^|[\\s"'])(?:${e})(?=[\\s"'])`, "g"), N = /<img\b/gi, $ = b(w), L = /\srecommendation-id=/g, C = b("items-block-v2|esd-(?:cart|browsed|purchased)-items-block"), I = "esd-timer-id", f = {
|
|
34
|
+
html_bytes: null,
|
|
35
|
+
css_bytes: null,
|
|
36
|
+
image_count: null,
|
|
37
|
+
synced_module_count: null,
|
|
38
|
+
recommendation_block_count: null,
|
|
39
|
+
items_block_count: null,
|
|
40
|
+
has_timers: null,
|
|
41
|
+
force_recreate: null
|
|
42
|
+
};
|
|
43
|
+
let l = null;
|
|
44
|
+
const i = (e) => {
|
|
45
|
+
try {
|
|
46
|
+
e();
|
|
47
|
+
} catch (t) {
|
|
48
|
+
console.debug("guido:open: metrics step failed", t);
|
|
49
|
+
}
|
|
50
|
+
}, k = () => window.DD_RUM, g = (e, t) => e === void 0 || t === void 0 ? null : Math.round(t - e), _ = (e, t) => {
|
|
51
|
+
var r;
|
|
52
|
+
return ((r = e.match(t)) == null ? void 0 : r.length) ?? 0;
|
|
53
|
+
}, y = (e) => new TextEncoder().encode(e).length, O = (e) => {
|
|
54
|
+
if (!e)
|
|
55
|
+
return f;
|
|
56
|
+
try {
|
|
57
|
+
const { html: t, css: r, forceRecreate: o } = e;
|
|
58
|
+
return {
|
|
59
|
+
html_bytes: y(t),
|
|
60
|
+
css_bytes: y(r),
|
|
61
|
+
image_count: _(t, N),
|
|
62
|
+
synced_module_count: _(t, $),
|
|
63
|
+
recommendation_block_count: _(t, L),
|
|
64
|
+
items_block_count: _(t, C),
|
|
65
|
+
has_timers: t.includes(I),
|
|
66
|
+
force_recreate: o
|
|
67
|
+
};
|
|
68
|
+
} catch (t) {
|
|
69
|
+
return console.debug("guido:open: template weight failed", t), f;
|
|
70
|
+
}
|
|
71
|
+
}, E = () => {
|
|
72
|
+
i(() => {
|
|
73
|
+
A.forEach((e) => performance.clearMarks(`${m}${e}`)), [...p.map(([e]) => e), h].forEach((e) => performance.clearMeasures(`${m}${e}`));
|
|
74
|
+
});
|
|
75
|
+
}, c = (e, t) => {
|
|
76
|
+
if (e.finished || e.marks[t] !== void 0)
|
|
77
|
+
return;
|
|
78
|
+
const r = performance.now();
|
|
79
|
+
e.marks[t] = r, e === l && i(() => performance.mark(`${m}${t}`, { startTime: r }));
|
|
80
|
+
}, s = (e) => {
|
|
81
|
+
e.finished = !0, document.removeEventListener("visibilitychange", e.onVisibilityChange), window.removeEventListener("pagehide", e.onPageHide);
|
|
82
|
+
}, B = (e, t) => {
|
|
83
|
+
const { marks: r } = e, o = p.map(([n, a, d]) => [n, r[a], r[d]]);
|
|
84
|
+
o.push([h, r.setup, t]), o.forEach(([n, a, d]) => {
|
|
85
|
+
a !== void 0 && d !== void 0 && i(() => performance.measure(`${m}${n}`, { start: a, end: d }));
|
|
86
|
+
});
|
|
87
|
+
}, D = (e, t, r) => {
|
|
88
|
+
const { marks: o, context: n } = e, a = Object.fromEntries(
|
|
89
|
+
p.map(([d, v, P]) => [`${d}_ms`, g(o[v], o[P])])
|
|
90
|
+
);
|
|
91
|
+
return {
|
|
92
|
+
outcome: t,
|
|
93
|
+
open_ms: g(o.setup, r),
|
|
94
|
+
...a,
|
|
95
|
+
script_preloaded: e.scriptPreloaded,
|
|
96
|
+
runtime_prefetch: e.runtimePrefetch,
|
|
97
|
+
...O(e.template),
|
|
98
|
+
partner_name: (n == null ? void 0 : n.partnerName) ?? null,
|
|
99
|
+
product_type: (n == null ? void 0 : n.productType) ?? null,
|
|
100
|
+
template_id: (n == null ? void 0 : n.templateId) ?? null,
|
|
101
|
+
variation_id: (n == null ? void 0 : n.variationId) ?? null,
|
|
102
|
+
guido_version: M.version,
|
|
103
|
+
stripo_version: R(),
|
|
104
|
+
was_backgrounded: e.wasBackgrounded
|
|
105
|
+
};
|
|
106
|
+
}, u = (e, t) => {
|
|
107
|
+
i(() => {
|
|
108
|
+
const r = e.marks.ready ?? performance.now(), o = D(e, t, r);
|
|
109
|
+
e.template = null, e === l && B(e, r), console.debug("guido:open", o), i(() => {
|
|
110
|
+
var n, a;
|
|
111
|
+
return (a = (n = k()) == null ? void 0 : n.addAction) == null ? void 0 : a.call(n, "guido_editor_open", o);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
}, T = (e) => {
|
|
115
|
+
e.finished || (s(e), u(e, "abandoned"));
|
|
116
|
+
}, H = () => {
|
|
117
|
+
const e = {
|
|
118
|
+
marks: {},
|
|
119
|
+
context: null,
|
|
120
|
+
template: null,
|
|
121
|
+
scriptPreloaded: null,
|
|
122
|
+
runtimePrefetch: null,
|
|
123
|
+
wasBackgrounded: document.visibilityState === "hidden",
|
|
124
|
+
finished: !1,
|
|
125
|
+
onVisibilityChange: () => {
|
|
126
|
+
document.visibilityState === "hidden" && (e.wasBackgrounded = !0);
|
|
127
|
+
},
|
|
128
|
+
onPageHide: () => T(e)
|
|
129
|
+
};
|
|
130
|
+
return e;
|
|
131
|
+
}, Y = (e) => ({
|
|
132
|
+
mark: (t) => c(e, t),
|
|
133
|
+
timed: async (t, r) => {
|
|
134
|
+
c(e, `${t}_start`);
|
|
135
|
+
const o = await r();
|
|
136
|
+
return c(e, `${t}_end`), o;
|
|
137
|
+
},
|
|
138
|
+
setContext: (t) => {
|
|
139
|
+
e.context = t;
|
|
140
|
+
},
|
|
141
|
+
setTemplate: (t) => {
|
|
142
|
+
e.template = t;
|
|
143
|
+
},
|
|
144
|
+
setScriptPreloaded: (t) => {
|
|
145
|
+
e.scriptPreloaded = t;
|
|
146
|
+
},
|
|
147
|
+
markReady: () => {
|
|
148
|
+
e.finished || (c(e, "ready"), s(e), i(() => {
|
|
149
|
+
var t, r;
|
|
150
|
+
return (r = (t = k()) == null ? void 0 : t.addTiming) == null ? void 0 : r.call(t, "guido_editor_ready");
|
|
151
|
+
}), setTimeout(() => u(e, "ready"), 0));
|
|
152
|
+
},
|
|
153
|
+
markFailed: () => {
|
|
154
|
+
e.finished || (s(e), u(e, "error"));
|
|
155
|
+
},
|
|
156
|
+
dispose: () => {
|
|
157
|
+
T(e), e === l && (E(), l = null);
|
|
158
|
+
}
|
|
159
|
+
}), K = () => {
|
|
160
|
+
const e = H();
|
|
161
|
+
return E(), l = e, i(() => {
|
|
162
|
+
e.runtimePrefetch = S();
|
|
163
|
+
}), document.addEventListener("visibilitychange", e.onVisibilityChange), window.addEventListener("pagehide", e.onPageHide), c(e, "setup"), Y(e);
|
|
164
|
+
};
|
|
165
|
+
export {
|
|
166
|
+
K as startEditorOpenMetrics
|
|
167
|
+
};
|
|
@@ -1,84 +1,91 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { useSaveStart as
|
|
5
|
-
import { useSaveValidation as
|
|
6
|
-
import { useSaveValidationRollout as
|
|
7
|
-
import { useSyncModuleExtractor as
|
|
8
|
-
import { ToasterTypeOptions as
|
|
9
|
-
import { useStripoApi as
|
|
10
|
-
import { useConfigStore as
|
|
11
|
-
import { useDynamicContentStore as
|
|
12
|
-
import { useSaveValidationStore as
|
|
13
|
-
import { useTemplatePreparation as
|
|
14
|
-
import { useAllowlist as
|
|
15
|
-
import { useHtmlValidator as
|
|
16
|
-
import { useToaster as
|
|
17
|
-
import { useCouponBlockValidator as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { useActionsApi as q } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as O } from "./useConfig.js";
|
|
3
|
+
import { useEditorLock as D } from "./useEditorLock.js";
|
|
4
|
+
import { useSaveStart as F, useSaveComplete as j } from "./useGuidoActions.js";
|
|
5
|
+
import { useSaveValidation as z } from "./useSaveValidation.js";
|
|
6
|
+
import { useSaveValidationRollout as G } from "./useSaveValidationRollout.js";
|
|
7
|
+
import { useSyncModuleExtractor as I } from "./useSyncModuleExtractor.js";
|
|
8
|
+
import { ToasterTypeOptions as J } from "../enums/toaster.js";
|
|
9
|
+
import { useStripoApi as K } from "../services/stripoApi.js";
|
|
10
|
+
import { useConfigStore as N } from "../stores/config.js";
|
|
11
|
+
import { useDynamicContentStore as Q } from "../stores/dynamic-content.js";
|
|
12
|
+
import { useSaveValidationStore as X } from "../stores/save-validation.js";
|
|
13
|
+
import { useTemplatePreparation as Y, getHtmlReferencedUnsubscribePages as Z } from "../utils/templatePreparation.js";
|
|
14
|
+
import { useAllowlist as _ } from "./useAllowlist.js";
|
|
15
|
+
import { useHtmlValidator as $ } from "./useHtmlValidator.js";
|
|
16
|
+
import { useToaster as tt } from "./useToaster.js";
|
|
17
|
+
import { useCouponBlockValidator as et } from "./validators/useCouponBlockValidator.js";
|
|
18
|
+
import { useHtmlDocumentCountValidator as ot } from "./validators/useHtmlDocumentCountValidator.js";
|
|
19
|
+
import { useLiquidValidator as it } from "./validators/useLiquidValidator.js";
|
|
20
|
+
import { useSyncModuleBlockValidator as st } from "./validators/useSyncModuleBlockValidator.js";
|
|
21
|
+
import { useUnsubscribeBlockValidator as at } from "./validators/useUnsubscribeBlockValidator.js";
|
|
22
|
+
const Pt = () => {
|
|
23
|
+
const n = F(), w = j(), { validateHtml: y } = $(), { validateLiquidSyntax: E } = it(), { validateCouponBlockTags: b } = et(), { validateUnsubscribeBlockUniqueness: g, validateUnsubscribeBlockHasTemplate: H } = at(), { validateSyncModuleBlocks: l } = st(), { validateSingleHtmlDocument: c } = ot(), { callbacks: r, isFeatureEnabled: v } = O(), { extractSyncModuleData: V } = I(), { setSyncModuleUnsubscriptionPages: x } = K(), { editorSave: C, getTemplateData: u } = q(), { showToaster: k } = tt(), { getBlockedDomains: h, resolveToast: B } = _(), { prepareTemplateDetails: p } = Y(), { collectSaveValidationErrors: T } = z(), { isEnabled: P } = G(), L = X(), U = Q(), S = N(), { runExclusive: m } = D(), d = async (t, e, i) => {
|
|
24
|
+
if (!v("allowlistEnabled"))
|
|
24
25
|
return !1;
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
26
|
+
const o = await h(t, e);
|
|
27
|
+
if (!o.length)
|
|
27
28
|
return !1;
|
|
28
|
-
if (!
|
|
29
|
-
const s = await
|
|
30
|
-
s != null && s.message &&
|
|
31
|
-
type:
|
|
29
|
+
if (!i) {
|
|
30
|
+
const s = await B(o);
|
|
31
|
+
s != null && s.message && k({
|
|
32
|
+
type: J.Warning,
|
|
32
33
|
message: s.message,
|
|
33
34
|
actionButton: s.actionButton
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
return !0;
|
|
37
|
-
},
|
|
38
|
-
if (!await
|
|
38
|
+
}, A = async (t) => !b(t.compiledHtml) || !g(t.compiledHtml) || !H(t.compiledHtml) ? !1 : v("liquidSyntax") ? E(t.compiledHtml) : y(t.compiledHtml, t.dynamicContentList, !0), f = async (t, e) => {
|
|
39
|
+
if (!await C())
|
|
39
40
|
return;
|
|
40
|
-
const { unsubscribePayload:
|
|
41
|
-
if (await
|
|
42
|
-
const
|
|
43
|
-
|
|
41
|
+
const { unsubscribePayload: o, stripoModules: s } = V(t.rawHtml);
|
|
42
|
+
if (await x(o), t.modules = s, !e.suppress) {
|
|
43
|
+
const a = e.blankCompiled ? { compiledHtml: "", ampHtml: "" } : {};
|
|
44
|
+
w({ ...t, ...a, silent: e.silent });
|
|
44
45
|
}
|
|
45
46
|
return t;
|
|
46
|
-
},
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
}, M = async (t, e) => {
|
|
48
|
+
var s;
|
|
49
|
+
n();
|
|
50
|
+
const i = await u();
|
|
51
|
+
if (!c(i.html, e))
|
|
52
|
+
return;
|
|
53
|
+
const o = await p(i);
|
|
54
|
+
if (l(o.rawHtml, e)) {
|
|
55
|
+
if (P.value && !e) {
|
|
56
|
+
const a = await T(
|
|
53
57
|
o.compiledHtml,
|
|
54
58
|
o.dynamicContentList
|
|
55
59
|
);
|
|
56
|
-
if (
|
|
57
|
-
|
|
60
|
+
if (a.length) {
|
|
61
|
+
L.open(a, "save");
|
|
58
62
|
return;
|
|
59
63
|
}
|
|
60
|
-
} else if (!await
|
|
64
|
+
} else if (!await A(o))
|
|
61
65
|
return;
|
|
62
|
-
if (!((
|
|
63
|
-
return
|
|
66
|
+
if (!((s = r.value) != null && s.externalValidation && !await r.value.externalValidation(o)) && !await d(o.compiledHtml, o.css, e))
|
|
67
|
+
return f(o, { silent: e, suppress: t });
|
|
64
68
|
}
|
|
65
|
-
},
|
|
66
|
-
var
|
|
67
|
-
if (!
|
|
69
|
+
}, W = async () => {
|
|
70
|
+
var i;
|
|
71
|
+
if (!S.allowSaveWithErrors)
|
|
72
|
+
return;
|
|
73
|
+
n();
|
|
74
|
+
const t = await u();
|
|
75
|
+
if (!c(t.html, !1))
|
|
68
76
|
return;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (!f.allowSaveWithErrors)
|
|
77
|
+
const e = await p(t);
|
|
78
|
+
if (l(e.rawHtml, !1) && !((i = r.value) != null && i.externalValidation && !await r.value.externalValidation(e)) && !await d(e.compiledHtml, e.css, !1))
|
|
79
|
+
return f(e, { silent: !1, blankCompiled: !0 });
|
|
80
|
+
}, R = async () => {
|
|
81
|
+
if (!S.allowSaveWithErrors)
|
|
75
82
|
return;
|
|
76
|
-
|
|
77
|
-
const { html: t, css: e } = await
|
|
78
|
-
if (!
|
|
83
|
+
n();
|
|
84
|
+
const { html: t, css: e } = await u();
|
|
85
|
+
if (!c(t, !0) || !l(t, !0) || await d(t, e, !0))
|
|
79
86
|
return;
|
|
80
|
-
const
|
|
81
|
-
dynamicContentList:
|
|
87
|
+
const i = Z(t), o = {
|
|
88
|
+
dynamicContentList: U.getSelectedDynamicContentList,
|
|
82
89
|
compiledHtml: "",
|
|
83
90
|
rawHtml: t,
|
|
84
91
|
css: e,
|
|
@@ -88,16 +95,16 @@ const Bt = () => {
|
|
|
88
95
|
// No campaignUrls: hosts overwrite their stored map with any object, and raw HTML can't rebuild it.
|
|
89
96
|
recommendation: { configs: {} },
|
|
90
97
|
unsubscribe: {
|
|
91
|
-
status:
|
|
92
|
-
config:
|
|
98
|
+
status: i.length > 0,
|
|
99
|
+
config: i
|
|
93
100
|
}
|
|
94
101
|
};
|
|
95
|
-
return
|
|
102
|
+
return f(o, { silent: !0 });
|
|
96
103
|
};
|
|
97
|
-
return { save: (t = !1, e = !1) =>
|
|
98
|
-
() =>
|
|
99
|
-
), saveWithErrors: () =>
|
|
104
|
+
return { save: (t = !1, e = !1) => m(
|
|
105
|
+
() => M(t, e)
|
|
106
|
+
), saveWithErrors: () => m(W), saveRawOnly: () => m(R) };
|
|
100
107
|
};
|
|
101
108
|
export {
|
|
102
|
-
|
|
109
|
+
Pt as useSave
|
|
103
110
|
};
|