@useinsider/guido 3.19.0-beta.0a1f92f → 3.19.0-beta.0b78e99

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 (154) hide show
  1. package/README.md +21 -3
  2. package/dist/@types/config/schemas.js +71 -51
  3. package/dist/components/Guido.vue.js +11 -11
  4. package/dist/components/Guido.vue2.js +90 -90
  5. package/dist/components/organisms/AutoSaveController.vue2.js +8 -10
  6. package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
  7. package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
  8. package/dist/components/organisms/base/Toaster.vue2.js +13 -12
  9. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
  10. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +78 -57
  11. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  12. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  13. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +28 -42
  14. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  15. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  16. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  17. package/dist/components/organisms/header/EditorActions.vue2.js +51 -37
  18. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  19. package/dist/components/organisms/header/HeaderWrapper.vue2.js +17 -9
  20. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  21. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -32
  22. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  23. package/dist/components/organisms/header/MiddleSlot.vue2.js +7 -8
  24. package/dist/components/organisms/header/RightSlot.vue.js +8 -9
  25. package/dist/components/organisms/header/RightSlot.vue2.js +18 -13
  26. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  27. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +40 -54
  28. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
  29. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
  30. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
  31. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
  32. package/dist/components/wrappers/WpModal.vue.js +1 -1
  33. package/dist/components/wrappers/WpModal.vue2.js +4 -3
  34. package/dist/composables/useActionsApi.js +52 -47
  35. package/dist/composables/useAuthError.js +52 -0
  36. package/dist/composables/useAutoSave.js +11 -11
  37. package/dist/composables/useCodeEditorApi.js +23 -9
  38. package/dist/composables/useCustomInterfaceAppearance.js +65 -52
  39. package/dist/composables/useHtmlValidator.js +87 -82
  40. package/dist/composables/useHttp.js +64 -54
  41. package/dist/composables/useLegacyStrategyConversion.js +65 -0
  42. package/dist/composables/useRecommendation.js +40 -35
  43. package/dist/composables/useStripo.js +43 -39
  44. package/dist/composables/useToaster.js +18 -22
  45. package/dist/composables/useTranslations.js +3 -2
  46. package/dist/composables/useVersionHistoryApi.js +33 -24
  47. package/dist/composables/validators/useLiquidValidator.js +15 -15
  48. package/dist/config/compiler/utils/recommendationCompilerUtils.js +72 -57
  49. package/dist/config/i18n/en/labels.json.js +4 -36
  50. package/dist/config/i18n/en/tooltips.json.js +1 -2
  51. package/dist/config/migrator/index.js +14 -13
  52. package/dist/config/migrator/itemsBlockMigrator.js +236 -248
  53. package/dist/config/migrator/recommendationMigrator.js +28 -21
  54. package/dist/config/migrator/recommendationPartnerMigrator.js +56 -0
  55. package/dist/enums/extensions/recommendationBlock.js +51 -34
  56. package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
  57. package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
  58. package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
  59. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  60. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
  61. package/dist/extensions/Blocks/Items/template.js +219 -204
  62. package/dist/extensions/Blocks/Recommendation/block.js +92 -50
  63. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
  64. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +103 -90
  65. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +150 -52
  66. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
  67. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +15 -11
  68. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +274 -92
  69. package/dist/extensions/Blocks/Recommendation/templates/utils.js +16 -16
  70. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +91 -87
  71. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
  72. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
  73. package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
  74. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
  75. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
  76. package/dist/guido.css +1 -1
  77. package/dist/services/recommendationApi.js +46 -37
  78. package/dist/sprite.svg +0 -6
  79. package/dist/src/@types/config/schemas.d.ts +32 -2
  80. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +1 -3
  81. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +3 -1
  82. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +3 -1
  83. package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
  84. package/dist/src/composables/useActionsApi.d.ts +2 -2
  85. package/dist/src/composables/useAuthError.d.ts +12 -0
  86. package/dist/src/composables/useConfig.d.ts +6 -2
  87. package/dist/src/composables/useGuidoActions.d.ts +2 -0
  88. package/dist/src/composables/useHttp.d.ts +2 -0
  89. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  90. package/dist/src/config/migrator/index.d.ts +2 -1
  91. package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
  92. package/dist/src/enums/extensions/recommendationBlock.d.ts +7 -1
  93. package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
  94. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
  95. package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
  96. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +11 -0
  97. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  98. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  99. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  100. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +10 -0
  101. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
  102. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +162 -1
  103. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +5 -2
  104. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  105. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
  106. package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
  107. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
  108. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
  109. package/dist/src/mock/cortexChatStore.d.ts +12 -0
  110. package/dist/src/services/recommendationApi.d.ts +2 -1
  111. package/dist/src/stores/config.d.ts +342 -18
  112. package/dist/src/stores/editor.d.ts +0 -109
  113. package/dist/src/stores/onboarding.d.ts +288 -201
  114. package/dist/src/stores/recommendation.d.ts +5 -0
  115. package/dist/src/stores/version-history.d.ts +1 -1
  116. package/dist/src/utils/dateUtil.d.ts +10 -0
  117. package/dist/src/utils/fluidImageStyle.d.ts +7 -0
  118. package/dist/src/utils/genericUtil.d.ts +3 -0
  119. package/dist/src/utils/stripoEditorApi.d.ts +4 -0
  120. package/dist/src/utils/timeUtil.d.ts +0 -5
  121. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  122. package/dist/static/assets/icons/line-info.svg.js +5 -0
  123. package/dist/static/styles/components/recommendation-strategy.css.js +113 -9
  124. package/dist/static/styles/components/skeleton.css.js +23 -0
  125. package/dist/static/styles/components/version-history.css.js +2 -6
  126. package/dist/static/styles/variables.css.js +0 -2
  127. package/dist/stores/config.js +74 -60
  128. package/dist/stores/editor.js +4 -7
  129. package/dist/stores/onboarding.js +34 -42
  130. package/dist/stores/unsubscribe.js +3 -3
  131. package/dist/utils/fluidImageStyle.js +26 -0
  132. package/dist/utils/pairProductVariables.js +71 -71
  133. package/dist/utils/stripoEditorApi.js +11 -0
  134. package/dist/utils/templatePreparation.js +55 -55
  135. package/dist/utils/timeUtil.js +17 -6
  136. package/package.json +2 -1
  137. package/dist/components/organisms/header/AutoSaveStatus.vue.js +0 -17
  138. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +0 -25
  139. package/dist/components/organisms/header/EditorActionsMenu.vue.js +0 -20
  140. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +0 -98
  141. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +0 -18
  142. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +0 -37
  143. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +0 -22
  144. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +0 -48
  145. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +0 -19
  146. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +0 -90
  147. package/dist/composables/useAccessibilityApi.js +0 -35
  148. package/dist/src/composables/useAccessibilityApi.d.ts +0 -15
  149. package/dist/static/styles/components/accessibility.css.js +0 -234
  150. /package/dist/src/components/organisms/{header/AutoSaveStatus.vue.d.ts → base/AuthErrorModal.vue.d.ts} +0 -0
  151. /package/dist/src/components/organisms/{header/EditorActionsMenu.vue.d.ts → extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts} +0 -0
  152. /package/dist/src/components/organisms/header/{accessibility/AccessibilityToolbar.vue.d.ts → AutoSaveToggle.vue.d.ts} +0 -0
  153. /package/dist/src/components/organisms/{header/accessibility/ColorVisionSelect.vue.d.ts → onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts} +0 -0
  154. /package/dist/src/components/organisms/onboarding/{EditorTabBarOnboarding.vue.d.ts → RecommendationStrategyOnboarding.vue.d.ts} +0 -0
@@ -0,0 +1,47 @@
1
+ import { defineComponent as g, computed as p, watch as b } from "vue";
2
+ import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as l } from "../../../composables/useTranslations.js";
4
+ import { ACADEMY_LINKS as f } from "../../../enums/academy.js";
5
+ import { useRecommendationExtensionStore as O } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
6
+ import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
7
+ import { InOnboard as y } from "@useinsider/design-system-vue";
8
+ const h = /* @__PURE__ */ g({
9
+ __name: "RecommendationStrategyOnboarding",
10
+ setup(C) {
11
+ const n = "recommendationStrategyOnboarding", e = l(), t = _(), i = O(), { getTopPosition: r } = u(), a = `<a href="${f.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${e("action-builder.visit-academy")}</a>`, m = () => [
12
+ {
13
+ classes: "guido-recommendation-strategy-onboarding",
14
+ // Sits in the gap left of the settings panel and points at the strategy section, which
15
+ // starts 208px down: the panel header and its tab row are fixed chrome above it.
16
+ right: "426px",
17
+ top: r(208),
18
+ position: "Right Top",
19
+ title: e("email-editor.onboarding-recommendation-strategy-title"),
20
+ description: e("email-editor.onboarding-recommendation-strategy-description", {
21
+ academyLink: a
22
+ }),
23
+ imageSource: "",
24
+ backButtonClick: () => {
25
+ },
26
+ nextButtonType: "text",
27
+ nextButtonText: e("action-builder.ok"),
28
+ nextButtonClick: () => {
29
+ t.close(n);
30
+ }
31
+ }
32
+ ], c = p(() => i.strategyPanelOpen && t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
33
+ var o, s;
34
+ (s = (o = t.getRecommendationStrategyCurrentCard) == null ? void 0 : o.nextButtonClick) == null || s.call(o);
35
+ };
36
+ return b(
37
+ () => t.isActive(n),
38
+ (o) => {
39
+ o && t.setConfig(n, m());
40
+ },
41
+ { immediate: !0 }
42
+ ), { __sfc: !0, ONBOARDING_TYPE: n, trans: e, onboardingStore: t, recommendationStore: i, getTopPosition: r, academyLink: a, buildOnboardingCards: m, isVisible: c, handleNext: d, InOnboard: y };
43
+ }
44
+ });
45
+ export {
46
+ h as default
47
+ };
@@ -2,7 +2,7 @@ import r from "./WpModal.vue2.js";
2
2
  import s from "../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var i = function() {
4
4
  var t = this, o = t._self._c, e = t._self._setupProxy;
5
- return o(e.InModalV2, { attrs: { id: t.id, "description-status": "", status: "", "close-button-status": t.closeButtonStatus, "close-on-outside-click": t.closeOnOutsideClick, "description-text": t.description, "footer-button-group-options": t.footerButtonOptions, "footer-status": t.footerStatus, size: t.size, "title-text": t.title }, on: { cancelOrBackButtonEvent: function(n) {
5
+ return o(e.InModalV2, { attrs: { id: t.id, "description-status": "", status: "", "close-button-status": t.closeButtonStatus, "close-on-outside-click": t.closeOnOutsideClick, "description-text": t.description, "footer-button-group-options": t.footerButtonOptions, "footer-status": t.footerStatus, size: t.size, state: t.state, "title-text": t.title }, on: { cancelOrBackButtonEvent: function(n) {
6
6
  return e.emit("close");
7
7
  }, onCloseEvent: function(n) {
8
8
  return e.emit("close");
@@ -1,11 +1,12 @@
1
1
  import { defineComponent as e } from "vue";
2
2
  import { InModalV2 as o } from "@useinsider/design-system-vue";
3
- const u = /* @__PURE__ */ e({
3
+ const n = /* @__PURE__ */ e({
4
4
  __name: "WpModal",
5
5
  props: {
6
6
  id: null,
7
7
  title: null,
8
8
  description: { default: "" },
9
+ state: { default: "default" },
9
10
  size: { default: "small" },
10
11
  footerButtonOptions: { default: void 0 },
11
12
  closeButtonStatus: { type: Boolean, default: !0 },
@@ -13,10 +14,10 @@ const u = /* @__PURE__ */ e({
13
14
  footerStatus: { type: Boolean, default: !0 }
14
15
  },
15
16
  emits: ["close", "primary-action", "secondary-action"],
16
- setup(l, { emit: t }) {
17
+ setup(a, { emit: t }) {
17
18
  return { __sfc: !0, emit: t, InModalV2: o };
18
19
  }
19
20
  });
20
21
  export {
21
- u as default
22
+ n as default
22
23
  };
@@ -1,18 +1,23 @@
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`)),
1
+ import { filterAmpErrors as y } from "../utils/ampErrorFilter.js";
2
+ import { getEditorApi as s } from "../utils/stripoEditorApi.js";
3
+ import { useToaster as D } from "./useToaster.js";
4
+ const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
5
+ const f = setTimeout(
6
+ () => p(new Error(`${n} did not report completion within ${l}ms`)),
6
7
  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(
8
+ ), c = (t) => (e) => {
9
+ clearTimeout(f), t(e);
10
+ }, d = c(p);
11
+ try {
12
+ A(c(C), d);
13
+ } catch (t) {
14
+ d(t);
15
+ }
16
+ }), P = () => {
17
+ const { handleError: n } = D(), l = (t = {}) => r(
13
18
  "compileEmail",
14
- d,
15
- (e, a) => {
19
+ T,
20
+ (e, i) => {
16
21
  const o = { ...{
17
22
  minimize: !0,
18
23
  utmEntity: {
@@ -32,53 +37,53 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
32
37
  forceAmp: !1,
33
38
  resetDataSavedFlag: !1,
34
39
  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
40
+ }, ...t }, u = {
41
+ callback: (m, g, w, S, v) => {
42
+ m ? i(m) : e({
43
+ html: g,
44
+ ampHtml: w,
45
+ ampErrors: y(S ?? []),
46
+ displayConditions: v
42
47
  });
43
48
  },
44
49
  ...o
45
50
  };
46
- window.StripoEditorApi.actionsApi.compileEmail(c);
51
+ s().actionsApi.compileEmail(u);
47
52
  }
48
53
  );
49
54
  return {
50
55
  getCompiledEmail: l,
51
- getTemplateData: () => s(
56
+ getTemplateData: () => r(
52
57
  "getTemplateData",
53
- d,
58
+ T,
54
59
  (t) => {
55
- const e = ({ html: a, css: i, width: o, height: E, utmParams: c, syncModulesIds: r }) => t({
56
- html: a,
57
- css: i,
60
+ const e = ({ html: i, css: a, width: o, height: E, utmParams: u, syncModulesIds: m }) => t({
61
+ html: i,
62
+ css: a,
58
63
  width: o,
59
64
  height: E,
60
- utmParams: c,
61
- syncModulesIds: r
65
+ utmParams: u,
66
+ syncModulesIds: m
62
67
  });
63
- window.StripoEditorApi.actionsApi.getTemplateData(e);
68
+ s().actionsApi.getTemplateData(e);
64
69
  }
65
70
  ),
66
71
  activateCustomViewStyles: (t = !0) => {
67
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
72
+ s().actionsApi.activateCustomViewStyles(t);
68
73
  },
69
74
  getPreviewData: async (t) => {
70
75
  try {
71
76
  const {
72
77
  html: e,
73
- displayConditions: a,
74
- ampHtml: i = "",
78
+ displayConditions: i,
79
+ ampHtml: a = "",
75
80
  ampErrors: o = []
76
81
  } = await l({ minimize: !1, resetDataSavedFlag: !1, ...t });
77
82
  return {
78
83
  html: e,
79
- ampHtml: i,
84
+ ampHtml: a,
80
85
  ampErrors: o,
81
- displayConditions: a
86
+ displayConditions: i
82
87
  };
83
88
  } catch (e) {
84
89
  return n(e, "Error loading preview"), {
@@ -90,30 +95,30 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
90
95
  }
91
96
  },
92
97
  updateTimerInClonedTemplate: () => new Promise((t) => {
93
- var e, a;
94
- if (typeof ((a = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : a.updateTimerInClonedTemplate) != "function") {
98
+ var e, i;
99
+ if (typeof ((i = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : i.updateTimerInClonedTemplate) != "function") {
95
100
  t(null);
96
101
  return;
97
102
  }
98
103
  try {
99
- window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
100
- i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
104
+ window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((a, o) => {
105
+ a ? (n(a, "Failed to update timer in cloned template"), t(null)) : t(o || null);
101
106
  });
102
- } catch (i) {
103
- n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
107
+ } catch (a) {
108
+ n(a, "Failed to call updateTimerInClonedTemplate"), t(null);
104
109
  }
105
110
  }),
106
111
  updateHtmlAndCss: (t, e) => {
107
- const { actionsApi: a } = window.StripoEditorApi;
108
- return s("updateHtmlAndCss", D, (i) => {
109
- a.updateHtmlAndCss(t, e, () => i());
112
+ const { actionsApi: i } = s();
113
+ return r("updateHtmlAndCss", h, (a) => {
114
+ i.updateHtmlAndCss(t, e, () => a());
110
115
  });
111
116
  },
112
- editorSave: () => s(
117
+ editorSave: () => r(
113
118
  "save",
114
- d,
119
+ T,
115
120
  (t) => {
116
- window.StripoEditorApi.actionsApi.save((e) => {
121
+ s().actionsApi.save((e) => {
117
122
  if (e) {
118
123
  n(e, "Failed to save template"), t(!1);
119
124
  return;
@@ -125,5 +130,5 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
125
130
  };
126
131
  };
127
132
  export {
128
- I as useActionsApi
133
+ P as useActionsApi
129
134
  };
@@ -0,0 +1,52 @@
1
+ import { ToasterTypeOptions as l } from "../enums/toaster.js";
2
+ import { ref as p } from "vue";
3
+ import { useToaster as u } from "./useToaster.js";
4
+ import { useTranslations as f } from "./useTranslations.js";
5
+ const d = ["accessExpired", "domainRestricted", "ipRestricted", "insiderAccessRestricted"], n = p(null), a = (e) => {
6
+ try {
7
+ return new URL(e, window.location.href).origin === window.location.origin;
8
+ } catch {
9
+ return !0;
10
+ }
11
+ }, g = (e) => {
12
+ try {
13
+ const o = new URL(e, window.location.href);
14
+ return o.origin === window.location.origin ? o.href : "";
15
+ } catch {
16
+ return "";
17
+ }
18
+ }, w = (e) => {
19
+ try {
20
+ const o = JSON.parse(e);
21
+ return o && typeof o == "object" && Object.keys(o).length ? o : null;
22
+ } catch {
23
+ return null;
24
+ }
25
+ }, y = (e) => typeof (e == null ? void 0 : e.message) == "string" ? e.message : "", s = (e) => y(e) || f()("user-management.collaborate-forbidden-action"), c = (e) => {
26
+ u().showToaster({ type: l.Error, message: e });
27
+ }, R = (e, o, t) => {
28
+ if (t && !a(t))
29
+ return;
30
+ const r = w(o);
31
+ if (e === 403) {
32
+ c(s(r));
33
+ return;
34
+ }
35
+ if (e === 401 && (r == null ? void 0 : r.type) === "groupLevelAccess") {
36
+ c(s(r));
37
+ return;
38
+ }
39
+ if (e === 401 && typeof (r == null ? void 0 : r.type) == "string" && d.includes(r.type)) {
40
+ const i = typeof r.redirect == "string" ? g(r.redirect) : "";
41
+ if (i) {
42
+ window.location.replace(i);
43
+ return;
44
+ }
45
+ }
46
+ e !== 401 && e !== 419 || n.value || (window.isSessionExpired = !0, n.value = { status: e, data: r });
47
+ }, T = () => ({ authError: n });
48
+ export {
49
+ a as isPanelOrigin,
50
+ R as reportAuthError,
51
+ T as useAuthError
52
+ };
@@ -1,17 +1,17 @@
1
1
  import { useConfig as E } from "./useConfig.js";
2
- import { useEditorLock as p } from "./useEditorLock.js";
3
- import { useAutosaveStore as A, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
4
- import { useEditorStore as f } from "../stores/editor.js";
2
+ import { useEditorLock as f } from "./useEditorLock.js";
3
+ import { useAutosaveStore as p, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
4
+ import { useEditorStore as A } from "../stores/editor.js";
5
5
  import { computed as y, watch as I, onUnmounted as L } from "vue";
6
6
  const w = 18e4, v = 6e4, R = (b) => {
7
- const { isFeatureEnabled: S } = E(), o = f(), t = A(), { isEditorBusy: g } = p();
7
+ const { isFeatureEnabled: S } = E(), o = A(), t = p(), { isEditorBusy: g } = f();
8
8
  let i = null, c = 0;
9
9
  const u = y(
10
10
  () => S("autosave") && t.isOn
11
11
  ), m = () => o.hasChanges && o.isInSaveableState, h = () => ({
12
12
  hasChanges: o.hasChanges,
13
13
  isInSaveableState: o.isInSaveableState
14
- }), r = async (e) => {
14
+ }), l = async (e) => {
15
15
  if (!u.value) {
16
16
  console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
17
17
  return;
@@ -28,7 +28,7 @@ const w = 18e4, v = 6e4, R = (b) => {
28
28
  console.debug("guido:autosave:skipped", { trigger: e, reason: "editor-busy" });
29
29
  return;
30
30
  }
31
- console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
31
+ e === "visibility" && (c = Date.now()), console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
32
32
  try {
33
33
  if (await b() === void 0) {
34
34
  console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = s.ERROR;
@@ -53,22 +53,22 @@ const w = 18e4, v = 6e4, R = (b) => {
53
53
  });
54
54
  return;
55
55
  }
56
- c = Date.now(), r("visibility");
56
+ l("visibility");
57
57
  }, d = () => {
58
58
  i && (clearInterval(i), i = null);
59
- }, l = () => {
59
+ }, r = () => {
60
60
  document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
61
61
  };
62
62
  I(
63
63
  u,
64
64
  (e) => {
65
65
  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);
66
+ console.debug("guido:autosave:interval-tick"), l("interval");
67
+ }, w), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), r(), t.status = s.IDLE);
68
68
  },
69
69
  { immediate: !0 }
70
70
  ), L(() => {
71
- d(), l(), t.status = s.IDLE, t.lastSavedAt = null;
71
+ d(), r(), t.status = s.IDLE, t.lastSavedAt = null;
72
72
  });
73
73
  };
74
74
  export {
@@ -1,11 +1,25 @@
1
- const i = () => ({
2
- openCodeEditor: () => {
3
- window.StripoEditorApi.codeEditorApi.openCodeEditor();
4
- },
5
- closeCodeEditor: () => {
6
- window.StripoEditorApi.codeEditorApi.closeCodeEditor();
7
- }
8
- });
1
+ import { ToasterTypeOptions as d } from "../enums/toaster.js";
2
+ import { findEditorApi as s, EDITOR_NOT_READY_MESSAGE as p } from "../utils/stripoEditorApi.js";
3
+ import { useToaster as E } from "./useToaster.js";
4
+ const T = () => {
5
+ const { showToaster: i } = E(), t = (o) => {
6
+ var r;
7
+ const e = (r = s()) == null ? void 0 : r.codeEditorApi;
8
+ if (!e) {
9
+ i({ type: d.Error, message: p });
10
+ return;
11
+ }
12
+ o(e);
13
+ };
14
+ return {
15
+ openCodeEditor: () => {
16
+ t((o) => o.openCodeEditor());
17
+ },
18
+ closeCodeEditor: () => {
19
+ t((o) => o.closeCodeEditor());
20
+ }
21
+ };
22
+ };
9
23
  export {
10
- i as useCodeEditorApi
24
+ T as useCodeEditorApi
11
25
  };
@@ -1,68 +1,81 @@
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/accessibility.css.js";
1
+ import p from "../static/assets/icons/filled-arrow-rising.svg.js";
2
+ import s from "../static/assets/icons/line-change.svg.js";
3
+ import a from "../static/assets/icons/line-delete.svg.js";
4
+ import f from "../static/assets/icons/line-info.svg.js";
5
+ import c from "../static/assets/icons/line-plus.svg.js";
6
+ import l from "../static/styles/base.css.js";
6
7
  import C from "../static/styles/components/alert-message.css.js";
7
- import c from "../static/styles/components/amp-block.css.js";
8
- import f from "../static/styles/components/base-input.css.js";
9
- import a from "../static/styles/components/button-group.css.js";
10
- import u from "../static/styles/components/button.css.js";
11
- import l from "../static/styles/components/combobox.css.js";
12
- import d from "../static/styles/components/counter.css.js";
13
- import h from "../static/styles/components/dropdown-menu.css.js";
14
- import g from "../static/styles/components/loader.css.js";
15
- import y from "../static/styles/components/narrow-panel.css.js";
16
- import I from "../static/styles/components/popup.css.js";
17
- import b from "../static/styles/components/recommendation-strategy.css.js";
18
- import w from "../static/styles/components/switcher.css.js";
19
- import B from "../static/styles/components/tabs.css.js";
20
- import $ from "../static/styles/components/tools.css.js";
21
- import A from "../static/styles/components/version-history.css.js";
22
- import P from "../static/styles/components/wide-panel.css.js";
23
- import x from "../static/styles/variables.css.js";
24
- function r(t, o) {
25
- return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
8
+ import d from "../static/styles/components/amp-block.css.js";
9
+ import u from "../static/styles/components/base-input.css.js";
10
+ import h from "../static/styles/components/button-group.css.js";
11
+ import I from "../static/styles/components/button.css.js";
12
+ import g from "../static/styles/components/combobox.css.js";
13
+ import w from "../static/styles/components/counter.css.js";
14
+ import y from "../static/styles/components/dropdown-menu.css.js";
15
+ import A from "../static/styles/components/loader.css.js";
16
+ import $ from "../static/styles/components/narrow-panel.css.js";
17
+ import b from "../static/styles/components/popup.css.js";
18
+ import B from "../static/styles/components/recommendation-strategy.css.js";
19
+ import D from "../static/styles/components/skeleton.css.js";
20
+ import R from "../static/styles/components/switcher.css.js";
21
+ import P from "../static/styles/components/tabs.css.js";
22
+ import T from "../static/styles/components/tools.css.js";
23
+ import x from "../static/styles/components/version-history.css.js";
24
+ import M from "../static/styles/components/wide-panel.css.js";
25
+ import O from "../static/styles/variables.css.js";
26
+ function o(i, r) {
27
+ return `--guido-icon-${i}: url("data:image/svg+xml,${encodeURIComponent(r.trim())}");`;
26
28
  }
27
- const R = `:host {
28
- ${r("line-change", S)}
29
- ${r("line-delete", i)}
30
- ${r("line-plus", n)}
31
- }`, V = [
32
- x,
29
+ const V = `:host {
30
+ ${o("line-change", s)}
31
+ ${o("line-delete", a)}
32
+ ${o("filled-arrow-rising", p)}
33
+ ${o("line-info", f)}
34
+ ${o("line-plus", c)}
35
+ }`, W = [
36
+ O,
33
37
  // Must be on top
34
- R,
35
- p,
38
+ V,
39
+ l,
36
40
  // Must be on top
37
41
  C,
38
- c,
39
- f,
40
- a,
41
- u,
42
- l,
43
42
  d,
43
+ u,
44
44
  h,
45
- g,
46
- y,
47
45
  I,
46
+ g,
48
47
  w,
49
- B,
50
- $,
48
+ y,
51
49
  A,
52
- P,
50
+ $,
53
51
  b,
54
- s
52
+ D,
53
+ R,
54
+ P,
55
+ T,
56
+ x,
57
+ M,
58
+ B
59
+ // Last: overrides button.css / wide-panel.css defaults
55
60
  ].join(`
56
61
 
57
- `), _ = () => ({ importCss: () => {
58
- const o = new CSSStyleSheet();
59
- o.replaceSync(V);
60
- const e = document.querySelector("ui-editor");
61
- if (!e)
62
- return;
63
- const m = e.shadowRoot;
64
- m && (m.adoptedStyleSheets = [o]);
62
+ `), _ = 3e4;
63
+ let e = null;
64
+ function k() {
65
+ return e || (e = new CSSStyleSheet(), e.replaceSync(W)), e;
66
+ }
67
+ const po = () => ({ importCss: () => {
68
+ const r = k(), S = Date.now() + _, n = () => {
69
+ var m;
70
+ const t = (m = document.querySelector("ui-editor")) == null ? void 0 : m.shadowRoot;
71
+ if (t) {
72
+ t.adoptedStyleSheets.includes(r) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, r]);
73
+ return;
74
+ }
75
+ Date.now() < S && requestAnimationFrame(n);
76
+ };
77
+ n();
65
78
  } });
66
79
  export {
67
- _ as useCustomInterfaceAppearance
80
+ po as useCustomInterfaceAppearance
68
81
  };