@useinsider/guido 1.0.3-beta.8646ecc → 1.0.3-beta.87cb92a
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 +6 -32
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +79 -73
- package/dist/components/organisms/header/RightSlot.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +99 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
- package/dist/composables/useActionsApi.js +1 -1
- package/dist/composables/useGuidoActions.js +19 -9
- package/dist/composables/useHtmlCompiler.js +15 -13
- package/dist/composables/useHtmlValidator.js +36 -35
- package/dist/composables/useStripo.js +46 -40
- package/dist/config/compiler/itemsCompilerRules.js +14 -0
- package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
- package/dist/enums/defaults.js +2 -1
- package/dist/enums/onboarding.js +7 -3
- package/dist/enums/unsubscribe.js +27 -25
- package/dist/extensions/Blocks/Checkbox/control.js +15 -14
- package/dist/extensions/Blocks/Checkbox/template.js +14 -9
- package/dist/extensions/Blocks/Items/block.js +29 -28
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +151 -57
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +2 -2
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +149 -117
- package/dist/extensions/Blocks/Items/enums/productEnums.js +83 -5
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +7 -1
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +57 -56
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +54 -55
- package/dist/extensions/Blocks/Items/settingsPanel.js +56 -31
- package/dist/extensions/Blocks/Items/template.js +138 -59
- package/dist/extensions/Blocks/RadioButton/control.js +18 -17
- package/dist/extensions/Blocks/RadioButton/template.js +18 -9
- 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 +25 -19
- package/dist/extensions/DynamicContent/dynamic-content.js +128 -33
- package/dist/guido.css +1 -1
- package/dist/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/lodash-es/_SetCache.js +13 -0
- package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +13 -12
- package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
- package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
- package/dist/node_modules/lodash-es/_arraySome.js +9 -0
- package/dist/node_modules/lodash-es/_baseEach.js +6 -0
- package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
- package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
- package/dist/node_modules/lodash-es/_baseGet.js +11 -0
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
- package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
- package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
- package/dist/node_modules/lodash-es/_baseMap.js +11 -0
- package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/dist/node_modules/lodash-es/_baseRange.js +9 -0
- package/dist/node_modules/lodash-es/_baseToString.js +18 -0
- package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
- package/dist/node_modules/lodash-es/_createRange.js +11 -0
- package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
- package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
- package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
- package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
- package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/lodash-es/_getTag.js +28 -0
- package/dist/node_modules/lodash-es/_hasPath.js +19 -0
- package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
- package/dist/node_modules/lodash-es/_isKey.js +12 -0
- package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
- package/dist/node_modules/lodash-es/flatMap.js +8 -0
- package/dist/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/lodash-es/hasIn.js +8 -0
- package/dist/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/lodash-es/keysIn.js +3 -3
- package/dist/node_modules/lodash-es/map.js +11 -0
- package/dist/node_modules/lodash-es/property.js +10 -0
- package/dist/node_modules/lodash-es/range.js +5 -0
- package/dist/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/lodash-es/toFinite.js +14 -0
- package/dist/node_modules/lodash-es/toNumber.js +22 -0
- package/dist/node_modules/lodash-es/toString.js +7 -0
- package/dist/package.json.js +1 -1
- package/dist/src/@types/generic.d.ts +27 -6
- package/dist/src/components/Guido.vue.d.ts +3 -2
- package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useGuidoActions.d.ts +9 -0
- package/dist/src/config/compiler/itemsCompilerRules.d.ts +2 -0
- package/dist/src/enums/onboarding.d.ts +4 -0
- package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +20 -7
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +8 -2
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +6 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +9 -1
- 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 +9 -2
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +52 -2
- package/dist/src/stores/config.d.ts +3 -2
- 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 +335 -1
- 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/environmentUtil.d.ts +5 -0
- package/dist/src/utils/genericUtil.d.ts +1 -0
- package/dist/src/utils/pairProductVariables.d.ts +7 -0
- 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 +44 -36
- 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/environmentUtil.js +4 -0
- package/dist/utils/genericUtil.js +17 -6
- package/dist/utils/pairProductVariables.js +136 -0
- package/package.json +4 -11
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var u = (n, i, e) =>
|
|
2
|
+
var S = (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) => S(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 d, BlockCompositionType as L, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { getDefaultTemplate as h } 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"]', T = ".unsubscribe-block-v2", f = "{{ins-unsubscribe-link}}", B = {
|
|
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 d {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
u(this, "selectEventListener", null);
|
|
@@ -25,7 +25,7 @@ class D extends S {
|
|
|
25
25
|
return "unsubscribe-icon";
|
|
26
26
|
}
|
|
27
27
|
getBlockCompositionType() {
|
|
28
|
-
return
|
|
28
|
+
return L.BLOCK;
|
|
29
29
|
}
|
|
30
30
|
getName() {
|
|
31
31
|
return this.api.translate("Unsubscribe Block");
|
|
@@ -34,10 +34,10 @@ class D extends S {
|
|
|
34
34
|
return this.api.translate("Unsubscribe Block Description");
|
|
35
35
|
}
|
|
36
36
|
getTemplate() {
|
|
37
|
-
return
|
|
37
|
+
return h();
|
|
38
38
|
}
|
|
39
39
|
onCreated(e) {
|
|
40
|
-
"getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
40
|
+
"getOuterHTML" in e && !e.getOuterHTML() || "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 S {
|
|
|
50
50
|
}
|
|
51
51
|
_setupSelectEventListener() {
|
|
52
52
|
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
53
|
-
const
|
|
54
|
-
this._updateBlock(t,
|
|
53
|
+
const s = e, { collectionType: t, selectedPages: r } = s.detail;
|
|
54
|
+
this._updateBlock(t, r.join(","));
|
|
55
55
|
}, document.addEventListener(a.SELECT, this.selectEventListener);
|
|
56
56
|
}
|
|
57
57
|
_removeSelectEventListener() {
|
|
@@ -71,17 +71,17 @@ class D extends S {
|
|
|
71
71
|
_removeEventListeners() {
|
|
72
72
|
this._removeSelectEventListener(), this._removeCancelEventListener();
|
|
73
73
|
}
|
|
74
|
-
_updateBlock(e,
|
|
74
|
+
_updateBlock(e, s) {
|
|
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 r = this._getMergeTag(e);
|
|
81
|
+
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", r).apply(new b(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, s).apply(new b("Updated unsubscribe block metadata"));
|
|
82
82
|
}
|
|
83
83
|
_getMergeTag(e) {
|
|
84
|
-
return
|
|
84
|
+
return B[e] ?? f;
|
|
85
85
|
}
|
|
86
86
|
_openDrawer() {
|
|
87
87
|
try {
|
|
@@ -93,11 +93,11 @@ class D extends S {
|
|
|
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(T).forEach((t) => {
|
|
97
97
|
if ("getAttribute" in t) {
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
const l = Number(
|
|
98
|
+
const r = t.getAttribute(o.PAGE_TYPE);
|
|
99
|
+
if (r) {
|
|
100
|
+
const l = Number(r);
|
|
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 S {
|
|
|
106
106
|
_loadBlockState(e) {
|
|
107
107
|
if (!("getAttribute" in e))
|
|
108
108
|
return;
|
|
109
|
-
const
|
|
110
|
-
if (!
|
|
109
|
+
const s = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
|
|
110
|
+
if (!s || !t)
|
|
111
111
|
return;
|
|
112
|
-
const
|
|
113
|
-
|
|
112
|
+
const r = c(), l = Number(s), p = m(t);
|
|
113
|
+
r.setCollectionWithoutAutoSelection(l), r.loadSelectedTemplates(p);
|
|
114
114
|
}
|
|
115
115
|
_resetStoreState() {
|
|
116
116
|
c().$reset();
|
|
@@ -118,11 +118,11 @@ class D extends S {
|
|
|
118
118
|
_removeBlockTemplatesFromStore(e) {
|
|
119
119
|
if (!("getAttribute" in e))
|
|
120
120
|
return;
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
121
|
+
const s = e.getAttribute(o.PAGE_LIST);
|
|
122
|
+
if (!s)
|
|
123
123
|
return;
|
|
124
|
-
const t = c(),
|
|
125
|
-
t.removeUnsubscribePages(
|
|
124
|
+
const t = c(), r = m(s);
|
|
125
|
+
t.removeUnsubscribePages(r);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
export {
|
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
class
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var m = (t, e, n) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var c = (t, e, n) => m(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
class C {
|
|
5
5
|
constructor() {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
c(this, "selectedDynamicContent", null);
|
|
7
|
+
c(this, "dataSelectCallback", () => {
|
|
8
8
|
});
|
|
9
|
+
c(this, "closeDynamicContentHandler", null);
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Opens the merge tags library modal
|
|
13
|
+
* @param dynamicContent - Currently selected dynamic content (if any)
|
|
14
|
+
* @param onDataSelectCallback - Callback invoked when user selects a merge tag
|
|
15
|
+
* @param position - Optional position data to place the modal
|
|
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
|
|
16
24
|
});
|
|
17
|
-
document.dispatchEvent(s)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
document.addEventListener("dynamic-content:close", o);
|
|
25
|
+
document.dispatchEvent(s), this.closeDynamicContentHandler = (i) => {
|
|
26
|
+
const a = i.detail;
|
|
27
|
+
this.selectedDynamicContent = a, a.text && a.value && this.dataSelectCallback(a);
|
|
28
|
+
}, document.addEventListener("dynamic-content:close", this.closeDynamicContentHandler);
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
export {
|
|
26
|
-
|
|
32
|
+
C as ExternalMergeTagsLibrary
|
|
27
33
|
};
|
|
@@ -1,61 +1,156 @@
|
|
|
1
|
-
var
|
|
2
|
-
var g = (
|
|
3
|
-
var
|
|
4
|
-
import { dynamicContentToMergeTags as m } from "../../utils/genericUtil.js";
|
|
5
|
-
import { UIElement as
|
|
6
|
-
import { ExternalMergeTagsLibrary as
|
|
7
|
-
const
|
|
8
|
-
class p extends
|
|
9
|
-
registerUiElements(
|
|
10
|
-
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var g = (o, s, t) => s in o ? c(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
|
+
var r = (o, s, t) => g(o, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
import { mergeTagToDynamicContent as d, dynamicContentToMergeTags as m } from "../../utils/genericUtil.js";
|
|
5
|
+
import { UIElement as u, UIElementType as a, UEAttr as h, UIElementTagRegistry as T } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { ExternalMergeTagsLibrary as y } from "./dynamic-content-modal.js";
|
|
7
|
+
const l = "external-dynamic-content-ui-element", C = "button-add-dynamic-content";
|
|
8
|
+
class p extends T {
|
|
9
|
+
registerUiElements(s) {
|
|
10
|
+
s[a.MERGETAGS] = l;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class b extends u {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
r(this, "mergeTagsButton", null);
|
|
17
|
+
r(this, "mergeTagsLibrary", null);
|
|
18
|
+
r(this, "clickListener", null);
|
|
19
|
+
r(this, "lastClickedElement", null);
|
|
20
|
+
r(this, "lastClickedFrame", null);
|
|
21
|
+
r(this, "mousedownListener", null);
|
|
21
22
|
}
|
|
22
23
|
getId() {
|
|
23
|
-
return
|
|
24
|
+
return l;
|
|
24
25
|
}
|
|
25
|
-
onRender(
|
|
26
|
-
var
|
|
27
|
-
this.
|
|
26
|
+
onRender(t) {
|
|
27
|
+
var e;
|
|
28
|
+
this.mergeTagsButton = t.querySelector("#guido__btn-add-dynamic-content"), this.clickListener = this._onClick.bind(this), (e = this.mergeTagsButton) == null || e.addEventListener("click", this.clickListener), this._setupCoordinateTracking();
|
|
28
29
|
}
|
|
29
30
|
onDestroy() {
|
|
30
|
-
var
|
|
31
|
-
(
|
|
31
|
+
var t;
|
|
32
|
+
this.clickListener && ((t = this.mergeTagsButton) == null || t.removeEventListener("click", this.clickListener)), this._cleanupCoordinateTracking(), this.mergeTagsButton = null, this.clickListener = null, this.lastClickedElement = null, this.lastClickedFrame = null;
|
|
32
33
|
}
|
|
33
34
|
_onClick() {
|
|
34
35
|
this.openMergeTagLibrary();
|
|
35
36
|
}
|
|
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
|
+
}
|
|
36
49
|
openMergeTagLibrary() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
const t = this._getButtonPosition(), e = { value: "", text: "" };
|
|
51
|
+
this._openDynamicContentLibrary(e, t);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Opens the dynamic content library for external apps
|
|
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
|
|
42
64
|
);
|
|
43
65
|
}
|
|
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
|
+
*/
|
|
44
139
|
getTemplate() {
|
|
45
140
|
return `
|
|
46
141
|
<div>
|
|
47
|
-
<${
|
|
142
|
+
<${a.BUTTON}
|
|
48
143
|
id="guido__btn-add-dynamic-content"
|
|
49
144
|
class="btn btn-primary"
|
|
50
|
-
${
|
|
51
|
-
<${
|
|
52
|
-
</${
|
|
145
|
+
${h.BUTTON.name}="${C}">
|
|
146
|
+
<${a.ICON} src="plus" class="icon icon-button color-primary">
|
|
147
|
+
</${a.ICON}>
|
|
53
148
|
${this.api.translate("Add Dynamic Content")}
|
|
54
|
-
</${
|
|
149
|
+
</${a.BUTTON}>
|
|
55
150
|
</div>`;
|
|
56
151
|
}
|
|
57
152
|
}
|
|
58
153
|
export {
|
|
59
154
|
p as DynamicContentTagRegistry,
|
|
60
|
-
|
|
155
|
+
b as DynamicContentUiElementExtension
|
|
61
156
|
};
|
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-dced5582]{height:100%;top:75px}.guido-editor__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-23c413c9],.guido-editor__container[data-v-23c413c9]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-23c413c9]{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-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import p from "./_MapCache.js";
|
|
2
|
+
import h from "./_setCacheAdd.js";
|
|
3
|
+
import r from "./_setCacheHas.js";
|
|
4
|
+
function e(t) {
|
|
5
|
+
var o = -1, a = t == null ? 0 : t.length;
|
|
6
|
+
for (this.__data__ = new p(); ++o < a; )
|
|
7
|
+
this.add(t[o]);
|
|
8
|
+
}
|
|
9
|
+
e.prototype.add = e.prototype.push = h;
|
|
10
|
+
e.prototype.has = r;
|
|
11
|
+
export {
|
|
12
|
+
e as default
|
|
13
|
+
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a 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
|
-
|
|
4
|
+
import b from "./isBuffer.js";
|
|
5
|
+
import A from "./_isIndex.js";
|
|
6
|
+
import c from "./isTypedArray.js";
|
|
7
|
+
var d = Object.prototype, O = d.hasOwnProperty;
|
|
8
|
+
function l(t, p) {
|
|
9
|
+
var o = h(t), i = !o && g(t), s = !o && !i && b(t), e = !o && !i && !s && c(t), n = o || i || s || e, f = n ? a(t.length, String) : [], m = f.length;
|
|
10
|
+
for (var r in t)
|
|
11
|
+
(p || O.call(t, r)) && !(n && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
11
12
|
(r == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
12
13
|
s && (r == "offset" || r == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return
|
|
14
|
+
e && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
|
|
15
|
+
A(r, m))) && f.push(r);
|
|
16
|
+
return f;
|
|
16
17
|
}
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
l as default
|
|
19
20
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import a from "./_arrayPush.js";
|
|
2
|
+
import e from "./_isFlattenable.js";
|
|
3
|
+
function l(h, m, t, g, n) {
|
|
4
|
+
var o = -1, f = h.length;
|
|
5
|
+
for (t || (t = e), n || (n = []); ++o < f; ) {
|
|
6
|
+
var i = h[o];
|
|
7
|
+
t(i) ? a(n, i) : n[n.length] = i;
|
|
8
|
+
}
|
|
9
|
+
return n;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
l as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import v from "./_Stack.js";
|
|
2
|
+
import B from "./_equalArrays.js";
|
|
3
|
+
import E from "./_equalByTag.js";
|
|
4
|
+
import L from "./_equalObjects.js";
|
|
5
|
+
import _ from "./_getTag.js";
|
|
6
|
+
import O from "./isArray.js";
|
|
7
|
+
import u from "./isBuffer.js";
|
|
8
|
+
import R from "./isTypedArray.js";
|
|
9
|
+
var S = 1, w = "[object Arguments]", P = "[object Array]", l = "[object Object]", q = Object.prototype, I = q.hasOwnProperty;
|
|
10
|
+
function K(r, f, p, i, g, a) {
|
|
11
|
+
var m = O(r), j = O(f), e = m ? P : _(r), o = j ? P : _(f);
|
|
12
|
+
e = e == w ? l : e, o = o == w ? l : o;
|
|
13
|
+
var A = e == l, d = o == l, n = e == o;
|
|
14
|
+
if (n && u(r)) {
|
|
15
|
+
if (!u(f))
|
|
16
|
+
return !1;
|
|
17
|
+
m = !0, A = !1;
|
|
18
|
+
}
|
|
19
|
+
if (n && !A)
|
|
20
|
+
return a || (a = new v()), m || R(r) ? B(r, f, p, i, g, a) : E(r, f, e, p, i, g, a);
|
|
21
|
+
if (!(p & S)) {
|
|
22
|
+
var y = A && I.call(r, "__wrapped__"), T = d && I.call(f, "__wrapped__");
|
|
23
|
+
if (y || T) {
|
|
24
|
+
var s = y ? r.value() : r, t = T ? f.value() : f;
|
|
25
|
+
return a || (a = new v()), g(s, t, p, i, a);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return n ? (a || (a = new v()), L(r, f, p, i, g, a)) : !1;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
K as default
|
|
32
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import R from "./_Stack.js";
|
|
2
|
+
import O from "./_baseIsEqual.js";
|
|
3
|
+
var _ = 1, h = 2;
|
|
4
|
+
function L(e, p, i, v) {
|
|
5
|
+
var n = i.length, f = n;
|
|
6
|
+
if (e == null)
|
|
7
|
+
return !f;
|
|
8
|
+
for (e = Object(e); n--; ) {
|
|
9
|
+
var r = i[n];
|
|
10
|
+
if (r[2] ? r[1] !== e[r[0]] : !(r[0] in e))
|
|
11
|
+
return !1;
|
|
12
|
+
}
|
|
13
|
+
for (; ++n < f; ) {
|
|
14
|
+
r = i[n];
|
|
15
|
+
var u = r[0], l = e[u], A = r[1];
|
|
16
|
+
if (r[2]) {
|
|
17
|
+
if (l === void 0 && !(u in e))
|
|
18
|
+
return !1;
|
|
19
|
+
} else {
|
|
20
|
+
var E = new R(), s;
|
|
21
|
+
if (!(s === void 0 ? O(A, l, _ | h, v, E) : s))
|
|
22
|
+
return !1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return !0;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
L as default
|
|
29
|
+
};
|