@useinsider/guido 3.1.1 → 3.2.0-beta.22a0c4c
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 +1 -0
- package/dist/@types/config/schemas.js +66 -54
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +91 -81
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -36
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +16 -13
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -17
- package/dist/composables/useHtmlCompiler.js +23 -21
- package/dist/composables/useHtmlValidator.js +40 -38
- package/dist/composables/usePreviewMode.js +20 -16
- package/dist/composables/useSave.js +23 -15
- package/dist/composables/useStripo.js +44 -41
- package/dist/composables/validators/useLiquidValidator.js +42 -0
- package/dist/config/compiler/liquidCompilerRules.js +15 -0
- package/dist/config/compiler/recommendationCompilerRules.js +158 -44
- package/dist/config/compiler/unsubscribeCompilerRules.js +37 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +52 -46
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/config/migrator/checkboxMigrator.js +5 -3
- package/dist/config/migrator/radioButtonMigrator.js +14 -12
- package/dist/config/migrator/recommendationMigrator.js +1 -1
- package/dist/enums/extensions/recommendationBlock.js +14 -11
- package/dist/enums/recommendation.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +6 -6
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +95 -93
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +75 -73
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +29 -25
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
- package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +15 -15
- package/dist/services/stripoApi.js +9 -9
- package/dist/services/templateLibraryApi.js +48 -46
- package/dist/src/@types/config/index.d.ts +1 -1
- package/dist/src/@types/config/schemas.d.ts +28 -0
- package/dist/src/@types/config/types.d.ts +3 -1
- package/dist/src/@types/generic.d.ts +0 -1
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/composables/useConfig.d.ts +12 -0
- package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/services/templateLibraryApi.d.ts +1 -1
- package/dist/src/stores/config.d.ts +108 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/src/utils/htmlCompiler.d.ts +2 -1
- package/dist/static/styles/base.css.js +7 -2
- package/dist/stores/preview.js +4 -3
- package/dist/utils/genericUtil.js +42 -20
- package/dist/utils/htmlCompiler.js +48 -41
- package/dist/utils/templatePreparation.js +36 -25
- package/dist/utils/tooltipUtils.js +4 -5
- package/package.json +2 -2
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
2
|
var g = (o, s, t) => s in o ? c(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
3
|
var r = (o, s, t) => g(o, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { useConfig as d } from "../../composables/useConfig.js";
|
|
5
|
+
import { mergeTagToDynamicContent as m, dynamicContentToMergeTags as u } from "../../utils/genericUtil.js";
|
|
6
|
+
import { UIElement as h, UIElementType as a, UEAttr as T, UIElementTagRegistry as y } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { ExternalMergeTagsLibrary as C } from "./dynamic-content-modal.js";
|
|
8
|
+
const l = "external-dynamic-content-ui-element", L = "button-add-dynamic-content";
|
|
9
|
+
class w extends y {
|
|
9
10
|
registerUiElements(s) {
|
|
10
11
|
s[a.MERGETAGS] = l;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
class
|
|
14
|
+
class f extends h {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
r(this, "mergeTagsButton", null);
|
|
@@ -43,7 +44,7 @@ class b extends u {
|
|
|
43
44
|
onAttributeUpdated(t, e) {
|
|
44
45
|
if (t !== "mergeTag" || !(e != null && e.value))
|
|
45
46
|
return;
|
|
46
|
-
const n =
|
|
47
|
+
const n = m(e), i = this._getLastClickedPosition();
|
|
47
48
|
this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(n, i);
|
|
48
49
|
}
|
|
49
50
|
openMergeTagLibrary() {
|
|
@@ -55,10 +56,14 @@ class b extends u {
|
|
|
55
56
|
* Dispatches event with dynamic content data and position
|
|
56
57
|
*/
|
|
57
58
|
_openDynamicContentLibrary(t, e) {
|
|
58
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
59
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new C()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
59
60
|
t,
|
|
60
61
|
(n) => {
|
|
61
|
-
n.text && n.value
|
|
62
|
+
if (n.text && n.value) {
|
|
63
|
+
const { isFeatureEnabled: i } = d();
|
|
64
|
+
this.api.triggerValueChange(u([n], i("liquidSyntax"))[0]);
|
|
65
|
+
} else
|
|
66
|
+
this.api.triggerValueChange(null);
|
|
62
67
|
},
|
|
63
68
|
e
|
|
64
69
|
);
|
|
@@ -142,7 +147,7 @@ class b extends u {
|
|
|
142
147
|
<${a.BUTTON}
|
|
143
148
|
id="guido__btn-add-dynamic-content"
|
|
144
149
|
class="btn btn-primary"
|
|
145
|
-
${
|
|
150
|
+
${T.BUTTON.name}="${L}">
|
|
146
151
|
<${a.ICON} src="plus" class="icon icon-button color-primary">
|
|
147
152
|
</${a.ICON}>
|
|
148
153
|
${this.api.translate("Add Dynamic Content")}
|
|
@@ -151,6 +156,6 @@ class b extends u {
|
|
|
151
156
|
}
|
|
152
157
|
}
|
|
153
158
|
export {
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
w as DynamicContentTagRegistry,
|
|
160
|
+
f as DynamicContentUiElementExtension
|
|
156
161
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-3b53a736],.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-
|
|
1
|
+
.gap-16[data-v-3b53a736],.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}.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-25780af6]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-25780af6]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-25780af6]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-df672485]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-df672485]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-df672485]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-df672485]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-df672485]{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-29b9af29] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-d073b1dc] .vueperslides__bullets{pointer-events:none!important}[data-v-d073b1dc] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { URLS as
|
|
3
|
-
const
|
|
4
|
-
const { get:
|
|
1
|
+
import { useHttp as a } from "../composables/useHttp.js";
|
|
2
|
+
import { QUERY_PARAMS as d, URLS as h } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const y = () => {
|
|
4
|
+
const { get: r } = a(), { get: s } = a({ headers: {} }), m = "6KcLM9TwheVB1mgK";
|
|
5
5
|
return {
|
|
6
6
|
fetchRecommendationCreateData: async () => {
|
|
7
7
|
try {
|
|
8
|
-
return (await
|
|
8
|
+
return (await r("/newsletter/recommendations/create-data")).data;
|
|
9
9
|
} catch (e) {
|
|
10
10
|
throw console.error("fetchUserModalState error:", e), e;
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
fetchRecommendationFilters: async () => {
|
|
14
14
|
try {
|
|
15
|
-
const { data: e } = await
|
|
15
|
+
const { data: e } = await r("/stripo/email-recommendation-attributes");
|
|
16
16
|
return e;
|
|
17
17
|
} catch (e) {
|
|
18
18
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
fetchRecommendationProducts: async (e,
|
|
21
|
+
fetchRecommendationProducts: async (e, i) => {
|
|
22
22
|
var n;
|
|
23
23
|
try {
|
|
24
|
-
const t =
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`${
|
|
24
|
+
const t = new URLSearchParams(Object.entries(i));
|
|
25
|
+
t.set(d.CLIENT_ID, m);
|
|
26
|
+
const c = decodeURIComponent(t.toString());
|
|
27
|
+
console.debug("🏁 Recommendation API Query:", c);
|
|
28
|
+
const o = await s(
|
|
29
|
+
`${h.RECOMMENDATION_API_URL}/v2/${e}?${c}`
|
|
30
30
|
);
|
|
31
|
-
return ((n =
|
|
31
|
+
return ((n = o == null ? void 0 : o.data) == null ? void 0 : n.data) ?? [];
|
|
32
32
|
} catch (t) {
|
|
33
33
|
throw console.error("fetchRecommendationProducts error:", t), t;
|
|
34
34
|
}
|
|
@@ -36,5 +36,5 @@ const f = () => {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
y as useRecommendationApi
|
|
40
40
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useHttp as d } from "../composables/useHttp.js";
|
|
2
2
|
import { useToaster as m } from "../composables/useToaster.js";
|
|
3
3
|
import { MAX_DEFAULT_TEMPLATE_ID as y } from "../enums/defaults.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import f from "../static/templates/empty/index.html.js";
|
|
5
|
+
import g from "../static/templates/empty/style.css.js";
|
|
6
6
|
const E = () => {
|
|
7
7
|
const { get: s, post: c } = d(), { handleError: r } = m();
|
|
8
8
|
return {
|
|
9
9
|
getToken: async () => {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
return
|
|
11
|
+
const { data: t } = await s("/stripo/get-user-token");
|
|
12
|
+
return t.body.token;
|
|
13
13
|
} catch (t) {
|
|
14
14
|
return r(t, "Failed to fetch token"), "";
|
|
15
15
|
}
|
|
@@ -27,14 +27,14 @@ const E = () => {
|
|
|
27
27
|
},
|
|
28
28
|
getDefaultTemplate: async () => {
|
|
29
29
|
const t = {
|
|
30
|
-
html:
|
|
31
|
-
css:
|
|
30
|
+
html: f,
|
|
31
|
+
css: g
|
|
32
32
|
};
|
|
33
33
|
try {
|
|
34
|
-
const e = new URLSearchParams(window.location.search), u = e.get("default-template"),
|
|
35
|
-
if (!i && !
|
|
34
|
+
const e = new URLSearchParams(window.location.search), u = e.get("default-template"), p = e.get("master"), a = u ? parseInt(u) : 0, i = a >= 1 && a <= y ? a : 0;
|
|
35
|
+
if (!i && !p)
|
|
36
36
|
return t;
|
|
37
|
-
const
|
|
37
|
+
const l = `/stripo/default-template/${i}`, { data: n } = await s(l), o = typeof n == "string" ? JSON.parse(n) : n;
|
|
38
38
|
return !o || typeof o != "object" || !("html" in o) || !("css" in o) ? t : o;
|
|
39
39
|
} catch (e) {
|
|
40
40
|
return r(e, "Failed to fetch default template"), t;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useHttp as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { useConfig as w } from "../composables/useConfig.js";
|
|
2
|
+
import { useHttp as b } from "../composables/useHttp.js";
|
|
3
|
+
import { useToaster as h } from "../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as C } from "../composables/useTranslations.js";
|
|
5
|
+
import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
|
|
6
|
+
import { EditorType as v } from "../enums/defaults.js";
|
|
7
|
+
import { useRecommendationExtensionStore as N } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
8
|
+
import { useSaveAsTemplateStore as x } from "../stores/save-as-template.js";
|
|
9
|
+
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
10
|
+
import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
|
|
11
|
+
const $ = () => {
|
|
12
|
+
const { get: n, post: m } = b(), { handleError: o, showToaster: l } = h(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = C();
|
|
12
13
|
return {
|
|
13
14
|
getCategories: async () => {
|
|
14
15
|
try {
|
|
@@ -26,7 +27,7 @@ const R = () => {
|
|
|
26
27
|
},
|
|
27
28
|
createCategory: async (e) => {
|
|
28
29
|
try {
|
|
29
|
-
const { data: { id: t } } = await
|
|
30
|
+
const { data: { id: t } } = await m(
|
|
30
31
|
"/newsletter/template-library/create-category",
|
|
31
32
|
{ name: e }
|
|
32
33
|
);
|
|
@@ -36,55 +37,56 @@ const R = () => {
|
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
createTemplate: async () => {
|
|
39
|
-
var e, t,
|
|
40
|
+
var e, t, d, y;
|
|
40
41
|
try {
|
|
41
|
-
const { prepareTemplateDetails:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
const { prepareTemplateDetails: i } = A(), s = x(), a = await i();
|
|
43
|
+
if (p("liquidSyntax") && !await g(a.compiledHtml))
|
|
44
|
+
return !1;
|
|
45
|
+
const f = {
|
|
46
|
+
name: s.getTemplateName,
|
|
47
|
+
categories: s.getSelectedCategoryIds,
|
|
48
|
+
productId: ((t = (e = c.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
49
|
+
editorType: v,
|
|
50
|
+
messageType: ((y = (d = c.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
|
|
51
|
+
content: r(a.compiledHtml),
|
|
52
|
+
css: r(a.css),
|
|
49
53
|
unsubscriptionPreferencePageStatus: !1,
|
|
50
54
|
unsubscriptionPreferencePages: [],
|
|
51
|
-
recommendationCampaignUrls:
|
|
52
|
-
|
|
55
|
+
recommendationCampaignUrls: r(
|
|
56
|
+
N().recommendationCampaignUrls
|
|
53
57
|
),
|
|
54
|
-
recommendationConfigs:
|
|
58
|
+
recommendationConfigs: r({}),
|
|
55
59
|
isGuido: !0,
|
|
56
|
-
|
|
60
|
+
// eslint-disable-next-line camelcase
|
|
61
|
+
template_engine: p("liquidSyntax") ? 1 : 0,
|
|
62
|
+
stripoConfig: r({
|
|
57
63
|
editor: "stripo",
|
|
58
|
-
html:
|
|
59
|
-
css:
|
|
64
|
+
html: a.rawHtml,
|
|
65
|
+
css: a.css
|
|
60
66
|
})
|
|
61
|
-
}, { data: { type:
|
|
67
|
+
}, { data: { type: T } } = await m(
|
|
62
68
|
"/newsletter/template-library/create-template",
|
|
63
|
-
|
|
69
|
+
f
|
|
64
70
|
);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
i({
|
|
76
|
-
message: p(
|
|
71
|
+
return T === "alert" ? (l({
|
|
72
|
+
message: u(
|
|
73
|
+
"newsletter.template-library-save-alert",
|
|
74
|
+
{ templateName: s.getTemplateName }
|
|
75
|
+
),
|
|
76
|
+
type: "alert"
|
|
77
|
+
}), !1) : (l({
|
|
78
|
+
message: u(
|
|
77
79
|
"newsletter.template-library-save-success",
|
|
78
|
-
{ templateName:
|
|
80
|
+
{ templateName: s.getTemplateName }
|
|
79
81
|
),
|
|
80
82
|
type: "success"
|
|
81
|
-
});
|
|
82
|
-
} catch (
|
|
83
|
-
o(
|
|
83
|
+
}), !0);
|
|
84
|
+
} catch (i) {
|
|
85
|
+
return o(i, "Failed to create template"), !1;
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
};
|
|
87
89
|
};
|
|
88
90
|
export {
|
|
89
|
-
|
|
91
|
+
$ as useTemplateLibraryApi
|
|
90
92
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Validation utilities
|
|
9
9
|
*/
|
|
10
10
|
export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, CompilerRuleSchema, CompilerRuleTypeSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, } from './schemas';
|
|
11
|
-
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput, CallbacksConfig, CallbacksConfigInput, ExternalValidationHandler, EmailHeader, DynamicContent, DefaultBlockType, CustomBlockType, BlockType, FeatureName, CompilerRule, ReplaceRule, RegexRule, RemoveRule, CustomRule, DeepPartial, ConfigOverrides, } from './types';
|
|
11
|
+
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, FallbackFont, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput, CallbacksConfig, CallbacksConfigInput, ExternalValidationHandler, EmailHeader, DynamicContent, DefaultBlockType, CustomBlockType, BlockType, FeatureName, CompilerRule, ReplaceRule, RegexRule, RemoveRule, CustomRule, DeepPartial, ConfigOverrides, } from './types';
|
|
12
12
|
export { DEFAULT_EMAIL_HEADER, DEFAULT_TEMPLATE, DEFAULT_EDITOR, DEFAULT_UI, DEFAULT_FEATURES, DEFAULT_BLOCKS, DEFAULT_COMPILER, DEFAULT_PRODUCT_TYPE, DEFAULT_MESSAGE_TYPE, DEFAULT_USERNAME, EDITOR_TYPE, TEST_PARTNERS, isTestPartner, } from './defaults';
|
|
13
13
|
export { validateConfig, parseConfig, parseConfigSafe, getValidationErrors, isValidConfig, validateIdentity, validatePartner, } from './validator';
|
|
14
14
|
export type { ValidationResult, ValidationError, } from './validator';
|
|
@@ -47,6 +47,12 @@ export declare const IdentitySchema: v.ObjectSchema<{
|
|
|
47
47
|
/**
|
|
48
48
|
* Partner configuration - organization and product context
|
|
49
49
|
*/
|
|
50
|
+
export declare const FallbackFontSchema: v.ObjectSchema<{
|
|
51
|
+
/** Fallback font name (e.g., "Georgia") */
|
|
52
|
+
readonly name: v.StringSchema<undefined>;
|
|
53
|
+
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
54
|
+
readonly family: v.StringSchema<undefined>;
|
|
55
|
+
}, undefined>;
|
|
50
56
|
export declare const PartnerSchema: v.ObjectSchema<{
|
|
51
57
|
/** Partner/organization name (required) */
|
|
52
58
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "partner.name is required">]>;
|
|
@@ -56,6 +62,13 @@ export declare const PartnerSchema: v.ObjectSchema<{
|
|
|
56
62
|
readonly messageType: v.OptionalSchema<v.PicklistSchema<[1, 2], undefined>, 1>;
|
|
57
63
|
/** Display name for the current user */
|
|
58
64
|
readonly username: v.OptionalSchema<v.StringSchema<undefined>, "Guido User">;
|
|
65
|
+
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
66
|
+
readonly fallbackFont: v.OptionalSchema<v.ObjectSchema<{
|
|
67
|
+
/** Fallback font name (e.g., "Georgia") */
|
|
68
|
+
readonly name: v.StringSchema<undefined>;
|
|
69
|
+
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
70
|
+
readonly family: v.StringSchema<undefined>;
|
|
71
|
+
}, undefined>, undefined>;
|
|
59
72
|
}, undefined>;
|
|
60
73
|
/**
|
|
61
74
|
* Dynamic content item schema
|
|
@@ -95,6 +108,8 @@ export declare const TemplateSchema: v.ObjectSchema<{
|
|
|
95
108
|
readonly value: v.StringSchema<undefined>;
|
|
96
109
|
}, undefined>, undefined>;
|
|
97
110
|
}, undefined>, undefined>, readonly []>;
|
|
111
|
+
/** Valid custom field attribute names from the partner's categorized fields */
|
|
112
|
+
readonly customFieldAttributes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
98
113
|
/** Selected unsubscribe page IDs */
|
|
99
114
|
readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
|
|
100
115
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
@@ -161,6 +176,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
161
176
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
162
177
|
/** Disable modules panel in the editor */
|
|
163
178
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
179
|
+
/** Enable Liquid template syntax */
|
|
180
|
+
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
164
181
|
}, undefined>;
|
|
165
182
|
/**
|
|
166
183
|
* Default block types available in Stripo
|
|
@@ -401,6 +418,13 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
401
418
|
readonly messageType: v.OptionalSchema<v.PicklistSchema<[1, 2], undefined>, 1>;
|
|
402
419
|
/** Display name for the current user */
|
|
403
420
|
readonly username: v.OptionalSchema<v.StringSchema<undefined>, "Guido User">;
|
|
421
|
+
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
422
|
+
readonly fallbackFont: v.OptionalSchema<v.ObjectSchema<{
|
|
423
|
+
/** Fallback font name (e.g., "Georgia") */
|
|
424
|
+
readonly name: v.StringSchema<undefined>;
|
|
425
|
+
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
426
|
+
readonly family: v.StringSchema<undefined>;
|
|
427
|
+
}, undefined>, undefined>;
|
|
404
428
|
}, undefined>;
|
|
405
429
|
/** Template content and presets */
|
|
406
430
|
readonly template: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -422,6 +446,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
422
446
|
readonly value: v.StringSchema<undefined>;
|
|
423
447
|
}, undefined>, undefined>;
|
|
424
448
|
}, undefined>, undefined>, readonly []>;
|
|
449
|
+
/** Valid custom field attribute names from the partner's categorized fields */
|
|
450
|
+
readonly customFieldAttributes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
425
451
|
/** Selected unsubscribe page IDs */
|
|
426
452
|
readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
|
|
427
453
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
@@ -473,6 +499,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
473
499
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
474
500
|
/** Disable modules panel in the editor */
|
|
475
501
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
502
|
+
/** Enable Liquid template syntax */
|
|
503
|
+
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
476
504
|
}, undefined>, {}>;
|
|
477
505
|
/** Block configuration */
|
|
478
506
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* This ensures type definitions are always in sync with validation.
|
|
6
6
|
* @module @types/config/types
|
|
7
7
|
*/
|
|
8
|
-
import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, ExternalValidationHandler } from './schemas';
|
|
8
|
+
import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, FallbackFontSchema, ExternalValidationHandler } from './schemas';
|
|
9
9
|
import type * as v from 'valibot';
|
|
10
10
|
/**
|
|
11
11
|
* Complete validated Guido configuration.
|
|
@@ -29,6 +29,8 @@ export type GuidoConfig = v.InferOutput<typeof GuidoConfigSchema>;
|
|
|
29
29
|
export type IdentityConfig = v.InferOutput<typeof IdentitySchema>;
|
|
30
30
|
/** Partner configuration (name, productType, messageType, username) */
|
|
31
31
|
export type PartnerConfig = v.InferOutput<typeof PartnerSchema>;
|
|
32
|
+
/** Fallback font settings for backend size calculation alignment */
|
|
33
|
+
export type FallbackFont = v.InferOutput<typeof FallbackFontSchema>;
|
|
32
34
|
/** Template configuration (html, css, dynamic content, unsubscribe pages) */
|
|
33
35
|
export type TemplateConfig = v.InferOutput<typeof TemplateSchema>;
|
|
34
36
|
/** Editor configuration (locale, translations, migration date, email header) */
|
|
@@ -17,6 +17,10 @@ export declare const useConfig: () => {
|
|
|
17
17
|
productType: 60 | 49 | 97;
|
|
18
18
|
messageType: 1 | 2;
|
|
19
19
|
username: string;
|
|
20
|
+
fallbackFont?: {
|
|
21
|
+
name: string;
|
|
22
|
+
family: string;
|
|
23
|
+
} | undefined;
|
|
20
24
|
};
|
|
21
25
|
template: {
|
|
22
26
|
html: string;
|
|
@@ -30,6 +34,7 @@ export declare const useConfig: () => {
|
|
|
30
34
|
value: string;
|
|
31
35
|
} | undefined;
|
|
32
36
|
}[];
|
|
37
|
+
customFieldAttributes: string[];
|
|
33
38
|
selectedUnsubscribePages: number[];
|
|
34
39
|
forceRecreate: boolean;
|
|
35
40
|
};
|
|
@@ -56,6 +61,7 @@ export declare const useConfig: () => {
|
|
|
56
61
|
displayConditions: boolean;
|
|
57
62
|
unsubscribe: boolean;
|
|
58
63
|
modulesDisabled: boolean;
|
|
64
|
+
liquidSyntax: boolean;
|
|
59
65
|
};
|
|
60
66
|
blocks: {
|
|
61
67
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -108,6 +114,10 @@ export declare const useConfig: () => {
|
|
|
108
114
|
productType: 60 | 49 | 97;
|
|
109
115
|
messageType: 1 | 2;
|
|
110
116
|
username: string;
|
|
117
|
+
fallbackFont?: {
|
|
118
|
+
name: string;
|
|
119
|
+
family: string;
|
|
120
|
+
} | undefined;
|
|
111
121
|
} | null>;
|
|
112
122
|
template: import("vue").ComputedRef<{
|
|
113
123
|
html: string;
|
|
@@ -121,6 +131,7 @@ export declare const useConfig: () => {
|
|
|
121
131
|
value: string;
|
|
122
132
|
} | undefined;
|
|
123
133
|
}[];
|
|
134
|
+
customFieldAttributes: string[];
|
|
124
135
|
selectedUnsubscribePages: number[];
|
|
125
136
|
forceRecreate: boolean;
|
|
126
137
|
} | null>;
|
|
@@ -147,6 +158,7 @@ export declare const useConfig: () => {
|
|
|
147
158
|
displayConditions: boolean;
|
|
148
159
|
unsubscribe: boolean;
|
|
149
160
|
modulesDisabled: boolean;
|
|
161
|
+
liquidSyntax: boolean;
|
|
150
162
|
} | null>;
|
|
151
163
|
blocks: import("vue").ComputedRef<{
|
|
152
164
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param alignment - Currency alignment from block config: 'before' or 'after'
|
|
7
7
|
* @returns Formatted price string with currency variable in correct position
|
|
8
8
|
*/
|
|
9
|
-
export declare function formatPriceVariable(campaignId: string, productIndex: number, attribute: string, alignment: string): string;
|
|
9
|
+
export declare function formatPriceVariable(campaignId: string, productIndex: number, attribute: string, alignment: string, prefix?: string): string;
|
|
10
10
|
/**
|
|
11
11
|
* Transforms recommendation block HTML by replacing product data with
|
|
12
12
|
* template variables.
|
|
@@ -3,6 +3,9 @@ import type { RecommendationFeedItem } from '@@/Types/recommendation';
|
|
|
3
3
|
export declare const URLS: {
|
|
4
4
|
RECOMMENDATION_API_URL: string;
|
|
5
5
|
};
|
|
6
|
+
export declare const QUERY_PARAMS: {
|
|
7
|
+
CLIENT_ID: string;
|
|
8
|
+
};
|
|
6
9
|
export declare const RecommendationFeedSourceMaps: RecommendationFeedItem[];
|
|
7
10
|
export declare const PriceAttributes: string[];
|
|
8
11
|
export declare const currencyLocationMaps: TextValueObject[];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export declare const COUPON_PLACEHOLDER_DEFAULT = "{@COUPON_CODE}";
|
|
2
|
+
export declare const COUPON_PLACEHOLDER_LIQUID = "{{ins_coupon_code}}";
|
|
1
3
|
declare const migrationTemplate = "\n <td\n class=\"coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block\"\n esd-extension-block-id=\"coupon-block\"\n >\n <p class=\"ins-title\" contenteditable=\"false\">{@COUPON_CODE}</p>\n </td>\n";
|
|
2
4
|
export declare function getDefaultTemplate(): string;
|
|
3
5
|
export default migrationTemplate;
|
|
@@ -63,5 +63,6 @@ export declare enum RecommendationControlId {
|
|
|
63
63
|
CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control",
|
|
64
64
|
CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control",
|
|
65
65
|
CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control",
|
|
66
|
+
CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control",
|
|
66
67
|
SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message"
|
|
67
68
|
}
|
|
@@ -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, 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, } from './selectors';
|
|
11
|
+
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, 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';
|
|
@@ -50,3 +50,8 @@ export declare const ATTR_CUSTOM_PREFIX = "customAttr:";
|
|
|
50
50
|
export declare const ATTR_DATA_CUSTOM_ATTRIBUTES = "data-custom-attributes";
|
|
51
51
|
/** HTML attribute on <td> elements identifying the product attribute for compiler template variable generation */
|
|
52
52
|
export declare const ATTR_PRODUCT_ATTR = "product-attr";
|
|
53
|
+
/**
|
|
54
|
+
* Default attribute names that are already represented by built-in composition toggle items.
|
|
55
|
+
* Used to exclude these from the custom attribute dropdown to prevent duplication with toggles.
|
|
56
|
+
*/
|
|
57
|
+
export declare const BUILT_IN_DEFAULT_ATTRIBUTES: Set<string>;
|
|
@@ -170,6 +170,11 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
170
170
|
* When filterList changes (e.g. after async fetch), re-renders dropdowns with new options.
|
|
171
171
|
*/
|
|
172
172
|
private _subscribeToStoreChanges;
|
|
173
|
+
/**
|
|
174
|
+
* Returns filters eligible for the custom attribute dropdown,
|
|
175
|
+
* excluding default attributes already covered by built-in toggle items.
|
|
176
|
+
*/
|
|
177
|
+
private _getAddableFilters;
|
|
173
178
|
/**
|
|
174
179
|
* Looks up the display name for an attribute from the store's filterList.
|
|
175
180
|
* Falls back to Title Case conversion of the snake_case attribute name.
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
* product cards — changing "brand" color won't affect "rating_star" color.
|
|
14
14
|
*/
|
|
15
15
|
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
16
|
+
import { CustomAttributeTextTrimControl } from './textTrim';
|
|
16
17
|
/**
|
|
17
18
|
* Grouped Custom Attribute Controls
|
|
18
19
|
* Use this object for cleaner imports in extension.ts
|
|
19
20
|
*/
|
|
21
|
+
export { CustomAttributeTextTrimControl } from './textTrim';
|
|
20
22
|
export declare const CustomAttributeControls: {
|
|
21
23
|
readonly align: {
|
|
22
24
|
new (): {
|
|
@@ -102,4 +104,5 @@ export declare const CustomAttributeControls: {
|
|
|
102
104
|
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
103
105
|
};
|
|
104
106
|
};
|
|
107
|
+
readonly textTrim: typeof CustomAttributeTextTrimControl;
|
|
105
108
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom Attribute Text Trim Control
|
|
3
|
+
*
|
|
4
|
+
* Per-attribute text trimming for custom product attributes.
|
|
5
|
+
* Unlike NameTextTrimControl which applies to ALL product names globally,
|
|
6
|
+
* this control is scoped to a specific custom attribute type via the
|
|
7
|
+
* `product-attr` HTML attribute — changing text-trim on "brand" won't
|
|
8
|
+
* affect "rating_star".
|
|
9
|
+
*
|
|
10
|
+
* CSS rules are shared with NameTextTrimControl via shared/textTrimCssRules.ts.
|
|
11
|
+
*/
|
|
12
|
+
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
13
|
+
import { CommonControl } from '../../../common-control';
|
|
14
|
+
/**
|
|
15
|
+
* Control for enabling/disabling text trimming on individual custom attributes.
|
|
16
|
+
* Scoped per attribute type using the `product-attr` HTML attribute.
|
|
17
|
+
*/
|
|
18
|
+
export declare class CustomAttributeTextTrimControl extends CommonControl {
|
|
19
|
+
getId(): string;
|
|
20
|
+
getTemplate(): string;
|
|
21
|
+
onRender(): void;
|
|
22
|
+
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
23
|
+
_setFormValues(): void;
|
|
24
|
+
_getCurrentTrimState(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Finds all custom attribute elements of the same type as the current node.
|
|
27
|
+
*
|
|
28
|
+
* Similar to getCustomAttrTargetNodes in customAttribute/index.ts, but adapted
|
|
29
|
+
* for CommonControl lifecycle where currentNode is a class property (not a
|
|
30
|
+
* parameter from Stripo's getTargetNodes override).
|
|
31
|
+
*/
|
|
32
|
+
_getTargetElements(): ImmutableHtmlNode[];
|
|
33
|
+
_onTextTrimChange(enabled: boolean): void;
|
|
34
|
+
_listenToFormUpdates(): void;
|
|
35
|
+
}
|