@useinsider/guido 3.17.0-beta.ec8eabb → 3.17.0-beta.edf4165

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 (61) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +7 -6
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +100 -97
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
  7. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  8. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  9. package/dist/components/organisms/header/EditorActions.vue.js +1 -1
  10. package/dist/components/organisms/header/EditorActions.vue2.js +36 -44
  11. package/dist/composables/useActionsApi.js +67 -82
  12. package/dist/composables/useAutoSave.js +26 -31
  13. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  14. package/dist/composables/useGuidoStateBridge.js +30 -31
  15. package/dist/composables/useRecommendation.js +41 -34
  16. package/dist/composables/useSave.js +36 -40
  17. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  18. package/dist/config/migrator/recommendationMigrator.js +5 -4
  19. package/dist/enums/academy.js +2 -1
  20. package/dist/enums/date.js +5 -3
  21. package/dist/enums/extensions/recommendationBlock.js +3 -1
  22. package/dist/extensions/Blocks/Recommendation/block.js +26 -21
  23. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -34
  24. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
  25. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +162 -166
  26. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  27. package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
  28. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +165 -79
  29. package/dist/extensions/Blocks/common-control.js +22 -19
  30. package/dist/guido.css +1 -1
  31. package/dist/services/recommendationApi.js +69 -30
  32. package/dist/src/@types/config/schemas.d.ts +2 -0
  33. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  34. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  35. package/dist/src/composables/useConfig.d.ts +2 -0
  36. package/dist/src/composables/useRecommendation.d.ts +1 -0
  37. package/dist/src/enums/academy.d.ts +1 -0
  38. package/dist/src/enums/date.d.ts +1 -0
  39. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  40. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +2 -6
  41. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  42. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +10 -4
  43. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  44. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +150 -10
  45. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -0
  46. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  47. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  48. package/dist/src/services/recommendationApi.d.ts +4 -1
  49. package/dist/src/stores/config.d.ts +18 -0
  50. package/dist/src/stores/save-as-template.d.ts +4 -3
  51. package/dist/src/utils/genericUtil.d.ts +5 -0
  52. package/dist/static/assets/icons/line-change.svg.js +5 -0
  53. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  54. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  55. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  56. package/dist/utils/dateUtil.js +23 -10
  57. package/dist/utils/genericUtil.js +28 -27
  58. package/dist/utils/templatePreparation.js +35 -34
  59. package/package.json +2 -1
  60. package/dist/composables/useEditorLock.js +0 -18
  61. package/dist/src/composables/useEditorLock.d.ts +0 -11
@@ -1,57 +1,49 @@
1
- import { defineComponent as F, ref as a, computed as x } from "vue";
2
- import { useActionsApi as b } from "../../../composables/useActionsApi.js";
3
- import { useConfig as k } from "../../../composables/useConfig.js";
4
- import { useExport as B } from "../../../composables/useExport.js";
5
- import { useTestEmailClick as D } from "../../../composables/useGuidoActions.js";
6
- import { useHtmlCompiler as L } from "../../../composables/useHtmlCompiler.js";
7
- import { useSave as R } from "../../../composables/useSave.js";
8
- import { useToaster as z } from "../../../composables/useToaster.js";
9
- import { useTranslations as I } from "../../../composables/useTranslations.js";
10
- import { useVersionHistoryApi as P } from "../../../composables/useVersionHistoryApi.js";
11
- import { useLiquidValidator as j } from "../../../composables/validators/useLiquidValidator.js";
12
- import { useEditorStore as G } from "../../../stores/editor.js";
13
- import { useTemplateStore as J } from "../../../stores/template.js";
14
- import { getTooltipOptions as K } from "../../../utils/tooltipUtils.js";
15
- import { InButtonV2 as N } from "@useinsider/design-system-vue";
16
- import { storeToRefs as Q } from "pinia";
17
- import U from "./MigrationConfirmModal.vue.js";
18
- const ft = /* @__PURE__ */ F({
1
+ import { defineComponent as O, ref as n, computed as h } from "vue";
2
+ import { useActionsApi as q } from "../../../composables/useActionsApi.js";
3
+ import { useConfig as b } from "../../../composables/useConfig.js";
4
+ import { useExport as k } from "../../../composables/useExport.js";
5
+ import { useTestEmailClick as B } from "../../../composables/useGuidoActions.js";
6
+ import { useHtmlCompiler as D } from "../../../composables/useHtmlCompiler.js";
7
+ import { useSave as F } from "../../../composables/useSave.js";
8
+ import { useTranslations as L } from "../../../composables/useTranslations.js";
9
+ import { useVersionHistoryApi as R } from "../../../composables/useVersionHistoryApi.js";
10
+ import { useLiquidValidator as z } from "../../../composables/validators/useLiquidValidator.js";
11
+ import { useEditorStore as I } from "../../../stores/editor.js";
12
+ import { useTemplateStore as P } from "../../../stores/template.js";
13
+ import { getTooltipOptions as j } from "../../../utils/tooltipUtils.js";
14
+ import { InButtonV2 as G } from "@useinsider/design-system-vue";
15
+ import { storeToRefs as J } from "pinia";
16
+ import K from "./MigrationConfirmModal.vue.js";
17
+ const ut = /* @__PURE__ */ O({
19
18
  __name: "EditorActions",
20
- setup(W, { expose: w }) {
21
- const { config: n, isFeatureEnabled: l } = k(), { exportHtml: m } = B(), { save: u } = R(), { openVersionHistory: c, closeVersionHistory: p } = P(), { getCompiledEmail: f } = b(), { compileHtml: d } = L(), { validateLiquidSyntax: v } = j(), { handleError: y } = z(), e = G(), g = J(), { hasMigrations: S } = Q(g), r = I(), s = a(!1), i = a(!1), H = a(), V = D(), _ = () => {
19
+ setup(N, { expose: x }) {
20
+ const { config: a, isFeatureEnabled: l } = b(), { exportHtml: m } = k(), { save: u } = F(), { openVersionHistory: c, closeVersionHistory: p } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations: g } = J(y), s = L(), i = n(!1), r = n(!1), S = n(), H = B(), T = () => {
22
21
  if (e.isVersionHistoryOpen) {
23
22
  p();
24
23
  return;
25
24
  }
26
25
  c();
27
- }, C = async () => {
28
- s.value = !0, await m(), s.value = !1;
29
- }, A = () => {
26
+ }, w = async () => {
27
+ i.value = !0, await m(), i.value = !1;
28
+ }, _ = () => {
30
29
  e.isSaveAsTemplateDrawerOpen = !0;
31
- }, M = x(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), O = x(
30
+ }, C = h(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), A = h(
32
31
  () => {
33
32
  var t, o;
34
- return ((o = (t = n.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
33
+ return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
35
34
  }
36
- ), h = async (t) => {
37
- i.value = !0, t || (e.loadingStatus = !0);
38
- let o;
39
- try {
40
- o = await u(t);
41
- } catch (T) {
42
- y(T, "Failed to save template");
43
- } finally {
44
- i.value = !1, !t && !o && (e.loadingStatus = !1);
45
- }
46
- return o;
35
+ ), V = async (t) => {
36
+ r.value = !0, t || (e.loadingStatus = !0);
37
+ const o = await u(t);
38
+ return r.value = !1, !t && !o && (e.loadingStatus = !1), o;
47
39
  }, E = (t) => {
48
40
  var o;
49
- if (!t && S.value) {
50
- (o = H.value) == null || o.open();
41
+ if (!t && g.value) {
42
+ (o = S.value) == null || o.open();
51
43
  return;
52
44
  }
53
- return h(t);
54
- }, q = async () => {
45
+ return V(t);
46
+ }, M = async () => {
55
47
  if (l("liquidSyntax")) {
56
48
  e.loadingStatus = !0;
57
49
  try {
@@ -62,13 +54,13 @@ const ft = /* @__PURE__ */ F({
62
54
  e.loadingStatus = !1;
63
55
  }
64
56
  }
65
- V();
57
+ H();
66
58
  };
67
- return w({
59
+ return x({
68
60
  handleSave: E
69
- }), { __sfc: !0, config: n, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, handleError: y, editorStore: e, templateStore: g, hasMigrations: S, trans: r, isExporting: s, isSaving: i, migrationModalRef: H, testEmailClick: V, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: h, handleSave: E, handleTestEmail: q, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
61
+ }), { __sfc: !0, config: a, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations: g, trans: s, isExporting: i, isSaving: r, migrationModalRef: S, testEmailClick: H, handleVersionHistory: T, handleExport: w, handleSaveAs: _, versionHistoryTooltipText: C, isVersionHistoryButtonVisible: A, executeSave: V, handleSave: E, handleTestEmail: M, getTooltipOptions: j, InButtonV2: G, MigrationConfirmModal: K };
70
62
  }
71
63
  });
72
64
  export {
73
- ft as default
65
+ ut as default
74
66
  };
@@ -1,68 +1,52 @@
1
- import { filterAmpErrors as v } from "../utils/ampErrorFilter.js";
2
- import { useToaster as y } from "./useToaster.js";
3
- const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
4
- const w = setTimeout(
5
- () => m(new Error(`${n} did not report completion within ${l}ms`)),
6
- l
7
- ), p = (A) => (t) => {
8
- clearTimeout(w), A(t);
9
- };
10
- u(p(T), p(m));
11
- }), I = () => {
12
- const { handleError: n } = y(), l = (t = {}) => s(
13
- "compileEmail",
14
- d,
15
- (e, a) => {
16
- const o = { ...{
17
- minimize: !0,
18
- utmEntity: {
19
- utmSource: "",
20
- utmMedium: "",
21
- utmCampaign: "",
22
- utmContent: "",
23
- utmTerm: "",
24
- customUtms: [
25
- {
26
- name1: "val1",
27
- name2: "val2"
28
- }
29
- ]
30
- },
31
- mergeTags: ["Tag1", "Tag2"],
32
- forceAmp: !1,
33
- resetDataSavedFlag: !1,
34
- disableLineHeightsReplace: !0
35
- }, ...t }, c = {
36
- callback: (r, C, f, S, g) => {
37
- r ? a(r) : e({
38
- html: C,
39
- ampHtml: f,
40
- ampErrors: v(S ?? []),
41
- displayConditions: g
42
- });
43
- },
44
- ...o
45
- };
46
- window.StripoEditorApi.actionsApi.compileEmail(c);
47
- }
48
- );
1
+ import { filterAmpErrors as T } from "../utils/ampErrorFilter.js";
2
+ import { useToaster as A } from "./useToaster.js";
3
+ const p = 1e4, D = () => {
4
+ const { handleError: r } = A(), l = (t = {}) => new Promise((e, a) => {
5
+ const o = { ...{
6
+ minimize: !0,
7
+ utmEntity: {
8
+ utmSource: "",
9
+ utmMedium: "",
10
+ utmCampaign: "",
11
+ utmContent: "",
12
+ utmTerm: "",
13
+ customUtms: [
14
+ {
15
+ name1: "val1",
16
+ name2: "val2"
17
+ }
18
+ ]
19
+ },
20
+ mergeTags: ["Tag1", "Tag2"],
21
+ forceAmp: !1,
22
+ resetDataSavedFlag: !1,
23
+ disableLineHeightsReplace: !0
24
+ }, ...t }, n = {
25
+ callback: (m, d, c, u, w) => {
26
+ m ? a(m) : e({
27
+ html: d,
28
+ ampHtml: c,
29
+ ampErrors: T(u ?? []),
30
+ displayConditions: w
31
+ });
32
+ },
33
+ ...o
34
+ };
35
+ window.StripoEditorApi.actionsApi.compileEmail(n);
36
+ });
49
37
  return {
50
38
  getCompiledEmail: l,
51
- getTemplateData: () => s(
52
- "getTemplateData",
53
- d,
54
- (t) => {
55
- const e = ({ html: a, css: i, width: o, height: E, utmParams: c, syncModulesIds: r }) => t({
56
- html: a,
57
- css: i,
58
- width: o,
59
- height: E,
60
- utmParams: c,
61
- syncModulesIds: r
62
- });
63
- window.StripoEditorApi.actionsApi.getTemplateData(e);
64
- }
65
- ),
39
+ getTemplateData: () => new Promise((t) => {
40
+ const e = ({ html: a, css: i, width: o, height: s, utmParams: n, syncModulesIds: m }) => t({
41
+ html: a,
42
+ css: i,
43
+ width: o,
44
+ height: s,
45
+ utmParams: n,
46
+ syncModulesIds: m
47
+ });
48
+ window.StripoEditorApi.actionsApi.getTemplateData(e);
49
+ }),
66
50
  activateCustomViewStyles: (t = !0) => {
67
51
  window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
68
52
  },
@@ -81,7 +65,7 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
81
65
  displayConditions: a
82
66
  };
83
67
  } catch (e) {
84
- return n(e, "Error loading preview"), {
68
+ return r(e, "Error loading preview"), {
85
69
  html: "",
86
70
  ampHtml: "",
87
71
  ampErrors: [],
@@ -97,33 +81,34 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
97
81
  }
98
82
  try {
99
83
  window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
100
- i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
84
+ i ? (r(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
101
85
  });
102
86
  } catch (i) {
103
- n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
87
+ r(i, "Failed to call updateTimerInClonedTemplate"), t(null);
104
88
  }
105
89
  }),
106
90
  updateHtmlAndCss: (t, e) => {
107
91
  const { actionsApi: a } = window.StripoEditorApi;
108
- return s("updateHtmlAndCss", D, (i) => {
109
- a.updateHtmlAndCss(t, e, () => i());
92
+ return new Promise((i, o) => {
93
+ const s = new Error(
94
+ `updateHtmlAndCss did not report completion within ${p}ms`
95
+ ), n = setTimeout(() => o(s), p);
96
+ a.updateHtmlAndCss(t, e, () => {
97
+ clearTimeout(n), i();
98
+ });
110
99
  });
111
100
  },
112
- editorSave: () => s(
113
- "save",
114
- d,
115
- (t) => {
116
- window.StripoEditorApi.actionsApi.save((e) => {
117
- if (e) {
118
- n(e, "Failed to save template"), t(!1);
119
- return;
120
- }
121
- t(!0);
122
- });
123
- }
124
- )
101
+ editorSave: () => new Promise((t) => {
102
+ window.StripoEditorApi.actionsApi.save((e) => {
103
+ if (e) {
104
+ r(e, "Failed to save template"), t(!1);
105
+ return;
106
+ }
107
+ t(!0);
108
+ });
109
+ })
125
110
  };
126
111
  };
127
112
  export {
128
- I as useActionsApi
113
+ D as useActionsApi
129
114
  };
@@ -1,22 +1,21 @@
1
- import { useConfig as E } from "./useConfig.js";
2
- import { useEditorLock as p } from "./useEditorLock.js";
1
+ import { useConfig as m } from "./useConfig.js";
3
2
  import { useAutosaveStore as A, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
4
- import { useEditorStore as f } from "../stores/editor.js";
5
- import { computed as y, watch as I, onUnmounted as L } from "vue";
6
- const w = 18e4, v = 6e4, R = (b) => {
7
- const { isFeatureEnabled: S } = E(), o = f(), t = A(), { isEditorBusy: g } = p();
3
+ import { useEditorStore as E } from "../stores/editor.js";
4
+ import { computed as f, watch as p, onUnmounted as y } from "vue";
5
+ const I = 18e4, r = 6e4, T = (b) => {
6
+ const { isFeatureEnabled: S } = m(), a = E(), t = A();
8
7
  let i = null, c = 0;
9
- const u = y(
8
+ const u = f(
10
9
  () => S("autosave") && t.isOn
11
- ), m = () => o.hasChanges && o.isInSaveableState, h = () => ({
12
- hasChanges: o.hasChanges,
13
- isInSaveableState: o.isInSaveableState
14
- }), r = async (e) => {
10
+ ), g = () => a.hasChanges && a.isInSaveableState, h = () => ({
11
+ hasChanges: a.hasChanges,
12
+ isInSaveableState: a.isInSaveableState
13
+ }), l = async (e) => {
15
14
  if (!u.value) {
16
15
  console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
17
16
  return;
18
17
  }
19
- if (!m()) {
18
+ if (!g()) {
20
19
  console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates: h() });
21
20
  return;
22
21
  }
@@ -24,19 +23,15 @@ const w = 18e4, v = 6e4, R = (b) => {
24
23
  console.debug("guido:autosave:skipped", { trigger: e, reason: "already-saving" });
25
24
  return;
26
25
  }
27
- if (g()) {
28
- console.debug("guido:autosave:skipped", { trigger: e, reason: "editor-busy" });
29
- return;
30
- }
31
26
  console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
32
27
  try {
33
28
  if (await b() === void 0) {
34
29
  console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = s.ERROR;
35
30
  return;
36
31
  }
37
- o.hasChanges = !1, t.status = s.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
38
- } catch (a) {
39
- console.debug("guido:autosave:error", { trigger: e, error: a }), t.status = s.ERROR;
32
+ a.hasChanges = !1, t.status = s.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
33
+ } catch (o) {
34
+ console.debug("guido:autosave:error", { trigger: e, error: o }), t.status = s.ERROR;
40
35
  }
41
36
  }, n = () => {
42
37
  const { visibilityState: e } = document;
@@ -45,32 +40,32 @@ const w = 18e4, v = 6e4, R = (b) => {
45
40
  isActive: u.value
46
41
  }), e !== "hidden")
47
42
  return;
48
- const a = Date.now() - c;
49
- if (a < v) {
43
+ const o = Date.now() - c;
44
+ if (o < r) {
50
45
  console.debug("guido:autosave:visibility-debounced", {
51
- sinceLastMs: a,
52
- debounceMs: v
46
+ sinceLastMs: o,
47
+ debounceMs: r
53
48
  });
54
49
  return;
55
50
  }
56
- c = Date.now(), r("visibility");
51
+ c = Date.now(), l("visibility");
57
52
  }, d = () => {
58
53
  i && (clearInterval(i), i = null);
59
- }, l = () => {
54
+ }, v = () => {
60
55
  document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
61
56
  };
62
- I(
57
+ p(
63
58
  u,
64
59
  (e) => {
65
60
  console.debug("guido:autosave:active-changed", { active: e }), e ? (d(), i = setInterval(() => {
66
- console.debug("guido:autosave:interval-tick"), r("interval");
67
- }, w), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), l(), t.status = s.IDLE);
61
+ console.debug("guido:autosave:interval-tick"), l("interval");
62
+ }, I), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), v(), t.status = s.IDLE);
68
63
  },
69
64
  { immediate: !0 }
70
- ), L(() => {
71
- d(), l(), t.status = s.IDLE, t.lastSavedAt = null;
65
+ ), y(() => {
66
+ d(), v(), t.status = s.IDLE, t.lastSavedAt = null;
72
67
  });
73
68
  };
74
69
  export {
75
- R as useAutoSave
70
+ T as useAutoSave
76
71
  };
@@ -1,53 +1,67 @@
1
- import S from "../static/styles/base.css.js";
2
- import m from "../static/styles/components/alert-message.css.js";
3
- import e from "../static/styles/components/amp-block.css.js";
4
- import i from "../static/styles/components/base-input.css.js";
5
- import p from "../static/styles/components/button-group.css.js";
6
- import n from "../static/styles/components/button.css.js";
7
- import s from "../static/styles/components/combobox.css.js";
8
- import C from "../static/styles/components/counter.css.js";
9
- import f from "../static/styles/components/dropdown-menu.css.js";
10
- import a from "../static/styles/components/loader.css.js";
11
- import u from "../static/styles/components/narrow-panel.css.js";
12
- import c from "../static/styles/components/popup.css.js";
13
- import d from "../static/styles/components/switcher.css.js";
14
- import l from "../static/styles/components/tabs.css.js";
15
- import h from "../static/styles/components/tools.css.js";
16
- import w from "../static/styles/components/version-history.css.js";
17
- import y from "../static/styles/components/wide-panel.css.js";
18
- import B from "../static/styles/variables.css.js";
19
- const b = [
20
- B,
21
- // Must be on top
22
- S,
1
+ import S from "../static/assets/icons/line-change.svg.js";
2
+ import i from "../static/assets/icons/line-delete.svg.js";
3
+ import n from "../static/assets/icons/line-plus.svg.js";
4
+ import p from "../static/styles/base.css.js";
5
+ import s from "../static/styles/components/alert-message.css.js";
6
+ import C from "../static/styles/components/amp-block.css.js";
7
+ import a from "../static/styles/components/base-input.css.js";
8
+ import f from "../static/styles/components/button-group.css.js";
9
+ import c from "../static/styles/components/button.css.js";
10
+ import u from "../static/styles/components/combobox.css.js";
11
+ import l from "../static/styles/components/counter.css.js";
12
+ import d from "../static/styles/components/dropdown-menu.css.js";
13
+ import h from "../static/styles/components/loader.css.js";
14
+ import g from "../static/styles/components/narrow-panel.css.js";
15
+ import I from "../static/styles/components/popup.css.js";
16
+ import w from "../static/styles/components/recommendation-strategy.css.js";
17
+ import y from "../static/styles/components/switcher.css.js";
18
+ import b from "../static/styles/components/tabs.css.js";
19
+ import B from "../static/styles/components/tools.css.js";
20
+ import $ from "../static/styles/components/version-history.css.js";
21
+ import P from "../static/styles/components/wide-panel.css.js";
22
+ import x from "../static/styles/variables.css.js";
23
+ function r(t, o) {
24
+ return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
25
+ }
26
+ const A = `:host {
27
+ ${r("line-change", S)}
28
+ ${r("line-delete", i)}
29
+ ${r("line-plus", n)}
30
+ }`, R = [
31
+ x,
23
32
  // Must be on top
24
- m,
25
- e,
26
- i,
33
+ A,
27
34
  p,
28
- n,
35
+ // Must be on top
29
36
  s,
30
37
  C,
31
- f,
32
38
  a,
33
- u,
39
+ f,
34
40
  c,
35
- d,
41
+ u,
36
42
  l,
43
+ d,
37
44
  h,
38
- w,
39
- y
45
+ g,
46
+ I,
47
+ y,
48
+ b,
49
+ B,
50
+ $,
51
+ P,
52
+ w
53
+ // Last: overrides button.css / wide-panel.css defaults
40
54
  ].join(`
41
55
 
42
- `), v = () => ({ importCss: () => {
56
+ `), Y = () => ({ importCss: () => {
43
57
  const o = new CSSStyleSheet();
44
- o.replaceSync(b);
45
- const r = document.querySelector("ui-editor");
46
- if (!r)
58
+ o.replaceSync(R);
59
+ const e = document.querySelector("ui-editor");
60
+ if (!e)
47
61
  return;
48
- const t = r.shadowRoot;
49
- t && (t.adoptedStyleSheets = [o]);
62
+ const m = e.shadowRoot;
63
+ m && (m.adoptedStyleSheets = [o]);
50
64
  } });
51
65
  export {
52
- v as useCustomInterfaceAppearance
66
+ Y as useCustomInterfaceAppearance
53
67
  };
@@ -1,49 +1,48 @@
1
- import { useActionsApi as I } from "./useActionsApi.js";
2
- import { useEditorLock as b } from "./useEditorLock.js";
3
- import { useConfigStore as T } from "../stores/config.js";
4
- import { useEditorStore as v } from "../stores/editor.js";
5
- import { useGuidoEmailEditorStore as w } from "../stores/guido-email-editor.js";
6
- import { watch as c, onUnmounted as y } from "vue";
7
- const B = 500, G = () => {
8
- const i = v(), a = w(), u = T(), { getTemplateData: l } = I(), { runExclusive: m, isEditorBusy: d } = b();
9
- let o = null, r = !1;
10
- const s = () => {
11
- o && (clearTimeout(o), o = null);
12
- }, n = async () => {
13
- var t, e;
14
- if (!(r || !i.isStripoInitialized || d()))
1
+ import { useActionsApi as g } from "./useActionsApi.js";
2
+ import { useConfigStore as I } from "../stores/config.js";
3
+ import { useEditorStore as b } from "../stores/editor.js";
4
+ import { useGuidoEmailEditorStore as E } from "../stores/guido-email-editor.js";
5
+ import { watch as c, onUnmounted as T } from "vue";
6
+ const w = 500, z = () => {
7
+ const i = b(), a = E(), l = I(), { getTemplateData: m } = g();
8
+ let e = null, n = !1;
9
+ const r = () => {
10
+ e && (clearTimeout(e), e = null);
11
+ }, s = async () => {
12
+ var t, o;
13
+ if (!(n || !i.isStripoInitialized))
15
14
  try {
16
- const { html: S, css: E } = await m(l), g = ((e = (t = u.config) == null ? void 0 : t.identity) == null ? void 0 : e.templateId) ?? "";
17
- if (r)
15
+ const { html: f, css: h } = await m(), S = ((o = (t = l.config) == null ? void 0 : t.identity) == null ? void 0 : o.templateId) ?? "";
16
+ if (n)
18
17
  return;
19
18
  a.$patch({
20
- html: S ?? "",
21
- css: E ?? "",
22
- templateId: g,
19
+ html: f ?? "",
20
+ css: h ?? "",
21
+ templateId: S,
23
22
  lastUpdatedAt: Date.now()
24
23
  });
25
24
  } catch {
26
25
  }
27
- }, p = () => {
28
- s(), o = setTimeout(() => {
29
- o = null, n();
30
- }, B);
31
- }, f = c(
26
+ }, u = () => {
27
+ r(), e = setTimeout(() => {
28
+ e = null, s();
29
+ }, w);
30
+ }, d = c(
32
31
  () => i.isStripoInitialized,
33
32
  (t) => {
34
- t && n();
33
+ t && s();
35
34
  },
36
35
  { immediate: !0 }
37
- ), h = c(
36
+ ), p = c(
38
37
  () => i.hasChanges,
39
- (t, e) => {
40
- i.isStripoInitialized && (t ? p() : e && (s(), n()));
38
+ (t, o) => {
39
+ i.isStripoInitialized && (t ? u() : o && (r(), s()));
41
40
  }
42
41
  );
43
- y(() => {
44
- r = !0, s(), f(), h();
42
+ T(() => {
43
+ n = !0, r(), d(), p();
45
44
  });
46
45
  };
47
46
  export {
48
- G as useGuidoStateBridge
47
+ z as useGuidoStateBridge
49
48
  };