@useinsider/guido 2.1.0-beta.7ffef92 → 2.1.0-beta.84a7014

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 (64) hide show
  1. package/README.md +41 -2
  2. package/dist/@types/config/schemas.js +1 -1
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +66 -66
  5. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +13 -11
  6. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +24 -55
  7. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +3 -3
  8. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +21 -34
  9. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +9 -9
  10. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +35 -44
  11. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
  12. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
  13. package/dist/composables/useSave.js +16 -12
  14. package/dist/composables/useStripo.js +63 -57
  15. package/dist/composables/useStripoEventHandler.js +27 -12
  16. package/dist/composables/useSyncModuleExtractor.js +45 -0
  17. package/dist/composables/useVersionHistoryApi.js +1 -1
  18. package/dist/config/i18n/en/index.js +11 -0
  19. package/dist/config/i18n/en/labels.json.js +7 -0
  20. package/dist/config/i18n/en/toasters.json.js +56 -0
  21. package/dist/config/i18n/en/tooltips.json.js +82 -0
  22. package/dist/config/i18n/index.js +7 -0
  23. package/dist/config/migrator/itemsBlockMigrator.js +65 -64
  24. package/dist/enums/unsubscribe.js +25 -21
  25. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +39 -58
  26. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +57 -93
  27. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +8 -8
  28. package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
  29. package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
  30. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
  31. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
  32. package/dist/guido.css +1 -1
  33. package/dist/services/stripoApi.js +55 -19
  34. package/dist/src/@types/config/schemas.d.ts +1 -1
  35. package/dist/src/@types/events.d.ts +38 -2
  36. package/dist/src/components/Guido.vue.d.ts +2 -2
  37. package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -1
  38. package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +1 -15
  39. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  40. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  41. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  42. package/dist/src/composables/useGuidoActions.d.ts +1 -1
  43. package/dist/src/composables/useSave.d.ts +2 -2
  44. package/dist/src/composables/useStripo.d.ts +2 -2
  45. package/dist/src/composables/useSyncModuleExtractor.d.ts +4 -0
  46. package/dist/src/config/i18n/en/index.d.ts +1 -0
  47. package/dist/src/config/i18n/index.d.ts +16 -0
  48. package/dist/src/enums/unsubscribe.d.ts +3 -0
  49. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -5
  50. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -18
  51. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  52. package/dist/src/mock/api/settings.d.ts +2 -0
  53. package/dist/src/services/stripoApi.d.ts +5 -0
  54. package/dist/src/stores/editor.d.ts +23 -0
  55. package/dist/src/utils/templatePreparation.d.ts +1 -1
  56. package/dist/static/styles/components/notification.css.js +18 -0
  57. package/dist/static/styles/components/tools.css.js +6 -2
  58. package/dist/static/styles/variables.css.js +2 -0
  59. package/dist/stores/editor.js +2 -1
  60. package/dist/stores/unsubscribe.js +37 -34
  61. package/dist/utils/templatePreparation.js +1 -1
  62. package/package.json +1 -1
  63. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +0 -29
  64. package/dist/src/extensions/Blocks/Recommendation/validation/filterSchema.d.ts +0 -15
@@ -1,53 +1,44 @@
1
- import { defineComponent as m, computed as l, ref as v, watch as O } from "vue";
2
- import { useTranslations as f } from "../../../../composables/useTranslations.js";
1
+ import { defineComponent as m, computed as o, ref as h } from "vue";
2
+ import { useTranslations as G } from "../../../../composables/useTranslations.js";
3
3
  import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { InButtonV2 as R, InSegments as T } from "@useinsider/design-system-vue";
5
- import U from "./FilterItem.vue.js";
6
- import E from "./LogicAdapter.vue.js";
7
- const w = /* @__PURE__ */ m({
4
+ import { InButtonV2 as v, InSegments as f } from "@useinsider/design-system-vue";
5
+ import _ from "./FilterItem.vue.js";
6
+ import A from "./LogicAdapter.vue.js";
7
+ const E = /* @__PURE__ */ m({
8
8
  __name: "Filters",
9
- props: {
10
- submitted: { type: Boolean }
11
- },
12
- setup(A, { expose: s }) {
13
- const i = f(), t = g(), u = l(() => t.getUniqueFilterGroups.map((e) => ({
14
- text: e.toString(),
15
- value: e
16
- }))), r = v(1);
17
- O(u, (e) => {
18
- if (!e.length)
19
- return;
20
- e.some((h) => h.value === r.value) || (r.value = e[0].value);
21
- });
22
- const a = (e) => {
9
+ setup(R) {
10
+ const i = G(), l = g(), u = o(() => l.getFilterGroupCount), t = o(() => Array.from({ length: u.value }, (e, a) => ({
11
+ text: (a + 1).toString(),
12
+ value: a + 1
13
+ }))), r = h(1), s = (e) => {
23
14
  r.value = e;
24
- };
25
- s({ switchToGroup: a });
26
- const p = () => {
27
- const e = t.getUniqueFilterGroups, o = e.length > 0 ? Math.max(...e) + 1 : 1;
28
- t.addFilterGroup(o), r.value = o;
29
- }, c = l(() => u.value.length >= 3), n = l(() => t.getSelectedFilterGroup(r.value)), d = l(() => n.value.length >= 10), F = l(() => n.value.length > 1), _ = l(() => u.value.length > 1), G = l(() => {
30
- var o;
31
- return ((o = n.value[0]) == null ? void 0 : o.outerGroupOperator) || "*";
32
- });
33
- return { __sfc: !0, MAX_FILTER_GROUP_COUNT: 3, MAX_FILTER_PER_GROUP_COUNT: 10, trans: i, store: t, filterGroupList: u, selectedFilterGroup: r, switchToGroup: a, handleAddFilterGroup: p, isMaxFilterGroupCount: c, selectedFilterGroupFilters: n, isMaxFilterPerGroupCount: d, hasLogicAdapter: F, hasRemoveFilterButton: _, outerGroupOperator: G, handleOuterGroupOperatorChange: (e) => {
34
- n.value.forEach((o) => {
35
- t.updateFilter({ ...o, outerGroupOperator: e });
36
- });
37
- }, handleAddFilter: () => {
38
- t.addFilter(
39
- t.createDefaultFilter(
40
- r.value,
41
- n.value.length + 1
42
- )
43
- );
15
+ }, d = () => {
16
+ const e = t.value.length + 1;
17
+ console.debug("handleAddFilterGroup", e), t.value.push({
18
+ text: e.toString(),
19
+ value: e
20
+ }), l.addFilterGroup(e);
21
+ }, p = o(() => t.value.length >= 3), n = o(() => l.getSelectedFilterGroup(r.value)), c = o(() => n.value.length > 1), F = o(() => t.value.length > 1);
22
+ return { __sfc: !0, MAX_FILTER_GROUP_COUNT: 3, trans: i, store: l, filterGroupCount: u, filterGroupList: t, selectedFilterGroup: r, changeFilterGroup: s, handleAddFilterGroup: d, isMaxFilterGroupCount: p, selectedFilterGroupFilters: n, hasLogicAdapter: c, hasRemoveFilterButton: F, handleAddFilter: () => {
23
+ l.addFilter({
24
+ type: "standardFilter",
25
+ attribute: "",
26
+ operatorReplace: "",
27
+ operator: "",
28
+ innerGroupOperator: "*",
29
+ outerGroupOperator: "*",
30
+ filterNumber: n.value.length + 1,
31
+ filterGroup: r.value,
32
+ isValid: !1,
33
+ value: ""
34
+ }), console.debug("handleAddFilter");
44
35
  }, handleDeleteFilter: (e) => {
45
- t.deleteFilter(e);
36
+ console.debug("handleDeleteFilter: ", e), l.deleteFilter(e);
46
37
  }, handleDeleteFilterGroup: () => {
47
- u.value.length <= 1 || t.deleteFilterGroup(r.value);
48
- }, InSegments: T, InButtonV2: R, FilterItem: U, LogicAdapter: E };
38
+ t.value.length !== 1 && (console.debug("handleDeleteFilterGroup"), t.value.splice(r.value - 1, 1), r.value > 1 && r.value--);
39
+ }, InSegments: f, InButtonV2: v, FilterItem: _, LogicAdapter: A };
49
40
  }
50
41
  });
51
42
  export {
52
- w as default
43
+ E as default
53
44
  };
@@ -16,7 +16,7 @@ var o = function() {
16
16
  i,
17
17
  !1,
18
18
  null,
19
- "a86fc486"
19
+ "df672485"
20
20
  );
21
21
  const _ = c.exports;
22
22
  export {
@@ -1,15 +1,15 @@
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";
1
+ import { defineComponent as g, ref as y, computed as n, watch as S } from "vue";
2
+ import T from "../../wrappers/WpDrawer.vue.js";
3
+ import { useToaster as v } from "../../../composables/useToaster.js";
4
+ import { useTranslations as B } from "../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as C } from "../../../enums/toaster.js";
6
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({
7
+ import { InContainer as h } from "@useinsider/design-system-vue";
8
+ import U from "./UnsubscribeBreadcrumb.vue.js";
9
+ const F = /* @__PURE__ */ g({
10
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(() => ({
11
+ setup(P) {
12
+ const s = B(), e = w(), { showToaster: a } = v(), 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")), u = n(() => ({
13
13
  primaryButton: {
14
14
  styling: "solid",
15
15
  type: "primary",
@@ -23,28 +23,28 @@ const E = /* @__PURE__ */ f({
23
23
  labelText: i.value,
24
24
  disabledStatus: o.value
25
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) => {
26
+ })), p = (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
27
  e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
28
28
  t();
29
29
  }, 500);
30
- }, m = () => {
30
+ }, d = () => {
31
31
  if (e.isActiveTypeFirstInCollection) {
32
32
  r(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
33
33
  return;
34
34
  }
35
35
  e.setPreviousType();
36
- }, d = () => {
36
+ }, m = () => {
37
37
  if (e.isActiveTypeLastInCollection) {
38
38
  o.value = !0;
39
- const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t);
40
- e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
39
+ const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t), f = e.getSelectedUnsubscribePagesByCollection(t);
40
+ e.removeUnsubscribePages(f), e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
41
41
  detail: {
42
42
  collectionType: t,
43
43
  selectedPages: l
44
44
  }
45
45
  })), r(() => {
46
46
  o.value = !1, a({
47
- type: B.Success,
47
+ type: C.Success,
48
48
  message: s("global-unsubscribe.pages-were-attached")
49
49
  });
50
50
  });
@@ -54,11 +54,11 @@ const E = /* @__PURE__ */ f({
54
54
  }, b = (t) => {
55
55
  e.setSelectedTemplate(t);
56
56
  };
57
- return T(() => e.pageSelectionDrawerStatus, (t) => {
57
+ return S(() => e.pageSelectionDrawerStatus, (t) => {
58
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 };
59
+ }), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: a, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: u, getBorderClass: p, closeModal: r, handleBack: d, handleSave: m, selectTemplate: b, WpDrawer: T, InContainer: h, UnsubscribeBreadcrumb: U };
60
60
  }
61
61
  });
62
62
  export {
63
- E as default
63
+ F as default
64
64
  };
@@ -1,17 +1,21 @@
1
- import { useConfig as l } from "./useConfig.js";
2
- import { useSaveStart as m, useSaveComplete as c } from "./useGuidoActions.js";
3
- import { useTemplatePreparation as d } from "../utils/templatePreparation.js";
4
- import { useHtmlValidator as p } from "./useHtmlValidator.js";
5
- const w = () => {
6
- const i = m(), s = c(), { validateHtml: o } = p(), { callbacks: a } = l();
7
- return { save: async (r = !1) => {
1
+ import { useConfig as d } from "./useConfig.js";
2
+ import { useSaveStart as p, useSaveComplete as f } from "./useGuidoActions.js";
3
+ import { useSyncModuleExtractor as v } from "./useSyncModuleExtractor.js";
4
+ import { useStripoApi as S } from "../services/stripoApi.js";
5
+ import { useTemplatePreparation as x } from "../utils/templatePreparation.js";
6
+ import { useHtmlValidator as V } from "./useHtmlValidator.js";
7
+ const g = () => {
8
+ const o = p(), s = f(), { validateHtml: i } = V(), { callbacks: a } = d(), { extractSyncModuleData: r } = v(), { setSyncModuleUnsubscriptionPages: n } = S();
9
+ return { save: async (l = !1) => {
8
10
  var e;
9
- i();
10
- const { prepareTemplateDetails: n } = d(), t = await n();
11
- if (await o(t.compiledHtml, t.dynamicContentList, !0) && !((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)))
12
- return r || s(t), t;
11
+ o();
12
+ const { prepareTemplateDetails: c } = x(), t = await c();
13
+ if (!await i(t.compiledHtml, t.dynamicContentList, !0) || (e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t))
14
+ return;
15
+ const { unsubscribePayload: m, stripoModules: u } = r(t.rawHtml);
16
+ return await n(m), t.modules = u, l || s(t), t;
13
17
  } };
14
18
  };
15
19
  export {
16
- w as useSave
20
+ g as useSave
17
21
  };
@@ -1,26 +1,27 @@
1
- import { useActionsApi as _ } from "./useActionsApi.js";
2
- import { useBlocksConfig as B } from "./useBlocksConfig.js";
3
- import { useConfig as v } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as A } from "./useCustomInterfaceAppearance.js";
5
- import { useStripoEventHandler as F } from "./useStripoEventHandler.js";
6
- import { useToaster as D } from "./useToaster.js";
7
- import { displayConditions as I } from "../enums/displayConditions.js";
8
- import { useStripoApi as M } from "../services/stripoApi.js";
9
- import U from "../static/styles/customEditorStyle.css.js";
10
- import { useEditorStore as P } from "../stores/editor.js";
11
- import { dynamicContentToMergeTags as R } from "../utils/genericUtil.js";
12
- import H from "../package.json.js";
13
- const W = (c) => {
14
- const { features: l, template: y } = v(), { handleError: u } = D(), { getToken: C, getCustomFonts: S } = M(), { handleEvent: E } = F(), { getStripoBlocksConfig: h } = B(), w = async (i, n = []) => {
15
- var m, g, f;
16
- const o = P(), { html: r, css: p } = i, { baseBlocks: s, extensions: t } = await h(), a = ((m = l.value) == null ? void 0 : m.displayConditions) ?? !0, k = ((g = l.value) == null ? void 0 : g.modulesDisabled) ?? !1, T = ((f = y.value) == null ? void 0 : f.forceRecreate) ?? !1;
1
+ import { useActionsApi as A } from "./useActionsApi.js";
2
+ import { useBlocksConfig as F } from "./useBlocksConfig.js";
3
+ import { useConfig as D } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as I } from "./useCustomInterfaceAppearance.js";
5
+ import { useStripoEventHandler as P } from "./useStripoEventHandler.js";
6
+ import { useToaster as U } from "./useToaster.js";
7
+ import { localePatch as R } from "../config/i18n/index.js";
8
+ import { displayConditions as H } from "../enums/displayConditions.js";
9
+ import { useStripoApi as O } from "../services/stripoApi.js";
10
+ import q from "../static/styles/customEditorStyle.css.js";
11
+ import { useEditorStore as S } from "../stores/editor.js";
12
+ import { dynamicContentToMergeTags as x } from "../utils/genericUtil.js";
13
+ import L from "../package.json.js";
14
+ const oe = (C, c) => {
15
+ const { features: l, template: E } = D(), { handleError: u } = U(), { getToken: h, getCustomFonts: w, getSyncModulesStatus: b } = O(), { handleEvent: k } = P(), { getStripoBlocksConfig: T } = F(), V = async (i, n = [], r = !1) => {
16
+ var f, g, y;
17
+ const e = S(), { html: m, css: a } = i, { baseBlocks: o, extensions: d } = await T(), p = ((f = l.value) == null ? void 0 : f.displayConditions) ?? !0, B = ((g = l.value) == null ? void 0 : g.modulesDisabled) ?? !1, v = ((y = E.value) == null ? void 0 : y.forceRecreate) ?? !1;
17
18
  window.UIEditor.initEditor(
18
19
  document.querySelector("#guido-editor"),
19
20
  {
20
- metadata: c,
21
- html: r,
22
- css: p,
23
- forceRecreate: T,
21
+ metadata: C,
22
+ html: m,
23
+ css: a,
24
+ forceRecreate: v,
24
25
  locale: "en",
25
26
  undoButtonSelector: "#guido__undo-button",
26
27
  redoButtonSelector: "#guido__redo-button",
@@ -30,19 +31,20 @@ const W = (c) => {
30
31
  customAppearanceMergetags: !0,
31
32
  customAppearanceMergetagsBorderColor: "#f1f3fe",
32
33
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
33
- customViewStyles: U,
34
- conditionsEnabled: a,
35
- customConditionsEnabled: a,
36
- conditionCategories: I,
34
+ customViewStyles: q,
35
+ conditionsEnabled: p,
36
+ customConditionsEnabled: p,
37
+ conditionCategories: H,
37
38
  enableXSSSecurity: !0,
38
- modulesDisabled: k,
39
+ modulesDisabled: B,
40
+ syncModulesEnabled: r,
39
41
  messageSettingsEnabled: !0,
40
42
  displayGmailAnnotations: !0,
41
43
  displayHiddenPreheader: !1,
42
44
  displayTitle: !1,
43
45
  displayUTM: !1,
44
46
  selectElementAfterDrop: !0,
45
- ...s ? { baseBlocks: s } : {},
47
+ ...o ? { baseBlocks: o } : {},
46
48
  editorFonts: {
47
49
  showDefaultStandardFonts: !0,
48
50
  showDefaultNotStandardFonts: !0,
@@ -50,68 +52,72 @@ const W = (c) => {
50
52
  },
51
53
  mergeTags: [
52
54
  {
53
- entries: R(c.preselectedDynamicContentList)
55
+ entries: x(c.preselectedDynamicContentList)
54
56
  }
55
57
  ],
56
- async onTokenRefreshRequest(e) {
58
+ async onTokenRefreshRequest(t) {
57
59
  try {
58
- const d = await C();
59
- e(d);
60
- } catch (d) {
61
- u(d, "Failed to refresh token");
60
+ const s = await h();
61
+ t(s);
62
+ } catch (s) {
63
+ u(s, "Failed to refresh token");
62
64
  }
63
65
  },
64
66
  onTemplateLoaded() {
65
67
  try {
66
- const { importCss: e } = A(), { activateCustomViewStyles: d, updateTimerInClonedTemplate: V } = _();
67
- e(), d(), V(), c.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
68
- o.hasChanges = !1;
68
+ const { importCss: t } = I(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: M } = A();
69
+ t(), s(), M(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
70
+ e.hasChanges = !1;
69
71
  }, 1e3);
70
- } catch (e) {
71
- u(e, "Failed to load custom interface appearance");
72
+ } catch (t) {
73
+ u(t, "Failed to load custom interface appearance");
72
74
  }
73
75
  },
74
- onCodeEditorVisibilityChanged(e) {
75
- o.isCodeEditorOpen = e;
76
+ onCodeEditorVisibilityChanged(t) {
77
+ e.isCodeEditorOpen = t;
76
78
  },
77
- onEditorVisualModeChanged(e) {
78
- o.editorVisualMode = e.toLowerCase();
79
+ onEditorVisualModeChanged(t) {
80
+ e.editorVisualMode = t.toLowerCase();
79
81
  },
80
- onVersionHistoryVisibilityChanged(e) {
81
- o.isVersionHistoryOpen = e;
82
+ onVersionHistoryVisibilityChanged(t) {
83
+ e.isVersionHistoryOpen = t;
82
84
  },
83
85
  onDataChanged() {
84
- o.hasChanges = !0;
86
+ e.hasChanges = !0;
85
87
  },
86
- onEvent: E,
88
+ onEvent: k,
87
89
  ignoreClickOutsideSelectors: [
88
90
  "#guido-dynamic-content-modal",
89
91
  ".in-on-board-wrapper",
90
92
  ".in-drawer__container"
91
93
  ],
92
- extensions: t
94
+ extensions: d,
95
+ localePatch: R
93
96
  }
94
97
  );
95
- }, b = (i) => new Promise((n, o) => {
96
- var a;
98
+ }, _ = (i) => new Promise((n, r) => {
99
+ var d;
97
100
  if (document.getElementById("UiEditorScript")) {
98
101
  i(), n();
99
102
  return;
100
103
  }
101
- const r = H.guido, s = `https://email-static.useinsider.com/guido/${(a = r == null ? void 0 : r.stripo) == null ? void 0 : a.version}/UIEditor.js`, t = document.createElement("script");
102
- t.id = "UiEditorScript", t.type = "module", t.src = s, t.onload = () => {
104
+ const e = L.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
105
+ o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
103
106
  i(), n();
104
- }, t.onerror = () => {
105
- o(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
106
- }, document.body.appendChild(t);
107
+ }, o.onerror = () => {
108
+ r(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
109
+ }, document.body.appendChild(o);
107
110
  });
108
111
  return { initPlugin: async (i) => {
109
- await b(async () => {
110
- const n = await S();
111
- await w(i, n);
112
+ await _(async () => {
113
+ const n = S(), [r, e] = await Promise.all([
114
+ w(),
115
+ b()
116
+ ]);
117
+ n.syncModulesEnabled = e, await V(i, r, e);
112
118
  });
113
119
  } };
114
120
  };
115
121
  export {
116
- W as useStripo
122
+ oe as useStripo
117
123
  };
@@ -1,20 +1,35 @@
1
- import { useOnboardingStore as i } from "../stores/onboarding.js";
2
- const c = () => {
3
- const e = {
4
- block_dropped: ({ blockName: t }) => {
5
- if (t === "BLOCK_TEXT") {
6
- const n = i(), o = !n.shouldShowOnboarding("textBlockOnboarding"), r = n.isActive("textBlockOnboarding");
7
- if (o || r)
1
+ import { useStripoApi as i } from "../services/stripoApi.js";
2
+ import { useEditorStore as u } from "../stores/editor.js";
3
+ import { useOnboardingStore as l } from "../stores/onboarding.js";
4
+ import { useUnsubscribeStore as b } from "../stores/unsubscribe.js";
5
+ const v = () => {
6
+ const { updateSyncModule: d, getSyncModule: r } = i(), n = u(), s = b(), a = {
7
+ block_dropped: ({ blockName: e }) => {
8
+ if (e === "BLOCK_TEXT") {
9
+ const o = l(), t = !o.shouldShowOnboarding("textBlockOnboarding"), c = o.isActive("textBlockOnboarding");
10
+ if (t || c)
8
11
  return;
9
- n.start("textBlockOnboarding");
12
+ o.start("textBlockOnboarding");
10
13
  }
14
+ },
15
+ module_saved: async (e) => {
16
+ n.syncModulesEnabled && (console.debug("[module_saved] Saved module data:", e), await d(e));
17
+ },
18
+ module_dropped: async (e) => {
19
+ if (!n.syncModulesEnabled)
20
+ return;
21
+ const { moduleId: o } = e, t = await r(o);
22
+ console.debug("[module_dropped] Sync module data:", t), t.unsubscriptionPreferencePages.length && await s.fetchTemplates();
23
+ },
24
+ module_updated: async (e) => {
25
+ n.syncModulesEnabled && (console.debug("[module_updated] Updated module data:", e), await d(e));
11
26
  }
12
27
  };
13
- return { handleEvent: async (t, n) => {
14
- const o = e[t];
15
- o && await o(n);
28
+ return { handleEvent: async (e, o) => {
29
+ const t = a[e];
30
+ console.debug("Stripo Event: ", e, o), t && await t(o);
16
31
  } };
17
32
  };
18
33
  export {
19
- c as useStripoEventHandler
34
+ v as useStripoEventHandler
20
35
  };
@@ -0,0 +1,45 @@
1
+ import { UNSUBSCRIBE_SYNC_MODULE_TYPES as T } from "../enums/unsubscribe.js";
2
+ import { DATA_ATTRIBUTES as p } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
3
+ import { useEditorStore as f } from "../stores/editor.js";
4
+ const y = ".esd-synchronizable-module", A = '[esd-extension-block-id="unsubscribe-block"]', _ = "esd-custom-block-id", B = () => {
5
+ const d = f();
6
+ return { extractSyncModuleData: (E) => {
7
+ const S = {
8
+ unsubscribePayload: [],
9
+ stripoModules: []
10
+ };
11
+ if (!d.syncModulesEnabled)
12
+ return S;
13
+ const b = new DOMParser().parseFromString(E, "text/html").querySelectorAll(y), r = [], s = [];
14
+ return b.forEach((o) => {
15
+ const t = o.getAttribute(_);
16
+ if (!t)
17
+ return;
18
+ const n = o.querySelectorAll(A);
19
+ if (n.length === 0) {
20
+ s.push(Number(t));
21
+ return;
22
+ }
23
+ n.forEach((c) => {
24
+ const u = c.getAttribute(p.PAGE_LIST), i = c.getAttribute(p.PAGE_TYPE);
25
+ if (!u || !i)
26
+ return;
27
+ const m = parseInt(i), a = T[m];
28
+ if (!a)
29
+ return;
30
+ const l = u.split(",").map((e) => parseInt(e.trim())).filter((e) => !Number.isNaN(e));
31
+ l.length !== 0 && r.push({
32
+ stripoModuleId: t,
33
+ unsubscriptionPreferencePages: l,
34
+ type: a
35
+ });
36
+ });
37
+ }), {
38
+ unsubscribePayload: r,
39
+ stripoModules: s
40
+ };
41
+ } };
42
+ };
43
+ export {
44
+ B as useSyncModuleExtractor
45
+ };
@@ -35,7 +35,7 @@ const S = () => {
35
35
  () => {
36
36
  s({
37
37
  type: t.Success,
38
- message: `${e} patch restored successfully.`
38
+ message: "Your version has been restored successfully."
39
39
  });
40
40
  },
41
41
  (o) => {
@@ -0,0 +1,11 @@
1
+ import o from "./labels.json.js";
2
+ import t from "./toasters.json.js";
3
+ import r from "./tooltips.json.js";
4
+ const e = {
5
+ ...o,
6
+ ...r,
7
+ ...t
8
+ };
9
+ export {
10
+ e as en
11
+ };
@@ -0,0 +1,7 @@
1
+ const l = {
2
+ "Global Styles & Layout": "Global Styles and Layout",
3
+ "Structures & Modules": "Structures and Modules"
4
+ };
5
+ export {
6
+ l as default
7
+ };
@@ -0,0 +1,56 @@
1
+ const e = "Your version has been restored successfully.", o = "Restore Image", t = "Cancel", a = {
2
+ "The image has been deleted.": "The image has been deleted successfully.",
3
+ "Aim for the drop zone!": "Drag and drop your image inside the upload area to continue.",
4
+ "Image processing": "The image upload is in progress. This may take some time.",
5
+ "Can not get image from an external source.": "The image couldn’t be uploaded from the URL. Check and update your URL to continue.",
6
+ "The selected basic color cannot be added to My Palette. Please choose a different one from the color picker.": "The selected color is already added to My Palette. Pick a different color to add.",
7
+ "Copied to clipboard": "Your Image URL has been copied to clipboard successfully.",
8
+ "The file {fileName} has wrong format {fileFormat}": "Upload a PNG, JPG, JPEG, or GIF image to continue.",
9
+ "The file {fileName} size exceeds the allowed size {maxFileSize}": "Upload an image up to 10 MB to continue.",
10
+ "Image link invalid": "Enter a valid Image Link to continue.",
11
+ "Image upload failed": "Upload a valid image to continue.",
12
+ "Image upload error": "Upload a valid image to continue.",
13
+ "Error message from video service": "The video thumbnail couldn't be loaded. Check and update your Video Link to continue.",
14
+ "Error message from image processing": "The Play Button couldn't be added to the Video Thumbnail right now. You can select another Play Button and try again.",
15
+ "The AI is fine-tuning your result... Please wait! This may take up to 1 minute.": "AI content generation is in progress. This may take some time.",
16
+ "Can not complete AI request. Try again later": "AI content generation couldn't be completed right now. You can reload the editor or wait for a while and try again.",
17
+ "Http failure response for https://plugins.stripo.email/api/v1/documents/v3/documents/link: 400 OK": "Upload a valid image to continue.",
18
+ "Http failure response for https://plugins.stripo.email/api/v1/documents/v3/documents/base64: 400 OK": "The video thumbnail couldn’t be uploaded from the URL. Check and update your URL to continue.",
19
+ "AI is processing your request": "AI content generation is in progress. This may take some time.",
20
+ "Whoops, something went wrong. Our experts are working to resolve this issue. Try again later please": "Your action couldn't be done right now. You can reload the editor or wait for a while and try again.",
21
+ "Unable to paste text. Limit is 256kB. Please trim it down.": "Add a text to Text Block of up to 256KB to continue.",
22
+ "Banner src included merge tag": "The image upload is in progress. This may take some time.",
23
+ "Module deletion error": "The module couldn't be deleted right now. You can wait for a while and try again.",
24
+ "Can`t delete the module": "The module couldn't be deleted right now. You can wait for a while and try again.",
25
+ "Block action error": "Your content couldn't added right now. You can wait for a while and try again.",
26
+ history_revert_to_patch: e,
27
+ "There is no connection to the server. Please reload the page or click 'Reconnect' to continue.": "Your server connection is lost. Reload the page to continue.",
28
+ "Reconnecting...": "Server reconnection is in progress. This may take some time.",
29
+ "Failed to load version history. Contact support for assistance.": "Your version couldn't be restored right now. You can wait for a while and try again.",
30
+ "Connection restored": "Server connection has been restored successfully.",
31
+ "Invalid base64 image format. Please replace the image link.": "This image can’t be edited.",
32
+ "Timer update error": "Your action couldn't be undone right now. You can reload the editor or wait for a while and try again.",
33
+ "Cannot edit base64 images": "This image type can't be edited.",
34
+ "Failed to copy URL": "Your Image Link couldn't be copied to clipboard right now. You can wait for a while and try again.",
35
+ "Error message from image service": "The image couldn’t be uploaded from the URL. Check and update your URL to continue.",
36
+ "Error message from image preload": "The image couldn't be loaded from the URL you entered. Check and update your Image Link to continue.",
37
+ "An error has occurred. Please report the error code to support: {trace_id} and reload the editor. Also, send a bug report with email logs to the development team.": "Your design couldn't be loaded right now. You can reload the page and try again.",
38
+ "The number of requests within your session has been exceeded. Please wait.": "Your requests are being processed. You can wait for a while to take new actions.",
39
+ "An error has occurred. Please report the error code to support.": "Your design couldn't be loaded right now. You can reload the page and try again.",
40
+ "Warning: custom fonts": "Use custom fonts up to 10 to continue.",
41
+ "Image recovery error": "The image couldn't be restored right now. You can wait for a while and try again.",
42
+ "Image moved to trash": "The image has been deleted successfully.",
43
+ Recover: o,
44
+ Stop: t,
45
+ "Can`t delete the image": "The image couldn’t be deleted right now. You can wait for a while and try again.",
46
+ "Can`t restore the image": "The image couldn’t be restored right now. You can wait for a while and try again.",
47
+ "Image delete error": "The image couldn't be deleted right now. You can wait for a while and try again.",
48
+ "The maximum number of users who can simultaneously work with the sheet has been exceeded. Maximum allowed number: {{max_users_per_model}}": "You can’t edit the design right now as the maximum number of users are currently editing it.",
49
+ "The monthly limit of Timer basic block is reached. Please change the subscription pricing plan to activate new quotas": "You have reached your monthly limit of Timer Blocks. You can contact your Account Director for more information."
50
+ };
51
+ export {
52
+ o as Recover,
53
+ t as Stop,
54
+ a as default,
55
+ e as history_revert_to_patch
56
+ };