@useinsider/guido 3.23.0-beta.6555b16 → 3.23.0-beta.75de098
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/extensions/Blocks/Recommendation/controls/main/index.js +68 -66
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +39 -29
- package/dist/package.json.js +2 -2
- package/dist/services/templateLibraryApi.js +37 -41
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +3 -0
- package/dist/static/stripo-runtime-manifest.json.js +1 -1
- package/dist/stores/save-as-template.js +5 -5
- package/package.json +2 -2
|
@@ -10,32 +10,32 @@ import { RecommendationConfigService as c } from "../../services/configService.j
|
|
|
10
10
|
import { useRecommendationExtensionStore as T } from "../../store/recommendation.js";
|
|
11
11
|
import { refreshBlockOutsidePanel as O } from "../../utils/blockRefresh.js";
|
|
12
12
|
import { mapLegacyStrategy as p } from "../../utils/legacyStrategyMap.js";
|
|
13
|
-
import { registerNodeConfigWriter as b, writeBlockConfigOutsidePanel as C, hasEditedConfigChange as B, pickConfigDescription as F, isProductIdsChange as L, PRODUCT_IDS_DESCRIPTION as D } from "../../utils/nodeConfigWriter.js";
|
|
14
|
-
import { AlgorithmControl as
|
|
15
|
-
import { ALGORITHM_CONTROL_ID as
|
|
16
|
-
import { CurrencyControl as
|
|
17
|
-
import { CURRENCY_CONTROL_ID as
|
|
18
|
-
import { FiltersControl as
|
|
19
|
-
import { FILTERS_CONTROL_ID as
|
|
13
|
+
import { registerNodeConfigWriter as b, writeBlockConfigOutsidePanel as C, hasEditedConfigChange as B, pickConfigDescription as F, isProductIdsChange as L, PRODUCT_IDS_DESCRIPTION as D, areProductsDrawn as E } from "../../utils/nodeConfigWriter.js";
|
|
14
|
+
import { AlgorithmControl as U } from "./algorithm.js";
|
|
15
|
+
import { ALGORITHM_CONTROL_ID as Re } from "./algorithm.js";
|
|
16
|
+
import { CurrencyControl as v } from "./currency.js";
|
|
17
|
+
import { CURRENCY_CONTROL_ID as Se } from "./currency.js";
|
|
18
|
+
import { FiltersControl as w } from "./filters.js";
|
|
19
|
+
import { FILTERS_CONTROL_ID as Te } from "./filters.js";
|
|
20
20
|
import { LayoutOrientationControl as A } from "./layoutOrientation.js";
|
|
21
|
-
import { LAYOUT_ORIENTATION_CONTROL_ID as
|
|
22
|
-
import { LocaleControl as
|
|
23
|
-
import { LOCALE_CONTROL_ID as
|
|
24
|
-
import { PricePlacementControl as
|
|
25
|
-
import { PRICE_PLACEMENT_CONTROL_ID as
|
|
26
|
-
import { ProductCountControl as
|
|
27
|
-
import { PRODUCT_COUNT_CONTROL_ID as
|
|
28
|
-
import { ProductLayoutControl as
|
|
29
|
-
import { PRODUCT_LAYOUT_CONTROL_ID as
|
|
30
|
-
import { ShuffleControl as
|
|
31
|
-
import { SHUFFLE_CONTROL_ID as
|
|
32
|
-
import { StrategyControl as
|
|
33
|
-
import { STRATEGY_CONTROL_ID as
|
|
34
|
-
import { setCurrencyAttributes as
|
|
35
|
-
import { adjustProductsToSize as
|
|
21
|
+
import { LAYOUT_ORIENTATION_CONTROL_ID as be } from "./layoutOrientation.js";
|
|
22
|
+
import { LocaleControl as V } from "./locale.js";
|
|
23
|
+
import { LOCALE_CONTROL_ID as Fe } from "./locale.js";
|
|
24
|
+
import { PricePlacementControl as W } from "./pricePlacement.js";
|
|
25
|
+
import { PRICE_PLACEMENT_CONTROL_ID as De } from "./pricePlacement.js";
|
|
26
|
+
import { ProductCountControl as x } from "./productCount.js";
|
|
27
|
+
import { PRODUCT_COUNT_CONTROL_ID as Ue } from "./productCount.js";
|
|
28
|
+
import { ProductLayoutControl as M } from "./productLayout.js";
|
|
29
|
+
import { PRODUCT_LAYOUT_CONTROL_ID as we } from "./productLayout.js";
|
|
30
|
+
import { ShuffleControl as G } from "./shuffle.js";
|
|
31
|
+
import { SHUFFLE_CONTROL_ID as Ve } from "./shuffle.js";
|
|
32
|
+
import { StrategyControl as $ } from "./strategy.js";
|
|
33
|
+
import { STRATEGY_CONTROL_ID as xe } from "./strategy.js";
|
|
34
|
+
import { setCurrencyAttributes as z, getBlockElement as H, isPartnerManagedBlock as Y, updateProductContentInPlace as j, regenerateProductRowsWithStyles as q } from "./utils.js";
|
|
35
|
+
import { adjustProductsToSize as Ge, formatProductPrice as $e, getCardComposition as ze, getCurrentLayout as He, getMainContainerTbody as Ye, regenerateMobileProductRows as je, updatePricesInPlace as qe, updateSingleProductContent as Je } from "./utils.js";
|
|
36
36
|
import { useDebounceFn as _ } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
37
|
-
const h = "Update recommendation filters",
|
|
38
|
-
class
|
|
37
|
+
const h = "Update recommendation filters", J = "ui-elements-recommendation-block";
|
|
38
|
+
class Ne extends I {
|
|
39
39
|
constructor() {
|
|
40
40
|
super(...arguments);
|
|
41
41
|
r(this, "store", T());
|
|
@@ -107,7 +107,7 @@ class _e extends I {
|
|
|
107
107
|
}, 100));
|
|
108
108
|
}
|
|
109
109
|
getId() {
|
|
110
|
-
return
|
|
110
|
+
return J;
|
|
111
111
|
}
|
|
112
112
|
get _subControls() {
|
|
113
113
|
return [
|
|
@@ -128,7 +128,7 @@ class _e extends I {
|
|
|
128
128
|
return this.rrsEnabled = f().isFeatureEnabled("reusableRecommendationStrategy"), this._subControls.forEach((t) => {
|
|
129
129
|
var o;
|
|
130
130
|
return (o = t == null ? void 0 : t.onDestroy) == null ? void 0 : o.call(t);
|
|
131
|
-
}), this.algorithmControl = new
|
|
131
|
+
}), this.algorithmControl = new U(), this.localeControl = new V(), this.currencyControl = new v(), this.productCountControl = new x(), this.productLayoutControl = new M(), this.filtersControl = new w(), this.shuffleControl = new G(), this.pricePlacementControl = new W(), this.layoutOrientationControl = new A(), this.strategyControl = this.rrsEnabled ? new $() : null, this._subControls.forEach((t) => {
|
|
132
132
|
t && (t.api = this.api);
|
|
133
133
|
}), `
|
|
134
134
|
<div class="recommendation-controls-container">
|
|
@@ -404,7 +404,7 @@ class _e extends I {
|
|
|
404
404
|
this.currentNode,
|
|
405
405
|
t,
|
|
406
406
|
"Applied smart defaults"
|
|
407
|
-
), o && t.currency &&
|
|
407
|
+
), o && t.currency && z({
|
|
408
408
|
currentNode: this.currentNode,
|
|
409
409
|
documentModifier: this.api.getDocumentModifier(),
|
|
410
410
|
currency: t.currency
|
|
@@ -428,7 +428,7 @@ class _e extends I {
|
|
|
428
428
|
* Reads the recommendation-id attribute from the block element within the node
|
|
429
429
|
*/
|
|
430
430
|
_getRecommendationIdFromNode(e) {
|
|
431
|
-
const t =
|
|
431
|
+
const t = H(e);
|
|
432
432
|
if (!t || !("getAttribute" in t))
|
|
433
433
|
return null;
|
|
434
434
|
const o = t.getAttribute(k);
|
|
@@ -452,7 +452,9 @@ class _e extends I {
|
|
|
452
452
|
e,
|
|
453
453
|
this._getNodeConfigUpdates(n.recommendationConfigs),
|
|
454
454
|
h
|
|
455
|
-
) && console.error("[recommendation] config write outside the panel did not reach a node", { blockId: e })
|
|
455
|
+
) && console.error("[recommendation] config write outside the panel did not reach a node", { blockId: e });
|
|
456
|
+
const s = o && !E(e, n.recommendationProducts);
|
|
457
|
+
(i || s) && this._refreshOutsidePanel(e, i);
|
|
456
458
|
} catch (n) {
|
|
457
459
|
console.error("[recommendation] finishing the block outside the panel failed", n);
|
|
458
460
|
}
|
|
@@ -488,19 +490,19 @@ class _e extends I {
|
|
|
488
490
|
return;
|
|
489
491
|
}
|
|
490
492
|
const e = this.store.recommendationProducts, t = this.api.getDocumentModifier(), o = this._pendingDescription(), n = this._stagePendingNodeConfig(t);
|
|
491
|
-
if (
|
|
493
|
+
if (Y(this.currentNode)) {
|
|
492
494
|
n && (t.apply(
|
|
493
495
|
new R(o ?? "Update recommendation configuration")
|
|
494
496
|
), this._consumePendingNodeConfig());
|
|
495
497
|
return;
|
|
496
498
|
}
|
|
497
|
-
|
|
499
|
+
j({
|
|
498
500
|
currentNode: this.currentNode,
|
|
499
501
|
documentModifier: t,
|
|
500
502
|
products: e,
|
|
501
503
|
description: o,
|
|
502
504
|
onApplied: n ? () => this._consumePendingNodeConfig() : void 0
|
|
503
|
-
}) ||
|
|
505
|
+
}) || q({
|
|
504
506
|
currentNode: this.currentNode,
|
|
505
507
|
documentModifier: t,
|
|
506
508
|
products: e,
|
|
@@ -543,39 +545,39 @@ class _e extends I {
|
|
|
543
545
|
}
|
|
544
546
|
}
|
|
545
547
|
export {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
548
|
+
Re as ALGORITHM_CONTROL_ID,
|
|
549
|
+
U as AlgorithmControl,
|
|
550
|
+
J as CONTROL_BLOCK_ID,
|
|
551
|
+
Se as CURRENCY_CONTROL_ID,
|
|
552
|
+
v as CurrencyControl,
|
|
553
|
+
Te as FILTERS_CONTROL_ID,
|
|
554
|
+
w as FiltersControl,
|
|
555
|
+
be as LAYOUT_ORIENTATION_CONTROL_ID,
|
|
556
|
+
Fe as LOCALE_CONTROL_ID,
|
|
555
557
|
A as LayoutOrientationControl,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
558
|
+
V as LocaleControl,
|
|
559
|
+
De as PRICE_PLACEMENT_CONTROL_ID,
|
|
560
|
+
Ue as PRODUCT_COUNT_CONTROL_ID,
|
|
561
|
+
we as PRODUCT_LAYOUT_CONTROL_ID,
|
|
562
|
+
W as PricePlacementControl,
|
|
563
|
+
x as ProductCountControl,
|
|
564
|
+
M as ProductLayoutControl,
|
|
565
|
+
Ne as RecommendationBlockControl,
|
|
566
|
+
Ve as SHUFFLE_CONTROL_ID,
|
|
567
|
+
xe as STRATEGY_CONTROL_ID,
|
|
568
|
+
G as ShuffleControl,
|
|
569
|
+
$ as StrategyControl,
|
|
570
|
+
Ge as adjustProductsToSize,
|
|
571
|
+
$e as formatProductPrice,
|
|
572
|
+
H as getBlockElement,
|
|
573
|
+
ze as getCardComposition,
|
|
574
|
+
He as getCurrentLayout,
|
|
575
|
+
Ye as getMainContainerTbody,
|
|
576
|
+
Y as isPartnerManagedBlock,
|
|
577
|
+
je as regenerateMobileProductRows,
|
|
578
|
+
q as regenerateProductRowsWithStyles,
|
|
579
|
+
z as setCurrencyAttributes,
|
|
580
|
+
qe as updatePricesInPlace,
|
|
581
|
+
j as updateProductContentInPlace,
|
|
582
|
+
Je as updateSingleProductContent
|
|
581
583
|
};
|
|
@@ -1,45 +1,52 @@
|
|
|
1
1
|
import { ModificationDescription as a } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RECOMMENDATION_ID_ATTR as m } from "../constants/selectors.js";
|
|
3
|
-
import { isPartnerManagedBlock as
|
|
3
|
+
import { isPartnerManagedBlock as N, updateProductContentInPlace as I, regenerateProductRowsWithStyles as D } from "../controls/main/utils.js";
|
|
4
4
|
import { RecommendationConfigService as c } from "../services/configService.js";
|
|
5
5
|
import { useRecommendationExtensionStore as O } from "../store/recommendation.js";
|
|
6
6
|
let r = null;
|
|
7
|
-
|
|
7
|
+
const C = /* @__PURE__ */ new Map();
|
|
8
|
+
function k(t) {
|
|
8
9
|
r = t;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
+
function P(t, n) {
|
|
12
|
+
C.set(t, n);
|
|
13
|
+
}
|
|
14
|
+
function q(t, n) {
|
|
15
|
+
return C.get(t) === n;
|
|
16
|
+
}
|
|
17
|
+
function p(t) {
|
|
11
18
|
const n = r == null ? void 0 : r.getDocumentRootHtmlNode();
|
|
12
19
|
return !n || !("querySelector" in n) ? null : n.querySelector(`[${m}="${t}"]`) ?? null;
|
|
13
20
|
}
|
|
14
|
-
function
|
|
21
|
+
function R(t, n) {
|
|
15
22
|
const o = c.getConfig(t);
|
|
16
23
|
return Object.keys(n).some((e) => JSON.stringify(o[e]) !== JSON.stringify(n[e]));
|
|
17
24
|
}
|
|
18
|
-
function
|
|
25
|
+
function h(t, n) {
|
|
19
26
|
const o = c.getConfig(t);
|
|
20
27
|
return ["filters", "strategy", "strategyId", "size", "productIds"].some((e) => e in n && JSON.stringify(o[e]) !== JSON.stringify(n[e]));
|
|
21
28
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
29
|
+
const S = "Updated product IDs";
|
|
30
|
+
function y(t, n) {
|
|
24
31
|
if (!("productIds" in n))
|
|
25
32
|
return !1;
|
|
26
33
|
const o = c.getConfig(t);
|
|
27
34
|
return JSON.stringify(o.productIds) !== JSON.stringify(n.productIds);
|
|
28
35
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
36
|
+
function w(t, n, o) {
|
|
37
|
+
return y(t, n) ? S : o;
|
|
31
38
|
}
|
|
32
|
-
function
|
|
33
|
-
const e =
|
|
39
|
+
function _(t, n, o) {
|
|
40
|
+
const e = p(t);
|
|
34
41
|
if (!r || !e)
|
|
35
42
|
return !1;
|
|
36
|
-
if (
|
|
37
|
-
const i =
|
|
43
|
+
if (h(e, n)) {
|
|
44
|
+
const i = w(e, n, o);
|
|
38
45
|
c.updateConfig(r, e, n, i);
|
|
39
46
|
}
|
|
40
47
|
return !0;
|
|
41
48
|
}
|
|
42
|
-
function
|
|
49
|
+
function B(t, n) {
|
|
43
50
|
const o = O(), e = o.currentRecommendationId;
|
|
44
51
|
if (e === t || !o.blockStates[t]) {
|
|
45
52
|
n();
|
|
@@ -52,34 +59,37 @@ function P(t, n) {
|
|
|
52
59
|
o.$patch({ currentRecommendationId: e });
|
|
53
60
|
}
|
|
54
61
|
}
|
|
55
|
-
function
|
|
62
|
+
function x(t) {
|
|
56
63
|
const n = r == null ? void 0 : r.getDocumentRootHtmlNode();
|
|
57
64
|
return !n || !("querySelectorAll" in n) ? [] : n.querySelectorAll(`[${m}="${t}"]`).map((o) => c.getConfig(o));
|
|
58
65
|
}
|
|
59
|
-
function
|
|
60
|
-
const i =
|
|
66
|
+
function A(t, n, o, e) {
|
|
67
|
+
const i = p(t);
|
|
61
68
|
if (!r || !i)
|
|
62
69
|
return !1;
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
P(t, o);
|
|
71
|
+
const f = r.getDocumentModifier(), d = R(i, n), g = y(i, n), s = g ? S : e, l = { currentNode: i, documentModifier: f, products: o, ...g ? { description: s } : {} };
|
|
72
|
+
if (c.stageConfig(f, i, n), N(i))
|
|
65
73
|
return d && f.apply(new a(s)), !0;
|
|
66
74
|
let u = !1;
|
|
67
|
-
return
|
|
75
|
+
return B(t, () => {
|
|
68
76
|
I({
|
|
69
77
|
...l,
|
|
70
78
|
onApplied: () => {
|
|
71
79
|
u = !0;
|
|
72
80
|
}
|
|
73
|
-
}) || (u =
|
|
81
|
+
}) || (u = D(l));
|
|
74
82
|
}), !u && d && f.apply(new a(s)), !0;
|
|
75
83
|
}
|
|
76
84
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
S as PRODUCT_IDS_DESCRIPTION,
|
|
86
|
+
q as areProductsDrawn,
|
|
87
|
+
A as commitBlockChangeOutsidePanel,
|
|
88
|
+
h as hasEditedConfigChange,
|
|
89
|
+
y as isProductIdsChange,
|
|
90
|
+
P as markProductsDrawn,
|
|
91
|
+
w as pickConfigDescription,
|
|
92
|
+
x as readBlockNodeConfigs,
|
|
93
|
+
k as registerNodeConfigWriter,
|
|
94
|
+
_ as writeBlockConfigOutsidePanel
|
|
85
95
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const o = "3.23.0-beta.
|
|
1
|
+
const o = "3.23.0-beta.75de098", s = { stripo: { version: "2.83.1" } }, e = {
|
|
2
2
|
version: o,
|
|
3
3
|
guido: s
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default,
|
|
7
7
|
s as guido,
|
|
8
8
|
o as version
|
|
9
9
|
};
|
|
@@ -1,70 +1,66 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useHttp as
|
|
1
|
+
import { useActionsApi as h } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useConfig as S } from "../composables/useConfig.js";
|
|
3
|
+
import { useHttp as v } from "../composables/useHttp.js";
|
|
4
4
|
import { useToaster as x } from "../composables/useToaster.js";
|
|
5
|
-
import { useTranslations as
|
|
6
|
-
import { useHtmlDocumentCountValidator as
|
|
7
|
-
import { useLiquidValidator as
|
|
8
|
-
import { EditorType as
|
|
9
|
-
import { ToasterTypeOptions as
|
|
10
|
-
import { useRecommendationExtensionStore as
|
|
11
|
-
import { useSaveAsTemplateStore as
|
|
5
|
+
import { useTranslations as A } from "../composables/useTranslations.js";
|
|
6
|
+
import { useHtmlDocumentCountValidator as E } from "../composables/validators/useHtmlDocumentCountValidator.js";
|
|
7
|
+
import { useLiquidValidator as N } from "../composables/validators/useLiquidValidator.js";
|
|
8
|
+
import { EditorType as H } from "../enums/defaults.js";
|
|
9
|
+
import { ToasterTypeOptions as P } from "../enums/toaster.js";
|
|
10
|
+
import { useRecommendationExtensionStore as D } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
11
|
+
import { useSaveAsTemplateStore as L } from "../stores/save-as-template.js";
|
|
12
12
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
13
|
-
import { isPlainObject as
|
|
13
|
+
import { isPlainObject as q } from "../utils/genericUtil.js";
|
|
14
14
|
import { useTemplatePreparation as F } from "../utils/templatePreparation.js";
|
|
15
15
|
const Z = () => {
|
|
16
|
-
const { get:
|
|
16
|
+
const { get: n, post: m } = v(), { handleError: s, showToaster: l } = x(), { config: c, isFeatureEnabled: p } = S(), { validateLiquidSyntax: T } = N(), { validateSingleHtmlDocument: w } = E(), { getTemplateData: b } = h(), u = A();
|
|
17
17
|
return {
|
|
18
18
|
getCategories: async () => {
|
|
19
19
|
try {
|
|
20
|
-
const { data: e } = await
|
|
21
|
-
|
|
22
|
-
return e;
|
|
23
|
-
if (w(e) && e.type === "alert" && typeof e.message == "string")
|
|
24
|
-
return i({ message: e.message, type: T.Error }), [];
|
|
25
|
-
throw new Error("Unexpected get-template-categories response");
|
|
20
|
+
const { data: e = [] } = await n("/newsletter/template-library/get-template-categories");
|
|
21
|
+
return e;
|
|
26
22
|
} catch (e) {
|
|
27
|
-
return
|
|
23
|
+
return s(e, "Failed to fetch template categories"), [];
|
|
28
24
|
}
|
|
29
25
|
},
|
|
30
26
|
checkTemplateNameAvailability: async (e) => {
|
|
31
|
-
const { data: { status: t = !1 } } = await
|
|
27
|
+
const { data: { status: t = !1 } } = await n(
|
|
32
28
|
`/newsletter/template-library/template-name-exists?name=${e}`
|
|
33
29
|
);
|
|
34
30
|
return !t;
|
|
35
31
|
},
|
|
36
32
|
createCategory: async (e) => {
|
|
37
33
|
try {
|
|
38
|
-
const { data: { id: t } } = await
|
|
34
|
+
const { data: { id: t } } = await m(
|
|
39
35
|
"/newsletter/template-library/create-category",
|
|
40
36
|
{ name: e }
|
|
41
37
|
);
|
|
42
38
|
return t.toString();
|
|
43
39
|
} catch (t) {
|
|
44
|
-
return
|
|
40
|
+
return s(t, "Failed to create category"), "";
|
|
45
41
|
}
|
|
46
42
|
},
|
|
47
43
|
createTemplate: async () => {
|
|
48
44
|
var e, t, d, y;
|
|
49
45
|
try {
|
|
50
|
-
const { prepareTemplateDetails:
|
|
51
|
-
if (!
|
|
46
|
+
const { prepareTemplateDetails: i } = F(), o = L(), g = await b();
|
|
47
|
+
if (!w(g.html))
|
|
52
48
|
return !1;
|
|
53
|
-
const a = await
|
|
54
|
-
if (p("liquidSyntax") && !await
|
|
49
|
+
const a = await i(g);
|
|
50
|
+
if (p("liquidSyntax") && !await T(a.compiledHtml))
|
|
55
51
|
return !1;
|
|
56
|
-
const
|
|
57
|
-
name:
|
|
58
|
-
categories:
|
|
52
|
+
const C = {
|
|
53
|
+
name: o.getTemplateName,
|
|
54
|
+
categories: o.getSelectedCategoryIds,
|
|
59
55
|
productId: ((t = (e = c.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
60
|
-
editorType:
|
|
56
|
+
editorType: H,
|
|
61
57
|
messageType: ((y = (d = c.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
|
|
62
58
|
content: r(a.compiledHtml),
|
|
63
59
|
css: r(a.css),
|
|
64
60
|
unsubscriptionPreferencePageStatus: !1,
|
|
65
61
|
unsubscriptionPreferencePages: [],
|
|
66
62
|
recommendationCampaignUrls: r(
|
|
67
|
-
|
|
63
|
+
D().recommendationCampaignUrls
|
|
68
64
|
),
|
|
69
65
|
recommendationConfigs: r({}),
|
|
70
66
|
isGuido: !0,
|
|
@@ -76,27 +72,27 @@ const Z = () => {
|
|
|
76
72
|
css: a.css,
|
|
77
73
|
dynamicContentList: a.dynamicContentList
|
|
78
74
|
})
|
|
79
|
-
}, { data: f } = await
|
|
75
|
+
}, { data: f } = await m(
|
|
80
76
|
"/newsletter/template-library/create-template",
|
|
81
|
-
|
|
77
|
+
C
|
|
82
78
|
);
|
|
83
|
-
if (!
|
|
79
|
+
if (!q(f))
|
|
84
80
|
throw new Error("Unexpected create-template response");
|
|
85
|
-
return f.type === "alert" ? (
|
|
81
|
+
return f.type === "alert" ? (l({
|
|
86
82
|
message: u(
|
|
87
83
|
"newsletter.template-library-save-alert",
|
|
88
|
-
{ templateName:
|
|
84
|
+
{ templateName: o.getTemplateName }
|
|
89
85
|
),
|
|
90
|
-
type:
|
|
91
|
-
}), !1) : (
|
|
86
|
+
type: P.Error
|
|
87
|
+
}), !1) : (l({
|
|
92
88
|
message: u(
|
|
93
89
|
"newsletter.template-library-save-success",
|
|
94
|
-
{ templateName:
|
|
90
|
+
{ templateName: o.getTemplateName }
|
|
95
91
|
),
|
|
96
92
|
type: "success"
|
|
97
93
|
}), !0);
|
|
98
|
-
} catch (
|
|
99
|
-
return
|
|
94
|
+
} catch (i) {
|
|
95
|
+
return s(i, "Failed to create template"), !1;
|
|
100
96
|
}
|
|
101
97
|
}
|
|
102
98
|
};
|
|
@@ -13,6 +13,9 @@ interface ConfigWriterApi {
|
|
|
13
13
|
* itself is torn down.
|
|
14
14
|
*/
|
|
15
15
|
export declare function registerNodeConfigWriter(api: ConfigWriterApi): void;
|
|
16
|
+
/** Records the product list last handed to a block's node; compared by identity, as every fetch swaps the array. */
|
|
17
|
+
export declare function markProductsDrawn(blockId: number, products: RecommendationProduct[]): void;
|
|
18
|
+
export declare function areProductsDrawn(blockId: number, products: RecommendationProduct[]): boolean;
|
|
16
19
|
export declare function hasEditedConfigChange(node: ImmutableHtmlNode, updates: PartialNodeConfig): boolean;
|
|
17
20
|
export declare const PRODUCT_IDS_DESCRIPTION = "Updated product IDs";
|
|
18
21
|
/** A deferred Product Ids edit keeps its own undo label wherever the write finally lands. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const s = "2.
|
|
1
|
+
const s = "2.83.1", n = ["UIEditor.js", "zone.js", "styles-BWH3PMR4.css", "polyfills-FF3RLU5F.js", "main-OTN2PYRT.js", "chunk-62K3AMOD.js", "chunk-6RGJBGUG.js", "chunk-6W43DTQG.js", "chunk-EC4WGEOZ.js", "chunk-GLBBUJ54.js", "chunk-GPJLJCMF.js", "chunk-MDCDEJUH.js", "chunk-P7HQTFJV.js", "chunk-PA4WGBC4.js", "chunk-QMDAV6OU.js", "chunk-R2F3ADM2.js", "chunk-YSKQ2TWF.js", "chunk-ZU5ASRKR.js", "assets/css/uiEditor.css", "assets/i18n/en.json", "assets/icons/ui-editor-icons.sprite.svg", "assets/icons/ui-editor-icons.map.json", "assets/imageeditor/scripts.min.js", "assets/imageeditor/assets/icons/merged.svg"], i = {
|
|
2
2
|
version: s,
|
|
3
3
|
files: n
|
|
4
4
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTemplateLibraryApi as o } from "../services/templateLibraryApi.js";
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
2
|
+
import { defineStore as i } from "pinia";
|
|
3
|
+
const r = () => ({
|
|
4
4
|
templateName: "",
|
|
5
5
|
categories: [],
|
|
6
6
|
selectedCategories: [],
|
|
@@ -17,8 +17,8 @@ const i = () => ({
|
|
|
17
17
|
editor: 2,
|
|
18
18
|
message: 1
|
|
19
19
|
}
|
|
20
|
-
}), g =
|
|
21
|
-
state: () =>
|
|
20
|
+
}), g = i("guidoSaveAsTemplate", {
|
|
21
|
+
state: () => r(),
|
|
22
22
|
getters: {
|
|
23
23
|
getTemplateName: (e) => e.templateName.trim(),
|
|
24
24
|
getSelectedCategoryIds: (e) => e.selectedCategories.map((a) => Number(a.value))
|
|
@@ -26,7 +26,7 @@ const i = () => ({
|
|
|
26
26
|
actions: {
|
|
27
27
|
async fetchCategories() {
|
|
28
28
|
const { getCategories: e } = o(), a = await e();
|
|
29
|
-
this.categories =
|
|
29
|
+
this.categories = a.map((t) => ({
|
|
30
30
|
value: t.id.toString(),
|
|
31
31
|
text: t.name
|
|
32
32
|
})).sort((t, s) => t.text.localeCompare(s.text));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.23.0-beta.
|
|
3
|
+
"version": "3.23.0-beta.75de098",
|
|
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",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
},
|
|
129
129
|
"guido": {
|
|
130
130
|
"stripo": {
|
|
131
|
-
"version": "2.
|
|
131
|
+
"version": "2.83.1"
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
}
|