@useinsider/guido 3.2.0-beta.6d12eec → 3.2.0-beta.8b4780a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/composables/useActionsApi.js +4 -4
- package/dist/composables/useSave.js +1 -1
- package/dist/composables/useStripo.js +29 -30
- package/dist/config/compiler/recommendationCompilerRules.js +72 -67
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
- package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
- package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +324 -218
- package/dist/package.json.js +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/static/styles/components/button.css.js +16 -9
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/static/styles/components/narrow-panel.css.js +52 -0
- package/package.json +3 -3
- package/dist/composables/useFullStoryBridge.js +0 -34
- package/dist/src/composables/useFullStoryBridge.d.ts +0 -11
|
@@ -3,15 +3,15 @@ var h = (n, i, e) => i in n ? d(n, i, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var u = (n, i, e) => h(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 _, BlockCompositionType as S, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
-
import { getDefaultTemplate as
|
|
6
|
+
import { Block as _, BlockCompositionType as S, BlockType as L, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { getDefaultTemplate as v } from "./template.js";
|
|
8
8
|
import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
|
|
9
9
|
import { parsePageList as p } from "./utils/utils.js";
|
|
10
|
-
const
|
|
10
|
+
const g = "unsubscribe-block", T = 'a[data-unsubscribe-link="true"]', f = ".unsubscribe-block-v2", B = "{{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
|
|
14
|
+
class I extends _ {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
u(this, "selectEventListener", null);
|
|
@@ -19,7 +19,7 @@ class R extends _ {
|
|
|
19
19
|
u(this, "currentNode");
|
|
20
20
|
}
|
|
21
21
|
getId() {
|
|
22
|
-
return
|
|
22
|
+
return g;
|
|
23
23
|
}
|
|
24
24
|
getIcon() {
|
|
25
25
|
return "unsubscribe-icon";
|
|
@@ -34,7 +34,7 @@ class R extends _ {
|
|
|
34
34
|
return this.api.translate("Unsubscribe Block Description");
|
|
35
35
|
}
|
|
36
36
|
getTemplate() {
|
|
37
|
-
return
|
|
37
|
+
return v();
|
|
38
38
|
}
|
|
39
39
|
onSelect(e) {
|
|
40
40
|
this.currentNode = e, !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
@@ -66,7 +66,7 @@ class R extends _ {
|
|
|
66
66
|
try {
|
|
67
67
|
if (!this.currentNode)
|
|
68
68
|
return;
|
|
69
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).
|
|
69
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${L.EMPTY_CONTAINER}/>`).apply(new b("Removed unsubscribe block due to cancel"));
|
|
70
70
|
} catch (e) {
|
|
71
71
|
console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
|
|
72
72
|
}
|
|
@@ -77,14 +77,14 @@ class R extends _ {
|
|
|
77
77
|
_updateBlock(e, r) {
|
|
78
78
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
79
79
|
return;
|
|
80
|
-
const s = this.currentNode.querySelector(
|
|
80
|
+
const s = this.currentNode.querySelector(T);
|
|
81
81
|
if (!s)
|
|
82
82
|
return;
|
|
83
83
|
const t = this._getMergeTag(e);
|
|
84
84
|
this.api.getDocumentModifier().modifyHtml(s).setAttribute("href", t).apply(new b(`Updated unsubscribe link to ${t}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, r).apply(new b("Updated unsubscribe block metadata"));
|
|
85
85
|
}
|
|
86
86
|
_getMergeTag(e) {
|
|
87
|
-
return
|
|
87
|
+
return C[e] ?? B;
|
|
88
88
|
}
|
|
89
89
|
_openDrawer() {
|
|
90
90
|
if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
|
|
@@ -130,6 +130,6 @@ class R extends _ {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
export {
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
g as UNSUBSCRIBE_BLOCK_ID,
|
|
134
|
+
I as UnsubscribeBlock
|
|
135
135
|
};
|