@useinsider/guido 1.0.3-beta.8496f2a → 1.0.3-beta.8646ecc
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 +32 -3
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +73 -79
- package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +20 -21
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
- package/dist/composables/useActionsApi.js +1 -1
- package/dist/composables/useGuidoActions.js +9 -19
- package/dist/composables/useHtmlCompiler.js +13 -15
- package/dist/composables/useHtmlValidator.js +35 -36
- package/dist/composables/useStripo.js +40 -46
- package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
- package/dist/enums/defaults.js +1 -2
- package/dist/enums/onboarding.js +3 -7
- package/dist/enums/unsubscribe.js +25 -27
- package/dist/extensions/Blocks/Checkbox/control.js +14 -15
- package/dist/extensions/Blocks/Checkbox/template.js +9 -14
- package/dist/extensions/Blocks/Items/block.js +28 -29
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +57 -151
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +2 -2
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +117 -149
- package/dist/extensions/Blocks/Items/enums/productEnums.js +5 -83
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +1 -7
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +56 -57
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +55 -54
- package/dist/extensions/Blocks/Items/settingsPanel.js +31 -56
- package/dist/extensions/Blocks/Items/template.js +59 -138
- package/dist/extensions/Blocks/RadioButton/control.js +17 -18
- package/dist/extensions/Blocks/RadioButton/template.js +9 -18
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/extensions/Blocks/Unsubscribe/block.js +27 -27
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
- package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
- package/dist/guido.css +1 -1
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +12 -13
- package/dist/node_modules/lodash-es/keysIn.js +3 -3
- package/dist/package.json.js +1 -1
- package/dist/src/@types/generic.d.ts +6 -27
- package/dist/src/components/Guido.vue.d.ts +2 -3
- package/dist/src/composables/useGuidoActions.d.ts +0 -9
- package/dist/src/enums/onboarding.d.ts +0 -4
- package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +7 -20
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +2 -8
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -8
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -6
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -9
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
- package/dist/src/stores/config.d.ts +2 -3
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/editor.d.ts +1 -1
- package/dist/src/stores/onboarding.d.ts +1 -335
- package/dist/src/stores/preview.d.ts +1 -1
- package/dist/src/stores/recommendation.d.ts +1 -1
- package/dist/src/stores/save-as-template.d.ts +1 -1
- package/dist/src/stores/toaster.d.ts +1 -1
- package/dist/src/stores/unsubscribe.d.ts +1 -1
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/genericUtil.d.ts +0 -1
- package/dist/stores/config.js +5 -5
- package/dist/stores/dynamic-content.js +2 -2
- package/dist/stores/editor.js +1 -1
- package/dist/stores/onboarding.js +36 -44
- package/dist/stores/preview.js +1 -1
- package/dist/stores/recommendation.js +3 -3
- package/dist/stores/save-as-template.js +2 -2
- package/dist/stores/toaster.js +1 -1
- package/dist/stores/unsubscribe.js +1 -1
- package/dist/stores/version-history.js +4 -4
- package/dist/utils/genericUtil.js +6 -17
- package/package.json +11 -4
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +0 -99
- package/dist/config/compiler/itemsCompilerRules.js +0 -14
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/lodash-es/_SetCache.js +0 -13
- package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
- package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
- package/dist/node_modules/lodash-es/_arraySome.js +0 -9
- package/dist/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/lodash-es/_baseGet.js +0 -11
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
- package/dist/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/lodash-es/_baseRange.js +0 -9
- package/dist/node_modules/lodash-es/_baseToString.js +0 -18
- package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/dist/node_modules/lodash-es/_createRange.js +0 -11
- package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
- package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
- package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/lodash-es/_getTag.js +0 -28
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/lodash-es/_isKey.js +0 -12
- package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/flatMap.js +0 -8
- package/dist/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/lodash-es/map.js +0 -11
- package/dist/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/lodash-es/range.js +0 -5
- package/dist/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/lodash-es/toFinite.js +0 -14
- package/dist/node_modules/lodash-es/toNumber.js +0 -22
- package/dist/node_modules/lodash-es/toString.js +0 -7
- package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +0 -2
- package/dist/src/config/compiler/itemsCompilerRules.d.ts +0 -2
- package/dist/src/utils/environmentUtil.d.ts +0 -5
- package/dist/src/utils/pairProductVariables.d.ts +0 -7
- package/dist/utils/environmentUtil.js +0 -4
- package/dist/utils/pairProductVariables.js +0 -136
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var u = (n, i, e) =>
|
|
2
|
+
var d = (n, i, e) => i in n ? _(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
|
|
3
|
+
var u = (n, i, e) => d(n, typeof i != "symbol" ? i + "" : i, e);
|
|
4
4
|
import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
|
|
5
5
|
import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
|
|
6
|
-
import { Block as
|
|
7
|
-
import { getDefaultTemplate as
|
|
6
|
+
import { Block as S, BlockCompositionType as h, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { getDefaultTemplate as L } from "./template.js";
|
|
8
8
|
import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
|
|
9
9
|
import { parsePageList as m } from "./utils/utils.js";
|
|
10
|
-
const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]',
|
|
10
|
+
const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', B = ".unsubscribe-block-v2", f = "{{ins-unsubscribe-link}}", C = {
|
|
11
11
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
12
12
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
13
13
|
};
|
|
14
|
-
class D extends
|
|
14
|
+
class D extends S {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
u(this, "selectEventListener", null);
|
|
@@ -25,7 +25,7 @@ class D extends d {
|
|
|
25
25
|
return "unsubscribe-icon";
|
|
26
26
|
}
|
|
27
27
|
getBlockCompositionType() {
|
|
28
|
-
return
|
|
28
|
+
return h.BLOCK;
|
|
29
29
|
}
|
|
30
30
|
getName() {
|
|
31
31
|
return this.api.translate("Unsubscribe Block");
|
|
@@ -34,10 +34,10 @@ class D extends d {
|
|
|
34
34
|
return this.api.translate("Unsubscribe Block Description");
|
|
35
35
|
}
|
|
36
36
|
getTemplate() {
|
|
37
|
-
return
|
|
37
|
+
return L();
|
|
38
38
|
}
|
|
39
39
|
onCreated(e) {
|
|
40
|
-
"
|
|
40
|
+
"getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
41
41
|
}
|
|
42
42
|
onSelect(e) {
|
|
43
43
|
this.currentNode = e, this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener();
|
|
@@ -50,8 +50,8 @@ class D extends d {
|
|
|
50
50
|
}
|
|
51
51
|
_setupSelectEventListener() {
|
|
52
52
|
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
53
|
-
const
|
|
54
|
-
this._updateBlock(t,
|
|
53
|
+
const r = e, { collectionType: t, selectedPages: s } = r.detail;
|
|
54
|
+
this._updateBlock(t, s.join(","));
|
|
55
55
|
}, document.addEventListener(a.SELECT, this.selectEventListener);
|
|
56
56
|
}
|
|
57
57
|
_removeSelectEventListener() {
|
|
@@ -71,17 +71,17 @@ class D extends d {
|
|
|
71
71
|
_removeEventListeners() {
|
|
72
72
|
this._removeSelectEventListener(), this._removeCancelEventListener();
|
|
73
73
|
}
|
|
74
|
-
_updateBlock(e,
|
|
74
|
+
_updateBlock(e, r) {
|
|
75
75
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
76
76
|
return;
|
|
77
77
|
const t = this.currentNode.querySelector(g);
|
|
78
78
|
if (!t)
|
|
79
79
|
return;
|
|
80
|
-
const
|
|
81
|
-
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href",
|
|
80
|
+
const s = this._getMergeTag(e);
|
|
81
|
+
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", s).apply(new b(`Updated unsubscribe link to ${s}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, r).apply(new b("Updated unsubscribe block metadata"));
|
|
82
82
|
}
|
|
83
83
|
_getMergeTag(e) {
|
|
84
|
-
return
|
|
84
|
+
return C[e] ?? f;
|
|
85
85
|
}
|
|
86
86
|
_openDrawer() {
|
|
87
87
|
try {
|
|
@@ -93,11 +93,11 @@ class D extends d {
|
|
|
93
93
|
}
|
|
94
94
|
_checkExistingBlocks() {
|
|
95
95
|
const e = c();
|
|
96
|
-
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(
|
|
96
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(B).forEach((t) => {
|
|
97
97
|
if ("getAttribute" in t) {
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
const l = Number(
|
|
98
|
+
const s = t.getAttribute(o.PAGE_TYPE);
|
|
99
|
+
if (s) {
|
|
100
|
+
const l = Number(s);
|
|
101
101
|
l === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : l === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -106,11 +106,11 @@ class D extends d {
|
|
|
106
106
|
_loadBlockState(e) {
|
|
107
107
|
if (!("getAttribute" in e))
|
|
108
108
|
return;
|
|
109
|
-
const
|
|
110
|
-
if (!
|
|
109
|
+
const r = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
|
|
110
|
+
if (!r || !t)
|
|
111
111
|
return;
|
|
112
|
-
const
|
|
113
|
-
|
|
112
|
+
const s = c(), l = Number(r), p = m(t);
|
|
113
|
+
s.setCollectionWithoutAutoSelection(l), s.loadSelectedTemplates(p);
|
|
114
114
|
}
|
|
115
115
|
_resetStoreState() {
|
|
116
116
|
c().$reset();
|
|
@@ -118,11 +118,11 @@ class D extends d {
|
|
|
118
118
|
_removeBlockTemplatesFromStore(e) {
|
|
119
119
|
if (!("getAttribute" in e))
|
|
120
120
|
return;
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
121
|
+
const r = e.getAttribute(o.PAGE_LIST);
|
|
122
|
+
if (!r)
|
|
123
123
|
return;
|
|
124
|
-
const t = c(),
|
|
125
|
-
t.removeUnsubscribePages(
|
|
124
|
+
const t = c(), s = m(r);
|
|
125
|
+
t.removeUnsubscribePages(s);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
export {
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
class
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var d = (t, e, n) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var a = (t, e, n) => d(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
class y {
|
|
5
5
|
constructor() {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
a(this, "selectedDynamicContent", null);
|
|
7
|
+
a(this, "dataSelectCallback", () => {
|
|
8
8
|
});
|
|
9
|
-
c(this, "closeDynamicContentHandler", null);
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
openMergeTagsLibrary(e, n, l) {
|
|
18
|
-
this.closeDynamicContentHandler && (document.removeEventListener("dynamic-content:close", this.closeDynamicContentHandler), this.closeDynamicContentHandler = null), this.dataSelectCallback = n, this.selectedDynamicContent = e;
|
|
19
|
-
const o = {
|
|
20
|
-
attribute: e,
|
|
21
|
-
position: l
|
|
22
|
-
}, s = new CustomEvent("dynamic-content:open", {
|
|
23
|
-
detail: o
|
|
10
|
+
openMergeTagsLibrary(e, n) {
|
|
11
|
+
this.dataSelectCallback = n, this.selectedDynamicContent = e;
|
|
12
|
+
const s = new CustomEvent("dynamic-content:open", {
|
|
13
|
+
detail: {
|
|
14
|
+
attribute: e
|
|
15
|
+
}
|
|
24
16
|
});
|
|
25
|
-
document.dispatchEvent(s)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
document.dispatchEvent(s);
|
|
18
|
+
const o = (l) => {
|
|
19
|
+
const c = l.detail;
|
|
20
|
+
this.selectedDynamicContent = c, c.text && c.value && this.dataSelectCallback(c), document.removeEventListener("dynamic-content:close", o);
|
|
21
|
+
};
|
|
22
|
+
document.addEventListener("dynamic-content:close", o);
|
|
29
23
|
}
|
|
30
24
|
}
|
|
31
25
|
export {
|
|
32
|
-
|
|
26
|
+
y as ExternalMergeTagsLibrary
|
|
33
27
|
};
|
|
@@ -1,156 +1,61 @@
|
|
|
1
|
-
var
|
|
2
|
-
var g = (
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import { UIElement as
|
|
6
|
-
import { ExternalMergeTagsLibrary as
|
|
7
|
-
const
|
|
8
|
-
class p extends
|
|
9
|
-
registerUiElements(
|
|
10
|
-
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var g = (n, t, e) => t in n ? o(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var i = (n, t, e) => g(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { dynamicContentToMergeTags as m } from "../../utils/genericUtil.js";
|
|
5
|
+
import { UIElement as c, UIElementType as r, UEAttr as l, UIElementTagRegistry as d } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { ExternalMergeTagsLibrary as T } from "./dynamic-content-modal.js";
|
|
7
|
+
const a = "external-dynamic-content-ui-element", y = "button-add-dynamic-content";
|
|
8
|
+
class p extends d {
|
|
9
|
+
registerUiElements(t) {
|
|
10
|
+
t[r.MERGETAGS] = a;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class C extends c {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
r(this, "mousedownListener", null);
|
|
16
|
+
i(this, "mergeTagsButton", null);
|
|
17
|
+
i(this, "listener", () => {
|
|
18
|
+
});
|
|
19
|
+
i(this, "mergeTagsLibrary", null);
|
|
20
|
+
i(this, "selectedDynamicContent", { value: "", text: "" });
|
|
22
21
|
}
|
|
23
22
|
getId() {
|
|
24
|
-
return
|
|
23
|
+
return a;
|
|
25
24
|
}
|
|
26
|
-
onRender(
|
|
27
|
-
var
|
|
28
|
-
this.mergeTagsButton =
|
|
25
|
+
onRender(e) {
|
|
26
|
+
var s;
|
|
27
|
+
this.listener = this._onClick.bind(this), this.mergeTagsButton = e.querySelector("#guido__btn-add-dynamic-content"), (s = this.mergeTagsButton) == null || s.addEventListener("click", this.listener);
|
|
29
28
|
}
|
|
30
29
|
onDestroy() {
|
|
31
|
-
var
|
|
32
|
-
|
|
30
|
+
var e;
|
|
31
|
+
(e = this.mergeTagsButton) == null || e.removeEventListener("click", this.listener);
|
|
33
32
|
}
|
|
34
33
|
_onClick() {
|
|
35
34
|
this.openMergeTagLibrary();
|
|
36
35
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Called when Stripo detects merge tag interactions
|
|
39
|
-
* This is the key method that receives notifications about merge tag clicks
|
|
40
|
-
* @param name - Attribute name (e.g., 'mergeTag')
|
|
41
|
-
* @param value - MergeTag object with label, value, selStart, selEnd, etc.
|
|
42
|
-
*/
|
|
43
|
-
onAttributeUpdated(t, e) {
|
|
44
|
-
if (t !== "mergeTag" || !(e != null && e.value))
|
|
45
|
-
return;
|
|
46
|
-
const n = d(e), i = this._getLastClickedPosition();
|
|
47
|
-
this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(n, i);
|
|
48
|
-
}
|
|
49
36
|
openMergeTagLibrary() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* Dispatches event with dynamic content data and position
|
|
56
|
-
*/
|
|
57
|
-
_openDynamicContentLibrary(t, e) {
|
|
58
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new y()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
59
|
-
t,
|
|
60
|
-
(n) => {
|
|
61
|
-
n.text && n.value ? this.api.triggerValueChange(m([n])[0]) : this.api.triggerValueChange(null);
|
|
62
|
-
},
|
|
63
|
-
e
|
|
37
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new T()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
38
|
+
this.selectedDynamicContent,
|
|
39
|
+
(e) => {
|
|
40
|
+
this.api.onValueChanged(m([e])[0]);
|
|
41
|
+
}
|
|
64
42
|
);
|
|
65
43
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Gets the button's position on the screen
|
|
68
|
-
* Used to position the modal or anything else near the button
|
|
69
|
-
*/
|
|
70
|
-
_getButtonPosition() {
|
|
71
|
-
if (!this.mergeTagsButton)
|
|
72
|
-
return { x: 0, y: 0, width: 0, height: 0 };
|
|
73
|
-
const { x: t, y: e, width: n, height: i } = this.mergeTagsButton.getBoundingClientRect();
|
|
74
|
-
return { x: t, y: e, width: n, height: i };
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Sets up coordinate tracking for merge tag clicks in the iframe
|
|
78
|
-
* Workaround from Stripo intercepting click events - tracks mousedown events instead
|
|
79
|
-
*/
|
|
80
|
-
_setupCoordinateTracking() {
|
|
81
|
-
var e;
|
|
82
|
-
const t = this._getEditorFrame();
|
|
83
|
-
(e = t == null ? void 0 : t.contentWindow) != null && e.document && (this.mousedownListener = (n) => {
|
|
84
|
-
const i = this._findMergeTagElement(n.target);
|
|
85
|
-
i && (this.lastClickedElement = i, this.lastClickedFrame = t);
|
|
86
|
-
}, t.contentWindow.document.addEventListener("mousedown", this.mousedownListener));
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Gets the editor iframe element
|
|
90
|
-
*/
|
|
91
|
-
_getEditorFrame() {
|
|
92
|
-
var n;
|
|
93
|
-
const t = document.querySelector("ui-editor");
|
|
94
|
-
if (!(t != null && t.shadowRoot))
|
|
95
|
-
return null;
|
|
96
|
-
const e = t.shadowRoot.querySelector("iframe");
|
|
97
|
-
return (n = e == null ? void 0 : e.contentWindow) != null && n.document ? e : null;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Finds merge tag element in the element tree
|
|
101
|
-
*/
|
|
102
|
-
_findMergeTagElement(t) {
|
|
103
|
-
return t.closest(".target, .esd-merge-tag");
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Gets the position of the last clicked element, calculated on-demand
|
|
107
|
-
* This ensures we always use the correct element's position even with rapid clicks
|
|
108
|
-
*/
|
|
109
|
-
_getLastClickedPosition() {
|
|
110
|
-
if (!(!this.lastClickedElement || !this.lastClickedFrame))
|
|
111
|
-
return this._calculateAbsolutePosition(this.lastClickedFrame, this.lastClickedElement);
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Calculates absolute position of element relative to page
|
|
115
|
-
*/
|
|
116
|
-
_calculateAbsolutePosition(t, e) {
|
|
117
|
-
const n = t.getBoundingClientRect(), i = e.getBoundingClientRect();
|
|
118
|
-
return {
|
|
119
|
-
x: n.x + i.x,
|
|
120
|
-
y: n.y + i.y,
|
|
121
|
-
width: i.width,
|
|
122
|
-
height: i.height
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Cleans up the coordinate tracking event listener
|
|
127
|
-
*/
|
|
128
|
-
_cleanupCoordinateTracking() {
|
|
129
|
-
var e;
|
|
130
|
-
if (!this.mousedownListener)
|
|
131
|
-
return;
|
|
132
|
-
const t = this._getEditorFrame();
|
|
133
|
-
(e = t == null ? void 0 : t.contentWindow) != null && e.document && t.contentWindow.document.removeEventListener("mousedown", this.mousedownListener), this.mousedownListener = null;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Returns the HTML template for the "Add Dynamic Content" button
|
|
137
|
-
* This button is placed in the merge tags selector UI
|
|
138
|
-
*/
|
|
139
44
|
getTemplate() {
|
|
140
45
|
return `
|
|
141
46
|
<div>
|
|
142
|
-
<${
|
|
47
|
+
<${r.BUTTON}
|
|
143
48
|
id="guido__btn-add-dynamic-content"
|
|
144
49
|
class="btn btn-primary"
|
|
145
|
-
${
|
|
146
|
-
<${
|
|
147
|
-
</${
|
|
50
|
+
${l.BUTTON.name}="${y}">
|
|
51
|
+
<${r.ICON} src="plus" class="icon icon-button color-primary">
|
|
52
|
+
</${r.ICON}>
|
|
148
53
|
${this.api.translate("Add Dynamic Content")}
|
|
149
|
-
</${
|
|
54
|
+
</${r.BUTTON}>
|
|
150
55
|
</div>`;
|
|
151
56
|
}
|
|
152
57
|
}
|
|
153
58
|
export {
|
|
154
59
|
p as DynamicContentTagRegistry,
|
|
155
|
-
|
|
60
|
+
C as DynamicContentUiElementExtension
|
|
156
61
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.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}.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}.guido-loading__wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.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}.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}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-3c910a93],.guido-editor__container[data-v-3c910a93]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-3c910a93]{height:calc(100vh - 75px)}[data-v-70835920] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-dd57102d] .guido__verion-history-view-option-selection-desktop svg,[data-v-dd57102d] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dd57102d] .in-segments-wrapper__button_selected,[data-v-dd57102d] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import p from "./_baseTimes.js";
|
|
2
2
|
import g from "./isArguments.js";
|
|
3
3
|
import h from "./isArray.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
(p || O.call(t, r)) && !(n && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
4
|
+
import a from "./isBuffer.js";
|
|
5
|
+
import d from "./_isIndex.js";
|
|
6
|
+
import A from "./isTypedArray.js";
|
|
7
|
+
function c(i, b) {
|
|
8
|
+
var t = h(i), f = !t && g(i), s = !t && !f && a(i), o = !t && !f && !s && A(i), n = t || f || s || o, e = n ? p(i.length, String) : [], m = e.length;
|
|
9
|
+
for (var r in i)
|
|
10
|
+
n && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
12
11
|
(r == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
13
12
|
s && (r == "offset" || r == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return
|
|
13
|
+
o && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
|
|
14
|
+
d(r, m)) || e.push(r);
|
|
15
|
+
return e;
|
|
17
16
|
}
|
|
18
17
|
export {
|
|
19
|
-
|
|
18
|
+
c as default
|
|
20
19
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -7,7 +7,6 @@ type Features = {
|
|
|
7
7
|
saveAsTemplate?: boolean;
|
|
8
8
|
versionHistory?: boolean;
|
|
9
9
|
testMessage?: boolean;
|
|
10
|
-
displayConditions?: boolean;
|
|
11
10
|
};
|
|
12
11
|
type Partner = {
|
|
13
12
|
partnerName: string;
|
|
@@ -38,39 +37,15 @@ export type TemplateConfig = {
|
|
|
38
37
|
selectedUnsubscribePages?: number[];
|
|
39
38
|
variationId?: string;
|
|
40
39
|
};
|
|
41
|
-
export type
|
|
40
|
+
export type DynamicContent = {
|
|
42
41
|
value: string;
|
|
42
|
+
text: string;
|
|
43
43
|
fallback?: string;
|
|
44
44
|
format?: {
|
|
45
45
|
key: string;
|
|
46
46
|
value: string;
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
export type DynamicContent = BaseDynamicContent & {
|
|
50
|
-
text: string;
|
|
51
|
-
};
|
|
52
|
-
export type MergeTag = BaseDynamicContent & {
|
|
53
|
-
label: string;
|
|
54
|
-
selStart?: number;
|
|
55
|
-
selEnd?: number;
|
|
56
|
-
hidden?: boolean;
|
|
57
|
-
};
|
|
58
|
-
export type PositionData = {
|
|
59
|
-
x: number;
|
|
60
|
-
y: number;
|
|
61
|
-
width?: number;
|
|
62
|
-
height?: number;
|
|
63
|
-
};
|
|
64
|
-
export type DynamicContentEvent = {
|
|
65
|
-
attribute: DynamicContent;
|
|
66
|
-
position?: PositionData;
|
|
67
|
-
};
|
|
68
|
-
export type MergeTagClickEvent = {
|
|
69
|
-
position: PositionData;
|
|
70
|
-
element: HTMLElement;
|
|
71
|
-
tagValue: string | null;
|
|
72
|
-
tagLabel: string | null;
|
|
73
|
-
};
|
|
74
49
|
export interface EmailHeader {
|
|
75
50
|
senderName: string;
|
|
76
51
|
subject: string;
|
|
@@ -86,6 +61,10 @@ export interface TooltipOptions {
|
|
|
86
61
|
};
|
|
87
62
|
preventXss?: boolean;
|
|
88
63
|
}
|
|
64
|
+
export type MergeTag = {
|
|
65
|
+
label: string;
|
|
66
|
+
value: string;
|
|
67
|
+
};
|
|
89
68
|
export type TextValueObject = {
|
|
90
69
|
text: string;
|
|
91
70
|
value: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DynamicContent, GuidoConfig,
|
|
1
|
+
import type { DynamicContent, GuidoConfig, TemplateConfig } from '@@/Types/generic';
|
|
2
2
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
templateId: string;
|
|
@@ -20,14 +20,13 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
20
20
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
21
21
|
saveSilent: () => Promise<SavedTemplateDetails | undefined> | undefined;
|
|
22
22
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
23
|
-
"dynamic-content:open": (detail: DynamicContent | null
|
|
23
|
+
"dynamic-content:open": (detail: DynamicContent | null) => void;
|
|
24
24
|
back: () => void;
|
|
25
25
|
"save:start": () => void;
|
|
26
26
|
"save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
|
|
27
27
|
"on-change": (hasChanges: boolean) => void;
|
|
28
28
|
ready: () => void;
|
|
29
29
|
"onboarding:finished": () => void;
|
|
30
|
-
"test-email:click": () => void;
|
|
31
30
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
32
31
|
export default _default;
|
|
33
32
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -3,11 +3,9 @@ import type { InjectionKey } from 'vue';
|
|
|
3
3
|
export type BackHandler = () => void;
|
|
4
4
|
export type SaveStartHandler = () => void;
|
|
5
5
|
export type SaveCompleteHandler = (template: Omit<SavedTemplateDetails, 'forceRecreate'>) => void;
|
|
6
|
-
export type TestEmailClickHandler = () => void;
|
|
7
6
|
export declare const BACK_KEY: InjectionKey<BackHandler>;
|
|
8
7
|
export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
|
|
9
8
|
export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
|
|
10
|
-
export declare const TEST_EMAIL_CLICK_KEY: InjectionKey<TestEmailClickHandler>;
|
|
11
9
|
/**
|
|
12
10
|
* Provides Guido action handlers to child components
|
|
13
11
|
*/
|
|
@@ -15,7 +13,6 @@ export declare const provideGuidoActions: (actions: {
|
|
|
15
13
|
onBack: BackHandler;
|
|
16
14
|
onSaveStart: SaveStartHandler;
|
|
17
15
|
onSaveComplete: SaveCompleteHandler;
|
|
18
|
-
onTestEmailClick: TestEmailClickHandler;
|
|
19
16
|
}) => void;
|
|
20
17
|
/**
|
|
21
18
|
* Provides individual Guido action handlers
|
|
@@ -38,11 +35,6 @@ export declare const useSaveStart: () => SaveStartHandler;
|
|
|
38
35
|
* @returns Save complete function
|
|
39
36
|
*/
|
|
40
37
|
export declare const useSaveComplete: () => SaveCompleteHandler;
|
|
41
|
-
/**
|
|
42
|
-
* Hook to use the test email click handler
|
|
43
|
-
* @returns Test email click function
|
|
44
|
-
*/
|
|
45
|
-
export declare const useTestEmailClick: () => TestEmailClickHandler;
|
|
46
38
|
/**
|
|
47
39
|
* Convenience hook to get all Guido actions
|
|
48
40
|
* @returns Object containing all action handlers
|
|
@@ -51,5 +43,4 @@ export declare const useGuidoActions: () => {
|
|
|
51
43
|
back: BackHandler;
|
|
52
44
|
saveStart: SaveStartHandler;
|
|
53
45
|
saveComplete: SaveCompleteHandler;
|
|
54
|
-
testEmailClick: TestEmailClickHandler;
|
|
55
46
|
};
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
export declare const SERVICE_HOVER_SELECTORS: string[];
|
|
2
|
-
export declare const UI_EDITOR_SELECTOR = "ui-editor";
|
|
3
|
-
export declare const CARD_COMPOSITION_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Card Composition\"]";
|
|
4
|
-
export declare const SETTINGS_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Settings\"]";
|
|
5
|
-
export declare const RIBBON_SELECTOR = ".in-ribbons-wrapper";
|
|
6
2
|
export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/email-drag-drop-editor";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"checkbox-block\"\n class=\"
|
|
1
|
+
declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"checkbox-block\" \n class=\"checkbox-block-v2 esd-block-checkbox esd-checkbox-block esd-extension-block es-p20\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"39\" style=\"vertical-align: top\">\n <input type=\"checkbox\">\n </td>\n <td align=\"left\" width=\"816\" style=\"vertical-align: top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
|
|
2
2
|
/**
|
|
3
3
|
* @returns The template for the default checkbox block
|
|
4
4
|
*/
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { Block, BlockCompositionType, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
2
|
export declare const BLOCK_ID = "items-block";
|
|
3
|
-
/**
|
|
4
|
-
* Items Block extension for Stripo email editor.
|
|
5
|
-
*
|
|
6
|
-
* Displays personalized product items (cart items, browsed items, or purchased items)
|
|
7
|
-
* in a configurable card layout with horizontal or vertical orientation.
|
|
8
|
-
*
|
|
9
|
-
* Features:
|
|
10
|
-
* - Multiple product data sources (cart, browsed, purchased)
|
|
11
|
-
* - Configurable card composition (image, name, price, quantity, button)
|
|
12
|
-
* - Orientation control (horizontal/vertical)
|
|
13
|
-
* - Price formatting and currency display options
|
|
14
|
-
* - Product name trimming
|
|
15
|
-
* - Onboarding support
|
|
16
|
-
*/
|
|
17
3
|
export declare class ItemsBlock extends Block {
|
|
18
4
|
getId(): string;
|
|
19
5
|
getIcon(): string;
|
|
@@ -1,33 +1,20 @@
|
|
|
1
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
1
|
import { CommonControl } from '../../common-control';
|
|
3
2
|
export declare const COMPOSITION_CONTROL_BLOCK_ID = "ui-elements-items-card-composition-block";
|
|
4
3
|
export declare class ItemsBlockCardCompositionControl extends CommonControl {
|
|
5
|
-
private store;
|
|
6
|
-
private visibilityState;
|
|
7
4
|
getId(): string;
|
|
8
5
|
getTemplate(): string;
|
|
9
6
|
onRender(): void;
|
|
10
|
-
|
|
7
|
+
onDestroy(): void;
|
|
11
8
|
_getToggleContainer({ name, label }: {
|
|
12
9
|
name: string;
|
|
13
10
|
label: string;
|
|
14
11
|
}): string;
|
|
15
12
|
_initializeToggles(): void;
|
|
16
|
-
_updateTogglesFromState(): void;
|
|
17
|
-
_syncVisibilityFromAttributes(): void;
|
|
18
|
-
/**
|
|
19
|
-
* If itemsType is not BROWSED_ITEMS, show quantity
|
|
20
|
-
* If itemsType is BROWSED_ITEMS, hide quantity
|
|
21
|
-
* and mark it as '0'
|
|
22
|
-
*/
|
|
23
|
-
_handleBrowsedItemsQuantity(): void;
|
|
24
|
-
_applyVisibilityStyles(): void;
|
|
25
|
-
_updateVisibilityAttribute(elementName: string, isVisible: boolean): void;
|
|
26
13
|
_listenToFormUpdates(): void;
|
|
27
|
-
_onProductImageChange(value:
|
|
28
|
-
_onProductNameChange(value:
|
|
29
|
-
_onProductQuantityChange(value:
|
|
30
|
-
_onProductPriceChange(value:
|
|
31
|
-
_onProductOriginalPriceChange(value:
|
|
32
|
-
_onProductButtonChange(value:
|
|
14
|
+
_onProductImageChange(value: string): void;
|
|
15
|
+
_onProductNameChange(value: string): void;
|
|
16
|
+
_onProductQuantityChange(value: string): void;
|
|
17
|
+
_onProductPriceChange(value: string): void;
|
|
18
|
+
_onProductOriginalPriceChange(value: string): void;
|
|
19
|
+
_onProductButtonChange(value: string): void;
|
|
33
20
|
}
|