@useinsider/guido 3.23.0-beta.6555b16 → 3.23.0-beta.778056a

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.
@@ -1,4 +1,4 @@
1
- const o = "3.23.0-beta.6555b16", s = { stripo: { version: "2.81.1" } }, t = {
1
+ const o = "3.23.0-beta.778056a", s = { stripo: { version: "2.83.1" } }, t = {
2
2
  version: o,
3
3
  guido: s
4
4
  };
@@ -1,41 +1,40 @@
1
- import { useActionsApi as v } from "../composables/useActionsApi.js";
2
- import { useConfig as A } from "../composables/useConfig.js";
1
+ import { useActionsApi as A } from "../composables/useActionsApi.js";
2
+ import { useConfig as S } from "../composables/useConfig.js";
3
3
  import { useHttp as E } from "../composables/useHttp.js";
4
4
  import { useToaster as x } from "../composables/useToaster.js";
5
- import { useTranslations as N } from "../composables/useTranslations.js";
6
- import { useHtmlDocumentCountValidator as H } from "../composables/validators/useHtmlDocumentCountValidator.js";
7
- import { useLiquidValidator as P } from "../composables/validators/useLiquidValidator.js";
8
- import { EditorType as D } from "../enums/defaults.js";
5
+ import { useTranslations as P } from "../composables/useTranslations.js";
6
+ import { useHtmlDocumentCountValidator as L } from "../composables/validators/useHtmlDocumentCountValidator.js";
7
+ import { useLiquidValidator as N } from "../composables/validators/useLiquidValidator.js";
8
+ import { EditorType as H } from "../enums/defaults.js";
9
9
  import { ToasterTypeOptions as T } from "../enums/toaster.js";
10
- import { useRecommendationExtensionStore as L } from "../extensions/Blocks/Recommendation/store/recommendation.js";
10
+ import { useRecommendationExtensionStore as D } from "../extensions/Blocks/Recommendation/store/recommendation.js";
11
11
  import { useSaveAsTemplateStore as q } from "../stores/save-as-template.js";
12
12
  import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
13
13
  import { isPlainObject as w } from "../utils/genericUtil.js";
14
14
  import { useTemplatePreparation as F } from "../utils/templatePreparation.js";
15
15
  const Z = () => {
16
- const { get: m, post: l } = E(), { handleError: o, showToaster: i } = x(), { config: c, isFeatureEnabled: p } = A(), { validateLiquidSyntax: b } = P(), { validateSingleHtmlDocument: h } = H(), { getTemplateData: C } = v(), u = N();
16
+ const { get: l, post: c } = E(), { handleError: o, showToaster: i } = x(), { config: p, isFeatureEnabled: u } = S(), { validateLiquidSyntax: b } = N(), { validateSingleHtmlDocument: C } = L(), { getTemplateData: h } = A(), n = P();
17
17
  return {
18
18
  getCategories: async () => {
19
19
  try {
20
- const { data: e } = await m("/newsletter/template-library/get-template-categories");
21
- if (Array.isArray(e))
22
- return e;
23
- if (w(e) && e.type === "alert" && typeof e.message == "string")
24
- return i({ message: e.message, type: T.Error }), [];
25
- throw new Error("Unexpected get-template-categories response");
20
+ const { data: e } = await l("/newsletter/template-library/get-template-categories");
21
+ return Array.isArray(e) ? e : ((!w(e) || e.type !== "alert") && console.error("[TEMPLATE_LIBRARY_API] Unexpected get-template-categories response", e), i({
22
+ message: n("newsletter.template-library-service-error"),
23
+ type: T.Error
24
+ }), []);
26
25
  } catch (e) {
27
26
  return o(e, "Failed to fetch template categories"), [];
28
27
  }
29
28
  },
30
29
  checkTemplateNameAvailability: async (e) => {
31
- const { data: { status: t = !1 } } = await m(
30
+ const { data: { status: t = !1 } } = await l(
32
31
  `/newsletter/template-library/template-name-exists?name=${e}`
33
32
  );
34
33
  return !t;
35
34
  },
36
35
  createCategory: async (e) => {
37
36
  try {
38
- const { data: { id: t } } = await l(
37
+ const { data: { id: t } } = await c(
39
38
  "/newsletter/template-library/create-category",
40
39
  { name: e }
41
40
  );
@@ -47,56 +46,56 @@ const Z = () => {
47
46
  createTemplate: async () => {
48
47
  var e, t, d, y;
49
48
  try {
50
- const { prepareTemplateDetails: n } = F(), s = q(), g = await C();
51
- if (!h(g.html))
49
+ const { prepareTemplateDetails: m } = F(), s = q(), g = await h();
50
+ if (!C(g.html))
52
51
  return !1;
53
- const a = await n(g);
54
- if (p("liquidSyntax") && !await b(a.compiledHtml))
52
+ const a = await m(g);
53
+ if (u("liquidSyntax") && !await b(a.compiledHtml))
55
54
  return !1;
56
- const S = {
55
+ const v = {
57
56
  name: s.getTemplateName,
58
57
  categories: s.getSelectedCategoryIds,
59
- productId: ((t = (e = c.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
60
- editorType: D,
61
- messageType: ((y = (d = c.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
58
+ productId: ((t = (e = p.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
59
+ editorType: H,
60
+ messageType: ((y = (d = p.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
62
61
  content: r(a.compiledHtml),
63
62
  css: r(a.css),
64
63
  unsubscriptionPreferencePageStatus: !1,
65
64
  unsubscriptionPreferencePages: [],
66
65
  recommendationCampaignUrls: r(
67
- L().recommendationCampaignUrls
66
+ D().recommendationCampaignUrls
68
67
  ),
69
68
  recommendationConfigs: r({}),
70
69
  isGuido: !0,
71
70
  // eslint-disable-next-line camelcase
72
- template_engine: p("liquidSyntax") ? 1 : 0,
71
+ template_engine: u("liquidSyntax") ? 1 : 0,
73
72
  stripoConfig: r({
74
73
  editor: "stripo",
75
74
  html: a.rawHtml,
76
75
  css: a.css,
77
76
  dynamicContentList: a.dynamicContentList
78
77
  })
79
- }, { data: f } = await l(
78
+ }, { data: f } = await c(
80
79
  "/newsletter/template-library/create-template",
81
- S
80
+ v
82
81
  );
83
82
  if (!w(f))
84
83
  throw new Error("Unexpected create-template response");
85
84
  return f.type === "alert" ? (i({
86
- message: u(
85
+ message: n(
87
86
  "newsletter.template-library-save-alert",
88
87
  { templateName: s.getTemplateName }
89
88
  ),
90
89
  type: T.Error
91
90
  }), !1) : (i({
92
- message: u(
91
+ message: n(
93
92
  "newsletter.template-library-save-success",
94
93
  { templateName: s.getTemplateName }
95
94
  ),
96
95
  type: "success"
97
96
  }), !0);
98
- } catch (n) {
99
- return o(n, "Failed to create template"), !1;
97
+ } catch (m) {
98
+ return o(m, "Failed to create template"), !1;
100
99
  }
101
100
  }
102
101
  };
@@ -1,4 +1,4 @@
1
- const s = "2.81.1", n = ["UIEditor.js", "zone.js", "styles-BWH3PMR4.css", "polyfills-FF3RLU5F.js", "main-5LCHF56A.js", "chunk-2HYLRI4G.js", "chunk-4SN7BSQN.js", "chunk-5IY7ZG3R.js", "chunk-62K3AMOD.js", "chunk-GK543IRH.js", "chunk-L2EPGQ76.js", "chunk-LXS5IGCQ.js", "chunk-PNWIGF4L.js", "chunk-S2TYCIH3.js", "chunk-S5UZ4LUK.js", "chunk-V2AGQPVL.js", "chunk-XZ6MUAN5.js", "chunk-ZPL4VL4O.js", "assets/css/uiEditor.css", "assets/i18n/en.json", "assets/icons/ui-editor-icons.sprite.svg", "assets/icons/ui-editor-icons.map.json", "assets/imageeditor/scripts.min.js", "assets/imageeditor/assets/icons/merged.svg"], i = {
1
+ const s = "2.83.1", n = ["UIEditor.js", "zone.js", "styles-BWH3PMR4.css", "polyfills-FF3RLU5F.js", "main-OTN2PYRT.js", "chunk-62K3AMOD.js", "chunk-6RGJBGUG.js", "chunk-6W43DTQG.js", "chunk-EC4WGEOZ.js", "chunk-GLBBUJ54.js", "chunk-GPJLJCMF.js", "chunk-MDCDEJUH.js", "chunk-P7HQTFJV.js", "chunk-PA4WGBC4.js", "chunk-QMDAV6OU.js", "chunk-R2F3ADM2.js", "chunk-YSKQ2TWF.js", "chunk-ZU5ASRKR.js", "assets/css/uiEditor.css", "assets/i18n/en.json", "assets/icons/ui-editor-icons.sprite.svg", "assets/icons/ui-editor-icons.map.json", "assets/imageeditor/scripts.min.js", "assets/imageeditor/assets/icons/merged.svg"], i = {
2
2
  version: s,
3
3
  files: n
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { useTemplateLibraryApi as o } from "../services/templateLibraryApi.js";
2
- import { defineStore as r } from "pinia";
3
- const i = () => ({
2
+ import { defineStore as i } from "pinia";
3
+ const r = () => ({
4
4
  templateName: "",
5
5
  categories: [],
6
6
  selectedCategories: [],
@@ -17,8 +17,8 @@ const i = () => ({
17
17
  editor: 2,
18
18
  message: 1
19
19
  }
20
- }), g = r("guidoSaveAsTemplate", {
21
- state: () => i(),
20
+ }), g = i("guidoSaveAsTemplate", {
21
+ state: () => r(),
22
22
  getters: {
23
23
  getTemplateName: (e) => e.templateName.trim(),
24
24
  getSelectedCategoryIds: (e) => e.selectedCategories.map((a) => Number(a.value))
@@ -26,7 +26,7 @@ const i = () => ({
26
26
  actions: {
27
27
  async fetchCategories() {
28
28
  const { getCategories: e } = o(), a = await e();
29
- this.categories = (Array.isArray(a) ? a : []).map((t) => ({
29
+ this.categories = a.map((t) => ({
30
30
  value: t.id.toString(),
31
31
  text: t.name
32
32
  })).sort((t, s) => t.text.localeCompare(s.text));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.23.0-beta.6555b16",
3
+ "version": "3.23.0-beta.778056a",
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",
@@ -128,7 +128,7 @@
128
128
  },
129
129
  "guido": {
130
130
  "stripo": {
131
- "version": "2.81.1"
131
+ "version": "2.83.1"
132
132
  }
133
133
  }
134
134
  }