@useinsider/guido 1.0.3-beta.ce4cdcb → 1.0.3-beta.cedc8cb

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.
Files changed (115) hide show
  1. package/dist/@types/generic.d.ts +13 -0
  2. package/dist/components/Guido.vue.d.ts +3 -2
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +99 -70
  5. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +19 -0
  6. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +28 -0
  7. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +38 -0
  8. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +2 -0
  9. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +17 -0
  10. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +37 -0
  11. package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +2 -0
  12. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +20 -0
  13. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +44 -0
  14. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +16 -0
  15. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +17 -0
  16. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +27 -0
  17. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -0
  18. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +18 -0
  19. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +16 -0
  20. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +2 -0
  21. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +24 -0
  22. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +64 -0
  23. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +2 -0
  24. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
  25. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +107 -0
  26. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -0
  27. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +18 -0
  28. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +12 -0
  29. package/dist/components/wrappers/WpDrawer.vue.d.ts +6 -4
  30. package/dist/components/wrappers/WpDrawer.vue.js +6 -4
  31. package/dist/composables/useApiErrorTracking.d.ts +26 -0
  32. package/dist/composables/useApiErrorTracking.js +120 -0
  33. package/dist/composables/useErrorTracking.d.ts +30 -0
  34. package/dist/composables/useErrorTracking.js +98 -0
  35. package/dist/composables/useHttp.js +89 -52
  36. package/dist/composables/useStripo.js +160 -61
  37. package/dist/composables/useStripoErrorCategory.d.ts +26 -0
  38. package/dist/composables/useStripoErrorCategory.js +86 -0
  39. package/dist/composables/useStripoSlackNotifier.d.ts +8 -0
  40. package/dist/composables/useStripoSlackNotifier.js +47 -0
  41. package/dist/config/compiler/unsubscribeCompilerRules.js +42 -29
  42. package/dist/config/migrator/index.d.ts +1 -1
  43. package/dist/config/migrator/index.js +7 -6
  44. package/dist/config/migrator/unsubscribeMigrator.d.ts +1 -0
  45. package/dist/config/migrator/unsubscribeMigrator.js +124 -0
  46. package/dist/enums/defaults.js +6 -3
  47. package/dist/enums/extensions/recommendationBlock.d.ts +16 -0
  48. package/dist/enums/extensions/recommendationBlock.js +80 -0
  49. package/dist/enums/unsubscribe.d.ts +19 -0
  50. package/dist/enums/unsubscribe.js +39 -6
  51. package/dist/extensions/Blocks/Checkbox/control.js +35 -39
  52. package/dist/extensions/Blocks/RadioButton/control.js +33 -37
  53. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  54. package/dist/extensions/Blocks/Recommendation/block.d.ts +10 -0
  55. package/dist/extensions/Blocks/Recommendation/block.js +27 -0
  56. package/dist/extensions/Blocks/Recommendation/control.d.ts +29 -0
  57. package/dist/extensions/Blocks/Recommendation/control.js +277 -0
  58. package/dist/extensions/Blocks/Recommendation/extension.d.ts +2 -0
  59. package/dist/extensions/Blocks/Recommendation/extension.js +10 -0
  60. package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +4 -0
  61. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +51 -0
  62. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +19 -0
  63. package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +4 -0
  64. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +32 -0
  65. package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +555 -0
  66. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +266 -0
  67. package/dist/extensions/Blocks/Recommendation/template.d.ts +6 -0
  68. package/dist/extensions/Blocks/Recommendation/template.js +200 -0
  69. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +7 -0
  70. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +28 -0
  71. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +32 -0
  72. package/dist/extensions/Blocks/Unsubscribe/block.js +131 -0
  73. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
  74. package/dist/extensions/Blocks/Unsubscribe/control.js +167 -0
  75. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
  76. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +42 -0
  77. package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +2 -0
  78. package/dist/extensions/Blocks/Unsubscribe/extension.js +21 -0
  79. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
  80. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
  81. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +4 -0
  82. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +35 -0
  83. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +42 -0
  84. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +4 -0
  85. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +10 -0
  86. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +12 -0
  87. package/dist/extensions/Blocks/Unsubscribe/template.js +22 -0
  88. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
  89. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
  90. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -0
  91. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +6 -0
  92. package/dist/extensions/Blocks/common-control.d.ts +66 -0
  93. package/dist/extensions/Blocks/common-control.js +102 -0
  94. package/dist/guido.css +1 -1
  95. package/dist/mock/api/recommendation.d.ts +2 -0
  96. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +83 -71
  97. package/dist/services/recommendationApi.d.ts +6 -0
  98. package/dist/services/recommendationApi.js +43 -0
  99. package/dist/services/slackNotificationService.d.ts +110 -0
  100. package/dist/services/slackNotificationService.js +167 -0
  101. package/dist/services/stripoApi.js +49 -19
  102. package/dist/services/stripoErrorDeduplicationService.d.ts +75 -0
  103. package/dist/services/stripoErrorDeduplicationService.js +91 -0
  104. package/dist/services/unsubscribeApi.d.ts +4 -0
  105. package/dist/services/unsubscribeApi.js +16 -0
  106. package/dist/stores/config.d.ts +96 -0
  107. package/dist/stores/config.js +17 -0
  108. package/dist/stores/editor.d.ts +21 -0
  109. package/dist/stores/editor.js +2 -1
  110. package/dist/stores/unsubscribe.d.ts +253 -5
  111. package/dist/stores/unsubscribe.js +126 -6
  112. package/dist/utils/genericUtil.d.ts +1 -0
  113. package/dist/utils/genericUtil.js +8 -7
  114. package/dist/utils/templatePreparation.js +17 -16
  115. package/package.json +2 -2
@@ -0,0 +1,24 @@
1
+ import a from "./UnsubscribePageSelection.vue2.js";
2
+ /* empty css */
3
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var r = this, e = r._self._c, t = r._self._setupProxy;
6
+ return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.closeModal, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
7
+ return [e(t.UnsubscribeBreadcrumb, { staticClass: "px-5 py-3" })];
8
+ }, proxy: !0 }]) }, [e("div", { staticClass: "d-g templates-wrapper" }, r._l(t.unsubscribeStore.getTemplatesByActiveType, function(s) {
9
+ return e("div", { key: s.id, staticClass: "template-wrapper", on: { click: function(u) {
10
+ return t.selectTemplate(s.id);
11
+ } } }, [e(t.InContainer, { staticClass: "template-container o-h", class: { selected: t.unsubscribeStore.getSelectedTemplateByActiveType === s.id }, attrs: { border: t.getBorderClass(s.id) } }, [e("div", { staticClass: "w-1 h-1 d-f j-c-c a-i-c" }, [e("img", { staticClass: "w-1 h-1 thumbnail o-h", attrs: { alt: s.name, src: s.thumbnail } })])]), e("div", { staticClass: "mt-1 f-s-1" }, [r._v(" " + r._s(s.name) + " ")])], 1);
12
+ }), 0)]);
13
+ }, i = [], c = /* @__PURE__ */ n(
14
+ a,
15
+ o,
16
+ i,
17
+ !1,
18
+ null,
19
+ "a86fc486"
20
+ );
21
+ const _ = c.exports;
22
+ export {
23
+ _ as default
24
+ };
@@ -0,0 +1,64 @@
1
+ import { defineComponent as f, ref as y, computed as n, watch as T } from "vue";
2
+ import g from "../../wrappers/WpDrawer.vue.js";
3
+ import { useToaster as S } from "../../../composables/useToaster.js";
4
+ import { useTranslations as v } from "../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as B } from "../../../enums/toaster.js";
6
+ import { useUnsubscribeStore as w } from "../../../stores/unsubscribe.js";
7
+ import { InContainer as C } from "@useinsider/design-system-vue";
8
+ import h from "./UnsubscribeBreadcrumb.vue.js";
9
+ const E = /* @__PURE__ */ f({
10
+ __name: "UnsubscribePageSelection",
11
+ setup(_) {
12
+ const s = v(), e = w(), { showToaster: a } = S(), o = y(!1), c = n(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = n(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), p = n(() => ({
13
+ primaryButton: {
14
+ styling: "solid",
15
+ type: "primary",
16
+ labelText: c.value,
17
+ loadingStatus: o.value,
18
+ disabledStatus: !1
19
+ },
20
+ cancelOrBackButton: {
21
+ styling: "ghost",
22
+ type: "secondary",
23
+ labelText: i.value,
24
+ disabledStatus: o.value
25
+ }
26
+ })), u = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", r = (t) => {
27
+ e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
28
+ t();
29
+ }, 500);
30
+ }, m = () => {
31
+ if (e.isActiveTypeFirstInCollection) {
32
+ r(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
33
+ return;
34
+ }
35
+ e.setPreviousType();
36
+ }, d = () => {
37
+ if (e.isActiveTypeLastInCollection) {
38
+ o.value = !0;
39
+ const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t);
40
+ e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
41
+ detail: {
42
+ collectionType: t,
43
+ selectedPages: l
44
+ }
45
+ })), r(() => {
46
+ o.value = !1, a({
47
+ type: B.Success,
48
+ message: s("global-unsubscribe.pages-were-attached")
49
+ });
50
+ });
51
+ return;
52
+ }
53
+ e.setNextType();
54
+ }, b = (t) => {
55
+ e.setSelectedTemplate(t);
56
+ };
57
+ return T(() => e.pageSelectionDrawerStatus, (t) => {
58
+ t && e.pageSelectionUpdateStatus && e.fetchTemplates();
59
+ }), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: a, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: p, getBorderClass: u, closeModal: r, handleBack: m, handleSave: d, selectTemplate: b, WpDrawer: g, InContainer: C, UnsubscribeBreadcrumb: h };
60
+ }
61
+ });
62
+ export {
63
+ E as default
64
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import n from "./UnsubscribeTypeSelection.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var i = function() {
5
+ var e = this, s = e._self._c, t = e._self._setupProxy;
6
+ return s(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.typeSelectionDrawerStatus, "title-text": t.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.selectCollection } }, [s(t.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: t.isSelecting, "segment-list": t.segmentList, selected: t.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": t.skeletonStatus }, on: { click: t.changeCollection } })], 1);
7
+ }, r = [], c = /* @__PURE__ */ o(
8
+ n,
9
+ i,
10
+ r,
11
+ !1,
12
+ null,
13
+ "dd57102d"
14
+ );
15
+ const d = c.exports;
16
+ export {
17
+ d as default
18
+ };
@@ -0,0 +1,107 @@
1
+ import { defineComponent as h, ref as b, computed as m, watch as _ } from "vue";
2
+ import v from "../../wrappers/WpDrawer.vue.js";
3
+ import { useToaster as B } from "../../../composables/useToaster.js";
4
+ import { useTranslations as N } from "../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as U } from "../../../enums/toaster.js";
6
+ import { PAGE_TYPES as l, ACADEMY_LINK as w, UNSUBSCRIBE_PAGES_LINK as P, TYPE_TRANSLATIONS as R } from "../../../enums/unsubscribe.js";
7
+ import { useUnsubscribeStore as D } from "../../../stores/unsubscribe.js";
8
+ import { InSegments as I } from "@useinsider/design-system-vue";
9
+ const z = /* @__PURE__ */ h({
10
+ __name: "UnsubscribeTypeSelection",
11
+ setup(G) {
12
+ const e = N(), { showToaster: f } = B(), t = D(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
13
+ "unsubscription-preference.select-unsubscribe-page-description",
14
+ { action: `<a href="${w}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
15
+ ), T = m(() => [
16
+ {
17
+ description: e("unsubscription-preference.type-global-unsubscribe-description"),
18
+ icon: "line-contact-global-unsub-page",
19
+ text: e("unsubscription-preference.type-global-unsubscribe"),
20
+ value: l.GLOBAL_UNSUBSCRIBE,
21
+ disable: t.isGlobalUnsubscribeDisabled,
22
+ position: "bottom",
23
+ tooltipText: t.isGlobalUnsubscribeDisabled ? e("unsubscription-preference.global-unsub-added") : ""
24
+ },
25
+ {
26
+ description: e("unsubscription-preference.type-subscription-preferences-center-description"),
27
+ icon: "line-contact-sub-pref-center-page",
28
+ text: e("unsubscription-preference.type-subscription-preferences-center"),
29
+ value: l.SUBSCRIPTION_PREFERENCE_CENTER,
30
+ disable: t.isSubscriptionPreferencesCenterDisabled,
31
+ tooltipText: t.isSubscriptionPreferencesCenterDisabled ? e("unsubscription-preference.pref-center-added") : ""
32
+ }
33
+ ]), y = m(() => ({
34
+ primaryButton: {
35
+ styling: "solid",
36
+ type: "primary",
37
+ labelText: e(
38
+ n.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
39
+ ),
40
+ loadingStatus: n.value,
41
+ disabledStatus: !1,
42
+ skeletonStatus: i.value,
43
+ skeletonSizing: { width: 168, height: 40 }
44
+ },
45
+ cancelOrBackButton: {
46
+ styling: "ghost",
47
+ type: "secondary",
48
+ labelText: e("products.cancel"),
49
+ disabledStatus: n.value,
50
+ skeletonStatus: i.value,
51
+ skeletonSizing: { width: 78, height: 40 }
52
+ }
53
+ })), d = (s) => {
54
+ t.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel")), s && setTimeout(() => {
55
+ s();
56
+ }, 500);
57
+ }, E = (s) => {
58
+ o.value = s;
59
+ }, g = () => {
60
+ const s = t.hasTemplatesByCollectionType, r = [];
61
+ if (Object.entries(s).forEach(([c, p]) => {
62
+ p || r.push(Number(c));
63
+ }), r.length === 0)
64
+ return !0;
65
+ const a = r.map((c) => R[c]);
66
+ let u = "";
67
+ if (r.length === 1)
68
+ u = e("unsubscription-preference.create-page-to-continue", {
69
+ page: a[0]
70
+ });
71
+ else if (r.length === 2)
72
+ u = e("unsubscription-preference.create-pages-to-continue", {
73
+ page1: a[0],
74
+ page2: a[1]
75
+ });
76
+ else {
77
+ const c = a.pop() ?? "", p = a.join(", ");
78
+ u = e("unsubscription-preference.create-multiple-pages-to-continue", {
79
+ pages: p,
80
+ lastPage: c
81
+ });
82
+ }
83
+ return f({
84
+ type: U.Warning,
85
+ message: u,
86
+ actionButton: {
87
+ text: "Go to Unsubscribe Pages",
88
+ onClick: () => {
89
+ window.location.href = P;
90
+ }
91
+ }
92
+ }), !1;
93
+ }, C = async () => {
94
+ if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !g()) {
95
+ n.value = !1, d();
96
+ return;
97
+ }
98
+ n.value = !1, t.typeSelectionDrawerStatus = !1, t.pageSelectionDrawerStatus = !0;
99
+ };
100
+ return _(() => t.typeSelectionDrawerStatus, (s) => {
101
+ s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, t.isGlobalUnsubscribeDisabled && (o.value = t.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
102
+ }), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: g, selectCollection: C, WpDrawer: v, InSegments: I };
103
+ }
104
+ });
105
+ export {
106
+ z as default
107
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import o from "./UnsubscribeWrapper.vue2.js";
2
+ import t from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var _ = function() {
4
+ var s;
5
+ var e = this, n = e._self._c, r = e._self._setupProxy;
6
+ return (s = r.config.extensions) != null && s.unsubscribe ? n("div", [n(r.UnsubscribeTypeSelection), n(r.UnsubscribePageSelection)], 1) : e._e();
7
+ }, c = [], i = /* @__PURE__ */ t(
8
+ o,
9
+ _,
10
+ c,
11
+ !1,
12
+ null,
13
+ null
14
+ );
15
+ const l = i.exports;
16
+ export {
17
+ l as default
18
+ };
@@ -0,0 +1,12 @@
1
+ import { defineComponent as t, defineAsyncComponent as e } from "vue";
2
+ import { useConfig as r } from "../../../composables/useConfig.js";
3
+ const m = /* @__PURE__ */ t({
4
+ __name: "UnsubscribeWrapper",
5
+ setup(i) {
6
+ const n = e(() => import("./UnsubscribePageSelection.vue.js")), o = e(() => import("./UnsubscribeTypeSelection.vue.js")), { config: s } = r();
7
+ return { __sfc: !0, UnsubscribePageSelection: n, UnsubscribeTypeSelection: o, config: s };
8
+ }
9
+ });
10
+ export {
11
+ m as default
12
+ };
@@ -2,7 +2,7 @@ import type { FooterButtonGroupOptions } from '@@/Types/wrappers/wp-drawer';
2
2
  interface Props {
3
3
  id: string;
4
4
  className?: string;
5
- size?: string;
5
+ size?: 'small' | 'medium' | 'large';
6
6
  closeOnOutsideClick?: boolean;
7
7
  descriptionStatus?: boolean;
8
8
  descriptionText?: string;
@@ -10,9 +10,11 @@ interface Props {
10
10
  status: boolean;
11
11
  titleText: string;
12
12
  }
13
- declare var __VLS_12: {};
13
+ declare var __VLS_12: {}, __VLS_14: {};
14
14
  type __VLS_Slots = {} & {
15
- default?: (props: typeof __VLS_12) => any;
15
+ headerBottomSlot?: (props: typeof __VLS_12) => any;
16
+ } & {
17
+ default?: (props: typeof __VLS_14) => any;
16
18
  };
17
19
  declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
18
20
  className: string;
@@ -32,7 +34,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
32
34
  descriptionText: string;
33
35
  }>>>, {
34
36
  className: string;
35
- size: string;
37
+ size: "small" | "medium" | "large";
36
38
  closeOnOutsideClick: boolean;
37
39
  descriptionStatus: boolean;
38
40
  descriptionText: string;
@@ -1,6 +1,6 @@
1
1
  import r from "./WpDrawer.vue2.js";
2
2
  import s from "../../_virtual/_plugin-vue2_normalizer.js";
3
- var i = function() {
3
+ var u = function() {
4
4
  var t = this, n = t._self._c, e = t._self._setupProxy;
5
5
  return n(e.InDrawer, { class: t.className, attrs: { id: t.id, "footer-status": "", "close-on-outside-click": t.closeOnOutsideClick, "description-status": t.descriptionStatus, "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, size: t.size, status: t.status, "title-text": t.titleText }, on: { cancelOrBackButtonEvent: function(o) {
6
6
  return e.emit("cancelOrBackButtonEvent");
@@ -8,13 +8,15 @@ var i = function() {
8
8
  return e.emit("onCloseEvent");
9
9
  }, primaryButtonEvent: function(o) {
10
10
  return e.emit("primaryButtonEvent");
11
- } }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
11
+ } }, scopedSlots: t._u([t.$slots.headerBottomSlot ? { key: "headerBottomSlot", fn: function() {
12
+ return [t._t("headerBottomSlot")];
13
+ }, proxy: !0 } : null, { key: "contentSlot", fn: function() {
12
14
  return [n("div", [t._t("default")], 2)];
13
15
  }, proxy: !0 }], null, !0) });
14
- }, u = [], c = /* @__PURE__ */ s(
16
+ }, i = [], c = /* @__PURE__ */ s(
15
17
  r,
16
- i,
17
18
  u,
19
+ i,
18
20
  !1,
19
21
  null,
20
22
  null
@@ -0,0 +1,26 @@
1
+ import type { HttpError, HttpResponse } from '@@/Composables/useHttp';
2
+ /**
3
+ * API error context with request/response details
4
+ */
5
+ export interface ApiErrorContext {
6
+ endpoint: string;
7
+ method?: string;
8
+ statusCode?: number;
9
+ statusText?: string;
10
+ errorType?: 'http_error' | 'network_error' | 'parsing_error' | 'timeout';
11
+ attemptNumber?: number;
12
+ retryable?: boolean;
13
+ [key: string]: unknown;
14
+ }
15
+ /**
16
+ * Tracks API failures including HTTP errors, network issues, and data parsing failures
17
+ * Integrates with the main error tracking system (Sentry + FullStory)
18
+ */
19
+ export declare const useApiErrorTracking: () => {
20
+ captureHttpError: (error: HttpError, endpoint: string, options?: Omit<ApiErrorContext, "endpoint">) => ApiErrorContext;
21
+ captureNetworkError: (error: Error, endpoint: string, options?: Omit<ApiErrorContext, "endpoint">) => ApiErrorContext;
22
+ captureParsingError: (error: unknown, endpoint: string, responseData?: unknown, options?: Omit<ApiErrorContext, "endpoint">) => ApiErrorContext;
23
+ captureTimeoutError: (endpoint: string, timeoutMs: number, options?: Omit<ApiErrorContext, "endpoint">) => ApiErrorContext;
24
+ withApiErrorTracking: <T>(apiCall: () => Promise<HttpResponse<T>>, endpoint: string, method?: string, options?: Omit<ApiErrorContext, "endpoint">) => Promise<HttpResponse<T>>;
25
+ withParsingErrorTracking: <T>(parser: () => T, endpoint: string, rawResponse?: unknown, options?: Omit<ApiErrorContext, "endpoint">) => T;
26
+ };
@@ -0,0 +1,120 @@
1
+ import { useErrorTracking as p } from "./useErrorTracking.js";
2
+ const h = () => {
3
+ const { captureError: i } = p(), E = (e, t, o = {}) => {
4
+ const s = {
5
+ endpoint: t,
6
+ method: o.method,
7
+ statusCode: e.status,
8
+ statusText: e.statusText,
9
+ errorType: "http_error",
10
+ component: "api-client",
11
+ operation: `http_error_${e.status}`,
12
+ retryable: e.status ? e.status >= 500 : !1,
13
+ // 5xx errors are retryable
14
+ ...o
15
+ }, r = new Error(
16
+ `HTTP ${e.status} ${e.statusText} - ${t}`
17
+ );
18
+ return i(r, s), s;
19
+ }, u = (e, t, o = {}) => {
20
+ const s = e.message, r = s.toLowerCase().includes("timeout"), n = e.name === "AbortError";
21
+ let a;
22
+ r ? a = "network_timeout" : n ? a = "request_abort" : a = "network_error";
23
+ const c = {
24
+ endpoint: t,
25
+ errorType: "network_error",
26
+ component: "api-client",
27
+ operation: a,
28
+ retryable: !0,
29
+ ...o
30
+ }, l = new Error(
31
+ `Network Error (${String(c.operation)}) - ${String(t)}: ${s}`
32
+ );
33
+ return i(l, c), c;
34
+ }, g = (e, t, o, s = {}) => {
35
+ const r = e instanceof Error ? e.message : String(e), n = {
36
+ endpoint: t,
37
+ errorType: "parsing_error",
38
+ component: "api-client",
39
+ operation: "response_parsing_failed",
40
+ retryable: !1,
41
+ responsePreview: o instanceof Object ? JSON.stringify(o).slice(0, 200) : String(o).slice(0, 200),
42
+ ...s
43
+ }, a = new Error(
44
+ `Failed to parse API response from ${t}: ${r}`
45
+ );
46
+ return i(a, n), n;
47
+ }, m = (e, t, o = {}) => {
48
+ const s = {
49
+ endpoint: e,
50
+ errorType: "timeout",
51
+ component: "api-client",
52
+ operation: "request_timeout",
53
+ timeoutMs: t,
54
+ retryable: !0,
55
+ ...o
56
+ }, r = new Error(
57
+ `Request to ${e} timed out after ${t}ms`
58
+ );
59
+ return i(r, s), s;
60
+ };
61
+ return {
62
+ captureHttpError: E,
63
+ captureNetworkError: u,
64
+ captureParsingError: g,
65
+ captureTimeoutError: m,
66
+ withApiErrorTracking: async (e, t, o = "GET", s = {}) => {
67
+ try {
68
+ return await e();
69
+ } catch (r) {
70
+ if (r instanceof Error)
71
+ if (r.message === "Request timeout") {
72
+ const n = s.timeoutMs || 1e4;
73
+ m(t, n, {
74
+ method: o,
75
+ ...s
76
+ });
77
+ } else if (r.name === "AbortError" || r.message.includes("cancelled"))
78
+ u(r, t, {
79
+ method: o,
80
+ ...s
81
+ });
82
+ else if (r.message.includes("HTTP Error")) {
83
+ const n = r.message.match(/HTTP Error: (\d+)/), a = n ? parseInt(n[1]) : void 0, c = {
84
+ message: r.message,
85
+ status: a,
86
+ statusText: r.message
87
+ };
88
+ E(c, t, {
89
+ method: o,
90
+ ...s
91
+ });
92
+ } else
93
+ u(r, t, {
94
+ method: o,
95
+ ...s
96
+ });
97
+ else {
98
+ const n = new Error(String(r));
99
+ u(n, t, {
100
+ method: o,
101
+ ...s
102
+ });
103
+ }
104
+ throw r;
105
+ }
106
+ },
107
+ withParsingErrorTracking: (e, t, o, s = {}) => {
108
+ try {
109
+ return e();
110
+ } catch (r) {
111
+ throw g(r, t, o, {
112
+ ...s
113
+ }), r;
114
+ }
115
+ }
116
+ };
117
+ };
118
+ export {
119
+ h as useApiErrorTracking
120
+ };
@@ -0,0 +1,30 @@
1
+ import type { Ref } from 'vue';
2
+ /**
3
+ * Error context for error tracking and correlation
4
+ */
5
+ export interface ErrorContext {
6
+ component?: string;
7
+ operation?: string;
8
+ templateId?: string;
9
+ userId?: string;
10
+ [key: string]: unknown;
11
+ }
12
+ /**
13
+ * Error tracking service for capturing and reporting errors
14
+ * Integrates with Sentry and FullStory for comprehensive error tracking
15
+ */
16
+ export declare const useErrorTracking: () => {
17
+ traceId: string;
18
+ errorCount: Readonly<Ref<number>>;
19
+ lastError: Readonly<Ref<Error | null>>;
20
+ captureError: (error: Error, context?: ErrorContext) => ErrorContext;
21
+ captureStripoError: (error: unknown, operation: string, additionalContext?: Record<string, unknown>, shouldLogToSentry?: boolean) => ErrorContext;
22
+ captureTimeoutError: (operation: string, timeoutMs: number, additionalContext?: Record<string, unknown>) => ErrorContext;
23
+ createTimeoutPromise: <T>(ms: number, operation: string, additionalContext?: Record<string, unknown>) => Promise<T>;
24
+ withTimeout: <T>(promise: Promise<T>, ms: number, operation: string, additionalContext?: Record<string, unknown>) => Promise<T>;
25
+ getErrorSummary: () => {
26
+ errorCount: number;
27
+ lastError: Error | null;
28
+ };
29
+ resetErrorTracking: () => void;
30
+ };
@@ -0,0 +1,98 @@
1
+ import { inject as S, ref as g } from "vue";
2
+ const f = () => {
3
+ const s = S("traceId", ""), n = g(0), i = g(null), d = (r, e = {}) => {
4
+ const t = r instanceof Error ? r.message : String(r), o = {
5
+ ...e,
6
+ errorMessage: t,
7
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
8
+ userAgent: navigator.userAgent,
9
+ url: window.location.href,
10
+ traceId: s || void 0
11
+ };
12
+ return n.value += 1, r instanceof Error && (i.value = r), window.Sentry && window.Sentry.captureException(r, {
13
+ tags: {
14
+ component: e.component,
15
+ operation: e.operation,
16
+ source: "guido"
17
+ },
18
+ contexts: {
19
+ guido: o
20
+ },
21
+ extra: {
22
+ traceId: s || void 0
23
+ }
24
+ }), window.FS && window.FS("event", "guido_error", {
25
+ errorMessageStr: t,
26
+ componentStr: e.component || "unknown",
27
+ operationStr: e.operation || "unknown",
28
+ templateIdStr: e.templateId || "",
29
+ userIdStr: e.userId || "",
30
+ traceIdStr: s || "",
31
+ errorCountInt: n.value,
32
+ timestampInt: Date.now()
33
+ }), o;
34
+ }, c = (r, e, t = {}, o = !0) => {
35
+ const a = r instanceof Error ? r : new Error(String(r)), u = a.message, p = {
36
+ component: "stripo-wrapper",
37
+ operation: e,
38
+ ...t,
39
+ errorMessage: u,
40
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
41
+ userAgent: navigator.userAgent,
42
+ url: window.location.href
43
+ };
44
+ return n.value += 1, i.value = a, o && window.Sentry && window.Sentry.captureException(a, {
45
+ tags: {
46
+ component: "stripo-wrapper",
47
+ operation: e
48
+ },
49
+ contexts: {
50
+ guido: p
51
+ }
52
+ }), o && window.FS && window.FS("event", "guido_stripo_error", {
53
+ errorMessageStr: u,
54
+ operationStr: e || "unknown",
55
+ timestampInt: Date.now()
56
+ }), p;
57
+ }, w = (r, e, t = {}) => {
58
+ const o = new Error(
59
+ `Timeout waiting for Stripo ${r} (${e}ms)`
60
+ );
61
+ return c(o, `${r}_timeout`, {
62
+ timeoutMs: e,
63
+ ...t
64
+ });
65
+ }, m = (r, e, t = {}) => new Promise((o, a) => {
66
+ setTimeout(() => {
67
+ const u = w(
68
+ e,
69
+ r,
70
+ t
71
+ );
72
+ a(new Error(u.errorMessage));
73
+ }, r);
74
+ });
75
+ return {
76
+ traceId: s,
77
+ errorCount: n,
78
+ lastError: i,
79
+ captureError: d,
80
+ captureStripoError: c,
81
+ captureTimeoutError: w,
82
+ createTimeoutPromise: m,
83
+ withTimeout: (r, e, t, o = {}) => Promise.race([
84
+ r,
85
+ m(e, t, o)
86
+ ]),
87
+ getErrorSummary: () => ({
88
+ errorCount: n.value,
89
+ lastError: i.value
90
+ }),
91
+ resetErrorTracking: () => {
92
+ n.value = 0, i.value = null;
93
+ }
94
+ };
95
+ };
96
+ export {
97
+ f as useErrorTracking
98
+ };