@useinsider/guido 3.6.0-beta.b75de0e → 3.6.0-beta.d0bfe20
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/unsubscribe/UnsubscribePageSelection.vue.js +2 -2
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +24 -22
- package/dist/composables/useHtmlValidator.js +102 -131
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +27 -28
- package/dist/config/migrator/recommendation/extractors.js +22 -44
- package/dist/config/migrator/recommendation/htmlBuilder.js +169 -175
- package/dist/config/migrator/recommendationMigrator.js +31 -30
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -21
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +24 -38
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +38 -39
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +34 -45
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +2 -3
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +52 -62
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +67 -74
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +6 -7
- package/dist/extensions/Blocks/Recommendation/extension.js +5 -6
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +2 -3
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +2 -3
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +2 -3
- package/dist/extensions/Blocks/Recommendation/templates/index.js +4 -5
- package/dist/extensions/Blocks/Unsubscribe/control.js +33 -26
- package/dist/guido.css +1 -1
- package/dist/src/composables/useHtmlValidator.d.ts +0 -9
- package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -15
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +0 -8
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -21
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +0 -6
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -9
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
- package/package.json +1 -1
- package/dist/config/compiler/utils/recommendationIgnoreUtils.js +0 -15
- package/dist/src/composables/useHtmlValidator.test.d.ts +0 -1
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +0 -17
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +0 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ExtensionBuilder as r } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RecommendationBlock as m } from "./block.js";
|
|
3
3
|
import { RecommendationBlockControl as n } from "./controls/main/index.js";
|
|
4
|
-
import "./constants/selectors.js";
|
|
5
4
|
import "./store/recommendation.js";
|
|
6
5
|
import { NameControls as i } from "./controls/name/index.js";
|
|
7
6
|
import { PriceControls as e } from "./controls/price/index.js";
|
|
8
7
|
import { OldPriceControls as s } from "./controls/oldPrice/index.js";
|
|
9
8
|
import { OmnibusPriceControls as l } from "./controls/omnibusPrice/index.js";
|
|
10
|
-
import { OmnibusDiscountControls as
|
|
11
|
-
import { ButtonControls as
|
|
9
|
+
import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
|
|
10
|
+
import { ButtonControls as p } from "./controls/button/index.js";
|
|
12
11
|
import { ImageControls as c } from "./controls/image/index.js";
|
|
13
12
|
import { CustomAttributeControls as C } from "./controls/customAttribute/index.js";
|
|
14
13
|
import { SpacingControl as f } from "./controls/spacing/index.js";
|
|
@@ -23,8 +22,8 @@ const b = [
|
|
|
23
22
|
e,
|
|
24
23
|
s,
|
|
25
24
|
l,
|
|
26
|
-
p,
|
|
27
25
|
a,
|
|
26
|
+
p,
|
|
28
27
|
c,
|
|
29
28
|
C
|
|
30
29
|
], P = [
|
|
@@ -36,10 +35,10 @@ const b = [
|
|
|
36
35
|
], S = [
|
|
37
36
|
...P,
|
|
38
37
|
...b.flatMap((o) => Object.values(o))
|
|
39
|
-
],
|
|
38
|
+
], K = S.reduce(
|
|
40
39
|
(o, t) => o.addControl(t),
|
|
41
40
|
new r().addBlock(m).withSettingsPanelRegistry(B)
|
|
42
41
|
).addStyles(y).withIconsRegistry(R).build();
|
|
43
42
|
export {
|
|
44
|
-
|
|
43
|
+
K as default
|
|
45
44
|
};
|
|
@@ -2,7 +2,6 @@ import { SettingsPanelRegistry as E, SettingsPanelTab as _, SettingsTab as O, Co
|
|
|
2
2
|
import { BLOCK_ID as U } from "./block.js";
|
|
3
3
|
import { RecommendationBlockId as S } from "./constants/blockIds.js";
|
|
4
4
|
import { RecommendationControlId as T } from "./constants/controlIds.js";
|
|
5
|
-
import "./constants/selectors.js";
|
|
6
5
|
import { CONTROL_BLOCK_ID as A } from "./controls/main/index.js";
|
|
7
6
|
import "./store/recommendation.js";
|
|
8
7
|
import "./controls/name/index.js";
|
|
@@ -16,7 +15,7 @@ import { SPACING_CONTROL_ID as L } from "./controls/spacing/index.js";
|
|
|
16
15
|
import { CARD_BACKGROUND_COLOR_CONTROL_ID as D } from "./controls/cardBackground/index.js";
|
|
17
16
|
import { COMPOSITION_CONTROL_BLOCK_ID as B } from "./controls/cardComposition/index.js";
|
|
18
17
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
19
|
-
class
|
|
18
|
+
class Z extends E {
|
|
20
19
|
registerBlockControls(I) {
|
|
21
20
|
I[U] = [
|
|
22
21
|
new _(
|
|
@@ -195,5 +194,5 @@ class a extends E {
|
|
|
195
194
|
}
|
|
196
195
|
}
|
|
197
196
|
export {
|
|
198
|
-
|
|
197
|
+
Z as SettingsPanel
|
|
199
198
|
};
|
|
@@ -2,7 +2,6 @@ import { getRecommendationFeedSourceMaps as g, getOperatorOptions as R, PriceAtt
|
|
|
2
2
|
import { useRecommendationApi as y } from "../../../../services/recommendationApi.js";
|
|
3
3
|
import { useConfigStore as G } from "../../../../stores/config.js";
|
|
4
4
|
import { defineStore as P } from "pinia";
|
|
5
|
-
import "../constants/selectors.js";
|
|
6
5
|
import { DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
|
|
7
6
|
import { EXCLUDED_ALGORITHM_IDS as D } from "../constants/defaultConfig.js";
|
|
8
7
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
@@ -60,7 +59,7 @@ const x = () => ({
|
|
|
60
59
|
blockStates: {},
|
|
61
60
|
currentRecommendationId: null,
|
|
62
61
|
configVersion: 0
|
|
63
|
-
}),
|
|
62
|
+
}), T = P("guidoRecommendationExtension", {
|
|
64
63
|
state: () => x(),
|
|
65
64
|
getters: {
|
|
66
65
|
// ====================================================================
|
|
@@ -476,5 +475,5 @@ const x = () => ({
|
|
|
476
475
|
}
|
|
477
476
|
});
|
|
478
477
|
export {
|
|
479
|
-
|
|
478
|
+
T as useRecommendationExtensionStore
|
|
480
479
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "../../constants/selectors.js";
|
|
2
1
|
import { DEFAULT_PRODUCTS_PER_ROW as L } from "../../constants/layout.js";
|
|
3
2
|
import { getDefaultProducts as E, DEFAULTS as I, createBlockTemplate as _, DEFAULT_CARD_COMPOSITION as S, spacer as b, buildElementRenderer as A, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
|
|
4
3
|
import { ATTRIBUTE_CELL_CLASS as w, DEFAULT_CELL_PADDING as D, gridElementRenderer as C } from "./elementRenderer.js";
|
|
@@ -53,12 +52,12 @@ function U(t, e, o, r, n = {}) {
|
|
|
53
52
|
function h(t, e, o, r = {}) {
|
|
54
53
|
return U(t, e, C, o, r);
|
|
55
54
|
}
|
|
56
|
-
function
|
|
55
|
+
function F(t) {
|
|
57
56
|
const e = t ? `ins-recommendation-v3-block-${t}` : void 0, o = _("grid", e), r = E(), n = h(r, L);
|
|
58
57
|
return o.replace("{-{-TITLE-}-}", I.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
|
|
59
58
|
}
|
|
60
59
|
export {
|
|
61
|
-
|
|
60
|
+
F as getDefaultTemplate,
|
|
62
61
|
P as prepareGridAttributeRows,
|
|
63
62
|
U as prepareGridProductRows,
|
|
64
63
|
h as prepareProductRows
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import "../constants/selectors.js";
|
|
2
1
|
import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
|
|
3
2
|
import { prepareProductRows as c } from "./grid/template.js";
|
|
4
|
-
import { prepareProductRows as
|
|
5
|
-
function
|
|
3
|
+
import { prepareProductRows as R } from "./list/template.js";
|
|
4
|
+
function a(o, t, r = {}) {
|
|
6
5
|
if (t === "list")
|
|
7
|
-
return
|
|
6
|
+
return R(o, r.composition, r.filterList);
|
|
8
7
|
const { productsPerRow: e = s, composition: p, filterList: i } = r;
|
|
9
8
|
return c(o, e, p, i);
|
|
10
9
|
}
|
|
11
10
|
export {
|
|
12
|
-
|
|
11
|
+
a as prepareProductRows
|
|
13
12
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var T = Object.defineProperty;
|
|
2
|
+
var p = (o, s, e) => s in o ? T(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e;
|
|
3
|
+
var c = (o, s, e) => p(o, typeof s != "symbol" ? s + "" : s, e);
|
|
4
4
|
import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
|
|
5
|
-
import { Control as
|
|
6
|
-
import { DATA_ATTRIBUTES as
|
|
7
|
-
import { parsePageList as
|
|
8
|
-
const
|
|
5
|
+
import { Control as _, UEAttr as i, UIElementType as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { DATA_ATTRIBUTES as d } from "./utils/constants.js";
|
|
7
|
+
import { parsePageList as h } from "./utils/utils.js";
|
|
8
|
+
const g = "ui-elements-unsubscribe", r = {
|
|
9
9
|
SELECT_BUTTON: "selectTemplateButton",
|
|
10
10
|
PREV_BUTTON: "prevButton",
|
|
11
11
|
NEXT_BUTTON: "nextButton",
|
|
12
12
|
COUNTER_TEXT: "counterText",
|
|
13
13
|
PREVIEW_IMAGE: "previewImage"
|
|
14
14
|
};
|
|
15
|
-
class B extends
|
|
15
|
+
class B extends _ {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
c(this, "currentPreviewIndex", 0);
|
|
19
|
+
c(this, "currentNode");
|
|
20
|
+
c(this, "currentPages");
|
|
21
|
+
c(this, "valueChangeHandlers", []);
|
|
22
|
+
c(this, "lastParsedAttribute");
|
|
23
23
|
}
|
|
24
24
|
getId() {
|
|
25
|
-
return
|
|
25
|
+
return g;
|
|
26
26
|
}
|
|
27
27
|
getTemplate() {
|
|
28
28
|
return `
|
|
@@ -34,8 +34,8 @@ class B extends T {
|
|
|
34
34
|
}
|
|
35
35
|
onTemplateNodeUpdated(e) {
|
|
36
36
|
if (this.currentNode = e, "getAttribute" in this.currentNode) {
|
|
37
|
-
const t = this.currentNode.getAttribute(
|
|
38
|
-
t && (t !== this.lastParsedAttribute && (this.currentPages =
|
|
37
|
+
const t = this.currentNode.getAttribute(d.PAGE_LIST);
|
|
38
|
+
t && (t !== this.lastParsedAttribute && (this.currentPages = h(t), this.lastParsedAttribute = t, this.currentPreviewIndex = 0), this._updateCounter(), this._loadAndUpdatePreview());
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
onRender() {
|
|
@@ -62,11 +62,18 @@ class B extends T {
|
|
|
62
62
|
_onButtonClick() {
|
|
63
63
|
try {
|
|
64
64
|
const e = l();
|
|
65
|
-
e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
|
|
65
|
+
this._reseedSelectionFromBlock(), e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
|
|
66
66
|
} catch (e) {
|
|
67
67
|
console.error("[UnsubscribeControl] Failed to open drawer:", e);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
+
_reseedSelectionFromBlock() {
|
|
71
|
+
const e = l();
|
|
72
|
+
if (e.$reset(), !this.currentNode || !("getAttribute" in this.currentNode))
|
|
73
|
+
return;
|
|
74
|
+
const t = this.currentNode.getAttribute(d.PAGE_TYPE), a = this.currentNode.getAttribute(d.PAGE_LIST);
|
|
75
|
+
!t || !a || (e.setCollectionWithoutAutoSelection(Number(t)), e.loadSelectedTemplates(h(a)));
|
|
76
|
+
}
|
|
70
77
|
_onPrevClick() {
|
|
71
78
|
this.currentPreviewIndex > 0 && (this.currentPreviewIndex--, this._updatePreview(), this._updateCounter());
|
|
72
79
|
}
|
|
@@ -80,21 +87,21 @@ class B extends T {
|
|
|
80
87
|
var e;
|
|
81
88
|
if ((e = this.currentPages) != null && e.length)
|
|
82
89
|
try {
|
|
83
|
-
const t = this.currentPages[this.currentPreviewIndex],
|
|
84
|
-
if (!
|
|
90
|
+
const t = this.currentPages[this.currentPreviewIndex], u = l().getThumbnailByTemplateId(t);
|
|
91
|
+
if (!u) {
|
|
85
92
|
console.warn("[UnsubscribeControl] No thumbnail found for page:", t);
|
|
86
93
|
return;
|
|
87
94
|
}
|
|
88
95
|
this.api.updateValues({
|
|
89
|
-
[r.PREVIEW_IMAGE]:
|
|
96
|
+
[r.PREVIEW_IMAGE]: u
|
|
90
97
|
});
|
|
91
98
|
} catch (t) {
|
|
92
99
|
console.error("[UnsubscribeControl] Failed to update preview:", t);
|
|
93
100
|
}
|
|
94
101
|
}
|
|
95
102
|
_updateCounter() {
|
|
96
|
-
const e = this.currentPreviewIndex + 1, t = this.totalTemplates,
|
|
97
|
-
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled,
|
|
103
|
+
const e = this.currentPreviewIndex + 1, t = this.totalTemplates, a = this.currentPreviewIndex === 0, u = this.currentPreviewIndex >= t - 1;
|
|
104
|
+
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, a), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, u), this.api.setUIEAttribute(
|
|
98
105
|
r.COUNTER_TEXT,
|
|
99
106
|
i.LABEL.text,
|
|
100
107
|
`${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
|
|
@@ -135,14 +142,14 @@ class B extends T {
|
|
|
135
142
|
</${n.LABEL}>
|
|
136
143
|
`;
|
|
137
144
|
}
|
|
138
|
-
_getIconButton(e, t,
|
|
139
|
-
const
|
|
145
|
+
_getIconButton(e, t, a) {
|
|
146
|
+
const u = a ? `${i.BUTTON.disabled}="true"` : "";
|
|
140
147
|
return `
|
|
141
148
|
<${n.BUTTON}
|
|
142
149
|
id="${e}"
|
|
143
150
|
class="flat-inline flat-white"
|
|
144
151
|
${i.BUTTON.name}="${e}"
|
|
145
|
-
${
|
|
152
|
+
${u}
|
|
146
153
|
>
|
|
147
154
|
<${n.ICON}
|
|
148
155
|
src="${t}"
|
|
@@ -165,6 +172,6 @@ class B extends T {
|
|
|
165
172
|
}
|
|
166
173
|
}
|
|
167
174
|
export {
|
|
168
|
-
|
|
175
|
+
g as UNSUBSCRIBE_CONTROL_ID,
|
|
169
176
|
B as UnsubscribeControl
|
|
170
177
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .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-173c3a40]{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-4e2a4adb]{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-b293a2b0]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-b293a2b0]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-b293a2b0]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .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-173c3a40]{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-4e2a4adb]{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-b293a2b0]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-b293a2b0]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-b293a2b0]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-824fa820]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-824fa820]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-824fa820]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-824fa820]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-824fa820]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .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-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{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}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
-
/**
|
|
3
|
-
* Parses a `{{recoId_index_attributeName}}` variable (already stripped of the
|
|
4
|
-
* braces/whitespace) into its recommendation id and attribute name. Returns
|
|
5
|
-
* null for anything that isn't a well-formed recommendation variable.
|
|
6
|
-
*/
|
|
7
|
-
export declare function parseRecommendationVariable(field: string): {
|
|
8
|
-
recoId: string;
|
|
9
|
-
attribute: string;
|
|
10
|
-
} | null;
|
|
11
2
|
export declare const useHtmlValidator: () => {
|
|
12
3
|
validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
|
|
13
4
|
};
|
|
@@ -5,18 +5,3 @@ export declare function extractTitleText(block: Element): string;
|
|
|
5
5
|
* the caller treats that as "no segment background".
|
|
6
6
|
*/
|
|
7
7
|
export declare function extractCardBgColor(block: Element): string;
|
|
8
|
-
/**
|
|
9
|
-
* Reads the legacy block's own `currency-*` attributes into a
|
|
10
|
-
* `currencySettings`-shaped object that `mapCurrency` understands. Used as a
|
|
11
|
-
* fallback when the external recommendationConfigs map has no entry for this
|
|
12
|
-
* block, so the migrated block keeps its real currency instead of defaulting.
|
|
13
|
-
* Returns undefined when the block carries no `currency` attribute.
|
|
14
|
-
*/
|
|
15
|
-
export declare function extractCurrencyFromBlock(block: Element): Record<string, string> | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* A legacy block whose inner markup already carries `{{...}}` template
|
|
18
|
-
* variables was hand-customized by the partner. Detected before rebuild so the
|
|
19
|
-
* migrator can preserve the content (and tag the block `ins-skip-compile`)
|
|
20
|
-
* instead of regenerating it and wiping the partner's variables.
|
|
21
|
-
*/
|
|
22
|
-
export declare function isCustomizedBlock(block: Element): boolean;
|
|
@@ -8,12 +8,4 @@ export declare function buildBlockHtml(params: {
|
|
|
8
8
|
extraClasses?: string;
|
|
9
9
|
legacyId?: string;
|
|
10
10
|
legacyBgColor?: string;
|
|
11
|
-
/**
|
|
12
|
-
* When set, the block's existing inner HTML is preserved verbatim instead
|
|
13
|
-
* of regenerating product rows — used for partner-customized blocks so
|
|
14
|
-
* their hand-authored `{{...}}` variables survive migration.
|
|
15
|
-
*/
|
|
16
|
-
preserveInnerHtml?: string;
|
|
17
|
-
/** Adds the `ins-skip-compile` opt-out class to the migrated block. */
|
|
18
|
-
skipCompile?: boolean;
|
|
19
11
|
}): string;
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { RecommendationBlockId } from './blockIds';
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
|
-
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON,
|
|
11
|
+
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
12
12
|
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
13
|
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -23,18 +23,6 @@ export declare const MOBILE_ROW_SELECTOR = ".ins-recommendation-mobile-row";
|
|
|
23
23
|
* `{{cId_pIdx_url}}` template variable.
|
|
24
24
|
*/
|
|
25
25
|
export declare const CSS_CLASS_RECO_BUTTON = "reco-v3-button";
|
|
26
|
-
/**
|
|
27
|
-
* Opt-out class for partners who want to inject their own template variables
|
|
28
|
-
* into a recommendation block. When present on `.recommendation-block-v2`,
|
|
29
|
-
* Guido skips ONLY its product-data → template-variable substitution
|
|
30
|
-
* (`replaceProductAttributes`) for that block — partners author their own
|
|
31
|
-
* `{{recoId_index_attribute}}` variables. Everything else (campaign URL
|
|
32
|
-
* building, hidden-row removal, Outlook image widths, text-trim CSS, discount
|
|
33
|
-
* conditions, store hydration, store-level config validation, and general HTML
|
|
34
|
-
* optimizations) still applies. The class is preserved in the final compiled
|
|
35
|
-
* output so partners may use it for their own styling.
|
|
36
|
-
*/
|
|
37
|
-
export declare const CSS_CLASS_SKIP_COMPILE = "ins-skip-compile";
|
|
38
26
|
/**
|
|
39
27
|
* Currency HTML attributes set on the block element
|
|
40
28
|
* These are read by the HTML compiler at runtime to format prices
|
|
@@ -73,12 +61,3 @@ export declare const ATTR_PRODUCT_ATTR = "product-attr";
|
|
|
73
61
|
* Used to exclude these from the custom attribute dropdown to prevent duplication with toggles.
|
|
74
62
|
*/
|
|
75
63
|
export declare const BUILT_IN_DEFAULT_ATTRIBUTES: Set<string>;
|
|
76
|
-
/**
|
|
77
|
-
* Attribute names valid inside a `{{recoId_index_attributeName}}` template
|
|
78
|
-
* variable regardless of the account's custom attribute list. Every built-in
|
|
79
|
-
* composition attribute is valid, plus `currency` and `discount` which the
|
|
80
|
-
* compiler emits but are not composition toggles. Custom attributes are
|
|
81
|
-
* validated separately against the account's fetched attribute list
|
|
82
|
-
* (`stripo/email-recommendation-attributes`).
|
|
83
|
-
*/
|
|
84
|
-
export declare const RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES: Set<string>;
|
|
@@ -17,13 +17,6 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
17
17
|
getId(): string;
|
|
18
18
|
getTemplate(): string;
|
|
19
19
|
onRender(): void;
|
|
20
|
-
/**
|
|
21
|
-
* Card composition restructures the block (toggles/reorders/adds attribute
|
|
22
|
-
* cells), which would corrupt a partner-managed (`ins-skip-compile`) block's
|
|
23
|
-
* preserved markup. There is no native tab-disable API, so the whole control
|
|
24
|
-
* container is rendered inert (greyed + non-interactive) instead.
|
|
25
|
-
*/
|
|
26
|
-
_syncDisabledState(): void;
|
|
27
20
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
28
21
|
onDestroy(): void;
|
|
29
22
|
private _initializeComposition;
|
|
@@ -21,11 +21,6 @@ export declare class LayoutOrientationControl extends CommonControl {
|
|
|
21
21
|
getTemplate(): string;
|
|
22
22
|
onRender(): void;
|
|
23
23
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
24
|
-
/**
|
|
25
|
-
* Layout orientation restructures the whole block, which is meaningless for
|
|
26
|
-
* partner-managed (`ins-skip-compile`) blocks — disable the control there.
|
|
27
|
-
*/
|
|
28
|
-
_syncDisabledState(): void;
|
|
29
24
|
_setFormValues(): void;
|
|
30
25
|
/**
|
|
31
26
|
* Handles layout change
|
|
@@ -30,12 +30,6 @@ export declare class ProductLayoutControl extends CommonControl {
|
|
|
30
30
|
getTemplate(): string;
|
|
31
31
|
onRender(): void;
|
|
32
32
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
33
|
-
/**
|
|
34
|
-
* Products-per-row and mobile-layout restructure the block, which is
|
|
35
|
-
* meaningless for partner-managed (`ins-skip-compile`) blocks — disable
|
|
36
|
-
* these inputs there. Disabling coexists with the visibility logic above.
|
|
37
|
-
*/
|
|
38
|
-
_syncDisabledState(): void;
|
|
39
33
|
onDestroy(): void;
|
|
40
34
|
_setFormValues(): void;
|
|
41
35
|
/**
|
|
@@ -35,15 +35,6 @@ interface DocumentModifier {
|
|
|
35
35
|
* @returns The block element or null if not found
|
|
36
36
|
*/
|
|
37
37
|
export declare function getBlockElement(currentNode: ImmutableHtmlNode | null | undefined): ImmutableHtmlNode | null;
|
|
38
|
-
/**
|
|
39
|
-
* True when the recommendation block has opted out of Guido's content
|
|
40
|
-
* regeneration via the `ins-skip-compile` class. Partner-managed blocks carry
|
|
41
|
-
* hand-authored `{{...}}` variables in their cells, so Guido must never
|
|
42
|
-
* overwrite their content with product data (regenerate / in-place update).
|
|
43
|
-
* @param currentNode - The current template node
|
|
44
|
-
* @returns True if the block opted out of content regeneration
|
|
45
|
-
*/
|
|
46
|
-
export declare function isPartnerManagedBlock(currentNode: ImmutableHtmlNode | null | undefined): boolean;
|
|
47
38
|
/**
|
|
48
39
|
* Gets the current layout orientation from the block's data attribute
|
|
49
40
|
* Supports both old (horizontal/vertical) and new (list/grid) values for backward compatibility
|
|
@@ -15,6 +15,7 @@ export declare class UnsubscribeControl extends Control {
|
|
|
15
15
|
private get totalTemplates();
|
|
16
16
|
private _listenToFormUpdates;
|
|
17
17
|
private _onButtonClick;
|
|
18
|
+
private _reseedSelectionFromBlock;
|
|
18
19
|
private _onPrevClick;
|
|
19
20
|
private _onNextClick;
|
|
20
21
|
private _loadAndUpdatePreview;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.6.0-beta.
|
|
3
|
+
"version": "3.6.0-beta.d0bfe20",
|
|
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,15 +0,0 @@
|
|
|
1
|
-
import { CSS_CLASS_SKIP_COMPILE as n, BLOCK_ROOT_SELECTOR as i } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
2
|
-
function m(o) {
|
|
3
|
-
return o.classList.contains(n);
|
|
4
|
-
}
|
|
5
|
-
function a(o) {
|
|
6
|
-
const r = new DOMParser().parseFromString(o, "text/html").querySelectorAll(`${i}.${n}`), t = /* @__PURE__ */ new Set();
|
|
7
|
-
return r.forEach((c) => {
|
|
8
|
-
const e = c.getAttribute("recommendation-id");
|
|
9
|
-
e && t.add(e);
|
|
10
|
-
}), t;
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
a as getIgnoredRecommendationBlockIds,
|
|
14
|
-
m as isIgnoredRecommendationBlock
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns true when a recommendation block has opted out of Guido's
|
|
3
|
-
* product-data → template-variable substitution. Partners signal opt-out by
|
|
4
|
-
* adding the `ins-skip-compile` class on the `.recommendation-block-v2`
|
|
5
|
-
* element. Only the variable substitution is skipped — campaign URL building,
|
|
6
|
-
* hidden-row removal, Outlook image widths, discount conditions, text-trim CSS
|
|
7
|
-
* and general HTML optimizations still apply. See `CSS_CLASS_SKIP_COMPILE` for
|
|
8
|
-
* the full scope.
|
|
9
|
-
*/
|
|
10
|
-
export declare function isIgnoredRecommendationBlock(block: Element): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* DOM-parses the HTML once and returns the set of `recommendation-id`
|
|
13
|
-
* values that belong to ignored blocks. Use this in regex/string-based
|
|
14
|
-
* compiler rules where the rule processes flat matches and only has the
|
|
15
|
-
* extracted block ID rather than a DOM Element reference.
|
|
16
|
-
*/
|
|
17
|
-
export declare function getIgnoredRecommendationBlockIds(html: string): Set<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|