@useinsider/guido 3.30.0-beta.949c781 → 3.30.0-beta.e841504

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.
@@ -3,7 +3,7 @@ import r from "./AssignStrategyDrawer.vue2.js";
3
3
  import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var a = function() {
5
5
  var e = this, s = e._self._c, t = e._self._setupProxy;
6
- return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
6
+ return t.hasOpened ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, show: t.store.assignStrategyDrawerStatus, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
7
7
  return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [t.strategiesLoading ? s(t.InSkeleton, { staticClass: "assign-strategy-select-skeleton", attrs: { sizing: t.SELECT_SKELETON_SIZING } }) : s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select w-23-s", attrs: { id: "assign-strategy-select", "create-button-visible": "", "info-box-position": "bottom right", "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { create: function(c) {
8
8
  return t.store.openStrategyCreation();
9
9
  }, infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
@@ -1,47 +1,48 @@
1
- import { defineComponent as b, defineAsyncComponent as T, ref as w, computed as o, watch as N } from "vue";
1
+ import { defineComponent as N, defineAsyncComponent as E, ref as y, computed as o, watch as R } from "vue";
2
2
  import "@useinsider/design-system-organisms/style";
3
- import { useToaster as R } from "../../../../composables/useToaster.js";
4
- import { useTranslations as P } from "../../../../composables/useTranslations.js";
5
- import { DOTTED_DATE_LOCALE as U } from "../../../../enums/date.js";
6
- import { URLS as G } from "../../../../enums/extensions/recommendationBlock.js";
7
- import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
8
- import { useRecommendationExtensionStore as M } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import { commitStrategyChange as E } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
10
- import $ from "./StrategyInfoBoxContent.vue.js";
11
- import { formatShortDate as z } from "../../../../utils/dateUtil.js";
3
+ import { useToaster as P } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as U } from "../../../../composables/useTranslations.js";
5
+ import { DOTTED_DATE_LOCALE as G } from "../../../../enums/date.js";
6
+ import { URLS as M } from "../../../../enums/extensions/recommendationBlock.js";
7
+ import { ToasterTypeOptions as p } from "../../../../enums/toaster.js";
8
+ import { useRecommendationExtensionStore as $ } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import { commitStrategyChange as O } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
10
+ import z from "./StrategyInfoBoxContent.vue.js";
11
+ import { formatShortDate as H } from "../../../../utils/dateUtil.js";
12
12
  import { asText as D } from "../../../../utils/genericUtil.js";
13
- import { escapeHtml as H } from "../../../../utils/htmlEscape.js";
14
- import { InSkeleton as O } from "@useinsider/design-system-vue";
15
- const it = /* @__PURE__ */ b({
13
+ import { escapeHtml as F } from "../../../../utils/htmlEscape.js";
14
+ import { InSkeleton as I } from "@useinsider/design-system-vue";
15
+ const ct = /* @__PURE__ */ N({
16
16
  __name: "AssignStrategyDrawer",
17
- setup(F) {
18
- const g = () => import("@useinsider/design-system-organisms"), p = (t, r) => ({
19
- render: (s) => s(O, { props: { sizing: { width: t, height: r } } })
20
- }), I = T({
17
+ setup(K) {
18
+ const g = () => import("@useinsider/design-system-organisms"), f = (t, r) => ({
19
+ render: (s) => s(I, { props: { sizing: { width: t, height: r } } })
20
+ }), h = E({
21
21
  loader: async () => (await g()).OrgStrategyDetailModal,
22
- loadingComponent: p(480, 240),
22
+ loadingComponent: f(480, 240),
23
23
  delay: 0
24
- }), h = T({
24
+ }), x = E({
25
25
  loader: async () => (await g()).OrgStrategyDropdown
26
- }), i = "guido-edit-strategy-", x = { width: 480, height: 42 }, a = P(), e = M(), { showToaster: c } = R(), n = w(null), d = "legacy", l = w(!1), A = o(() => e.strategiesLoading || e.legacyConversionLoading), C = o(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: G.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
- N(() => e.assignStrategyDrawerStatus, (t) => {
26
+ }), i = "guido-edit-strategy-", A = { width: 480, height: 42 }, a = U(), e = $(), { showToaster: c } = P(), n = y(null), d = "legacy", l = y(!1), S = y(!1), C = o(() => e.strategiesLoading || e.legacyConversionLoading), L = o(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: M.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
+ R(() => e.assignStrategyDrawerStatus, (t) => {
28
28
  if (!t)
29
29
  return;
30
+ S.value = !0;
30
31
  const { strategyId: r } = e.recommendationConfigs;
31
32
  n.value = r || (e.isLegacyStrategyBlock ? d : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
32
33
  c({
33
- type: u.Error,
34
+ type: p.Error,
34
35
  message: a("discovery-strategy.error-description")
35
36
  });
36
37
  });
37
38
  });
38
- const f = (t) => {
39
+ const v = (t) => {
39
40
  const r = D(t.updated_at || t.created_at);
40
41
  if (!r)
41
42
  return "";
42
- const s = z(r, U);
43
+ const s = H(r, G);
43
44
  return a("recommendation-strategy.last-updated-on", { value: s });
44
- }, S = o(() => ({
45
+ }, _ = o(() => ({
45
46
  text: a("ds-steps.legacy-strategy"),
46
47
  value: d,
47
48
  hidden: !0
@@ -54,10 +55,10 @@ const it = /* @__PURE__ */ b({
54
55
  variant: "information",
55
56
  size: "small",
56
57
  class: "assign-strategy-info-box",
57
- titleText: H(D(t.name)),
58
+ titleText: F(D(t.name)),
58
59
  descriptionStatus: !0,
59
- descriptionText: f(t),
60
- slot: $,
60
+ descriptionText: v(t),
61
+ slot: z,
61
62
  slotProps: { strategy: t },
62
63
  // The info box drops the option's value/text, so the id is the only channel
63
64
  // that can carry the strategy back to the click handler.
@@ -70,17 +71,17 @@ const it = /* @__PURE__ */ b({
70
71
  icon: "line-open-website"
71
72
  }]
72
73
  }
73
- }))), L = o(() => e.isLegacyStrategyBlock ? [S.value, ...m.value] : m.value), B = (t) => {
74
- var _;
75
- const r = (_ = t == null ? void 0 : t.id) != null && _.startsWith(i) ? t.id.slice(i.length) : "";
74
+ }))), B = o(() => e.isLegacyStrategyBlock ? [_.value, ...m.value] : m.value), k = (t) => {
75
+ var w;
76
+ const r = (w = t == null ? void 0 : t.id) != null && w.startsWith(i) ? t.id.slice(i.length) : "";
76
77
  if (!r)
77
78
  return;
78
- const s = e.currentRecommendationId, y = e.recommendationConfigs.strategyId === r;
79
- e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null), y && (e.removeStrategy(), s !== null && E(s, "Removed recommendation strategy")));
80
- }, v = o(() => {
79
+ const s = e.currentRecommendationId, u = e.recommendationConfigs.strategyId === r;
80
+ e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null), u && (e.removeStrategy(), s !== null && O(s, "Removed recommendation strategy")));
81
+ }, T = o(() => {
81
82
  const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
82
83
  return t ? { ...t, fallback_config: null } : null;
83
- }), k = o(() => ({
84
+ }), b = o(() => ({
84
85
  primaryButton: {
85
86
  styling: "solid",
86
87
  type: "primary",
@@ -92,10 +93,10 @@ const it = /* @__PURE__ */ b({
92
93
  labelText: a("products.cancel")
93
94
  }
94
95
  }));
95
- return { __sfc: !0, loadOrganisms: g, skeleton: p, OrgStrategyDetailModal: I, OrgStrategyDropdown: h, EDIT_BUTTON_ID_PREFIX: i, SELECT_SKELETON_SIZING: x, trans: a, store: e, showToaster: c, selectedStrategyId: n, LEGACY_OPTION_VALUE: d, showSelectionError: l, strategiesLoading: A, drawerDescription: C, lastUpdatedText: f, legacyStrategyOption: S, remoteStrategyOptions: m, strategyOptions: L, onInfoBoxButtonClick: B, selectedStrategy: v, footerButtonGroupOptions: k, closeDrawer: () => {
96
+ return { __sfc: !0, loadOrganisms: g, skeleton: f, OrgStrategyDetailModal: h, OrgStrategyDropdown: x, EDIT_BUTTON_ID_PREFIX: i, SELECT_SKELETON_SIZING: A, trans: a, store: e, showToaster: c, selectedStrategyId: n, LEGACY_OPTION_VALUE: d, showSelectionError: l, hasOpened: S, strategiesLoading: C, drawerDescription: L, lastUpdatedText: v, legacyStrategyOption: _, remoteStrategyOptions: m, strategyOptions: B, onInfoBoxButtonClick: k, selectedStrategy: T, footerButtonGroupOptions: b, closeDrawer: () => {
96
97
  e.closeAssignStrategyDrawer();
97
98
  }, assignStrategy: async () => {
98
- const t = v.value;
99
+ const t = T.value;
99
100
  if (!t) {
100
101
  l.value = !0;
101
102
  return;
@@ -103,26 +104,26 @@ const it = /* @__PURE__ */ b({
103
104
  let r = "";
104
105
  try {
105
106
  r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
106
- } catch (y) {
107
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", y);
107
+ } catch (u) {
108
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", u);
108
109
  }
109
110
  if (!r) {
110
111
  c({
111
- type: u.Error,
112
+ type: p.Error,
112
113
  message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
113
114
  });
114
115
  return;
115
116
  }
116
117
  const s = e.currentRecommendationId;
117
118
  e.assignStrategy(t), c({
118
- type: u.Success,
119
+ type: p.Success,
119
120
  message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
120
- }), e.closeAssignStrategyDrawer(), s !== null && await E(s, "Assigned recommendation strategy");
121
+ }), e.closeAssignStrategyDrawer(), s !== null && await O(s, "Assigned recommendation strategy");
121
122
  }, onSelect: (t) => {
122
123
  n.value = t.value, l.value = !1;
123
- }, InSkeleton: O };
124
+ }, InSkeleton: I };
124
125
  }
125
126
  });
126
127
  export {
127
- it as default
128
+ ct as default
128
129
  };
@@ -1,9 +1,9 @@
1
- const o = "3.30.0-beta.949c781", s = { stripo: { version: "2.87.0" } }, t = {
1
+ const o = "3.30.0-beta.e841504", s = { stripo: { version: "2.87.0" } }, e = {
2
2
  version: o,
3
3
  guido: s
4
4
  };
5
5
  export {
6
- t as default,
6
+ e as default,
7
7
  s as guido,
8
8
  o as version
9
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.30.0-beta.949c781",
3
+ "version": "3.30.0-beta.e841504",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",